etudes 23.4.1 → 23.4.2

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.
package/build/etudes.js CHANGED
@@ -4428,9 +4428,9 @@ process.env.NODE_ENV === "development" && (wa.displayName = "WithTooltip");
4428
4428
  function Fl(e, { element: r, isEnabled: i = !0 } = {}) {
4429
4429
  Ae(() => {
4430
4430
  if (!i) return;
4431
- const a = r ?? window.document.documentElement, c = a.classList;
4432
- return a.classList.add(e), () => {
4433
- c.contains(e) || a.classList.remove(e);
4431
+ const a = r ?? window.document.documentElement, c = a.classList.contains(e);
4432
+ return c || a.classList.add(e), () => {
4433
+ c || a.classList.remove(e);
4434
4434
  };
4435
4435
  }, [e, r, i]);
4436
4436
  }
@@ -3,7 +3,7 @@
3
3
  <%s {...props} />
4
4
  React keys must be passed directly to JSX without using spread:
5
5
  let props = %s;
6
- <%s key={someKey} {...props} />`,$,de,Ne,de),z[de+$]=!0)}if(de=null,ee!==void 0&&(i(ee),de=""+ee),d(J)&&(i(J.key),de=""+J.key),"key"in J){ee={};for(var ne in J)ne!=="key"&&(ee[ne]=J[ne])}else ee=J;return de&&g(ee,typeof I=="function"?I.displayName||I.name||"Unknown":I),b(I,de,ee,c(),pe,ve)}function _(I){P(I)?I._store&&(I._store.validated=1):typeof I=="object"&&I!==null&&I.$$typeof===U&&(I._payload.status==="fulfilled"?P(I._payload.value)&&I._payload.value._store&&(I._payload.value._store.validated=1):I._store&&(I._store.validated=1))}function P(I){return typeof I=="object"&&I!==null&&I.$$typeof===M}var R=N,M=Symbol.for("react.transitional.element"),T=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),Z=Symbol.for("react.strict_mode"),q=Symbol.for("react.profiler"),W=Symbol.for("react.consumer"),K=Symbol.for("react.context"),x=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),E=Symbol.for("react.suspense_list"),L=Symbol.for("react.memo"),U=Symbol.for("react.lazy"),Q=Symbol.for("react.activity"),ie=Symbol.for("react.client.reference"),te=R.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,B=Object.prototype.hasOwnProperty,F=Array.isArray,X=console.createTask?console.createTask:function(){return null};R={react_stack_bottom_frame:function(I){return I()}};var oe,ae={},ue=R.react_stack_bottom_frame.bind(R,u)(),Y=X(a(u)),z={};ht.Fragment=j,ht.jsx=function(I,J,ee){var $=1e4>te.recentlyCreatedOwnerStacks++;return C(I,J,ee,!1,$?Error("react-stack-top-frame"):ue,$?X(a(I)):Y)},ht.jsxs=function(I,J,ee){var $=1e4>te.recentlyCreatedOwnerStacks++;return C(I,J,ee,!0,$?Error("react-stack-top-frame"):ue,$?X(a(I)):Y)}})()),ht}var zr;function Wi(){return zr||(zr=1,process.env.NODE_ENV==="production"?Dt.exports=Ki():Dt.exports=Gi()),Dt.exports}var w=Wi();function Fr(e){var r,i,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var c=e.length;for(r=0;r<c;r++)e[r]&&(i=Fr(e[r]))&&(a&&(a+=" "),a+=i)}else for(i in e)e[i]&&(a&&(a+=" "),a+=i);return a}function ce(){for(var e,r,i=0,a="",c=arguments.length;i<c;i++)(e=arguments[i])&&(r=Fr(e))&&(a&&(a+=" "),a+=r);return a}function gt({count:e=1,children:r,render:i}){return w.jsx(w.Fragment,{children:[...Array(e)].map((a,c)=>w.jsx(N.Fragment,{children:i?.(c)??(typeof r=="function"?r(c):r)},`element-${c}`))})}process.env.NODE_ENV==="development"&&(gt.displayName="Repeat");function Bt(e,r={},...i){const{className:a,style:c,...u}=r,{className:d,style:g,...m}=e.props;return N.cloneElement(e,{className:`${d??""} ${a??""}`.split(" ").filter(Boolean).join(" ")||void 0,style:{...g??{},...c??{}},...m,...u},...i)}function me({children:e,element:r,...i}){return Bt(r,i,...e?Array.isArray(e)?e:[e]:[])}process.env.NODE_ENV==="development"&&(me.displayName="Styled");function Ji(e){return e}function Pe(e,r={}){const i=Object.keys(r),a=Object.values(r),c={};return N.Children.forEach(e,u=>{if(u==null)return;if(!N.isValidElement(u)){console.error("[etudes::asComponentDict] Invalid child detected");return}const d=a.indexOf(u.type);if(d<0){console.error(`[etudes::asComponentDict] Unsupported child, only the following children are allowed: ${a.map(m=>m.displayName??m.name).join(", ")}`);return}const g=i[d];if(c[g]){console.error(`[etudes::asComponentDict] Only one ${a[d]} can be provided as a child`);return}c[g]=u}),c}function Zi(e){return e}function le(...e){return e.reduce((r,i)=>({...r,...i||{}}),{})}const Vr=N.forwardRef(({children:e,className:r,isActive:i=!1,isTailHidden:a=!1,isSplit:c=!1,numberOfBars:u=3,...d},g)=>{const m=Pe(e,{bar:Ht}),b={root:ce({active:i}),bar:ce({active:i})},C=Qi({isSplit:c,isActive:i,isTailHidden:a});return w.jsx("div",{...d,ref:g,className:ce(r,b.root),children:w.jsx(gt,{count:c?2:1,children:_=>w.jsx("div",{"aria-hidden":!0,style:le(C.section,C[`section${_}`]),children:w.jsx(gt,{count:u,children:P=>w.jsx(me,{"aria-hidden":!0,className:ce(b.bar),element:m.bar??w.jsx(Ht,{}),style:u===2?le(C.bar,C[`bar${_}${P===0?0:2}`]):le(C.bar,C[`bar${_}${P}`])})})})})})}),Ht=({...e})=>w.jsx("span",{...e}),Ln=Object.assign(Vr,{Bar:Ht});function Qi({isActive:e=!1,isSplit:r=!1,isTailHidden:i=!1}){return{section:{height:"100%",position:"absolute",width:r?"50%":"100%"},section0:{left:"0",top:"0"},section1:{right:"0",top:"0"},bar:{margin:"0",padding:"0",position:"absolute",width:"100%"},bar00:{left:"0",top:e?"50%":"0",transform:e?"translate(0, -50%) rotate(45deg)":"translate(0, 0) rotate(0deg)",transformOrigin:r?"right center":"center"},bar01:{left:"0",top:"50%",transform:e?"translate(0, -50%) scale(0)":"translate(0, -50%) scale(1)",transformOrigin:r?"right center":"center"},bar02:{left:"0",top:e?"50%":"100%",transform:e?"translate(0, -50%) rotate(-45deg)":"translate(0, -100%) rotate(0deg)",transformOrigin:r?"right center":"center",width:e||r?"100%":`${i?"50%":"100%"}`},bar10:{left:"0",top:e?"50%":"0",transform:e?"translate(0, -50%) rotate(-45deg)":"translate(0, 0) rotate(0deg)",transformOrigin:"left center"},bar11:{left:"0",top:"50%",transform:e?"translate(0, -50%) scale(0)":"translate(0, -50%) scale(1)",transformOrigin:"left center"},bar12:{left:"0",top:e?"50%":"100%",transform:e?"translate(0, -50%) rotate(45deg)":"translate(0, -100%) rotate(0deg)",transformOrigin:"left center",width:i&&!e?"0":"100%"}}}process.env.NODE_ENV==="development"&&(Vr.displayName="Burger",Ht.displayName="Burger.Bar");const Dr=N.forwardRef(({children:e,className:r,style:i,isActive:a=!1,isTailHidden:c=!1,isSplit:u=!1,numberOfBars:d=3,onActivate:g,onDeactivate:m,onToggle:b,...C},_)=>{const P=()=>{const T=!a;b?.(T),T?g?.():m?.()},R={root:ce({active:a})},M=qi();return w.jsx("button",{...C,ref:_,"aria-expanded":a,className:ce(r,R.root),style:le(i,M.root),onClick:P,children:w.jsx(Ln,{isActive:a,isSplit:u,isTailHidden:c,numberOfBars:d,children:e})})}),Br=Ln.Bar,$i=Object.assign(Dr,{Bar:Br});function qi(){return{root:{background:"transparent",border:"none",display:"block",outline:"none"}}}process.env.NODE_ENV==="development"&&(Dr.displayName="BurgerButton",Br.displayName="BurgerButton.Bar");var Se;(e=>{e.zero=r();function r(T=0,j=0){if(typeof T=="number")return{x:T,y:j};if(!P(T))throw Error("Invalid parameters passed to constructor");return T instanceof Array?{x:T[0],y:T[1]}:{x:T.x,y:T.y}}e.make=r;function i(T,j={}){return r({x:typeof j.x=="number"?j.x:T.x,y:typeof j.y=="number"?j.y:T.y})}e.clone=i;function a(T,j){return r({x:T.x+j.x,y:T.y+j.y})}e.add=a;function c(T,j){return r({x:T.x-j.x,y:T.y-j.y})}e.subtract=c;function u(T,j){return r({x:T.x*j.x,y:T.y*j.y})}e.multiply=u;function d(T,j){return r({x:T.x/j.x,y:T.y/j.y})}e.divide=d;function g(T){return r({x:T.y,y:T.x})}e.reflect=g;function m(T,j){return!(T.x!==j.x||T.y!==j.y)}e.isEqual=m;function b(T){return`Point(x=${T.x}, y=${T.y})`}e.toString=b;function C(T){return Object.freeze({x:T.x,y:T.y})}e.toJSON=C;function _(T){return[T.x,T.y]}e.toArray=_;function P(T){return T instanceof Array?!(T.length!==2||typeof T[0]!="number"||typeof T[1]!="number"):typeof T=="object"?!(typeof T.x!="number"||typeof T.y!="number"):!1}e.isValidDescriptor=P;function R(T){return typeof T=="object"&&typeof T.x=="number"&&typeof T.y=="number"}e.isPoint=R;function M(T){return T.x===0&&T.y===0}e.isZero=M})(Se||(Se={}));function es(e,r){try{const i=Se.isValidDescriptor(e)&&Se.make(e),a=Se.isValidDescriptor(r)&&Se.make(r);if(i&&!a){const c=r instanceof Array?r:[r],u=c.length;for(let d=0;d<u;d++){const g=xe.from(c[d]);if(!g)continue;const m=i.x>=g.left&&i.x<=g.right,b=i.y>=g.top&&i.y<=g.bottom;if(m&&b)return!0}return!1}else if(!i&&a){const c=e instanceof Array?e:[e],u=c.length;for(let d=0;d<u;d++){const g=xe.from(c[d]);if(!g)continue;const m=a.x>=g.left&&a.x<=g.right,b=a.y>=g.top&&a.y<=g.bottom;if(m&&b)return!0}return!1}else{if(i&&a)return Se.isEqual(i,a);{const c=[...e instanceof Array?e:[e],...r instanceof Array?r:[r]],u=xe.intersecting.apply(null,c);return u?u.width*u.height!==0:!1}}}catch(i){return console.error(i),!1}}var ke;(e=>{e.zero=r();function r(T=0,j=0){if(typeof T=="number")return{width:T,height:j};if(!P(T))throw Error("Invalid parameters passed to constructor");return T instanceof Array?{width:T[0],height:T[1]}:{width:T.width,height:T.height}}e.make=r;function i(T,j={}){return r({width:typeof j.width=="number"?j.width:T.width,height:typeof j.height=="number"?j.height:T.height})}e.clone=i;function a(T,j){return r({width:T.width+j.width,height:T.height+j.height})}e.add=a;function c(T,j){return r({width:T.width-j.width,height:T.height-j.height})}e.subtract=c;function u(T,j){return r({width:T.width*j.width,height:T.height*j.height})}e.multiply=u;function d(T,j){return r({width:T.width/j.width,height:T.height/j.height})}e.divide=d;function g(T){return r({width:T.height,height:T.width})}e.rotate=g;function m(T,j){return!(T.width!==j.width||T.height!==j.height)}e.isEqual=m;function b(T){return`Size(width=${T.width}, height=${T.height})`}e.toString=b;function C(T){return Object.freeze({width:T.width,height:T.height})}e.toJSON=C;function _(T){return[T.width,T.height]}e.toArray=_;function P(T){return T instanceof Array?!(T.length!==2||typeof T[0]!="number"||typeof T[1]!="number"):typeof T=="object"?!(typeof T.width!="number"||typeof T.height!="number"):!1}e.isValidDescriptor=P;function R(T){return typeof T=="object"&&typeof T.width=="number"&&typeof T.height=="number"}e.isSize=R;function M(T){return T.width===0&&T.height===0}e.isZero=M})(ke||(ke={}));var xe;(e=>{e.zero=r();function r(x=0,O=0,E=0,L=0){if(typeof x=="number"&&typeof O=="number"){const U=x,Q=O;return{top:Q,right:U+E,bottom:Q+L,left:U,width:E,height:L}}else if(Se.isPoint(x)&&ke.isSize(O)){const U=x,Q=O;return{top:U.y,right:U.x+Q.width,bottom:U.y+Q.height,left:U.x,width:Q.width,height:Q.height}}else{const U=x;if(!q(U))throw Error("Invalid parameters passed to constructor");return{top:U.y,right:U.x+U.width,bottom:U.y+U.height,left:U.x,width:U.width,height:U.height}}}e.make=r;function i(x){return Se.make({x:(x.right-x.left)/2+x.left,y:(x.bottom-x.top)/2+x.top})}e.center=i;function a(x){return ke.make({width:x.width,height:x.height})}e.size=a;function c(x,O={}){try{if(x==null)return e.zero;if(W(x))return x;if(mt(x))return c(document.documentElement||document.body.parentNode||document.body,O);const E=x instanceof Array?x:[x],L=E.length,U=O.reference||window,Q=u(),ie=mt(U)?Q:c(O.reference);if(!Q||!ie)return e.zero;let te;for(let B=0;B<L;B++){const F=E[B],X=F.getBoundingClientRect(),oe=r({x:X.left+Q.left-(mt(U)?0:ie.left),y:X.top+Q.top-(mt(U)?0:ie.top),width:O.overflow?F.scrollWidth:F instanceof HTMLElement?F.offsetWidth:X.width,height:O.overflow?F.scrollHeight:F instanceof HTMLElement?F.offsetHeight:X.height});te=te?P(te,oe):oe}return te??e.zero}catch(E){return console.error(E),e.zero}}e.from=c;function u(){const x=Math.max(document.documentElement.clientWidth,window.innerWidth||0),O=Math.max(document.documentElement.clientHeight,window.innerHeight||0),E=window.pageXOffset!==void 0?window.pageXOffset:(document.documentElement||document.body.parentNode||document.body).scrollLeft,L=window.pageYOffset!==void 0?window.pageYOffset:(document.documentElement||document.body.parentNode||document.body).scrollTop;return r({x:E,y:L,width:x,height:O})}e.fromViewport=u;function d(x,O={}){return x?mt(x)?c(Array.from(document.body.children)):c(Array.from(x.children),{overflow:O.overflow,reference:O.reference||x}):e.zero}e.fromChildrenOf=d;function g(x,O,E={}){if(!O)return e.zero;const L=Array.from(O.children);return x<=0?r():x>=L.length?c(L,{reference:E.reference,overflow:!1}):(L.splice(x),c(L,{reference:E.reference||O,overflow:!1}))}e.fromChildrenBefore=g;function m(x,O,E={}){if(!O)return e.zero;const L=Array.from(O.children);return x<0?c(L,{reference:E.reference,overflow:!1}):x>=L.length-1?r():(L.splice(0,L.length-x-1),c(L,{reference:E.reference||O,overflow:!1}))}e.fromChildrenAfter=m;function b(x,O,E={}){if(!O)return e.zero;const L=O.children[x];return c(L,{overflow:E.overflow,reference:E.reference||O})}e.fromChildAt=b;function C(...x){try{const O=x.length,E={};let L,U;for(let Q=0;Q<O;Q++){if(L||(L=c(x[Q])),Q===0&&Q+1===O)U=u();else if(Q+1<O)U=c(x[Q+1]);else break;!L||!U||(E.width=Math.max(0,Math.min(L.right,U.right)-Math.max(L.left,U.left)),E.height=Math.max(0,Math.min(L.bottom,U.bottom)-Math.max(L.top,U.top)),E.y=Math.max(L.top,U.top),E.x=Math.max(L.left,U.left),E.width*E.height===0&&(E.width=0,E.height=0,E.y=NaN,E.x=NaN),L=r(E))}return r(E)}catch(O){return console.error(O),e.zero}}e.intersecting=C;function _(x,O={}){return r({x:typeof O.x=="number"?O.x:x.left,y:typeof O.y=="number"?O.y:x.top,width:typeof O.width=="number"?O.width:x.width,height:typeof O.height=="number"?O.height:x.height})}e.clone=_;function P(x,O){return r({x:Math.min(x.left,O.left),y:Math.min(x.top,O.top),width:Math.max(x.right,O.right)-Math.min(x.left,O.left),height:Math.max(x.bottom,O.bottom)-Math.min(x.top,O.top)})}e.concat=P;function R(x){return r({x:x.left,y:x.top,width:x.height,height:x.width})}e.rotate=R;function M(x,O){return!(x.top!==O.top||x.right!==O.right||x.bottom!==O.bottom||x.left!==O.left||x.width!==O.width||x.height!==O.height)}e.isEqual=M;function T(x,O){return es(O,x)}e.contains=T;function j(x){return`Rect(top=${x.top}, right=${x.right}, bottom=${x.bottom}, left=${x.left}, width=${x.width}, height=${x.height})`}e.toString=j;function Z(x){return Object.freeze({top:x.top,right:x.right,bottom:x.bottom,left:x.left,width:x.width,height:x.height})}e.toJSON=Z;function q(x){return!(typeof x.x!="number"||typeof x.y!="number"||typeof x.width!="number"||typeof x.height!="number")}e.isValidDescriptor=q;function W(x){return typeof x=="object"&&typeof x.top=="number"&&typeof x.right=="number"&&typeof x.bottom=="number"&&typeof x.left=="number"&&typeof x.width=="number"&&typeof x.height=="number"}e.isRect=W;function K(x){return x.top===0&&x.right===0&&x.bottom===0&&x.left===0&&x.width===0&&x.height===0}e.isZero=K})(xe||(xe={}));function mt(e){return e===window}function Ee(e){const r=N.useRef(e);return N.useEffect(()=>{r.current=e},[e]),r}function Hr(e,{onChange:r}){const i=Ee(r);N.useLayoutEffect(()=>{const a=e?.current;if(!a)return;const c=new IntersectionObserver(u=>{for(const d of u)if(d.target===a){i.current?.(a);break}});return c.observe(a),()=>{c.disconnect()}},[e?.current])}function Yt(e,{onResize:r}){const i=Ee(r);N.useLayoutEffect(()=>{const a=e?.current;if(!a)return;const c=new ResizeObserver(()=>{i.current?.(a)});return c.observe(a),()=>{c.disconnect()}},[e?.current])}function Yr(){const[e,r]=N.useState(ke.zero);return N.useLayoutEffect(()=>{const i=()=>{const a=xe.size(xe.fromViewport());r(a)};return window.addEventListener("resize",i),i(),()=>{window.removeEventListener("resize",i)}},[]),e}function Be(e){const[r,i]=N.useState(xe.zero),a=Yr();return Yt(e,{onResize:c=>{const u=xe.from(c);i(u)}}),Hr(e,{onChange:c=>{const u=xe.from(c);i(u)}}),N.useLayoutEffect(()=>{const c=e?.current,u=xe.from(c);i(u)},[ke.toString(a)]),r}D.ImageSource=void 0,(e=>{function r(u){try{return i(u),{media:u.media,sizes:c(u),srcSet:a(u),type:u.type}}catch(d){console.error(`[etudes:ImageSource] ${d}`);return}}e.asProps=r;function i({sizes:u=[],srcSet:d}){if(u.length>0&&!d.some(({width:g})=>g!==void 0))throw Error("If `sizes` is specified, at least one entry in `sourceSet` must have a `width` specified");if(u.length>0&&u[u.length-1].media!==void 0)throw Error("The last item in `sizes` must not have a `media` condition");if(d.length===0)throw Error("At least one entry in `sourceSet` must be specified");d.forEach(({src:g,width:m,pixelDensity:b})=>{if(g===void 0||g==="")throw Error("Each entry in `sourceSet` must have a non-empty `src`");if(m!==void 0&&(!isFinite(m)||!Number.isInteger(m)||m<=0))throw Error("If `width` is specified, it must be a positive integer greater than 0");if(b!==void 0&&(!isFinite(b)||b<=0))throw Error("If `pixelDensity` is specified, it must be a number greater than 0");if(m!==void 0&&b!==void 0)throw Error("Only one of `width` or `pixelDensity` can be specified")})}function a(u){return u.srcSet.map(({pixelDensity:d,src:g,width:m})=>{let b=g;return m!==void 0?b+=` ${m}w`:d!==void 0&&(b+=` ${d}x`),b}).filter(Boolean).join(", ")}function c(u){return u.sizes?.map(({media:d,width:g})=>{let m=g;return d&&(m=`${d} ${m}`),m}).filter(Boolean).join(", ")}})(D.ImageSource||(D.ImageSource={}));function Xr({src:e,srcSet:r,sizes:i},{onLoadStart:a,onLoadComplete:c,onLoadError:u}={}){const d=N.useRef(void 0),g=Ee(a),m=Ee(c),b=Ee(u);N.useLayoutEffect(()=>{let C=!1;const _=M=>{if(C)return;const T=M.currentTarget;m.current?.(T)},P=M=>{if(C)return;const T=M.currentTarget;b.current?.(T)},R=new Image;return R.addEventListener("load",_),R.addEventListener("error",P),g.current?.(R),r&&(R.srcset=r),i&&(R.sizes=i),R.src=e,d.current=R,()=>{C=!0,R.removeEventListener("load",_),R.removeEventListener("error",P),d.current=void 0}},[e,r,i])}function zn({src:e,srcSet:r,sizes:i},{preservesSizeBetweenLoads:a=!0,onLoadStart:c,onLoadComplete:u,onLoadError:d}={}){const[g,m]=N.useState(),b=Ee(c),C=Ee(u),_=Ee(d),P=N.useCallback(T=>{a||m(void 0),b.current?.(T)},[a]),R=N.useCallback(T=>{m(ts(T)),C.current?.(T)},[]),M=N.useCallback(T=>{a||m(void 0),_.current?.(T)},[a]);return Xr({src:e,srcSet:r,sizes:i},{onLoadStart:P,onLoadComplete:R,onLoadError:M}),g}function ts(e){if(e&&typeof e.width=="number"&&typeof e.height=="number")return ke.make(e.width,e.height)}const Fn=N.forwardRef(({alt:e,source:r,loadingMode:i,src:a,onLoadStart:c,onLoadComplete:u,onLoadError:d,onSizeChange:g,...m},b)=>{const C=r?D.ImageSource.asProps(r):void 0,_=zn({src:a,srcSet:C?.srcSet,sizes:C?.sizes},{onLoadStart:c,onLoadComplete:u,onLoadError:d});return N.useEffect(()=>{g?.(_)},[_?.width,_?.height]),w.jsx("img",{...m,...C,ref:b,alt:e,loading:i,src:a})});process.env.NODE_ENV==="development"&&(Fn.displayName="Image");const Vn=N.forwardRef(({alt:e,loadingMode:r,sources:i=[],src:a,onLoadComplete:c,onLoadError:u,onLoadStart:d,onSizeChange:g,...m},b)=>w.jsxs("picture",{...m,ref:b,children:[i.map((C,_)=>w.jsx("source",{...D.ImageSource.asProps(C)},_)),w.jsx(Fn,{alt:e,loadingMode:r,src:a,style:{width:"100%",height:"100%"},onLoadComplete:c,onLoadError:u,onLoadStart:d,onSizeChange:g})]}));process.env.NODE_ENV==="development"&&(Vn.displayName="Picture");const Ur=N.forwardRef(({children:e,alt:r,aspectRatio:i=NaN,sources:a,loadingMode:c,src:u,style:d,onLoadStart:g,onLoadComplete:m,onLoadError:b,...C},_)=>{const P=O=>{j(O?O.width/O.height:NaN)},R=N.useRef(null),M=_??R,[T,j]=N.useState(NaN),Z=isNaN(i)?T:i,q=Be(M),W=q.width/q.height,K=ke.make(W>1?Math.max(q.width,q.height*Z):Math.max(q.width,Math.max(q.height,q.width/Z)*Z),W>1?Math.max(q.height,Math.max(q.width,q.height*Z)/Z):Math.max(q.height,q.width/Z)),x=Pe(e,{content:Xt,viewport:Ut});return w.jsxs("div",{...C,ref:M,style:le(d,Dn.root),children:[w.jsx(Vn,{alt:r,sources:a,src:u,style:le(Dn.viewport,{height:`${K.height}px`,maxWidth:"unset",width:`${K.width}px`}),onLoadComplete:m,onLoadError:b,onLoadStart:g,onSizeChange:O=>P(O)}),x.viewport&&w.jsx(me,{element:x.viewport,style:le(Dn.viewport,{height:`${K.height}px`,pointerEvents:"none",width:`${K.width}px`})}),x.content]})}),Xt=({children:e,...r})=>w.jsx("div",{...r,children:e}),Ut=({children:e,...r})=>w.jsx("div",{...r,children:e}),ns=Object.assign(Ur,{Content:Xt,Viewport:Ut}),Dn={root:{overflow:"hidden"},viewport:{left:"50%",position:"absolute",top:"50%",transform:"translate(-50%, -50%)"}};process.env.NODE_ENV==="development"&&(Ur.displayName="CoverImage",Xt.displayName="CoverImage.Content",Ut.displayName="CoverImage.Viewport");function Kr(e,{onLoadStart:r,onLoadComplete:i,onLoadError:a}={}){const c=Ee(r),u=Ee(i),d=Ee(a);N.useLayoutEffect(()=>{if(!e)return;const g=window.document.createElement("video"),m=()=>u.current?.(g),b=()=>d.current?.(g);return g.addEventListener("loadedmetadata",m),g.addEventListener("error",b),g.src=e,c.current?.(g),()=>{g.removeEventListener("loadedmetadata",m),g.removeEventListener("error",b),g.src=""}},[e])}function Gr(e,{preservesSizeBetweenLoads:r=!0,onLoadStart:i,onLoadComplete:a,onLoadError:c}={}){const[u,d]=N.useState(),g=Ee(i),m=Ee(a),b=Ee(c),C=N.useCallback(R=>{r||d(void 0),g.current?.(R)},[r]),_=N.useCallback(R=>{d(rs(R)),m.current?.(R)},[]),P=N.useCallback(R=>{r||d(void 0),b.current?.(R)},[r]);return Kr(e,{onLoadStart:C,onLoadComplete:_,onLoadError:P}),u}function rs(e){if(e&&typeof e.videoWidth=="number"&&typeof e.videoHeight=="number")return ke.make(e.videoWidth,e.videoHeight)}const Bn=N.forwardRef(({autoLoop:e=!0,autoPlay:r=!0,hasControls:i=!1,isMuted:a=!0,playsInline:c=!0,posterSrc:u,src:d,onCanPlay:g,onEnd:m,onFullscreenChange:b,onLoadMetadata:C,onLoadMetadataComplete:_,onLoadMetadataError:P,onPause:R,onPlay:M,onSizeChange:T,onTimeUpdate:j,...Z},q)=>{const W=N.useRef(null),K=q??W,x=Gr(d,{onLoadStart:C,onLoadComplete:_,onLoadError:P});N.useEffect(()=>{if(!K.current)return;if(d.toLowerCase().endsWith(".m3u8")){const F=!!K.current.canPlayType("application/x-mpegURL"),X=typeof window.Hls<"u"?window.Hls:void 0;if(!F&&X?.isSupported()){const oe=new X;oe.loadSource(d),oe.attachMedia(K.current)}}const B=F=>{const X=window.document.fullScreen||window.document.mozFullScreen||window.document.webkitIsFullScreen;X!==void 0&&b?.(X)};return K.current.muted=a,K.current.load(),K.current.addEventListener("webkitfullscreenchange",B),K.current.addEventListener("mozfullscreenchange",B),K.current.addEventListener("fullscreenchange",B),()=>{te(),K.current?.removeEventListener("webkitfullscreenchange",B),K.current?.removeEventListener("mozfullscreenchange",B),K.current?.removeEventListener("fullscreenchange",B)}},[d]),N.useEffect(()=>{T?.(x)},[x]);const O=B=>{const F=B.currentTarget;r&&F.paused&&ie(),g?.()},E=B=>{M?.()},L=B=>{R?.()},U=B=>{m?.()},Q=B=>{const F=B.currentTarget;j?.(F.currentTime,F.duration)},ie=()=>{K.current&&K.current.play()},te=()=>{K.current&&K.current.pause()};return w.jsx("video",{...Z,ref:K,autoPlay:r,controls:i,loop:e,muted:a,playsInline:c,poster:u,onCanPlay:O,onEnded:U,onPause:L,onPlay:E,onTimeUpdate:Q,children:w.jsx("source",{src:d})})});process.env.NODE_ENV==="development"&&(Bn.displayName="Video");const Wr=N.forwardRef(({className:e,children:r,style:i,aspectRatio:a=NaN,autoLoop:c,autoPlay:u,hasControls:d,isMuted:g,playsInline:m,posterSrc:b,src:C,onCanPlay:_,onEnd:P,onFullscreenChange:R,onLoadMetadata:M,onLoadMetadataComplete:T,onLoadMetadataError:j,onPause:Z,onPlay:q,onSizeChange:W,...K},x)=>{const O=X=>{Q(X?X.width/X.height:NaN),W?.(X)},E=x??N.useRef(null),L=Be(E),[U,Q]=N.useState(NaN),ie=isNaN(a)?U:a,te=L.width/L.height,B=ke.make(te>1?Math.max(L.width,L.height*ie):Math.max(L.width,Math.max(L.height,L.width/ie)*ie),te>1?Math.max(L.height,Math.max(L.width,L.height*ie)/ie):Math.max(L.height,L.width/ie)),F=Pe(r,{content:Hn,viewport:Yn});return w.jsxs("div",{...K,ref:E,className:e,style:le(i,Xn.root),children:[w.jsx(Bn,{autoLoop:c,autoPlay:u,hasControls:d,isMuted:g,playsInline:m,posterSrc:b,src:C,style:le(Xn.viewport,{width:`${B.width}px`,height:`${B.height}px`,maxWidth:"unset"}),onCanPlay:_,onEnd:P,onFullscreenChange:R,onLoadMetadata:M,onLoadMetadataComplete:T,onLoadMetadataError:j,onPause:Z,onPlay:q,onSizeChange:X=>O(X)}),F.viewport&&w.jsx(me,{element:F.viewport,style:le(Xn.viewport,{height:`${B.height}px`,pointerEvents:"none",width:`${B.width}px`})}),F.content]})}),Hn=({children:e,...r})=>w.jsx("div",{...r,children:e}),Yn=({children:e,...r})=>w.jsx("div",{...r,children:e}),os=Object.assign(Wr,{Content:Hn,Viewport:Yn}),Xn={root:{overflow:"hidden"},viewport:{left:"50%",position:"absolute",top:"50%",transform:"translate(-50%, -50%)"}};process.env.NODE_ENV==="development"&&(Wr.displayName="CoverVideo",Hn.displayName="CoverVideo.Content",Yn.displayName="CoverVideo.Viewport");const Un=N.forwardRef((e,r)=>{switch(!0){case is(e):{const{action:i,children:a,className:c,isDisabled:u,label:d,opensInNewTab:g,...m}=e;return w.jsx("a",{...m,...u?{"aria-disabled":!0}:{},ref:r,"aria-label":d,className:ce(c,{disabled:u}),href:i,rel:g?"noopener,noreferrer":void 0,target:g?"_blank":void 0,children:a??d})}case ss(e):{const{action:i,children:a,className:c,isDisabled:u,label:d,type:g="button",...m}=e;return w.jsx("button",{...m,...u?{"aria-disabled":!0}:{},ref:r,"aria-label":d,className:c,disabled:u,type:g,onClick:i,children:a??d})}default:console.error("[etudes::Button] Unknown button type");return}});function is(e){return typeof e.action=="string"}function ss(e){return typeof e.action=="function"||typeof e.type=="string"}process.env.NODE_ENV==="development"&&(Un.displayName="Button");const Jr=N.forwardRef(({index:e=0,isDisabled:r=!1,options:i,onChange:a,...c},u)=>{const d=i.length-1,g=i[e],m=typeof g=="string"?g:g?.label,b=N.useCallback(()=>{if(r)return;const C=e<d?e+1:0,_=i[C],P=typeof _=="string"?_:_?.value;a?.(P,C)},[d,r,e,i,a]);return w.jsx(Un,{...c,ref:u,action:b,isDisabled:r,label:m})});process.env.NODE_ENV==="development"&&(Jr.displayName="OptionButton");var Kn,Zr;function as(){return Zr||(Zr=1,Kn=function e(r,i){if(r===i)return!0;if(r&&i&&typeof r=="object"&&typeof i=="object"){if(r.constructor!==i.constructor)return!1;var a,c,u;if(Array.isArray(r)){if(a=r.length,a!=i.length)return!1;for(c=a;c--!==0;)if(!e(r[c],i[c]))return!1;return!0}if(r.constructor===RegExp)return r.source===i.source&&r.flags===i.flags;if(r.valueOf!==Object.prototype.valueOf)return r.valueOf()===i.valueOf();if(r.toString!==Object.prototype.toString)return r.toString()===i.toString();if(u=Object.keys(r),a=u.length,a!==Object.keys(i).length)return!1;for(c=a;c--!==0;)if(!Object.prototype.hasOwnProperty.call(i,u[c]))return!1;for(c=a;c--!==0;){var d=u[c];if(!(d==="_owner"&&r.$$typeof)&&!e(r[d],i[d]))return!1}return!0}return r!==r&&i!==i}),Kn}var cs=as();const He=Ar(cs);var Kt={exports:{}},ls=Kt.exports,Qr;function us(){return Qr||(Qr=1,(function(e,r){(function(i,a){e.exports=a()})(ls,(function(){function i(n,t){var o=Object.keys(n);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);t&&(s=s.filter((function(l){return Object.getOwnPropertyDescriptor(n,l).enumerable}))),o.push.apply(o,s)}return o}function a(n){for(var t=1;t<arguments.length;t++){var o=arguments[t]!=null?arguments[t]:{};t%2?i(Object(o),!0).forEach((function(s){m(n,s,o[s])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):i(Object(o)).forEach((function(s){Object.defineProperty(n,s,Object.getOwnPropertyDescriptor(o,s))}))}return n}function c(n){return c=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},c(n)}function u(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")}function d(n,t){for(var o=0;o<t.length;o++){var s=t[o];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(n,T(s.key),s)}}function g(n,t,o){return t&&d(n.prototype,t),Object.defineProperty(n,"prototype",{writable:!1}),n}function m(n,t,o){return(t=T(t))in n?Object.defineProperty(n,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[t]=o,n}function b(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),t&&_(n,t)}function C(n){return C=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},C(n)}function _(n,t){return _=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,s){return o.__proto__=s,o},_(n,t)}function P(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function R(n){var t=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var o,s=C(n);if(t){var l=C(this).constructor;o=Reflect.construct(s,arguments,l)}else o=s.apply(this,arguments);return(function(f,p){if(p&&(typeof p=="object"||typeof p=="function"))return p;if(p!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return P(f)})(this,o)}}function M(){return M=typeof Reflect<"u"&&Reflect.get?Reflect.get.bind():function(n,t,o){var s=(function(f,p){for(;!Object.prototype.hasOwnProperty.call(f,p)&&(f=C(f))!==null;);return f})(n,t);if(s){var l=Object.getOwnPropertyDescriptor(s,t);return l.get?l.get.call(arguments.length<3?n:o):l.value}},M.apply(this,arguments)}function T(n){var t=(function(o,s){if(typeof o!="object"||o===null)return o;var l=o[Symbol.toPrimitive];if(l!==void 0){var f=l.call(o,s);if(typeof f!="object")return f;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(o)})(n,"string");return typeof t=="symbol"?t:t+""}var j=function(n){return!(!n||!n.Window)&&n instanceof n.Window},Z=void 0,q=void 0;function W(n){Z=n;var t=n.document.createTextNode("");t.ownerDocument!==n.document&&typeof n.wrap=="function"&&n.wrap(t)===t&&(n=n.wrap(n)),q=n}function K(n){return j(n)?n:(n.ownerDocument||n).defaultView||q.window}typeof window<"u"&&window&&W(window);var x=function(n){return!!n&&c(n)==="object"},O=function(n){return typeof n=="function"},E={window:function(n){return n===q||j(n)},docFrag:function(n){return x(n)&&n.nodeType===11},object:x,func:O,number:function(n){return typeof n=="number"},bool:function(n){return typeof n=="boolean"},string:function(n){return typeof n=="string"},element:function(n){if(!n||c(n)!=="object")return!1;var t=K(n)||q;return/object|function/.test(typeof Element>"u"?"undefined":c(Element))?n instanceof Element||n instanceof t.Element:n.nodeType===1&&typeof n.nodeName=="string"},plainObject:function(n){return x(n)&&!!n.constructor&&/function Object\b/.test(n.constructor.toString())},array:function(n){return x(n)&&n.length!==void 0&&O(n.splice)}};function L(n){var t=n.interaction;if(t.prepared.name==="drag"){var o=t.prepared.axis;o==="x"?(t.coords.cur.page.y=t.coords.start.page.y,t.coords.cur.client.y=t.coords.start.client.y,t.coords.velocity.client.y=0,t.coords.velocity.page.y=0):o==="y"&&(t.coords.cur.page.x=t.coords.start.page.x,t.coords.cur.client.x=t.coords.start.client.x,t.coords.velocity.client.x=0,t.coords.velocity.page.x=0)}}function U(n){var t=n.iEvent,o=n.interaction;if(o.prepared.name==="drag"){var s=o.prepared.axis;if(s==="x"||s==="y"){var l=s==="x"?"y":"x";t.page[l]=o.coords.start.page[l],t.client[l]=o.coords.start.client[l],t.delta[l]=0}}}var Q={id:"actions/drag",install:function(n){var t=n.actions,o=n.Interactable,s=n.defaults;o.prototype.draggable=Q.draggable,t.map.drag=Q,t.methodDict.drag="draggable",s.actions.drag=Q.defaults},listeners:{"interactions:before-action-move":L,"interactions:action-resume":L,"interactions:action-move":U,"auto-start:check":function(n){var t=n.interaction,o=n.interactable,s=n.buttons,l=o.options.drag;if(l&&l.enabled&&(!t.pointerIsDown||!/mouse|pointer/.test(t.pointerType)||(s&o.options.drag.mouseButtons)!=0))return n.action={name:"drag",axis:l.lockAxis==="start"?l.startAxis:l.lockAxis},!1}},draggable:function(n){return E.object(n)?(this.options.drag.enabled=n.enabled!==!1,this.setPerAction("drag",n),this.setOnEvents("drag",n),/^(xy|x|y|start)$/.test(n.lockAxis)&&(this.options.drag.lockAxis=n.lockAxis),/^(xy|x|y)$/.test(n.startAxis)&&(this.options.drag.startAxis=n.startAxis),this):E.bool(n)?(this.options.drag.enabled=n,this):this.options.drag},beforeMove:L,move:U,defaults:{startAxis:"xy",lockAxis:"xy"},getCursor:function(){return"move"},filterEventType:function(n){return n.search("drag")===0}},ie=Q,te={init:function(n){var t=n;te.document=t.document,te.DocumentFragment=t.DocumentFragment||B,te.SVGElement=t.SVGElement||B,te.SVGSVGElement=t.SVGSVGElement||B,te.SVGElementInstance=t.SVGElementInstance||B,te.Element=t.Element||B,te.HTMLElement=t.HTMLElement||te.Element,te.Event=t.Event,te.Touch=t.Touch||B,te.PointerEvent=t.PointerEvent||t.MSPointerEvent},document:null,DocumentFragment:null,SVGElement:null,SVGSVGElement:null,SVGElementInstance:null,Element:null,HTMLElement:null,Event:null,Touch:null,PointerEvent:null};function B(){}var F=te,X={init:function(n){var t=F.Element,o=n.navigator||{};X.supportsTouch="ontouchstart"in n||E.func(n.DocumentTouch)&&F.document instanceof n.DocumentTouch,X.supportsPointerEvent=o.pointerEnabled!==!1&&!!F.PointerEvent,X.isIOS=/iP(hone|od|ad)/.test(o.platform),X.isIOS7=/iP(hone|od|ad)/.test(o.platform)&&/OS 7[^\d]/.test(o.appVersion),X.isIe9=/MSIE 9/.test(o.userAgent),X.isOperaMobile=o.appName==="Opera"&&X.supportsTouch&&/Presto/.test(o.userAgent),X.prefixedMatchesSelector="matches"in t.prototype?"matches":"webkitMatchesSelector"in t.prototype?"webkitMatchesSelector":"mozMatchesSelector"in t.prototype?"mozMatchesSelector":"oMatchesSelector"in t.prototype?"oMatchesSelector":"msMatchesSelector",X.pEventTypes=X.supportsPointerEvent?F.PointerEvent===n.MSPointerEvent?{up:"MSPointerUp",down:"MSPointerDown",over:"mouseover",out:"mouseout",move:"MSPointerMove",cancel:"MSPointerCancel"}:{up:"pointerup",down:"pointerdown",over:"pointerover",out:"pointerout",move:"pointermove",cancel:"pointercancel"}:null,X.wheelEvent=F.document&&"onmousewheel"in F.document?"mousewheel":"wheel"},supportsTouch:null,supportsPointerEvent:null,isIOS7:null,isIOS:null,isIe9:null,isOperaMobile:null,prefixedMatchesSelector:null,pEventTypes:null,wheelEvent:null},oe=X;function ae(n,t){if(n.contains)return n.contains(t);for(;t;){if(t===n)return!0;t=t.parentNode}return!1}function ue(n,t){for(;E.element(n);){if(z(n,t))return n;n=Y(n)}return null}function Y(n){var t=n.parentNode;if(E.docFrag(t)){for(;(t=t.host)&&E.docFrag(t););return t}return t}function z(n,t){return q!==Z&&(t=t.replace(/\/deep\//g," ")),n[oe.prefixedMatchesSelector](t)}var I=function(n){return n.parentNode||n.host};function J(n,t){for(var o,s=[],l=n;(o=I(l))&&l!==t&&o!==l.ownerDocument;)s.unshift(l),l=o;return s}function ee(n,t,o){for(;E.element(n);){if(z(n,t))return!0;if((n=Y(n))===o)return z(n,t)}return!1}function $(n){return n.correspondingUseElement||n}function pe(n){var t=n instanceof F.SVGElement?n.getBoundingClientRect():n.getClientRects()[0];return t&&{left:t.left,right:t.right,top:t.top,bottom:t.bottom,width:t.width||t.right-t.left,height:t.height||t.bottom-t.top}}function ve(n){var t,o=pe(n);if(!oe.isIOS7&&o){var s={x:(t=(t=K(n))||q).scrollX||t.document.documentElement.scrollLeft,y:t.scrollY||t.document.documentElement.scrollTop};o.left+=s.x,o.right+=s.x,o.top+=s.y,o.bottom+=s.y}return o}function de(n){for(var t=[];n;)t.push(n),n=Y(n);return t}function Ne(n){return!!E.string(n)&&(F.document.querySelector(n),!0)}function ne(n,t){for(var o in t)n[o]=t[o];return n}function Ve(n,t,o){return n==="parent"?Y(o):n==="self"?t.getRect(o):ue(o,n)}function Ie(n,t,o,s){var l=n;return E.string(l)?l=Ve(l,t,o):E.func(l)&&(l=l.apply(void 0,s)),E.element(l)&&(l=ve(l)),l}function Ce(n){return n&&{x:"x"in n?n.x:n.left,y:"y"in n?n.y:n.top}}function De(n){return!n||"x"in n&&"y"in n||((n=ne({},n)).x=n.left||0,n.y=n.top||0,n.width=n.width||(n.right||0)-n.x,n.height=n.height||(n.bottom||0)-n.y),n}function lt(n,t,o){n.left&&(t.left+=o.x),n.right&&(t.right+=o.x),n.top&&(t.top+=o.y),n.bottom&&(t.bottom+=o.y),t.width=t.right-t.left,t.height=t.bottom-t.top}function nt(n,t,o){var s=o&&n.options[o];return Ce(Ie(s&&s.origin||n.options.origin,n,t,[n&&t]))||{x:0,y:0}}function Oe(n,t){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(v){return!0},s=arguments.length>3?arguments[3]:void 0;if(s=s||{},E.string(n)&&n.search(" ")!==-1&&(n=ut(n)),E.array(n))return n.forEach((function(v){return Oe(v,t,o,s)})),s;if(E.object(n)&&(t=n,n=""),E.func(t)&&o(n))s[n]=s[n]||[],s[n].push(t);else if(E.array(t))for(var l=0,f=t;l<f.length;l++){var p=f[l];Oe(n,p,o,s)}else if(E.object(t))for(var h in t)Oe(ut(h).map((function(v){return"".concat(n).concat(v)})),t[h],o,s);return s}function ut(n){return n.trim().split(/ +/)}var rt=function(n,t){return Math.sqrt(n*n+t*t)},Vc=["webkit","moz"];function Nn(n,t){n.__set||(n.__set={});var o=function(l){if(Vc.some((function(f){return l.indexOf(f)===0})))return 1;typeof n[l]!="function"&&l!=="__set"&&Object.defineProperty(n,l,{get:function(){return l in n.__set?n.__set[l]:n.__set[l]=t[l]},set:function(f){n.__set[l]=f},configurable:!0})};for(var s in t)o(s);return n}function Sn(n,t){n.page=n.page||{},n.page.x=t.page.x,n.page.y=t.page.y,n.client=n.client||{},n.client.x=t.client.x,n.client.y=t.client.y,n.timeStamp=t.timeStamp}function ri(n){n.page.x=0,n.page.y=0,n.client.x=0,n.client.y=0}function oi(n){return n instanceof F.Event||n instanceof F.Touch}function Tn(n,t,o){return n=n||"page",(o=o||{}).x=t[n+"X"],o.y=t[n+"Y"],o}function ii(n,t){return t=t||{x:0,y:0},oe.isOperaMobile&&oi(n)?(Tn("screen",n,t),t.x+=window.scrollX,t.y+=window.scrollY):Tn("page",n,t),t}function It(n){return E.number(n.pointerId)?n.pointerId:n.identifier}function Dc(n,t,o){var s=t.length>1?si(t):t[0];ii(s,n.page),(function(l,f){f=f||{},oe.isOperaMobile&&oi(l)?Tn("screen",l,f):Tn("client",l,f)})(s,n.client),n.timeStamp=o}function dr(n){var t=[];return E.array(n)?(t[0]=n[0],t[1]=n[1]):n.type==="touchend"?n.touches.length===1?(t[0]=n.touches[0],t[1]=n.changedTouches[0]):n.touches.length===0&&(t[0]=n.changedTouches[0],t[1]=n.changedTouches[1]):(t[0]=n.touches[0],t[1]=n.touches[1]),t}function si(n){for(var t={pageX:0,pageY:0,clientX:0,clientY:0,screenX:0,screenY:0},o=0;o<n.length;o++){var s=n[o];for(var l in t)t[l]+=s[l]}for(var f in t)t[f]/=n.length;return t}function pr(n){if(!n.length)return null;var t=dr(n),o=Math.min(t[0].pageX,t[1].pageX),s=Math.min(t[0].pageY,t[1].pageY),l=Math.max(t[0].pageX,t[1].pageX),f=Math.max(t[0].pageY,t[1].pageY);return{x:o,y:s,left:o,top:s,right:l,bottom:f,width:l-o,height:f-s}}function hr(n,t){var o=t+"X",s=t+"Y",l=dr(n),f=l[0][o]-l[1][o],p=l[0][s]-l[1][s];return rt(f,p)}function gr(n,t){var o=t+"X",s=t+"Y",l=dr(n),f=l[1][o]-l[0][o],p=l[1][s]-l[0][s];return 180*Math.atan2(p,f)/Math.PI}function ai(n){return E.string(n.pointerType)?n.pointerType:E.number(n.pointerType)?[void 0,void 0,"touch","pen","mouse"][n.pointerType]:/touch/.test(n.type||"")||n instanceof F.Touch?"touch":"mouse"}function ci(n){var t=E.func(n.composedPath)?n.composedPath():n.path;return[$(t?t[0]:n.target),$(n.currentTarget)]}var _n=(function(){function n(t){u(this,n),this.immediatePropagationStopped=!1,this.propagationStopped=!1,this._interaction=t}return g(n,[{key:"preventDefault",value:function(){}},{key:"stopPropagation",value:function(){this.propagationStopped=!0}},{key:"stopImmediatePropagation",value:function(){this.immediatePropagationStopped=this.propagationStopped=!0}}]),n})();Object.defineProperty(_n.prototype,"interaction",{get:function(){return this._interaction._proxy},set:function(){}});var li=function(n,t){for(var o=0;o<t.length;o++){var s=t[o];n.push(s)}return n},ui=function(n){return li([],n)},jt=function(n,t){for(var o=0;o<n.length;o++)if(t(n[o],o,n))return o;return-1},Rt=function(n,t){return n[jt(n,t)]},ft=(function(n){b(o,n);var t=R(o);function o(s,l,f){var p;u(this,o),(p=t.call(this,l._interaction)).dropzone=void 0,p.dragEvent=void 0,p.relatedTarget=void 0,p.draggable=void 0,p.propagationStopped=!1,p.immediatePropagationStopped=!1;var h=f==="dragleave"?s.prev:s.cur,v=h.element,S=h.dropzone;return p.type=f,p.target=v,p.currentTarget=v,p.dropzone=S,p.dragEvent=l,p.relatedTarget=l.target,p.draggable=l.interactable,p.timeStamp=l.timeStamp,p}return g(o,[{key:"reject",value:function(){var s=this,l=this._interaction.dropState;if(this.type==="dropactivate"||this.dropzone&&l.cur.dropzone===this.dropzone&&l.cur.element===this.target)if(l.prev.dropzone=this.dropzone,l.prev.element=this.target,l.rejected=!0,l.events.enter=null,this.stopImmediatePropagation(),this.type==="dropactivate"){var f=l.activeDrops,p=jt(f,(function(v){var S=v.dropzone,y=v.element;return S===s.dropzone&&y===s.target}));l.activeDrops.splice(p,1);var h=new o(l,this.dragEvent,"dropdeactivate");h.dropzone=this.dropzone,h.target=this.target,this.dropzone.fire(h)}else this.dropzone.fire(new o(l,this.dragEvent,"dragleave"))}},{key:"preventDefault",value:function(){}},{key:"stopPropagation",value:function(){this.propagationStopped=!0}},{key:"stopImmediatePropagation",value:function(){this.immediatePropagationStopped=this.propagationStopped=!0}}]),o})(_n);function fi(n,t){for(var o=0,s=n.slice();o<s.length;o++){var l=s[o],f=l.dropzone,p=l.element;t.dropzone=f,t.target=p,f.fire(t),t.propagationStopped=t.immediatePropagationStopped=!1}}function mr(n,t){for(var o=(function(f,p){for(var h=[],v=0,S=f.interactables.list;v<S.length;v++){var y=S[v];if(y.options.drop.enabled){var k=y.options.drop.accept;if(!(E.element(k)&&k!==p||E.string(k)&&!z(p,k)||E.func(k)&&!k({dropzone:y,draggableElement:p})))for(var A=0,H=y.getAllElements();A<H.length;A++){var V=H[A];V!==p&&h.push({dropzone:y,element:V,rect:y.getRect(V)})}}}return h})(n,t),s=0;s<o.length;s++){var l=o[s];l.rect=l.dropzone.getRect(l.element)}return o}function di(n,t,o){for(var s=n.dropState,l=n.interactable,f=n.element,p=[],h=0,v=s.activeDrops;h<v.length;h++){var S=v[h],y=S.dropzone,k=S.element,A=S.rect,H=y.dropCheck(t,o,l,f,k,A);p.push(H?k:null)}var V=(function(G){for(var se,re,fe,ye=[],we=0;we<G.length;we++){var he=G[we],be=G[se];if(he&&we!==se)if(be){var Ae=I(he),Te=I(be);if(Ae!==he.ownerDocument)if(Te!==he.ownerDocument)if(Ae!==Te){ye=ye.length?ye:J(be);var Le=void 0;if(be instanceof F.HTMLElement&&he instanceof F.SVGElement&&!(he instanceof F.SVGSVGElement)){if(he===Te)continue;Le=he.ownerSVGElement}else Le=he;for(var ze=J(Le,be.ownerDocument),Ue=0;ze[Ue]&&ze[Ue]===ye[Ue];)Ue++;var Mn=[ze[Ue-1],ze[Ue],ye[Ue]];if(Mn[0])for(var Vt=Mn[0].lastChild;Vt;){if(Vt===Mn[1]){se=we,ye=ze;break}if(Vt===Mn[2])break;Vt=Vt.previousSibling}}else fe=be,(parseInt(K(re=he).getComputedStyle(re).zIndex,10)||0)>=(parseInt(K(fe).getComputedStyle(fe).zIndex,10)||0)&&(se=we);else se=we}else se=we}return se})(p);return s.activeDrops[V]||null}function vr(n,t,o){var s=n.dropState,l={enter:null,leave:null,activate:null,deactivate:null,move:null,drop:null};return o.type==="dragstart"&&(l.activate=new ft(s,o,"dropactivate"),l.activate.target=null,l.activate.dropzone=null),o.type==="dragend"&&(l.deactivate=new ft(s,o,"dropdeactivate"),l.deactivate.target=null,l.deactivate.dropzone=null),s.rejected||(s.cur.element!==s.prev.element&&(s.prev.dropzone&&(l.leave=new ft(s,o,"dragleave"),o.dragLeave=l.leave.target=s.prev.element,o.prevDropzone=l.leave.dropzone=s.prev.dropzone),s.cur.dropzone&&(l.enter=new ft(s,o,"dragenter"),o.dragEnter=s.cur.element,o.dropzone=s.cur.dropzone)),o.type==="dragend"&&s.cur.dropzone&&(l.drop=new ft(s,o,"drop"),o.dropzone=s.cur.dropzone,o.relatedTarget=s.cur.element),o.type==="dragmove"&&s.cur.dropzone&&(l.move=new ft(s,o,"dropmove"),o.dropzone=s.cur.dropzone)),l}function yr(n,t){var o=n.dropState,s=o.activeDrops,l=o.cur,f=o.prev;t.leave&&f.dropzone.fire(t.leave),t.enter&&l.dropzone.fire(t.enter),t.move&&l.dropzone.fire(t.move),t.drop&&l.dropzone.fire(t.drop),t.deactivate&&fi(s,t.deactivate),o.prev.dropzone=l.dropzone,o.prev.element=l.element}function pi(n,t){var o=n.interaction,s=n.iEvent,l=n.event;if(s.type==="dragmove"||s.type==="dragend"){var f=o.dropState;t.dynamicDrop&&(f.activeDrops=mr(t,o.element));var p=s,h=di(o,p,l);f.rejected=f.rejected&&!!h&&h.dropzone===f.cur.dropzone&&h.element===f.cur.element,f.cur.dropzone=h&&h.dropzone,f.cur.element=h&&h.element,f.events=vr(o,0,p)}}var hi={id:"actions/drop",install:function(n){var t=n.actions,o=n.interactStatic,s=n.Interactable,l=n.defaults;n.usePlugin(ie),s.prototype.dropzone=function(f){return(function(p,h){if(E.object(h)){if(p.options.drop.enabled=h.enabled!==!1,h.listeners){var v=Oe(h.listeners),S=Object.keys(v).reduce((function(k,A){return k[/^(enter|leave)/.test(A)?"drag".concat(A):/^(activate|deactivate|move)/.test(A)?"drop".concat(A):A]=v[A],k}),{}),y=p.options.drop.listeners;y&&p.off(y),p.on(S),p.options.drop.listeners=S}return E.func(h.ondrop)&&p.on("drop",h.ondrop),E.func(h.ondropactivate)&&p.on("dropactivate",h.ondropactivate),E.func(h.ondropdeactivate)&&p.on("dropdeactivate",h.ondropdeactivate),E.func(h.ondragenter)&&p.on("dragenter",h.ondragenter),E.func(h.ondragleave)&&p.on("dragleave",h.ondragleave),E.func(h.ondropmove)&&p.on("dropmove",h.ondropmove),/^(pointer|center)$/.test(h.overlap)?p.options.drop.overlap=h.overlap:E.number(h.overlap)&&(p.options.drop.overlap=Math.max(Math.min(1,h.overlap),0)),"accept"in h&&(p.options.drop.accept=h.accept),"checker"in h&&(p.options.drop.checker=h.checker),p}return E.bool(h)?(p.options.drop.enabled=h,p):p.options.drop})(this,f)},s.prototype.dropCheck=function(f,p,h,v,S,y){return(function(k,A,H,V,G,se,re){var fe=!1;if(!(re=re||k.getRect(se)))return!!k.options.drop.checker&&k.options.drop.checker(A,H,fe,k,se,V,G);var ye=k.options.drop.overlap;if(ye==="pointer"){var we=nt(V,G,"drag"),he=ii(A);he.x+=we.x,he.y+=we.y;var be=he.x>re.left&&he.x<re.right,Ae=he.y>re.top&&he.y<re.bottom;fe=be&&Ae}var Te=V.getRect(G);if(Te&&ye==="center"){var Le=Te.left+Te.width/2,ze=Te.top+Te.height/2;fe=Le>=re.left&&Le<=re.right&&ze>=re.top&&ze<=re.bottom}return Te&&E.number(ye)&&(fe=Math.max(0,Math.min(re.right,Te.right)-Math.max(re.left,Te.left))*Math.max(0,Math.min(re.bottom,Te.bottom)-Math.max(re.top,Te.top))/(Te.width*Te.height)>=ye),k.options.drop.checker&&(fe=k.options.drop.checker(A,H,fe,k,se,V,G)),fe})(this,f,p,h,v,S,y)},o.dynamicDrop=function(f){return E.bool(f)?(n.dynamicDrop=f,o):n.dynamicDrop},ne(t.phaselessTypes,{dragenter:!0,dragleave:!0,dropactivate:!0,dropdeactivate:!0,dropmove:!0,drop:!0}),t.methodDict.drop="dropzone",n.dynamicDrop=!1,l.actions.drop=hi.defaults},listeners:{"interactions:before-action-start":function(n){var t=n.interaction;t.prepared.name==="drag"&&(t.dropState={cur:{dropzone:null,element:null},prev:{dropzone:null,element:null},rejected:null,events:null,activeDrops:[]})},"interactions:after-action-start":function(n,t){var o=n.interaction,s=n.iEvent;if(o.prepared.name==="drag"){var l=o.dropState;l.activeDrops=[],l.events={},l.activeDrops=mr(t,o.element),l.events=vr(o,0,s),l.events.activate&&(fi(l.activeDrops,l.events.activate),t.fire("actions/drop:start",{interaction:o,dragEvent:s}))}},"interactions:action-move":pi,"interactions:after-action-move":function(n,t){var o=n.interaction,s=n.iEvent;if(o.prepared.name==="drag"){var l=o.dropState;yr(o,l.events),t.fire("actions/drop:move",{interaction:o,dragEvent:s}),l.events={}}},"interactions:action-end":function(n,t){if(n.interaction.prepared.name==="drag"){var o=n.interaction,s=n.iEvent;pi(n,t),yr(o,o.dropState.events),t.fire("actions/drop:end",{interaction:o,dragEvent:s})}},"interactions:stop":function(n){var t=n.interaction;if(t.prepared.name==="drag"){var o=t.dropState;o&&(o.activeDrops=null,o.events=null,o.cur.dropzone=null,o.cur.element=null,o.prev.dropzone=null,o.prev.element=null,o.rejected=!1)}}},getActiveDrops:mr,getDrop:di,getDropEvents:vr,fireDropEvents:yr,filterEventType:function(n){return n.search("drag")===0||n.search("drop")===0},defaults:{enabled:!1,accept:null,overlap:"pointer"}},Bc=hi;function br(n){var t=n.interaction,o=n.iEvent,s=n.phase;if(t.prepared.name==="gesture"){var l=t.pointers.map((function(S){return S.pointer})),f=s==="start",p=s==="end",h=t.interactable.options.deltaSource;if(o.touches=[l[0],l[1]],f)o.distance=hr(l,h),o.box=pr(l),o.scale=1,o.ds=0,o.angle=gr(l,h),o.da=0,t.gesture.startDistance=o.distance,t.gesture.startAngle=o.angle;else if(p||t.pointers.length<2){var v=t.prevEvent;o.distance=v.distance,o.box=v.box,o.scale=v.scale,o.ds=0,o.angle=v.angle,o.da=0}else o.distance=hr(l,h),o.box=pr(l),o.scale=o.distance/t.gesture.startDistance,o.angle=gr(l,h),o.ds=o.scale-t.gesture.scale,o.da=o.angle-t.gesture.angle;t.gesture.distance=o.distance,t.gesture.angle=o.angle,E.number(o.scale)&&o.scale!==1/0&&!isNaN(o.scale)&&(t.gesture.scale=o.scale)}}var wr={id:"actions/gesture",before:["actions/drag","actions/resize"],install:function(n){var t=n.actions,o=n.Interactable,s=n.defaults;o.prototype.gesturable=function(l){return E.object(l)?(this.options.gesture.enabled=l.enabled!==!1,this.setPerAction("gesture",l),this.setOnEvents("gesture",l),this):E.bool(l)?(this.options.gesture.enabled=l,this):this.options.gesture},t.map.gesture=wr,t.methodDict.gesture="gesturable",s.actions.gesture=wr.defaults},listeners:{"interactions:action-start":br,"interactions:action-move":br,"interactions:action-end":br,"interactions:new":function(n){n.interaction.gesture={angle:0,distance:0,scale:1,startAngle:0,startDistance:0}},"auto-start:check":function(n){if(!(n.interaction.pointers.length<2)){var t=n.interactable.options.gesture;if(t&&t.enabled)return n.action={name:"gesture"},!1}}},defaults:{},getCursor:function(){return""},filterEventType:function(n){return n.search("gesture")===0}},Hc=wr;function Yc(n,t,o,s,l,f,p){if(!t)return!1;if(t===!0){var h=E.number(f.width)?f.width:f.right-f.left,v=E.number(f.height)?f.height:f.bottom-f.top;if(p=Math.min(p,Math.abs((n==="left"||n==="right"?h:v)/2)),h<0&&(n==="left"?n="right":n==="right"&&(n="left")),v<0&&(n==="top"?n="bottom":n==="bottom"&&(n="top")),n==="left"){var S=h>=0?f.left:f.right;return o.x<S+p}if(n==="top"){var y=v>=0?f.top:f.bottom;return o.y<y+p}if(n==="right")return o.x>(h>=0?f.right:f.left)-p;if(n==="bottom")return o.y>(v>=0?f.bottom:f.top)-p}return!!E.element(s)&&(E.element(t)?t===s:ee(s,t,l))}function gi(n){var t=n.iEvent,o=n.interaction;if(o.prepared.name==="resize"&&o.resizeAxes){var s=t;o.interactable.options.resize.square?(o.resizeAxes==="y"?s.delta.x=s.delta.y:s.delta.y=s.delta.x,s.axes="xy"):(s.axes=o.resizeAxes,o.resizeAxes==="x"?s.delta.y=0:o.resizeAxes==="y"&&(s.delta.x=0))}}var Ye,ot,Xe={id:"actions/resize",before:["actions/drag"],install:function(n){var t=n.actions,o=n.browser,s=n.Interactable,l=n.defaults;Xe.cursors=(function(f){return f.isIe9?{x:"e-resize",y:"s-resize",xy:"se-resize",top:"n-resize",left:"w-resize",bottom:"s-resize",right:"e-resize",topleft:"se-resize",bottomright:"se-resize",topright:"ne-resize",bottomleft:"ne-resize"}:{x:"ew-resize",y:"ns-resize",xy:"nwse-resize",top:"ns-resize",left:"ew-resize",bottom:"ns-resize",right:"ew-resize",topleft:"nwse-resize",bottomright:"nwse-resize",topright:"nesw-resize",bottomleft:"nesw-resize"}})(o),Xe.defaultMargin=o.supportsTouch||o.supportsPointerEvent?20:10,s.prototype.resizable=function(f){return(function(p,h,v){return E.object(h)?(p.options.resize.enabled=h.enabled!==!1,p.setPerAction("resize",h),p.setOnEvents("resize",h),E.string(h.axis)&&/^x$|^y$|^xy$/.test(h.axis)?p.options.resize.axis=h.axis:h.axis===null&&(p.options.resize.axis=v.defaults.actions.resize.axis),E.bool(h.preserveAspectRatio)?p.options.resize.preserveAspectRatio=h.preserveAspectRatio:E.bool(h.square)&&(p.options.resize.square=h.square),p):E.bool(h)?(p.options.resize.enabled=h,p):p.options.resize})(this,f,n)},t.map.resize=Xe,t.methodDict.resize="resizable",l.actions.resize=Xe.defaults},listeners:{"interactions:new":function(n){n.interaction.resizeAxes="xy"},"interactions:action-start":function(n){(function(t){var o=t.iEvent,s=t.interaction;if(s.prepared.name==="resize"&&s.prepared.edges){var l=o,f=s.rect;s._rects={start:ne({},f),corrected:ne({},f),previous:ne({},f),delta:{left:0,right:0,width:0,top:0,bottom:0,height:0}},l.edges=s.prepared.edges,l.rect=s._rects.corrected,l.deltaRect=s._rects.delta}})(n),gi(n)},"interactions:action-move":function(n){(function(t){var o=t.iEvent,s=t.interaction;if(s.prepared.name==="resize"&&s.prepared.edges){var l=o,f=s.interactable.options.resize.invert,p=f==="reposition"||f==="negate",h=s.rect,v=s._rects,S=v.start,y=v.corrected,k=v.delta,A=v.previous;if(ne(A,y),p){if(ne(y,h),f==="reposition"){if(y.top>y.bottom){var H=y.top;y.top=y.bottom,y.bottom=H}if(y.left>y.right){var V=y.left;y.left=y.right,y.right=V}}}else y.top=Math.min(h.top,S.bottom),y.bottom=Math.max(h.bottom,S.top),y.left=Math.min(h.left,S.right),y.right=Math.max(h.right,S.left);for(var G in y.width=y.right-y.left,y.height=y.bottom-y.top,y)k[G]=y[G]-A[G];l.edges=s.prepared.edges,l.rect=y,l.deltaRect=k}})(n),gi(n)},"interactions:action-end":function(n){var t=n.iEvent,o=n.interaction;if(o.prepared.name==="resize"&&o.prepared.edges){var s=t;s.edges=o.prepared.edges,s.rect=o._rects.corrected,s.deltaRect=o._rects.delta}},"auto-start:check":function(n){var t=n.interaction,o=n.interactable,s=n.element,l=n.rect,f=n.buttons;if(l){var p=ne({},t.coords.cur.page),h=o.options.resize;if(h&&h.enabled&&(!t.pointerIsDown||!/mouse|pointer/.test(t.pointerType)||(f&h.mouseButtons)!=0)){if(E.object(h.edges)){var v={left:!1,right:!1,top:!1,bottom:!1};for(var S in v)v[S]=Yc(S,h.edges[S],p,t._latestPointer.eventTarget,s,l,h.margin||Xe.defaultMargin);v.left=v.left&&!v.right,v.top=v.top&&!v.bottom,(v.left||v.right||v.top||v.bottom)&&(n.action={name:"resize",edges:v})}else{var y=h.axis!=="y"&&p.x>l.right-Xe.defaultMargin,k=h.axis!=="x"&&p.y>l.bottom-Xe.defaultMargin;(y||k)&&(n.action={name:"resize",axes:(y?"x":"")+(k?"y":"")})}return!n.action&&void 0}}}},defaults:{square:!1,preserveAspectRatio:!1,axis:"xy",margin:NaN,edges:null,invert:"none"},cursors:null,getCursor:function(n){var t=n.edges,o=n.axis,s=n.name,l=Xe.cursors,f=null;if(o)f=l[s+o];else if(t){for(var p="",h=0,v=["top","bottom","left","right"];h<v.length;h++){var S=v[h];t[S]&&(p+=S)}f=l[p]}return f},filterEventType:function(n){return n.search("resize")===0},defaultMargin:null},Xc=Xe,Uc={id:"actions",install:function(n){n.usePlugin(Hc),n.usePlugin(Xc),n.usePlugin(ie),n.usePlugin(Bc)}},mi=0,We={request:function(n){return Ye(n)},cancel:function(n){return ot(n)},init:function(n){if(Ye=n.requestAnimationFrame,ot=n.cancelAnimationFrame,!Ye)for(var t=["ms","moz","webkit","o"],o=0;o<t.length;o++){var s=t[o];Ye=n["".concat(s,"RequestAnimationFrame")],ot=n["".concat(s,"CancelAnimationFrame")]||n["".concat(s,"CancelRequestAnimationFrame")]}Ye=Ye&&Ye.bind(n),ot=ot&&ot.bind(n),Ye||(Ye=function(l){var f=Date.now(),p=Math.max(0,16-(f-mi)),h=n.setTimeout((function(){l(f+p)}),p);return mi=f+p,h},ot=function(l){return clearTimeout(l)})}},ge={defaults:{enabled:!1,margin:60,container:null,speed:300},now:Date.now,interaction:null,i:0,x:0,y:0,isScrolling:!1,prevTime:0,margin:0,speed:0,start:function(n){ge.isScrolling=!0,We.cancel(ge.i),n.autoScroll=ge,ge.interaction=n,ge.prevTime=ge.now(),ge.i=We.request(ge.scroll)},stop:function(){ge.isScrolling=!1,ge.interaction&&(ge.interaction.autoScroll=null),We.cancel(ge.i)},scroll:function(){var n=ge.interaction,t=n.interactable,o=n.element,s=n.prepared.name,l=t.options[s].autoScroll,f=vi(l.container,t,o),p=ge.now(),h=(p-ge.prevTime)/1e3,v=l.speed*h;if(v>=1){var S={x:ge.x*v,y:ge.y*v};if(S.x||S.y){var y=yi(f);E.window(f)?f.scrollBy(S.x,S.y):f&&(f.scrollLeft+=S.x,f.scrollTop+=S.y);var k=yi(f),A={x:k.x-y.x,y:k.y-y.y};(A.x||A.y)&&t.fire({type:"autoscroll",target:o,interactable:t,delta:A,interaction:n,container:f})}ge.prevTime=p}ge.isScrolling&&(We.cancel(ge.i),ge.i=We.request(ge.scroll))},check:function(n,t){var o;return(o=n.options[t].autoScroll)==null?void 0:o.enabled},onInteractionMove:function(n){var t=n.interaction,o=n.pointer;if(t.interacting()&&ge.check(t.interactable,t.prepared.name))if(t.simulation)ge.x=ge.y=0;else{var s,l,f,p,h=t.interactable,v=t.element,S=t.prepared.name,y=h.options[S].autoScroll,k=vi(y.container,h,v);if(E.window(k))p=o.clientX<ge.margin,s=o.clientY<ge.margin,l=o.clientX>k.innerWidth-ge.margin,f=o.clientY>k.innerHeight-ge.margin;else{var A=pe(k);p=o.clientX<A.left+ge.margin,s=o.clientY<A.top+ge.margin,l=o.clientX>A.right-ge.margin,f=o.clientY>A.bottom-ge.margin}ge.x=l?1:p?-1:0,ge.y=f?1:s?-1:0,ge.isScrolling||(ge.margin=y.margin,ge.speed=y.speed,ge.start(t))}}};function vi(n,t,o){return(E.string(n)?Ve(n,t,o):n)||K(o)}function yi(n){return E.window(n)&&(n=window.document.body),{x:n.scrollLeft,y:n.scrollTop}}var Kc={id:"auto-scroll",install:function(n){var t=n.defaults,o=n.actions;n.autoScroll=ge,ge.now=function(){return n.now()},o.phaselessTypes.autoscroll=!0,t.perAction.autoScroll=ge.defaults},listeners:{"interactions:new":function(n){n.interaction.autoScroll=null},"interactions:destroy":function(n){n.interaction.autoScroll=null,ge.stop(),ge.interaction&&(ge.interaction=null)},"interactions:stop":ge.stop,"interactions:action-move":function(n){return ge.onInteractionMove(n)}}},Gc=Kc;function At(n,t){var o=!1;return function(){return o||(q.console.warn(t),o=!0),n.apply(this,arguments)}}function xr(n,t){return n.name=t.name,n.axis=t.axis,n.edges=t.edges,n}function Wc(n){return E.bool(n)?(this.options.styleCursor=n,this):n===null?(delete this.options.styleCursor,this):this.options.styleCursor}function Jc(n){return E.func(n)?(this.options.actionChecker=n,this):n===null?(delete this.options.actionChecker,this):this.options.actionChecker}var Zc={id:"auto-start/interactableMethods",install:function(n){var t=n.Interactable;t.prototype.getAction=function(o,s,l,f){var p=(function(h,v,S,y,k){var A=h.getRect(y),H=v.buttons||{0:1,1:4,3:8,4:16}[v.button],V={action:null,interactable:h,interaction:S,element:y,rect:A,buttons:H};return k.fire("auto-start:check",V),V.action})(this,s,l,f,n);return this.options.actionChecker?this.options.actionChecker(o,s,p,this,f,l):p},t.prototype.ignoreFrom=At((function(o){return this._backCompatOption("ignoreFrom",o)}),"Interactable.ignoreFrom() has been deprecated. Use Interactble.draggable({ignoreFrom: newValue})."),t.prototype.allowFrom=At((function(o){return this._backCompatOption("allowFrom",o)}),"Interactable.allowFrom() has been deprecated. Use Interactble.draggable({allowFrom: newValue})."),t.prototype.actionChecker=Jc,t.prototype.styleCursor=Wc}};function bi(n,t,o,s,l){return t.testIgnoreAllow(t.options[n.name],o,s)&&t.options[n.name].enabled&&Cn(t,o,n,l)?n:null}function Qc(n,t,o,s,l,f,p){for(var h=0,v=s.length;h<v;h++){var S=s[h],y=l[h],k=S.getAction(t,o,n,y);if(k){var A=bi(k,S,y,f,p);if(A)return{action:A,interactable:S,element:y}}}return{action:null,interactable:null,element:null}}function wi(n,t,o,s,l){var f=[],p=[],h=s;function v(y){f.push(y),p.push(h)}for(;E.element(h);){f=[],p=[],l.interactables.forEachMatch(h,v);var S=Qc(n,t,o,f,p,s,l);if(S.action&&!S.interactable.options[S.action.name].manualStart)return S;h=Y(h)}return{action:null,interactable:null,element:null}}function xi(n,t,o){var s=t.action,l=t.interactable,f=t.element;s=s||{name:null},n.interactable=l,n.element=f,xr(n.prepared,s),n.rect=l&&s.name?l.getRect(f):null,Ni(n,o),o.fire("autoStart:prepared",{interaction:n})}function Cn(n,t,o,s){var l=n.options,f=l[o.name].max,p=l[o.name].maxPerElement,h=s.autoStart.maxInteractions,v=0,S=0,y=0;if(!(f&&p&&h))return!1;for(var k=0,A=s.interactions.list;k<A.length;k++){var H=A[k],V=H.prepared.name;if(H.interacting()&&(++v>=h||H.interactable===n&&((S+=V===o.name?1:0)>=f||H.element===t&&(y++,V===o.name&&y>=p))))return!1}return h>0}function Ei(n,t){return E.number(n)?(t.autoStart.maxInteractions=n,this):t.autoStart.maxInteractions}function Er(n,t,o){var s=o.autoStart.cursorElement;s&&s!==n&&(s.style.cursor=""),n.ownerDocument.documentElement.style.cursor=t,n.style.cursor=t,o.autoStart.cursorElement=t?n:null}function Ni(n,t){var o=n.interactable,s=n.element,l=n.prepared;if(n.pointerType==="mouse"&&o&&o.options.styleCursor){var f="";if(l.name){var p=o.options[l.name].cursorChecker;f=E.func(p)?p(l,o,s,n._interacting):t.actions.map[l.name].getCursor(l)}Er(n.element,f||"",t)}else t.autoStart.cursorElement&&Er(t.autoStart.cursorElement,"",t)}var $c={id:"auto-start/base",before:["actions"],install:function(n){var t=n.interactStatic,o=n.defaults;n.usePlugin(Zc),o.base.actionChecker=null,o.base.styleCursor=!0,ne(o.perAction,{manualStart:!1,max:1/0,maxPerElement:1,allowFrom:null,ignoreFrom:null,mouseButtons:1}),t.maxInteractions=function(s){return Ei(s,n)},n.autoStart={maxInteractions:1/0,withinInteractionLimit:Cn,cursorElement:null}},listeners:{"interactions:down":function(n,t){var o=n.interaction,s=n.pointer,l=n.event,f=n.eventTarget;o.interacting()||xi(o,wi(o,s,l,f,t),t)},"interactions:move":function(n,t){(function(o,s){var l=o.interaction,f=o.pointer,p=o.event,h=o.eventTarget;l.pointerType!=="mouse"||l.pointerIsDown||l.interacting()||xi(l,wi(l,f,p,h,s),s)})(n,t),(function(o,s){var l=o.interaction;if(l.pointerIsDown&&!l.interacting()&&l.pointerWasMoved&&l.prepared.name){s.fire("autoStart:before-start",o);var f=l.interactable,p=l.prepared.name;p&&f&&(f.options[p].manualStart||!Cn(f,l.element,l.prepared,s)?l.stop():(l.start(l.prepared,f,l.element),Ni(l,s)))}})(n,t)},"interactions:stop":function(n,t){var o=n.interaction,s=o.interactable;s&&s.options.styleCursor&&Er(o.element,"",t)}},maxInteractions:Ei,withinInteractionLimit:Cn,validateAction:bi},Nr=$c,qc={id:"auto-start/dragAxis",listeners:{"autoStart:before-start":function(n,t){var o=n.interaction,s=n.eventTarget,l=n.dx,f=n.dy;if(o.prepared.name==="drag"){var p=Math.abs(l),h=Math.abs(f),v=o.interactable.options.drag,S=v.startAxis,y=p>h?"x":p<h?"y":"xy";if(o.prepared.axis=v.lockAxis==="start"?y[0]:v.lockAxis,y!=="xy"&&S!=="xy"&&S!==y){o.prepared.name=null;for(var k=s,A=function(V){if(V!==o.interactable){var G=o.interactable.options.drag;if(!G.manualStart&&V.testIgnoreAllow(G,k,s)){var se=V.getAction(o.downPointer,o.downEvent,o,k);if(se&&se.name==="drag"&&(function(re,fe){if(!fe)return!1;var ye=fe.options.drag.startAxis;return re==="xy"||ye==="xy"||ye===re})(y,V)&&Nr.validateAction(se,V,k,s,t))return V}}};E.element(k);){var H=t.interactables.forEachMatch(k,A);if(H){o.prepared.name="drag",o.interactable=H,o.element=k;break}k=Y(k)}}}}}};function Sr(n){var t=n.prepared&&n.prepared.name;if(!t)return null;var o=n.interactable.options;return o[t].hold||o[t].delay}var el={id:"auto-start/hold",install:function(n){var t=n.defaults;n.usePlugin(Nr),t.perAction.hold=0,t.perAction.delay=0},listeners:{"interactions:new":function(n){n.interaction.autoStartHoldTimer=null},"autoStart:prepared":function(n){var t=n.interaction,o=Sr(t);o>0&&(t.autoStartHoldTimer=setTimeout((function(){t.start(t.prepared,t.interactable,t.element)}),o))},"interactions:move":function(n){var t=n.interaction,o=n.duplicate;t.autoStartHoldTimer&&t.pointerWasMoved&&!o&&(clearTimeout(t.autoStartHoldTimer),t.autoStartHoldTimer=null)},"autoStart:before-start":function(n){var t=n.interaction;Sr(t)>0&&(t.prepared.name=null)}},getHoldDuration:Sr},tl=el,nl={id:"auto-start",install:function(n){n.usePlugin(Nr),n.usePlugin(tl),n.usePlugin(qc)}},rl=function(n){return/^(always|never|auto)$/.test(n)?(this.options.preventDefault=n,this):E.bool(n)?(this.options.preventDefault=n?"always":"never",this):this.options.preventDefault};function ol(n){var t=n.interaction,o=n.event;t.interactable&&t.interactable.checkAndPreventDefault(o)}var Si={id:"core/interactablePreventDefault",install:function(n){var t=n.Interactable;t.prototype.preventDefault=rl,t.prototype.checkAndPreventDefault=function(o){return(function(s,l,f){var p=s.options.preventDefault;if(p!=="never")if(p!=="always"){if(l.events.supportsPassive&&/^touch(start|move)$/.test(f.type)){var h=K(f.target).document,v=l.getDocOptions(h);if(!v||!v.events||v.events.passive!==!1)return}/^(mouse|pointer|touch)*(down|start)/i.test(f.type)||E.element(f.target)&&z(f.target,"input,select,textarea,[contenteditable=true],[contenteditable=true] *")||f.preventDefault()}else f.preventDefault()})(this,n,o)},n.interactions.docEvents.push({type:"dragstart",listener:function(o){for(var s=0,l=n.interactions.list;s<l.length;s++){var f=l[s];if(f.element&&(f.element===o.target||ae(f.element,o.target)))return void f.interactable.checkAndPreventDefault(o)}}})},listeners:["down","move","up","cancel"].reduce((function(n,t){return n["interactions:".concat(t)]=ol,n}),{})};function kn(n,t){if(t.phaselessTypes[n])return!0;for(var o in t.map)if(n.indexOf(o)===0&&n.substr(o.length)in t.phases)return!0;return!1}function dt(n){var t={};for(var o in n){var s=n[o];E.plainObject(s)?t[o]=dt(s):E.array(s)?t[o]=ui(s):t[o]=s}return t}var Tr=(function(){function n(t){u(this,n),this.states=[],this.startOffset={left:0,right:0,top:0,bottom:0},this.startDelta=void 0,this.result=void 0,this.endResult=void 0,this.startEdges=void 0,this.edges=void 0,this.interaction=void 0,this.interaction=t,this.result=On(),this.edges={left:!1,right:!1,top:!1,bottom:!1}}return g(n,[{key:"start",value:function(t,o){var s,l,f=t.phase,p=this.interaction,h=(function(S){var y=S.interactable.options[S.prepared.name],k=y.modifiers;return k&&k.length?k:["snap","snapSize","snapEdges","restrict","restrictEdges","restrictSize"].map((function(A){var H=y[A];return H&&H.enabled&&{options:H,methods:H._methods}})).filter((function(A){return!!A}))})(p);this.prepareStates(h),this.startEdges=ne({},p.edges),this.edges=ne({},this.startEdges),this.startOffset=(s=p.rect,l=o,s?{left:l.x-s.left,top:l.y-s.top,right:s.right-l.x,bottom:s.bottom-l.y}:{left:0,top:0,right:0,bottom:0}),this.startDelta={x:0,y:0};var v=this.fillArg({phase:f,pageCoords:o,preEnd:!1});return this.result=On(),this.startAll(v),this.result=this.setAll(v)}},{key:"fillArg",value:function(t){var o=this.interaction;return t.interaction=o,t.interactable=o.interactable,t.element=o.element,t.rect||(t.rect=o.rect),t.edges||(t.edges=this.startEdges),t.startOffset=this.startOffset,t}},{key:"startAll",value:function(t){for(var o=0,s=this.states;o<s.length;o++){var l=s[o];l.methods.start&&(t.state=l,l.methods.start(t))}}},{key:"setAll",value:function(t){var o=t.phase,s=t.preEnd,l=t.skipModifiers,f=t.rect,p=t.edges;t.coords=ne({},t.pageCoords),t.rect=ne({},f),t.edges=ne({},p);for(var h=l?this.states.slice(l):this.states,v=On(t.coords,t.rect),S=0;S<h.length;S++){var y,k=h[S],A=k.options,H=ne({},t.coords),V=null;(y=k.methods)!=null&&y.set&&this.shouldDo(A,s,o)&&(t.state=k,V=k.methods.set(t),lt(t.edges,t.rect,{x:t.coords.x-H.x,y:t.coords.y-H.y})),v.eventProps.push(V)}ne(this.edges,t.edges),v.delta.x=t.coords.x-t.pageCoords.x,v.delta.y=t.coords.y-t.pageCoords.y,v.rectDelta.left=t.rect.left-f.left,v.rectDelta.right=t.rect.right-f.right,v.rectDelta.top=t.rect.top-f.top,v.rectDelta.bottom=t.rect.bottom-f.bottom;var G=this.result.coords,se=this.result.rect;if(G&&se){var re=v.rect.left!==se.left||v.rect.right!==se.right||v.rect.top!==se.top||v.rect.bottom!==se.bottom;v.changed=re||G.x!==v.coords.x||G.y!==v.coords.y}return v}},{key:"applyToInteraction",value:function(t){var o=this.interaction,s=t.phase,l=o.coords.cur,f=o.coords.start,p=this.result,h=this.startDelta,v=p.delta;s==="start"&&ne(this.startDelta,p.delta);for(var S=0,y=[[f,h],[l,v]];S<y.length;S++){var k=y[S],A=k[0],H=k[1];A.page.x+=H.x,A.page.y+=H.y,A.client.x+=H.x,A.client.y+=H.y}var V=this.result.rectDelta,G=t.rect||o.rect;G.left+=V.left,G.right+=V.right,G.top+=V.top,G.bottom+=V.bottom,G.width=G.right-G.left,G.height=G.bottom-G.top}},{key:"setAndApply",value:function(t){var o=this.interaction,s=t.phase,l=t.preEnd,f=t.skipModifiers,p=this.setAll(this.fillArg({preEnd:l,phase:s,pageCoords:t.modifiedCoords||o.coords.cur.page}));if(this.result=p,!p.changed&&(!f||f<this.states.length)&&o.interacting())return!1;if(t.modifiedCoords){var h=o.coords.cur.page,v={x:t.modifiedCoords.x-h.x,y:t.modifiedCoords.y-h.y};p.coords.x+=v.x,p.coords.y+=v.y,p.delta.x+=v.x,p.delta.y+=v.y}this.applyToInteraction(t)}},{key:"beforeEnd",value:function(t){var o=t.interaction,s=t.event,l=this.states;if(l&&l.length){for(var f=!1,p=0;p<l.length;p++){var h=l[p];t.state=h;var v=h.options,S=h.methods,y=S.beforeEnd&&S.beforeEnd(t);if(y)return this.endResult=y,!1;f=f||!f&&this.shouldDo(v,!0,t.phase,!0)}f&&o.move({event:s,preEnd:!0})}}},{key:"stop",value:function(t){var o=t.interaction;if(this.states&&this.states.length){var s=ne({states:this.states,interactable:o.interactable,element:o.element,rect:null},t);this.fillArg(s);for(var l=0,f=this.states;l<f.length;l++){var p=f[l];s.state=p,p.methods.stop&&p.methods.stop(s)}this.states=null,this.endResult=null}}},{key:"prepareStates",value:function(t){this.states=[];for(var o=0;o<t.length;o++){var s=t[o],l=s.options,f=s.methods,p=s.name;this.states.push({options:l,methods:f,index:o,name:p})}return this.states}},{key:"restoreInteractionCoords",value:function(t){var o=t.interaction,s=o.coords,l=o.rect,f=o.modification;if(f.result){for(var p=f.startDelta,h=f.result,v=h.delta,S=h.rectDelta,y=0,k=[[s.start,p],[s.cur,v]];y<k.length;y++){var A=k[y],H=A[0],V=A[1];H.page.x-=V.x,H.page.y-=V.y,H.client.x-=V.x,H.client.y-=V.y}l.left-=S.left,l.right-=S.right,l.top-=S.top,l.bottom-=S.bottom}}},{key:"shouldDo",value:function(t,o,s,l){return!(!t||t.enabled===!1||l&&!t.endOnly||t.endOnly&&!o||s==="start"&&!t.setStart)}},{key:"copyFrom",value:function(t){this.startOffset=t.startOffset,this.startDelta=t.startDelta,this.startEdges=t.startEdges,this.edges=t.edges,this.states=t.states.map((function(o){return dt(o)})),this.result=On(ne({},t.result.coords),ne({},t.result.rect))}},{key:"destroy",value:function(){for(var t in this)this[t]=null}}]),n})();function On(n,t){return{rect:t,coords:n,delta:{x:0,y:0},rectDelta:{left:0,right:0,top:0,bottom:0},eventProps:[],changed:!0}}function Je(n,t){var o=n.defaults,s={start:n.start,set:n.set,beforeEnd:n.beforeEnd,stop:n.stop},l=function(f){var p=f||{};for(var h in p.enabled=p.enabled!==!1,o)h in p||(p[h]=o[h]);var v={options:p,methods:s,name:t,enable:function(){return p.enabled=!0,v},disable:function(){return p.enabled=!1,v}};return v};return t&&typeof t=="string"&&(l._defaults=o,l._methods=s),l}function Mt(n){var t=n.iEvent,o=n.interaction.modification.result;o&&(t.modifiers=o.eventProps)}var il={id:"modifiers/base",before:["actions"],install:function(n){n.defaults.perAction.modifiers=[]},listeners:{"interactions:new":function(n){var t=n.interaction;t.modification=new Tr(t)},"interactions:before-action-start":function(n){var t=n.interaction,o=n.interaction.modification;o.start(n,t.coords.start.page),t.edges=o.edges,o.applyToInteraction(n)},"interactions:before-action-move":function(n){var t=n.interaction,o=t.modification,s=o.setAndApply(n);return t.edges=o.edges,s},"interactions:before-action-end":function(n){var t=n.interaction,o=t.modification,s=o.beforeEnd(n);return t.edges=o.startEdges,s},"interactions:action-start":Mt,"interactions:action-move":Mt,"interactions:action-end":Mt,"interactions:after-action-start":function(n){return n.interaction.modification.restoreInteractionCoords(n)},"interactions:after-action-move":function(n){return n.interaction.modification.restoreInteractionCoords(n)},"interactions:stop":function(n){return n.interaction.modification.stop(n)}}},Ti=il,_i={base:{preventDefault:"auto",deltaSource:"page"},perAction:{enabled:!1,origin:{x:0,y:0}},actions:{}},_r=(function(n){b(o,n);var t=R(o);function o(s,l,f,p,h,v,S){var y;u(this,o),(y=t.call(this,s)).relatedTarget=null,y.screenX=void 0,y.screenY=void 0,y.button=void 0,y.buttons=void 0,y.ctrlKey=void 0,y.shiftKey=void 0,y.altKey=void 0,y.metaKey=void 0,y.page=void 0,y.client=void 0,y.delta=void 0,y.rect=void 0,y.x0=void 0,y.y0=void 0,y.t0=void 0,y.dt=void 0,y.duration=void 0,y.clientX0=void 0,y.clientY0=void 0,y.velocity=void 0,y.speed=void 0,y.swipe=void 0,y.axes=void 0,y.preEnd=void 0,h=h||s.element;var k=s.interactable,A=(k&&k.options||_i).deltaSource,H=nt(k,h,f),V=p==="start",G=p==="end",se=V?P(y):s.prevEvent,re=V?s.coords.start:G?{page:se.page,client:se.client,timeStamp:s.coords.cur.timeStamp}:s.coords.cur;return y.page=ne({},re.page),y.client=ne({},re.client),y.rect=ne({},s.rect),y.timeStamp=re.timeStamp,G||(y.page.x-=H.x,y.page.y-=H.y,y.client.x-=H.x,y.client.y-=H.y),y.ctrlKey=l.ctrlKey,y.altKey=l.altKey,y.shiftKey=l.shiftKey,y.metaKey=l.metaKey,y.button=l.button,y.buttons=l.buttons,y.target=h,y.currentTarget=h,y.preEnd=v,y.type=S||f+(p||""),y.interactable=k,y.t0=V?s.pointers[s.pointers.length-1].downTime:se.t0,y.x0=s.coords.start.page.x-H.x,y.y0=s.coords.start.page.y-H.y,y.clientX0=s.coords.start.client.x-H.x,y.clientY0=s.coords.start.client.y-H.y,y.delta=V||G?{x:0,y:0}:{x:y[A].x-se[A].x,y:y[A].y-se[A].y},y.dt=s.coords.delta.timeStamp,y.duration=y.timeStamp-y.t0,y.velocity=ne({},s.coords.velocity[A]),y.speed=rt(y.velocity.x,y.velocity.y),y.swipe=G||p==="inertiastart"?y.getSwipe():null,y}return g(o,[{key:"getSwipe",value:function(){var s=this._interaction;if(s.prevEvent.speed<600||this.timeStamp-s.prevEvent.timeStamp>150)return null;var l=180*Math.atan2(s.prevEvent.velocityY,s.prevEvent.velocityX)/Math.PI;l<0&&(l+=360);var f=112.5<=l&&l<247.5,p=202.5<=l&&l<337.5;return{up:p,down:!p&&22.5<=l&&l<157.5,left:f,right:!f&&(292.5<=l||l<67.5),angle:l,speed:s.prevEvent.speed,velocity:{x:s.prevEvent.velocityX,y:s.prevEvent.velocityY}}}},{key:"preventDefault",value:function(){}},{key:"stopImmediatePropagation",value:function(){this.immediatePropagationStopped=this.propagationStopped=!0}},{key:"stopPropagation",value:function(){this.propagationStopped=!0}}]),o})(_n);Object.defineProperties(_r.prototype,{pageX:{get:function(){return this.page.x},set:function(n){this.page.x=n}},pageY:{get:function(){return this.page.y},set:function(n){this.page.y=n}},clientX:{get:function(){return this.client.x},set:function(n){this.client.x=n}},clientY:{get:function(){return this.client.y},set:function(n){this.client.y=n}},dx:{get:function(){return this.delta.x},set:function(n){this.delta.x=n}},dy:{get:function(){return this.delta.y},set:function(n){this.delta.y=n}},velocityX:{get:function(){return this.velocity.x},set:function(n){this.velocity.x=n}},velocityY:{get:function(){return this.velocity.y},set:function(n){this.velocity.y=n}}});var sl=g((function n(t,o,s,l,f){u(this,n),this.id=void 0,this.pointer=void 0,this.event=void 0,this.downTime=void 0,this.downTarget=void 0,this.id=t,this.pointer=o,this.event=s,this.downTime=l,this.downTarget=f})),al=(function(n){return n.interactable="",n.element="",n.prepared="",n.pointerIsDown="",n.pointerWasMoved="",n._proxy="",n})({}),Ci=(function(n){return n.start="",n.move="",n.end="",n.stop="",n.interacting="",n})({}),cl=0,ll=(function(){function n(t){var o=this,s=t.pointerType,l=t.scopeFire;u(this,n),this.interactable=null,this.element=null,this.rect=null,this._rects=void 0,this.edges=null,this._scopeFire=void 0,this.prepared={name:null,axis:null,edges:null},this.pointerType=void 0,this.pointers=[],this.downEvent=null,this.downPointer={},this._latestPointer={pointer:null,event:null,eventTarget:null},this.prevEvent=null,this.pointerIsDown=!1,this.pointerWasMoved=!1,this._interacting=!1,this._ending=!1,this._stopped=!0,this._proxy=void 0,this.simulation=null,this.doMove=At((function(y){this.move(y)}),"The interaction.doMove() method has been renamed to interaction.move()"),this.coords={start:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},prev:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},cur:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},delta:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},velocity:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0}},this._id=cl++,this._scopeFire=l,this.pointerType=s;var f=this;this._proxy={};var p=function(y){Object.defineProperty(o._proxy,y,{get:function(){return f[y]}})};for(var h in al)p(h);var v=function(y){Object.defineProperty(o._proxy,y,{value:function(){return f[y].apply(f,arguments)}})};for(var S in Ci)v(S);this._scopeFire("interactions:new",{interaction:this})}return g(n,[{key:"pointerMoveTolerance",get:function(){return 1}},{key:"pointerDown",value:function(t,o,s){var l=this.updatePointer(t,o,s,!0),f=this.pointers[l];this._scopeFire("interactions:down",{pointer:t,event:o,eventTarget:s,pointerIndex:l,pointerInfo:f,type:"down",interaction:this})}},{key:"start",value:function(t,o,s){return!(this.interacting()||!this.pointerIsDown||this.pointers.length<(t.name==="gesture"?2:1)||!o.options[t.name].enabled)&&(xr(this.prepared,t),this.interactable=o,this.element=s,this.rect=o.getRect(s),this.edges=this.prepared.edges?ne({},this.prepared.edges):{left:!0,right:!0,top:!0,bottom:!0},this._stopped=!1,this._interacting=this._doPhase({interaction:this,event:this.downEvent,phase:"start"})&&!this._stopped,this._interacting)}},{key:"pointerMove",value:function(t,o,s){this.simulation||this.modification&&this.modification.endResult||this.updatePointer(t,o,s,!1);var l,f,p=this.coords.cur.page.x===this.coords.prev.page.x&&this.coords.cur.page.y===this.coords.prev.page.y&&this.coords.cur.client.x===this.coords.prev.client.x&&this.coords.cur.client.y===this.coords.prev.client.y;this.pointerIsDown&&!this.pointerWasMoved&&(l=this.coords.cur.client.x-this.coords.start.client.x,f=this.coords.cur.client.y-this.coords.start.client.y,this.pointerWasMoved=rt(l,f)>this.pointerMoveTolerance);var h,v,S,y=this.getPointerIndex(t),k={pointer:t,pointerIndex:y,pointerInfo:this.pointers[y],event:o,type:"move",eventTarget:s,dx:l,dy:f,duplicate:p,interaction:this};p||(h=this.coords.velocity,v=this.coords.delta,S=Math.max(v.timeStamp/1e3,.001),h.page.x=v.page.x/S,h.page.y=v.page.y/S,h.client.x=v.client.x/S,h.client.y=v.client.y/S,h.timeStamp=S),this._scopeFire("interactions:move",k),p||this.simulation||(this.interacting()&&(k.type=null,this.move(k)),this.pointerWasMoved&&Sn(this.coords.prev,this.coords.cur))}},{key:"move",value:function(t){t&&t.event||ri(this.coords.delta),(t=ne({pointer:this._latestPointer.pointer,event:this._latestPointer.event,eventTarget:this._latestPointer.eventTarget,interaction:this},t||{})).phase="move",this._doPhase(t)}},{key:"pointerUp",value:function(t,o,s,l){var f=this.getPointerIndex(t);f===-1&&(f=this.updatePointer(t,o,s,!1));var p=/cancel$/i.test(o.type)?"cancel":"up";this._scopeFire("interactions:".concat(p),{pointer:t,pointerIndex:f,pointerInfo:this.pointers[f],event:o,eventTarget:s,type:p,curEventTarget:l,interaction:this}),this.simulation||this.end(o),this.removePointer(t,o)}},{key:"documentBlur",value:function(t){this.end(t),this._scopeFire("interactions:blur",{event:t,type:"blur",interaction:this})}},{key:"end",value:function(t){var o;this._ending=!0,t=t||this._latestPointer.event,this.interacting()&&(o=this._doPhase({event:t,interaction:this,phase:"end"})),this._ending=!1,o===!0&&this.stop()}},{key:"currentAction",value:function(){return this._interacting?this.prepared.name:null}},{key:"interacting",value:function(){return this._interacting}},{key:"stop",value:function(){this._scopeFire("interactions:stop",{interaction:this}),this.interactable=this.element=null,this._interacting=!1,this._stopped=!0,this.prepared.name=this.prevEvent=null}},{key:"getPointerIndex",value:function(t){var o=It(t);return this.pointerType==="mouse"||this.pointerType==="pen"?this.pointers.length-1:jt(this.pointers,(function(s){return s.id===o}))}},{key:"getPointerInfo",value:function(t){return this.pointers[this.getPointerIndex(t)]}},{key:"updatePointer",value:function(t,o,s,l){var f,p,h,v=It(t),S=this.getPointerIndex(t),y=this.pointers[S];return l=l!==!1&&(l||/(down|start)$/i.test(o.type)),y?y.pointer=t:(y=new sl(v,t,o,null,null),S=this.pointers.length,this.pointers.push(y)),Dc(this.coords.cur,this.pointers.map((function(k){return k.pointer})),this._now()),f=this.coords.delta,p=this.coords.prev,h=this.coords.cur,f.page.x=h.page.x-p.page.x,f.page.y=h.page.y-p.page.y,f.client.x=h.client.x-p.client.x,f.client.y=h.client.y-p.client.y,f.timeStamp=h.timeStamp-p.timeStamp,l&&(this.pointerIsDown=!0,y.downTime=this.coords.cur.timeStamp,y.downTarget=s,Nn(this.downPointer,t),this.interacting()||(Sn(this.coords.start,this.coords.cur),Sn(this.coords.prev,this.coords.cur),this.downEvent=o,this.pointerWasMoved=!1)),this._updateLatestPointer(t,o,s),this._scopeFire("interactions:update-pointer",{pointer:t,event:o,eventTarget:s,down:l,pointerInfo:y,pointerIndex:S,interaction:this}),S}},{key:"removePointer",value:function(t,o){var s=this.getPointerIndex(t);if(s!==-1){var l=this.pointers[s];this._scopeFire("interactions:remove-pointer",{pointer:t,event:o,eventTarget:null,pointerIndex:s,pointerInfo:l,interaction:this}),this.pointers.splice(s,1),this.pointerIsDown=!1}}},{key:"_updateLatestPointer",value:function(t,o,s){this._latestPointer.pointer=t,this._latestPointer.event=o,this._latestPointer.eventTarget=s}},{key:"destroy",value:function(){this._latestPointer.pointer=null,this._latestPointer.event=null,this._latestPointer.eventTarget=null}},{key:"_createPreparedEvent",value:function(t,o,s,l){return new _r(this,t,this.prepared.name,o,this.element,s,l)}},{key:"_fireEvent",value:function(t){var o;(o=this.interactable)==null||o.fire(t),(!this.prevEvent||t.timeStamp>=this.prevEvent.timeStamp)&&(this.prevEvent=t)}},{key:"_doPhase",value:function(t){var o=t.event,s=t.phase,l=t.preEnd,f=t.type,p=this.rect;if(p&&s==="move"&&(lt(this.edges,p,this.coords.delta[this.interactable.options.deltaSource]),p.width=p.right-p.left,p.height=p.bottom-p.top),this._scopeFire("interactions:before-action-".concat(s),t)===!1)return!1;var h=t.iEvent=this._createPreparedEvent(o,s,l,f);return this._scopeFire("interactions:action-".concat(s),t),s==="start"&&(this.prevEvent=h),this._fireEvent(h),this._scopeFire("interactions:after-action-".concat(s),t),!0}},{key:"_now",value:function(){return Date.now()}}]),n})();function ki(n){Oi(n.interaction)}function Oi(n){if(!(function(o){return!(!o.offset.pending.x&&!o.offset.pending.y)})(n))return!1;var t=n.offset.pending;return Cr(n.coords.cur,t),Cr(n.coords.delta,t),lt(n.edges,n.rect,t),t.x=0,t.y=0,!0}function ul(n){var t=n.x,o=n.y;this.offset.pending.x+=t,this.offset.pending.y+=o,this.offset.total.x+=t,this.offset.total.y+=o}function Cr(n,t){var o=n.page,s=n.client,l=t.x,f=t.y;o.x+=l,o.y+=f,s.x+=l,s.y+=f}Ci.offsetBy="";var fl={id:"offset",before:["modifiers","pointer-events","actions","inertia"],install:function(n){n.Interaction.prototype.offsetBy=ul},listeners:{"interactions:new":function(n){n.interaction.offset={total:{x:0,y:0},pending:{x:0,y:0}}},"interactions:update-pointer":function(n){return(function(t){t.pointerIsDown&&(Cr(t.coords.cur,t.offset.total),t.offset.pending.x=0,t.offset.pending.y=0)})(n.interaction)},"interactions:before-action-start":ki,"interactions:before-action-move":ki,"interactions:before-action-end":function(n){var t=n.interaction;if(Oi(t))return t.move({offset:!0}),t.end(),!1},"interactions:stop":function(n){var t=n.interaction;t.offset.total.x=0,t.offset.total.y=0,t.offset.pending.x=0,t.offset.pending.y=0}}},Pi=fl,dl=(function(){function n(t){u(this,n),this.active=!1,this.isModified=!1,this.smoothEnd=!1,this.allowResume=!1,this.modification=void 0,this.modifierCount=0,this.modifierArg=void 0,this.startCoords=void 0,this.t0=0,this.v0=0,this.te=0,this.targetOffset=void 0,this.modifiedOffset=void 0,this.currentOffset=void 0,this.lambda_v0=0,this.one_ve_v0=0,this.timeout=void 0,this.interaction=void 0,this.interaction=t}return g(n,[{key:"start",value:function(t){var o=this.interaction,s=Pn(o);if(!s||!s.enabled)return!1;var l=o.coords.velocity.client,f=rt(l.x,l.y),p=this.modification||(this.modification=new Tr(o));if(p.copyFrom(o.modification),this.t0=o._now(),this.allowResume=s.allowResume,this.v0=f,this.currentOffset={x:0,y:0},this.startCoords=o.coords.cur.page,this.modifierArg=p.fillArg({pageCoords:this.startCoords,preEnd:!0,phase:"inertiastart"}),this.t0-o.coords.cur.timeStamp<50&&f>s.minSpeed&&f>s.endSpeed)this.startInertia();else{if(p.result=p.setAll(this.modifierArg),!p.result.changed)return!1;this.startSmoothEnd()}return o.modification.result.rect=null,o.offsetBy(this.targetOffset),o._doPhase({interaction:o,event:t,phase:"inertiastart"}),o.offsetBy({x:-this.targetOffset.x,y:-this.targetOffset.y}),o.modification.result.rect=null,this.active=!0,o.simulation=this,!0}},{key:"startInertia",value:function(){var t=this,o=this.interaction.coords.velocity.client,s=Pn(this.interaction),l=s.resistance,f=-Math.log(s.endSpeed/this.v0)/l;this.targetOffset={x:(o.x-f)/l,y:(o.y-f)/l},this.te=f,this.lambda_v0=l/this.v0,this.one_ve_v0=1-s.endSpeed/this.v0;var p=this.modification,h=this.modifierArg;h.pageCoords={x:this.startCoords.x+this.targetOffset.x,y:this.startCoords.y+this.targetOffset.y},p.result=p.setAll(h),p.result.changed&&(this.isModified=!0,this.modifiedOffset={x:this.targetOffset.x+p.result.delta.x,y:this.targetOffset.y+p.result.delta.y}),this.onNextFrame((function(){return t.inertiaTick()}))}},{key:"startSmoothEnd",value:function(){var t=this;this.smoothEnd=!0,this.isModified=!0,this.targetOffset={x:this.modification.result.delta.x,y:this.modification.result.delta.y},this.onNextFrame((function(){return t.smoothEndTick()}))}},{key:"onNextFrame",value:function(t){var o=this;this.timeout=We.request((function(){o.active&&t()}))}},{key:"inertiaTick",value:function(){var t,o,s,l,f,p,h,v=this,S=this.interaction,y=Pn(S).resistance,k=(S._now()-this.t0)/1e3;if(k<this.te){var A,H=1-(Math.exp(-y*k)-this.lambda_v0)/this.one_ve_v0;this.isModified?(t=0,o=0,s=this.targetOffset.x,l=this.targetOffset.y,f=this.modifiedOffset.x,p=this.modifiedOffset.y,A={x:Ii(h=H,t,s,f),y:Ii(h,o,l,p)}):A={x:this.targetOffset.x*H,y:this.targetOffset.y*H};var V={x:A.x-this.currentOffset.x,y:A.y-this.currentOffset.y};this.currentOffset.x+=V.x,this.currentOffset.y+=V.y,S.offsetBy(V),S.move(),this.onNextFrame((function(){return v.inertiaTick()}))}else S.offsetBy({x:this.modifiedOffset.x-this.currentOffset.x,y:this.modifiedOffset.y-this.currentOffset.y}),this.end()}},{key:"smoothEndTick",value:function(){var t=this,o=this.interaction,s=o._now()-this.t0,l=Pn(o).smoothEndDuration;if(s<l){var f={x:ji(s,0,this.targetOffset.x,l),y:ji(s,0,this.targetOffset.y,l)},p={x:f.x-this.currentOffset.x,y:f.y-this.currentOffset.y};this.currentOffset.x+=p.x,this.currentOffset.y+=p.y,o.offsetBy(p),o.move({skipModifiers:this.modifierCount}),this.onNextFrame((function(){return t.smoothEndTick()}))}else o.offsetBy({x:this.targetOffset.x-this.currentOffset.x,y:this.targetOffset.y-this.currentOffset.y}),this.end()}},{key:"resume",value:function(t){var o=t.pointer,s=t.event,l=t.eventTarget,f=this.interaction;f.offsetBy({x:-this.currentOffset.x,y:-this.currentOffset.y}),f.updatePointer(o,s,l,!0),f._doPhase({interaction:f,event:s,phase:"resume"}),Sn(f.coords.prev,f.coords.cur),this.stop()}},{key:"end",value:function(){this.interaction.move(),this.interaction.end(),this.stop()}},{key:"stop",value:function(){this.active=this.smoothEnd=!1,this.interaction.simulation=null,We.cancel(this.timeout)}}]),n})();function Pn(n){var t=n.interactable,o=n.prepared;return t&&t.options&&o.name&&t.options[o.name].inertia}var pl={id:"inertia",before:["modifiers","actions"],install:function(n){var t=n.defaults;n.usePlugin(Pi),n.usePlugin(Ti),n.actions.phases.inertiastart=!0,n.actions.phases.resume=!0,t.perAction.inertia={enabled:!1,resistance:10,minSpeed:100,endSpeed:10,allowResume:!0,smoothEndDuration:300}},listeners:{"interactions:new":function(n){var t=n.interaction;t.inertia=new dl(t)},"interactions:before-action-end":function(n){var t=n.interaction,o=n.event;return(!t._interacting||t.simulation||!t.inertia.start(o))&&null},"interactions:down":function(n){var t=n.interaction,o=n.eventTarget,s=t.inertia;if(s.active)for(var l=o;E.element(l);){if(l===t.element){s.resume(n);break}l=Y(l)}},"interactions:stop":function(n){var t=n.interaction.inertia;t.active&&t.stop()},"interactions:before-action-resume":function(n){var t=n.interaction.modification;t.stop(n),t.start(n,n.interaction.coords.cur.page),t.applyToInteraction(n)},"interactions:before-action-inertiastart":function(n){return n.interaction.modification.setAndApply(n)},"interactions:action-resume":Mt,"interactions:action-inertiastart":Mt,"interactions:after-action-inertiastart":function(n){return n.interaction.modification.restoreInteractionCoords(n)},"interactions:after-action-resume":function(n){return n.interaction.modification.restoreInteractionCoords(n)}}};function Ii(n,t,o,s){var l=1-n;return l*l*t+2*l*n*o+n*n*s}function ji(n,t,o,s){return-o*(n/=s)*(n-2)+t}var hl=pl;function Ri(n,t){for(var o=0;o<t.length;o++){var s=t[o];if(n.immediatePropagationStopped)break;s(n)}}var Ai=(function(){function n(t){u(this,n),this.options=void 0,this.types={},this.propagationStopped=!1,this.immediatePropagationStopped=!1,this.global=void 0,this.options=ne({},t||{})}return g(n,[{key:"fire",value:function(t){var o,s=this.global;(o=this.types[t.type])&&Ri(t,o),!t.propagationStopped&&s&&(o=s[t.type])&&Ri(t,o)}},{key:"on",value:function(t,o){var s=Oe(t,o);for(t in s)this.types[t]=li(this.types[t]||[],s[t])}},{key:"off",value:function(t,o){var s=Oe(t,o);for(t in s){var l=this.types[t];if(l&&l.length)for(var f=0,p=s[t];f<p.length;f++){var h=p[f],v=l.indexOf(h);v!==-1&&l.splice(v,1)}}}},{key:"getRect",value:function(t){return null}}]),n})(),gl=(function(){function n(t){u(this,n),this.currentTarget=void 0,this.originalEvent=void 0,this.type=void 0,this.originalEvent=t,Nn(this,t)}return g(n,[{key:"preventOriginalDefault",value:function(){this.originalEvent.preventDefault()}},{key:"stopPropagation",value:function(){this.originalEvent.stopPropagation()}},{key:"stopImmediatePropagation",value:function(){this.originalEvent.stopImmediatePropagation()}}]),n})();function Lt(n){return E.object(n)?{capture:!!n.capture,passive:!!n.passive}:{capture:!!n,passive:!1}}function In(n,t){return n===t||(typeof n=="boolean"?!!t.capture===n&&!t.passive:!!n.capture==!!t.capture&&!!n.passive==!!t.passive)}var ml={id:"events",install:function(n){var t,o=[],s={},l=[],f={add:p,remove:h,addDelegate:function(y,k,A,H,V){var G=Lt(V);if(!s[A]){s[A]=[];for(var se=0;se<l.length;se++){var re=l[se];p(re,A,v),p(re,A,S,!0)}}var fe=s[A],ye=Rt(fe,(function(we){return we.selector===y&&we.context===k}));ye||(ye={selector:y,context:k,listeners:[]},fe.push(ye)),ye.listeners.push({func:H,options:G})},removeDelegate:function(y,k,A,H,V){var G,se=Lt(V),re=s[A],fe=!1;if(re)for(G=re.length-1;G>=0;G--){var ye=re[G];if(ye.selector===y&&ye.context===k){for(var we=ye.listeners,he=we.length-1;he>=0;he--){var be=we[he];if(be.func===H&&In(be.options,se)){we.splice(he,1),we.length||(re.splice(G,1),h(k,A,v),h(k,A,S,!0)),fe=!0;break}}if(fe)break}}},delegateListener:v,delegateUseCapture:S,delegatedEvents:s,documents:l,targets:o,supportsOptions:!1,supportsPassive:!1};function p(y,k,A,H){if(y.addEventListener){var V=Lt(H),G=Rt(o,(function(se){return se.eventTarget===y}));G||(G={eventTarget:y,events:{}},o.push(G)),G.events[k]||(G.events[k]=[]),Rt(G.events[k],(function(se){return se.func===A&&In(se.options,V)}))||(y.addEventListener(k,A,f.supportsOptions?V:V.capture),G.events[k].push({func:A,options:V}))}}function h(y,k,A,H){if(y.addEventListener&&y.removeEventListener){var V=jt(o,(function(Ae){return Ae.eventTarget===y})),G=o[V];if(G&&G.events)if(k!=="all"){var se=!1,re=G.events[k];if(re){if(A==="all"){for(var fe=re.length-1;fe>=0;fe--){var ye=re[fe];h(y,k,ye.func,ye.options)}return}for(var we=Lt(H),he=0;he<re.length;he++){var be=re[he];if(be.func===A&&In(be.options,we)){y.removeEventListener(k,A,f.supportsOptions?we:we.capture),re.splice(he,1),re.length===0&&(delete G.events[k],se=!0);break}}}se&&!Object.keys(G.events).length&&o.splice(V,1)}else for(k in G.events)G.events.hasOwnProperty(k)&&h(y,k,"all")}}function v(y,k){for(var A=Lt(k),H=new gl(y),V=s[y.type],G=ci(y)[0],se=G;E.element(se);){for(var re=0;re<V.length;re++){var fe=V[re],ye=fe.selector,we=fe.context;if(z(se,ye)&&ae(we,G)&&ae(we,se)){var he=fe.listeners;H.currentTarget=se;for(var be=0;be<he.length;be++){var Ae=he[be];In(Ae.options,A)&&Ae.func(H)}}}se=Y(se)}}function S(y){return v(y,!0)}return(t=n.document)==null||t.createElement("div").addEventListener("test",null,{get capture(){return f.supportsOptions=!0},get passive(){return f.supportsPassive=!0}}),n.events=f,f}},kr={methodOrder:["simulationResume","mouseOrPen","hasPointer","idle"],search:function(n){for(var t=0,o=kr.methodOrder;t<o.length;t++){var s=o[t],l=kr[s](n);if(l)return l}return null},simulationResume:function(n){var t=n.pointerType,o=n.eventType,s=n.eventTarget,l=n.scope;if(!/down|start/i.test(o))return null;for(var f=0,p=l.interactions.list;f<p.length;f++){var h=p[f],v=s;if(h.simulation&&h.simulation.allowResume&&h.pointerType===t)for(;v;){if(v===h.element)return h;v=Y(v)}}return null},mouseOrPen:function(n){var t,o=n.pointerId,s=n.pointerType,l=n.eventType,f=n.scope;if(s!=="mouse"&&s!=="pen")return null;for(var p=0,h=f.interactions.list;p<h.length;p++){var v=h[p];if(v.pointerType===s){if(v.simulation&&!Mi(v,o))continue;if(v.interacting())return v;t||(t=v)}}if(t)return t;for(var S=0,y=f.interactions.list;S<y.length;S++){var k=y[S];if(!(k.pointerType!==s||/down/i.test(l)&&k.simulation))return k}return null},hasPointer:function(n){for(var t=n.pointerId,o=0,s=n.scope.interactions.list;o<s.length;o++){var l=s[o];if(Mi(l,t))return l}return null},idle:function(n){for(var t=n.pointerType,o=0,s=n.scope.interactions.list;o<s.length;o++){var l=s[o];if(l.pointers.length===1){var f=l.interactable;if(f&&(!f.options.gesture||!f.options.gesture.enabled))continue}else if(l.pointers.length>=2)continue;if(!l.interacting()&&t===l.pointerType)return l}return null}};function Mi(n,t){return n.pointers.some((function(o){return o.id===t}))}var vl=kr,Or=["pointerDown","pointerMove","pointerUp","updatePointer","removePointer","windowBlur"];function Li(n,t){return function(o){var s=t.interactions.list,l=ai(o),f=ci(o),p=f[0],h=f[1],v=[];if(/^touch/.test(o.type)){t.prevTouchTime=t.now();for(var S=0,y=o.changedTouches;S<y.length;S++){var k=y[S],A={pointer:k,pointerId:It(k),pointerType:l,eventType:o.type,eventTarget:p,curEventTarget:h,scope:t},H=zi(A);v.push([A.pointer,A.eventTarget,A.curEventTarget,H])}}else{var V=!1;if(!oe.supportsPointerEvent&&/mouse/.test(o.type)){for(var G=0;G<s.length&&!V;G++)V=s[G].pointerType!=="mouse"&&s[G].pointerIsDown;V=V||t.now()-t.prevTouchTime<500||o.timeStamp===0}if(!V){var se={pointer:o,pointerId:It(o),pointerType:l,eventType:o.type,curEventTarget:h,eventTarget:p,scope:t},re=zi(se);v.push([se.pointer,se.eventTarget,se.curEventTarget,re])}}for(var fe=0;fe<v.length;fe++){var ye=v[fe],we=ye[0],he=ye[1],be=ye[2];ye[3][n](we,o,he,be)}}}function zi(n){var t=n.pointerType,o=n.scope,s={interaction:vl.search(n),searchDetails:n};return o.fire("interactions:find",s),s.interaction||o.interactions.new({pointerType:t})}function Pr(n,t){var o=n.doc,s=n.scope,l=n.options,f=s.interactions.docEvents,p=s.events,h=p[t];for(var v in s.browser.isIOS&&!l.events&&(l.events={passive:!1}),p.delegatedEvents)h(o,v,p.delegateListener),h(o,v,p.delegateUseCapture,!0);for(var S=l&&l.events,y=0;y<f.length;y++){var k=f[y];h(o,k.type,k.listener,S)}}var yl={id:"core/interactions",install:function(n){for(var t={},o=0;o<Or.length;o++){var s=Or[o];t[s]=Li(s,n)}var l,f=oe.pEventTypes;function p(){for(var h=0,v=n.interactions.list;h<v.length;h++){var S=v[h];if(S.pointerIsDown&&S.pointerType==="touch"&&!S._interacting)for(var y=function(){var H=A[k];n.documents.some((function(V){return ae(V.doc,H.downTarget)}))||S.removePointer(H.pointer,H.event)},k=0,A=S.pointers;k<A.length;k++)y()}}(l=F.PointerEvent?[{type:f.down,listener:p},{type:f.down,listener:t.pointerDown},{type:f.move,listener:t.pointerMove},{type:f.up,listener:t.pointerUp},{type:f.cancel,listener:t.pointerUp}]:[{type:"mousedown",listener:t.pointerDown},{type:"mousemove",listener:t.pointerMove},{type:"mouseup",listener:t.pointerUp},{type:"touchstart",listener:p},{type:"touchstart",listener:t.pointerDown},{type:"touchmove",listener:t.pointerMove},{type:"touchend",listener:t.pointerUp},{type:"touchcancel",listener:t.pointerUp}]).push({type:"blur",listener:function(h){for(var v=0,S=n.interactions.list;v<S.length;v++)S[v].documentBlur(h)}}),n.prevTouchTime=0,n.Interaction=(function(h){b(S,h);var v=R(S);function S(){return u(this,S),v.apply(this,arguments)}return g(S,[{key:"pointerMoveTolerance",get:function(){return n.interactions.pointerMoveTolerance},set:function(y){n.interactions.pointerMoveTolerance=y}},{key:"_now",value:function(){return n.now()}}]),S})(ll),n.interactions={list:[],new:function(h){h.scopeFire=function(S,y){return n.fire(S,y)};var v=new n.Interaction(h);return n.interactions.list.push(v),v},listeners:t,docEvents:l,pointerMoveTolerance:1},n.usePlugin(Si)},listeners:{"scope:add-document":function(n){return Pr(n,"add")},"scope:remove-document":function(n){return Pr(n,"remove")},"interactable:unset":function(n,t){for(var o=n.interactable,s=t.interactions.list.length-1;s>=0;s--){var l=t.interactions.list[s];l.interactable===o&&(l.stop(),t.fire("interactions:destroy",{interaction:l}),l.destroy(),t.interactions.list.length>2&&t.interactions.list.splice(s,1))}}},onDocSignal:Pr,doOnInteractions:Li,methodNames:Or},bl=yl,Ze=(function(n){return n[n.On=0]="On",n[n.Off=1]="Off",n})(Ze||{}),wl=(function(){function n(t,o,s,l){u(this,n),this.target=void 0,this.options=void 0,this._actions=void 0,this.events=new Ai,this._context=void 0,this._win=void 0,this._doc=void 0,this._scopeEvents=void 0,this._actions=o.actions,this.target=t,this._context=o.context||s,this._win=K(Ne(t)?this._context:t),this._doc=this._win.document,this._scopeEvents=l,this.set(o)}return g(n,[{key:"_defaults",get:function(){return{base:{},perAction:{},actions:{}}}},{key:"setOnEvents",value:function(t,o){return E.func(o.onstart)&&this.on("".concat(t,"start"),o.onstart),E.func(o.onmove)&&this.on("".concat(t,"move"),o.onmove),E.func(o.onend)&&this.on("".concat(t,"end"),o.onend),E.func(o.oninertiastart)&&this.on("".concat(t,"inertiastart"),o.oninertiastart),this}},{key:"updatePerActionListeners",value:function(t,o,s){var l,f=this,p=(l=this._actions.map[t])==null?void 0:l.filterEventType,h=function(v){return(p==null||p(v))&&kn(v,f._actions)};(E.array(o)||E.object(o))&&this._onOff(Ze.Off,t,o,void 0,h),(E.array(s)||E.object(s))&&this._onOff(Ze.On,t,s,void 0,h)}},{key:"setPerAction",value:function(t,o){var s=this._defaults;for(var l in o){var f=l,p=this.options[t],h=o[f];f==="listeners"&&this.updatePerActionListeners(t,p.listeners,h),E.array(h)?p[f]=ui(h):E.plainObject(h)?(p[f]=ne(p[f]||{},dt(h)),E.object(s.perAction[f])&&"enabled"in s.perAction[f]&&(p[f].enabled=h.enabled!==!1)):E.bool(h)&&E.object(s.perAction[f])?p[f].enabled=h:p[f]=h}}},{key:"getRect",value:function(t){return t=t||(E.element(this.target)?this.target:null),E.string(this.target)&&(t=t||this._context.querySelector(this.target)),ve(t)}},{key:"rectChecker",value:function(t){var o=this;return E.func(t)?(this.getRect=function(s){var l=ne({},t.apply(o,s));return"width"in l||(l.width=l.right-l.left,l.height=l.bottom-l.top),l},this):t===null?(delete this.getRect,this):this.getRect}},{key:"_backCompatOption",value:function(t,o){if(Ne(o)||E.object(o)){for(var s in this.options[t]=o,this._actions.map)this.options[s][t]=o;return this}return this.options[t]}},{key:"origin",value:function(t){return this._backCompatOption("origin",t)}},{key:"deltaSource",value:function(t){return t==="page"||t==="client"?(this.options.deltaSource=t,this):this.options.deltaSource}},{key:"getAllElements",value:function(){var t=this.target;return E.string(t)?Array.from(this._context.querySelectorAll(t)):E.func(t)&&t.getAllElements?t.getAllElements():E.element(t)?[t]:[]}},{key:"context",value:function(){return this._context}},{key:"inContext",value:function(t){return this._context===t.ownerDocument||ae(this._context,t)}},{key:"testIgnoreAllow",value:function(t,o,s){return!this.testIgnore(t.ignoreFrom,o,s)&&this.testAllow(t.allowFrom,o,s)}},{key:"testAllow",value:function(t,o,s){return!t||!!E.element(s)&&(E.string(t)?ee(s,t,o):!!E.element(t)&&ae(t,s))}},{key:"testIgnore",value:function(t,o,s){return!(!t||!E.element(s))&&(E.string(t)?ee(s,t,o):!!E.element(t)&&ae(t,s))}},{key:"fire",value:function(t){return this.events.fire(t),this}},{key:"_onOff",value:function(t,o,s,l,f){E.object(o)&&!E.array(o)&&(l=s,s=null);var p=Oe(o,s,f);for(var h in p){h==="wheel"&&(h=oe.wheelEvent);for(var v=0,S=p[h];v<S.length;v++){var y=S[v];kn(h,this._actions)?this.events[t===Ze.On?"on":"off"](h,y):E.string(this.target)?this._scopeEvents[t===Ze.On?"addDelegate":"removeDelegate"](this.target,this._context,h,y,l):this._scopeEvents[t===Ze.On?"add":"remove"](this.target,h,y,l)}}return this}},{key:"on",value:function(t,o,s){return this._onOff(Ze.On,t,o,s)}},{key:"off",value:function(t,o,s){return this._onOff(Ze.Off,t,o,s)}},{key:"set",value:function(t){var o=this._defaults;for(var s in E.object(t)||(t={}),this.options=dt(o.base),this._actions.methodDict){var l=s,f=this._actions.methodDict[l];this.options[l]={},this.setPerAction(l,ne(ne({},o.perAction),o.actions[l])),this[f](t[l])}for(var p in t)p!=="getRect"?E.func(this[p])&&this[p](t[p]):this.rectChecker(t.getRect);return this}},{key:"unset",value:function(){if(E.string(this.target))for(var t in this._scopeEvents.delegatedEvents)for(var o=this._scopeEvents.delegatedEvents[t],s=o.length-1;s>=0;s--){var l=o[s],f=l.selector,p=l.context,h=l.listeners;f===this.target&&p===this._context&&o.splice(s,1);for(var v=h.length-1;v>=0;v--)this._scopeEvents.removeDelegate(this.target,this._context,t,h[v][0],h[v][1])}else this._scopeEvents.remove(this.target,"all")}}]),n})(),xl=(function(){function n(t){var o=this;u(this,n),this.list=[],this.selectorMap={},this.scope=void 0,this.scope=t,t.addListeners({"interactable:unset":function(s){var l=s.interactable,f=l.target,p=E.string(f)?o.selectorMap[f]:f[o.scope.id],h=jt(p,(function(v){return v===l}));p.splice(h,1)}})}return g(n,[{key:"new",value:function(t,o){o=ne(o||{},{actions:this.scope.actions});var s=new this.scope.Interactable(t,o,this.scope.document,this.scope.events);return this.scope.addDocument(s._doc),this.list.push(s),E.string(t)?(this.selectorMap[t]||(this.selectorMap[t]=[]),this.selectorMap[t].push(s)):(s.target[this.scope.id]||Object.defineProperty(t,this.scope.id,{value:[],configurable:!0}),t[this.scope.id].push(s)),this.scope.fire("interactable:new",{target:t,options:o,interactable:s,win:this.scope._win}),s}},{key:"getExisting",value:function(t,o){var s=o&&o.context||this.scope.document,l=E.string(t),f=l?this.selectorMap[t]:t[this.scope.id];if(f)return Rt(f,(function(p){return p._context===s&&(l||p.inContext(t))}))}},{key:"forEachMatch",value:function(t,o){for(var s=0,l=this.list;s<l.length;s++){var f=l[s],p=void 0;if((E.string(f.target)?E.element(t)&&z(t,f.target):t===f.target)&&f.inContext(t)&&(p=o(f)),p!==void 0)return p}}}]),n})(),El=(function(){function n(){var t=this;u(this,n),this.id="__interact_scope_".concat(Math.floor(100*Math.random())),this.isInitialized=!1,this.listenerMaps=[],this.browser=oe,this.defaults=dt(_i),this.Eventable=Ai,this.actions={map:{},phases:{start:!0,move:!0,end:!0},methodDict:{},phaselessTypes:{}},this.interactStatic=(function(s){var l=function f(p,h){var v=s.interactables.getExisting(p,h);return v||((v=s.interactables.new(p,h)).events.global=f.globalEvents),v};return l.getPointerAverage=si,l.getTouchBBox=pr,l.getTouchDistance=hr,l.getTouchAngle=gr,l.getElementRect=ve,l.getElementClientRect=pe,l.matchesSelector=z,l.closest=ue,l.globalEvents={},l.version="1.10.27",l.scope=s,l.use=function(f,p){return this.scope.usePlugin(f,p),this},l.isSet=function(f,p){return!!this.scope.interactables.get(f,p&&p.context)},l.on=At((function(f,p,h){if(E.string(f)&&f.search(" ")!==-1&&(f=f.trim().split(/ +/)),E.array(f)){for(var v=0,S=f;v<S.length;v++){var y=S[v];this.on(y,p,h)}return this}if(E.object(f)){for(var k in f)this.on(k,f[k],p);return this}return kn(f,this.scope.actions)?this.globalEvents[f]?this.globalEvents[f].push(p):this.globalEvents[f]=[p]:this.scope.events.add(this.scope.document,f,p,{options:h}),this}),"The interact.on() method is being deprecated"),l.off=At((function(f,p,h){if(E.string(f)&&f.search(" ")!==-1&&(f=f.trim().split(/ +/)),E.array(f)){for(var v=0,S=f;v<S.length;v++){var y=S[v];this.off(y,p,h)}return this}if(E.object(f)){for(var k in f)this.off(k,f[k],p);return this}var A;return kn(f,this.scope.actions)?f in this.globalEvents&&(A=this.globalEvents[f].indexOf(p))!==-1&&this.globalEvents[f].splice(A,1):this.scope.events.remove(this.scope.document,f,p,h),this}),"The interact.off() method is being deprecated"),l.debug=function(){return this.scope},l.supportsTouch=function(){return oe.supportsTouch},l.supportsPointerEvent=function(){return oe.supportsPointerEvent},l.stop=function(){for(var f=0,p=this.scope.interactions.list;f<p.length;f++)p[f].stop();return this},l.pointerMoveTolerance=function(f){return E.number(f)?(this.scope.interactions.pointerMoveTolerance=f,this):this.scope.interactions.pointerMoveTolerance},l.addDocument=function(f,p){this.scope.addDocument(f,p)},l.removeDocument=function(f){this.scope.removeDocument(f)},l})(this),this.InteractEvent=_r,this.Interactable=void 0,this.interactables=new xl(this),this._win=void 0,this.document=void 0,this.window=void 0,this.documents=[],this._plugins={list:[],map:{}},this.onWindowUnload=function(s){return t.removeDocument(s.target)};var o=this;this.Interactable=(function(s){b(f,s);var l=R(f);function f(){return u(this,f),l.apply(this,arguments)}return g(f,[{key:"_defaults",get:function(){return o.defaults}},{key:"set",value:function(p){return M(C(f.prototype),"set",this).call(this,p),o.fire("interactable:set",{options:p,interactable:this}),this}},{key:"unset",value:function(){M(C(f.prototype),"unset",this).call(this);var p=o.interactables.list.indexOf(this);p<0||(o.interactables.list.splice(p,1),o.fire("interactable:unset",{interactable:this}))}}]),f})(wl)}return g(n,[{key:"addListeners",value:function(t,o){this.listenerMaps.push({id:o,map:t})}},{key:"fire",value:function(t,o){for(var s=0,l=this.listenerMaps;s<l.length;s++){var f=l[s].map[t];if(f&&f(o,this,t)===!1)return!1}}},{key:"init",value:function(t){return this.isInitialized?this:(function(o,s){return o.isInitialized=!0,E.window(s)&&W(s),F.init(s),oe.init(s),We.init(s),o.window=s,o.document=s.document,o.usePlugin(bl),o.usePlugin(ml),o})(this,t)}},{key:"pluginIsInstalled",value:function(t){var o=t.id;return o?!!this._plugins.map[o]:this._plugins.list.indexOf(t)!==-1}},{key:"usePlugin",value:function(t,o){if(!this.isInitialized)return this;if(this.pluginIsInstalled(t))return this;if(t.id&&(this._plugins.map[t.id]=t),this._plugins.list.push(t),t.install&&t.install(this,o),t.listeners&&t.before){for(var s=0,l=this.listenerMaps.length,f=t.before.reduce((function(h,v){return h[v]=!0,h[Fi(v)]=!0,h}),{});s<l;s++){var p=this.listenerMaps[s].id;if(p&&(f[p]||f[Fi(p)]))break}this.listenerMaps.splice(s,0,{id:t.id,map:t.listeners})}else t.listeners&&this.listenerMaps.push({id:t.id,map:t.listeners});return this}},{key:"addDocument",value:function(t,o){if(this.getDocIndex(t)!==-1)return!1;var s=K(t);o=o?ne({},o):{},this.documents.push({doc:t,options:o}),this.events.documents.push(t),t!==this.document&&this.events.add(s,"unload",this.onWindowUnload),this.fire("scope:add-document",{doc:t,window:s,scope:this,options:o})}},{key:"removeDocument",value:function(t){var o=this.getDocIndex(t),s=K(t),l=this.documents[o].options;this.events.remove(s,"unload",this.onWindowUnload),this.documents.splice(o,1),this.events.documents.splice(o,1),this.fire("scope:remove-document",{doc:t,window:s,scope:this,options:l})}},{key:"getDocIndex",value:function(t){for(var o=0;o<this.documents.length;o++)if(this.documents[o].doc===t)return o;return-1}},{key:"getDocOptions",value:function(t){var o=this.getDocIndex(t);return o===-1?null:this.documents[o].options}},{key:"now",value:function(){return(this.window.Date||Date).now()}}]),n})();function Fi(n){return n&&n.replace(/\/.*$/,"")}var Vi=new El,Re=Vi.interactStatic,Nl=typeof globalThis<"u"?globalThis:window;Vi.init(Nl);var Sl=Object.freeze({__proto__:null,edgeTarget:function(){},elements:function(){},grid:function(n){var t=[["x","y"],["left","top"],["right","bottom"],["width","height"]].filter((function(s){var l=s[0],f=s[1];return l in n||f in n})),o=function(s,l){for(var f=n.range,p=n.limits,h=p===void 0?{left:-1/0,right:1/0,top:-1/0,bottom:1/0}:p,v=n.offset,S=v===void 0?{x:0,y:0}:v,y={range:f,grid:n,x:null,y:null},k=0;k<t.length;k++){var A=t[k],H=A[0],V=A[1],G=Math.round((s-S.x)/n[H]),se=Math.round((l-S.y)/n[V]);y[H]=Math.max(h.left,Math.min(h.right,G*n[H]+S.x)),y[V]=Math.max(h.top,Math.min(h.bottom,se*n[V]+S.y))}return y};return o.grid=n,o.coordFields=t,o}}),Tl={id:"snappers",install:function(n){var t=n.interactStatic;t.snappers=ne(t.snappers||{},Sl),t.createSnapGrid=t.snappers.grid}},_l=Tl,Cl={start:function(n){var t=n.state,o=n.rect,s=n.edges,l=n.pageCoords,f=t.options,p=f.ratio,h=f.enabled,v=t.options,S=v.equalDelta,y=v.modifiers;p==="preserve"&&(p=o.width/o.height),t.startCoords=ne({},l),t.startRect=ne({},o),t.ratio=p,t.equalDelta=S;var k=t.linkedEdges={top:s.top||s.left&&!s.bottom,left:s.left||s.top&&!s.right,bottom:s.bottom||s.right&&!s.top,right:s.right||s.bottom&&!s.left};if(t.xIsPrimaryAxis=!(!s.left&&!s.right),t.equalDelta){var A=(k.left?1:-1)*(k.top?1:-1);t.edgeSign={x:A,y:A}}else t.edgeSign={x:k.left?-1:1,y:k.top?-1:1};if(h!==!1&&ne(s,k),y!=null&&y.length){var H=new Tr(n.interaction);H.copyFrom(n.interaction.modification),H.prepareStates(y),t.subModification=H,H.startAll(a({},n))}},set:function(n){var t=n.state,o=n.rect,s=n.coords,l=t.linkedEdges,f=ne({},s),p=t.equalDelta?kl:Ol;if(ne(n.edges,l),p(t,t.xIsPrimaryAxis,s,o),!t.subModification)return null;var h=ne({},o);lt(l,h,{x:s.x-f.x,y:s.y-f.y});var v=t.subModification.setAll(a(a({},n),{},{rect:h,edges:l,pageCoords:s,prevCoords:s,prevRect:h})),S=v.delta;return v.changed&&(p(t,Math.abs(S.x)>Math.abs(S.y),v.coords,v.rect),ne(s,v.coords)),v.eventProps},defaults:{ratio:"preserve",equalDelta:!1,modifiers:[],enabled:!1}};function kl(n,t,o){var s=n.startCoords,l=n.edgeSign;t?o.y=s.y+(o.x-s.x)*l.y:o.x=s.x+(o.y-s.y)*l.x}function Ol(n,t,o,s){var l=n.startRect,f=n.startCoords,p=n.ratio,h=n.edgeSign;if(t){var v=s.width/p;o.y=f.y+(v-l.height)*h.y}else{var S=s.height*p;o.x=f.x+(S-l.width)*h.x}}var Pl=Je(Cl,"aspectRatio"),Di=function(){};Di._defaults={};var jn=Di;function it(n,t,o){return E.func(n)?Ie(n,t.interactable,t.element,[o.x,o.y,t]):Ie(n,t.interactable,t.element)}var Rn={start:function(n){var t=n.rect,o=n.startOffset,s=n.state,l=n.interaction,f=n.pageCoords,p=s.options,h=p.elementRect,v=ne({left:0,top:0,right:0,bottom:0},p.offset||{});if(t&&h){var S=it(p.restriction,l,f);if(S){var y=S.right-S.left-t.width,k=S.bottom-S.top-t.height;y<0&&(v.left+=y,v.right+=y),k<0&&(v.top+=k,v.bottom+=k)}v.left+=o.left-t.width*h.left,v.top+=o.top-t.height*h.top,v.right+=o.right-t.width*(1-h.right),v.bottom+=o.bottom-t.height*(1-h.bottom)}s.offset=v},set:function(n){var t=n.coords,o=n.interaction,s=n.state,l=s.options,f=s.offset,p=it(l.restriction,o,t);if(p){var h=(function(v){return!v||"left"in v&&"top"in v||((v=ne({},v)).left=v.x||0,v.top=v.y||0,v.right=v.right||v.left+v.width,v.bottom=v.bottom||v.top+v.height),v})(p);t.x=Math.max(Math.min(h.right-f.right,t.x),h.left+f.left),t.y=Math.max(Math.min(h.bottom-f.bottom,t.y),h.top+f.top)}},defaults:{restriction:null,elementRect:null,offset:null,endOnly:!1,enabled:!1}},Il=Je(Rn,"restrict"),Bi={top:1/0,left:1/0,bottom:-1/0,right:-1/0},Hi={top:-1/0,left:-1/0,bottom:1/0,right:1/0};function Yi(n,t){for(var o=0,s=["top","left","bottom","right"];o<s.length;o++){var l=s[o];l in n||(n[l]=t[l])}return n}var zt={noInner:Bi,noOuter:Hi,start:function(n){var t,o=n.interaction,s=n.startOffset,l=n.state,f=l.options;f&&(t=Ce(it(f.offset,o,o.coords.start.page))),t=t||{x:0,y:0},l.offset={top:t.y+s.top,left:t.x+s.left,bottom:t.y-s.bottom,right:t.x-s.right}},set:function(n){var t=n.coords,o=n.edges,s=n.interaction,l=n.state,f=l.offset,p=l.options;if(o){var h=ne({},t),v=it(p.inner,s,h)||{},S=it(p.outer,s,h)||{};Yi(v,Bi),Yi(S,Hi),o.top?t.y=Math.min(Math.max(S.top+f.top,h.y),v.top+f.top):o.bottom&&(t.y=Math.max(Math.min(S.bottom+f.bottom,h.y),v.bottom+f.bottom)),o.left?t.x=Math.min(Math.max(S.left+f.left,h.x),v.left+f.left):o.right&&(t.x=Math.max(Math.min(S.right+f.right,h.x),v.right+f.right))}},defaults:{inner:null,outer:null,offset:null,endOnly:!1,enabled:!1}},jl=Je(zt,"restrictEdges"),Rl=ne({get elementRect(){return{top:0,left:0,bottom:1,right:1}},set elementRect(n){}},Rn.defaults),Al=Je({start:Rn.start,set:Rn.set,defaults:Rl},"restrictRect"),Ml={width:-1/0,height:-1/0},Ll={width:1/0,height:1/0},zl=Je({start:function(n){return zt.start(n)},set:function(n){var t=n.interaction,o=n.state,s=n.rect,l=n.edges,f=o.options;if(l){var p=De(it(f.min,t,n.coords))||Ml,h=De(it(f.max,t,n.coords))||Ll;o.options={endOnly:f.endOnly,inner:ne({},zt.noInner),outer:ne({},zt.noOuter)},l.top?(o.options.inner.top=s.bottom-p.height,o.options.outer.top=s.bottom-h.height):l.bottom&&(o.options.inner.bottom=s.top+p.height,o.options.outer.bottom=s.top+h.height),l.left?(o.options.inner.left=s.right-p.width,o.options.outer.left=s.right-h.width):l.right&&(o.options.inner.right=s.left+p.width,o.options.outer.right=s.left+h.width),zt.set(n),o.options=f}},defaults:{min:null,max:null,endOnly:!1,enabled:!1}},"restrictSize"),Ir={start:function(n){var t,o=n.interaction,s=n.interactable,l=n.element,f=n.rect,p=n.state,h=n.startOffset,v=p.options,S=v.offsetWithOrigin?(function(A){var H=A.interaction.element,V=Ce(Ie(A.state.options.origin,null,null,[H])),G=V||nt(A.interactable,H,A.interaction.prepared.name);return G})(n):{x:0,y:0};if(v.offset==="startCoords")t={x:o.coords.start.page.x,y:o.coords.start.page.y};else{var y=Ie(v.offset,s,l,[o]);(t=Ce(y)||{x:0,y:0}).x+=S.x,t.y+=S.y}var k=v.relativePoints;p.offsets=f&&k&&k.length?k.map((function(A,H){return{index:H,relativePoint:A,x:h.left-f.width*A.x+t.x,y:h.top-f.height*A.y+t.y}})):[{index:0,relativePoint:null,x:t.x,y:t.y}]},set:function(n){var t=n.interaction,o=n.coords,s=n.state,l=s.options,f=s.offsets,p=nt(t.interactable,t.element,t.prepared.name),h=ne({},o),v=[];l.offsetWithOrigin||(h.x-=p.x,h.y-=p.y);for(var S=0,y=f;S<y.length;S++)for(var k=y[S],A=h.x-k.x,H=h.y-k.y,V=0,G=l.targets.length;V<G;V++){var se=l.targets[V],re=void 0;(re=E.func(se)?se(A,H,t._proxy,k,V):se)&&v.push({x:(E.number(re.x)?re.x:A)+k.x,y:(E.number(re.y)?re.y:H)+k.y,range:E.number(re.range)?re.range:l.range,source:se,index:V,offset:k})}for(var fe={target:null,inRange:!1,distance:0,range:0,delta:{x:0,y:0}},ye=0;ye<v.length;ye++){var we=v[ye],he=we.range,be=we.x-h.x,Ae=we.y-h.y,Te=rt(be,Ae),Le=Te<=he;he===1/0&&fe.inRange&&fe.range!==1/0&&(Le=!1),fe.target&&!(Le?fe.inRange&&he!==1/0?Te/he<fe.distance/fe.range:he===1/0&&fe.range!==1/0||Te<fe.distance:!fe.inRange&&Te<fe.distance)||(fe.target=we,fe.distance=Te,fe.range=he,fe.inRange=Le,fe.delta.x=be,fe.delta.y=Ae)}return fe.inRange&&(o.x=fe.target.x,o.y=fe.target.y),s.closest=fe,fe},defaults:{range:1/0,targets:null,offset:null,offsetWithOrigin:!0,origin:null,relativePoints:null,endOnly:!1,enabled:!1}},Fl=Je(Ir,"snap"),An={start:function(n){var t=n.state,o=n.edges,s=t.options;if(!o)return null;n.state={options:{targets:null,relativePoints:[{x:o.left?0:1,y:o.top?0:1}],offset:s.offset||"self",origin:{x:0,y:0},range:s.range}},t.targetFields=t.targetFields||[["width","height"],["x","y"]],Ir.start(n),t.offsets=n.state.offsets,n.state=t},set:function(n){var t=n.interaction,o=n.state,s=n.coords,l=o.options,f=o.offsets,p={x:s.x-f[0].x,y:s.y-f[0].y};o.options=ne({},l),o.options.targets=[];for(var h=0,v=l.targets||[];h<v.length;h++){var S=v[h],y=void 0;if(y=E.func(S)?S(p.x,p.y,t):S){for(var k=0,A=o.targetFields;k<A.length;k++){var H=A[k],V=H[0],G=H[1];if(V in y||G in y){y.x=y[V],y.y=y[G];break}}o.options.targets.push(y)}}var se=Ir.set(n);return o.options=l,se},defaults:{range:1/0,targets:null,offset:null,endOnly:!1,enabled:!1}},Vl=Je(An,"snapSize"),jr={aspectRatio:Pl,restrictEdges:jl,restrict:Il,restrictRect:Al,restrictSize:zl,snapEdges:Je({start:function(n){var t=n.edges;return t?(n.state.targetFields=n.state.targetFields||[[t.left?"left":"right",t.top?"top":"bottom"]],An.start(n)):null},set:An.set,defaults:ne(dt(An.defaults),{targets:void 0,range:void 0,offset:{x:0,y:0}})},"snapEdges"),snap:Fl,snapSize:Vl,spring:jn,avoid:jn,transform:jn,rubberband:jn},Dl={id:"modifiers",install:function(n){var t=n.interactStatic;for(var o in n.usePlugin(Ti),n.usePlugin(_l),t.modifiers=jr,jr){var s=jr[o],l=s._defaults,f=s._methods;l._methods=f,n.defaults.perAction[o]=l}}},Bl=Dl,Xi=(function(n){b(o,n);var t=R(o);function o(s,l,f,p,h,v){var S;if(u(this,o),Nn(P(S=t.call(this,h)),f),f!==l&&Nn(P(S),l),S.timeStamp=v,S.originalEvent=f,S.type=s,S.pointerId=It(l),S.pointerType=ai(l),S.target=p,S.currentTarget=null,s==="tap"){var y=h.getPointerIndex(l);S.dt=S.timeStamp-h.pointers[y].downTime;var k=S.timeStamp-h.tapTime;S.double=!!h.prevTap&&h.prevTap.type!=="doubletap"&&h.prevTap.target===S.target&&k<500}else s==="doubletap"&&(S.dt=l.timeStamp-h.tapTime,S.double=!0);return S}return g(o,[{key:"_subtractOrigin",value:function(s){var l=s.x,f=s.y;return this.pageX-=l,this.pageY-=f,this.clientX-=l,this.clientY-=f,this}},{key:"_addOrigin",value:function(s){var l=s.x,f=s.y;return this.pageX+=l,this.pageY+=f,this.clientX+=l,this.clientY+=f,this}},{key:"preventDefault",value:function(){this.originalEvent.preventDefault()}}]),o})(_n),Ft={id:"pointer-events/base",before:["inertia","modifiers","auto-start","actions"],install:function(n){n.pointerEvents=Ft,n.defaults.actions.pointerEvents=Ft.defaults,ne(n.actions.phaselessTypes,Ft.types)},listeners:{"interactions:new":function(n){var t=n.interaction;t.prevTap=null,t.tapTime=0},"interactions:update-pointer":function(n){var t=n.down,o=n.pointerInfo;!t&&o.hold||(o.hold={duration:1/0,timeout:null})},"interactions:move":function(n,t){var o=n.interaction,s=n.pointer,l=n.event,f=n.eventTarget;n.duplicate||o.pointerIsDown&&!o.pointerWasMoved||(o.pointerIsDown&&Rr(n),Qe({interaction:o,pointer:s,event:l,eventTarget:f,type:"move"},t))},"interactions:down":function(n,t){(function(o,s){for(var l=o.interaction,f=o.pointer,p=o.event,h=o.eventTarget,v=o.pointerIndex,S=l.pointers[v].hold,y=de(h),k={interaction:l,pointer:f,event:p,eventTarget:h,type:"hold",targets:[],path:y,node:null},A=0;A<y.length;A++){var H=y[A];k.node=H,s.fire("pointerEvents:collect-targets",k)}if(k.targets.length){for(var V=1/0,G=0,se=k.targets;G<se.length;G++){var re=se[G].eventable.options.holdDuration;re<V&&(V=re)}S.duration=V,S.timeout=setTimeout((function(){Qe({interaction:l,eventTarget:h,pointer:f,event:p,type:"hold"},s)}),V)}})(n,t),Qe(n,t)},"interactions:up":function(n,t){Rr(n),Qe(n,t),(function(o,s){var l=o.interaction,f=o.pointer,p=o.event,h=o.eventTarget;l.pointerWasMoved||Qe({interaction:l,eventTarget:h,pointer:f,event:p,type:"tap"},s)})(n,t)},"interactions:cancel":function(n,t){Rr(n),Qe(n,t)}},PointerEvent:Xi,fire:Qe,collectEventTargets:Ui,defaults:{holdDuration:600,ignoreFrom:null,allowFrom:null,origin:{x:0,y:0}},types:{down:!0,move:!0,up:!0,cancel:!0,tap:!0,doubletap:!0,hold:!0}};function Qe(n,t){var o=n.interaction,s=n.pointer,l=n.event,f=n.eventTarget,p=n.type,h=n.targets,v=h===void 0?Ui(n,t):h,S=new Xi(p,s,l,f,o,t.now());t.fire("pointerEvents:new",{pointerEvent:S});for(var y={interaction:o,pointer:s,event:l,eventTarget:f,targets:v,type:p,pointerEvent:S},k=0;k<v.length;k++){var A=v[k];for(var H in A.props||{})S[H]=A.props[H];var V=nt(A.eventable,A.node);if(S._subtractOrigin(V),S.eventable=A.eventable,S.currentTarget=A.node,A.eventable.fire(S),S._addOrigin(V),S.immediatePropagationStopped||S.propagationStopped&&k+1<v.length&&v[k+1].node!==S.currentTarget)break}if(t.fire("pointerEvents:fired",y),p==="tap"){var G=S.double?Qe({interaction:o,pointer:s,event:l,eventTarget:f,type:"doubletap"},t):S;o.prevTap=G,o.tapTime=G.timeStamp}return S}function Ui(n,t){var o=n.interaction,s=n.pointer,l=n.event,f=n.eventTarget,p=n.type,h=o.getPointerIndex(s),v=o.pointers[h];if(p==="tap"&&(o.pointerWasMoved||!v||v.downTarget!==f))return[];for(var S=de(f),y={interaction:o,pointer:s,event:l,eventTarget:f,type:p,path:S,targets:[],node:null},k=0;k<S.length;k++){var A=S[k];y.node=A,t.fire("pointerEvents:collect-targets",y)}return p==="hold"&&(y.targets=y.targets.filter((function(H){var V,G;return H.eventable.options.holdDuration===((V=o.pointers[h])==null||(G=V.hold)==null?void 0:G.duration)}))),y.targets}function Rr(n){var t=n.interaction,o=n.pointerIndex,s=t.pointers[o].hold;s&&s.timeout&&(clearTimeout(s.timeout),s.timeout=null)}var Hl=Object.freeze({__proto__:null,default:Ft});function Yl(n){var t=n.interaction;t.holdIntervalHandle&&(clearInterval(t.holdIntervalHandle),t.holdIntervalHandle=null)}var Xl={id:"pointer-events/holdRepeat",install:function(n){n.usePlugin(Ft);var t=n.pointerEvents;t.defaults.holdRepeatInterval=0,t.types.holdrepeat=n.actions.phaselessTypes.holdrepeat=!0},listeners:["move","up","cancel","endall"].reduce((function(n,t){return n["pointerEvents:".concat(t)]=Yl,n}),{"pointerEvents:new":function(n){var t=n.pointerEvent;t.type==="hold"&&(t.count=(t.count||0)+1)},"pointerEvents:fired":function(n,t){var o=n.interaction,s=n.pointerEvent,l=n.eventTarget,f=n.targets;if(s.type==="hold"&&f.length){var p=f[0].eventable.options.holdRepeatInterval;p<=0||(o.holdIntervalHandle=setTimeout((function(){t.pointerEvents.fire({interaction:o,eventTarget:l,type:"hold",pointer:s,event:s},t)}),p))}}})},Ul=Xl,Kl={id:"pointer-events/interactableTargets",install:function(n){var t=n.Interactable;t.prototype.pointerEvents=function(s){return ne(this.events.options,s),this};var o=t.prototype._backCompatOption;t.prototype._backCompatOption=function(s,l){var f=o.call(this,s,l);return f===this&&(this.events.options[s]=l),f}},listeners:{"pointerEvents:collect-targets":function(n,t){var o=n.targets,s=n.node,l=n.type,f=n.eventTarget;t.interactables.forEachMatch(s,(function(p){var h=p.events,v=h.options;h.types[l]&&h.types[l].length&&p.testIgnoreAllow(v,s,f)&&o.push({node:s,eventable:h,props:{interactable:p}})}))},"interactable:new":function(n){var t=n.interactable;t.events.getRect=function(o){return t.getRect(o)}},"interactable:set":function(n,t){var o=n.interactable,s=n.options;ne(o.events.options,t.pointerEvents.defaults),ne(o.events.options,s.pointerEvents||{})}}},Gl=Kl,Wl={id:"pointer-events",install:function(n){n.usePlugin(Hl),n.usePlugin(Ul),n.usePlugin(Gl)}},Jl=Wl,Zl={id:"reflow",install:function(n){var t=n.Interactable;n.actions.phases.reflow=!0,t.prototype.reflow=function(o){return(function(s,l,f){for(var p=s.getAllElements(),h=f.window.Promise,v=h?[]:null,S=function(){var k=p[y],A=s.getRect(k);if(!A)return 1;var H,V=Rt(f.interactions.list,(function(re){return re.interacting()&&re.interactable===s&&re.element===k&&re.prepared.name===l.name}));if(V)V.move(),v&&(H=V._reflowPromise||new h((function(re){V._reflowResolve=re})));else{var G=De(A),se=(function(re){return{coords:re,get page(){return this.coords.page},get client(){return this.coords.client},get timeStamp(){return this.coords.timeStamp},get pageX(){return this.coords.page.x},get pageY(){return this.coords.page.y},get clientX(){return this.coords.client.x},get clientY(){return this.coords.client.y},get pointerId(){return this.coords.pointerId},get target(){return this.coords.target},get type(){return this.coords.type},get pointerType(){return this.coords.pointerType},get buttons(){return this.coords.buttons},preventDefault:function(){}}})({page:{x:G.x,y:G.y},client:{x:G.x,y:G.y},timeStamp:f.now()});H=(function(re,fe,ye,we,he){var be=re.interactions.new({pointerType:"reflow"}),Ae={interaction:be,event:he,pointer:he,eventTarget:ye,phase:"reflow"};be.interactable=fe,be.element=ye,be.prevEvent=he,be.updatePointer(he,he,ye,!0),ri(be.coords.delta),xr(be.prepared,we),be._doPhase(Ae);var Te=re.window,Le=Te.Promise,ze=Le?new Le((function(Ue){be._reflowResolve=Ue})):void 0;return be._reflowPromise=ze,be.start(we,fe,ye),be._interacting?(be.move(Ae),be.end(he)):(be.stop(),be._reflowResolve()),be.removePointer(he,he),ze})(f,s,k,l,se)}v&&v.push(H)},y=0;y<p.length&&!S();y++);return v&&h.all(v).then((function(){return s}))})(this,o,n)}},listeners:{"interactions:stop":function(n,t){var o=n.interaction;o.pointerType==="reflow"&&(o._reflowResolve&&o._reflowResolve(),(function(s,l){s.splice(s.indexOf(l),1)})(t.interactions.list,o))}}},Ql=Zl;if(Re.use(Si),Re.use(Pi),Re.use(Jl),Re.use(hl),Re.use(Bl),Re.use(nl),Re.use(Uc),Re.use(Gc),Re.use(Ql),Re.default=Re,c(e)==="object"&&e)try{e.exports=Re}catch{}return Re.default=Re,Re}))})(Kt)),Kt.exports}var fs=us();const ds=Ar(fs);function Fe(e){return e==null?"":typeof e=="string"||typeof e=="number"||typeof e=="boolean"?String(e):typeof e=="function"?e.toString():e instanceof Date?e.toISOString():e instanceof RegExp?e.toString():e instanceof Map?JSON.stringify(Array.from(e.entries())):e instanceof Set?JSON.stringify(Array.from(e.values())):e instanceof WeakMap||e instanceof WeakSet?"":e instanceof ArrayBuffer?e.toString():Array.isArray(e)?JSON.stringify(e.map(Fe)):typeof e=="object"?JSON.stringify(Object.entries(e).sort(([r],[i])=>r.localeCompare(i))):""}function $r(e,{isEnabled:r=!0,onDragStart:i,onDragMove:a,onDragEnd:c,...u}){const d=Ee(i),g=Ee(a),m=Ee(c);N.useLayoutEffect(()=>{if(!r)return;const b=e.current;if(!b)return;const C=ds(b).draggable({inertia:!0,...u,onstart:({client:_})=>{const P=Se.make(_);d.current?.(P)},onmove:({client:_,clientX0:P,clientY0:R,dx:M,dy:T})=>{const j=Se.make(P,R),Z=Se.make(_),q=Se.make(M,T);g.current?.(q,Z,j)},onend:({client:_,clientX0:P,clientY0:R})=>{const M=Se.make(P,R),T=Se.make(_);m.current?.(T,M)}});return()=>{C.unset(),m.current?.(Se.zero,Se.zero)}},[r,Fe(u)])}function st(e,{initialValue:r,transform:i,onDragStart:a,onDragMove:c,onDragEnd:u,...d}){const g=N.useRef(r),[m,b]=N.useState(!1),[C,_]=N.useState(!1),[P,R]=N.useState(r),M=Ee(a),T=Ee(c),j=Ee(u),Z=Ee(i);return $r(e,{onDragStart:x=>{b(!0),_(!1),M.current?.(x)},onDragMove:(x,O,E)=>{const L=Z.current(g.current,x.x,x.y);qr(g,L)&&R(L),b(!0),_(!1),T.current?.(x,O,E)},onDragEnd:(x,O)=>{b(!1),_(!0),j.current?.(x,O)},...d}),N.useEffect(()=>{qr(g,P)},[P]),{isDragging:m,isReleasing:C,value:P,setValue:R}}function qr(e,r){return He(e.current,r)?!1:(e.current=r,!0)}const Gn=N.forwardRef(({angle:e=0,speed:r=1,src:i,zeroAnchor:a=0,onAngleChange:c,onPositionChange:u,onDragStart:d,onDragEnd:g,onLoadImageStart:m,onLoadImageComplete:b,onLoadImageError:C,onImageSizeChange:_,...P},R)=>{const M=N.useCallback((L,U,Q)=>L-U*r,[r]),T=N.useRef(null),j=Be(T),Z=zn({src:i},{onLoadStart:m,onLoadComplete:b,onLoadError:C}),[q,W]=N.useState(e),{isDragging:K,value:x,setValue:O}=st(T,{initialValue:0,transform:M,onDragStart:d,onDragEnd:g});N.useEffect(()=>{if(K||!Z)return;const L=hs(e,Z,xe.size(j),a);L!==x&&O(L),e!==q&&W(e)},[e,Z,j.width,j.height,a]),N.useEffect(()=>{if(!K||!Z)return;const L=gs(x,Z,xe.size(j),a);q!==L&&W(L)},[x,Z,j.width,j.height,a]),N.useEffect(()=>{c?.(q,K),u?.(q/360,K)},[q]),N.useEffect(()=>{_?.(Z)},[Z?.width,Z?.height]);const E=ps({src:i,displacement:x});return w.jsx("div",{...P,ref:R,"aria-valuenow":q,role:"slider",children:w.jsx("div",{ref:T,style:E.body})})});function ps({src:e="",displacement:r=NaN}){return{body:{backgroundImage:`url(${e})`,backgroundPositionX:`${-r}px`,backgroundRepeat:"repeat",backgroundSize:"auto 100%",height:"100%",touchAction:"none",width:"100%"}}}function eo(e,r){const{width:i,height:a}=e,{height:c}=r;if(a<=0)return ke.zero;const d=c/a*i;return ke.make(d,c)}function hs(e,r,i,a){const{width:c}=eo(r,i),{width:u}=i,d=u*a;return e/360*c-d}function gs(e,r,i,a){const{width:c}=eo(r,i),{width:u}=i,d=u*a;let g=(e+d)%c/c*360;for(;g<0;)g+=360;return g}process.env.NODE_ENV==="development"&&(Gn.displayName="Panorama");const to=N.forwardRef(({className:e,style:r,angle:i=0,autoDimension:a="width",children:c,fov:u,speed:d=1,src:g,viewportSize:m,zeroAnchor:b=0,onAngleChange:C,onDragEnd:_,onDragStart:P,onLoadImageComplete:R,onLoadImageError:M,onLoadImageStart:T,onImageSizeChange:j,onPositionChange:Z,...q},W)=>{const K=N.useRef(null),x=Be(K),[O,E]=N.useState(),[L,U]=N.useState(!1),ie=N.useCallback(()=>{if(!O)return 0;const{width:z,height:I}=O;return I===0?0:z/I},[O?.width,O?.height])(),B=N.useCallback(()=>{const z=Math.min(360,Math.max(0,u??(m?m.width/(m.height*ie)*360:0)));return x.width*(z/360)},[m?.width,m?.height,ie,x.width,u])(),X=N.useCallback(()=>x.width<=0?b:((x.width-B)*.5+b*B)/x.width,[x.width,B,b])(),oe=N.useCallback(()=>{U(!0),P?.()},[P]),ae=N.useCallback(()=>{U(!1),_?.()},[_]),ue=Pe(c,{track:vt,reticle:Wt,indicator:Gt}),Y=vs({autoDimension:a,panoramaRect:x,aspectRatio:ie,reticleWidth:B});return w.jsxs("div",{...q,ref:W,className:ce(e,{dragging:L}),style:le(r,Y.root),children:[w.jsx(Gn,{ref:K,angle:i,speed:d,src:g,style:Y.panorama,zeroAnchor:X,onAngleChange:C,onDragEnd:ae,onDragStart:oe,onImageSizeChange:E,onLoadImageComplete:R,onLoadImageError:M,onLoadImageStart:T,onPositionChange:Z}),w.jsx("div",{style:Y.body,children:w.jsxs("div",{style:Y.controls,children:[w.jsx(me,{className:ce({dragging:L}),element:ue.track??w.jsx(vt,{}),style:Y.track}),w.jsx(me,{className:ce({dragging:L}),element:ue.reticle??w.jsx(Wt,{}),style:Y.reticle}),w.jsx(me,{className:ce({dragging:L}),element:ue.track??w.jsx(vt,{}),style:Y.track})]})}),w.jsx(me,{className:ce({dragging:L}),element:ue.indicator??w.jsx(Gt,{}),style:Y.indicator})]})}),Gt=({...e})=>w.jsx("div",{...e}),Wt=({...e})=>w.jsx("div",{...e}),vt=({...e})=>w.jsx("div",{...e}),ms=Object.assign(to,{Indicator:Gt,Reticle:Wt,Track:vt});function vs({autoDimension:e="width",panoramaRect:r=xe.zero,aspectRatio:i=0,reticleWidth:a=0}){return{root:{...e==="width"?{width:`${r.height*i}px`}:{height:`${r.width/i}px`}},body:{height:"100%",left:"0",overflow:"hidden",pointerEvents:"none",position:"absolute",top:"0",width:"100%"},panorama:{height:"100%",width:"100%"},controls:{alignItems:"center",display:"flex",height:"100%",justifyContent:"flex-start",left:"0",overflow:"visible",position:"absolute",top:"0",width:"100%"},track:{flex:"1 0 auto"},reticle:{width:`${a}px`},indicator:{width:`${a}px`}}}process.env.NODE_ENV==="development"&&(to.displayName="PanoramaSlider",Gt.displayName="PanoramaSlider.Indicator",Wt.displayName="PanoramaSlider.Reticle",vt.displayName="PanoramaSlider.Track");const no=N.forwardRef(({children:e,className:r,isDeselectable:i=!1,isDisabled:a=!1,isSelected:c=!1,label:u,onDeselect:d,onSelect:g,onToggle:m,...b},C)=>{const _=()=>{if(!a)if(c){if(!i)return;m?.(c),d?.()}else m?.(c),g?.()};return w.jsx("button",{...b,...a?{"aria-disabled":!0}:{},ref:C,"aria-label":u,"aria-selected":c,className:ce(r,{active:c,disabled:a||c&&!i}),disabled:a||c&&!i,onClick:_,children:e??u})});process.env.NODE_ENV==="development"&&(no.displayName="SelectableButton");function ro({children:e,if:r}){return typeof r==="function"?r()?w.jsx(w.Fragment,{children:e}):w.jsx(w.Fragment,{}):r?w.jsx(w.Fragment,{children:e}):w.jsx(w.Fragment,{})}process.env.NODE_ENV==="development"&&(ro.displayName="Conditional");function yt({in:e,children:r,render:i}){if(e==null)return w.jsx(w.Fragment,{});if(!(e instanceof Array))throw TypeError(`Provided list <${e}> is not an array`);return w.jsx(w.Fragment,{children:e.map((a,c)=>w.jsx(N.Fragment,{children:i?.(a,c)??(typeof r=="function"?r(a,c):r)},`item-${c}`))})}process.env.NODE_ENV==="development"&&(yt.displayName="Each");function oo({children:e,condition:r}){const i=N.Children.toArray(e);if(i.length===0)return console.error("[etudes::Switch] `Switch` must have at least one child"),w.jsx(w.Fragment,{});if(!bs(i))return console.error("[etudes::Switch] `Switch` children must be of `Case` type or `Default` type"),w.jsx(w.Fragment,{});const a=i.filter(u=>u.type===Jt);if(a.length>1)return console.error("[etudes::Switch] `Switch` can only have maximum one `Default` child"),w.jsx(w.Fragment,{});const c=a[0];for(const u of i)if(typeof r=="function"){if(r(u.props.value))return u}else if(r===u.props.value)return u;if(c)return c}function Wn({children:e}){return e}function Jt({children:e}){return e}const ys=Object.assign(oo,{Case:Wn,Default:Jt});function bs(e){return e.every(r=>N.isValidElement(r)&&(r.type===Wn||r.type===Jt))}process.env.NODE_ENV==="development"&&(oo.displayName="Switch",Wn.displayName="Switch.Case",Jt.displayName="Switch.Default");const Jn=N.forwardRef(({children:e,...r},i)=>(Array.isArray(e)&&console.error(`[etudes::ExtractChild] Only one child is expected, but found ${e.length}. Only the first child is extracted while the rest are discarded.`),N.Children.map(e,(a,c)=>{if(!(c>0))return N.isValidElement(a)?Bt(a,{...r,ref:i}):a})));process.env.NODE_ENV==="development"&&(Jn.displayName="ExtractChild");function io({children:e,className:r,style:i,alignment:a,arrowHeight:c=6,arrowWidth:u=12,gap:d=4,hint:g,maxWidth:m=200,threshold:b=100}){const C=N.useRef(null),_=N.useRef(void 0),P=Be(C),R=N.useCallback(()=>{const j=window.document.createElement("span");j.className=ce(r),j.innerHTML=g,j.role="tooltip";const Z=a??(C.current?xs(C.current,b):"tl"),q=ws(j),W=Ss({alignment:Z,arrowSize:ke.make(u,c),gap:d,maxDialogWidth:m,fullDialogWidth:q.width,targetWidth:P.width}),K=le(i,W.dialog);Object.keys(K).forEach(O=>j.style[O]=K[O]);const x=window.document.createElement("span");return Object.keys(W.arrow).forEach(O=>x.style[O]=W.arrow[O]),j.appendChild(x),j},[r,a,g,m,Fe(i),P.width,b,c,u,d]),M=N.useCallback(()=>{_.current&&(_.current.style.opacity="1",_.current.ariaHidden="false")},[]),T=N.useCallback(()=>{_.current&&(_.current.style.opacity="0",_.current.ariaHidden="true")},[]);return N.useEffect(()=>{const j=R();return C.current?.appendChild(j),_.current=j,()=>{C.current?.removeChild(j),_.current=void 0}},[R]),w.jsx(Jn,{ref:C,onMouseEnter:M,onMouseLeave:T,children:e})}function ws(e){if(typeof window>"u")return ke.zero;const r=e.cloneNode(!1);r.innerHTML=e.innerHTML,r.style.visibility="hidden",r.style.whiteSpace="pre",window.document.body.appendChild(r);const i=r.getBoundingClientRect();return window.document.body.removeChild(r),ke.make(i.width,i.height)}function xs(e,r){const i=xe.fromViewport(),a=xe.intersecting(e),c=a.left-i.left<r,u=i.right-a.right<r,d=a.top-i.top<r,g=i.bottom-a.bottom<r;return c&&d?"br":c&&g?"tr":u&&d?"bl":u&&g?"tl":c?"cr":u?"cl":"tc"}function Es({alignment:e,arrowSize:r,fullDialogWidth:i,gap:a,maxDialogWidth:c,targetWidth:u}){const d=Math.min(i,c),g=u>d;switch(e){case"tl":return{bottom:`calc(100% + ${r.height}px + ${a}px)`,right:g?"":"0",left:g?"50%":"",transform:`translate(${d>u?"0":"-50%"}, 0)`};case"tc":return{bottom:`calc(100% + ${r.height}px + ${a}px)`,left:"50%",transform:"translateX(-50%)"};case"tr":return{bottom:`calc(100% + ${r.height}px + ${a}px)`,left:g?"50%":"0",transform:`translate(${d>u?"0":"-50%"}, 0)`};case"cl":return{top:"50%",right:`calc(100% + ${r.height+a}px)`,transform:"translate(0, -50%)"};case"cr":return{top:"50%",left:`calc(100% + ${r.height+a}px)`,transform:"translate(0, -50%)"};case"bl":return{left:g?"50%":"",right:g?"":"0",top:`calc(100% + ${r.height}px + ${a}px)`,transform:`translate(${d>u?"0":"-50%"}, 0)`};case"bc":return{left:"50%",top:`calc(100% + ${r.height}px + ${a}px)`,transform:"translateX(-50%)"};case"br":return{left:g?"50%":"0",top:`calc(100% + ${r.height}px + ${a}px)`,transform:`translate(${d>u?"0":"-50%"}, 0)`};default:return console.error(`[etudes::WithTooltip] Invalid alignment: ${e}`),{}}}function Ns({alignment:e,arrowSize:r,fullDialogWidth:i,maxDialogWidth:a,targetWidth:c}){const u=Math.min(i,a),d=c>u;switch(e){case"tl":return{bottom:0,clipPath:"polygon(50% 100%,100% 0,0 0)",height:`${r.height}px`,left:d?"50%":"",right:d?"":`${c-r.width/2-c/2}px`,transform:`translate(${d?"-50%":"0"}, 100%)`,width:`${r.width}px`};case"tc":return{bottom:0,clipPath:"polygon(50% 100%,100% 0,0 0)",height:`${r.height}px`,left:"50%",transform:"translate(-50%, 100%)",width:`${r.width}px`};case"tr":return{bottom:0,clipPath:"polygon(50% 100%,100% 0,0 0)",height:`${r.height}px`,left:d?"50%":`${c-r.width/2-c/2}px`,transform:`translate(${d?"-50%":"0"}, 100%)`,width:`${r.width}px`};case"cl":return{clipPath:"polygon(0 0,100% 50%,0 100%)",height:`${r.width}px`,right:"0",top:"50%",transform:"translate(100%, -50%)",width:`${r.height}px`};case"cr":return{clipPath:"polygon(100% 0,0 50%,100% 100%)",height:`${r.width}px`,left:"0",top:"50%",transform:"translate(-100%, -50%)",width:`${r.height}px`};case"bl":return{clipPath:"polygon(50% 0,100% 100%,0 100%)",height:`${r.height}px`,left:d?"50%":"",right:d?"":`${c-r.width/2-c/2}px`,top:"0",transform:`translate(${d?"-50%":"0"}, -100%)`,width:`${r.width}px`};case"bc":return{clipPath:"polygon(50% 0,100% 100%,0 100%)",height:`${r.height}px`,left:"50%",top:"0",transform:"translate(-50%, -100%)",width:`${r.width}px`};case"br":return{clipPath:"polygon(50% 0,100% 100%,0 100%)",height:`${r.height}px`,left:d?"50%":`${c-r.width/2-c/2}px`,top:"0",transform:`translate(${d?"-50%":"0"}, -100%)`,width:`${r.width}px`};default:return console.error(`[etudes::WithTooltip] Invalid alignment: ${e}`),{}}}function Ss({alignment:e,arrowSize:r,fullDialogWidth:i,gap:a,maxDialogWidth:c,targetWidth:u}){return{dialog:{boxSizing:"border-box",height:"auto",margin:"0",opacity:"0",pointerEvents:"none",position:"absolute",userSelect:"none",whiteSpace:i>c?"normal":"pre",width:i>c?`${c}px`:"",...Es({alignment:e,arrowSize:r,fullDialogWidth:i,gap:a,maxDialogWidth:c,targetWidth:u})},arrow:{background:"inherit",position:"absolute",...Ns({alignment:e,arrowSize:r,fullDialogWidth:i,maxDialogWidth:c,targetWidth:u})}}}process.env.NODE_ENV==="development"&&(io.displayName="WithTooltip");function Ts(e,{element:r,isEnabled:i=!0}={}){N.useLayoutEffect(()=>{if(!i)return;const a=r??window.document.documentElement,c=a.classList;return a.classList.add(e),()=>{c.contains(e)||a.classList.remove(e)}},[e,r,i])}function _s(e,r){const i=Ee(r);N.useLayoutEffect(()=>{const a=c=>{if(!(c.target instanceof Node))return;let u=!0,d=c.target;const m=[].concat(e).map(b=>b.current);for(;d;){if(m.find(b=>b===d)){u=!1;break}if(!d.parentNode)break;d=d.parentNode}u&&i.current()};return window.addEventListener("click",a,!0),()=>{window.removeEventListener("click",a,!0)}},[])}function Cs(){return N.useCallback(async e=>{const r=e.type,i=new ClipboardItem({[r]:e});try{await navigator.clipboard.write([i])}catch(a){console.error("[etudes::useCopyBlobToClipboard] Failed to copy blob to clipboard:",a)}},[])}function ks(){return N.useCallback((e,r)=>{const i=URL.createObjectURL(e),a=document.createElement("a");a.href=i,a.download=r,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(i)},[])}function Os(){return typeof window>"u"?1:window.devicePixelRatio||1}function Ps(){return N.useMemo(()=>Os(),[])}function so(e,{isEnabled:r=!0,updatesCursor:i=!0,onDragStart:a,onDragMove:c,onDragEnd:u}){const d=N.useRef(void 0),g=N.useRef(void 0),m=Ee(a),b=Ee(c),C=Ee(u),_=N.useCallback(M=>{if(!d.current)return;const T=Se.make(M.clientX,M.clientY),j=Se.subtract(T,g.current??d.current);g.current=T,b.current?.(j,T,d.current)},[]),P=N.useCallback(M=>{const T=e.current;if(!T||!d.current)return;const j=Se.make(M.clientX,M.clientY),Z=Se.subtract(g.current??d.current,j);C.current?.(j,Z,d.current),d.current=void 0,g.current=void 0,T.removeEventListener("mousemove",_),T.removeEventListener("mouseup",P,{capture:!0}),T.removeEventListener("mouseleave",P),i&&(T.style.cursor="grab")},[i,_]),R=N.useCallback(M=>{const T=e.current;if(!T)return;M.preventDefault();const j=Se.make(M.clientX,M.clientY);d.current=j,g.current=j,T.addEventListener("mousemove",_),T.addEventListener("mouseup",P,{capture:!0}),T.addEventListener("mouseleave",P),i&&(T.style.cursor="grabbing"),m.current?.(j)},[i,_,P]);N.useLayoutEffect(()=>{const M=e.current;if(!M||!r||!i)return;const T=M.style.cursor;return M.style.cursor="grab",()=>{M.style.cursor=T}},[r,i]),N.useLayoutEffect(()=>{const M=e.current;if(!(!M||!r))return M.addEventListener("mousedown",R),()=>{M.removeEventListener("mousedown",R),M.removeEventListener("mousemove",_),M.removeEventListener("mouseup",P,{capture:!0}),M.removeEventListener("mouseleave",P)}},[r,_,P,R])}function Is(e){const[r,i]=N.useState(!1),a=N.useCallback(d=>{d.preventDefault(),d.stopPropagation(),i(!0)},[]),c=N.useCallback(d=>{d.preventDefault(),d.stopPropagation(),i(!1)},[]),u=N.useCallback(d=>{d.preventDefault(),d.stopPropagation(),i(!1);const g=d.dataTransfer.files;if(g&&g.length>0){const m=g[0];new FormData().append("file",m),e(m)}},[]);return{isDropping:r,onDragOver:a,onDragLeave:c,onDrop:u}}function ao(e,{autoStarts:r=!0,shouldInvokeInitially:i=!1,onInterval:a},c=[]){const u=N.useRef(void 0),d=Ee(a),g=N.useCallback(()=>{clearInterval(u.current),u.current=void 0},[]),m=N.useCallback(()=>{g(),!(e<0)&&(i&&d.current(),u.current=setInterval(()=>{d.current()},e))},[e,i,g]);return N.useEffect(()=>(r&&e>0&&m(),g),[r,e,m,g,...c]),{start:m,stop:g}}function js(){const[e,r]=N.useState(!1);return N.useEffect(()=>(r(!0),()=>{r(!1)}),[]),e}function co(){return typeof window>"u"?!1:!!(typeof window.navigator<"u"&&(window.navigator.maxTouchPoints>0||"msMaxTouchPoints"in window.navigator&&window.navigator.msMaxTouchPoints>0)||window.matchMedia("(pointer: coarse)").matches||window.matchMedia("(hover: none)").matches||"ontouchstart"in window||"ontouchstart"in window.document.documentElement)}function lo(){return N.useMemo(()=>co(),[])}function Rs(e,r,{capture:i=!1,isEnabled:a=!0,preventsDefault:c=!0,stopsPropagation:u=!0,target:d}={}){const g=Ee(r),m=Array.isArray(e)?e:[e],b=N.useMemo(()=>m.map(C=>C.toLowerCase()).sort(),[m]);N.useEffect(()=>{if(!a||b.length===0)return;const C=d&&typeof d=="object"&&"current"in d?d.current:d||window;if(!C)return;const _=P=>{const R=new Set([P.key.toLowerCase(),P.ctrlKey&&"control",P.metaKey&&"meta",P.shiftKey&&"shift",P.altKey&&"alt"].filter(Boolean));b.every(T=>R.has(T))&&R.size===b.length&&(c&&P.preventDefault(),u&&P.stopPropagation(),g.current?.())};return C.addEventListener("keydown",_,{capture:i}),()=>{C.removeEventListener("keydown",_,{capture:i})}},[a,c,i,b.join(",")])}const Zn=typeof window<"u"?window.localStorage:void 0;function uo({defaultTTL:e=300}={}){return{get:Ms,invalidate:fo,set:(r,i,a=e)=>Ls(r,i,a)}}function fo(e){Zn?.removeItem(e)}function As(e){const{timestamp:r,ttl:i}=e;return(Date.now()-r)/1e3>=i}function Ms(e){const r=Zn?.getItem(e);if(!r)return;const i=JSON.parse(r);if(i)if(As(i)){fo(e);return}else return i.value}function Ls(e,r,i){const a={value:e,timestamp:Date.now(),ttl:i};return Zn?.setItem(r,JSON.stringify(a)),e}function zs(e){return N.useMemo(()=>uo({defaultTTL:e}),[e])}function Fs(){const e=navigator.userAgent||navigator.vendor||window.opera;return N.useMemo(()=>{switch(!0){case/android/i.test(e):return"android";case(/iPad|iPhone|iPod/.test(e)&&!window.MSStream):return"ios";case/win/i.test(e):return"windows";case/mac/i.test(e):return"macos";case/linux/i.test(e):return"linux";default:return"unknown"}},[e])}function Vs(e,r=[]){const i=Ee(e),a=N.useRef(void 0),c=N.useRef(!1);N.useLayoutEffect(()=>{const u=()=>{const g=Ds();g&&(i.current(g,a.current),a.current=g)},d=()=>{c.current||typeof requestAnimationFrame=="function"&&(c.current=!0,requestAnimationFrame(()=>{u(),c.current=!1}))};return window.addEventListener("scroll",d,{passive:!0}),window.addEventListener("resize",d),window.addEventListener("orientationchange",d),d(),()=>{window.removeEventListener("scroll",d),window.removeEventListener("resize",d),window.removeEventListener("orientationchange",d)}},[...r])}function Ds(){const e=xe.fromViewport(),r=xe.clone(e,{x:0,y:0}),i=xe.from(window,{overflow:!0}),a=xe.clone(r,{x:i.width-e.width,y:i.height-e.height}),c=Se.make(e.left/a.left,e.top/a.top);return{minPos:Se.make(r.left,r.top),maxPos:Se.make(a.left,a.top),pos:Se.make(e.left,e.top),step:c}}function po(e){const r=N.useRef(void 0);return N.useEffect(()=>{r.current=e},[e]),r.current}const Qn=typeof window<"u"?window.sessionStorage:void 0;function ho({defaultTTL:e=300}={}){return{get:Hs,invalidate:go,set:(r,i,a=e)=>Ys(r,i,a)}}function go(e){Qn?.removeItem(e)}function Bs(e){const{timestamp:r,ttl:i}=e;return(Date.now()-r)/1e3>=i}function Hs(e){const r=Qn?.getItem(e);if(!r)return;const i=JSON.parse(r);if(i)if(Bs(i)){go(e);return}else return i.value}function Ys(e,r,i){const a={value:e,timestamp:Date.now(),ttl:i};return Qn?.setItem(r,JSON.stringify(a)),e}function Xs(e){return N.useMemo(()=>ho({defaultTTL:e}),[e])}function $n(e){const[r,i]=N.useState(ke.zero);return Yt(e,{onResize:a=>{const c=xe.from(a);if(!c)return;const u=xe.size(c);i(d=>ke.isEqual(d,u)?d:u)}}),r}function mo(e,{element:r,computed:i}){if(typeof window>"u")return;const a=r??window.document.documentElement;return i?window.getComputedStyle(a).getPropertyValue(e)||void 0:a.style.getPropertyValue(e)||void 0}function qn(e,r,{element:i}={}){if(typeof window>"u")return;const a=i??window.document.documentElement;r===void 0?a.style.removeProperty(e):a.style.setProperty(e,r)}function Us(e,r,{element:i,isEnabled:a=!0}={}){N.useLayoutEffect(()=>{if(!a)return;const c=i??window.document.documentElement,u=mo(e,{element:c,computed:!1});return qn(e,r,{element:c}),()=>{qn(e,u,{element:c})}},[e,r,i,a])}function Ks(e="light"){const[r,i]=N.useState(e);return N.useLayoutEffect(()=>{const a=window.matchMedia("(prefers-color-scheme: dark)");function c(u){i(u.matches?"dark":"light")}return i(a.matches?"dark":"light"),a.addEventListener("change",c),()=>{a.removeEventListener("change",c)}},[]),r}function Gs(e,{autoStarts:r=!0,onTimeout:i},a=[]){const c=N.useRef(void 0),u=Ee(i),d=N.useCallback(()=>{c.current!==void 0&&(clearTimeout(c.current),c.current=void 0)},[]),g=N.useCallback(()=>{d(),!(e<0)&&(c.current=setTimeout(()=>{d(),u.current()},e))},[e,d]);return N.useEffect(()=>(r&&e>=0&&g(),d),[r,e,g,d,...a]),{start:g,stop:d}}const vo=N.forwardRef(({className:e,children:r,style:i,isSelectionTogglable:a=!1,itemLength:c,itemPadding:u=0,items:d=[],layout:g="list",numSegments:m=1,orientation:b="vertical",selection:C,selectionMode:_="none",onActivateAt:P,onDeselectAt:R,onCustomEvent:M,onSelectAt:T,onSelectionChange:j,ItemComponent:Z,...q},W)=>{const K=Js(C??[],d),x=Zs({itemLength:c,itemPadding:u,layout:g,numSegments:m,orientation:b}),O=B=>K.indexOf(B)>=0,E=B=>{O(B)?U(B):L(B)},L=B=>{if(O(B))return;let F;switch(_){case"multiple":{F=ae=>yo([...ae.filter(ue=>ue!==B),B]);break}case"single":{F=ae=>[B];break}default:return}const X=K,oe=F(K);ie(X,oe)},U=B=>{if(!O(B))return;const F=ae=>ae.filter(ue=>ue!==B),X=K,oe=F(K);ie(X,oe)},Q=B=>{P?.(B),_!=="none"&&(a?E(B):L(B))},ie=(B,F)=>{if(He(B,F))return;const X=B?.filter(ae=>F.indexOf(ae)===-1)??[],oe=F.filter(ae=>B?.indexOf(ae)===-1);X.forEach(ae=>R?.(ae)),oe.forEach(ae=>T?.(ae)),j?.(F)};N.useEffect(()=>{const B=K;let F;switch(_){case"multiple":F=K;break;case"single":F=K.slice(-1);break;default:F=[];break}ie(B,F)},[_]);const te=Pe(r,{item:Zt});return w.jsx("div",{...q,ref:W,"aria-multiselectable":_==="multiple",className:ce(e),role:g==="grid"?"grid":_==="none"?"list":"listbox",style:le(i,x.root),children:w.jsx(yt,{in:d,children:(B,F)=>{const X=g==="grid"?"gridcell":_==="none"?"listitem":"option",oe=O(F),ae=le(x.item,{pointerEvents:a!==!0&&O(F)?"none":"auto",...F>=d.length-1?{}:{...g==="list"?{...b==="vertical"?{marginBottom:`${u}px`}:{marginRight:`${u}px`}}:{}}});return Z?w.jsx(Z,{"aria-selected":oe,className:ce({active:oe}),index:F,isSelected:O(F),item:B,orientation:b,role:X,style:ae,onClick:()=>Q(F),onCustomEvent:(ue,Y)=>M?.(F,ue,Y)}):w.jsx(me,{"aria-selected":oe,className:ce({active:oe}),element:te.item??w.jsx(Zt,{}),role:X,selectionMode:_,style:ae,onActivateAt:P,onClick:()=>Q(F),children:`${B}`})}})})}),Zt=({children:e,selectionMode:r,onActivateAt:i,...a})=>i||r==="single"||r==="multiple"?w.jsx("button",{...a,children:e}):w.jsx("div",{...a,children:e}),bt=Object.assign(vo,{Item:Zt});function Ws(e,r){return!!(isNaN(e)||e>=r.length||e<0)}function Js(e,r){return yo(e).filter(i=>!Ws(i,r))}function yo(e){return e.sort((r,i)=>r-i)}function Zs({itemLength:e=NaN,itemPadding:r=0,layout:i="collection",numSegments:a=1,orientation:c="vertical"}){return{root:{counterReset:"item-counter",listStyle:"none",...i==="list"?{alignItems:"flex-start",display:"flex",flex:"0 0 auto",flexDirection:c==="horizontal"?"row":"column",justifyContent:"flex-start"}:{display:"grid",gap:`${r}px`,...c==="vertical"?{gridAutoRows:isNaN(e)?void 0:`${e}px`,gridTemplateColumns:`repeat(${a}, 1fr)`,gridAutoFlow:"row"}:{gridAutoColumns:isNaN(e)?void 0:`${e}px`,gridTemplateRows:`repeat(${a}, 1fr)`,gridAutoFlow:"column"}}},item:{counterIncrement:"item-counter",flex:"0 0 auto",...i==="list"?{...c==="vertical"?{width:"100%",height:isNaN(e)?void 0:`${e}px`}:{width:isNaN(e)?void 0:`${e}px`,height:"100%"}}:{}}}}process.env.NODE_ENV==="development"&&(vo.displayName="Collection",Zt.displayName="Collection.Item");const bo=N.forwardRef(({children:e,style:r,autoCollapseSections:i=!1,expandedSectionIndices:a,orientation:c="vertical",sectionPadding:u=0,sections:d,selection:g,selectionMode:m="single",onActivateAt:b,onCollapseSectionAt:C,onDeselectAt:_,onExpandedSectionsChange:P,onExpandSectionAt:R,onHeaderCustomEvent:M,onItemCustomEvent:T,onSelectAt:j,onSelectionChange:Z,HeaderComponent:q,ItemComponent:W,...K},x)=>{const O=ea(g??{},d),E=qs(a??[],d),L=ta({orientation:c}),U=d.map(()=>N.useRef(null)),Q=U.map($n),ie=(Y,z)=>(O[z]?.indexOf(Y)??-1)>=0,te=Y=>E.indexOf(Y)>=0,B=Y=>{let z;te(Y)?z=I=>I.filter(J=>J!==Y):i?z=I=>[Y]:z=I=>[...I.filter(J=>J!==Y),Y],oe(E,z(E))},F=(Y,z)=>{if(ie(Y,z))return;let I;switch(m){case"multiple":I=ee=>({...ee,[z]:qt([...(ee[z]??[]).filter($=>$!==Y),Y])});break;case"single":I=ee=>({[z]:[Y]});break;default:return}const J=I(O);ae(O,J)},X=(Y,z)=>{if(!ie(Y,z))return;const J=(ee=>({...ee,[z]:(ee[z]??[]).filter($=>$!==Y)}))(O);ae(O,J)},oe=(Y,z)=>{if(He(Y,z))return;const I=Y?.filter(ee=>z.indexOf(ee)===-1)??[],J=z.filter(ee=>Y?.indexOf(ee)===-1);I.forEach(ee=>C?.(ee)),J.forEach(ee=>R?.(ee)),P?.(z)},ae=(Y,z)=>{if(He(Y,z))return;const I=d.length;let J=[],ee=[];for(let $=0;$<I;$++){const pe=Y?.[$]??[],ve=z[$]??[],de=pe.filter(ne=>ve.indexOf(ne)===-1),Ne=ve.filter(ne=>pe?.indexOf(ne)===-1);J=[...J,...de.map(ne=>[ne,$])],ee=[...ee,...Ne.map(ne=>[ne,$])]}J.forEach($=>_?.($[0],$[1])),ee.forEach($=>j?.($[0],$[1])),Z?.(z)},ue=Pe(e,{collapseIcon:tr,expandIcon:er,header:Qt,item:$t,section:nr});return w.jsx("div",{ref:x,style:le(r,L.root),...K,children:w.jsx(yt,{in:d,children:(Y,z)=>{const{collectionPadding:I=0,items:J=[],itemLength:ee=50,itemPadding:$=0,isSelectionTogglable:pe,layout:ve="list",maxVisible:de=-1,numSegments:Ne=1}=Y,ne=ve==="list"?J.length:Math.ceil(J.length/Ne),Ve=de<0?ne:Math.min(ne,de),Ie=ee*Ve+$*(Ve-1),Ce=!te(z),De=Q[z],lt=Ce?De.width:Ie+De.width+I,nt=Ce?De.height:Ie+De.height+I;return w.jsxs(me,{element:ue.section??w.jsx(nr,{}),style:le(L.section,c==="vertical"?{marginTop:z===0?"0px":`${u}px`,...De.height>0?{height:`${nt}px`}:{visibility:"hidden"}}:{marginLeft:z===0?"0px":`${u}px`,...De.width>0?{width:`${lt}px`}:{visibility:"hidden"}}),children:[w.jsx("div",{ref:U[z],style:le(L.headerContainer),children:q?w.jsx(q,{"aria-expanded":!Ce,className:ce({collapsed:Ce,expanded:!Ce}),index:z,isCollapsed:Ce,role:"button",section:Y,style:le(L.header),onClick:()=>B(z),onCustomEvent:(Oe,ut)=>M?.(z,Oe,ut)}):w.jsxs(me,{"aria-expanded":!Ce,className:ce({collapsed:Ce,expanded:!Ce}),element:ue.header??w.jsx(Qt,{}),role:"button",style:le(L.header),onClick:()=>B(z),children:[w.jsx("span",{dangerouslySetInnerHTML:{__html:Y.label}}),ue.expandIcon&&w.jsx(me,{className:ce({collapsed:Ce,expanded:!Ce}),element:Ce?ue.collapseIcon??ue.expandIcon:ue.expandIcon,style:le(Ce?L.collapseIcon:L.expandIcon)})]})}),w.jsx("div",{role:"region",style:le({pointerEvents:Ce?"none":"auto"},c==="vertical"?{width:"100%",height:`${Ie}px`,marginTop:`${I}px`,overflowY:de<0||de>=ne?"hidden":"scroll"}:{marginLeft:`${I}px`,overflowX:de<0||de>=ne?"hidden":"scroll",width:`${Ie}px`,height:"100%"}),children:w.jsx(bt,{className:ce({collapsed:Ce,expanded:!Ce}),isSelectionTogglable:pe,ItemComponent:W,itemLength:ee,itemPadding:$,items:J,layout:ve,numSegments:Ne,orientation:c,selection:O[z]??[],selectionMode:m,style:le(c==="vertical"?{width:"100%"}:{height:"100%"}),onActivateAt:Oe=>b?.(Oe,z),onCustomEvent:(Oe,ut,rt)=>T?.(Oe,z,ut,rt),onDeselectAt:Oe=>X(Oe,z),onSelectAt:Oe=>F(Oe,z),children:!W&&(ue.item??w.jsx($t,{}))})})]})}})})}),Qt=({children:e,...r})=>w.jsx("button",{...r,children:e}),er=({children:e,...r})=>w.jsx("figure",{...r,children:e}),tr=({children:e,...r})=>w.jsx("figure",{...r,children:e}),nr=({children:e,...r})=>w.jsx("div",{...r,children:e}),$t=bt.Item,Qs=Object.assign(bo,{Header:Qt,ExpandIcon:er,CollapseIcon:tr,Section:nr,Item:$t});function wo(e,r){return e>=r.length||e<0}function $s(e,r,i){if(wo(r,i))return!0;const a=i[r].items??[];return e>=a.length||e<0}function qs(e,r){return qt(e).filter(i=>!wo(i,r))}function ea(e,r){const i={};for(const a in r){if(!Object.hasOwn(r,a))continue;const c=qt([...e[a]??[]]);i[Number(a)]=qt(c).filter(u=>!$s(u,Number(a),r))}return i}function qt(e){return e.sort((r,i)=>r-i)}function ta({orientation:e="vertical"}){return{root:{alignItems:"center",boxSizing:"border-box",display:"flex",flex:"0 0 auto",justifyContent:"flex-start",padding:"0",...e==="vertical"?{flexDirection:"column",height:"auto"}:{flexDirection:"row",width:"auto"}},collapseIcon:{pointerEvents:"none",zIndex:1},expandIcon:{pointerEvents:"none",zIndex:1},section:{alignItems:"flex-start",display:"flex",flex:"0 0 auto",justifyContent:"flex-start",margin:"0",overflow:"hidden",padding:"0",...e==="vertical"?{flexDirection:"column",width:"100%"}:{flexDirection:"row",height:"100%"}},headerContainer:{flexShrink:"0",...e==="vertical"?{width:"100%"}:{height:"100%"}},header:{cursor:"pointer",margin:"0",...e==="vertical"?{width:"100%"}:{height:"100%"}}}}process.env.NODE_ENV==="development"&&(bo.displayName="Accordion",Qt.displayName="Accordion.Header",er.displayName="Accordion.ExpandIcon",tr.displayName="Accordion.CollapseIcon",$t.displayName="Accordion.Item");const xo=N.forwardRef(({autoAdvanceInterval:e=0,index:r=0,isDragEnabled:i=!0,items:a=[],orientation:c="horizontal",tracksItemExposure:u=!1,onAutoAdvancePause:d,onAutoAdvanceResume:g,onIndexChange:m,ItemComponent:b,...C},_)=>{const P=N.useRef(void 0),R=N.useRef(null),M=N.useRef(void 0),T=N.useRef(void 0),j=N.useRef(void 0),Z=1e3,q=Ee(d),W=Ee(g),K=Ee(m),x=N.useRef(!1),O=N.useRef(!1),E=lo(),[L,U]=N.useState(Eo(R,c)),[Q,ie]=N.useState(!1),te=oa({scrollSnapEnabled:E||!Q,orientation:c}),B=e>0,F=N.useCallback(()=>{j.current!==void 0&&(clearTimeout(j.current),j.current=void 0)},[]),X=N.useCallback(()=>{F(),j.current=setTimeout(()=>{clearTimeout(j.current),j.current=void 0},Z)},[Z,F]),oe=N.useCallback(()=>{na(R,r,c),X()},[r,c]),ae=N.useCallback(()=>{U(Eo(R,c))},[c]),ue=N.useCallback($=>{E||(M.current=Se.make($.clientX,$.clientY),ie(!0))},[E]),Y=N.useCallback($=>{E||(T.current=Se.make($.clientX,$.clientY),oe(),ie(!1))},[E,oe]),z=N.useCallback($=>{const pe=M.current,ve=T.current;if(!pe||!ve)return;const de=5,Ne=Se.subtract(pe,ve);(Math.abs(Ne.x)>de||Math.abs(Ne.y)>de)&&$.stopPropagation(),M.current=void 0,T.current=void 0},[]),I=N.useCallback(()=>{const $=(r+a.length+1)%a.length;K.current?.($)},[Q,r,a.length]),J=N.useCallback(({x:$,y:pe})=>{const ve=R.current;!ve||x.current||(F(),x.current=!0,requestAnimationFrame(()=>{switch(c){case"horizontal":ve.scrollLeft-=$*1.5;break;case"vertical":ve.scrollTop-=pe*1.5;default:console.error(`[etudes::Carousel] Unsupported orientation: ${c}`)}x.current=!1}))},[c]),ee=N.useCallback(()=>{const $=R.current;!$||O.current||(O.current=!0,requestAnimationFrame(()=>{if(u&&ae(),!(j.current!==void 0)){const ve=Math.round(c==="horizontal"?$.scrollLeft/$.clientWidth:$.scrollTop/$.clientHeight),de=Math.max(0,Math.min(a.length-1,ve));de!==r&&(P.current=de,K.current?.(de))}O.current=!1}))},[a.length,r,c,u,ae]);return so(R,{isEnabled:!E&&i&&a.length>1,onDragMove:J}),ao(Q||!B?-1:e,{onInterval:I},[r]),N.useLayoutEffect(()=>{!B||E||(Q?q.current?.():W.current?.())},[E,Q,B]),N.useLayoutEffect(()=>{const $=R.current;if(!$)return;const pe=P.current===void 0,ve=P.current===r;return $.addEventListener("scroll",ee),u&&ae(),ve||(P.current=r,pe||(K.current?.(r),oe())),()=>{$.removeEventListener("scroll",ee)}},[r,u,oe,ee,ae]),w.jsx("div",{...C,ref:_,role:"region",onClick:z,onPointerCancel:Y,onPointerDown:ue,onPointerLeave:Y,onPointerUp:Y,children:w.jsx("div",{ref:R,style:le(te.viewport),children:w.jsx(yt,{in:a,children:({style:$,...pe},ve)=>w.jsx("div",{style:le(te.itemContainer),children:w.jsx(b,{"aria-hidden":ve!==r,exposure:u?L?.[ve]:void 0,style:le($,te.item),...pe})})})})})});function na(e,r,i){const a=e?.current;if(!a)return;const c=i==="horizontal"?0:a.clientHeight*r,u=i==="horizontal"?a.clientWidth*r:0;a.scrollTop===c&&a.scrollLeft===u||a.scrollTo({top:c,left:u,behavior:"smooth"})}function Eo(e,r){const i=e?.current;if(!i)return;const a=[];for(let c=0;c<i.children.length;c++)a.push(ra(c,e,r));return a}function ra(e,r,i){const a=r?.current,c=a?.children[e];if(!c)return 0;const u=xe.intersecting(c,a);switch(i){case"horizontal":return Math.max(0,Math.min(1,Math.round((u.width/a.clientWidth+Number.EPSILON)*1e3)/1e3));case"vertical":return Math.max(0,Math.min(1,Math.round((u.height/a.clientHeight+Number.EPSILON)*1e3)/1e3));default:return console.error(`[etudes::Carousel] Unsupported orientation: ${i}`),NaN}}function oa({scrollSnapEnabled:e=!1,orientation:r="horizontal"}){return{viewport:{alignItems:"center",display:"flex",height:"100%",userSelect:e?"auto":"none",justifyContent:"flex-start",scrollSnapStop:"always",WebkitOverflowScrolling:"touch",width:"100%",...r==="horizontal"?{flexDirection:"row",overflowX:"scroll",overflowY:"hidden",scrollSnapType:e?"x mandatory":"none"}:{flexDirection:"column",overflowX:"hidden",overflowY:"scroll",scrollSnapType:e?"y mandatory":"none"}},itemContainer:{height:"100%",overflow:"hidden",scrollSnapAlign:"center",width:"100%",flex:"0 0 auto"},item:{height:"100%",width:"100%"}}}process.env.NODE_ENV==="development"&&(xo.displayName="Carousel");const No=N.forwardRef(({children:e,autoComplete:r="one-time-code",autoFocus:i=!1,inputMode:a="numeric",isDisabled:c=!1,isRequired:u=!0,placeholder:d,size:g,style:m,value:b,onChange:C,..._},P)=>{const R=aa(b,g),M=N.useRef([]),T=sa(),j=Pe(e,{field:en}),Z=x=>{x<0?M.current[0]?.focus():x>=g?M.current[g-1]?.focus():M.current[x]?.focus()},q=x=>O=>{const E=R[x],L=ca(O.target.value,E),U=So(R.slice(),L.split("").slice(0,g),x);C(U);const Q=Math.min(x+L.length,g-1);Z(Q)},W=x=>O=>{switch(O.key){case"Backspace":{if(O.preventDefault(),R[x]){const E=R.slice();E[x]="",C(E),Z(x-1)}else Z(x-1);break}case"ArrowLeft":{O.preventDefault(),Z(x-1);break}case"ArrowRight":{O.preventDefault(),Z(x+1);break}}},K=x=>O=>{O.preventDefault();const E=O.clipboardData.getData("text").trim(),L=So(R.slice(),E.split("").slice(0,g),x);C(L);const U=Math.min(x+E.length,g-1);Z(U)};return N.useEffect(()=>{if(!i)return;const x=R.findIndex(O=>O==="");x!==-1&&Z(x)},[i]),w.jsx("div",{..._,ref:P,style:le(m,T.root),children:w.jsx(gt,{count:g,children:x=>w.jsx(me,{...c?{"aria-disabled":!0}:{},ref:O=>M.current[x]=O,"aria-required":u,autoComplete:r,disabled:c,element:j.field??w.jsx(en,{}),inputMode:a,placeholder:d,required:u,style:le(T.field),value:R[x],onChange:q(x),onKeyDown:W(x),onPaste:K(x)})})})}),en=({...e})=>w.jsx("input",{...e,autoCapitalize:"off",autoCorrect:"off",type:"text"}),ia=Object.assign(No,{Field:en});function sa(){return{root:{alignItems:"stretch",display:"flex",justifyContent:"stretch"},field:{caretColor:"transparent",flex:"1",minWidth:"0"}}}function aa(e,r){const i=e.slice(0,r);for(;i.length<r;)i.push("");return i}function So(e,r,i=0){let a=i,c=0;for(;c<r.length&&a<e.length;)e[a]=r[c],a++,c++;for(;c<r.length;)e.shift(),e.push(r[c]),c++;return e}function ca(e,r){return r===""?e:e.startsWith(r)?e.slice(r.length):e.endsWith(r)?e.slice(0,-r.length):e}process.env.NODE_ENV==="development"&&(No.displayName="CodeInput",en.displayName="CodeInput.Field");const rr=N.forwardRef(({className:e,emptyValue:r="",isDisabled:i=!1,isRequired:a=!1,placeholder:c,type:u="text",value:d,formatter:g,onFocus:m,onUnfocus:b,onChange:C,..._},P)=>{const R=N.useCallback(M=>{const T=(g?.(M)??M)||r;C?.(T)},[C,g]);return w.jsx("input",{..._,...i?{"aria-disabled":!0}:{},ref:P,"aria-placeholder":c,"aria-required":a,className:ce(e,{disabled:i}),disabled:i,placeholder:c,required:a,type:u,value:d||r,onBlur:({target:M})=>b?.(M.value),onChange:({target:M})=>R(M.value),onFocus:({target:M})=>m?.(M.value)})});process.env.NODE_ENV==="development"&&(rr.displayName="TextField");const To=N.forwardRef(({children:e,style:r,allowsInput:i=!0,max:a=NaN,min:c=NaN,quantity:u=0,onChange:d,...g},m)=>{const b=()=>{d?.(T(u-1))},C=()=>{d?.(T(u+1))},_=O=>{Z(O)},P=O=>{const E=M(O);E!==u?d?.(E):Z(R(E))},R=O=>O.toLocaleString(),M=O=>{const E=parseInt(O,10);return E.toString()!==O.replace(/^0+/,"")?u:T(E)},T=O=>{let E=O;return isNaN(c)||(E=Math.max(c,E)),isNaN(a)||(E=Math.min(a,E)),E},[j,Z]=N.useState(R(u)),q=po(u),W=!isNaN(a)&&u+1>a,K=!isNaN(c)&&u-1<c;N.useEffect(()=>{if(q===void 0||q===u)return;const O=T(u);Z(R(O))},[u,c,a]);const x=Pe(e,{textField:tn,addButton:nn,subscribeButton:rn});return w.jsxs("div",{...g,ref:m,style:le(r,on.root),children:[w.jsx(me,{className:ce({disabled:K}),element:x.subscribeButton??w.jsx(rn,{}),style:le(on.subtract),onClick:()=>b()}),w.jsx(me,{element:x.textField??w.jsx(tn,{}),isDisabled:!i,style:le(on.textField),value:j,onChange:_,onUnfocus:P}),w.jsx(me,{className:ce({disabled:W}),element:x.addButton??w.jsx(nn,{}),style:le(on.add),onClick:()=>C()})]})}),tn=({...e})=>w.jsx(rr,{...e}),nn=({children:e,...r})=>w.jsx("button",{...r,children:e}),rn=({children:e,...r})=>w.jsx("button",{...r,children:e}),la=Object.assign(To,{TextField:tn,AddButton:nn,SubtractButton:rn}),on={root:{alignItems:"stretch",display:"flex",flexDirection:"row",justifyContent:"stretch"},subtract:{flex:"0 0 auto"},add:{flex:"0 0 auto"},textField:{width:"100%"}};process.env.NODE_ENV==="development"&&(To.displayName="Counter",nn.displayName="Counter.AddButton",rn.displayName="Counter.SubtractButton",tn.displayName="Counter.TextField");const ua=N.forwardRef(({children:e,style:r,angle:i=0,knobLength:a=30,knobThickness:c=10,radius:u=50,trackGap:d=0,trackThickness:g=2,...m},b)=>{const C=u*2,_=Math.max(0,Math.min(360,a)),P=Pe(e,{track:sn,knob:an}),R=da({angle:i,diameter:C});return w.jsxs("div",{...m,ref:b,style:le(r,R.root),children:[w.jsx("div",{style:R.trackContainer,children:w.jsx("svg",{height:C,style:R.svgContainer,viewBox:`0 0 ${C} ${C}`,width:C,children:w.jsx(me,{cx:u,cy:u,element:P.track??w.jsx(sn,{}),fill:"none",r:u-g/2,strokeDasharray:d,strokeWidth:g})})}),w.jsx("div",{style:le(R.knobContainer),children:w.jsx("svg",{style:R.svgContainer,viewBox:`0 0 ${C} ${C}`,xmlns:"http://www.w3.org/2000/svg",children:w.jsx(me,{d:fa(u,u,u-c/2-(g-c)/2,-_/2,_/2),element:P.knob??w.jsx(an,{}),fill:"none",strokeWidth:c})})})]})}),sn=({...e})=>w.jsx("circle",{...e}),an=({...e})=>w.jsx("path",{...e}),_o=Object.assign(ua,{Track:sn,Knob:an});function Co(e,r,i,a){const c=(a-90)*Math.PI/180;return{x:e+i*Math.cos(c),y:r+i*Math.sin(c)}}function fa(e,r,i,a,c){const u=Co(e,r,i,c),d=Co(e,r,i,a),g=c-a<=180?"0":"1";return["M",u.x,u.y,"A",i,i,0,g,0,d.x,d.y].join(" ")}function da({diameter:e=0,angle:r=0}){return{root:{height:`${e}px`,width:`${e}px`},knobContainer:{backgroundPosition:"center",backgroundRepeat:"no-repeat",backgroundSize:"100%",height:"100%",left:"0",position:"absolute",top:"0",transformOrigin:"center",width:"100%",transform:`rotate(${(r+360)%360}deg)`},trackContainer:{height:"100%",left:"0",position:"absolute",top:"0",transformOrigin:"center",width:"100%"},svgContainer:{overflow:"visible",position:"absolute",right:"0",top:"0"}}}process.env.NODE_ENV==="development"&&(_o.displayName="Dial",sn.displayName="Dial.Track",an.displayName="Dial.Knob");const ko=N.forwardRef(({children:e,className:r,style:i,collapsesOnSelect:a=!0,collectionPadding:c=0,isCollapsed:u,isInverted:d=!1,label:g,layout:m="list",isSelectionTogglable:b=!1,itemLength:C,itemPadding:_=0,items:P=[],maxVisibleItems:R=-1,numSegments:M=1,orientation:T="vertical",selection:j=[],selectionMode:Z="single",onActivateAt:q,onCollapse:W,onDeselectAt:K,onExpand:x,onSelectAt:O,onSelectionChange:E,onToggleCustomEvent:L,ItemComponent:U,ToggleComponent:Q,...ie},te)=>{const B=N.useRef(null),F=Be(B),X=P.length,oe=va(P,R,M,m),ae=C??(T==="vertical"?F.height:F.width),ue=ae*oe+_*(oe-1),Y=ga(j,P),[z,I]=N.useState(u??!0),J=ya({isCollapsed:z,collectionPadding:c,isInverted:d,maxVisibleItems:R,menuLength:ue,numItems:X,orientation:T}),ee=Pe(e,{collapseIcon:or,collection:cn,expandIcon:ir,item:ln,toggle:un}),$=()=>{z&&(I(!1),x?.())},pe=()=>{z||(I(!0),W?.())},ve=()=>{z?$():pe()},de=Ne=>{O?.(Ne),Z==="single"&&a&&pe()};return N.useEffect(()=>{u!==void 0&&I(u)},[u]),N.useEffect(()=>{const Ne=ne=>{if(z||!(ne.target instanceof Node))return;let Ve=!0,Ie=ne.target;for(;Ie;){if(Ie===B.current){Ve=!1;break}if(!Ie.parentNode)break;Ie=Ie.parentNode}Ve&&pe()};return window.addEventListener("click",Ne),()=>{window.removeEventListener("click",Ne)}},[z]),w.jsx("div",{...ie,ref:te,className:ce(r,{collapsed:z,expanded:!z}),style:le(i,J.root),children:w.jsxs("div",{ref:B,style:le(J.body),children:[Q?w.jsx(Q,{"aria-expanded":!z,"aria-haspopup":"listbox",className:ce({collapsed:z,expanded:!z}),style:le(J.toggle),onClick:ve,onCustomEvent:(Ne,ne)=>L?.(Ne,ne)}):w.jsxs(me,{"aria-expanded":!z,"aria-haspopup":"listbox",className:ce({collapsed:z,expanded:!z}),element:ee.toggle??w.jsx(un,{}),style:le(J.toggle),onClick:ve,children:[w.jsx("span",{dangerouslySetInnerHTML:{__html:g?.(Y)??(Y.length>0?Y.map(Ne=>P[Ne]).join(", "):"")}}),ee.expandIcon&&w.jsx(me,{className:ce({collapsed:z,expanded:!z}),element:z?ee.collapseIcon??ee.expandIcon:ee.expandIcon,style:le(z?J.collapseIcon:J.expandIcon)})]}),w.jsx(me,{element:ee.collection??w.jsx(cn,{}),isSelectionTogglable:b,ItemComponent:U,itemLength:ae,itemPadding:_,items:P,layout:m,numSegments:M,orientation:T,selection:Y,selectionMode:Z,style:le(J.collection),onActivateAt:q,onDeselectAt:K,onSelectAt:de,onSelectionChange:E,children:!U&&(ee.item??w.jsx(ln,{}))})]})})}),cn=bt,ln=bt.Item,un=({children:e,...r})=>w.jsx("button",{...r,children:e}),or=({children:e,...r})=>w.jsx("figure",{...r,"aria-hidden":!0,children:e}),ir=({children:e,...r})=>w.jsx("figure",{...r,"aria-hidden":!0,children:e}),pa=Object.assign(ko,{Collection:cn,CollapseIcon:or,ExpandIcon:ir,Item:ln,Toggle:un});function ha(e,r){return!!(isNaN(e)||e>=r.length||e<0)}function ga(e,r){return ma(e).filter(i=>!ha(i,r))}function ma(e){return e.sort((r,i)=>r-i)}function va(e,r,i,a){const c=e.length;if(a==="grid"){const u=i<1?c:Math.ceil(c/i);return r<0?u:Math.min(u,r)}else return r<0?c:Math.min(c,r)}function ya({isCollapsed:e=!0,isInverted:r=!1,collectionPadding:i=0,maxVisibleItems:a=0,menuLength:c=NaN,numItems:u=0,orientation:d="vertical"}){return{root:{alignItems:"center",display:"flex",justifyContent:"flex-start",overflow:"visible",...d==="vertical"?{flexDirection:r?"column-reverse":"column"}:{flexDirection:r?"row-reverse":"row"}},body:{height:"100%",position:"relative",width:"100%"},toggle:{height:"100%",left:"0",margin:"0",position:"absolute",top:"0",width:"100%",zIndex:"1"},collection:{position:"absolute",...d==="vertical"?{width:"100%",height:e?"0px":`${c}px`,overflowY:a!==-1&&a<u?"scroll":"hidden",...r?{marginBottom:`${i}px`,bottom:"100%"}:{top:"100%",marginTop:`${i}px`}}:{width:e?"0px":`${c}px`,height:"100%",overflowX:a!==-1&&a<u?"scroll":"hidden",...r?{marginRight:`${i}px`,right:"100%"}:{left:"100%",marginLeft:`${i}px`}}},expandIcon:{pointerEvents:"none",zIndex:1},collapseIcon:{pointerEvents:"none",zIndex:1}}}process.env.NODE_ENV==="development"&&(ko.displayName="Dropdown",cn.displayName="Dropdown.Collection",or.displayName="Dropdown.CollapseIcon",ir.displayName="Dropdown.ExpandIcon",ln.displayName="Dropdown.Item",un.displayName="Dropdown.Toggle");const Oo=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",ba=Oo+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",wa="["+Oo+"]["+ba+"]*",xa=new RegExp("^"+wa+"$");function Po(e,r){const i=[];let a=r.exec(e);for(;a;){const c=[];c.startIndex=r.lastIndex-a[0].length;const u=a.length;for(let d=0;d<u;d++)c.push(a[d]);i.push(c),a=r.exec(e)}return i}const fn=function(e){const r=xa.exec(e);return!(r===null||typeof r>"u")};function Ea(e){return typeof e<"u"}const Na={allowBooleanAttributes:!1,unpairedTags:[]};function Sa(e,r){r=Object.assign({},Na,r);const i=[];let a=!1,c=!1;e[0]==="\uFEFF"&&(e=e.substr(1));for(let u=0;u<e.length;u++)if(e[u]==="<"&&e[u+1]==="?"){if(u+=2,u=jo(e,u),u.err)return u}else if(e[u]==="<"){let d=u;if(u++,e[u]==="!"){u=Ro(e,u);continue}else{let g=!1;e[u]==="/"&&(g=!0,u++);let m="";for(;u<e.length&&e[u]!==">"&&e[u]!==" "&&e[u]!==" "&&e[u]!==`
6
+ <%s key={someKey} {...props} />`,$,de,Ne,de),z[de+$]=!0)}if(de=null,ee!==void 0&&(i(ee),de=""+ee),d(J)&&(i(J.key),de=""+J.key),"key"in J){ee={};for(var ne in J)ne!=="key"&&(ee[ne]=J[ne])}else ee=J;return de&&g(ee,typeof I=="function"?I.displayName||I.name||"Unknown":I),b(I,de,ee,c(),pe,ve)}function _(I){P(I)?I._store&&(I._store.validated=1):typeof I=="object"&&I!==null&&I.$$typeof===U&&(I._payload.status==="fulfilled"?P(I._payload.value)&&I._payload.value._store&&(I._payload.value._store.validated=1):I._store&&(I._store.validated=1))}function P(I){return typeof I=="object"&&I!==null&&I.$$typeof===M}var R=N,M=Symbol.for("react.transitional.element"),T=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),Z=Symbol.for("react.strict_mode"),q=Symbol.for("react.profiler"),W=Symbol.for("react.consumer"),K=Symbol.for("react.context"),x=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),E=Symbol.for("react.suspense_list"),L=Symbol.for("react.memo"),U=Symbol.for("react.lazy"),Q=Symbol.for("react.activity"),ie=Symbol.for("react.client.reference"),te=R.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,B=Object.prototype.hasOwnProperty,F=Array.isArray,X=console.createTask?console.createTask:function(){return null};R={react_stack_bottom_frame:function(I){return I()}};var oe,ae={},ue=R.react_stack_bottom_frame.bind(R,u)(),Y=X(a(u)),z={};ht.Fragment=j,ht.jsx=function(I,J,ee){var $=1e4>te.recentlyCreatedOwnerStacks++;return C(I,J,ee,!1,$?Error("react-stack-top-frame"):ue,$?X(a(I)):Y)},ht.jsxs=function(I,J,ee){var $=1e4>te.recentlyCreatedOwnerStacks++;return C(I,J,ee,!0,$?Error("react-stack-top-frame"):ue,$?X(a(I)):Y)}})()),ht}var zr;function Wi(){return zr||(zr=1,process.env.NODE_ENV==="production"?Dt.exports=Ki():Dt.exports=Gi()),Dt.exports}var w=Wi();function Fr(e){var r,i,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var c=e.length;for(r=0;r<c;r++)e[r]&&(i=Fr(e[r]))&&(a&&(a+=" "),a+=i)}else for(i in e)e[i]&&(a&&(a+=" "),a+=i);return a}function ce(){for(var e,r,i=0,a="",c=arguments.length;i<c;i++)(e=arguments[i])&&(r=Fr(e))&&(a&&(a+=" "),a+=r);return a}function gt({count:e=1,children:r,render:i}){return w.jsx(w.Fragment,{children:[...Array(e)].map((a,c)=>w.jsx(N.Fragment,{children:i?.(c)??(typeof r=="function"?r(c):r)},`element-${c}`))})}process.env.NODE_ENV==="development"&&(gt.displayName="Repeat");function Bt(e,r={},...i){const{className:a,style:c,...u}=r,{className:d,style:g,...m}=e.props;return N.cloneElement(e,{className:`${d??""} ${a??""}`.split(" ").filter(Boolean).join(" ")||void 0,style:{...g??{},...c??{}},...m,...u},...i)}function me({children:e,element:r,...i}){return Bt(r,i,...e?Array.isArray(e)?e:[e]:[])}process.env.NODE_ENV==="development"&&(me.displayName="Styled");function Ji(e){return e}function Pe(e,r={}){const i=Object.keys(r),a=Object.values(r),c={};return N.Children.forEach(e,u=>{if(u==null)return;if(!N.isValidElement(u)){console.error("[etudes::asComponentDict] Invalid child detected");return}const d=a.indexOf(u.type);if(d<0){console.error(`[etudes::asComponentDict] Unsupported child, only the following children are allowed: ${a.map(m=>m.displayName??m.name).join(", ")}`);return}const g=i[d];if(c[g]){console.error(`[etudes::asComponentDict] Only one ${a[d]} can be provided as a child`);return}c[g]=u}),c}function Zi(e){return e}function le(...e){return e.reduce((r,i)=>({...r,...i||{}}),{})}const Vr=N.forwardRef(({children:e,className:r,isActive:i=!1,isTailHidden:a=!1,isSplit:c=!1,numberOfBars:u=3,...d},g)=>{const m=Pe(e,{bar:Ht}),b={root:ce({active:i}),bar:ce({active:i})},C=Qi({isSplit:c,isActive:i,isTailHidden:a});return w.jsx("div",{...d,ref:g,className:ce(r,b.root),children:w.jsx(gt,{count:c?2:1,children:_=>w.jsx("div",{"aria-hidden":!0,style:le(C.section,C[`section${_}`]),children:w.jsx(gt,{count:u,children:P=>w.jsx(me,{"aria-hidden":!0,className:ce(b.bar),element:m.bar??w.jsx(Ht,{}),style:u===2?le(C.bar,C[`bar${_}${P===0?0:2}`]):le(C.bar,C[`bar${_}${P}`])})})})})})}),Ht=({...e})=>w.jsx("span",{...e}),Ln=Object.assign(Vr,{Bar:Ht});function Qi({isActive:e=!1,isSplit:r=!1,isTailHidden:i=!1}){return{section:{height:"100%",position:"absolute",width:r?"50%":"100%"},section0:{left:"0",top:"0"},section1:{right:"0",top:"0"},bar:{margin:"0",padding:"0",position:"absolute",width:"100%"},bar00:{left:"0",top:e?"50%":"0",transform:e?"translate(0, -50%) rotate(45deg)":"translate(0, 0) rotate(0deg)",transformOrigin:r?"right center":"center"},bar01:{left:"0",top:"50%",transform:e?"translate(0, -50%) scale(0)":"translate(0, -50%) scale(1)",transformOrigin:r?"right center":"center"},bar02:{left:"0",top:e?"50%":"100%",transform:e?"translate(0, -50%) rotate(-45deg)":"translate(0, -100%) rotate(0deg)",transformOrigin:r?"right center":"center",width:e||r?"100%":`${i?"50%":"100%"}`},bar10:{left:"0",top:e?"50%":"0",transform:e?"translate(0, -50%) rotate(-45deg)":"translate(0, 0) rotate(0deg)",transformOrigin:"left center"},bar11:{left:"0",top:"50%",transform:e?"translate(0, -50%) scale(0)":"translate(0, -50%) scale(1)",transformOrigin:"left center"},bar12:{left:"0",top:e?"50%":"100%",transform:e?"translate(0, -50%) rotate(45deg)":"translate(0, -100%) rotate(0deg)",transformOrigin:"left center",width:i&&!e?"0":"100%"}}}process.env.NODE_ENV==="development"&&(Vr.displayName="Burger",Ht.displayName="Burger.Bar");const Dr=N.forwardRef(({children:e,className:r,style:i,isActive:a=!1,isTailHidden:c=!1,isSplit:u=!1,numberOfBars:d=3,onActivate:g,onDeactivate:m,onToggle:b,...C},_)=>{const P=()=>{const T=!a;b?.(T),T?g?.():m?.()},R={root:ce({active:a})},M=qi();return w.jsx("button",{...C,ref:_,"aria-expanded":a,className:ce(r,R.root),style:le(i,M.root),onClick:P,children:w.jsx(Ln,{isActive:a,isSplit:u,isTailHidden:c,numberOfBars:d,children:e})})}),Br=Ln.Bar,$i=Object.assign(Dr,{Bar:Br});function qi(){return{root:{background:"transparent",border:"none",display:"block",outline:"none"}}}process.env.NODE_ENV==="development"&&(Dr.displayName="BurgerButton",Br.displayName="BurgerButton.Bar");var Se;(e=>{e.zero=r();function r(T=0,j=0){if(typeof T=="number")return{x:T,y:j};if(!P(T))throw Error("Invalid parameters passed to constructor");return T instanceof Array?{x:T[0],y:T[1]}:{x:T.x,y:T.y}}e.make=r;function i(T,j={}){return r({x:typeof j.x=="number"?j.x:T.x,y:typeof j.y=="number"?j.y:T.y})}e.clone=i;function a(T,j){return r({x:T.x+j.x,y:T.y+j.y})}e.add=a;function c(T,j){return r({x:T.x-j.x,y:T.y-j.y})}e.subtract=c;function u(T,j){return r({x:T.x*j.x,y:T.y*j.y})}e.multiply=u;function d(T,j){return r({x:T.x/j.x,y:T.y/j.y})}e.divide=d;function g(T){return r({x:T.y,y:T.x})}e.reflect=g;function m(T,j){return!(T.x!==j.x||T.y!==j.y)}e.isEqual=m;function b(T){return`Point(x=${T.x}, y=${T.y})`}e.toString=b;function C(T){return Object.freeze({x:T.x,y:T.y})}e.toJSON=C;function _(T){return[T.x,T.y]}e.toArray=_;function P(T){return T instanceof Array?!(T.length!==2||typeof T[0]!="number"||typeof T[1]!="number"):typeof T=="object"?!(typeof T.x!="number"||typeof T.y!="number"):!1}e.isValidDescriptor=P;function R(T){return typeof T=="object"&&typeof T.x=="number"&&typeof T.y=="number"}e.isPoint=R;function M(T){return T.x===0&&T.y===0}e.isZero=M})(Se||(Se={}));function es(e,r){try{const i=Se.isValidDescriptor(e)&&Se.make(e),a=Se.isValidDescriptor(r)&&Se.make(r);if(i&&!a){const c=r instanceof Array?r:[r],u=c.length;for(let d=0;d<u;d++){const g=xe.from(c[d]);if(!g)continue;const m=i.x>=g.left&&i.x<=g.right,b=i.y>=g.top&&i.y<=g.bottom;if(m&&b)return!0}return!1}else if(!i&&a){const c=e instanceof Array?e:[e],u=c.length;for(let d=0;d<u;d++){const g=xe.from(c[d]);if(!g)continue;const m=a.x>=g.left&&a.x<=g.right,b=a.y>=g.top&&a.y<=g.bottom;if(m&&b)return!0}return!1}else{if(i&&a)return Se.isEqual(i,a);{const c=[...e instanceof Array?e:[e],...r instanceof Array?r:[r]],u=xe.intersecting.apply(null,c);return u?u.width*u.height!==0:!1}}}catch(i){return console.error(i),!1}}var ke;(e=>{e.zero=r();function r(T=0,j=0){if(typeof T=="number")return{width:T,height:j};if(!P(T))throw Error("Invalid parameters passed to constructor");return T instanceof Array?{width:T[0],height:T[1]}:{width:T.width,height:T.height}}e.make=r;function i(T,j={}){return r({width:typeof j.width=="number"?j.width:T.width,height:typeof j.height=="number"?j.height:T.height})}e.clone=i;function a(T,j){return r({width:T.width+j.width,height:T.height+j.height})}e.add=a;function c(T,j){return r({width:T.width-j.width,height:T.height-j.height})}e.subtract=c;function u(T,j){return r({width:T.width*j.width,height:T.height*j.height})}e.multiply=u;function d(T,j){return r({width:T.width/j.width,height:T.height/j.height})}e.divide=d;function g(T){return r({width:T.height,height:T.width})}e.rotate=g;function m(T,j){return!(T.width!==j.width||T.height!==j.height)}e.isEqual=m;function b(T){return`Size(width=${T.width}, height=${T.height})`}e.toString=b;function C(T){return Object.freeze({width:T.width,height:T.height})}e.toJSON=C;function _(T){return[T.width,T.height]}e.toArray=_;function P(T){return T instanceof Array?!(T.length!==2||typeof T[0]!="number"||typeof T[1]!="number"):typeof T=="object"?!(typeof T.width!="number"||typeof T.height!="number"):!1}e.isValidDescriptor=P;function R(T){return typeof T=="object"&&typeof T.width=="number"&&typeof T.height=="number"}e.isSize=R;function M(T){return T.width===0&&T.height===0}e.isZero=M})(ke||(ke={}));var xe;(e=>{e.zero=r();function r(x=0,O=0,E=0,L=0){if(typeof x=="number"&&typeof O=="number"){const U=x,Q=O;return{top:Q,right:U+E,bottom:Q+L,left:U,width:E,height:L}}else if(Se.isPoint(x)&&ke.isSize(O)){const U=x,Q=O;return{top:U.y,right:U.x+Q.width,bottom:U.y+Q.height,left:U.x,width:Q.width,height:Q.height}}else{const U=x;if(!q(U))throw Error("Invalid parameters passed to constructor");return{top:U.y,right:U.x+U.width,bottom:U.y+U.height,left:U.x,width:U.width,height:U.height}}}e.make=r;function i(x){return Se.make({x:(x.right-x.left)/2+x.left,y:(x.bottom-x.top)/2+x.top})}e.center=i;function a(x){return ke.make({width:x.width,height:x.height})}e.size=a;function c(x,O={}){try{if(x==null)return e.zero;if(W(x))return x;if(mt(x))return c(document.documentElement||document.body.parentNode||document.body,O);const E=x instanceof Array?x:[x],L=E.length,U=O.reference||window,Q=u(),ie=mt(U)?Q:c(O.reference);if(!Q||!ie)return e.zero;let te;for(let B=0;B<L;B++){const F=E[B],X=F.getBoundingClientRect(),oe=r({x:X.left+Q.left-(mt(U)?0:ie.left),y:X.top+Q.top-(mt(U)?0:ie.top),width:O.overflow?F.scrollWidth:F instanceof HTMLElement?F.offsetWidth:X.width,height:O.overflow?F.scrollHeight:F instanceof HTMLElement?F.offsetHeight:X.height});te=te?P(te,oe):oe}return te??e.zero}catch(E){return console.error(E),e.zero}}e.from=c;function u(){const x=Math.max(document.documentElement.clientWidth,window.innerWidth||0),O=Math.max(document.documentElement.clientHeight,window.innerHeight||0),E=window.pageXOffset!==void 0?window.pageXOffset:(document.documentElement||document.body.parentNode||document.body).scrollLeft,L=window.pageYOffset!==void 0?window.pageYOffset:(document.documentElement||document.body.parentNode||document.body).scrollTop;return r({x:E,y:L,width:x,height:O})}e.fromViewport=u;function d(x,O={}){return x?mt(x)?c(Array.from(document.body.children)):c(Array.from(x.children),{overflow:O.overflow,reference:O.reference||x}):e.zero}e.fromChildrenOf=d;function g(x,O,E={}){if(!O)return e.zero;const L=Array.from(O.children);return x<=0?r():x>=L.length?c(L,{reference:E.reference,overflow:!1}):(L.splice(x),c(L,{reference:E.reference||O,overflow:!1}))}e.fromChildrenBefore=g;function m(x,O,E={}){if(!O)return e.zero;const L=Array.from(O.children);return x<0?c(L,{reference:E.reference,overflow:!1}):x>=L.length-1?r():(L.splice(0,L.length-x-1),c(L,{reference:E.reference||O,overflow:!1}))}e.fromChildrenAfter=m;function b(x,O,E={}){if(!O)return e.zero;const L=O.children[x];return c(L,{overflow:E.overflow,reference:E.reference||O})}e.fromChildAt=b;function C(...x){try{const O=x.length,E={};let L,U;for(let Q=0;Q<O;Q++){if(L||(L=c(x[Q])),Q===0&&Q+1===O)U=u();else if(Q+1<O)U=c(x[Q+1]);else break;!L||!U||(E.width=Math.max(0,Math.min(L.right,U.right)-Math.max(L.left,U.left)),E.height=Math.max(0,Math.min(L.bottom,U.bottom)-Math.max(L.top,U.top)),E.y=Math.max(L.top,U.top),E.x=Math.max(L.left,U.left),E.width*E.height===0&&(E.width=0,E.height=0,E.y=NaN,E.x=NaN),L=r(E))}return r(E)}catch(O){return console.error(O),e.zero}}e.intersecting=C;function _(x,O={}){return r({x:typeof O.x=="number"?O.x:x.left,y:typeof O.y=="number"?O.y:x.top,width:typeof O.width=="number"?O.width:x.width,height:typeof O.height=="number"?O.height:x.height})}e.clone=_;function P(x,O){return r({x:Math.min(x.left,O.left),y:Math.min(x.top,O.top),width:Math.max(x.right,O.right)-Math.min(x.left,O.left),height:Math.max(x.bottom,O.bottom)-Math.min(x.top,O.top)})}e.concat=P;function R(x){return r({x:x.left,y:x.top,width:x.height,height:x.width})}e.rotate=R;function M(x,O){return!(x.top!==O.top||x.right!==O.right||x.bottom!==O.bottom||x.left!==O.left||x.width!==O.width||x.height!==O.height)}e.isEqual=M;function T(x,O){return es(O,x)}e.contains=T;function j(x){return`Rect(top=${x.top}, right=${x.right}, bottom=${x.bottom}, left=${x.left}, width=${x.width}, height=${x.height})`}e.toString=j;function Z(x){return Object.freeze({top:x.top,right:x.right,bottom:x.bottom,left:x.left,width:x.width,height:x.height})}e.toJSON=Z;function q(x){return!(typeof x.x!="number"||typeof x.y!="number"||typeof x.width!="number"||typeof x.height!="number")}e.isValidDescriptor=q;function W(x){return typeof x=="object"&&typeof x.top=="number"&&typeof x.right=="number"&&typeof x.bottom=="number"&&typeof x.left=="number"&&typeof x.width=="number"&&typeof x.height=="number"}e.isRect=W;function K(x){return x.top===0&&x.right===0&&x.bottom===0&&x.left===0&&x.width===0&&x.height===0}e.isZero=K})(xe||(xe={}));function mt(e){return e===window}function Ee(e){const r=N.useRef(e);return N.useEffect(()=>{r.current=e},[e]),r}function Hr(e,{onChange:r}){const i=Ee(r);N.useLayoutEffect(()=>{const a=e?.current;if(!a)return;const c=new IntersectionObserver(u=>{for(const d of u)if(d.target===a){i.current?.(a);break}});return c.observe(a),()=>{c.disconnect()}},[e?.current])}function Yt(e,{onResize:r}){const i=Ee(r);N.useLayoutEffect(()=>{const a=e?.current;if(!a)return;const c=new ResizeObserver(()=>{i.current?.(a)});return c.observe(a),()=>{c.disconnect()}},[e?.current])}function Yr(){const[e,r]=N.useState(ke.zero);return N.useLayoutEffect(()=>{const i=()=>{const a=xe.size(xe.fromViewport());r(a)};return window.addEventListener("resize",i),i(),()=>{window.removeEventListener("resize",i)}},[]),e}function Be(e){const[r,i]=N.useState(xe.zero),a=Yr();return Yt(e,{onResize:c=>{const u=xe.from(c);i(u)}}),Hr(e,{onChange:c=>{const u=xe.from(c);i(u)}}),N.useLayoutEffect(()=>{const c=e?.current,u=xe.from(c);i(u)},[ke.toString(a)]),r}D.ImageSource=void 0,(e=>{function r(u){try{return i(u),{media:u.media,sizes:c(u),srcSet:a(u),type:u.type}}catch(d){console.error(`[etudes:ImageSource] ${d}`);return}}e.asProps=r;function i({sizes:u=[],srcSet:d}){if(u.length>0&&!d.some(({width:g})=>g!==void 0))throw Error("If `sizes` is specified, at least one entry in `sourceSet` must have a `width` specified");if(u.length>0&&u[u.length-1].media!==void 0)throw Error("The last item in `sizes` must not have a `media` condition");if(d.length===0)throw Error("At least one entry in `sourceSet` must be specified");d.forEach(({src:g,width:m,pixelDensity:b})=>{if(g===void 0||g==="")throw Error("Each entry in `sourceSet` must have a non-empty `src`");if(m!==void 0&&(!isFinite(m)||!Number.isInteger(m)||m<=0))throw Error("If `width` is specified, it must be a positive integer greater than 0");if(b!==void 0&&(!isFinite(b)||b<=0))throw Error("If `pixelDensity` is specified, it must be a number greater than 0");if(m!==void 0&&b!==void 0)throw Error("Only one of `width` or `pixelDensity` can be specified")})}function a(u){return u.srcSet.map(({pixelDensity:d,src:g,width:m})=>{let b=g;return m!==void 0?b+=` ${m}w`:d!==void 0&&(b+=` ${d}x`),b}).filter(Boolean).join(", ")}function c(u){return u.sizes?.map(({media:d,width:g})=>{let m=g;return d&&(m=`${d} ${m}`),m}).filter(Boolean).join(", ")}})(D.ImageSource||(D.ImageSource={}));function Xr({src:e,srcSet:r,sizes:i},{onLoadStart:a,onLoadComplete:c,onLoadError:u}={}){const d=N.useRef(void 0),g=Ee(a),m=Ee(c),b=Ee(u);N.useLayoutEffect(()=>{let C=!1;const _=M=>{if(C)return;const T=M.currentTarget;m.current?.(T)},P=M=>{if(C)return;const T=M.currentTarget;b.current?.(T)},R=new Image;return R.addEventListener("load",_),R.addEventListener("error",P),g.current?.(R),r&&(R.srcset=r),i&&(R.sizes=i),R.src=e,d.current=R,()=>{C=!0,R.removeEventListener("load",_),R.removeEventListener("error",P),d.current=void 0}},[e,r,i])}function zn({src:e,srcSet:r,sizes:i},{preservesSizeBetweenLoads:a=!0,onLoadStart:c,onLoadComplete:u,onLoadError:d}={}){const[g,m]=N.useState(),b=Ee(c),C=Ee(u),_=Ee(d),P=N.useCallback(T=>{a||m(void 0),b.current?.(T)},[a]),R=N.useCallback(T=>{m(ts(T)),C.current?.(T)},[]),M=N.useCallback(T=>{a||m(void 0),_.current?.(T)},[a]);return Xr({src:e,srcSet:r,sizes:i},{onLoadStart:P,onLoadComplete:R,onLoadError:M}),g}function ts(e){if(e&&typeof e.width=="number"&&typeof e.height=="number")return ke.make(e.width,e.height)}const Fn=N.forwardRef(({alt:e,source:r,loadingMode:i,src:a,onLoadStart:c,onLoadComplete:u,onLoadError:d,onSizeChange:g,...m},b)=>{const C=r?D.ImageSource.asProps(r):void 0,_=zn({src:a,srcSet:C?.srcSet,sizes:C?.sizes},{onLoadStart:c,onLoadComplete:u,onLoadError:d});return N.useEffect(()=>{g?.(_)},[_?.width,_?.height]),w.jsx("img",{...m,...C,ref:b,alt:e,loading:i,src:a})});process.env.NODE_ENV==="development"&&(Fn.displayName="Image");const Vn=N.forwardRef(({alt:e,loadingMode:r,sources:i=[],src:a,onLoadComplete:c,onLoadError:u,onLoadStart:d,onSizeChange:g,...m},b)=>w.jsxs("picture",{...m,ref:b,children:[i.map((C,_)=>w.jsx("source",{...D.ImageSource.asProps(C)},_)),w.jsx(Fn,{alt:e,loadingMode:r,src:a,style:{width:"100%",height:"100%"},onLoadComplete:c,onLoadError:u,onLoadStart:d,onSizeChange:g})]}));process.env.NODE_ENV==="development"&&(Vn.displayName="Picture");const Ur=N.forwardRef(({children:e,alt:r,aspectRatio:i=NaN,sources:a,loadingMode:c,src:u,style:d,onLoadStart:g,onLoadComplete:m,onLoadError:b,...C},_)=>{const P=O=>{j(O?O.width/O.height:NaN)},R=N.useRef(null),M=_??R,[T,j]=N.useState(NaN),Z=isNaN(i)?T:i,q=Be(M),W=q.width/q.height,K=ke.make(W>1?Math.max(q.width,q.height*Z):Math.max(q.width,Math.max(q.height,q.width/Z)*Z),W>1?Math.max(q.height,Math.max(q.width,q.height*Z)/Z):Math.max(q.height,q.width/Z)),x=Pe(e,{content:Xt,viewport:Ut});return w.jsxs("div",{...C,ref:M,style:le(d,Dn.root),children:[w.jsx(Vn,{alt:r,sources:a,src:u,style:le(Dn.viewport,{height:`${K.height}px`,maxWidth:"unset",width:`${K.width}px`}),onLoadComplete:m,onLoadError:b,onLoadStart:g,onSizeChange:O=>P(O)}),x.viewport&&w.jsx(me,{element:x.viewport,style:le(Dn.viewport,{height:`${K.height}px`,pointerEvents:"none",width:`${K.width}px`})}),x.content]})}),Xt=({children:e,...r})=>w.jsx("div",{...r,children:e}),Ut=({children:e,...r})=>w.jsx("div",{...r,children:e}),ns=Object.assign(Ur,{Content:Xt,Viewport:Ut}),Dn={root:{overflow:"hidden"},viewport:{left:"50%",position:"absolute",top:"50%",transform:"translate(-50%, -50%)"}};process.env.NODE_ENV==="development"&&(Ur.displayName="CoverImage",Xt.displayName="CoverImage.Content",Ut.displayName="CoverImage.Viewport");function Kr(e,{onLoadStart:r,onLoadComplete:i,onLoadError:a}={}){const c=Ee(r),u=Ee(i),d=Ee(a);N.useLayoutEffect(()=>{if(!e)return;const g=window.document.createElement("video"),m=()=>u.current?.(g),b=()=>d.current?.(g);return g.addEventListener("loadedmetadata",m),g.addEventListener("error",b),g.src=e,c.current?.(g),()=>{g.removeEventListener("loadedmetadata",m),g.removeEventListener("error",b),g.src=""}},[e])}function Gr(e,{preservesSizeBetweenLoads:r=!0,onLoadStart:i,onLoadComplete:a,onLoadError:c}={}){const[u,d]=N.useState(),g=Ee(i),m=Ee(a),b=Ee(c),C=N.useCallback(R=>{r||d(void 0),g.current?.(R)},[r]),_=N.useCallback(R=>{d(rs(R)),m.current?.(R)},[]),P=N.useCallback(R=>{r||d(void 0),b.current?.(R)},[r]);return Kr(e,{onLoadStart:C,onLoadComplete:_,onLoadError:P}),u}function rs(e){if(e&&typeof e.videoWidth=="number"&&typeof e.videoHeight=="number")return ke.make(e.videoWidth,e.videoHeight)}const Bn=N.forwardRef(({autoLoop:e=!0,autoPlay:r=!0,hasControls:i=!1,isMuted:a=!0,playsInline:c=!0,posterSrc:u,src:d,onCanPlay:g,onEnd:m,onFullscreenChange:b,onLoadMetadata:C,onLoadMetadataComplete:_,onLoadMetadataError:P,onPause:R,onPlay:M,onSizeChange:T,onTimeUpdate:j,...Z},q)=>{const W=N.useRef(null),K=q??W,x=Gr(d,{onLoadStart:C,onLoadComplete:_,onLoadError:P});N.useEffect(()=>{if(!K.current)return;if(d.toLowerCase().endsWith(".m3u8")){const F=!!K.current.canPlayType("application/x-mpegURL"),X=typeof window.Hls<"u"?window.Hls:void 0;if(!F&&X?.isSupported()){const oe=new X;oe.loadSource(d),oe.attachMedia(K.current)}}const B=F=>{const X=window.document.fullScreen||window.document.mozFullScreen||window.document.webkitIsFullScreen;X!==void 0&&b?.(X)};return K.current.muted=a,K.current.load(),K.current.addEventListener("webkitfullscreenchange",B),K.current.addEventListener("mozfullscreenchange",B),K.current.addEventListener("fullscreenchange",B),()=>{te(),K.current?.removeEventListener("webkitfullscreenchange",B),K.current?.removeEventListener("mozfullscreenchange",B),K.current?.removeEventListener("fullscreenchange",B)}},[d]),N.useEffect(()=>{T?.(x)},[x]);const O=B=>{const F=B.currentTarget;r&&F.paused&&ie(),g?.()},E=B=>{M?.()},L=B=>{R?.()},U=B=>{m?.()},Q=B=>{const F=B.currentTarget;j?.(F.currentTime,F.duration)},ie=()=>{K.current&&K.current.play()},te=()=>{K.current&&K.current.pause()};return w.jsx("video",{...Z,ref:K,autoPlay:r,controls:i,loop:e,muted:a,playsInline:c,poster:u,onCanPlay:O,onEnded:U,onPause:L,onPlay:E,onTimeUpdate:Q,children:w.jsx("source",{src:d})})});process.env.NODE_ENV==="development"&&(Bn.displayName="Video");const Wr=N.forwardRef(({className:e,children:r,style:i,aspectRatio:a=NaN,autoLoop:c,autoPlay:u,hasControls:d,isMuted:g,playsInline:m,posterSrc:b,src:C,onCanPlay:_,onEnd:P,onFullscreenChange:R,onLoadMetadata:M,onLoadMetadataComplete:T,onLoadMetadataError:j,onPause:Z,onPlay:q,onSizeChange:W,...K},x)=>{const O=X=>{Q(X?X.width/X.height:NaN),W?.(X)},E=x??N.useRef(null),L=Be(E),[U,Q]=N.useState(NaN),ie=isNaN(a)?U:a,te=L.width/L.height,B=ke.make(te>1?Math.max(L.width,L.height*ie):Math.max(L.width,Math.max(L.height,L.width/ie)*ie),te>1?Math.max(L.height,Math.max(L.width,L.height*ie)/ie):Math.max(L.height,L.width/ie)),F=Pe(r,{content:Hn,viewport:Yn});return w.jsxs("div",{...K,ref:E,className:e,style:le(i,Xn.root),children:[w.jsx(Bn,{autoLoop:c,autoPlay:u,hasControls:d,isMuted:g,playsInline:m,posterSrc:b,src:C,style:le(Xn.viewport,{width:`${B.width}px`,height:`${B.height}px`,maxWidth:"unset"}),onCanPlay:_,onEnd:P,onFullscreenChange:R,onLoadMetadata:M,onLoadMetadataComplete:T,onLoadMetadataError:j,onPause:Z,onPlay:q,onSizeChange:X=>O(X)}),F.viewport&&w.jsx(me,{element:F.viewport,style:le(Xn.viewport,{height:`${B.height}px`,pointerEvents:"none",width:`${B.width}px`})}),F.content]})}),Hn=({children:e,...r})=>w.jsx("div",{...r,children:e}),Yn=({children:e,...r})=>w.jsx("div",{...r,children:e}),os=Object.assign(Wr,{Content:Hn,Viewport:Yn}),Xn={root:{overflow:"hidden"},viewport:{left:"50%",position:"absolute",top:"50%",transform:"translate(-50%, -50%)"}};process.env.NODE_ENV==="development"&&(Wr.displayName="CoverVideo",Hn.displayName="CoverVideo.Content",Yn.displayName="CoverVideo.Viewport");const Un=N.forwardRef((e,r)=>{switch(!0){case is(e):{const{action:i,children:a,className:c,isDisabled:u,label:d,opensInNewTab:g,...m}=e;return w.jsx("a",{...m,...u?{"aria-disabled":!0}:{},ref:r,"aria-label":d,className:ce(c,{disabled:u}),href:i,rel:g?"noopener,noreferrer":void 0,target:g?"_blank":void 0,children:a??d})}case ss(e):{const{action:i,children:a,className:c,isDisabled:u,label:d,type:g="button",...m}=e;return w.jsx("button",{...m,...u?{"aria-disabled":!0}:{},ref:r,"aria-label":d,className:c,disabled:u,type:g,onClick:i,children:a??d})}default:console.error("[etudes::Button] Unknown button type");return}});function is(e){return typeof e.action=="string"}function ss(e){return typeof e.action=="function"||typeof e.type=="string"}process.env.NODE_ENV==="development"&&(Un.displayName="Button");const Jr=N.forwardRef(({index:e=0,isDisabled:r=!1,options:i,onChange:a,...c},u)=>{const d=i.length-1,g=i[e],m=typeof g=="string"?g:g?.label,b=N.useCallback(()=>{if(r)return;const C=e<d?e+1:0,_=i[C],P=typeof _=="string"?_:_?.value;a?.(P,C)},[d,r,e,i,a]);return w.jsx(Un,{...c,ref:u,action:b,isDisabled:r,label:m})});process.env.NODE_ENV==="development"&&(Jr.displayName="OptionButton");var Kn,Zr;function as(){return Zr||(Zr=1,Kn=function e(r,i){if(r===i)return!0;if(r&&i&&typeof r=="object"&&typeof i=="object"){if(r.constructor!==i.constructor)return!1;var a,c,u;if(Array.isArray(r)){if(a=r.length,a!=i.length)return!1;for(c=a;c--!==0;)if(!e(r[c],i[c]))return!1;return!0}if(r.constructor===RegExp)return r.source===i.source&&r.flags===i.flags;if(r.valueOf!==Object.prototype.valueOf)return r.valueOf()===i.valueOf();if(r.toString!==Object.prototype.toString)return r.toString()===i.toString();if(u=Object.keys(r),a=u.length,a!==Object.keys(i).length)return!1;for(c=a;c--!==0;)if(!Object.prototype.hasOwnProperty.call(i,u[c]))return!1;for(c=a;c--!==0;){var d=u[c];if(!(d==="_owner"&&r.$$typeof)&&!e(r[d],i[d]))return!1}return!0}return r!==r&&i!==i}),Kn}var cs=as();const He=Ar(cs);var Kt={exports:{}},ls=Kt.exports,Qr;function us(){return Qr||(Qr=1,(function(e,r){(function(i,a){e.exports=a()})(ls,(function(){function i(n,t){var o=Object.keys(n);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);t&&(s=s.filter((function(l){return Object.getOwnPropertyDescriptor(n,l).enumerable}))),o.push.apply(o,s)}return o}function a(n){for(var t=1;t<arguments.length;t++){var o=arguments[t]!=null?arguments[t]:{};t%2?i(Object(o),!0).forEach((function(s){m(n,s,o[s])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):i(Object(o)).forEach((function(s){Object.defineProperty(n,s,Object.getOwnPropertyDescriptor(o,s))}))}return n}function c(n){return c=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},c(n)}function u(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")}function d(n,t){for(var o=0;o<t.length;o++){var s=t[o];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(n,T(s.key),s)}}function g(n,t,o){return t&&d(n.prototype,t),Object.defineProperty(n,"prototype",{writable:!1}),n}function m(n,t,o){return(t=T(t))in n?Object.defineProperty(n,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[t]=o,n}function b(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),t&&_(n,t)}function C(n){return C=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},C(n)}function _(n,t){return _=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,s){return o.__proto__=s,o},_(n,t)}function P(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function R(n){var t=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var o,s=C(n);if(t){var l=C(this).constructor;o=Reflect.construct(s,arguments,l)}else o=s.apply(this,arguments);return(function(f,p){if(p&&(typeof p=="object"||typeof p=="function"))return p;if(p!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return P(f)})(this,o)}}function M(){return M=typeof Reflect<"u"&&Reflect.get?Reflect.get.bind():function(n,t,o){var s=(function(f,p){for(;!Object.prototype.hasOwnProperty.call(f,p)&&(f=C(f))!==null;);return f})(n,t);if(s){var l=Object.getOwnPropertyDescriptor(s,t);return l.get?l.get.call(arguments.length<3?n:o):l.value}},M.apply(this,arguments)}function T(n){var t=(function(o,s){if(typeof o!="object"||o===null)return o;var l=o[Symbol.toPrimitive];if(l!==void 0){var f=l.call(o,s);if(typeof f!="object")return f;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(o)})(n,"string");return typeof t=="symbol"?t:t+""}var j=function(n){return!(!n||!n.Window)&&n instanceof n.Window},Z=void 0,q=void 0;function W(n){Z=n;var t=n.document.createTextNode("");t.ownerDocument!==n.document&&typeof n.wrap=="function"&&n.wrap(t)===t&&(n=n.wrap(n)),q=n}function K(n){return j(n)?n:(n.ownerDocument||n).defaultView||q.window}typeof window<"u"&&window&&W(window);var x=function(n){return!!n&&c(n)==="object"},O=function(n){return typeof n=="function"},E={window:function(n){return n===q||j(n)},docFrag:function(n){return x(n)&&n.nodeType===11},object:x,func:O,number:function(n){return typeof n=="number"},bool:function(n){return typeof n=="boolean"},string:function(n){return typeof n=="string"},element:function(n){if(!n||c(n)!=="object")return!1;var t=K(n)||q;return/object|function/.test(typeof Element>"u"?"undefined":c(Element))?n instanceof Element||n instanceof t.Element:n.nodeType===1&&typeof n.nodeName=="string"},plainObject:function(n){return x(n)&&!!n.constructor&&/function Object\b/.test(n.constructor.toString())},array:function(n){return x(n)&&n.length!==void 0&&O(n.splice)}};function L(n){var t=n.interaction;if(t.prepared.name==="drag"){var o=t.prepared.axis;o==="x"?(t.coords.cur.page.y=t.coords.start.page.y,t.coords.cur.client.y=t.coords.start.client.y,t.coords.velocity.client.y=0,t.coords.velocity.page.y=0):o==="y"&&(t.coords.cur.page.x=t.coords.start.page.x,t.coords.cur.client.x=t.coords.start.client.x,t.coords.velocity.client.x=0,t.coords.velocity.page.x=0)}}function U(n){var t=n.iEvent,o=n.interaction;if(o.prepared.name==="drag"){var s=o.prepared.axis;if(s==="x"||s==="y"){var l=s==="x"?"y":"x";t.page[l]=o.coords.start.page[l],t.client[l]=o.coords.start.client[l],t.delta[l]=0}}}var Q={id:"actions/drag",install:function(n){var t=n.actions,o=n.Interactable,s=n.defaults;o.prototype.draggable=Q.draggable,t.map.drag=Q,t.methodDict.drag="draggable",s.actions.drag=Q.defaults},listeners:{"interactions:before-action-move":L,"interactions:action-resume":L,"interactions:action-move":U,"auto-start:check":function(n){var t=n.interaction,o=n.interactable,s=n.buttons,l=o.options.drag;if(l&&l.enabled&&(!t.pointerIsDown||!/mouse|pointer/.test(t.pointerType)||(s&o.options.drag.mouseButtons)!=0))return n.action={name:"drag",axis:l.lockAxis==="start"?l.startAxis:l.lockAxis},!1}},draggable:function(n){return E.object(n)?(this.options.drag.enabled=n.enabled!==!1,this.setPerAction("drag",n),this.setOnEvents("drag",n),/^(xy|x|y|start)$/.test(n.lockAxis)&&(this.options.drag.lockAxis=n.lockAxis),/^(xy|x|y)$/.test(n.startAxis)&&(this.options.drag.startAxis=n.startAxis),this):E.bool(n)?(this.options.drag.enabled=n,this):this.options.drag},beforeMove:L,move:U,defaults:{startAxis:"xy",lockAxis:"xy"},getCursor:function(){return"move"},filterEventType:function(n){return n.search("drag")===0}},ie=Q,te={init:function(n){var t=n;te.document=t.document,te.DocumentFragment=t.DocumentFragment||B,te.SVGElement=t.SVGElement||B,te.SVGSVGElement=t.SVGSVGElement||B,te.SVGElementInstance=t.SVGElementInstance||B,te.Element=t.Element||B,te.HTMLElement=t.HTMLElement||te.Element,te.Event=t.Event,te.Touch=t.Touch||B,te.PointerEvent=t.PointerEvent||t.MSPointerEvent},document:null,DocumentFragment:null,SVGElement:null,SVGSVGElement:null,SVGElementInstance:null,Element:null,HTMLElement:null,Event:null,Touch:null,PointerEvent:null};function B(){}var F=te,X={init:function(n){var t=F.Element,o=n.navigator||{};X.supportsTouch="ontouchstart"in n||E.func(n.DocumentTouch)&&F.document instanceof n.DocumentTouch,X.supportsPointerEvent=o.pointerEnabled!==!1&&!!F.PointerEvent,X.isIOS=/iP(hone|od|ad)/.test(o.platform),X.isIOS7=/iP(hone|od|ad)/.test(o.platform)&&/OS 7[^\d]/.test(o.appVersion),X.isIe9=/MSIE 9/.test(o.userAgent),X.isOperaMobile=o.appName==="Opera"&&X.supportsTouch&&/Presto/.test(o.userAgent),X.prefixedMatchesSelector="matches"in t.prototype?"matches":"webkitMatchesSelector"in t.prototype?"webkitMatchesSelector":"mozMatchesSelector"in t.prototype?"mozMatchesSelector":"oMatchesSelector"in t.prototype?"oMatchesSelector":"msMatchesSelector",X.pEventTypes=X.supportsPointerEvent?F.PointerEvent===n.MSPointerEvent?{up:"MSPointerUp",down:"MSPointerDown",over:"mouseover",out:"mouseout",move:"MSPointerMove",cancel:"MSPointerCancel"}:{up:"pointerup",down:"pointerdown",over:"pointerover",out:"pointerout",move:"pointermove",cancel:"pointercancel"}:null,X.wheelEvent=F.document&&"onmousewheel"in F.document?"mousewheel":"wheel"},supportsTouch:null,supportsPointerEvent:null,isIOS7:null,isIOS:null,isIe9:null,isOperaMobile:null,prefixedMatchesSelector:null,pEventTypes:null,wheelEvent:null},oe=X;function ae(n,t){if(n.contains)return n.contains(t);for(;t;){if(t===n)return!0;t=t.parentNode}return!1}function ue(n,t){for(;E.element(n);){if(z(n,t))return n;n=Y(n)}return null}function Y(n){var t=n.parentNode;if(E.docFrag(t)){for(;(t=t.host)&&E.docFrag(t););return t}return t}function z(n,t){return q!==Z&&(t=t.replace(/\/deep\//g," ")),n[oe.prefixedMatchesSelector](t)}var I=function(n){return n.parentNode||n.host};function J(n,t){for(var o,s=[],l=n;(o=I(l))&&l!==t&&o!==l.ownerDocument;)s.unshift(l),l=o;return s}function ee(n,t,o){for(;E.element(n);){if(z(n,t))return!0;if((n=Y(n))===o)return z(n,t)}return!1}function $(n){return n.correspondingUseElement||n}function pe(n){var t=n instanceof F.SVGElement?n.getBoundingClientRect():n.getClientRects()[0];return t&&{left:t.left,right:t.right,top:t.top,bottom:t.bottom,width:t.width||t.right-t.left,height:t.height||t.bottom-t.top}}function ve(n){var t,o=pe(n);if(!oe.isIOS7&&o){var s={x:(t=(t=K(n))||q).scrollX||t.document.documentElement.scrollLeft,y:t.scrollY||t.document.documentElement.scrollTop};o.left+=s.x,o.right+=s.x,o.top+=s.y,o.bottom+=s.y}return o}function de(n){for(var t=[];n;)t.push(n),n=Y(n);return t}function Ne(n){return!!E.string(n)&&(F.document.querySelector(n),!0)}function ne(n,t){for(var o in t)n[o]=t[o];return n}function Ve(n,t,o){return n==="parent"?Y(o):n==="self"?t.getRect(o):ue(o,n)}function Ie(n,t,o,s){var l=n;return E.string(l)?l=Ve(l,t,o):E.func(l)&&(l=l.apply(void 0,s)),E.element(l)&&(l=ve(l)),l}function Ce(n){return n&&{x:"x"in n?n.x:n.left,y:"y"in n?n.y:n.top}}function De(n){return!n||"x"in n&&"y"in n||((n=ne({},n)).x=n.left||0,n.y=n.top||0,n.width=n.width||(n.right||0)-n.x,n.height=n.height||(n.bottom||0)-n.y),n}function lt(n,t,o){n.left&&(t.left+=o.x),n.right&&(t.right+=o.x),n.top&&(t.top+=o.y),n.bottom&&(t.bottom+=o.y),t.width=t.right-t.left,t.height=t.bottom-t.top}function nt(n,t,o){var s=o&&n.options[o];return Ce(Ie(s&&s.origin||n.options.origin,n,t,[n&&t]))||{x:0,y:0}}function Oe(n,t){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(v){return!0},s=arguments.length>3?arguments[3]:void 0;if(s=s||{},E.string(n)&&n.search(" ")!==-1&&(n=ut(n)),E.array(n))return n.forEach((function(v){return Oe(v,t,o,s)})),s;if(E.object(n)&&(t=n,n=""),E.func(t)&&o(n))s[n]=s[n]||[],s[n].push(t);else if(E.array(t))for(var l=0,f=t;l<f.length;l++){var p=f[l];Oe(n,p,o,s)}else if(E.object(t))for(var h in t)Oe(ut(h).map((function(v){return"".concat(n).concat(v)})),t[h],o,s);return s}function ut(n){return n.trim().split(/ +/)}var rt=function(n,t){return Math.sqrt(n*n+t*t)},Vc=["webkit","moz"];function Nn(n,t){n.__set||(n.__set={});var o=function(l){if(Vc.some((function(f){return l.indexOf(f)===0})))return 1;typeof n[l]!="function"&&l!=="__set"&&Object.defineProperty(n,l,{get:function(){return l in n.__set?n.__set[l]:n.__set[l]=t[l]},set:function(f){n.__set[l]=f},configurable:!0})};for(var s in t)o(s);return n}function Sn(n,t){n.page=n.page||{},n.page.x=t.page.x,n.page.y=t.page.y,n.client=n.client||{},n.client.x=t.client.x,n.client.y=t.client.y,n.timeStamp=t.timeStamp}function ri(n){n.page.x=0,n.page.y=0,n.client.x=0,n.client.y=0}function oi(n){return n instanceof F.Event||n instanceof F.Touch}function Tn(n,t,o){return n=n||"page",(o=o||{}).x=t[n+"X"],o.y=t[n+"Y"],o}function ii(n,t){return t=t||{x:0,y:0},oe.isOperaMobile&&oi(n)?(Tn("screen",n,t),t.x+=window.scrollX,t.y+=window.scrollY):Tn("page",n,t),t}function It(n){return E.number(n.pointerId)?n.pointerId:n.identifier}function Dc(n,t,o){var s=t.length>1?si(t):t[0];ii(s,n.page),(function(l,f){f=f||{},oe.isOperaMobile&&oi(l)?Tn("screen",l,f):Tn("client",l,f)})(s,n.client),n.timeStamp=o}function dr(n){var t=[];return E.array(n)?(t[0]=n[0],t[1]=n[1]):n.type==="touchend"?n.touches.length===1?(t[0]=n.touches[0],t[1]=n.changedTouches[0]):n.touches.length===0&&(t[0]=n.changedTouches[0],t[1]=n.changedTouches[1]):(t[0]=n.touches[0],t[1]=n.touches[1]),t}function si(n){for(var t={pageX:0,pageY:0,clientX:0,clientY:0,screenX:0,screenY:0},o=0;o<n.length;o++){var s=n[o];for(var l in t)t[l]+=s[l]}for(var f in t)t[f]/=n.length;return t}function pr(n){if(!n.length)return null;var t=dr(n),o=Math.min(t[0].pageX,t[1].pageX),s=Math.min(t[0].pageY,t[1].pageY),l=Math.max(t[0].pageX,t[1].pageX),f=Math.max(t[0].pageY,t[1].pageY);return{x:o,y:s,left:o,top:s,right:l,bottom:f,width:l-o,height:f-s}}function hr(n,t){var o=t+"X",s=t+"Y",l=dr(n),f=l[0][o]-l[1][o],p=l[0][s]-l[1][s];return rt(f,p)}function gr(n,t){var o=t+"X",s=t+"Y",l=dr(n),f=l[1][o]-l[0][o],p=l[1][s]-l[0][s];return 180*Math.atan2(p,f)/Math.PI}function ai(n){return E.string(n.pointerType)?n.pointerType:E.number(n.pointerType)?[void 0,void 0,"touch","pen","mouse"][n.pointerType]:/touch/.test(n.type||"")||n instanceof F.Touch?"touch":"mouse"}function ci(n){var t=E.func(n.composedPath)?n.composedPath():n.path;return[$(t?t[0]:n.target),$(n.currentTarget)]}var _n=(function(){function n(t){u(this,n),this.immediatePropagationStopped=!1,this.propagationStopped=!1,this._interaction=t}return g(n,[{key:"preventDefault",value:function(){}},{key:"stopPropagation",value:function(){this.propagationStopped=!0}},{key:"stopImmediatePropagation",value:function(){this.immediatePropagationStopped=this.propagationStopped=!0}}]),n})();Object.defineProperty(_n.prototype,"interaction",{get:function(){return this._interaction._proxy},set:function(){}});var li=function(n,t){for(var o=0;o<t.length;o++){var s=t[o];n.push(s)}return n},ui=function(n){return li([],n)},jt=function(n,t){for(var o=0;o<n.length;o++)if(t(n[o],o,n))return o;return-1},Rt=function(n,t){return n[jt(n,t)]},ft=(function(n){b(o,n);var t=R(o);function o(s,l,f){var p;u(this,o),(p=t.call(this,l._interaction)).dropzone=void 0,p.dragEvent=void 0,p.relatedTarget=void 0,p.draggable=void 0,p.propagationStopped=!1,p.immediatePropagationStopped=!1;var h=f==="dragleave"?s.prev:s.cur,v=h.element,S=h.dropzone;return p.type=f,p.target=v,p.currentTarget=v,p.dropzone=S,p.dragEvent=l,p.relatedTarget=l.target,p.draggable=l.interactable,p.timeStamp=l.timeStamp,p}return g(o,[{key:"reject",value:function(){var s=this,l=this._interaction.dropState;if(this.type==="dropactivate"||this.dropzone&&l.cur.dropzone===this.dropzone&&l.cur.element===this.target)if(l.prev.dropzone=this.dropzone,l.prev.element=this.target,l.rejected=!0,l.events.enter=null,this.stopImmediatePropagation(),this.type==="dropactivate"){var f=l.activeDrops,p=jt(f,(function(v){var S=v.dropzone,y=v.element;return S===s.dropzone&&y===s.target}));l.activeDrops.splice(p,1);var h=new o(l,this.dragEvent,"dropdeactivate");h.dropzone=this.dropzone,h.target=this.target,this.dropzone.fire(h)}else this.dropzone.fire(new o(l,this.dragEvent,"dragleave"))}},{key:"preventDefault",value:function(){}},{key:"stopPropagation",value:function(){this.propagationStopped=!0}},{key:"stopImmediatePropagation",value:function(){this.immediatePropagationStopped=this.propagationStopped=!0}}]),o})(_n);function fi(n,t){for(var o=0,s=n.slice();o<s.length;o++){var l=s[o],f=l.dropzone,p=l.element;t.dropzone=f,t.target=p,f.fire(t),t.propagationStopped=t.immediatePropagationStopped=!1}}function mr(n,t){for(var o=(function(f,p){for(var h=[],v=0,S=f.interactables.list;v<S.length;v++){var y=S[v];if(y.options.drop.enabled){var k=y.options.drop.accept;if(!(E.element(k)&&k!==p||E.string(k)&&!z(p,k)||E.func(k)&&!k({dropzone:y,draggableElement:p})))for(var A=0,H=y.getAllElements();A<H.length;A++){var V=H[A];V!==p&&h.push({dropzone:y,element:V,rect:y.getRect(V)})}}}return h})(n,t),s=0;s<o.length;s++){var l=o[s];l.rect=l.dropzone.getRect(l.element)}return o}function di(n,t,o){for(var s=n.dropState,l=n.interactable,f=n.element,p=[],h=0,v=s.activeDrops;h<v.length;h++){var S=v[h],y=S.dropzone,k=S.element,A=S.rect,H=y.dropCheck(t,o,l,f,k,A);p.push(H?k:null)}var V=(function(G){for(var se,re,fe,ye=[],we=0;we<G.length;we++){var he=G[we],be=G[se];if(he&&we!==se)if(be){var Ae=I(he),Te=I(be);if(Ae!==he.ownerDocument)if(Te!==he.ownerDocument)if(Ae!==Te){ye=ye.length?ye:J(be);var Le=void 0;if(be instanceof F.HTMLElement&&he instanceof F.SVGElement&&!(he instanceof F.SVGSVGElement)){if(he===Te)continue;Le=he.ownerSVGElement}else Le=he;for(var ze=J(Le,be.ownerDocument),Ue=0;ze[Ue]&&ze[Ue]===ye[Ue];)Ue++;var Mn=[ze[Ue-1],ze[Ue],ye[Ue]];if(Mn[0])for(var Vt=Mn[0].lastChild;Vt;){if(Vt===Mn[1]){se=we,ye=ze;break}if(Vt===Mn[2])break;Vt=Vt.previousSibling}}else fe=be,(parseInt(K(re=he).getComputedStyle(re).zIndex,10)||0)>=(parseInt(K(fe).getComputedStyle(fe).zIndex,10)||0)&&(se=we);else se=we}else se=we}return se})(p);return s.activeDrops[V]||null}function vr(n,t,o){var s=n.dropState,l={enter:null,leave:null,activate:null,deactivate:null,move:null,drop:null};return o.type==="dragstart"&&(l.activate=new ft(s,o,"dropactivate"),l.activate.target=null,l.activate.dropzone=null),o.type==="dragend"&&(l.deactivate=new ft(s,o,"dropdeactivate"),l.deactivate.target=null,l.deactivate.dropzone=null),s.rejected||(s.cur.element!==s.prev.element&&(s.prev.dropzone&&(l.leave=new ft(s,o,"dragleave"),o.dragLeave=l.leave.target=s.prev.element,o.prevDropzone=l.leave.dropzone=s.prev.dropzone),s.cur.dropzone&&(l.enter=new ft(s,o,"dragenter"),o.dragEnter=s.cur.element,o.dropzone=s.cur.dropzone)),o.type==="dragend"&&s.cur.dropzone&&(l.drop=new ft(s,o,"drop"),o.dropzone=s.cur.dropzone,o.relatedTarget=s.cur.element),o.type==="dragmove"&&s.cur.dropzone&&(l.move=new ft(s,o,"dropmove"),o.dropzone=s.cur.dropzone)),l}function yr(n,t){var o=n.dropState,s=o.activeDrops,l=o.cur,f=o.prev;t.leave&&f.dropzone.fire(t.leave),t.enter&&l.dropzone.fire(t.enter),t.move&&l.dropzone.fire(t.move),t.drop&&l.dropzone.fire(t.drop),t.deactivate&&fi(s,t.deactivate),o.prev.dropzone=l.dropzone,o.prev.element=l.element}function pi(n,t){var o=n.interaction,s=n.iEvent,l=n.event;if(s.type==="dragmove"||s.type==="dragend"){var f=o.dropState;t.dynamicDrop&&(f.activeDrops=mr(t,o.element));var p=s,h=di(o,p,l);f.rejected=f.rejected&&!!h&&h.dropzone===f.cur.dropzone&&h.element===f.cur.element,f.cur.dropzone=h&&h.dropzone,f.cur.element=h&&h.element,f.events=vr(o,0,p)}}var hi={id:"actions/drop",install:function(n){var t=n.actions,o=n.interactStatic,s=n.Interactable,l=n.defaults;n.usePlugin(ie),s.prototype.dropzone=function(f){return(function(p,h){if(E.object(h)){if(p.options.drop.enabled=h.enabled!==!1,h.listeners){var v=Oe(h.listeners),S=Object.keys(v).reduce((function(k,A){return k[/^(enter|leave)/.test(A)?"drag".concat(A):/^(activate|deactivate|move)/.test(A)?"drop".concat(A):A]=v[A],k}),{}),y=p.options.drop.listeners;y&&p.off(y),p.on(S),p.options.drop.listeners=S}return E.func(h.ondrop)&&p.on("drop",h.ondrop),E.func(h.ondropactivate)&&p.on("dropactivate",h.ondropactivate),E.func(h.ondropdeactivate)&&p.on("dropdeactivate",h.ondropdeactivate),E.func(h.ondragenter)&&p.on("dragenter",h.ondragenter),E.func(h.ondragleave)&&p.on("dragleave",h.ondragleave),E.func(h.ondropmove)&&p.on("dropmove",h.ondropmove),/^(pointer|center)$/.test(h.overlap)?p.options.drop.overlap=h.overlap:E.number(h.overlap)&&(p.options.drop.overlap=Math.max(Math.min(1,h.overlap),0)),"accept"in h&&(p.options.drop.accept=h.accept),"checker"in h&&(p.options.drop.checker=h.checker),p}return E.bool(h)?(p.options.drop.enabled=h,p):p.options.drop})(this,f)},s.prototype.dropCheck=function(f,p,h,v,S,y){return(function(k,A,H,V,G,se,re){var fe=!1;if(!(re=re||k.getRect(se)))return!!k.options.drop.checker&&k.options.drop.checker(A,H,fe,k,se,V,G);var ye=k.options.drop.overlap;if(ye==="pointer"){var we=nt(V,G,"drag"),he=ii(A);he.x+=we.x,he.y+=we.y;var be=he.x>re.left&&he.x<re.right,Ae=he.y>re.top&&he.y<re.bottom;fe=be&&Ae}var Te=V.getRect(G);if(Te&&ye==="center"){var Le=Te.left+Te.width/2,ze=Te.top+Te.height/2;fe=Le>=re.left&&Le<=re.right&&ze>=re.top&&ze<=re.bottom}return Te&&E.number(ye)&&(fe=Math.max(0,Math.min(re.right,Te.right)-Math.max(re.left,Te.left))*Math.max(0,Math.min(re.bottom,Te.bottom)-Math.max(re.top,Te.top))/(Te.width*Te.height)>=ye),k.options.drop.checker&&(fe=k.options.drop.checker(A,H,fe,k,se,V,G)),fe})(this,f,p,h,v,S,y)},o.dynamicDrop=function(f){return E.bool(f)?(n.dynamicDrop=f,o):n.dynamicDrop},ne(t.phaselessTypes,{dragenter:!0,dragleave:!0,dropactivate:!0,dropdeactivate:!0,dropmove:!0,drop:!0}),t.methodDict.drop="dropzone",n.dynamicDrop=!1,l.actions.drop=hi.defaults},listeners:{"interactions:before-action-start":function(n){var t=n.interaction;t.prepared.name==="drag"&&(t.dropState={cur:{dropzone:null,element:null},prev:{dropzone:null,element:null},rejected:null,events:null,activeDrops:[]})},"interactions:after-action-start":function(n,t){var o=n.interaction,s=n.iEvent;if(o.prepared.name==="drag"){var l=o.dropState;l.activeDrops=[],l.events={},l.activeDrops=mr(t,o.element),l.events=vr(o,0,s),l.events.activate&&(fi(l.activeDrops,l.events.activate),t.fire("actions/drop:start",{interaction:o,dragEvent:s}))}},"interactions:action-move":pi,"interactions:after-action-move":function(n,t){var o=n.interaction,s=n.iEvent;if(o.prepared.name==="drag"){var l=o.dropState;yr(o,l.events),t.fire("actions/drop:move",{interaction:o,dragEvent:s}),l.events={}}},"interactions:action-end":function(n,t){if(n.interaction.prepared.name==="drag"){var o=n.interaction,s=n.iEvent;pi(n,t),yr(o,o.dropState.events),t.fire("actions/drop:end",{interaction:o,dragEvent:s})}},"interactions:stop":function(n){var t=n.interaction;if(t.prepared.name==="drag"){var o=t.dropState;o&&(o.activeDrops=null,o.events=null,o.cur.dropzone=null,o.cur.element=null,o.prev.dropzone=null,o.prev.element=null,o.rejected=!1)}}},getActiveDrops:mr,getDrop:di,getDropEvents:vr,fireDropEvents:yr,filterEventType:function(n){return n.search("drag")===0||n.search("drop")===0},defaults:{enabled:!1,accept:null,overlap:"pointer"}},Bc=hi;function br(n){var t=n.interaction,o=n.iEvent,s=n.phase;if(t.prepared.name==="gesture"){var l=t.pointers.map((function(S){return S.pointer})),f=s==="start",p=s==="end",h=t.interactable.options.deltaSource;if(o.touches=[l[0],l[1]],f)o.distance=hr(l,h),o.box=pr(l),o.scale=1,o.ds=0,o.angle=gr(l,h),o.da=0,t.gesture.startDistance=o.distance,t.gesture.startAngle=o.angle;else if(p||t.pointers.length<2){var v=t.prevEvent;o.distance=v.distance,o.box=v.box,o.scale=v.scale,o.ds=0,o.angle=v.angle,o.da=0}else o.distance=hr(l,h),o.box=pr(l),o.scale=o.distance/t.gesture.startDistance,o.angle=gr(l,h),o.ds=o.scale-t.gesture.scale,o.da=o.angle-t.gesture.angle;t.gesture.distance=o.distance,t.gesture.angle=o.angle,E.number(o.scale)&&o.scale!==1/0&&!isNaN(o.scale)&&(t.gesture.scale=o.scale)}}var wr={id:"actions/gesture",before:["actions/drag","actions/resize"],install:function(n){var t=n.actions,o=n.Interactable,s=n.defaults;o.prototype.gesturable=function(l){return E.object(l)?(this.options.gesture.enabled=l.enabled!==!1,this.setPerAction("gesture",l),this.setOnEvents("gesture",l),this):E.bool(l)?(this.options.gesture.enabled=l,this):this.options.gesture},t.map.gesture=wr,t.methodDict.gesture="gesturable",s.actions.gesture=wr.defaults},listeners:{"interactions:action-start":br,"interactions:action-move":br,"interactions:action-end":br,"interactions:new":function(n){n.interaction.gesture={angle:0,distance:0,scale:1,startAngle:0,startDistance:0}},"auto-start:check":function(n){if(!(n.interaction.pointers.length<2)){var t=n.interactable.options.gesture;if(t&&t.enabled)return n.action={name:"gesture"},!1}}},defaults:{},getCursor:function(){return""},filterEventType:function(n){return n.search("gesture")===0}},Hc=wr;function Yc(n,t,o,s,l,f,p){if(!t)return!1;if(t===!0){var h=E.number(f.width)?f.width:f.right-f.left,v=E.number(f.height)?f.height:f.bottom-f.top;if(p=Math.min(p,Math.abs((n==="left"||n==="right"?h:v)/2)),h<0&&(n==="left"?n="right":n==="right"&&(n="left")),v<0&&(n==="top"?n="bottom":n==="bottom"&&(n="top")),n==="left"){var S=h>=0?f.left:f.right;return o.x<S+p}if(n==="top"){var y=v>=0?f.top:f.bottom;return o.y<y+p}if(n==="right")return o.x>(h>=0?f.right:f.left)-p;if(n==="bottom")return o.y>(v>=0?f.bottom:f.top)-p}return!!E.element(s)&&(E.element(t)?t===s:ee(s,t,l))}function gi(n){var t=n.iEvent,o=n.interaction;if(o.prepared.name==="resize"&&o.resizeAxes){var s=t;o.interactable.options.resize.square?(o.resizeAxes==="y"?s.delta.x=s.delta.y:s.delta.y=s.delta.x,s.axes="xy"):(s.axes=o.resizeAxes,o.resizeAxes==="x"?s.delta.y=0:o.resizeAxes==="y"&&(s.delta.x=0))}}var Ye,ot,Xe={id:"actions/resize",before:["actions/drag"],install:function(n){var t=n.actions,o=n.browser,s=n.Interactable,l=n.defaults;Xe.cursors=(function(f){return f.isIe9?{x:"e-resize",y:"s-resize",xy:"se-resize",top:"n-resize",left:"w-resize",bottom:"s-resize",right:"e-resize",topleft:"se-resize",bottomright:"se-resize",topright:"ne-resize",bottomleft:"ne-resize"}:{x:"ew-resize",y:"ns-resize",xy:"nwse-resize",top:"ns-resize",left:"ew-resize",bottom:"ns-resize",right:"ew-resize",topleft:"nwse-resize",bottomright:"nwse-resize",topright:"nesw-resize",bottomleft:"nesw-resize"}})(o),Xe.defaultMargin=o.supportsTouch||o.supportsPointerEvent?20:10,s.prototype.resizable=function(f){return(function(p,h,v){return E.object(h)?(p.options.resize.enabled=h.enabled!==!1,p.setPerAction("resize",h),p.setOnEvents("resize",h),E.string(h.axis)&&/^x$|^y$|^xy$/.test(h.axis)?p.options.resize.axis=h.axis:h.axis===null&&(p.options.resize.axis=v.defaults.actions.resize.axis),E.bool(h.preserveAspectRatio)?p.options.resize.preserveAspectRatio=h.preserveAspectRatio:E.bool(h.square)&&(p.options.resize.square=h.square),p):E.bool(h)?(p.options.resize.enabled=h,p):p.options.resize})(this,f,n)},t.map.resize=Xe,t.methodDict.resize="resizable",l.actions.resize=Xe.defaults},listeners:{"interactions:new":function(n){n.interaction.resizeAxes="xy"},"interactions:action-start":function(n){(function(t){var o=t.iEvent,s=t.interaction;if(s.prepared.name==="resize"&&s.prepared.edges){var l=o,f=s.rect;s._rects={start:ne({},f),corrected:ne({},f),previous:ne({},f),delta:{left:0,right:0,width:0,top:0,bottom:0,height:0}},l.edges=s.prepared.edges,l.rect=s._rects.corrected,l.deltaRect=s._rects.delta}})(n),gi(n)},"interactions:action-move":function(n){(function(t){var o=t.iEvent,s=t.interaction;if(s.prepared.name==="resize"&&s.prepared.edges){var l=o,f=s.interactable.options.resize.invert,p=f==="reposition"||f==="negate",h=s.rect,v=s._rects,S=v.start,y=v.corrected,k=v.delta,A=v.previous;if(ne(A,y),p){if(ne(y,h),f==="reposition"){if(y.top>y.bottom){var H=y.top;y.top=y.bottom,y.bottom=H}if(y.left>y.right){var V=y.left;y.left=y.right,y.right=V}}}else y.top=Math.min(h.top,S.bottom),y.bottom=Math.max(h.bottom,S.top),y.left=Math.min(h.left,S.right),y.right=Math.max(h.right,S.left);for(var G in y.width=y.right-y.left,y.height=y.bottom-y.top,y)k[G]=y[G]-A[G];l.edges=s.prepared.edges,l.rect=y,l.deltaRect=k}})(n),gi(n)},"interactions:action-end":function(n){var t=n.iEvent,o=n.interaction;if(o.prepared.name==="resize"&&o.prepared.edges){var s=t;s.edges=o.prepared.edges,s.rect=o._rects.corrected,s.deltaRect=o._rects.delta}},"auto-start:check":function(n){var t=n.interaction,o=n.interactable,s=n.element,l=n.rect,f=n.buttons;if(l){var p=ne({},t.coords.cur.page),h=o.options.resize;if(h&&h.enabled&&(!t.pointerIsDown||!/mouse|pointer/.test(t.pointerType)||(f&h.mouseButtons)!=0)){if(E.object(h.edges)){var v={left:!1,right:!1,top:!1,bottom:!1};for(var S in v)v[S]=Yc(S,h.edges[S],p,t._latestPointer.eventTarget,s,l,h.margin||Xe.defaultMargin);v.left=v.left&&!v.right,v.top=v.top&&!v.bottom,(v.left||v.right||v.top||v.bottom)&&(n.action={name:"resize",edges:v})}else{var y=h.axis!=="y"&&p.x>l.right-Xe.defaultMargin,k=h.axis!=="x"&&p.y>l.bottom-Xe.defaultMargin;(y||k)&&(n.action={name:"resize",axes:(y?"x":"")+(k?"y":"")})}return!n.action&&void 0}}}},defaults:{square:!1,preserveAspectRatio:!1,axis:"xy",margin:NaN,edges:null,invert:"none"},cursors:null,getCursor:function(n){var t=n.edges,o=n.axis,s=n.name,l=Xe.cursors,f=null;if(o)f=l[s+o];else if(t){for(var p="",h=0,v=["top","bottom","left","right"];h<v.length;h++){var S=v[h];t[S]&&(p+=S)}f=l[p]}return f},filterEventType:function(n){return n.search("resize")===0},defaultMargin:null},Xc=Xe,Uc={id:"actions",install:function(n){n.usePlugin(Hc),n.usePlugin(Xc),n.usePlugin(ie),n.usePlugin(Bc)}},mi=0,We={request:function(n){return Ye(n)},cancel:function(n){return ot(n)},init:function(n){if(Ye=n.requestAnimationFrame,ot=n.cancelAnimationFrame,!Ye)for(var t=["ms","moz","webkit","o"],o=0;o<t.length;o++){var s=t[o];Ye=n["".concat(s,"RequestAnimationFrame")],ot=n["".concat(s,"CancelAnimationFrame")]||n["".concat(s,"CancelRequestAnimationFrame")]}Ye=Ye&&Ye.bind(n),ot=ot&&ot.bind(n),Ye||(Ye=function(l){var f=Date.now(),p=Math.max(0,16-(f-mi)),h=n.setTimeout((function(){l(f+p)}),p);return mi=f+p,h},ot=function(l){return clearTimeout(l)})}},ge={defaults:{enabled:!1,margin:60,container:null,speed:300},now:Date.now,interaction:null,i:0,x:0,y:0,isScrolling:!1,prevTime:0,margin:0,speed:0,start:function(n){ge.isScrolling=!0,We.cancel(ge.i),n.autoScroll=ge,ge.interaction=n,ge.prevTime=ge.now(),ge.i=We.request(ge.scroll)},stop:function(){ge.isScrolling=!1,ge.interaction&&(ge.interaction.autoScroll=null),We.cancel(ge.i)},scroll:function(){var n=ge.interaction,t=n.interactable,o=n.element,s=n.prepared.name,l=t.options[s].autoScroll,f=vi(l.container,t,o),p=ge.now(),h=(p-ge.prevTime)/1e3,v=l.speed*h;if(v>=1){var S={x:ge.x*v,y:ge.y*v};if(S.x||S.y){var y=yi(f);E.window(f)?f.scrollBy(S.x,S.y):f&&(f.scrollLeft+=S.x,f.scrollTop+=S.y);var k=yi(f),A={x:k.x-y.x,y:k.y-y.y};(A.x||A.y)&&t.fire({type:"autoscroll",target:o,interactable:t,delta:A,interaction:n,container:f})}ge.prevTime=p}ge.isScrolling&&(We.cancel(ge.i),ge.i=We.request(ge.scroll))},check:function(n,t){var o;return(o=n.options[t].autoScroll)==null?void 0:o.enabled},onInteractionMove:function(n){var t=n.interaction,o=n.pointer;if(t.interacting()&&ge.check(t.interactable,t.prepared.name))if(t.simulation)ge.x=ge.y=0;else{var s,l,f,p,h=t.interactable,v=t.element,S=t.prepared.name,y=h.options[S].autoScroll,k=vi(y.container,h,v);if(E.window(k))p=o.clientX<ge.margin,s=o.clientY<ge.margin,l=o.clientX>k.innerWidth-ge.margin,f=o.clientY>k.innerHeight-ge.margin;else{var A=pe(k);p=o.clientX<A.left+ge.margin,s=o.clientY<A.top+ge.margin,l=o.clientX>A.right-ge.margin,f=o.clientY>A.bottom-ge.margin}ge.x=l?1:p?-1:0,ge.y=f?1:s?-1:0,ge.isScrolling||(ge.margin=y.margin,ge.speed=y.speed,ge.start(t))}}};function vi(n,t,o){return(E.string(n)?Ve(n,t,o):n)||K(o)}function yi(n){return E.window(n)&&(n=window.document.body),{x:n.scrollLeft,y:n.scrollTop}}var Kc={id:"auto-scroll",install:function(n){var t=n.defaults,o=n.actions;n.autoScroll=ge,ge.now=function(){return n.now()},o.phaselessTypes.autoscroll=!0,t.perAction.autoScroll=ge.defaults},listeners:{"interactions:new":function(n){n.interaction.autoScroll=null},"interactions:destroy":function(n){n.interaction.autoScroll=null,ge.stop(),ge.interaction&&(ge.interaction=null)},"interactions:stop":ge.stop,"interactions:action-move":function(n){return ge.onInteractionMove(n)}}},Gc=Kc;function At(n,t){var o=!1;return function(){return o||(q.console.warn(t),o=!0),n.apply(this,arguments)}}function xr(n,t){return n.name=t.name,n.axis=t.axis,n.edges=t.edges,n}function Wc(n){return E.bool(n)?(this.options.styleCursor=n,this):n===null?(delete this.options.styleCursor,this):this.options.styleCursor}function Jc(n){return E.func(n)?(this.options.actionChecker=n,this):n===null?(delete this.options.actionChecker,this):this.options.actionChecker}var Zc={id:"auto-start/interactableMethods",install:function(n){var t=n.Interactable;t.prototype.getAction=function(o,s,l,f){var p=(function(h,v,S,y,k){var A=h.getRect(y),H=v.buttons||{0:1,1:4,3:8,4:16}[v.button],V={action:null,interactable:h,interaction:S,element:y,rect:A,buttons:H};return k.fire("auto-start:check",V),V.action})(this,s,l,f,n);return this.options.actionChecker?this.options.actionChecker(o,s,p,this,f,l):p},t.prototype.ignoreFrom=At((function(o){return this._backCompatOption("ignoreFrom",o)}),"Interactable.ignoreFrom() has been deprecated. Use Interactble.draggable({ignoreFrom: newValue})."),t.prototype.allowFrom=At((function(o){return this._backCompatOption("allowFrom",o)}),"Interactable.allowFrom() has been deprecated. Use Interactble.draggable({allowFrom: newValue})."),t.prototype.actionChecker=Jc,t.prototype.styleCursor=Wc}};function bi(n,t,o,s,l){return t.testIgnoreAllow(t.options[n.name],o,s)&&t.options[n.name].enabled&&Cn(t,o,n,l)?n:null}function Qc(n,t,o,s,l,f,p){for(var h=0,v=s.length;h<v;h++){var S=s[h],y=l[h],k=S.getAction(t,o,n,y);if(k){var A=bi(k,S,y,f,p);if(A)return{action:A,interactable:S,element:y}}}return{action:null,interactable:null,element:null}}function wi(n,t,o,s,l){var f=[],p=[],h=s;function v(y){f.push(y),p.push(h)}for(;E.element(h);){f=[],p=[],l.interactables.forEachMatch(h,v);var S=Qc(n,t,o,f,p,s,l);if(S.action&&!S.interactable.options[S.action.name].manualStart)return S;h=Y(h)}return{action:null,interactable:null,element:null}}function xi(n,t,o){var s=t.action,l=t.interactable,f=t.element;s=s||{name:null},n.interactable=l,n.element=f,xr(n.prepared,s),n.rect=l&&s.name?l.getRect(f):null,Ni(n,o),o.fire("autoStart:prepared",{interaction:n})}function Cn(n,t,o,s){var l=n.options,f=l[o.name].max,p=l[o.name].maxPerElement,h=s.autoStart.maxInteractions,v=0,S=0,y=0;if(!(f&&p&&h))return!1;for(var k=0,A=s.interactions.list;k<A.length;k++){var H=A[k],V=H.prepared.name;if(H.interacting()&&(++v>=h||H.interactable===n&&((S+=V===o.name?1:0)>=f||H.element===t&&(y++,V===o.name&&y>=p))))return!1}return h>0}function Ei(n,t){return E.number(n)?(t.autoStart.maxInteractions=n,this):t.autoStart.maxInteractions}function Er(n,t,o){var s=o.autoStart.cursorElement;s&&s!==n&&(s.style.cursor=""),n.ownerDocument.documentElement.style.cursor=t,n.style.cursor=t,o.autoStart.cursorElement=t?n:null}function Ni(n,t){var o=n.interactable,s=n.element,l=n.prepared;if(n.pointerType==="mouse"&&o&&o.options.styleCursor){var f="";if(l.name){var p=o.options[l.name].cursorChecker;f=E.func(p)?p(l,o,s,n._interacting):t.actions.map[l.name].getCursor(l)}Er(n.element,f||"",t)}else t.autoStart.cursorElement&&Er(t.autoStart.cursorElement,"",t)}var $c={id:"auto-start/base",before:["actions"],install:function(n){var t=n.interactStatic,o=n.defaults;n.usePlugin(Zc),o.base.actionChecker=null,o.base.styleCursor=!0,ne(o.perAction,{manualStart:!1,max:1/0,maxPerElement:1,allowFrom:null,ignoreFrom:null,mouseButtons:1}),t.maxInteractions=function(s){return Ei(s,n)},n.autoStart={maxInteractions:1/0,withinInteractionLimit:Cn,cursorElement:null}},listeners:{"interactions:down":function(n,t){var o=n.interaction,s=n.pointer,l=n.event,f=n.eventTarget;o.interacting()||xi(o,wi(o,s,l,f,t),t)},"interactions:move":function(n,t){(function(o,s){var l=o.interaction,f=o.pointer,p=o.event,h=o.eventTarget;l.pointerType!=="mouse"||l.pointerIsDown||l.interacting()||xi(l,wi(l,f,p,h,s),s)})(n,t),(function(o,s){var l=o.interaction;if(l.pointerIsDown&&!l.interacting()&&l.pointerWasMoved&&l.prepared.name){s.fire("autoStart:before-start",o);var f=l.interactable,p=l.prepared.name;p&&f&&(f.options[p].manualStart||!Cn(f,l.element,l.prepared,s)?l.stop():(l.start(l.prepared,f,l.element),Ni(l,s)))}})(n,t)},"interactions:stop":function(n,t){var o=n.interaction,s=o.interactable;s&&s.options.styleCursor&&Er(o.element,"",t)}},maxInteractions:Ei,withinInteractionLimit:Cn,validateAction:bi},Nr=$c,qc={id:"auto-start/dragAxis",listeners:{"autoStart:before-start":function(n,t){var o=n.interaction,s=n.eventTarget,l=n.dx,f=n.dy;if(o.prepared.name==="drag"){var p=Math.abs(l),h=Math.abs(f),v=o.interactable.options.drag,S=v.startAxis,y=p>h?"x":p<h?"y":"xy";if(o.prepared.axis=v.lockAxis==="start"?y[0]:v.lockAxis,y!=="xy"&&S!=="xy"&&S!==y){o.prepared.name=null;for(var k=s,A=function(V){if(V!==o.interactable){var G=o.interactable.options.drag;if(!G.manualStart&&V.testIgnoreAllow(G,k,s)){var se=V.getAction(o.downPointer,o.downEvent,o,k);if(se&&se.name==="drag"&&(function(re,fe){if(!fe)return!1;var ye=fe.options.drag.startAxis;return re==="xy"||ye==="xy"||ye===re})(y,V)&&Nr.validateAction(se,V,k,s,t))return V}}};E.element(k);){var H=t.interactables.forEachMatch(k,A);if(H){o.prepared.name="drag",o.interactable=H,o.element=k;break}k=Y(k)}}}}}};function Sr(n){var t=n.prepared&&n.prepared.name;if(!t)return null;var o=n.interactable.options;return o[t].hold||o[t].delay}var el={id:"auto-start/hold",install:function(n){var t=n.defaults;n.usePlugin(Nr),t.perAction.hold=0,t.perAction.delay=0},listeners:{"interactions:new":function(n){n.interaction.autoStartHoldTimer=null},"autoStart:prepared":function(n){var t=n.interaction,o=Sr(t);o>0&&(t.autoStartHoldTimer=setTimeout((function(){t.start(t.prepared,t.interactable,t.element)}),o))},"interactions:move":function(n){var t=n.interaction,o=n.duplicate;t.autoStartHoldTimer&&t.pointerWasMoved&&!o&&(clearTimeout(t.autoStartHoldTimer),t.autoStartHoldTimer=null)},"autoStart:before-start":function(n){var t=n.interaction;Sr(t)>0&&(t.prepared.name=null)}},getHoldDuration:Sr},tl=el,nl={id:"auto-start",install:function(n){n.usePlugin(Nr),n.usePlugin(tl),n.usePlugin(qc)}},rl=function(n){return/^(always|never|auto)$/.test(n)?(this.options.preventDefault=n,this):E.bool(n)?(this.options.preventDefault=n?"always":"never",this):this.options.preventDefault};function ol(n){var t=n.interaction,o=n.event;t.interactable&&t.interactable.checkAndPreventDefault(o)}var Si={id:"core/interactablePreventDefault",install:function(n){var t=n.Interactable;t.prototype.preventDefault=rl,t.prototype.checkAndPreventDefault=function(o){return(function(s,l,f){var p=s.options.preventDefault;if(p!=="never")if(p!=="always"){if(l.events.supportsPassive&&/^touch(start|move)$/.test(f.type)){var h=K(f.target).document,v=l.getDocOptions(h);if(!v||!v.events||v.events.passive!==!1)return}/^(mouse|pointer|touch)*(down|start)/i.test(f.type)||E.element(f.target)&&z(f.target,"input,select,textarea,[contenteditable=true],[contenteditable=true] *")||f.preventDefault()}else f.preventDefault()})(this,n,o)},n.interactions.docEvents.push({type:"dragstart",listener:function(o){for(var s=0,l=n.interactions.list;s<l.length;s++){var f=l[s];if(f.element&&(f.element===o.target||ae(f.element,o.target)))return void f.interactable.checkAndPreventDefault(o)}}})},listeners:["down","move","up","cancel"].reduce((function(n,t){return n["interactions:".concat(t)]=ol,n}),{})};function kn(n,t){if(t.phaselessTypes[n])return!0;for(var o in t.map)if(n.indexOf(o)===0&&n.substr(o.length)in t.phases)return!0;return!1}function dt(n){var t={};for(var o in n){var s=n[o];E.plainObject(s)?t[o]=dt(s):E.array(s)?t[o]=ui(s):t[o]=s}return t}var Tr=(function(){function n(t){u(this,n),this.states=[],this.startOffset={left:0,right:0,top:0,bottom:0},this.startDelta=void 0,this.result=void 0,this.endResult=void 0,this.startEdges=void 0,this.edges=void 0,this.interaction=void 0,this.interaction=t,this.result=On(),this.edges={left:!1,right:!1,top:!1,bottom:!1}}return g(n,[{key:"start",value:function(t,o){var s,l,f=t.phase,p=this.interaction,h=(function(S){var y=S.interactable.options[S.prepared.name],k=y.modifiers;return k&&k.length?k:["snap","snapSize","snapEdges","restrict","restrictEdges","restrictSize"].map((function(A){var H=y[A];return H&&H.enabled&&{options:H,methods:H._methods}})).filter((function(A){return!!A}))})(p);this.prepareStates(h),this.startEdges=ne({},p.edges),this.edges=ne({},this.startEdges),this.startOffset=(s=p.rect,l=o,s?{left:l.x-s.left,top:l.y-s.top,right:s.right-l.x,bottom:s.bottom-l.y}:{left:0,top:0,right:0,bottom:0}),this.startDelta={x:0,y:0};var v=this.fillArg({phase:f,pageCoords:o,preEnd:!1});return this.result=On(),this.startAll(v),this.result=this.setAll(v)}},{key:"fillArg",value:function(t){var o=this.interaction;return t.interaction=o,t.interactable=o.interactable,t.element=o.element,t.rect||(t.rect=o.rect),t.edges||(t.edges=this.startEdges),t.startOffset=this.startOffset,t}},{key:"startAll",value:function(t){for(var o=0,s=this.states;o<s.length;o++){var l=s[o];l.methods.start&&(t.state=l,l.methods.start(t))}}},{key:"setAll",value:function(t){var o=t.phase,s=t.preEnd,l=t.skipModifiers,f=t.rect,p=t.edges;t.coords=ne({},t.pageCoords),t.rect=ne({},f),t.edges=ne({},p);for(var h=l?this.states.slice(l):this.states,v=On(t.coords,t.rect),S=0;S<h.length;S++){var y,k=h[S],A=k.options,H=ne({},t.coords),V=null;(y=k.methods)!=null&&y.set&&this.shouldDo(A,s,o)&&(t.state=k,V=k.methods.set(t),lt(t.edges,t.rect,{x:t.coords.x-H.x,y:t.coords.y-H.y})),v.eventProps.push(V)}ne(this.edges,t.edges),v.delta.x=t.coords.x-t.pageCoords.x,v.delta.y=t.coords.y-t.pageCoords.y,v.rectDelta.left=t.rect.left-f.left,v.rectDelta.right=t.rect.right-f.right,v.rectDelta.top=t.rect.top-f.top,v.rectDelta.bottom=t.rect.bottom-f.bottom;var G=this.result.coords,se=this.result.rect;if(G&&se){var re=v.rect.left!==se.left||v.rect.right!==se.right||v.rect.top!==se.top||v.rect.bottom!==se.bottom;v.changed=re||G.x!==v.coords.x||G.y!==v.coords.y}return v}},{key:"applyToInteraction",value:function(t){var o=this.interaction,s=t.phase,l=o.coords.cur,f=o.coords.start,p=this.result,h=this.startDelta,v=p.delta;s==="start"&&ne(this.startDelta,p.delta);for(var S=0,y=[[f,h],[l,v]];S<y.length;S++){var k=y[S],A=k[0],H=k[1];A.page.x+=H.x,A.page.y+=H.y,A.client.x+=H.x,A.client.y+=H.y}var V=this.result.rectDelta,G=t.rect||o.rect;G.left+=V.left,G.right+=V.right,G.top+=V.top,G.bottom+=V.bottom,G.width=G.right-G.left,G.height=G.bottom-G.top}},{key:"setAndApply",value:function(t){var o=this.interaction,s=t.phase,l=t.preEnd,f=t.skipModifiers,p=this.setAll(this.fillArg({preEnd:l,phase:s,pageCoords:t.modifiedCoords||o.coords.cur.page}));if(this.result=p,!p.changed&&(!f||f<this.states.length)&&o.interacting())return!1;if(t.modifiedCoords){var h=o.coords.cur.page,v={x:t.modifiedCoords.x-h.x,y:t.modifiedCoords.y-h.y};p.coords.x+=v.x,p.coords.y+=v.y,p.delta.x+=v.x,p.delta.y+=v.y}this.applyToInteraction(t)}},{key:"beforeEnd",value:function(t){var o=t.interaction,s=t.event,l=this.states;if(l&&l.length){for(var f=!1,p=0;p<l.length;p++){var h=l[p];t.state=h;var v=h.options,S=h.methods,y=S.beforeEnd&&S.beforeEnd(t);if(y)return this.endResult=y,!1;f=f||!f&&this.shouldDo(v,!0,t.phase,!0)}f&&o.move({event:s,preEnd:!0})}}},{key:"stop",value:function(t){var o=t.interaction;if(this.states&&this.states.length){var s=ne({states:this.states,interactable:o.interactable,element:o.element,rect:null},t);this.fillArg(s);for(var l=0,f=this.states;l<f.length;l++){var p=f[l];s.state=p,p.methods.stop&&p.methods.stop(s)}this.states=null,this.endResult=null}}},{key:"prepareStates",value:function(t){this.states=[];for(var o=0;o<t.length;o++){var s=t[o],l=s.options,f=s.methods,p=s.name;this.states.push({options:l,methods:f,index:o,name:p})}return this.states}},{key:"restoreInteractionCoords",value:function(t){var o=t.interaction,s=o.coords,l=o.rect,f=o.modification;if(f.result){for(var p=f.startDelta,h=f.result,v=h.delta,S=h.rectDelta,y=0,k=[[s.start,p],[s.cur,v]];y<k.length;y++){var A=k[y],H=A[0],V=A[1];H.page.x-=V.x,H.page.y-=V.y,H.client.x-=V.x,H.client.y-=V.y}l.left-=S.left,l.right-=S.right,l.top-=S.top,l.bottom-=S.bottom}}},{key:"shouldDo",value:function(t,o,s,l){return!(!t||t.enabled===!1||l&&!t.endOnly||t.endOnly&&!o||s==="start"&&!t.setStart)}},{key:"copyFrom",value:function(t){this.startOffset=t.startOffset,this.startDelta=t.startDelta,this.startEdges=t.startEdges,this.edges=t.edges,this.states=t.states.map((function(o){return dt(o)})),this.result=On(ne({},t.result.coords),ne({},t.result.rect))}},{key:"destroy",value:function(){for(var t in this)this[t]=null}}]),n})();function On(n,t){return{rect:t,coords:n,delta:{x:0,y:0},rectDelta:{left:0,right:0,top:0,bottom:0},eventProps:[],changed:!0}}function Je(n,t){var o=n.defaults,s={start:n.start,set:n.set,beforeEnd:n.beforeEnd,stop:n.stop},l=function(f){var p=f||{};for(var h in p.enabled=p.enabled!==!1,o)h in p||(p[h]=o[h]);var v={options:p,methods:s,name:t,enable:function(){return p.enabled=!0,v},disable:function(){return p.enabled=!1,v}};return v};return t&&typeof t=="string"&&(l._defaults=o,l._methods=s),l}function Mt(n){var t=n.iEvent,o=n.interaction.modification.result;o&&(t.modifiers=o.eventProps)}var il={id:"modifiers/base",before:["actions"],install:function(n){n.defaults.perAction.modifiers=[]},listeners:{"interactions:new":function(n){var t=n.interaction;t.modification=new Tr(t)},"interactions:before-action-start":function(n){var t=n.interaction,o=n.interaction.modification;o.start(n,t.coords.start.page),t.edges=o.edges,o.applyToInteraction(n)},"interactions:before-action-move":function(n){var t=n.interaction,o=t.modification,s=o.setAndApply(n);return t.edges=o.edges,s},"interactions:before-action-end":function(n){var t=n.interaction,o=t.modification,s=o.beforeEnd(n);return t.edges=o.startEdges,s},"interactions:action-start":Mt,"interactions:action-move":Mt,"interactions:action-end":Mt,"interactions:after-action-start":function(n){return n.interaction.modification.restoreInteractionCoords(n)},"interactions:after-action-move":function(n){return n.interaction.modification.restoreInteractionCoords(n)},"interactions:stop":function(n){return n.interaction.modification.stop(n)}}},Ti=il,_i={base:{preventDefault:"auto",deltaSource:"page"},perAction:{enabled:!1,origin:{x:0,y:0}},actions:{}},_r=(function(n){b(o,n);var t=R(o);function o(s,l,f,p,h,v,S){var y;u(this,o),(y=t.call(this,s)).relatedTarget=null,y.screenX=void 0,y.screenY=void 0,y.button=void 0,y.buttons=void 0,y.ctrlKey=void 0,y.shiftKey=void 0,y.altKey=void 0,y.metaKey=void 0,y.page=void 0,y.client=void 0,y.delta=void 0,y.rect=void 0,y.x0=void 0,y.y0=void 0,y.t0=void 0,y.dt=void 0,y.duration=void 0,y.clientX0=void 0,y.clientY0=void 0,y.velocity=void 0,y.speed=void 0,y.swipe=void 0,y.axes=void 0,y.preEnd=void 0,h=h||s.element;var k=s.interactable,A=(k&&k.options||_i).deltaSource,H=nt(k,h,f),V=p==="start",G=p==="end",se=V?P(y):s.prevEvent,re=V?s.coords.start:G?{page:se.page,client:se.client,timeStamp:s.coords.cur.timeStamp}:s.coords.cur;return y.page=ne({},re.page),y.client=ne({},re.client),y.rect=ne({},s.rect),y.timeStamp=re.timeStamp,G||(y.page.x-=H.x,y.page.y-=H.y,y.client.x-=H.x,y.client.y-=H.y),y.ctrlKey=l.ctrlKey,y.altKey=l.altKey,y.shiftKey=l.shiftKey,y.metaKey=l.metaKey,y.button=l.button,y.buttons=l.buttons,y.target=h,y.currentTarget=h,y.preEnd=v,y.type=S||f+(p||""),y.interactable=k,y.t0=V?s.pointers[s.pointers.length-1].downTime:se.t0,y.x0=s.coords.start.page.x-H.x,y.y0=s.coords.start.page.y-H.y,y.clientX0=s.coords.start.client.x-H.x,y.clientY0=s.coords.start.client.y-H.y,y.delta=V||G?{x:0,y:0}:{x:y[A].x-se[A].x,y:y[A].y-se[A].y},y.dt=s.coords.delta.timeStamp,y.duration=y.timeStamp-y.t0,y.velocity=ne({},s.coords.velocity[A]),y.speed=rt(y.velocity.x,y.velocity.y),y.swipe=G||p==="inertiastart"?y.getSwipe():null,y}return g(o,[{key:"getSwipe",value:function(){var s=this._interaction;if(s.prevEvent.speed<600||this.timeStamp-s.prevEvent.timeStamp>150)return null;var l=180*Math.atan2(s.prevEvent.velocityY,s.prevEvent.velocityX)/Math.PI;l<0&&(l+=360);var f=112.5<=l&&l<247.5,p=202.5<=l&&l<337.5;return{up:p,down:!p&&22.5<=l&&l<157.5,left:f,right:!f&&(292.5<=l||l<67.5),angle:l,speed:s.prevEvent.speed,velocity:{x:s.prevEvent.velocityX,y:s.prevEvent.velocityY}}}},{key:"preventDefault",value:function(){}},{key:"stopImmediatePropagation",value:function(){this.immediatePropagationStopped=this.propagationStopped=!0}},{key:"stopPropagation",value:function(){this.propagationStopped=!0}}]),o})(_n);Object.defineProperties(_r.prototype,{pageX:{get:function(){return this.page.x},set:function(n){this.page.x=n}},pageY:{get:function(){return this.page.y},set:function(n){this.page.y=n}},clientX:{get:function(){return this.client.x},set:function(n){this.client.x=n}},clientY:{get:function(){return this.client.y},set:function(n){this.client.y=n}},dx:{get:function(){return this.delta.x},set:function(n){this.delta.x=n}},dy:{get:function(){return this.delta.y},set:function(n){this.delta.y=n}},velocityX:{get:function(){return this.velocity.x},set:function(n){this.velocity.x=n}},velocityY:{get:function(){return this.velocity.y},set:function(n){this.velocity.y=n}}});var sl=g((function n(t,o,s,l,f){u(this,n),this.id=void 0,this.pointer=void 0,this.event=void 0,this.downTime=void 0,this.downTarget=void 0,this.id=t,this.pointer=o,this.event=s,this.downTime=l,this.downTarget=f})),al=(function(n){return n.interactable="",n.element="",n.prepared="",n.pointerIsDown="",n.pointerWasMoved="",n._proxy="",n})({}),Ci=(function(n){return n.start="",n.move="",n.end="",n.stop="",n.interacting="",n})({}),cl=0,ll=(function(){function n(t){var o=this,s=t.pointerType,l=t.scopeFire;u(this,n),this.interactable=null,this.element=null,this.rect=null,this._rects=void 0,this.edges=null,this._scopeFire=void 0,this.prepared={name:null,axis:null,edges:null},this.pointerType=void 0,this.pointers=[],this.downEvent=null,this.downPointer={},this._latestPointer={pointer:null,event:null,eventTarget:null},this.prevEvent=null,this.pointerIsDown=!1,this.pointerWasMoved=!1,this._interacting=!1,this._ending=!1,this._stopped=!0,this._proxy=void 0,this.simulation=null,this.doMove=At((function(y){this.move(y)}),"The interaction.doMove() method has been renamed to interaction.move()"),this.coords={start:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},prev:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},cur:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},delta:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},velocity:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0}},this._id=cl++,this._scopeFire=l,this.pointerType=s;var f=this;this._proxy={};var p=function(y){Object.defineProperty(o._proxy,y,{get:function(){return f[y]}})};for(var h in al)p(h);var v=function(y){Object.defineProperty(o._proxy,y,{value:function(){return f[y].apply(f,arguments)}})};for(var S in Ci)v(S);this._scopeFire("interactions:new",{interaction:this})}return g(n,[{key:"pointerMoveTolerance",get:function(){return 1}},{key:"pointerDown",value:function(t,o,s){var l=this.updatePointer(t,o,s,!0),f=this.pointers[l];this._scopeFire("interactions:down",{pointer:t,event:o,eventTarget:s,pointerIndex:l,pointerInfo:f,type:"down",interaction:this})}},{key:"start",value:function(t,o,s){return!(this.interacting()||!this.pointerIsDown||this.pointers.length<(t.name==="gesture"?2:1)||!o.options[t.name].enabled)&&(xr(this.prepared,t),this.interactable=o,this.element=s,this.rect=o.getRect(s),this.edges=this.prepared.edges?ne({},this.prepared.edges):{left:!0,right:!0,top:!0,bottom:!0},this._stopped=!1,this._interacting=this._doPhase({interaction:this,event:this.downEvent,phase:"start"})&&!this._stopped,this._interacting)}},{key:"pointerMove",value:function(t,o,s){this.simulation||this.modification&&this.modification.endResult||this.updatePointer(t,o,s,!1);var l,f,p=this.coords.cur.page.x===this.coords.prev.page.x&&this.coords.cur.page.y===this.coords.prev.page.y&&this.coords.cur.client.x===this.coords.prev.client.x&&this.coords.cur.client.y===this.coords.prev.client.y;this.pointerIsDown&&!this.pointerWasMoved&&(l=this.coords.cur.client.x-this.coords.start.client.x,f=this.coords.cur.client.y-this.coords.start.client.y,this.pointerWasMoved=rt(l,f)>this.pointerMoveTolerance);var h,v,S,y=this.getPointerIndex(t),k={pointer:t,pointerIndex:y,pointerInfo:this.pointers[y],event:o,type:"move",eventTarget:s,dx:l,dy:f,duplicate:p,interaction:this};p||(h=this.coords.velocity,v=this.coords.delta,S=Math.max(v.timeStamp/1e3,.001),h.page.x=v.page.x/S,h.page.y=v.page.y/S,h.client.x=v.client.x/S,h.client.y=v.client.y/S,h.timeStamp=S),this._scopeFire("interactions:move",k),p||this.simulation||(this.interacting()&&(k.type=null,this.move(k)),this.pointerWasMoved&&Sn(this.coords.prev,this.coords.cur))}},{key:"move",value:function(t){t&&t.event||ri(this.coords.delta),(t=ne({pointer:this._latestPointer.pointer,event:this._latestPointer.event,eventTarget:this._latestPointer.eventTarget,interaction:this},t||{})).phase="move",this._doPhase(t)}},{key:"pointerUp",value:function(t,o,s,l){var f=this.getPointerIndex(t);f===-1&&(f=this.updatePointer(t,o,s,!1));var p=/cancel$/i.test(o.type)?"cancel":"up";this._scopeFire("interactions:".concat(p),{pointer:t,pointerIndex:f,pointerInfo:this.pointers[f],event:o,eventTarget:s,type:p,curEventTarget:l,interaction:this}),this.simulation||this.end(o),this.removePointer(t,o)}},{key:"documentBlur",value:function(t){this.end(t),this._scopeFire("interactions:blur",{event:t,type:"blur",interaction:this})}},{key:"end",value:function(t){var o;this._ending=!0,t=t||this._latestPointer.event,this.interacting()&&(o=this._doPhase({event:t,interaction:this,phase:"end"})),this._ending=!1,o===!0&&this.stop()}},{key:"currentAction",value:function(){return this._interacting?this.prepared.name:null}},{key:"interacting",value:function(){return this._interacting}},{key:"stop",value:function(){this._scopeFire("interactions:stop",{interaction:this}),this.interactable=this.element=null,this._interacting=!1,this._stopped=!0,this.prepared.name=this.prevEvent=null}},{key:"getPointerIndex",value:function(t){var o=It(t);return this.pointerType==="mouse"||this.pointerType==="pen"?this.pointers.length-1:jt(this.pointers,(function(s){return s.id===o}))}},{key:"getPointerInfo",value:function(t){return this.pointers[this.getPointerIndex(t)]}},{key:"updatePointer",value:function(t,o,s,l){var f,p,h,v=It(t),S=this.getPointerIndex(t),y=this.pointers[S];return l=l!==!1&&(l||/(down|start)$/i.test(o.type)),y?y.pointer=t:(y=new sl(v,t,o,null,null),S=this.pointers.length,this.pointers.push(y)),Dc(this.coords.cur,this.pointers.map((function(k){return k.pointer})),this._now()),f=this.coords.delta,p=this.coords.prev,h=this.coords.cur,f.page.x=h.page.x-p.page.x,f.page.y=h.page.y-p.page.y,f.client.x=h.client.x-p.client.x,f.client.y=h.client.y-p.client.y,f.timeStamp=h.timeStamp-p.timeStamp,l&&(this.pointerIsDown=!0,y.downTime=this.coords.cur.timeStamp,y.downTarget=s,Nn(this.downPointer,t),this.interacting()||(Sn(this.coords.start,this.coords.cur),Sn(this.coords.prev,this.coords.cur),this.downEvent=o,this.pointerWasMoved=!1)),this._updateLatestPointer(t,o,s),this._scopeFire("interactions:update-pointer",{pointer:t,event:o,eventTarget:s,down:l,pointerInfo:y,pointerIndex:S,interaction:this}),S}},{key:"removePointer",value:function(t,o){var s=this.getPointerIndex(t);if(s!==-1){var l=this.pointers[s];this._scopeFire("interactions:remove-pointer",{pointer:t,event:o,eventTarget:null,pointerIndex:s,pointerInfo:l,interaction:this}),this.pointers.splice(s,1),this.pointerIsDown=!1}}},{key:"_updateLatestPointer",value:function(t,o,s){this._latestPointer.pointer=t,this._latestPointer.event=o,this._latestPointer.eventTarget=s}},{key:"destroy",value:function(){this._latestPointer.pointer=null,this._latestPointer.event=null,this._latestPointer.eventTarget=null}},{key:"_createPreparedEvent",value:function(t,o,s,l){return new _r(this,t,this.prepared.name,o,this.element,s,l)}},{key:"_fireEvent",value:function(t){var o;(o=this.interactable)==null||o.fire(t),(!this.prevEvent||t.timeStamp>=this.prevEvent.timeStamp)&&(this.prevEvent=t)}},{key:"_doPhase",value:function(t){var o=t.event,s=t.phase,l=t.preEnd,f=t.type,p=this.rect;if(p&&s==="move"&&(lt(this.edges,p,this.coords.delta[this.interactable.options.deltaSource]),p.width=p.right-p.left,p.height=p.bottom-p.top),this._scopeFire("interactions:before-action-".concat(s),t)===!1)return!1;var h=t.iEvent=this._createPreparedEvent(o,s,l,f);return this._scopeFire("interactions:action-".concat(s),t),s==="start"&&(this.prevEvent=h),this._fireEvent(h),this._scopeFire("interactions:after-action-".concat(s),t),!0}},{key:"_now",value:function(){return Date.now()}}]),n})();function ki(n){Oi(n.interaction)}function Oi(n){if(!(function(o){return!(!o.offset.pending.x&&!o.offset.pending.y)})(n))return!1;var t=n.offset.pending;return Cr(n.coords.cur,t),Cr(n.coords.delta,t),lt(n.edges,n.rect,t),t.x=0,t.y=0,!0}function ul(n){var t=n.x,o=n.y;this.offset.pending.x+=t,this.offset.pending.y+=o,this.offset.total.x+=t,this.offset.total.y+=o}function Cr(n,t){var o=n.page,s=n.client,l=t.x,f=t.y;o.x+=l,o.y+=f,s.x+=l,s.y+=f}Ci.offsetBy="";var fl={id:"offset",before:["modifiers","pointer-events","actions","inertia"],install:function(n){n.Interaction.prototype.offsetBy=ul},listeners:{"interactions:new":function(n){n.interaction.offset={total:{x:0,y:0},pending:{x:0,y:0}}},"interactions:update-pointer":function(n){return(function(t){t.pointerIsDown&&(Cr(t.coords.cur,t.offset.total),t.offset.pending.x=0,t.offset.pending.y=0)})(n.interaction)},"interactions:before-action-start":ki,"interactions:before-action-move":ki,"interactions:before-action-end":function(n){var t=n.interaction;if(Oi(t))return t.move({offset:!0}),t.end(),!1},"interactions:stop":function(n){var t=n.interaction;t.offset.total.x=0,t.offset.total.y=0,t.offset.pending.x=0,t.offset.pending.y=0}}},Pi=fl,dl=(function(){function n(t){u(this,n),this.active=!1,this.isModified=!1,this.smoothEnd=!1,this.allowResume=!1,this.modification=void 0,this.modifierCount=0,this.modifierArg=void 0,this.startCoords=void 0,this.t0=0,this.v0=0,this.te=0,this.targetOffset=void 0,this.modifiedOffset=void 0,this.currentOffset=void 0,this.lambda_v0=0,this.one_ve_v0=0,this.timeout=void 0,this.interaction=void 0,this.interaction=t}return g(n,[{key:"start",value:function(t){var o=this.interaction,s=Pn(o);if(!s||!s.enabled)return!1;var l=o.coords.velocity.client,f=rt(l.x,l.y),p=this.modification||(this.modification=new Tr(o));if(p.copyFrom(o.modification),this.t0=o._now(),this.allowResume=s.allowResume,this.v0=f,this.currentOffset={x:0,y:0},this.startCoords=o.coords.cur.page,this.modifierArg=p.fillArg({pageCoords:this.startCoords,preEnd:!0,phase:"inertiastart"}),this.t0-o.coords.cur.timeStamp<50&&f>s.minSpeed&&f>s.endSpeed)this.startInertia();else{if(p.result=p.setAll(this.modifierArg),!p.result.changed)return!1;this.startSmoothEnd()}return o.modification.result.rect=null,o.offsetBy(this.targetOffset),o._doPhase({interaction:o,event:t,phase:"inertiastart"}),o.offsetBy({x:-this.targetOffset.x,y:-this.targetOffset.y}),o.modification.result.rect=null,this.active=!0,o.simulation=this,!0}},{key:"startInertia",value:function(){var t=this,o=this.interaction.coords.velocity.client,s=Pn(this.interaction),l=s.resistance,f=-Math.log(s.endSpeed/this.v0)/l;this.targetOffset={x:(o.x-f)/l,y:(o.y-f)/l},this.te=f,this.lambda_v0=l/this.v0,this.one_ve_v0=1-s.endSpeed/this.v0;var p=this.modification,h=this.modifierArg;h.pageCoords={x:this.startCoords.x+this.targetOffset.x,y:this.startCoords.y+this.targetOffset.y},p.result=p.setAll(h),p.result.changed&&(this.isModified=!0,this.modifiedOffset={x:this.targetOffset.x+p.result.delta.x,y:this.targetOffset.y+p.result.delta.y}),this.onNextFrame((function(){return t.inertiaTick()}))}},{key:"startSmoothEnd",value:function(){var t=this;this.smoothEnd=!0,this.isModified=!0,this.targetOffset={x:this.modification.result.delta.x,y:this.modification.result.delta.y},this.onNextFrame((function(){return t.smoothEndTick()}))}},{key:"onNextFrame",value:function(t){var o=this;this.timeout=We.request((function(){o.active&&t()}))}},{key:"inertiaTick",value:function(){var t,o,s,l,f,p,h,v=this,S=this.interaction,y=Pn(S).resistance,k=(S._now()-this.t0)/1e3;if(k<this.te){var A,H=1-(Math.exp(-y*k)-this.lambda_v0)/this.one_ve_v0;this.isModified?(t=0,o=0,s=this.targetOffset.x,l=this.targetOffset.y,f=this.modifiedOffset.x,p=this.modifiedOffset.y,A={x:Ii(h=H,t,s,f),y:Ii(h,o,l,p)}):A={x:this.targetOffset.x*H,y:this.targetOffset.y*H};var V={x:A.x-this.currentOffset.x,y:A.y-this.currentOffset.y};this.currentOffset.x+=V.x,this.currentOffset.y+=V.y,S.offsetBy(V),S.move(),this.onNextFrame((function(){return v.inertiaTick()}))}else S.offsetBy({x:this.modifiedOffset.x-this.currentOffset.x,y:this.modifiedOffset.y-this.currentOffset.y}),this.end()}},{key:"smoothEndTick",value:function(){var t=this,o=this.interaction,s=o._now()-this.t0,l=Pn(o).smoothEndDuration;if(s<l){var f={x:ji(s,0,this.targetOffset.x,l),y:ji(s,0,this.targetOffset.y,l)},p={x:f.x-this.currentOffset.x,y:f.y-this.currentOffset.y};this.currentOffset.x+=p.x,this.currentOffset.y+=p.y,o.offsetBy(p),o.move({skipModifiers:this.modifierCount}),this.onNextFrame((function(){return t.smoothEndTick()}))}else o.offsetBy({x:this.targetOffset.x-this.currentOffset.x,y:this.targetOffset.y-this.currentOffset.y}),this.end()}},{key:"resume",value:function(t){var o=t.pointer,s=t.event,l=t.eventTarget,f=this.interaction;f.offsetBy({x:-this.currentOffset.x,y:-this.currentOffset.y}),f.updatePointer(o,s,l,!0),f._doPhase({interaction:f,event:s,phase:"resume"}),Sn(f.coords.prev,f.coords.cur),this.stop()}},{key:"end",value:function(){this.interaction.move(),this.interaction.end(),this.stop()}},{key:"stop",value:function(){this.active=this.smoothEnd=!1,this.interaction.simulation=null,We.cancel(this.timeout)}}]),n})();function Pn(n){var t=n.interactable,o=n.prepared;return t&&t.options&&o.name&&t.options[o.name].inertia}var pl={id:"inertia",before:["modifiers","actions"],install:function(n){var t=n.defaults;n.usePlugin(Pi),n.usePlugin(Ti),n.actions.phases.inertiastart=!0,n.actions.phases.resume=!0,t.perAction.inertia={enabled:!1,resistance:10,minSpeed:100,endSpeed:10,allowResume:!0,smoothEndDuration:300}},listeners:{"interactions:new":function(n){var t=n.interaction;t.inertia=new dl(t)},"interactions:before-action-end":function(n){var t=n.interaction,o=n.event;return(!t._interacting||t.simulation||!t.inertia.start(o))&&null},"interactions:down":function(n){var t=n.interaction,o=n.eventTarget,s=t.inertia;if(s.active)for(var l=o;E.element(l);){if(l===t.element){s.resume(n);break}l=Y(l)}},"interactions:stop":function(n){var t=n.interaction.inertia;t.active&&t.stop()},"interactions:before-action-resume":function(n){var t=n.interaction.modification;t.stop(n),t.start(n,n.interaction.coords.cur.page),t.applyToInteraction(n)},"interactions:before-action-inertiastart":function(n){return n.interaction.modification.setAndApply(n)},"interactions:action-resume":Mt,"interactions:action-inertiastart":Mt,"interactions:after-action-inertiastart":function(n){return n.interaction.modification.restoreInteractionCoords(n)},"interactions:after-action-resume":function(n){return n.interaction.modification.restoreInteractionCoords(n)}}};function Ii(n,t,o,s){var l=1-n;return l*l*t+2*l*n*o+n*n*s}function ji(n,t,o,s){return-o*(n/=s)*(n-2)+t}var hl=pl;function Ri(n,t){for(var o=0;o<t.length;o++){var s=t[o];if(n.immediatePropagationStopped)break;s(n)}}var Ai=(function(){function n(t){u(this,n),this.options=void 0,this.types={},this.propagationStopped=!1,this.immediatePropagationStopped=!1,this.global=void 0,this.options=ne({},t||{})}return g(n,[{key:"fire",value:function(t){var o,s=this.global;(o=this.types[t.type])&&Ri(t,o),!t.propagationStopped&&s&&(o=s[t.type])&&Ri(t,o)}},{key:"on",value:function(t,o){var s=Oe(t,o);for(t in s)this.types[t]=li(this.types[t]||[],s[t])}},{key:"off",value:function(t,o){var s=Oe(t,o);for(t in s){var l=this.types[t];if(l&&l.length)for(var f=0,p=s[t];f<p.length;f++){var h=p[f],v=l.indexOf(h);v!==-1&&l.splice(v,1)}}}},{key:"getRect",value:function(t){return null}}]),n})(),gl=(function(){function n(t){u(this,n),this.currentTarget=void 0,this.originalEvent=void 0,this.type=void 0,this.originalEvent=t,Nn(this,t)}return g(n,[{key:"preventOriginalDefault",value:function(){this.originalEvent.preventDefault()}},{key:"stopPropagation",value:function(){this.originalEvent.stopPropagation()}},{key:"stopImmediatePropagation",value:function(){this.originalEvent.stopImmediatePropagation()}}]),n})();function Lt(n){return E.object(n)?{capture:!!n.capture,passive:!!n.passive}:{capture:!!n,passive:!1}}function In(n,t){return n===t||(typeof n=="boolean"?!!t.capture===n&&!t.passive:!!n.capture==!!t.capture&&!!n.passive==!!t.passive)}var ml={id:"events",install:function(n){var t,o=[],s={},l=[],f={add:p,remove:h,addDelegate:function(y,k,A,H,V){var G=Lt(V);if(!s[A]){s[A]=[];for(var se=0;se<l.length;se++){var re=l[se];p(re,A,v),p(re,A,S,!0)}}var fe=s[A],ye=Rt(fe,(function(we){return we.selector===y&&we.context===k}));ye||(ye={selector:y,context:k,listeners:[]},fe.push(ye)),ye.listeners.push({func:H,options:G})},removeDelegate:function(y,k,A,H,V){var G,se=Lt(V),re=s[A],fe=!1;if(re)for(G=re.length-1;G>=0;G--){var ye=re[G];if(ye.selector===y&&ye.context===k){for(var we=ye.listeners,he=we.length-1;he>=0;he--){var be=we[he];if(be.func===H&&In(be.options,se)){we.splice(he,1),we.length||(re.splice(G,1),h(k,A,v),h(k,A,S,!0)),fe=!0;break}}if(fe)break}}},delegateListener:v,delegateUseCapture:S,delegatedEvents:s,documents:l,targets:o,supportsOptions:!1,supportsPassive:!1};function p(y,k,A,H){if(y.addEventListener){var V=Lt(H),G=Rt(o,(function(se){return se.eventTarget===y}));G||(G={eventTarget:y,events:{}},o.push(G)),G.events[k]||(G.events[k]=[]),Rt(G.events[k],(function(se){return se.func===A&&In(se.options,V)}))||(y.addEventListener(k,A,f.supportsOptions?V:V.capture),G.events[k].push({func:A,options:V}))}}function h(y,k,A,H){if(y.addEventListener&&y.removeEventListener){var V=jt(o,(function(Ae){return Ae.eventTarget===y})),G=o[V];if(G&&G.events)if(k!=="all"){var se=!1,re=G.events[k];if(re){if(A==="all"){for(var fe=re.length-1;fe>=0;fe--){var ye=re[fe];h(y,k,ye.func,ye.options)}return}for(var we=Lt(H),he=0;he<re.length;he++){var be=re[he];if(be.func===A&&In(be.options,we)){y.removeEventListener(k,A,f.supportsOptions?we:we.capture),re.splice(he,1),re.length===0&&(delete G.events[k],se=!0);break}}}se&&!Object.keys(G.events).length&&o.splice(V,1)}else for(k in G.events)G.events.hasOwnProperty(k)&&h(y,k,"all")}}function v(y,k){for(var A=Lt(k),H=new gl(y),V=s[y.type],G=ci(y)[0],se=G;E.element(se);){for(var re=0;re<V.length;re++){var fe=V[re],ye=fe.selector,we=fe.context;if(z(se,ye)&&ae(we,G)&&ae(we,se)){var he=fe.listeners;H.currentTarget=se;for(var be=0;be<he.length;be++){var Ae=he[be];In(Ae.options,A)&&Ae.func(H)}}}se=Y(se)}}function S(y){return v(y,!0)}return(t=n.document)==null||t.createElement("div").addEventListener("test",null,{get capture(){return f.supportsOptions=!0},get passive(){return f.supportsPassive=!0}}),n.events=f,f}},kr={methodOrder:["simulationResume","mouseOrPen","hasPointer","idle"],search:function(n){for(var t=0,o=kr.methodOrder;t<o.length;t++){var s=o[t],l=kr[s](n);if(l)return l}return null},simulationResume:function(n){var t=n.pointerType,o=n.eventType,s=n.eventTarget,l=n.scope;if(!/down|start/i.test(o))return null;for(var f=0,p=l.interactions.list;f<p.length;f++){var h=p[f],v=s;if(h.simulation&&h.simulation.allowResume&&h.pointerType===t)for(;v;){if(v===h.element)return h;v=Y(v)}}return null},mouseOrPen:function(n){var t,o=n.pointerId,s=n.pointerType,l=n.eventType,f=n.scope;if(s!=="mouse"&&s!=="pen")return null;for(var p=0,h=f.interactions.list;p<h.length;p++){var v=h[p];if(v.pointerType===s){if(v.simulation&&!Mi(v,o))continue;if(v.interacting())return v;t||(t=v)}}if(t)return t;for(var S=0,y=f.interactions.list;S<y.length;S++){var k=y[S];if(!(k.pointerType!==s||/down/i.test(l)&&k.simulation))return k}return null},hasPointer:function(n){for(var t=n.pointerId,o=0,s=n.scope.interactions.list;o<s.length;o++){var l=s[o];if(Mi(l,t))return l}return null},idle:function(n){for(var t=n.pointerType,o=0,s=n.scope.interactions.list;o<s.length;o++){var l=s[o];if(l.pointers.length===1){var f=l.interactable;if(f&&(!f.options.gesture||!f.options.gesture.enabled))continue}else if(l.pointers.length>=2)continue;if(!l.interacting()&&t===l.pointerType)return l}return null}};function Mi(n,t){return n.pointers.some((function(o){return o.id===t}))}var vl=kr,Or=["pointerDown","pointerMove","pointerUp","updatePointer","removePointer","windowBlur"];function Li(n,t){return function(o){var s=t.interactions.list,l=ai(o),f=ci(o),p=f[0],h=f[1],v=[];if(/^touch/.test(o.type)){t.prevTouchTime=t.now();for(var S=0,y=o.changedTouches;S<y.length;S++){var k=y[S],A={pointer:k,pointerId:It(k),pointerType:l,eventType:o.type,eventTarget:p,curEventTarget:h,scope:t},H=zi(A);v.push([A.pointer,A.eventTarget,A.curEventTarget,H])}}else{var V=!1;if(!oe.supportsPointerEvent&&/mouse/.test(o.type)){for(var G=0;G<s.length&&!V;G++)V=s[G].pointerType!=="mouse"&&s[G].pointerIsDown;V=V||t.now()-t.prevTouchTime<500||o.timeStamp===0}if(!V){var se={pointer:o,pointerId:It(o),pointerType:l,eventType:o.type,curEventTarget:h,eventTarget:p,scope:t},re=zi(se);v.push([se.pointer,se.eventTarget,se.curEventTarget,re])}}for(var fe=0;fe<v.length;fe++){var ye=v[fe],we=ye[0],he=ye[1],be=ye[2];ye[3][n](we,o,he,be)}}}function zi(n){var t=n.pointerType,o=n.scope,s={interaction:vl.search(n),searchDetails:n};return o.fire("interactions:find",s),s.interaction||o.interactions.new({pointerType:t})}function Pr(n,t){var o=n.doc,s=n.scope,l=n.options,f=s.interactions.docEvents,p=s.events,h=p[t];for(var v in s.browser.isIOS&&!l.events&&(l.events={passive:!1}),p.delegatedEvents)h(o,v,p.delegateListener),h(o,v,p.delegateUseCapture,!0);for(var S=l&&l.events,y=0;y<f.length;y++){var k=f[y];h(o,k.type,k.listener,S)}}var yl={id:"core/interactions",install:function(n){for(var t={},o=0;o<Or.length;o++){var s=Or[o];t[s]=Li(s,n)}var l,f=oe.pEventTypes;function p(){for(var h=0,v=n.interactions.list;h<v.length;h++){var S=v[h];if(S.pointerIsDown&&S.pointerType==="touch"&&!S._interacting)for(var y=function(){var H=A[k];n.documents.some((function(V){return ae(V.doc,H.downTarget)}))||S.removePointer(H.pointer,H.event)},k=0,A=S.pointers;k<A.length;k++)y()}}(l=F.PointerEvent?[{type:f.down,listener:p},{type:f.down,listener:t.pointerDown},{type:f.move,listener:t.pointerMove},{type:f.up,listener:t.pointerUp},{type:f.cancel,listener:t.pointerUp}]:[{type:"mousedown",listener:t.pointerDown},{type:"mousemove",listener:t.pointerMove},{type:"mouseup",listener:t.pointerUp},{type:"touchstart",listener:p},{type:"touchstart",listener:t.pointerDown},{type:"touchmove",listener:t.pointerMove},{type:"touchend",listener:t.pointerUp},{type:"touchcancel",listener:t.pointerUp}]).push({type:"blur",listener:function(h){for(var v=0,S=n.interactions.list;v<S.length;v++)S[v].documentBlur(h)}}),n.prevTouchTime=0,n.Interaction=(function(h){b(S,h);var v=R(S);function S(){return u(this,S),v.apply(this,arguments)}return g(S,[{key:"pointerMoveTolerance",get:function(){return n.interactions.pointerMoveTolerance},set:function(y){n.interactions.pointerMoveTolerance=y}},{key:"_now",value:function(){return n.now()}}]),S})(ll),n.interactions={list:[],new:function(h){h.scopeFire=function(S,y){return n.fire(S,y)};var v=new n.Interaction(h);return n.interactions.list.push(v),v},listeners:t,docEvents:l,pointerMoveTolerance:1},n.usePlugin(Si)},listeners:{"scope:add-document":function(n){return Pr(n,"add")},"scope:remove-document":function(n){return Pr(n,"remove")},"interactable:unset":function(n,t){for(var o=n.interactable,s=t.interactions.list.length-1;s>=0;s--){var l=t.interactions.list[s];l.interactable===o&&(l.stop(),t.fire("interactions:destroy",{interaction:l}),l.destroy(),t.interactions.list.length>2&&t.interactions.list.splice(s,1))}}},onDocSignal:Pr,doOnInteractions:Li,methodNames:Or},bl=yl,Ze=(function(n){return n[n.On=0]="On",n[n.Off=1]="Off",n})(Ze||{}),wl=(function(){function n(t,o,s,l){u(this,n),this.target=void 0,this.options=void 0,this._actions=void 0,this.events=new Ai,this._context=void 0,this._win=void 0,this._doc=void 0,this._scopeEvents=void 0,this._actions=o.actions,this.target=t,this._context=o.context||s,this._win=K(Ne(t)?this._context:t),this._doc=this._win.document,this._scopeEvents=l,this.set(o)}return g(n,[{key:"_defaults",get:function(){return{base:{},perAction:{},actions:{}}}},{key:"setOnEvents",value:function(t,o){return E.func(o.onstart)&&this.on("".concat(t,"start"),o.onstart),E.func(o.onmove)&&this.on("".concat(t,"move"),o.onmove),E.func(o.onend)&&this.on("".concat(t,"end"),o.onend),E.func(o.oninertiastart)&&this.on("".concat(t,"inertiastart"),o.oninertiastart),this}},{key:"updatePerActionListeners",value:function(t,o,s){var l,f=this,p=(l=this._actions.map[t])==null?void 0:l.filterEventType,h=function(v){return(p==null||p(v))&&kn(v,f._actions)};(E.array(o)||E.object(o))&&this._onOff(Ze.Off,t,o,void 0,h),(E.array(s)||E.object(s))&&this._onOff(Ze.On,t,s,void 0,h)}},{key:"setPerAction",value:function(t,o){var s=this._defaults;for(var l in o){var f=l,p=this.options[t],h=o[f];f==="listeners"&&this.updatePerActionListeners(t,p.listeners,h),E.array(h)?p[f]=ui(h):E.plainObject(h)?(p[f]=ne(p[f]||{},dt(h)),E.object(s.perAction[f])&&"enabled"in s.perAction[f]&&(p[f].enabled=h.enabled!==!1)):E.bool(h)&&E.object(s.perAction[f])?p[f].enabled=h:p[f]=h}}},{key:"getRect",value:function(t){return t=t||(E.element(this.target)?this.target:null),E.string(this.target)&&(t=t||this._context.querySelector(this.target)),ve(t)}},{key:"rectChecker",value:function(t){var o=this;return E.func(t)?(this.getRect=function(s){var l=ne({},t.apply(o,s));return"width"in l||(l.width=l.right-l.left,l.height=l.bottom-l.top),l},this):t===null?(delete this.getRect,this):this.getRect}},{key:"_backCompatOption",value:function(t,o){if(Ne(o)||E.object(o)){for(var s in this.options[t]=o,this._actions.map)this.options[s][t]=o;return this}return this.options[t]}},{key:"origin",value:function(t){return this._backCompatOption("origin",t)}},{key:"deltaSource",value:function(t){return t==="page"||t==="client"?(this.options.deltaSource=t,this):this.options.deltaSource}},{key:"getAllElements",value:function(){var t=this.target;return E.string(t)?Array.from(this._context.querySelectorAll(t)):E.func(t)&&t.getAllElements?t.getAllElements():E.element(t)?[t]:[]}},{key:"context",value:function(){return this._context}},{key:"inContext",value:function(t){return this._context===t.ownerDocument||ae(this._context,t)}},{key:"testIgnoreAllow",value:function(t,o,s){return!this.testIgnore(t.ignoreFrom,o,s)&&this.testAllow(t.allowFrom,o,s)}},{key:"testAllow",value:function(t,o,s){return!t||!!E.element(s)&&(E.string(t)?ee(s,t,o):!!E.element(t)&&ae(t,s))}},{key:"testIgnore",value:function(t,o,s){return!(!t||!E.element(s))&&(E.string(t)?ee(s,t,o):!!E.element(t)&&ae(t,s))}},{key:"fire",value:function(t){return this.events.fire(t),this}},{key:"_onOff",value:function(t,o,s,l,f){E.object(o)&&!E.array(o)&&(l=s,s=null);var p=Oe(o,s,f);for(var h in p){h==="wheel"&&(h=oe.wheelEvent);for(var v=0,S=p[h];v<S.length;v++){var y=S[v];kn(h,this._actions)?this.events[t===Ze.On?"on":"off"](h,y):E.string(this.target)?this._scopeEvents[t===Ze.On?"addDelegate":"removeDelegate"](this.target,this._context,h,y,l):this._scopeEvents[t===Ze.On?"add":"remove"](this.target,h,y,l)}}return this}},{key:"on",value:function(t,o,s){return this._onOff(Ze.On,t,o,s)}},{key:"off",value:function(t,o,s){return this._onOff(Ze.Off,t,o,s)}},{key:"set",value:function(t){var o=this._defaults;for(var s in E.object(t)||(t={}),this.options=dt(o.base),this._actions.methodDict){var l=s,f=this._actions.methodDict[l];this.options[l]={},this.setPerAction(l,ne(ne({},o.perAction),o.actions[l])),this[f](t[l])}for(var p in t)p!=="getRect"?E.func(this[p])&&this[p](t[p]):this.rectChecker(t.getRect);return this}},{key:"unset",value:function(){if(E.string(this.target))for(var t in this._scopeEvents.delegatedEvents)for(var o=this._scopeEvents.delegatedEvents[t],s=o.length-1;s>=0;s--){var l=o[s],f=l.selector,p=l.context,h=l.listeners;f===this.target&&p===this._context&&o.splice(s,1);for(var v=h.length-1;v>=0;v--)this._scopeEvents.removeDelegate(this.target,this._context,t,h[v][0],h[v][1])}else this._scopeEvents.remove(this.target,"all")}}]),n})(),xl=(function(){function n(t){var o=this;u(this,n),this.list=[],this.selectorMap={},this.scope=void 0,this.scope=t,t.addListeners({"interactable:unset":function(s){var l=s.interactable,f=l.target,p=E.string(f)?o.selectorMap[f]:f[o.scope.id],h=jt(p,(function(v){return v===l}));p.splice(h,1)}})}return g(n,[{key:"new",value:function(t,o){o=ne(o||{},{actions:this.scope.actions});var s=new this.scope.Interactable(t,o,this.scope.document,this.scope.events);return this.scope.addDocument(s._doc),this.list.push(s),E.string(t)?(this.selectorMap[t]||(this.selectorMap[t]=[]),this.selectorMap[t].push(s)):(s.target[this.scope.id]||Object.defineProperty(t,this.scope.id,{value:[],configurable:!0}),t[this.scope.id].push(s)),this.scope.fire("interactable:new",{target:t,options:o,interactable:s,win:this.scope._win}),s}},{key:"getExisting",value:function(t,o){var s=o&&o.context||this.scope.document,l=E.string(t),f=l?this.selectorMap[t]:t[this.scope.id];if(f)return Rt(f,(function(p){return p._context===s&&(l||p.inContext(t))}))}},{key:"forEachMatch",value:function(t,o){for(var s=0,l=this.list;s<l.length;s++){var f=l[s],p=void 0;if((E.string(f.target)?E.element(t)&&z(t,f.target):t===f.target)&&f.inContext(t)&&(p=o(f)),p!==void 0)return p}}}]),n})(),El=(function(){function n(){var t=this;u(this,n),this.id="__interact_scope_".concat(Math.floor(100*Math.random())),this.isInitialized=!1,this.listenerMaps=[],this.browser=oe,this.defaults=dt(_i),this.Eventable=Ai,this.actions={map:{},phases:{start:!0,move:!0,end:!0},methodDict:{},phaselessTypes:{}},this.interactStatic=(function(s){var l=function f(p,h){var v=s.interactables.getExisting(p,h);return v||((v=s.interactables.new(p,h)).events.global=f.globalEvents),v};return l.getPointerAverage=si,l.getTouchBBox=pr,l.getTouchDistance=hr,l.getTouchAngle=gr,l.getElementRect=ve,l.getElementClientRect=pe,l.matchesSelector=z,l.closest=ue,l.globalEvents={},l.version="1.10.27",l.scope=s,l.use=function(f,p){return this.scope.usePlugin(f,p),this},l.isSet=function(f,p){return!!this.scope.interactables.get(f,p&&p.context)},l.on=At((function(f,p,h){if(E.string(f)&&f.search(" ")!==-1&&(f=f.trim().split(/ +/)),E.array(f)){for(var v=0,S=f;v<S.length;v++){var y=S[v];this.on(y,p,h)}return this}if(E.object(f)){for(var k in f)this.on(k,f[k],p);return this}return kn(f,this.scope.actions)?this.globalEvents[f]?this.globalEvents[f].push(p):this.globalEvents[f]=[p]:this.scope.events.add(this.scope.document,f,p,{options:h}),this}),"The interact.on() method is being deprecated"),l.off=At((function(f,p,h){if(E.string(f)&&f.search(" ")!==-1&&(f=f.trim().split(/ +/)),E.array(f)){for(var v=0,S=f;v<S.length;v++){var y=S[v];this.off(y,p,h)}return this}if(E.object(f)){for(var k in f)this.off(k,f[k],p);return this}var A;return kn(f,this.scope.actions)?f in this.globalEvents&&(A=this.globalEvents[f].indexOf(p))!==-1&&this.globalEvents[f].splice(A,1):this.scope.events.remove(this.scope.document,f,p,h),this}),"The interact.off() method is being deprecated"),l.debug=function(){return this.scope},l.supportsTouch=function(){return oe.supportsTouch},l.supportsPointerEvent=function(){return oe.supportsPointerEvent},l.stop=function(){for(var f=0,p=this.scope.interactions.list;f<p.length;f++)p[f].stop();return this},l.pointerMoveTolerance=function(f){return E.number(f)?(this.scope.interactions.pointerMoveTolerance=f,this):this.scope.interactions.pointerMoveTolerance},l.addDocument=function(f,p){this.scope.addDocument(f,p)},l.removeDocument=function(f){this.scope.removeDocument(f)},l})(this),this.InteractEvent=_r,this.Interactable=void 0,this.interactables=new xl(this),this._win=void 0,this.document=void 0,this.window=void 0,this.documents=[],this._plugins={list:[],map:{}},this.onWindowUnload=function(s){return t.removeDocument(s.target)};var o=this;this.Interactable=(function(s){b(f,s);var l=R(f);function f(){return u(this,f),l.apply(this,arguments)}return g(f,[{key:"_defaults",get:function(){return o.defaults}},{key:"set",value:function(p){return M(C(f.prototype),"set",this).call(this,p),o.fire("interactable:set",{options:p,interactable:this}),this}},{key:"unset",value:function(){M(C(f.prototype),"unset",this).call(this);var p=o.interactables.list.indexOf(this);p<0||(o.interactables.list.splice(p,1),o.fire("interactable:unset",{interactable:this}))}}]),f})(wl)}return g(n,[{key:"addListeners",value:function(t,o){this.listenerMaps.push({id:o,map:t})}},{key:"fire",value:function(t,o){for(var s=0,l=this.listenerMaps;s<l.length;s++){var f=l[s].map[t];if(f&&f(o,this,t)===!1)return!1}}},{key:"init",value:function(t){return this.isInitialized?this:(function(o,s){return o.isInitialized=!0,E.window(s)&&W(s),F.init(s),oe.init(s),We.init(s),o.window=s,o.document=s.document,o.usePlugin(bl),o.usePlugin(ml),o})(this,t)}},{key:"pluginIsInstalled",value:function(t){var o=t.id;return o?!!this._plugins.map[o]:this._plugins.list.indexOf(t)!==-1}},{key:"usePlugin",value:function(t,o){if(!this.isInitialized)return this;if(this.pluginIsInstalled(t))return this;if(t.id&&(this._plugins.map[t.id]=t),this._plugins.list.push(t),t.install&&t.install(this,o),t.listeners&&t.before){for(var s=0,l=this.listenerMaps.length,f=t.before.reduce((function(h,v){return h[v]=!0,h[Fi(v)]=!0,h}),{});s<l;s++){var p=this.listenerMaps[s].id;if(p&&(f[p]||f[Fi(p)]))break}this.listenerMaps.splice(s,0,{id:t.id,map:t.listeners})}else t.listeners&&this.listenerMaps.push({id:t.id,map:t.listeners});return this}},{key:"addDocument",value:function(t,o){if(this.getDocIndex(t)!==-1)return!1;var s=K(t);o=o?ne({},o):{},this.documents.push({doc:t,options:o}),this.events.documents.push(t),t!==this.document&&this.events.add(s,"unload",this.onWindowUnload),this.fire("scope:add-document",{doc:t,window:s,scope:this,options:o})}},{key:"removeDocument",value:function(t){var o=this.getDocIndex(t),s=K(t),l=this.documents[o].options;this.events.remove(s,"unload",this.onWindowUnload),this.documents.splice(o,1),this.events.documents.splice(o,1),this.fire("scope:remove-document",{doc:t,window:s,scope:this,options:l})}},{key:"getDocIndex",value:function(t){for(var o=0;o<this.documents.length;o++)if(this.documents[o].doc===t)return o;return-1}},{key:"getDocOptions",value:function(t){var o=this.getDocIndex(t);return o===-1?null:this.documents[o].options}},{key:"now",value:function(){return(this.window.Date||Date).now()}}]),n})();function Fi(n){return n&&n.replace(/\/.*$/,"")}var Vi=new El,Re=Vi.interactStatic,Nl=typeof globalThis<"u"?globalThis:window;Vi.init(Nl);var Sl=Object.freeze({__proto__:null,edgeTarget:function(){},elements:function(){},grid:function(n){var t=[["x","y"],["left","top"],["right","bottom"],["width","height"]].filter((function(s){var l=s[0],f=s[1];return l in n||f in n})),o=function(s,l){for(var f=n.range,p=n.limits,h=p===void 0?{left:-1/0,right:1/0,top:-1/0,bottom:1/0}:p,v=n.offset,S=v===void 0?{x:0,y:0}:v,y={range:f,grid:n,x:null,y:null},k=0;k<t.length;k++){var A=t[k],H=A[0],V=A[1],G=Math.round((s-S.x)/n[H]),se=Math.round((l-S.y)/n[V]);y[H]=Math.max(h.left,Math.min(h.right,G*n[H]+S.x)),y[V]=Math.max(h.top,Math.min(h.bottom,se*n[V]+S.y))}return y};return o.grid=n,o.coordFields=t,o}}),Tl={id:"snappers",install:function(n){var t=n.interactStatic;t.snappers=ne(t.snappers||{},Sl),t.createSnapGrid=t.snappers.grid}},_l=Tl,Cl={start:function(n){var t=n.state,o=n.rect,s=n.edges,l=n.pageCoords,f=t.options,p=f.ratio,h=f.enabled,v=t.options,S=v.equalDelta,y=v.modifiers;p==="preserve"&&(p=o.width/o.height),t.startCoords=ne({},l),t.startRect=ne({},o),t.ratio=p,t.equalDelta=S;var k=t.linkedEdges={top:s.top||s.left&&!s.bottom,left:s.left||s.top&&!s.right,bottom:s.bottom||s.right&&!s.top,right:s.right||s.bottom&&!s.left};if(t.xIsPrimaryAxis=!(!s.left&&!s.right),t.equalDelta){var A=(k.left?1:-1)*(k.top?1:-1);t.edgeSign={x:A,y:A}}else t.edgeSign={x:k.left?-1:1,y:k.top?-1:1};if(h!==!1&&ne(s,k),y!=null&&y.length){var H=new Tr(n.interaction);H.copyFrom(n.interaction.modification),H.prepareStates(y),t.subModification=H,H.startAll(a({},n))}},set:function(n){var t=n.state,o=n.rect,s=n.coords,l=t.linkedEdges,f=ne({},s),p=t.equalDelta?kl:Ol;if(ne(n.edges,l),p(t,t.xIsPrimaryAxis,s,o),!t.subModification)return null;var h=ne({},o);lt(l,h,{x:s.x-f.x,y:s.y-f.y});var v=t.subModification.setAll(a(a({},n),{},{rect:h,edges:l,pageCoords:s,prevCoords:s,prevRect:h})),S=v.delta;return v.changed&&(p(t,Math.abs(S.x)>Math.abs(S.y),v.coords,v.rect),ne(s,v.coords)),v.eventProps},defaults:{ratio:"preserve",equalDelta:!1,modifiers:[],enabled:!1}};function kl(n,t,o){var s=n.startCoords,l=n.edgeSign;t?o.y=s.y+(o.x-s.x)*l.y:o.x=s.x+(o.y-s.y)*l.x}function Ol(n,t,o,s){var l=n.startRect,f=n.startCoords,p=n.ratio,h=n.edgeSign;if(t){var v=s.width/p;o.y=f.y+(v-l.height)*h.y}else{var S=s.height*p;o.x=f.x+(S-l.width)*h.x}}var Pl=Je(Cl,"aspectRatio"),Di=function(){};Di._defaults={};var jn=Di;function it(n,t,o){return E.func(n)?Ie(n,t.interactable,t.element,[o.x,o.y,t]):Ie(n,t.interactable,t.element)}var Rn={start:function(n){var t=n.rect,o=n.startOffset,s=n.state,l=n.interaction,f=n.pageCoords,p=s.options,h=p.elementRect,v=ne({left:0,top:0,right:0,bottom:0},p.offset||{});if(t&&h){var S=it(p.restriction,l,f);if(S){var y=S.right-S.left-t.width,k=S.bottom-S.top-t.height;y<0&&(v.left+=y,v.right+=y),k<0&&(v.top+=k,v.bottom+=k)}v.left+=o.left-t.width*h.left,v.top+=o.top-t.height*h.top,v.right+=o.right-t.width*(1-h.right),v.bottom+=o.bottom-t.height*(1-h.bottom)}s.offset=v},set:function(n){var t=n.coords,o=n.interaction,s=n.state,l=s.options,f=s.offset,p=it(l.restriction,o,t);if(p){var h=(function(v){return!v||"left"in v&&"top"in v||((v=ne({},v)).left=v.x||0,v.top=v.y||0,v.right=v.right||v.left+v.width,v.bottom=v.bottom||v.top+v.height),v})(p);t.x=Math.max(Math.min(h.right-f.right,t.x),h.left+f.left),t.y=Math.max(Math.min(h.bottom-f.bottom,t.y),h.top+f.top)}},defaults:{restriction:null,elementRect:null,offset:null,endOnly:!1,enabled:!1}},Il=Je(Rn,"restrict"),Bi={top:1/0,left:1/0,bottom:-1/0,right:-1/0},Hi={top:-1/0,left:-1/0,bottom:1/0,right:1/0};function Yi(n,t){for(var o=0,s=["top","left","bottom","right"];o<s.length;o++){var l=s[o];l in n||(n[l]=t[l])}return n}var zt={noInner:Bi,noOuter:Hi,start:function(n){var t,o=n.interaction,s=n.startOffset,l=n.state,f=l.options;f&&(t=Ce(it(f.offset,o,o.coords.start.page))),t=t||{x:0,y:0},l.offset={top:t.y+s.top,left:t.x+s.left,bottom:t.y-s.bottom,right:t.x-s.right}},set:function(n){var t=n.coords,o=n.edges,s=n.interaction,l=n.state,f=l.offset,p=l.options;if(o){var h=ne({},t),v=it(p.inner,s,h)||{},S=it(p.outer,s,h)||{};Yi(v,Bi),Yi(S,Hi),o.top?t.y=Math.min(Math.max(S.top+f.top,h.y),v.top+f.top):o.bottom&&(t.y=Math.max(Math.min(S.bottom+f.bottom,h.y),v.bottom+f.bottom)),o.left?t.x=Math.min(Math.max(S.left+f.left,h.x),v.left+f.left):o.right&&(t.x=Math.max(Math.min(S.right+f.right,h.x),v.right+f.right))}},defaults:{inner:null,outer:null,offset:null,endOnly:!1,enabled:!1}},jl=Je(zt,"restrictEdges"),Rl=ne({get elementRect(){return{top:0,left:0,bottom:1,right:1}},set elementRect(n){}},Rn.defaults),Al=Je({start:Rn.start,set:Rn.set,defaults:Rl},"restrictRect"),Ml={width:-1/0,height:-1/0},Ll={width:1/0,height:1/0},zl=Je({start:function(n){return zt.start(n)},set:function(n){var t=n.interaction,o=n.state,s=n.rect,l=n.edges,f=o.options;if(l){var p=De(it(f.min,t,n.coords))||Ml,h=De(it(f.max,t,n.coords))||Ll;o.options={endOnly:f.endOnly,inner:ne({},zt.noInner),outer:ne({},zt.noOuter)},l.top?(o.options.inner.top=s.bottom-p.height,o.options.outer.top=s.bottom-h.height):l.bottom&&(o.options.inner.bottom=s.top+p.height,o.options.outer.bottom=s.top+h.height),l.left?(o.options.inner.left=s.right-p.width,o.options.outer.left=s.right-h.width):l.right&&(o.options.inner.right=s.left+p.width,o.options.outer.right=s.left+h.width),zt.set(n),o.options=f}},defaults:{min:null,max:null,endOnly:!1,enabled:!1}},"restrictSize"),Ir={start:function(n){var t,o=n.interaction,s=n.interactable,l=n.element,f=n.rect,p=n.state,h=n.startOffset,v=p.options,S=v.offsetWithOrigin?(function(A){var H=A.interaction.element,V=Ce(Ie(A.state.options.origin,null,null,[H])),G=V||nt(A.interactable,H,A.interaction.prepared.name);return G})(n):{x:0,y:0};if(v.offset==="startCoords")t={x:o.coords.start.page.x,y:o.coords.start.page.y};else{var y=Ie(v.offset,s,l,[o]);(t=Ce(y)||{x:0,y:0}).x+=S.x,t.y+=S.y}var k=v.relativePoints;p.offsets=f&&k&&k.length?k.map((function(A,H){return{index:H,relativePoint:A,x:h.left-f.width*A.x+t.x,y:h.top-f.height*A.y+t.y}})):[{index:0,relativePoint:null,x:t.x,y:t.y}]},set:function(n){var t=n.interaction,o=n.coords,s=n.state,l=s.options,f=s.offsets,p=nt(t.interactable,t.element,t.prepared.name),h=ne({},o),v=[];l.offsetWithOrigin||(h.x-=p.x,h.y-=p.y);for(var S=0,y=f;S<y.length;S++)for(var k=y[S],A=h.x-k.x,H=h.y-k.y,V=0,G=l.targets.length;V<G;V++){var se=l.targets[V],re=void 0;(re=E.func(se)?se(A,H,t._proxy,k,V):se)&&v.push({x:(E.number(re.x)?re.x:A)+k.x,y:(E.number(re.y)?re.y:H)+k.y,range:E.number(re.range)?re.range:l.range,source:se,index:V,offset:k})}for(var fe={target:null,inRange:!1,distance:0,range:0,delta:{x:0,y:0}},ye=0;ye<v.length;ye++){var we=v[ye],he=we.range,be=we.x-h.x,Ae=we.y-h.y,Te=rt(be,Ae),Le=Te<=he;he===1/0&&fe.inRange&&fe.range!==1/0&&(Le=!1),fe.target&&!(Le?fe.inRange&&he!==1/0?Te/he<fe.distance/fe.range:he===1/0&&fe.range!==1/0||Te<fe.distance:!fe.inRange&&Te<fe.distance)||(fe.target=we,fe.distance=Te,fe.range=he,fe.inRange=Le,fe.delta.x=be,fe.delta.y=Ae)}return fe.inRange&&(o.x=fe.target.x,o.y=fe.target.y),s.closest=fe,fe},defaults:{range:1/0,targets:null,offset:null,offsetWithOrigin:!0,origin:null,relativePoints:null,endOnly:!1,enabled:!1}},Fl=Je(Ir,"snap"),An={start:function(n){var t=n.state,o=n.edges,s=t.options;if(!o)return null;n.state={options:{targets:null,relativePoints:[{x:o.left?0:1,y:o.top?0:1}],offset:s.offset||"self",origin:{x:0,y:0},range:s.range}},t.targetFields=t.targetFields||[["width","height"],["x","y"]],Ir.start(n),t.offsets=n.state.offsets,n.state=t},set:function(n){var t=n.interaction,o=n.state,s=n.coords,l=o.options,f=o.offsets,p={x:s.x-f[0].x,y:s.y-f[0].y};o.options=ne({},l),o.options.targets=[];for(var h=0,v=l.targets||[];h<v.length;h++){var S=v[h],y=void 0;if(y=E.func(S)?S(p.x,p.y,t):S){for(var k=0,A=o.targetFields;k<A.length;k++){var H=A[k],V=H[0],G=H[1];if(V in y||G in y){y.x=y[V],y.y=y[G];break}}o.options.targets.push(y)}}var se=Ir.set(n);return o.options=l,se},defaults:{range:1/0,targets:null,offset:null,endOnly:!1,enabled:!1}},Vl=Je(An,"snapSize"),jr={aspectRatio:Pl,restrictEdges:jl,restrict:Il,restrictRect:Al,restrictSize:zl,snapEdges:Je({start:function(n){var t=n.edges;return t?(n.state.targetFields=n.state.targetFields||[[t.left?"left":"right",t.top?"top":"bottom"]],An.start(n)):null},set:An.set,defaults:ne(dt(An.defaults),{targets:void 0,range:void 0,offset:{x:0,y:0}})},"snapEdges"),snap:Fl,snapSize:Vl,spring:jn,avoid:jn,transform:jn,rubberband:jn},Dl={id:"modifiers",install:function(n){var t=n.interactStatic;for(var o in n.usePlugin(Ti),n.usePlugin(_l),t.modifiers=jr,jr){var s=jr[o],l=s._defaults,f=s._methods;l._methods=f,n.defaults.perAction[o]=l}}},Bl=Dl,Xi=(function(n){b(o,n);var t=R(o);function o(s,l,f,p,h,v){var S;if(u(this,o),Nn(P(S=t.call(this,h)),f),f!==l&&Nn(P(S),l),S.timeStamp=v,S.originalEvent=f,S.type=s,S.pointerId=It(l),S.pointerType=ai(l),S.target=p,S.currentTarget=null,s==="tap"){var y=h.getPointerIndex(l);S.dt=S.timeStamp-h.pointers[y].downTime;var k=S.timeStamp-h.tapTime;S.double=!!h.prevTap&&h.prevTap.type!=="doubletap"&&h.prevTap.target===S.target&&k<500}else s==="doubletap"&&(S.dt=l.timeStamp-h.tapTime,S.double=!0);return S}return g(o,[{key:"_subtractOrigin",value:function(s){var l=s.x,f=s.y;return this.pageX-=l,this.pageY-=f,this.clientX-=l,this.clientY-=f,this}},{key:"_addOrigin",value:function(s){var l=s.x,f=s.y;return this.pageX+=l,this.pageY+=f,this.clientX+=l,this.clientY+=f,this}},{key:"preventDefault",value:function(){this.originalEvent.preventDefault()}}]),o})(_n),Ft={id:"pointer-events/base",before:["inertia","modifiers","auto-start","actions"],install:function(n){n.pointerEvents=Ft,n.defaults.actions.pointerEvents=Ft.defaults,ne(n.actions.phaselessTypes,Ft.types)},listeners:{"interactions:new":function(n){var t=n.interaction;t.prevTap=null,t.tapTime=0},"interactions:update-pointer":function(n){var t=n.down,o=n.pointerInfo;!t&&o.hold||(o.hold={duration:1/0,timeout:null})},"interactions:move":function(n,t){var o=n.interaction,s=n.pointer,l=n.event,f=n.eventTarget;n.duplicate||o.pointerIsDown&&!o.pointerWasMoved||(o.pointerIsDown&&Rr(n),Qe({interaction:o,pointer:s,event:l,eventTarget:f,type:"move"},t))},"interactions:down":function(n,t){(function(o,s){for(var l=o.interaction,f=o.pointer,p=o.event,h=o.eventTarget,v=o.pointerIndex,S=l.pointers[v].hold,y=de(h),k={interaction:l,pointer:f,event:p,eventTarget:h,type:"hold",targets:[],path:y,node:null},A=0;A<y.length;A++){var H=y[A];k.node=H,s.fire("pointerEvents:collect-targets",k)}if(k.targets.length){for(var V=1/0,G=0,se=k.targets;G<se.length;G++){var re=se[G].eventable.options.holdDuration;re<V&&(V=re)}S.duration=V,S.timeout=setTimeout((function(){Qe({interaction:l,eventTarget:h,pointer:f,event:p,type:"hold"},s)}),V)}})(n,t),Qe(n,t)},"interactions:up":function(n,t){Rr(n),Qe(n,t),(function(o,s){var l=o.interaction,f=o.pointer,p=o.event,h=o.eventTarget;l.pointerWasMoved||Qe({interaction:l,eventTarget:h,pointer:f,event:p,type:"tap"},s)})(n,t)},"interactions:cancel":function(n,t){Rr(n),Qe(n,t)}},PointerEvent:Xi,fire:Qe,collectEventTargets:Ui,defaults:{holdDuration:600,ignoreFrom:null,allowFrom:null,origin:{x:0,y:0}},types:{down:!0,move:!0,up:!0,cancel:!0,tap:!0,doubletap:!0,hold:!0}};function Qe(n,t){var o=n.interaction,s=n.pointer,l=n.event,f=n.eventTarget,p=n.type,h=n.targets,v=h===void 0?Ui(n,t):h,S=new Xi(p,s,l,f,o,t.now());t.fire("pointerEvents:new",{pointerEvent:S});for(var y={interaction:o,pointer:s,event:l,eventTarget:f,targets:v,type:p,pointerEvent:S},k=0;k<v.length;k++){var A=v[k];for(var H in A.props||{})S[H]=A.props[H];var V=nt(A.eventable,A.node);if(S._subtractOrigin(V),S.eventable=A.eventable,S.currentTarget=A.node,A.eventable.fire(S),S._addOrigin(V),S.immediatePropagationStopped||S.propagationStopped&&k+1<v.length&&v[k+1].node!==S.currentTarget)break}if(t.fire("pointerEvents:fired",y),p==="tap"){var G=S.double?Qe({interaction:o,pointer:s,event:l,eventTarget:f,type:"doubletap"},t):S;o.prevTap=G,o.tapTime=G.timeStamp}return S}function Ui(n,t){var o=n.interaction,s=n.pointer,l=n.event,f=n.eventTarget,p=n.type,h=o.getPointerIndex(s),v=o.pointers[h];if(p==="tap"&&(o.pointerWasMoved||!v||v.downTarget!==f))return[];for(var S=de(f),y={interaction:o,pointer:s,event:l,eventTarget:f,type:p,path:S,targets:[],node:null},k=0;k<S.length;k++){var A=S[k];y.node=A,t.fire("pointerEvents:collect-targets",y)}return p==="hold"&&(y.targets=y.targets.filter((function(H){var V,G;return H.eventable.options.holdDuration===((V=o.pointers[h])==null||(G=V.hold)==null?void 0:G.duration)}))),y.targets}function Rr(n){var t=n.interaction,o=n.pointerIndex,s=t.pointers[o].hold;s&&s.timeout&&(clearTimeout(s.timeout),s.timeout=null)}var Hl=Object.freeze({__proto__:null,default:Ft});function Yl(n){var t=n.interaction;t.holdIntervalHandle&&(clearInterval(t.holdIntervalHandle),t.holdIntervalHandle=null)}var Xl={id:"pointer-events/holdRepeat",install:function(n){n.usePlugin(Ft);var t=n.pointerEvents;t.defaults.holdRepeatInterval=0,t.types.holdrepeat=n.actions.phaselessTypes.holdrepeat=!0},listeners:["move","up","cancel","endall"].reduce((function(n,t){return n["pointerEvents:".concat(t)]=Yl,n}),{"pointerEvents:new":function(n){var t=n.pointerEvent;t.type==="hold"&&(t.count=(t.count||0)+1)},"pointerEvents:fired":function(n,t){var o=n.interaction,s=n.pointerEvent,l=n.eventTarget,f=n.targets;if(s.type==="hold"&&f.length){var p=f[0].eventable.options.holdRepeatInterval;p<=0||(o.holdIntervalHandle=setTimeout((function(){t.pointerEvents.fire({interaction:o,eventTarget:l,type:"hold",pointer:s,event:s},t)}),p))}}})},Ul=Xl,Kl={id:"pointer-events/interactableTargets",install:function(n){var t=n.Interactable;t.prototype.pointerEvents=function(s){return ne(this.events.options,s),this};var o=t.prototype._backCompatOption;t.prototype._backCompatOption=function(s,l){var f=o.call(this,s,l);return f===this&&(this.events.options[s]=l),f}},listeners:{"pointerEvents:collect-targets":function(n,t){var o=n.targets,s=n.node,l=n.type,f=n.eventTarget;t.interactables.forEachMatch(s,(function(p){var h=p.events,v=h.options;h.types[l]&&h.types[l].length&&p.testIgnoreAllow(v,s,f)&&o.push({node:s,eventable:h,props:{interactable:p}})}))},"interactable:new":function(n){var t=n.interactable;t.events.getRect=function(o){return t.getRect(o)}},"interactable:set":function(n,t){var o=n.interactable,s=n.options;ne(o.events.options,t.pointerEvents.defaults),ne(o.events.options,s.pointerEvents||{})}}},Gl=Kl,Wl={id:"pointer-events",install:function(n){n.usePlugin(Hl),n.usePlugin(Ul),n.usePlugin(Gl)}},Jl=Wl,Zl={id:"reflow",install:function(n){var t=n.Interactable;n.actions.phases.reflow=!0,t.prototype.reflow=function(o){return(function(s,l,f){for(var p=s.getAllElements(),h=f.window.Promise,v=h?[]:null,S=function(){var k=p[y],A=s.getRect(k);if(!A)return 1;var H,V=Rt(f.interactions.list,(function(re){return re.interacting()&&re.interactable===s&&re.element===k&&re.prepared.name===l.name}));if(V)V.move(),v&&(H=V._reflowPromise||new h((function(re){V._reflowResolve=re})));else{var G=De(A),se=(function(re){return{coords:re,get page(){return this.coords.page},get client(){return this.coords.client},get timeStamp(){return this.coords.timeStamp},get pageX(){return this.coords.page.x},get pageY(){return this.coords.page.y},get clientX(){return this.coords.client.x},get clientY(){return this.coords.client.y},get pointerId(){return this.coords.pointerId},get target(){return this.coords.target},get type(){return this.coords.type},get pointerType(){return this.coords.pointerType},get buttons(){return this.coords.buttons},preventDefault:function(){}}})({page:{x:G.x,y:G.y},client:{x:G.x,y:G.y},timeStamp:f.now()});H=(function(re,fe,ye,we,he){var be=re.interactions.new({pointerType:"reflow"}),Ae={interaction:be,event:he,pointer:he,eventTarget:ye,phase:"reflow"};be.interactable=fe,be.element=ye,be.prevEvent=he,be.updatePointer(he,he,ye,!0),ri(be.coords.delta),xr(be.prepared,we),be._doPhase(Ae);var Te=re.window,Le=Te.Promise,ze=Le?new Le((function(Ue){be._reflowResolve=Ue})):void 0;return be._reflowPromise=ze,be.start(we,fe,ye),be._interacting?(be.move(Ae),be.end(he)):(be.stop(),be._reflowResolve()),be.removePointer(he,he),ze})(f,s,k,l,se)}v&&v.push(H)},y=0;y<p.length&&!S();y++);return v&&h.all(v).then((function(){return s}))})(this,o,n)}},listeners:{"interactions:stop":function(n,t){var o=n.interaction;o.pointerType==="reflow"&&(o._reflowResolve&&o._reflowResolve(),(function(s,l){s.splice(s.indexOf(l),1)})(t.interactions.list,o))}}},Ql=Zl;if(Re.use(Si),Re.use(Pi),Re.use(Jl),Re.use(hl),Re.use(Bl),Re.use(nl),Re.use(Uc),Re.use(Gc),Re.use(Ql),Re.default=Re,c(e)==="object"&&e)try{e.exports=Re}catch{}return Re.default=Re,Re}))})(Kt)),Kt.exports}var fs=us();const ds=Ar(fs);function Fe(e){return e==null?"":typeof e=="string"||typeof e=="number"||typeof e=="boolean"?String(e):typeof e=="function"?e.toString():e instanceof Date?e.toISOString():e instanceof RegExp?e.toString():e instanceof Map?JSON.stringify(Array.from(e.entries())):e instanceof Set?JSON.stringify(Array.from(e.values())):e instanceof WeakMap||e instanceof WeakSet?"":e instanceof ArrayBuffer?e.toString():Array.isArray(e)?JSON.stringify(e.map(Fe)):typeof e=="object"?JSON.stringify(Object.entries(e).sort(([r],[i])=>r.localeCompare(i))):""}function $r(e,{isEnabled:r=!0,onDragStart:i,onDragMove:a,onDragEnd:c,...u}){const d=Ee(i),g=Ee(a),m=Ee(c);N.useLayoutEffect(()=>{if(!r)return;const b=e.current;if(!b)return;const C=ds(b).draggable({inertia:!0,...u,onstart:({client:_})=>{const P=Se.make(_);d.current?.(P)},onmove:({client:_,clientX0:P,clientY0:R,dx:M,dy:T})=>{const j=Se.make(P,R),Z=Se.make(_),q=Se.make(M,T);g.current?.(q,Z,j)},onend:({client:_,clientX0:P,clientY0:R})=>{const M=Se.make(P,R),T=Se.make(_);m.current?.(T,M)}});return()=>{C.unset(),m.current?.(Se.zero,Se.zero)}},[r,Fe(u)])}function st(e,{initialValue:r,transform:i,onDragStart:a,onDragMove:c,onDragEnd:u,...d}){const g=N.useRef(r),[m,b]=N.useState(!1),[C,_]=N.useState(!1),[P,R]=N.useState(r),M=Ee(a),T=Ee(c),j=Ee(u),Z=Ee(i);return $r(e,{onDragStart:x=>{b(!0),_(!1),M.current?.(x)},onDragMove:(x,O,E)=>{const L=Z.current(g.current,x.x,x.y);qr(g,L)&&R(L),b(!0),_(!1),T.current?.(x,O,E)},onDragEnd:(x,O)=>{b(!1),_(!0),j.current?.(x,O)},...d}),N.useEffect(()=>{qr(g,P)},[P]),{isDragging:m,isReleasing:C,value:P,setValue:R}}function qr(e,r){return He(e.current,r)?!1:(e.current=r,!0)}const Gn=N.forwardRef(({angle:e=0,speed:r=1,src:i,zeroAnchor:a=0,onAngleChange:c,onPositionChange:u,onDragStart:d,onDragEnd:g,onLoadImageStart:m,onLoadImageComplete:b,onLoadImageError:C,onImageSizeChange:_,...P},R)=>{const M=N.useCallback((L,U,Q)=>L-U*r,[r]),T=N.useRef(null),j=Be(T),Z=zn({src:i},{onLoadStart:m,onLoadComplete:b,onLoadError:C}),[q,W]=N.useState(e),{isDragging:K,value:x,setValue:O}=st(T,{initialValue:0,transform:M,onDragStart:d,onDragEnd:g});N.useEffect(()=>{if(K||!Z)return;const L=hs(e,Z,xe.size(j),a);L!==x&&O(L),e!==q&&W(e)},[e,Z,j.width,j.height,a]),N.useEffect(()=>{if(!K||!Z)return;const L=gs(x,Z,xe.size(j),a);q!==L&&W(L)},[x,Z,j.width,j.height,a]),N.useEffect(()=>{c?.(q,K),u?.(q/360,K)},[q]),N.useEffect(()=>{_?.(Z)},[Z?.width,Z?.height]);const E=ps({src:i,displacement:x});return w.jsx("div",{...P,ref:R,"aria-valuenow":q,role:"slider",children:w.jsx("div",{ref:T,style:E.body})})});function ps({src:e="",displacement:r=NaN}){return{body:{backgroundImage:`url(${e})`,backgroundPositionX:`${-r}px`,backgroundRepeat:"repeat",backgroundSize:"auto 100%",height:"100%",touchAction:"none",width:"100%"}}}function eo(e,r){const{width:i,height:a}=e,{height:c}=r;if(a<=0)return ke.zero;const d=c/a*i;return ke.make(d,c)}function hs(e,r,i,a){const{width:c}=eo(r,i),{width:u}=i,d=u*a;return e/360*c-d}function gs(e,r,i,a){const{width:c}=eo(r,i),{width:u}=i,d=u*a;let g=(e+d)%c/c*360;for(;g<0;)g+=360;return g}process.env.NODE_ENV==="development"&&(Gn.displayName="Panorama");const to=N.forwardRef(({className:e,style:r,angle:i=0,autoDimension:a="width",children:c,fov:u,speed:d=1,src:g,viewportSize:m,zeroAnchor:b=0,onAngleChange:C,onDragEnd:_,onDragStart:P,onLoadImageComplete:R,onLoadImageError:M,onLoadImageStart:T,onImageSizeChange:j,onPositionChange:Z,...q},W)=>{const K=N.useRef(null),x=Be(K),[O,E]=N.useState(),[L,U]=N.useState(!1),ie=N.useCallback(()=>{if(!O)return 0;const{width:z,height:I}=O;return I===0?0:z/I},[O?.width,O?.height])(),B=N.useCallback(()=>{const z=Math.min(360,Math.max(0,u??(m?m.width/(m.height*ie)*360:0)));return x.width*(z/360)},[m?.width,m?.height,ie,x.width,u])(),X=N.useCallback(()=>x.width<=0?b:((x.width-B)*.5+b*B)/x.width,[x.width,B,b])(),oe=N.useCallback(()=>{U(!0),P?.()},[P]),ae=N.useCallback(()=>{U(!1),_?.()},[_]),ue=Pe(c,{track:vt,reticle:Wt,indicator:Gt}),Y=vs({autoDimension:a,panoramaRect:x,aspectRatio:ie,reticleWidth:B});return w.jsxs("div",{...q,ref:W,className:ce(e,{dragging:L}),style:le(r,Y.root),children:[w.jsx(Gn,{ref:K,angle:i,speed:d,src:g,style:Y.panorama,zeroAnchor:X,onAngleChange:C,onDragEnd:ae,onDragStart:oe,onImageSizeChange:E,onLoadImageComplete:R,onLoadImageError:M,onLoadImageStart:T,onPositionChange:Z}),w.jsx("div",{style:Y.body,children:w.jsxs("div",{style:Y.controls,children:[w.jsx(me,{className:ce({dragging:L}),element:ue.track??w.jsx(vt,{}),style:Y.track}),w.jsx(me,{className:ce({dragging:L}),element:ue.reticle??w.jsx(Wt,{}),style:Y.reticle}),w.jsx(me,{className:ce({dragging:L}),element:ue.track??w.jsx(vt,{}),style:Y.track})]})}),w.jsx(me,{className:ce({dragging:L}),element:ue.indicator??w.jsx(Gt,{}),style:Y.indicator})]})}),Gt=({...e})=>w.jsx("div",{...e}),Wt=({...e})=>w.jsx("div",{...e}),vt=({...e})=>w.jsx("div",{...e}),ms=Object.assign(to,{Indicator:Gt,Reticle:Wt,Track:vt});function vs({autoDimension:e="width",panoramaRect:r=xe.zero,aspectRatio:i=0,reticleWidth:a=0}){return{root:{...e==="width"?{width:`${r.height*i}px`}:{height:`${r.width/i}px`}},body:{height:"100%",left:"0",overflow:"hidden",pointerEvents:"none",position:"absolute",top:"0",width:"100%"},panorama:{height:"100%",width:"100%"},controls:{alignItems:"center",display:"flex",height:"100%",justifyContent:"flex-start",left:"0",overflow:"visible",position:"absolute",top:"0",width:"100%"},track:{flex:"1 0 auto"},reticle:{width:`${a}px`},indicator:{width:`${a}px`}}}process.env.NODE_ENV==="development"&&(to.displayName="PanoramaSlider",Gt.displayName="PanoramaSlider.Indicator",Wt.displayName="PanoramaSlider.Reticle",vt.displayName="PanoramaSlider.Track");const no=N.forwardRef(({children:e,className:r,isDeselectable:i=!1,isDisabled:a=!1,isSelected:c=!1,label:u,onDeselect:d,onSelect:g,onToggle:m,...b},C)=>{const _=()=>{if(!a)if(c){if(!i)return;m?.(c),d?.()}else m?.(c),g?.()};return w.jsx("button",{...b,...a?{"aria-disabled":!0}:{},ref:C,"aria-label":u,"aria-selected":c,className:ce(r,{active:c,disabled:a||c&&!i}),disabled:a||c&&!i,onClick:_,children:e??u})});process.env.NODE_ENV==="development"&&(no.displayName="SelectableButton");function ro({children:e,if:r}){return typeof r==="function"?r()?w.jsx(w.Fragment,{children:e}):w.jsx(w.Fragment,{}):r?w.jsx(w.Fragment,{children:e}):w.jsx(w.Fragment,{})}process.env.NODE_ENV==="development"&&(ro.displayName="Conditional");function yt({in:e,children:r,render:i}){if(e==null)return w.jsx(w.Fragment,{});if(!(e instanceof Array))throw TypeError(`Provided list <${e}> is not an array`);return w.jsx(w.Fragment,{children:e.map((a,c)=>w.jsx(N.Fragment,{children:i?.(a,c)??(typeof r=="function"?r(a,c):r)},`item-${c}`))})}process.env.NODE_ENV==="development"&&(yt.displayName="Each");function oo({children:e,condition:r}){const i=N.Children.toArray(e);if(i.length===0)return console.error("[etudes::Switch] `Switch` must have at least one child"),w.jsx(w.Fragment,{});if(!bs(i))return console.error("[etudes::Switch] `Switch` children must be of `Case` type or `Default` type"),w.jsx(w.Fragment,{});const a=i.filter(u=>u.type===Jt);if(a.length>1)return console.error("[etudes::Switch] `Switch` can only have maximum one `Default` child"),w.jsx(w.Fragment,{});const c=a[0];for(const u of i)if(typeof r=="function"){if(r(u.props.value))return u}else if(r===u.props.value)return u;if(c)return c}function Wn({children:e}){return e}function Jt({children:e}){return e}const ys=Object.assign(oo,{Case:Wn,Default:Jt});function bs(e){return e.every(r=>N.isValidElement(r)&&(r.type===Wn||r.type===Jt))}process.env.NODE_ENV==="development"&&(oo.displayName="Switch",Wn.displayName="Switch.Case",Jt.displayName="Switch.Default");const Jn=N.forwardRef(({children:e,...r},i)=>(Array.isArray(e)&&console.error(`[etudes::ExtractChild] Only one child is expected, but found ${e.length}. Only the first child is extracted while the rest are discarded.`),N.Children.map(e,(a,c)=>{if(!(c>0))return N.isValidElement(a)?Bt(a,{...r,ref:i}):a})));process.env.NODE_ENV==="development"&&(Jn.displayName="ExtractChild");function io({children:e,className:r,style:i,alignment:a,arrowHeight:c=6,arrowWidth:u=12,gap:d=4,hint:g,maxWidth:m=200,threshold:b=100}){const C=N.useRef(null),_=N.useRef(void 0),P=Be(C),R=N.useCallback(()=>{const j=window.document.createElement("span");j.className=ce(r),j.innerHTML=g,j.role="tooltip";const Z=a??(C.current?xs(C.current,b):"tl"),q=ws(j),W=Ss({alignment:Z,arrowSize:ke.make(u,c),gap:d,maxDialogWidth:m,fullDialogWidth:q.width,targetWidth:P.width}),K=le(i,W.dialog);Object.keys(K).forEach(O=>j.style[O]=K[O]);const x=window.document.createElement("span");return Object.keys(W.arrow).forEach(O=>x.style[O]=W.arrow[O]),j.appendChild(x),j},[r,a,g,m,Fe(i),P.width,b,c,u,d]),M=N.useCallback(()=>{_.current&&(_.current.style.opacity="1",_.current.ariaHidden="false")},[]),T=N.useCallback(()=>{_.current&&(_.current.style.opacity="0",_.current.ariaHidden="true")},[]);return N.useEffect(()=>{const j=R();return C.current?.appendChild(j),_.current=j,()=>{C.current?.removeChild(j),_.current=void 0}},[R]),w.jsx(Jn,{ref:C,onMouseEnter:M,onMouseLeave:T,children:e})}function ws(e){if(typeof window>"u")return ke.zero;const r=e.cloneNode(!1);r.innerHTML=e.innerHTML,r.style.visibility="hidden",r.style.whiteSpace="pre",window.document.body.appendChild(r);const i=r.getBoundingClientRect();return window.document.body.removeChild(r),ke.make(i.width,i.height)}function xs(e,r){const i=xe.fromViewport(),a=xe.intersecting(e),c=a.left-i.left<r,u=i.right-a.right<r,d=a.top-i.top<r,g=i.bottom-a.bottom<r;return c&&d?"br":c&&g?"tr":u&&d?"bl":u&&g?"tl":c?"cr":u?"cl":"tc"}function Es({alignment:e,arrowSize:r,fullDialogWidth:i,gap:a,maxDialogWidth:c,targetWidth:u}){const d=Math.min(i,c),g=u>d;switch(e){case"tl":return{bottom:`calc(100% + ${r.height}px + ${a}px)`,right:g?"":"0",left:g?"50%":"",transform:`translate(${d>u?"0":"-50%"}, 0)`};case"tc":return{bottom:`calc(100% + ${r.height}px + ${a}px)`,left:"50%",transform:"translateX(-50%)"};case"tr":return{bottom:`calc(100% + ${r.height}px + ${a}px)`,left:g?"50%":"0",transform:`translate(${d>u?"0":"-50%"}, 0)`};case"cl":return{top:"50%",right:`calc(100% + ${r.height+a}px)`,transform:"translate(0, -50%)"};case"cr":return{top:"50%",left:`calc(100% + ${r.height+a}px)`,transform:"translate(0, -50%)"};case"bl":return{left:g?"50%":"",right:g?"":"0",top:`calc(100% + ${r.height}px + ${a}px)`,transform:`translate(${d>u?"0":"-50%"}, 0)`};case"bc":return{left:"50%",top:`calc(100% + ${r.height}px + ${a}px)`,transform:"translateX(-50%)"};case"br":return{left:g?"50%":"0",top:`calc(100% + ${r.height}px + ${a}px)`,transform:`translate(${d>u?"0":"-50%"}, 0)`};default:return console.error(`[etudes::WithTooltip] Invalid alignment: ${e}`),{}}}function Ns({alignment:e,arrowSize:r,fullDialogWidth:i,maxDialogWidth:a,targetWidth:c}){const u=Math.min(i,a),d=c>u;switch(e){case"tl":return{bottom:0,clipPath:"polygon(50% 100%,100% 0,0 0)",height:`${r.height}px`,left:d?"50%":"",right:d?"":`${c-r.width/2-c/2}px`,transform:`translate(${d?"-50%":"0"}, 100%)`,width:`${r.width}px`};case"tc":return{bottom:0,clipPath:"polygon(50% 100%,100% 0,0 0)",height:`${r.height}px`,left:"50%",transform:"translate(-50%, 100%)",width:`${r.width}px`};case"tr":return{bottom:0,clipPath:"polygon(50% 100%,100% 0,0 0)",height:`${r.height}px`,left:d?"50%":`${c-r.width/2-c/2}px`,transform:`translate(${d?"-50%":"0"}, 100%)`,width:`${r.width}px`};case"cl":return{clipPath:"polygon(0 0,100% 50%,0 100%)",height:`${r.width}px`,right:"0",top:"50%",transform:"translate(100%, -50%)",width:`${r.height}px`};case"cr":return{clipPath:"polygon(100% 0,0 50%,100% 100%)",height:`${r.width}px`,left:"0",top:"50%",transform:"translate(-100%, -50%)",width:`${r.height}px`};case"bl":return{clipPath:"polygon(50% 0,100% 100%,0 100%)",height:`${r.height}px`,left:d?"50%":"",right:d?"":`${c-r.width/2-c/2}px`,top:"0",transform:`translate(${d?"-50%":"0"}, -100%)`,width:`${r.width}px`};case"bc":return{clipPath:"polygon(50% 0,100% 100%,0 100%)",height:`${r.height}px`,left:"50%",top:"0",transform:"translate(-50%, -100%)",width:`${r.width}px`};case"br":return{clipPath:"polygon(50% 0,100% 100%,0 100%)",height:`${r.height}px`,left:d?"50%":`${c-r.width/2-c/2}px`,top:"0",transform:`translate(${d?"-50%":"0"}, -100%)`,width:`${r.width}px`};default:return console.error(`[etudes::WithTooltip] Invalid alignment: ${e}`),{}}}function Ss({alignment:e,arrowSize:r,fullDialogWidth:i,gap:a,maxDialogWidth:c,targetWidth:u}){return{dialog:{boxSizing:"border-box",height:"auto",margin:"0",opacity:"0",pointerEvents:"none",position:"absolute",userSelect:"none",whiteSpace:i>c?"normal":"pre",width:i>c?`${c}px`:"",...Es({alignment:e,arrowSize:r,fullDialogWidth:i,gap:a,maxDialogWidth:c,targetWidth:u})},arrow:{background:"inherit",position:"absolute",...Ns({alignment:e,arrowSize:r,fullDialogWidth:i,maxDialogWidth:c,targetWidth:u})}}}process.env.NODE_ENV==="development"&&(io.displayName="WithTooltip");function Ts(e,{element:r,isEnabled:i=!0}={}){N.useLayoutEffect(()=>{if(!i)return;const a=r??window.document.documentElement,c=a.classList.contains(e);return c||a.classList.add(e),()=>{c||a.classList.remove(e)}},[e,r,i])}function _s(e,r){const i=Ee(r);N.useLayoutEffect(()=>{const a=c=>{if(!(c.target instanceof Node))return;let u=!0,d=c.target;const m=[].concat(e).map(b=>b.current);for(;d;){if(m.find(b=>b===d)){u=!1;break}if(!d.parentNode)break;d=d.parentNode}u&&i.current()};return window.addEventListener("click",a,!0),()=>{window.removeEventListener("click",a,!0)}},[])}function Cs(){return N.useCallback(async e=>{const r=e.type,i=new ClipboardItem({[r]:e});try{await navigator.clipboard.write([i])}catch(a){console.error("[etudes::useCopyBlobToClipboard] Failed to copy blob to clipboard:",a)}},[])}function ks(){return N.useCallback((e,r)=>{const i=URL.createObjectURL(e),a=document.createElement("a");a.href=i,a.download=r,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(i)},[])}function Os(){return typeof window>"u"?1:window.devicePixelRatio||1}function Ps(){return N.useMemo(()=>Os(),[])}function so(e,{isEnabled:r=!0,updatesCursor:i=!0,onDragStart:a,onDragMove:c,onDragEnd:u}){const d=N.useRef(void 0),g=N.useRef(void 0),m=Ee(a),b=Ee(c),C=Ee(u),_=N.useCallback(M=>{if(!d.current)return;const T=Se.make(M.clientX,M.clientY),j=Se.subtract(T,g.current??d.current);g.current=T,b.current?.(j,T,d.current)},[]),P=N.useCallback(M=>{const T=e.current;if(!T||!d.current)return;const j=Se.make(M.clientX,M.clientY),Z=Se.subtract(g.current??d.current,j);C.current?.(j,Z,d.current),d.current=void 0,g.current=void 0,T.removeEventListener("mousemove",_),T.removeEventListener("mouseup",P,{capture:!0}),T.removeEventListener("mouseleave",P),i&&(T.style.cursor="grab")},[i,_]),R=N.useCallback(M=>{const T=e.current;if(!T)return;M.preventDefault();const j=Se.make(M.clientX,M.clientY);d.current=j,g.current=j,T.addEventListener("mousemove",_),T.addEventListener("mouseup",P,{capture:!0}),T.addEventListener("mouseleave",P),i&&(T.style.cursor="grabbing"),m.current?.(j)},[i,_,P]);N.useLayoutEffect(()=>{const M=e.current;if(!M||!r||!i)return;const T=M.style.cursor;return M.style.cursor="grab",()=>{M.style.cursor=T}},[r,i]),N.useLayoutEffect(()=>{const M=e.current;if(!(!M||!r))return M.addEventListener("mousedown",R),()=>{M.removeEventListener("mousedown",R),M.removeEventListener("mousemove",_),M.removeEventListener("mouseup",P,{capture:!0}),M.removeEventListener("mouseleave",P)}},[r,_,P,R])}function Is(e){const[r,i]=N.useState(!1),a=N.useCallback(d=>{d.preventDefault(),d.stopPropagation(),i(!0)},[]),c=N.useCallback(d=>{d.preventDefault(),d.stopPropagation(),i(!1)},[]),u=N.useCallback(d=>{d.preventDefault(),d.stopPropagation(),i(!1);const g=d.dataTransfer.files;if(g&&g.length>0){const m=g[0];new FormData().append("file",m),e(m)}},[]);return{isDropping:r,onDragOver:a,onDragLeave:c,onDrop:u}}function ao(e,{autoStarts:r=!0,shouldInvokeInitially:i=!1,onInterval:a},c=[]){const u=N.useRef(void 0),d=Ee(a),g=N.useCallback(()=>{clearInterval(u.current),u.current=void 0},[]),m=N.useCallback(()=>{g(),!(e<0)&&(i&&d.current(),u.current=setInterval(()=>{d.current()},e))},[e,i,g]);return N.useEffect(()=>(r&&e>0&&m(),g),[r,e,m,g,...c]),{start:m,stop:g}}function js(){const[e,r]=N.useState(!1);return N.useEffect(()=>(r(!0),()=>{r(!1)}),[]),e}function co(){return typeof window>"u"?!1:!!(typeof window.navigator<"u"&&(window.navigator.maxTouchPoints>0||"msMaxTouchPoints"in window.navigator&&window.navigator.msMaxTouchPoints>0)||window.matchMedia("(pointer: coarse)").matches||window.matchMedia("(hover: none)").matches||"ontouchstart"in window||"ontouchstart"in window.document.documentElement)}function lo(){return N.useMemo(()=>co(),[])}function Rs(e,r,{capture:i=!1,isEnabled:a=!0,preventsDefault:c=!0,stopsPropagation:u=!0,target:d}={}){const g=Ee(r),m=Array.isArray(e)?e:[e],b=N.useMemo(()=>m.map(C=>C.toLowerCase()).sort(),[m]);N.useEffect(()=>{if(!a||b.length===0)return;const C=d&&typeof d=="object"&&"current"in d?d.current:d||window;if(!C)return;const _=P=>{const R=new Set([P.key.toLowerCase(),P.ctrlKey&&"control",P.metaKey&&"meta",P.shiftKey&&"shift",P.altKey&&"alt"].filter(Boolean));b.every(T=>R.has(T))&&R.size===b.length&&(c&&P.preventDefault(),u&&P.stopPropagation(),g.current?.())};return C.addEventListener("keydown",_,{capture:i}),()=>{C.removeEventListener("keydown",_,{capture:i})}},[a,c,i,b.join(",")])}const Zn=typeof window<"u"?window.localStorage:void 0;function uo({defaultTTL:e=300}={}){return{get:Ms,invalidate:fo,set:(r,i,a=e)=>Ls(r,i,a)}}function fo(e){Zn?.removeItem(e)}function As(e){const{timestamp:r,ttl:i}=e;return(Date.now()-r)/1e3>=i}function Ms(e){const r=Zn?.getItem(e);if(!r)return;const i=JSON.parse(r);if(i)if(As(i)){fo(e);return}else return i.value}function Ls(e,r,i){const a={value:e,timestamp:Date.now(),ttl:i};return Zn?.setItem(r,JSON.stringify(a)),e}function zs(e){return N.useMemo(()=>uo({defaultTTL:e}),[e])}function Fs(){const e=navigator.userAgent||navigator.vendor||window.opera;return N.useMemo(()=>{switch(!0){case/android/i.test(e):return"android";case(/iPad|iPhone|iPod/.test(e)&&!window.MSStream):return"ios";case/win/i.test(e):return"windows";case/mac/i.test(e):return"macos";case/linux/i.test(e):return"linux";default:return"unknown"}},[e])}function Vs(e,r=[]){const i=Ee(e),a=N.useRef(void 0),c=N.useRef(!1);N.useLayoutEffect(()=>{const u=()=>{const g=Ds();g&&(i.current(g,a.current),a.current=g)},d=()=>{c.current||typeof requestAnimationFrame=="function"&&(c.current=!0,requestAnimationFrame(()=>{u(),c.current=!1}))};return window.addEventListener("scroll",d,{passive:!0}),window.addEventListener("resize",d),window.addEventListener("orientationchange",d),d(),()=>{window.removeEventListener("scroll",d),window.removeEventListener("resize",d),window.removeEventListener("orientationchange",d)}},[...r])}function Ds(){const e=xe.fromViewport(),r=xe.clone(e,{x:0,y:0}),i=xe.from(window,{overflow:!0}),a=xe.clone(r,{x:i.width-e.width,y:i.height-e.height}),c=Se.make(e.left/a.left,e.top/a.top);return{minPos:Se.make(r.left,r.top),maxPos:Se.make(a.left,a.top),pos:Se.make(e.left,e.top),step:c}}function po(e){const r=N.useRef(void 0);return N.useEffect(()=>{r.current=e},[e]),r.current}const Qn=typeof window<"u"?window.sessionStorage:void 0;function ho({defaultTTL:e=300}={}){return{get:Hs,invalidate:go,set:(r,i,a=e)=>Ys(r,i,a)}}function go(e){Qn?.removeItem(e)}function Bs(e){const{timestamp:r,ttl:i}=e;return(Date.now()-r)/1e3>=i}function Hs(e){const r=Qn?.getItem(e);if(!r)return;const i=JSON.parse(r);if(i)if(Bs(i)){go(e);return}else return i.value}function Ys(e,r,i){const a={value:e,timestamp:Date.now(),ttl:i};return Qn?.setItem(r,JSON.stringify(a)),e}function Xs(e){return N.useMemo(()=>ho({defaultTTL:e}),[e])}function $n(e){const[r,i]=N.useState(ke.zero);return Yt(e,{onResize:a=>{const c=xe.from(a);if(!c)return;const u=xe.size(c);i(d=>ke.isEqual(d,u)?d:u)}}),r}function mo(e,{element:r,computed:i}){if(typeof window>"u")return;const a=r??window.document.documentElement;return i?window.getComputedStyle(a).getPropertyValue(e)||void 0:a.style.getPropertyValue(e)||void 0}function qn(e,r,{element:i}={}){if(typeof window>"u")return;const a=i??window.document.documentElement;r===void 0?a.style.removeProperty(e):a.style.setProperty(e,r)}function Us(e,r,{element:i,isEnabled:a=!0}={}){N.useLayoutEffect(()=>{if(!a)return;const c=i??window.document.documentElement,u=mo(e,{element:c,computed:!1});return qn(e,r,{element:c}),()=>{qn(e,u,{element:c})}},[e,r,i,a])}function Ks(e="light"){const[r,i]=N.useState(e);return N.useLayoutEffect(()=>{const a=window.matchMedia("(prefers-color-scheme: dark)");function c(u){i(u.matches?"dark":"light")}return i(a.matches?"dark":"light"),a.addEventListener("change",c),()=>{a.removeEventListener("change",c)}},[]),r}function Gs(e,{autoStarts:r=!0,onTimeout:i},a=[]){const c=N.useRef(void 0),u=Ee(i),d=N.useCallback(()=>{c.current!==void 0&&(clearTimeout(c.current),c.current=void 0)},[]),g=N.useCallback(()=>{d(),!(e<0)&&(c.current=setTimeout(()=>{d(),u.current()},e))},[e,d]);return N.useEffect(()=>(r&&e>=0&&g(),d),[r,e,g,d,...a]),{start:g,stop:d}}const vo=N.forwardRef(({className:e,children:r,style:i,isSelectionTogglable:a=!1,itemLength:c,itemPadding:u=0,items:d=[],layout:g="list",numSegments:m=1,orientation:b="vertical",selection:C,selectionMode:_="none",onActivateAt:P,onDeselectAt:R,onCustomEvent:M,onSelectAt:T,onSelectionChange:j,ItemComponent:Z,...q},W)=>{const K=Js(C??[],d),x=Zs({itemLength:c,itemPadding:u,layout:g,numSegments:m,orientation:b}),O=B=>K.indexOf(B)>=0,E=B=>{O(B)?U(B):L(B)},L=B=>{if(O(B))return;let F;switch(_){case"multiple":{F=ae=>yo([...ae.filter(ue=>ue!==B),B]);break}case"single":{F=ae=>[B];break}default:return}const X=K,oe=F(K);ie(X,oe)},U=B=>{if(!O(B))return;const F=ae=>ae.filter(ue=>ue!==B),X=K,oe=F(K);ie(X,oe)},Q=B=>{P?.(B),_!=="none"&&(a?E(B):L(B))},ie=(B,F)=>{if(He(B,F))return;const X=B?.filter(ae=>F.indexOf(ae)===-1)??[],oe=F.filter(ae=>B?.indexOf(ae)===-1);X.forEach(ae=>R?.(ae)),oe.forEach(ae=>T?.(ae)),j?.(F)};N.useEffect(()=>{const B=K;let F;switch(_){case"multiple":F=K;break;case"single":F=K.slice(-1);break;default:F=[];break}ie(B,F)},[_]);const te=Pe(r,{item:Zt});return w.jsx("div",{...q,ref:W,"aria-multiselectable":_==="multiple",className:ce(e),role:g==="grid"?"grid":_==="none"?"list":"listbox",style:le(i,x.root),children:w.jsx(yt,{in:d,children:(B,F)=>{const X=g==="grid"?"gridcell":_==="none"?"listitem":"option",oe=O(F),ae=le(x.item,{pointerEvents:a!==!0&&O(F)?"none":"auto",...F>=d.length-1?{}:{...g==="list"?{...b==="vertical"?{marginBottom:`${u}px`}:{marginRight:`${u}px`}}:{}}});return Z?w.jsx(Z,{"aria-selected":oe,className:ce({active:oe}),index:F,isSelected:O(F),item:B,orientation:b,role:X,style:ae,onClick:()=>Q(F),onCustomEvent:(ue,Y)=>M?.(F,ue,Y)}):w.jsx(me,{"aria-selected":oe,className:ce({active:oe}),element:te.item??w.jsx(Zt,{}),role:X,selectionMode:_,style:ae,onActivateAt:P,onClick:()=>Q(F),children:`${B}`})}})})}),Zt=({children:e,selectionMode:r,onActivateAt:i,...a})=>i||r==="single"||r==="multiple"?w.jsx("button",{...a,children:e}):w.jsx("div",{...a,children:e}),bt=Object.assign(vo,{Item:Zt});function Ws(e,r){return!!(isNaN(e)||e>=r.length||e<0)}function Js(e,r){return yo(e).filter(i=>!Ws(i,r))}function yo(e){return e.sort((r,i)=>r-i)}function Zs({itemLength:e=NaN,itemPadding:r=0,layout:i="collection",numSegments:a=1,orientation:c="vertical"}){return{root:{counterReset:"item-counter",listStyle:"none",...i==="list"?{alignItems:"flex-start",display:"flex",flex:"0 0 auto",flexDirection:c==="horizontal"?"row":"column",justifyContent:"flex-start"}:{display:"grid",gap:`${r}px`,...c==="vertical"?{gridAutoRows:isNaN(e)?void 0:`${e}px`,gridTemplateColumns:`repeat(${a}, 1fr)`,gridAutoFlow:"row"}:{gridAutoColumns:isNaN(e)?void 0:`${e}px`,gridTemplateRows:`repeat(${a}, 1fr)`,gridAutoFlow:"column"}}},item:{counterIncrement:"item-counter",flex:"0 0 auto",...i==="list"?{...c==="vertical"?{width:"100%",height:isNaN(e)?void 0:`${e}px`}:{width:isNaN(e)?void 0:`${e}px`,height:"100%"}}:{}}}}process.env.NODE_ENV==="development"&&(vo.displayName="Collection",Zt.displayName="Collection.Item");const bo=N.forwardRef(({children:e,style:r,autoCollapseSections:i=!1,expandedSectionIndices:a,orientation:c="vertical",sectionPadding:u=0,sections:d,selection:g,selectionMode:m="single",onActivateAt:b,onCollapseSectionAt:C,onDeselectAt:_,onExpandedSectionsChange:P,onExpandSectionAt:R,onHeaderCustomEvent:M,onItemCustomEvent:T,onSelectAt:j,onSelectionChange:Z,HeaderComponent:q,ItemComponent:W,...K},x)=>{const O=ea(g??{},d),E=qs(a??[],d),L=ta({orientation:c}),U=d.map(()=>N.useRef(null)),Q=U.map($n),ie=(Y,z)=>(O[z]?.indexOf(Y)??-1)>=0,te=Y=>E.indexOf(Y)>=0,B=Y=>{let z;te(Y)?z=I=>I.filter(J=>J!==Y):i?z=I=>[Y]:z=I=>[...I.filter(J=>J!==Y),Y],oe(E,z(E))},F=(Y,z)=>{if(ie(Y,z))return;let I;switch(m){case"multiple":I=ee=>({...ee,[z]:qt([...(ee[z]??[]).filter($=>$!==Y),Y])});break;case"single":I=ee=>({[z]:[Y]});break;default:return}const J=I(O);ae(O,J)},X=(Y,z)=>{if(!ie(Y,z))return;const J=(ee=>({...ee,[z]:(ee[z]??[]).filter($=>$!==Y)}))(O);ae(O,J)},oe=(Y,z)=>{if(He(Y,z))return;const I=Y?.filter(ee=>z.indexOf(ee)===-1)??[],J=z.filter(ee=>Y?.indexOf(ee)===-1);I.forEach(ee=>C?.(ee)),J.forEach(ee=>R?.(ee)),P?.(z)},ae=(Y,z)=>{if(He(Y,z))return;const I=d.length;let J=[],ee=[];for(let $=0;$<I;$++){const pe=Y?.[$]??[],ve=z[$]??[],de=pe.filter(ne=>ve.indexOf(ne)===-1),Ne=ve.filter(ne=>pe?.indexOf(ne)===-1);J=[...J,...de.map(ne=>[ne,$])],ee=[...ee,...Ne.map(ne=>[ne,$])]}J.forEach($=>_?.($[0],$[1])),ee.forEach($=>j?.($[0],$[1])),Z?.(z)},ue=Pe(e,{collapseIcon:tr,expandIcon:er,header:Qt,item:$t,section:nr});return w.jsx("div",{ref:x,style:le(r,L.root),...K,children:w.jsx(yt,{in:d,children:(Y,z)=>{const{collectionPadding:I=0,items:J=[],itemLength:ee=50,itemPadding:$=0,isSelectionTogglable:pe,layout:ve="list",maxVisible:de=-1,numSegments:Ne=1}=Y,ne=ve==="list"?J.length:Math.ceil(J.length/Ne),Ve=de<0?ne:Math.min(ne,de),Ie=ee*Ve+$*(Ve-1),Ce=!te(z),De=Q[z],lt=Ce?De.width:Ie+De.width+I,nt=Ce?De.height:Ie+De.height+I;return w.jsxs(me,{element:ue.section??w.jsx(nr,{}),style:le(L.section,c==="vertical"?{marginTop:z===0?"0px":`${u}px`,...De.height>0?{height:`${nt}px`}:{visibility:"hidden"}}:{marginLeft:z===0?"0px":`${u}px`,...De.width>0?{width:`${lt}px`}:{visibility:"hidden"}}),children:[w.jsx("div",{ref:U[z],style:le(L.headerContainer),children:q?w.jsx(q,{"aria-expanded":!Ce,className:ce({collapsed:Ce,expanded:!Ce}),index:z,isCollapsed:Ce,role:"button",section:Y,style:le(L.header),onClick:()=>B(z),onCustomEvent:(Oe,ut)=>M?.(z,Oe,ut)}):w.jsxs(me,{"aria-expanded":!Ce,className:ce({collapsed:Ce,expanded:!Ce}),element:ue.header??w.jsx(Qt,{}),role:"button",style:le(L.header),onClick:()=>B(z),children:[w.jsx("span",{dangerouslySetInnerHTML:{__html:Y.label}}),ue.expandIcon&&w.jsx(me,{className:ce({collapsed:Ce,expanded:!Ce}),element:Ce?ue.collapseIcon??ue.expandIcon:ue.expandIcon,style:le(Ce?L.collapseIcon:L.expandIcon)})]})}),w.jsx("div",{role:"region",style:le({pointerEvents:Ce?"none":"auto"},c==="vertical"?{width:"100%",height:`${Ie}px`,marginTop:`${I}px`,overflowY:de<0||de>=ne?"hidden":"scroll"}:{marginLeft:`${I}px`,overflowX:de<0||de>=ne?"hidden":"scroll",width:`${Ie}px`,height:"100%"}),children:w.jsx(bt,{className:ce({collapsed:Ce,expanded:!Ce}),isSelectionTogglable:pe,ItemComponent:W,itemLength:ee,itemPadding:$,items:J,layout:ve,numSegments:Ne,orientation:c,selection:O[z]??[],selectionMode:m,style:le(c==="vertical"?{width:"100%"}:{height:"100%"}),onActivateAt:Oe=>b?.(Oe,z),onCustomEvent:(Oe,ut,rt)=>T?.(Oe,z,ut,rt),onDeselectAt:Oe=>X(Oe,z),onSelectAt:Oe=>F(Oe,z),children:!W&&(ue.item??w.jsx($t,{}))})})]})}})})}),Qt=({children:e,...r})=>w.jsx("button",{...r,children:e}),er=({children:e,...r})=>w.jsx("figure",{...r,children:e}),tr=({children:e,...r})=>w.jsx("figure",{...r,children:e}),nr=({children:e,...r})=>w.jsx("div",{...r,children:e}),$t=bt.Item,Qs=Object.assign(bo,{Header:Qt,ExpandIcon:er,CollapseIcon:tr,Section:nr,Item:$t});function wo(e,r){return e>=r.length||e<0}function $s(e,r,i){if(wo(r,i))return!0;const a=i[r].items??[];return e>=a.length||e<0}function qs(e,r){return qt(e).filter(i=>!wo(i,r))}function ea(e,r){const i={};for(const a in r){if(!Object.hasOwn(r,a))continue;const c=qt([...e[a]??[]]);i[Number(a)]=qt(c).filter(u=>!$s(u,Number(a),r))}return i}function qt(e){return e.sort((r,i)=>r-i)}function ta({orientation:e="vertical"}){return{root:{alignItems:"center",boxSizing:"border-box",display:"flex",flex:"0 0 auto",justifyContent:"flex-start",padding:"0",...e==="vertical"?{flexDirection:"column",height:"auto"}:{flexDirection:"row",width:"auto"}},collapseIcon:{pointerEvents:"none",zIndex:1},expandIcon:{pointerEvents:"none",zIndex:1},section:{alignItems:"flex-start",display:"flex",flex:"0 0 auto",justifyContent:"flex-start",margin:"0",overflow:"hidden",padding:"0",...e==="vertical"?{flexDirection:"column",width:"100%"}:{flexDirection:"row",height:"100%"}},headerContainer:{flexShrink:"0",...e==="vertical"?{width:"100%"}:{height:"100%"}},header:{cursor:"pointer",margin:"0",...e==="vertical"?{width:"100%"}:{height:"100%"}}}}process.env.NODE_ENV==="development"&&(bo.displayName="Accordion",Qt.displayName="Accordion.Header",er.displayName="Accordion.ExpandIcon",tr.displayName="Accordion.CollapseIcon",$t.displayName="Accordion.Item");const xo=N.forwardRef(({autoAdvanceInterval:e=0,index:r=0,isDragEnabled:i=!0,items:a=[],orientation:c="horizontal",tracksItemExposure:u=!1,onAutoAdvancePause:d,onAutoAdvanceResume:g,onIndexChange:m,ItemComponent:b,...C},_)=>{const P=N.useRef(void 0),R=N.useRef(null),M=N.useRef(void 0),T=N.useRef(void 0),j=N.useRef(void 0),Z=1e3,q=Ee(d),W=Ee(g),K=Ee(m),x=N.useRef(!1),O=N.useRef(!1),E=lo(),[L,U]=N.useState(Eo(R,c)),[Q,ie]=N.useState(!1),te=oa({scrollSnapEnabled:E||!Q,orientation:c}),B=e>0,F=N.useCallback(()=>{j.current!==void 0&&(clearTimeout(j.current),j.current=void 0)},[]),X=N.useCallback(()=>{F(),j.current=setTimeout(()=>{clearTimeout(j.current),j.current=void 0},Z)},[Z,F]),oe=N.useCallback(()=>{na(R,r,c),X()},[r,c]),ae=N.useCallback(()=>{U(Eo(R,c))},[c]),ue=N.useCallback($=>{E||(M.current=Se.make($.clientX,$.clientY),ie(!0))},[E]),Y=N.useCallback($=>{E||(T.current=Se.make($.clientX,$.clientY),oe(),ie(!1))},[E,oe]),z=N.useCallback($=>{const pe=M.current,ve=T.current;if(!pe||!ve)return;const de=5,Ne=Se.subtract(pe,ve);(Math.abs(Ne.x)>de||Math.abs(Ne.y)>de)&&$.stopPropagation(),M.current=void 0,T.current=void 0},[]),I=N.useCallback(()=>{const $=(r+a.length+1)%a.length;K.current?.($)},[Q,r,a.length]),J=N.useCallback(({x:$,y:pe})=>{const ve=R.current;!ve||x.current||(F(),x.current=!0,requestAnimationFrame(()=>{switch(c){case"horizontal":ve.scrollLeft-=$*1.5;break;case"vertical":ve.scrollTop-=pe*1.5;default:console.error(`[etudes::Carousel] Unsupported orientation: ${c}`)}x.current=!1}))},[c]),ee=N.useCallback(()=>{const $=R.current;!$||O.current||(O.current=!0,requestAnimationFrame(()=>{if(u&&ae(),!(j.current!==void 0)){const ve=Math.round(c==="horizontal"?$.scrollLeft/$.clientWidth:$.scrollTop/$.clientHeight),de=Math.max(0,Math.min(a.length-1,ve));de!==r&&(P.current=de,K.current?.(de))}O.current=!1}))},[a.length,r,c,u,ae]);return so(R,{isEnabled:!E&&i&&a.length>1,onDragMove:J}),ao(Q||!B?-1:e,{onInterval:I},[r]),N.useLayoutEffect(()=>{!B||E||(Q?q.current?.():W.current?.())},[E,Q,B]),N.useLayoutEffect(()=>{const $=R.current;if(!$)return;const pe=P.current===void 0,ve=P.current===r;return $.addEventListener("scroll",ee),u&&ae(),ve||(P.current=r,pe||(K.current?.(r),oe())),()=>{$.removeEventListener("scroll",ee)}},[r,u,oe,ee,ae]),w.jsx("div",{...C,ref:_,role:"region",onClick:z,onPointerCancel:Y,onPointerDown:ue,onPointerLeave:Y,onPointerUp:Y,children:w.jsx("div",{ref:R,style:le(te.viewport),children:w.jsx(yt,{in:a,children:({style:$,...pe},ve)=>w.jsx("div",{style:le(te.itemContainer),children:w.jsx(b,{"aria-hidden":ve!==r,exposure:u?L?.[ve]:void 0,style:le($,te.item),...pe})})})})})});function na(e,r,i){const a=e?.current;if(!a)return;const c=i==="horizontal"?0:a.clientHeight*r,u=i==="horizontal"?a.clientWidth*r:0;a.scrollTop===c&&a.scrollLeft===u||a.scrollTo({top:c,left:u,behavior:"smooth"})}function Eo(e,r){const i=e?.current;if(!i)return;const a=[];for(let c=0;c<i.children.length;c++)a.push(ra(c,e,r));return a}function ra(e,r,i){const a=r?.current,c=a?.children[e];if(!c)return 0;const u=xe.intersecting(c,a);switch(i){case"horizontal":return Math.max(0,Math.min(1,Math.round((u.width/a.clientWidth+Number.EPSILON)*1e3)/1e3));case"vertical":return Math.max(0,Math.min(1,Math.round((u.height/a.clientHeight+Number.EPSILON)*1e3)/1e3));default:return console.error(`[etudes::Carousel] Unsupported orientation: ${i}`),NaN}}function oa({scrollSnapEnabled:e=!1,orientation:r="horizontal"}){return{viewport:{alignItems:"center",display:"flex",height:"100%",userSelect:e?"auto":"none",justifyContent:"flex-start",scrollSnapStop:"always",WebkitOverflowScrolling:"touch",width:"100%",...r==="horizontal"?{flexDirection:"row",overflowX:"scroll",overflowY:"hidden",scrollSnapType:e?"x mandatory":"none"}:{flexDirection:"column",overflowX:"hidden",overflowY:"scroll",scrollSnapType:e?"y mandatory":"none"}},itemContainer:{height:"100%",overflow:"hidden",scrollSnapAlign:"center",width:"100%",flex:"0 0 auto"},item:{height:"100%",width:"100%"}}}process.env.NODE_ENV==="development"&&(xo.displayName="Carousel");const No=N.forwardRef(({children:e,autoComplete:r="one-time-code",autoFocus:i=!1,inputMode:a="numeric",isDisabled:c=!1,isRequired:u=!0,placeholder:d,size:g,style:m,value:b,onChange:C,..._},P)=>{const R=aa(b,g),M=N.useRef([]),T=sa(),j=Pe(e,{field:en}),Z=x=>{x<0?M.current[0]?.focus():x>=g?M.current[g-1]?.focus():M.current[x]?.focus()},q=x=>O=>{const E=R[x],L=ca(O.target.value,E),U=So(R.slice(),L.split("").slice(0,g),x);C(U);const Q=Math.min(x+L.length,g-1);Z(Q)},W=x=>O=>{switch(O.key){case"Backspace":{if(O.preventDefault(),R[x]){const E=R.slice();E[x]="",C(E),Z(x-1)}else Z(x-1);break}case"ArrowLeft":{O.preventDefault(),Z(x-1);break}case"ArrowRight":{O.preventDefault(),Z(x+1);break}}},K=x=>O=>{O.preventDefault();const E=O.clipboardData.getData("text").trim(),L=So(R.slice(),E.split("").slice(0,g),x);C(L);const U=Math.min(x+E.length,g-1);Z(U)};return N.useEffect(()=>{if(!i)return;const x=R.findIndex(O=>O==="");x!==-1&&Z(x)},[i]),w.jsx("div",{..._,ref:P,style:le(m,T.root),children:w.jsx(gt,{count:g,children:x=>w.jsx(me,{...c?{"aria-disabled":!0}:{},ref:O=>M.current[x]=O,"aria-required":u,autoComplete:r,disabled:c,element:j.field??w.jsx(en,{}),inputMode:a,placeholder:d,required:u,style:le(T.field),value:R[x],onChange:q(x),onKeyDown:W(x),onPaste:K(x)})})})}),en=({...e})=>w.jsx("input",{...e,autoCapitalize:"off",autoCorrect:"off",type:"text"}),ia=Object.assign(No,{Field:en});function sa(){return{root:{alignItems:"stretch",display:"flex",justifyContent:"stretch"},field:{caretColor:"transparent",flex:"1",minWidth:"0"}}}function aa(e,r){const i=e.slice(0,r);for(;i.length<r;)i.push("");return i}function So(e,r,i=0){let a=i,c=0;for(;c<r.length&&a<e.length;)e[a]=r[c],a++,c++;for(;c<r.length;)e.shift(),e.push(r[c]),c++;return e}function ca(e,r){return r===""?e:e.startsWith(r)?e.slice(r.length):e.endsWith(r)?e.slice(0,-r.length):e}process.env.NODE_ENV==="development"&&(No.displayName="CodeInput",en.displayName="CodeInput.Field");const rr=N.forwardRef(({className:e,emptyValue:r="",isDisabled:i=!1,isRequired:a=!1,placeholder:c,type:u="text",value:d,formatter:g,onFocus:m,onUnfocus:b,onChange:C,..._},P)=>{const R=N.useCallback(M=>{const T=(g?.(M)??M)||r;C?.(T)},[C,g]);return w.jsx("input",{..._,...i?{"aria-disabled":!0}:{},ref:P,"aria-placeholder":c,"aria-required":a,className:ce(e,{disabled:i}),disabled:i,placeholder:c,required:a,type:u,value:d||r,onBlur:({target:M})=>b?.(M.value),onChange:({target:M})=>R(M.value),onFocus:({target:M})=>m?.(M.value)})});process.env.NODE_ENV==="development"&&(rr.displayName="TextField");const To=N.forwardRef(({children:e,style:r,allowsInput:i=!0,max:a=NaN,min:c=NaN,quantity:u=0,onChange:d,...g},m)=>{const b=()=>{d?.(T(u-1))},C=()=>{d?.(T(u+1))},_=O=>{Z(O)},P=O=>{const E=M(O);E!==u?d?.(E):Z(R(E))},R=O=>O.toLocaleString(),M=O=>{const E=parseInt(O,10);return E.toString()!==O.replace(/^0+/,"")?u:T(E)},T=O=>{let E=O;return isNaN(c)||(E=Math.max(c,E)),isNaN(a)||(E=Math.min(a,E)),E},[j,Z]=N.useState(R(u)),q=po(u),W=!isNaN(a)&&u+1>a,K=!isNaN(c)&&u-1<c;N.useEffect(()=>{if(q===void 0||q===u)return;const O=T(u);Z(R(O))},[u,c,a]);const x=Pe(e,{textField:tn,addButton:nn,subscribeButton:rn});return w.jsxs("div",{...g,ref:m,style:le(r,on.root),children:[w.jsx(me,{className:ce({disabled:K}),element:x.subscribeButton??w.jsx(rn,{}),style:le(on.subtract),onClick:()=>b()}),w.jsx(me,{element:x.textField??w.jsx(tn,{}),isDisabled:!i,style:le(on.textField),value:j,onChange:_,onUnfocus:P}),w.jsx(me,{className:ce({disabled:W}),element:x.addButton??w.jsx(nn,{}),style:le(on.add),onClick:()=>C()})]})}),tn=({...e})=>w.jsx(rr,{...e}),nn=({children:e,...r})=>w.jsx("button",{...r,children:e}),rn=({children:e,...r})=>w.jsx("button",{...r,children:e}),la=Object.assign(To,{TextField:tn,AddButton:nn,SubtractButton:rn}),on={root:{alignItems:"stretch",display:"flex",flexDirection:"row",justifyContent:"stretch"},subtract:{flex:"0 0 auto"},add:{flex:"0 0 auto"},textField:{width:"100%"}};process.env.NODE_ENV==="development"&&(To.displayName="Counter",nn.displayName="Counter.AddButton",rn.displayName="Counter.SubtractButton",tn.displayName="Counter.TextField");const ua=N.forwardRef(({children:e,style:r,angle:i=0,knobLength:a=30,knobThickness:c=10,radius:u=50,trackGap:d=0,trackThickness:g=2,...m},b)=>{const C=u*2,_=Math.max(0,Math.min(360,a)),P=Pe(e,{track:sn,knob:an}),R=da({angle:i,diameter:C});return w.jsxs("div",{...m,ref:b,style:le(r,R.root),children:[w.jsx("div",{style:R.trackContainer,children:w.jsx("svg",{height:C,style:R.svgContainer,viewBox:`0 0 ${C} ${C}`,width:C,children:w.jsx(me,{cx:u,cy:u,element:P.track??w.jsx(sn,{}),fill:"none",r:u-g/2,strokeDasharray:d,strokeWidth:g})})}),w.jsx("div",{style:le(R.knobContainer),children:w.jsx("svg",{style:R.svgContainer,viewBox:`0 0 ${C} ${C}`,xmlns:"http://www.w3.org/2000/svg",children:w.jsx(me,{d:fa(u,u,u-c/2-(g-c)/2,-_/2,_/2),element:P.knob??w.jsx(an,{}),fill:"none",strokeWidth:c})})})]})}),sn=({...e})=>w.jsx("circle",{...e}),an=({...e})=>w.jsx("path",{...e}),_o=Object.assign(ua,{Track:sn,Knob:an});function Co(e,r,i,a){const c=(a-90)*Math.PI/180;return{x:e+i*Math.cos(c),y:r+i*Math.sin(c)}}function fa(e,r,i,a,c){const u=Co(e,r,i,c),d=Co(e,r,i,a),g=c-a<=180?"0":"1";return["M",u.x,u.y,"A",i,i,0,g,0,d.x,d.y].join(" ")}function da({diameter:e=0,angle:r=0}){return{root:{height:`${e}px`,width:`${e}px`},knobContainer:{backgroundPosition:"center",backgroundRepeat:"no-repeat",backgroundSize:"100%",height:"100%",left:"0",position:"absolute",top:"0",transformOrigin:"center",width:"100%",transform:`rotate(${(r+360)%360}deg)`},trackContainer:{height:"100%",left:"0",position:"absolute",top:"0",transformOrigin:"center",width:"100%"},svgContainer:{overflow:"visible",position:"absolute",right:"0",top:"0"}}}process.env.NODE_ENV==="development"&&(_o.displayName="Dial",sn.displayName="Dial.Track",an.displayName="Dial.Knob");const ko=N.forwardRef(({children:e,className:r,style:i,collapsesOnSelect:a=!0,collectionPadding:c=0,isCollapsed:u,isInverted:d=!1,label:g,layout:m="list",isSelectionTogglable:b=!1,itemLength:C,itemPadding:_=0,items:P=[],maxVisibleItems:R=-1,numSegments:M=1,orientation:T="vertical",selection:j=[],selectionMode:Z="single",onActivateAt:q,onCollapse:W,onDeselectAt:K,onExpand:x,onSelectAt:O,onSelectionChange:E,onToggleCustomEvent:L,ItemComponent:U,ToggleComponent:Q,...ie},te)=>{const B=N.useRef(null),F=Be(B),X=P.length,oe=va(P,R,M,m),ae=C??(T==="vertical"?F.height:F.width),ue=ae*oe+_*(oe-1),Y=ga(j,P),[z,I]=N.useState(u??!0),J=ya({isCollapsed:z,collectionPadding:c,isInverted:d,maxVisibleItems:R,menuLength:ue,numItems:X,orientation:T}),ee=Pe(e,{collapseIcon:or,collection:cn,expandIcon:ir,item:ln,toggle:un}),$=()=>{z&&(I(!1),x?.())},pe=()=>{z||(I(!0),W?.())},ve=()=>{z?$():pe()},de=Ne=>{O?.(Ne),Z==="single"&&a&&pe()};return N.useEffect(()=>{u!==void 0&&I(u)},[u]),N.useEffect(()=>{const Ne=ne=>{if(z||!(ne.target instanceof Node))return;let Ve=!0,Ie=ne.target;for(;Ie;){if(Ie===B.current){Ve=!1;break}if(!Ie.parentNode)break;Ie=Ie.parentNode}Ve&&pe()};return window.addEventListener("click",Ne),()=>{window.removeEventListener("click",Ne)}},[z]),w.jsx("div",{...ie,ref:te,className:ce(r,{collapsed:z,expanded:!z}),style:le(i,J.root),children:w.jsxs("div",{ref:B,style:le(J.body),children:[Q?w.jsx(Q,{"aria-expanded":!z,"aria-haspopup":"listbox",className:ce({collapsed:z,expanded:!z}),style:le(J.toggle),onClick:ve,onCustomEvent:(Ne,ne)=>L?.(Ne,ne)}):w.jsxs(me,{"aria-expanded":!z,"aria-haspopup":"listbox",className:ce({collapsed:z,expanded:!z}),element:ee.toggle??w.jsx(un,{}),style:le(J.toggle),onClick:ve,children:[w.jsx("span",{dangerouslySetInnerHTML:{__html:g?.(Y)??(Y.length>0?Y.map(Ne=>P[Ne]).join(", "):"")}}),ee.expandIcon&&w.jsx(me,{className:ce({collapsed:z,expanded:!z}),element:z?ee.collapseIcon??ee.expandIcon:ee.expandIcon,style:le(z?J.collapseIcon:J.expandIcon)})]}),w.jsx(me,{element:ee.collection??w.jsx(cn,{}),isSelectionTogglable:b,ItemComponent:U,itemLength:ae,itemPadding:_,items:P,layout:m,numSegments:M,orientation:T,selection:Y,selectionMode:Z,style:le(J.collection),onActivateAt:q,onDeselectAt:K,onSelectAt:de,onSelectionChange:E,children:!U&&(ee.item??w.jsx(ln,{}))})]})})}),cn=bt,ln=bt.Item,un=({children:e,...r})=>w.jsx("button",{...r,children:e}),or=({children:e,...r})=>w.jsx("figure",{...r,"aria-hidden":!0,children:e}),ir=({children:e,...r})=>w.jsx("figure",{...r,"aria-hidden":!0,children:e}),pa=Object.assign(ko,{Collection:cn,CollapseIcon:or,ExpandIcon:ir,Item:ln,Toggle:un});function ha(e,r){return!!(isNaN(e)||e>=r.length||e<0)}function ga(e,r){return ma(e).filter(i=>!ha(i,r))}function ma(e){return e.sort((r,i)=>r-i)}function va(e,r,i,a){const c=e.length;if(a==="grid"){const u=i<1?c:Math.ceil(c/i);return r<0?u:Math.min(u,r)}else return r<0?c:Math.min(c,r)}function ya({isCollapsed:e=!0,isInverted:r=!1,collectionPadding:i=0,maxVisibleItems:a=0,menuLength:c=NaN,numItems:u=0,orientation:d="vertical"}){return{root:{alignItems:"center",display:"flex",justifyContent:"flex-start",overflow:"visible",...d==="vertical"?{flexDirection:r?"column-reverse":"column"}:{flexDirection:r?"row-reverse":"row"}},body:{height:"100%",position:"relative",width:"100%"},toggle:{height:"100%",left:"0",margin:"0",position:"absolute",top:"0",width:"100%",zIndex:"1"},collection:{position:"absolute",...d==="vertical"?{width:"100%",height:e?"0px":`${c}px`,overflowY:a!==-1&&a<u?"scroll":"hidden",...r?{marginBottom:`${i}px`,bottom:"100%"}:{top:"100%",marginTop:`${i}px`}}:{width:e?"0px":`${c}px`,height:"100%",overflowX:a!==-1&&a<u?"scroll":"hidden",...r?{marginRight:`${i}px`,right:"100%"}:{left:"100%",marginLeft:`${i}px`}}},expandIcon:{pointerEvents:"none",zIndex:1},collapseIcon:{pointerEvents:"none",zIndex:1}}}process.env.NODE_ENV==="development"&&(ko.displayName="Dropdown",cn.displayName="Dropdown.Collection",or.displayName="Dropdown.CollapseIcon",ir.displayName="Dropdown.ExpandIcon",ln.displayName="Dropdown.Item",un.displayName="Dropdown.Toggle");const Oo=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",ba=Oo+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",wa="["+Oo+"]["+ba+"]*",xa=new RegExp("^"+wa+"$");function Po(e,r){const i=[];let a=r.exec(e);for(;a;){const c=[];c.startIndex=r.lastIndex-a[0].length;const u=a.length;for(let d=0;d<u;d++)c.push(a[d]);i.push(c),a=r.exec(e)}return i}const fn=function(e){const r=xa.exec(e);return!(r===null||typeof r>"u")};function Ea(e){return typeof e<"u"}const Na={allowBooleanAttributes:!1,unpairedTags:[]};function Sa(e,r){r=Object.assign({},Na,r);const i=[];let a=!1,c=!1;e[0]==="\uFEFF"&&(e=e.substr(1));for(let u=0;u<e.length;u++)if(e[u]==="<"&&e[u+1]==="?"){if(u+=2,u=jo(e,u),u.err)return u}else if(e[u]==="<"){let d=u;if(u++,e[u]==="!"){u=Ro(e,u);continue}else{let g=!1;e[u]==="/"&&(g=!0,u++);let m="";for(;u<e.length&&e[u]!==">"&&e[u]!==" "&&e[u]!==" "&&e[u]!==`
7
7
  `&&e[u]!=="\r";u++)m+=e[u];if(m=m.trim(),m[m.length-1]==="/"&&(m=m.substring(0,m.length-1),u--),!ja(m)){let _;return m.trim().length===0?_="Invalid space after '<'.":_="Tag '"+m+"' is an invalid name.",_e("InvalidTag",_,je(e,u))}const b=Ca(e,u);if(b===!1)return _e("InvalidAttr","Attributes for '"+m+"' have open quote.",je(e,u));let C=b.value;if(u=b.index,C[C.length-1]==="/"){const _=u-C.length;C=C.substring(0,C.length-1);const P=Ao(C,r);if(P===!0)a=!0;else return _e(P.err.code,P.err.msg,je(e,_+P.err.line))}else if(g)if(b.tagClosed){if(C.trim().length>0)return _e("InvalidTag","Closing tag '"+m+"' can't have attributes or invalid starting.",je(e,d));if(i.length===0)return _e("InvalidTag","Closing tag '"+m+"' has not been opened.",je(e,d));{const _=i.pop();if(m!==_.tagName){let P=je(e,_.tagStartPos);return _e("InvalidTag","Expected closing tag '"+_.tagName+"' (opened in line "+P.line+", col "+P.col+") instead of closing tag '"+m+"'.",je(e,d))}i.length==0&&(c=!0)}}else return _e("InvalidTag","Closing tag '"+m+"' doesn't have proper closing.",je(e,u));else{const _=Ao(C,r);if(_!==!0)return _e(_.err.code,_.err.msg,je(e,u-C.length+_.err.line));if(c===!0)return _e("InvalidXml","Multiple possible root nodes found.",je(e,u));r.unpairedTags.indexOf(m)!==-1||i.push({tagName:m,tagStartPos:d}),a=!0}for(u++;u<e.length;u++)if(e[u]==="<")if(e[u+1]==="!"){u++,u=Ro(e,u);continue}else if(e[u+1]==="?"){if(u=jo(e,++u),u.err)return u}else break;else if(e[u]==="&"){const _=Pa(e,u);if(_==-1)return _e("InvalidChar","char '&' is not expected.",je(e,u));u=_}else if(c===!0&&!Io(e[u]))return _e("InvalidXml","Extra text at the end",je(e,u));e[u]==="<"&&u--}}else{if(Io(e[u]))continue;return _e("InvalidChar","char '"+e[u]+"' is not expected.",je(e,u))}if(a){if(i.length==1)return _e("InvalidTag","Unclosed tag '"+i[0].tagName+"'.",je(e,i[0].tagStartPos));if(i.length>0)return _e("InvalidXml","Invalid '"+JSON.stringify(i.map(u=>u.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return _e("InvalidXml","Start tag expected.",1);return!0}function Io(e){return e===" "||e===" "||e===`
8
8
  `||e==="\r"}function jo(e,r){const i=r;for(;r<e.length;r++)if(e[r]=="?"||e[r]==" "){const a=e.substr(i,r-i);if(r>5&&a==="xml")return _e("InvalidXml","XML declaration allowed only at the start of the document.",je(e,r));if(e[r]=="?"&&e[r+1]==">"){r++;break}else continue}return r}function Ro(e,r){if(e.length>r+5&&e[r+1]==="-"&&e[r+2]==="-"){for(r+=3;r<e.length;r++)if(e[r]==="-"&&e[r+1]==="-"&&e[r+2]===">"){r+=2;break}}else if(e.length>r+8&&e[r+1]==="D"&&e[r+2]==="O"&&e[r+3]==="C"&&e[r+4]==="T"&&e[r+5]==="Y"&&e[r+6]==="P"&&e[r+7]==="E"){let i=1;for(r+=8;r<e.length;r++)if(e[r]==="<")i++;else if(e[r]===">"&&(i--,i===0))break}else if(e.length>r+9&&e[r+1]==="["&&e[r+2]==="C"&&e[r+3]==="D"&&e[r+4]==="A"&&e[r+5]==="T"&&e[r+6]==="A"&&e[r+7]==="["){for(r+=8;r<e.length;r++)if(e[r]==="]"&&e[r+1]==="]"&&e[r+2]===">"){r+=2;break}}return r}const Ta='"',_a="'";function Ca(e,r){let i="",a="",c=!1;for(;r<e.length;r++){if(e[r]===Ta||e[r]===_a)a===""?a=e[r]:a!==e[r]||(a="");else if(e[r]===">"&&a===""){c=!0;break}i+=e[r]}return a!==""?!1:{value:i,index:r,tagClosed:c}}const ka=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function Ao(e,r){const i=Po(e,ka),a={};for(let c=0;c<i.length;c++){if(i[c][1].length===0)return _e("InvalidAttr","Attribute '"+i[c][2]+"' has no space in starting.",wt(i[c]));if(i[c][3]!==void 0&&i[c][4]===void 0)return _e("InvalidAttr","Attribute '"+i[c][2]+"' is without value.",wt(i[c]));if(i[c][3]===void 0&&!r.allowBooleanAttributes)return _e("InvalidAttr","boolean attribute '"+i[c][2]+"' is not allowed.",wt(i[c]));const u=i[c][2];if(!Ia(u))return _e("InvalidAttr","Attribute '"+u+"' is an invalid name.",wt(i[c]));if(!a.hasOwnProperty(u))a[u]=1;else return _e("InvalidAttr","Attribute '"+u+"' is repeated.",wt(i[c]))}return!0}function Oa(e,r){let i=/\d/;for(e[r]==="x"&&(r++,i=/[\da-fA-F]/);r<e.length;r++){if(e[r]===";")return r;if(!e[r].match(i))break}return-1}function Pa(e,r){if(r++,e[r]===";")return-1;if(e[r]==="#")return r++,Oa(e,r);let i=0;for(;r<e.length;r++,i++)if(!(e[r].match(/\w/)&&i<20)){if(e[r]===";")break;return-1}return r}function _e(e,r,i){return{err:{code:e,msg:r,line:i.line||i,col:i.col}}}function Ia(e){return fn(e)}function ja(e){return fn(e)}function je(e,r){const i=e.substring(0,r).split(/\r?\n/);return{line:i.length,col:i[i.length-1].length+1}}function wt(e){return e.startIndex+e[1].length}const Ra={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(e,r){return r},attributeValueProcessor:function(e,r){return r},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(e,r,i){return e},captureMetaData:!1},Aa=function(e){return Object.assign({},Ra,e)};let dn;typeof Symbol!="function"?dn="@@xmlMetadata":dn=Symbol("XML Node Metadata");class $e{constructor(r){this.tagname=r,this.child=[],this[":@"]={}}add(r,i){r==="__proto__"&&(r="#__proto__"),this.child.push({[r]:i})}addChild(r,i){r.tagname==="__proto__"&&(r.tagname="#__proto__"),r[":@"]&&Object.keys(r[":@"]).length>0?this.child.push({[r.tagname]:r.child,":@":r[":@"]}):this.child.push({[r.tagname]:r.child}),i!==void 0&&(this.child[this.child.length-1][dn]={startIndex:i})}static getMetaDataSymbol(){return dn}}class Ma{constructor(r){this.suppressValidationErr=!r}readDocType(r,i){const a={};if(r[i+3]==="O"&&r[i+4]==="C"&&r[i+5]==="T"&&r[i+6]==="Y"&&r[i+7]==="P"&&r[i+8]==="E"){i=i+9;let c=1,u=!1,d=!1;for(;i<r.length;i++)if(r[i]==="<"&&!d){if(u&&qe(r,"!ENTITY",i)){i+=7;let g,m;[g,m,i]=this.readEntityExp(r,i+1,this.suppressValidationErr),m.indexOf("&")===-1&&(a[g]={regx:RegExp(`&${g};`,"g"),val:m})}else if(u&&qe(r,"!ELEMENT",i)){i+=8;const{index:g}=this.readElementExp(r,i+1);i=g}else if(u&&qe(r,"!ATTLIST",i))i+=8;else if(u&&qe(r,"!NOTATION",i)){i+=9;const{index:g}=this.readNotationExp(r,i+1,this.suppressValidationErr);i=g}else if(qe(r,"!--",i))d=!0;else throw new Error("Invalid DOCTYPE");c++}else if(r[i]===">"){if(d?r[i-1]==="-"&&r[i-2]==="-"&&(d=!1,c--):c--,c===0)break}else r[i]==="["&&(u=!0);if(c!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:a,i}}readEntityExp(r,i){i=Me(r,i);let a="";for(;i<r.length&&!/\s/.test(r[i])&&r[i]!=='"'&&r[i]!=="'";)a+=r[i],i++;if(xt(a),i=Me(r,i),!this.suppressValidationErr){if(r.substring(i,i+6).toUpperCase()==="SYSTEM")throw new Error("External entities are not supported");if(r[i]==="%")throw new Error("Parameter entities are not supported")}let c="";return[i,c]=this.readIdentifierVal(r,i,"entity"),i--,[a,c,i]}readNotationExp(r,i){i=Me(r,i);let a="";for(;i<r.length&&!/\s/.test(r[i]);)a+=r[i],i++;!this.suppressValidationErr&&xt(a),i=Me(r,i);const c=r.substring(i,i+6).toUpperCase();if(!this.suppressValidationErr&&c!=="SYSTEM"&&c!=="PUBLIC")throw new Error(`Expected SYSTEM or PUBLIC, found "${c}"`);i+=c.length,i=Me(r,i);let u=null,d=null;if(c==="PUBLIC")[i,u]=this.readIdentifierVal(r,i,"publicIdentifier"),i=Me(r,i),(r[i]==='"'||r[i]==="'")&&([i,d]=this.readIdentifierVal(r,i,"systemIdentifier"));else if(c==="SYSTEM"&&([i,d]=this.readIdentifierVal(r,i,"systemIdentifier"),!this.suppressValidationErr&&!d))throw new Error("Missing mandatory system identifier for SYSTEM notation");return{notationName:a,publicIdentifier:u,systemIdentifier:d,index:--i}}readIdentifierVal(r,i,a){let c="";const u=r[i];if(u!=='"'&&u!=="'")throw new Error(`Expected quoted string, found "${u}"`);for(i++;i<r.length&&r[i]!==u;)c+=r[i],i++;if(r[i]!==u)throw new Error(`Unterminated ${a} value`);return i++,[i,c]}readElementExp(r,i){i=Me(r,i);let a="";for(;i<r.length&&!/\s/.test(r[i]);)a+=r[i],i++;if(!this.suppressValidationErr&&!fn(a))throw new Error(`Invalid element name: "${a}"`);i=Me(r,i);let c="";if(r[i]==="E"&&qe(r,"MPTY",i))i+=4;else if(r[i]==="A"&&qe(r,"NY",i))i+=2;else if(r[i]==="("){for(i++;i<r.length&&r[i]!==")";)c+=r[i],i++;if(r[i]!==")")throw new Error("Unterminated content model")}else if(!this.suppressValidationErr)throw new Error(`Invalid Element Expression, found "${r[i]}"`);return{elementName:a,contentModel:c.trim(),index:i}}readAttlistExp(r,i){i=Me(r,i);let a="";for(;i<r.length&&!/\s/.test(r[i]);)a+=r[i],i++;xt(a),i=Me(r,i);let c="";for(;i<r.length&&!/\s/.test(r[i]);)c+=r[i],i++;if(!xt(c))throw new Error(`Invalid attribute name: "${c}"`);i=Me(r,i);let u="";if(r.substring(i,i+8).toUpperCase()==="NOTATION"){if(u="NOTATION",i+=8,i=Me(r,i),r[i]!=="(")throw new Error(`Expected '(', found "${r[i]}"`);i++;let g=[];for(;i<r.length&&r[i]!==")";){let m="";for(;i<r.length&&r[i]!=="|"&&r[i]!==")";)m+=r[i],i++;if(m=m.trim(),!xt(m))throw new Error(`Invalid notation name: "${m}"`);g.push(m),r[i]==="|"&&(i++,i=Me(r,i))}if(r[i]!==")")throw new Error("Unterminated list of notations");i++,u+=" ("+g.join("|")+")"}else{for(;i<r.length&&!/\s/.test(r[i]);)u+=r[i],i++;const g=["CDATA","ID","IDREF","IDREFS","ENTITY","ENTITIES","NMTOKEN","NMTOKENS"];if(!this.suppressValidationErr&&!g.includes(u.toUpperCase()))throw new Error(`Invalid attribute type: "${u}"`)}i=Me(r,i);let d="";return r.substring(i,i+8).toUpperCase()==="#REQUIRED"?(d="#REQUIRED",i+=8):r.substring(i,i+7).toUpperCase()==="#IMPLIED"?(d="#IMPLIED",i+=7):[i,d]=this.readIdentifierVal(r,i,"ATTLIST"),{elementName:a,attributeName:c,attributeType:u,defaultValue:d,index:i}}}const Me=(e,r)=>{for(;r<e.length&&/\s/.test(e[r]);)r++;return r};function qe(e,r,i){for(let a=0;a<r.length;a++)if(r[a]!==e[i+a+1])return!1;return!0}function xt(e){if(fn(e))return e;throw new Error(`Invalid entity name ${e}`)}const La=/^[-+]?0x[a-fA-F0-9]+$/,za=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,Fa={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};function Va(e,r={}){if(r=Object.assign({},Fa,r),!e||typeof e!="string")return e;let i=e.trim();if(r.skipLike!==void 0&&r.skipLike.test(i))return e;if(e==="0")return 0;if(r.hex&&La.test(i))return Ya(i,16);if(i.includes("e")||i.includes("E"))return Ba(e,i,r);{const a=za.exec(i);if(a){const c=a[1]||"",u=a[2];let d=Ha(a[3]);const g=c?e[u.length+1]===".":e[u.length]===".";if(!r.leadingZeros&&(u.length>1||u.length===1&&!g))return e;{const m=Number(i),b=String(m);if(m===0)return m;if(b.search(/[eE]/)!==-1)return r.eNotation?m:e;if(i.indexOf(".")!==-1)return b==="0"||b===d||b===`${c}${d}`?m:e;let C=u?d:i;return u?C===b||c+C===b?m:e:C===b||C===c+b?m:e}}else return e}}const Da=/^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;function Ba(e,r,i){if(!i.eNotation)return e;const a=r.match(Da);if(a){let c=a[1]||"";const u=a[3].indexOf("e")===-1?"E":"e",d=a[2],g=c?e[d.length+1]===u:e[d.length]===u;return d.length>1&&g?e:d.length===1&&(a[3].startsWith(`.${u}`)||a[3][0]===u)?Number(r):i.leadingZeros&&!g?(r=(a[1]||"")+a[3],Number(r)):e}else return e}function Ha(e){return e&&e.indexOf(".")!==-1&&(e=e.replace(/0+$/,""),e==="."?e="0":e[0]==="."?e="0"+e:e[e.length-1]==="."&&(e=e.substring(0,e.length-1))),e}function Ya(e,r){if(parseInt)return parseInt(e,r);if(Number.parseInt)return Number.parseInt(e,r);if(window&&window.parseInt)return window.parseInt(e,r);throw new Error("parseInt, Number.parseInt, window.parseInt are not supported")}function Mo(e){return typeof e=="function"?e:Array.isArray(e)?r=>{for(const i of e)if(typeof i=="string"&&r===i||i instanceof RegExp&&i.test(r))return!0}:()=>!1}class Xa{constructor(r){if(this.options=r,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"},num_dec:{regex:/&#([0-9]{1,7});/g,val:(i,a)=>String.fromCodePoint(Number.parseInt(a,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(i,a)=>String.fromCodePoint(Number.parseInt(a,16))}},this.addExternalEntities=Ua,this.parseXml=Za,this.parseTextData=Ka,this.resolveNameSpace=Ga,this.buildAttributesMap=Ja,this.isItStopNode=ec,this.replaceEntitiesValue=$a,this.readStopNodeData=nc,this.saveTextToParentTag=qa,this.addChild=Qa,this.ignoreAttributesFn=Mo(this.options.ignoreAttributes),this.options.stopNodes&&this.options.stopNodes.length>0){this.stopNodesExact=new Set,this.stopNodesWildcard=new Set;for(let i=0;i<this.options.stopNodes.length;i++){const a=this.options.stopNodes[i];typeof a=="string"&&(a.startsWith("*.")?this.stopNodesWildcard.add(a.substring(2)):this.stopNodesExact.add(a))}}}}function Ua(e){const r=Object.keys(e);for(let i=0;i<r.length;i++){const a=r[i];this.lastEntities[a]={regex:new RegExp("&"+a+";","g"),val:e[a]}}}function Ka(e,r,i,a,c,u,d){if(e!==void 0&&(this.options.trimValues&&!a&&(e=e.trim()),e.length>0)){d||(e=this.replaceEntitiesValue(e));const g=this.options.tagValueProcessor(r,e,i,c,u);return g==null?e:typeof g!=typeof e||g!==e?g:this.options.trimValues?ar(e,this.options.parseTagValue,this.options.numberParseOptions):e.trim()===e?ar(e,this.options.parseTagValue,this.options.numberParseOptions):e}}function Ga(e){if(this.options.removeNSPrefix){const r=e.split(":"),i=e.charAt(0)==="/"?"/":"";if(r[0]==="xmlns")return"";r.length===2&&(e=i+r[1])}return e}const Wa=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function Ja(e,r){if(this.options.ignoreAttributes!==!0&&typeof e=="string"){const i=Po(e,Wa),a=i.length,c={};for(let u=0;u<a;u++){const d=this.resolveNameSpace(i[u][1]);if(this.ignoreAttributesFn(d,r))continue;let g=i[u][4],m=this.options.attributeNamePrefix+d;if(d.length)if(this.options.transformAttributeName&&(m=this.options.transformAttributeName(m)),m==="__proto__"&&(m="#__proto__"),g!==void 0){this.options.trimValues&&(g=g.trim()),g=this.replaceEntitiesValue(g);const b=this.options.attributeValueProcessor(d,g,r);b==null?c[m]=g:typeof b!=typeof g||b!==g?c[m]=b:c[m]=ar(g,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(c[m]=!0)}if(!Object.keys(c).length)return;if(this.options.attributesGroupName){const u={};return u[this.options.attributesGroupName]=c,u}return c}}const Za=function(e){e=e.replace(/\r\n?/g,`
9
9
  `);const r=new $e("!xml");let i=r,a="",c="";const u=new Ma(this.options.processEntities);for(let d=0;d<e.length;d++)if(e[d]==="<")if(e[d+1]==="/"){const m=et(e,">",d,"Closing Tag is not closed.");let b=e.substring(d+2,m).trim();if(this.options.removeNSPrefix){const P=b.indexOf(":");P!==-1&&(b=b.substr(P+1))}this.options.transformTagName&&(b=this.options.transformTagName(b)),i&&(a=this.saveTextToParentTag(a,i,c));const C=c.substring(c.lastIndexOf(".")+1);if(b&&this.options.unpairedTags.indexOf(b)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: </${b}>`);let _=0;C&&this.options.unpairedTags.indexOf(C)!==-1?(_=c.lastIndexOf(".",c.lastIndexOf(".")-1),this.tagsNodeStack.pop()):_=c.lastIndexOf("."),c=c.substring(0,_),i=this.tagsNodeStack.pop(),a="",d=m}else if(e[d+1]==="?"){let m=sr(e,d,!1,"?>");if(!m)throw new Error("Pi Tag is not closed.");if(a=this.saveTextToParentTag(a,i,c),!(this.options.ignoreDeclaration&&m.tagName==="?xml"||this.options.ignorePiTags)){const b=new $e(m.tagName);b.add(this.options.textNodeName,""),m.tagName!==m.tagExp&&m.attrExpPresent&&(b[":@"]=this.buildAttributesMap(m.tagExp,c)),this.addChild(i,b,c,d)}d=m.closeIndex+1}else if(e.substr(d+1,3)==="!--"){const m=et(e,"-->",d+4,"Comment is not closed.");if(this.options.commentPropName){const b=e.substring(d+4,m-2);a=this.saveTextToParentTag(a,i,c),i.add(this.options.commentPropName,[{[this.options.textNodeName]:b}])}d=m}else if(e.substr(d+1,2)==="!D"){const m=u.readDocType(e,d);this.docTypeEntities=m.entities,d=m.i}else if(e.substr(d+1,2)==="!["){const m=et(e,"]]>",d,"CDATA is not closed.")-2,b=e.substring(d+9,m);a=this.saveTextToParentTag(a,i,c);let C=this.parseTextData(b,i.tagname,c,!0,!1,!0,!0);C==null&&(C=""),this.options.cdataPropName?i.add(this.options.cdataPropName,[{[this.options.textNodeName]:b}]):i.add(this.options.textNodeName,C),d=m+2}else{let m=sr(e,d,this.options.removeNSPrefix),b=m.tagName;const C=m.rawTagName;let _=m.tagExp,P=m.attrExpPresent,R=m.closeIndex;if(this.options.transformTagName){const j=this.options.transformTagName(b);_===b&&(_=j),b=j}i&&a&&i.tagname!=="!xml"&&(a=this.saveTextToParentTag(a,i,c,!1));const M=i;M&&this.options.unpairedTags.indexOf(M.tagname)!==-1&&(i=this.tagsNodeStack.pop(),c=c.substring(0,c.lastIndexOf("."))),b!==r.tagname&&(c+=c?"."+b:b);const T=d;if(this.isItStopNode(this.stopNodesExact,this.stopNodesWildcard,c,b)){let j="";if(_.length>0&&_.lastIndexOf("/")===_.length-1)b[b.length-1]==="/"?(b=b.substr(0,b.length-1),c=c.substr(0,c.length-1),_=b):_=_.substr(0,_.length-1),d=m.closeIndex;else if(this.options.unpairedTags.indexOf(b)!==-1)d=m.closeIndex;else{const q=this.readStopNodeData(e,C,R+1);if(!q)throw new Error(`Unexpected end of ${C}`);d=q.i,j=q.tagContent}const Z=new $e(b);b!==_&&P&&(Z[":@"]=this.buildAttributesMap(_,c)),j&&(j=this.parseTextData(j,b,c,!0,P,!0,!0)),c=c.substr(0,c.lastIndexOf(".")),Z.add(this.options.textNodeName,j),this.addChild(i,Z,c,T)}else{if(_.length>0&&_.lastIndexOf("/")===_.length-1){if(b[b.length-1]==="/"?(b=b.substr(0,b.length-1),c=c.substr(0,c.length-1),_=b):_=_.substr(0,_.length-1),this.options.transformTagName){const Z=this.options.transformTagName(b);_===b&&(_=Z),b=Z}const j=new $e(b);b!==_&&P&&(j[":@"]=this.buildAttributesMap(_,c)),this.addChild(i,j,c,T),c=c.substr(0,c.lastIndexOf("."))}else{const j=new $e(b);this.tagsNodeStack.push(i),b!==_&&P&&(j[":@"]=this.buildAttributesMap(_,c)),this.addChild(i,j,c,T),i=j}a="",d=R}}else a+=e[d];return r.child};function Qa(e,r,i,a){this.options.captureMetaData||(a=void 0);const c=this.options.updateTag(r.tagname,i,r[":@"]);c===!1||(typeof c=="string"&&(r.tagname=c),e.addChild(r,a))}const $a=function(e){if(this.options.processEntities){for(let r in this.docTypeEntities){const i=this.docTypeEntities[r];e=e.replace(i.regx,i.val)}for(let r in this.lastEntities){const i=this.lastEntities[r];e=e.replace(i.regex,i.val)}if(this.options.htmlEntities)for(let r in this.htmlEntities){const i=this.htmlEntities[r];e=e.replace(i.regex,i.val)}e=e.replace(this.ampEntity.regex,this.ampEntity.val)}return e};function qa(e,r,i,a){return e&&(a===void 0&&(a=r.child.length===0),e=this.parseTextData(e,r.tagname,i,!1,r[":@"]?Object.keys(r[":@"]).length!==0:!1,a),e!==void 0&&e!==""&&r.add(this.options.textNodeName,e),e=""),e}function ec(e,r,i,a){return!!(r&&r.has(a)||e&&e.has(i))}function tc(e,r,i=">"){let a,c="";for(let u=r;u<e.length;u++){let d=e[u];if(a)d===a&&(a="");else if(d==='"'||d==="'")a=d;else if(d===i[0])if(i[1]){if(e[u+1]===i[1])return{data:c,index:u}}else return{data:c,index:u};else d===" "&&(d=" ");c+=d}}function et(e,r,i,a){const c=e.indexOf(r,i);if(c===-1)throw new Error(a);return c+r.length-1}function sr(e,r,i,a=">"){const c=tc(e,r+1,a);if(!c)return;let u=c.data;const d=c.index,g=u.search(/\s/);let m=u,b=!0;g!==-1&&(m=u.substring(0,g),u=u.substring(g+1).trimStart());const C=m;if(i){const _=m.indexOf(":");_!==-1&&(m=m.substr(_+1),b=m!==c.data.substr(_+1))}return{tagName:m,tagExp:u,closeIndex:d,attrExpPresent:b,rawTagName:C}}function nc(e,r,i){const a=i;let c=1;for(;i<e.length;i++)if(e[i]==="<")if(e[i+1]==="/"){const u=et(e,">",i,`${r} is not closed`);if(e.substring(i+2,u).trim()===r&&(c--,c===0))return{tagContent:e.substring(a,i),i:u};i=u}else if(e[i+1]==="?")i=et(e,"?>",i+1,"StopNode is not closed.");else if(e.substr(i+1,3)==="!--")i=et(e,"-->",i+3,"StopNode is not closed.");else if(e.substr(i+1,2)==="![")i=et(e,"]]>",i,"StopNode is not closed.")-2;else{const u=sr(e,i,">");u&&((u&&u.tagName)===r&&u.tagExp[u.tagExp.length-1]!=="/"&&c++,i=u.closeIndex)}}function ar(e,r,i){if(r&&typeof e=="string"){const a=e.trim();return a==="true"?!0:a==="false"?!1:Va(e,i)}else return Ea(e)?e:""}const cr=$e.getMetaDataSymbol();function rc(e,r){return Lo(e,r)}function Lo(e,r,i){let a;const c={};for(let u=0;u<e.length;u++){const d=e[u],g=oc(d);let m="";if(i===void 0?m=g:m=i+"."+g,g===r.textNodeName)a===void 0?a=d[g]:a+=""+d[g];else{if(g===void 0)continue;if(d[g]){let b=Lo(d[g],r,m);const C=sc(b,r);d[cr]!==void 0&&(b[cr]=d[cr]),d[":@"]?ic(b,d[":@"],m,r):Object.keys(b).length===1&&b[r.textNodeName]!==void 0&&!r.alwaysCreateTextNode?b=b[r.textNodeName]:Object.keys(b).length===0&&(r.alwaysCreateTextNode?b[r.textNodeName]="":b=""),c[g]!==void 0&&c.hasOwnProperty(g)?(Array.isArray(c[g])||(c[g]=[c[g]]),c[g].push(b)):r.isArray(g,m,C)?c[g]=[b]:c[g]=b}}}return typeof a=="string"?a.length>0&&(c[r.textNodeName]=a):a!==void 0&&(c[r.textNodeName]=a),c}function oc(e){const r=Object.keys(e);for(let i=0;i<r.length;i++){const a=r[i];if(a!==":@")return a}}function ic(e,r,i,a){if(r){const c=Object.keys(r),u=c.length;for(let d=0;d<u;d++){const g=c[d];a.isArray(g,i+"."+g,!0,!0)?e[g]=[r[g]]:e[g]=r[g]}}}function sc(e,r){const{textNodeName:i}=r,a=Object.keys(e).length;return!!(a===0||a===1&&(e[i]||typeof e[i]=="boolean"||e[i]===0))}class ac{constructor(r){this.externalEntities={},this.options=Aa(r)}parse(r,i){if(typeof r!="string"&&r.toString)r=r.toString();else if(typeof r!="string")throw new Error("XML data is accepted in String or Bytes[] form.");if(i){i===!0&&(i={});const u=Sa(r,i);if(u!==!0)throw Error(`${u.err.msg}:${u.err.line}:${u.err.col}`)}const a=new Xa(this.options);a.addExternalEntities(this.externalEntities);const c=a.parseXml(r);return this.options.preserveOrder||c===void 0?c:rc(c,this.options)}addEntity(r,i){if(i.indexOf("&")!==-1)throw new Error("Entity value can't have '&'");if(r.indexOf("&")!==-1||r.indexOf(";")!==-1)throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");if(i==="&")throw new Error("An entity with value '&' is not permitted");this.externalEntities[r]=i}static getMetaDataSymbol(){return $e.getMetaDataSymbol()}}const cc=`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "etudes",
3
- "version": "23.4.1",
3
+ "version": "23.4.2",
4
4
  "description": "A study of headless React components",
5
5
  "type": "module",
6
6
  "main": "./build/etudes.umd.cjs",