etudes 22.2.0 → 22.3.0

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.
@@ -1,12 +1,12 @@
1
- (function(H,N){typeof exports=="object"&&typeof module<"u"?N(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],N):(H=typeof globalThis<"u"?globalThis:H||self,N(H.etudes={},H.React))})(this,(function(H,N){"use strict";function Rr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Vt={exports:{}},ft={};var Ar;function Ki(){if(Ar)return ft;Ar=1;var e=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function i(a,c,u){var d=null;if(u!==void 0&&(d=""+u),c.key!==void 0&&(d=""+c.key),"key"in c){u={};for(var g in c)g!=="key"&&(u[g]=c[g])}else u=c;return c=u.ref,{$$typeof:e,type:a,key:d,ref:c!==void 0?c:null,props:u}}return ft.Fragment=r,ft.jsx=i,ft.jsxs=i,ft}var dt={};var Mr;function Gi(){return Mr||(Mr=1,process.env.NODE_ENV!=="production"&&(function(){function e(I){if(I==null)return null;if(typeof I=="function")return I.$$typeof===se?null:I.displayName||I.name||null;if(typeof I=="string")return I;switch(I){case j:return"Fragment";case $:return"Profiler";case Q:return"StrictMode";case k:return"Suspense";case E:return"SuspenseList";case J:return"Activity"}if(typeof I=="object")switch(typeof I.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),I.$$typeof){case _:return"Portal";case q:return I.displayName||"Context";case K:return(I._context.displayName||"Context")+".Consumer";case w:var W=I.render;return I=I.displayName,I||(I=W.displayName||W.name||"",I=I!==""?"ForwardRef("+I+")":"ForwardRef"),I;case z:return W=I.displayName||null,W!==null?W:e(I.type)||"Memo";case X:W=I._payload,I=I._init;try{return e(I(W))}catch{}}return null}function r(I){return""+I}function i(I){try{var W=!1}catch{W=!0}if(W){W=console;var ee=W.error,Z=typeof Symbol=="function"&&Symbol.toStringTag&&I[Symbol.toStringTag]||I.constructor.name||"Object";return ee.call(W,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",Z),r(I)}}function a(I){if(I===j)return"<>";if(typeof I=="object"&&I!==null&&I.$$typeof===X)return"<...>";try{var W=e(I);return W?"<"+W+">":"<...>"}catch{return"<...>"}}function c(){var I=te.A;return I===null?null:I.getOwner()}function u(){return Error("react-stack-top-frame")}function d(I){if(G.call(I,"key")){var W=Object.getOwnPropertyDescriptor(I,"key").get;if(W&&W.isReactWarning)return!1}return I.key!==void 0}function g(I,W){function ee(){re||(re=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",W))}ee.isReactWarning=!0,Object.defineProperty(I,"key",{get:ee,configurable:!0})}function m(){var I=e(this.type);return oe[I]||(oe[I]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),I=this.props.ref,I!==void 0?I:null}function b(I,W,ee,Z,pe,ve){var de=ee.ref;return I={$$typeof:M,type:I,key:W,props:ee,_owner:Z},(de!==void 0?de:null)!==null?Object.defineProperty(I,"ref",{enumerable:!1,get:m}):Object.defineProperty(I,"ref",{enumerable:!1,value:null}),I._store={},Object.defineProperty(I._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(I,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(I,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:pe}),Object.defineProperty(I,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:ve}),Object.freeze&&(Object.freeze(I.props),Object.freeze(I)),I}function C(I,W,ee,Z,pe,ve){var de=W.children;if(de!==void 0)if(Z)if(Y(de)){for(Z=0;Z<de.length;Z++)T(de[Z]);Object.freeze&&Object.freeze(de)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else T(de);if(G.call(W,"key")){de=e(I);var Ne=Object.keys(W).filter(function(Ve){return Ve!=="key"});Z=0<Ne.length?"{key: someKey, "+Ne.join(": ..., ")+": ...}":"{key: someKey}",L[de+Z]||(Ne=0<Ne.length?"{"+Ne.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
1
+ (function(D,N){typeof exports=="object"&&typeof module<"u"?N(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],N):(D=typeof globalThis<"u"?globalThis:D||self,N(D.etudes={},D.React))})(this,(function(D,N){"use strict";function Rr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Vt={exports:{}},ft={};var Ar;function Ki(){if(Ar)return ft;Ar=1;var e=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function i(a,c,u){var d=null;if(u!==void 0&&(d=""+u),c.key!==void 0&&(d=""+c.key),"key"in c){u={};for(var g in c)g!=="key"&&(u[g]=c[g])}else u=c;return c=u.ref,{$$typeof:e,type:a,key:d,ref:c!==void 0?c:null,props:u}}return ft.Fragment=r,ft.jsx=i,ft.jsxs=i,ft}var dt={};var Mr;function Gi(){return Mr||(Mr=1,process.env.NODE_ENV!=="production"&&(function(){function e(I){if(I==null)return null;if(typeof I=="function")return I.$$typeof===se?null:I.displayName||I.name||null;if(typeof I=="string")return I;switch(I){case j:return"Fragment";case $:return"Profiler";case Q:return"StrictMode";case O:return"Suspense";case E:return"SuspenseList";case J:return"Activity"}if(typeof I=="object")switch(typeof I.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),I.$$typeof){case T:return"Portal";case q:return I.displayName||"Context";case K:return(I._context.displayName||"Context")+".Consumer";case w:var W=I.render;return I=I.displayName,I||(I=W.displayName||W.name||"",I=I!==""?"ForwardRef("+I+")":"ForwardRef"),I;case z:return W=I.displayName||null,W!==null?W:e(I.type)||"Memo";case X:W=I._payload,I=I._init;try{return e(I(W))}catch{}}return null}function r(I){return""+I}function i(I){try{var W=!1}catch{W=!0}if(W){W=console;var ee=W.error,Z=typeof Symbol=="function"&&Symbol.toStringTag&&I[Symbol.toStringTag]||I.constructor.name||"Object";return ee.call(W,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",Z),r(I)}}function a(I){if(I===j)return"<>";if(typeof I=="object"&&I!==null&&I.$$typeof===X)return"<...>";try{var W=e(I);return W?"<"+W+">":"<...>"}catch{return"<...>"}}function c(){var I=te.A;return I===null?null:I.getOwner()}function u(){return Error("react-stack-top-frame")}function d(I){if(G.call(I,"key")){var W=Object.getOwnPropertyDescriptor(I,"key").get;if(W&&W.isReactWarning)return!1}return I.key!==void 0}function g(I,W){function ee(){re||(re=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",W))}ee.isReactWarning=!0,Object.defineProperty(I,"key",{get:ee,configurable:!0})}function m(){var I=e(this.type);return oe[I]||(oe[I]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),I=this.props.ref,I!==void 0?I:null}function b(I,W,ee,Z,pe,ve){var de=ee.ref;return I={$$typeof:M,type:I,key:W,props:ee,_owner:Z},(de!==void 0?de:null)!==null?Object.defineProperty(I,"ref",{enumerable:!1,get:m}):Object.defineProperty(I,"ref",{enumerable:!1,value:null}),I._store={},Object.defineProperty(I._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(I,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(I,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:pe}),Object.defineProperty(I,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:ve}),Object.freeze&&(Object.freeze(I.props),Object.freeze(I)),I}function C(I,W,ee,Z,pe,ve){var de=W.children;if(de!==void 0)if(Z)if(Y(de)){for(Z=0;Z<de.length;Z++)_(de[Z]);Object.freeze&&Object.freeze(de)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else _(de);if(G.call(W,"key")){de=e(I);var Ne=Object.keys(W).filter(function(Ve){return Ve!=="key"});Z=0<Ne.length?"{key: someKey, "+Ne.join(": ..., ")+": ...}":"{key: someKey}",L[de+Z]||(Ne=0<Ne.length?"{"+Ne.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
2
2
  let props = %s;
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} />`,Z,de,Ne,de),L[de+Z]=!0)}if(de=null,ee!==void 0&&(i(ee),de=""+ee),d(W)&&(i(W.key),de=""+W.key),"key"in W){ee={};for(var ne in W)ne!=="key"&&(ee[ne]=W[ne])}else ee=W;return de&&g(ee,typeof I=="function"?I.displayName||I.name||"Unknown":I),b(I,de,ee,c(),pe,ve)}function T(I){P(I)?I._store&&(I._store.validated=1):typeof I=="object"&&I!==null&&I.$$typeof===X&&(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"),_=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),Q=Symbol.for("react.strict_mode"),$=Symbol.for("react.profiler"),K=Symbol.for("react.consumer"),q=Symbol.for("react.context"),w=Symbol.for("react.forward_ref"),k=Symbol.for("react.suspense"),E=Symbol.for("react.suspense_list"),z=Symbol.for("react.memo"),X=Symbol.for("react.lazy"),J=Symbol.for("react.activity"),se=Symbol.for("react.client.reference"),te=R.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G=Object.prototype.hasOwnProperty,Y=Array.isArray,F=console.createTask?console.createTask:function(){return null};R={react_stack_bottom_frame:function(I){return I()}};var re,oe={},le=R.react_stack_bottom_frame.bind(R,u)(),D=F(a(u)),L={};dt.Fragment=j,dt.jsx=function(I,W,ee){var Z=1e4>te.recentlyCreatedOwnerStacks++;return C(I,W,ee,!1,Z?Error("react-stack-top-frame"):le,Z?F(a(I)):D)},dt.jsxs=function(I,W,ee){var Z=1e4>te.recentlyCreatedOwnerStacks++;return C(I,W,ee,!0,Z?Error("react-stack-top-frame"):le,Z?F(a(I)):D)}})()),dt}var zr;function Wi(){return zr||(zr=1,process.env.NODE_ENV==="production"?Vt.exports=Ki():Vt.exports=Gi()),Vt.exports}var x=Wi();function Lr(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=Lr(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=Lr(e))&&(a&&(a+=" "),a+=r);return a}function pt({count:e=1,children:r,render:i}){return x.jsx(x.Fragment,{children:[...Array(e)].map((a,c)=>x.jsx(N.Fragment,{children:i?.(c)??(typeof r=="function"?r(c):r)},`element-${c}`))})}process.env.NODE_ENV==="development"&&(pt.displayName="Repeat");function Dt(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 Dt(r,i,...e?Array.isArray(e)?e:[e]:[])}process.env.NODE_ENV==="development"&&(me.displayName="Styled");function Ji(e){return e}function Oe(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 ue(...e){return e.reduce((r,i)=>({...r,...i||{}}),{})}const Fr=N.forwardRef(({children:e,className:r,isActive:i=!1,isTailHidden:a=!1,isSplit:c=!1,numberOfBars:u=3,...d},g)=>{const m=Oe(e,{bar:Bt}),b={root:ce({active:i}),bar:ce({active:i})},C=Qi({isSplit:c,isActive:i,isTailHidden:a});return x.jsx("div",{...d,ref:g,className:ce(r,b.root),children:x.jsx(pt,{count:c?2:1,children:T=>x.jsx("div",{"aria-hidden":!0,style:ue(C.section,C[`section${T}`]),children:x.jsx(pt,{count:u,children:P=>x.jsx(me,{"aria-hidden":!0,className:ce(b.bar),element:m.bar??x.jsx(Bt,{}),style:(()=>{switch(u){case 2:return ue(C.bar,C[`bar${T}${P===0?0:2}`]);case 3:default:return ue(C.bar,C[`bar${T}${P}`])}})()})})})})})}),Bt=({...e})=>x.jsx("span",{...e}),Mn=Object.assign(Fr,{Bar:Bt});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"&&(Fr.displayName="Burger",Bt.displayName="Burger.Bar");const Vr=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},T)=>{const P=()=>{const _=!a;b?.(_),_?g?.():m?.()},R={root:ce({active:a})},M=qi();return x.jsx("button",{...C,ref:T,"aria-expanded":a,className:ce(r,R.root),style:ue(i,M.root),onClick:P,children:x.jsx(Mn,{isActive:a,isSplit:u,isTailHidden:c,numberOfBars:d,children:e})})}),Dr=Mn.Bar,$i=Object.assign(Vr,{Bar:Dr});function qi(){return{root:{background:"transparent",border:"none",display:"block",outline:"none"}}}process.env.NODE_ENV==="development"&&(Vr.displayName="BurgerButton",Dr.displayName="BurgerButton.Bar");var Se;(e=>{e.zero=r();function r(_=0,j=0){if(typeof _=="number")return{x:_,y:j};if(!P(_))throw Error("Invalid parameters passed to constructor");return _ instanceof Array?{x:_[0],y:_[1]}:{x:_.x,y:_.y}}e.make=r;function i(_,j={}){return r({x:typeof j.x=="number"?j.x:_.x,y:typeof j.y=="number"?j.y:_.y})}e.clone=i;function a(_,j){return r({x:_.x+j.x,y:_.y+j.y})}e.add=a;function c(_,j){return r({x:_.x-j.x,y:_.y-j.y})}e.subtract=c;function u(_,j){return r({x:_.x*j.x,y:_.y*j.y})}e.multiply=u;function d(_,j){return r({x:_.x/j.x,y:_.y/j.y})}e.divide=d;function g(_){return r({x:_.y,y:_.x})}e.reflect=g;function m(_,j){return!(_.x!==j.x||_.y!==j.y)}e.isEqual=m;function b(_){return`Point(x=${_.x}, y=${_.y})`}e.toString=b;function C(_){return Object.freeze({x:_.x,y:_.y})}e.toJSON=C;function T(_){return[_.x,_.y]}e.toArray=T;function P(_){return _ instanceof Array?!(_.length!==2||typeof _[0]!="number"||typeof _[1]!="number"):typeof _=="object"?!(typeof _.x!="number"||typeof _.y!="number"):!1}e.isValidDescriptor=P;function R(_){return typeof _=="object"&&typeof _.x=="number"&&typeof _.y=="number"}e.isPoint=R;function M(_){return _.x===0&&_.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=we.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=we.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=we.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(_=0,j=0){if(typeof _=="number")return{width:_,height:j};if(!P(_))throw Error("Invalid parameters passed to constructor");return _ instanceof Array?{width:_[0],height:_[1]}:{width:_.width,height:_.height}}e.make=r;function i(_,j={}){return r({width:typeof j.width=="number"?j.width:_.width,height:typeof j.height=="number"?j.height:_.height})}e.clone=i;function a(_,j){return r({width:_.width+j.width,height:_.height+j.height})}e.add=a;function c(_,j){return r({width:_.width-j.width,height:_.height-j.height})}e.subtract=c;function u(_,j){return r({width:_.width*j.width,height:_.height*j.height})}e.multiply=u;function d(_,j){return r({width:_.width/j.width,height:_.height/j.height})}e.divide=d;function g(_){return r({width:_.height,height:_.width})}e.rotate=g;function m(_,j){return!(_.width!==j.width||_.height!==j.height)}e.isEqual=m;function b(_){return`Size(width=${_.width}, height=${_.height})`}e.toString=b;function C(_){return Object.freeze({width:_.width,height:_.height})}e.toJSON=C;function T(_){return[_.width,_.height]}e.toArray=T;function P(_){return _ instanceof Array?!(_.length!==2||typeof _[0]!="number"||typeof _[1]!="number"):typeof _=="object"?!(typeof _.width!="number"||typeof _.height!="number"):!1}e.isValidDescriptor=P;function R(_){return typeof _=="object"&&typeof _.width=="number"&&typeof _.height=="number"}e.isSize=R;function M(_){return _.width===0&&_.height===0}e.isZero=M})(ke||(ke={}));var we;(e=>{e.zero=r();function r(w=0,k=0,E=0,z=0){if(typeof w=="number"&&typeof k=="number"){const X=w,J=k;return{top:J,right:X+E,bottom:J+z,left:X,width:E,height:z}}else if(Se.isPoint(w)&&ke.isSize(k)){const X=w,J=k;return{top:X.y,right:X.x+J.width,bottom:X.y+J.height,left:X.x,width:J.width,height:J.height}}else{const X=w;if(!$(X))throw Error("Invalid parameters passed to constructor");return{top:X.y,right:X.x+X.width,bottom:X.y+X.height,left:X.x,width:X.width,height:X.height}}}e.make=r;function i(w){return Se.make({x:(w.right-w.left)/2+w.left,y:(w.bottom-w.top)/2+w.top})}e.center=i;function a(w){return ke.make({width:w.width,height:w.height})}e.size=a;function c(w,k={}){try{if(w==null)return;if(K(w))return w;if(ht(w))return c(document.documentElement||document.body.parentNode||document.body,k);const E=w instanceof Array?w:[w],z=E.length,X=k.reference||window,J=u(),se=ht(X)?J:c(k.reference);if(!J||!se)return;let te;for(let G=0;G<z;G++){const Y=E[G],F=Y.getBoundingClientRect(),re=r({x:F.left+J.left-(ht(X)?0:se.left),y:F.top+J.top-(ht(X)?0:se.top),width:k.overflow?Y.scrollWidth:Y instanceof HTMLElement?Y.offsetWidth:F.width,height:k.overflow?Y.scrollHeight:Y instanceof HTMLElement?Y.offsetHeight:F.height});te=te?P(te,re):re}return te}catch(E){console.error(E);return}}e.from=c;function u(){const w=Math.max(document.documentElement.clientWidth,window.innerWidth||0),k=Math.max(document.documentElement.clientHeight,window.innerHeight||0),E=window.pageXOffset!==void 0?window.pageXOffset:(document.documentElement||document.body.parentNode||document.body).scrollLeft,z=window.pageYOffset!==void 0?window.pageYOffset:(document.documentElement||document.body.parentNode||document.body).scrollTop;return r({x:E,y:z,width:w,height:k})}e.fromViewport=u;function d(w,k={}){if(w)return ht(w)?c(Array.from(document.body.children)):c(Array.from(w.children),{overflow:k.overflow,reference:k.reference||w})}e.fromChildrenOf=d;function g(w,k,E={}){if(!k)return;const z=Array.from(k.children);return w<=0?r():w>=z.length?c(z,{reference:E.reference,overflow:!1}):(z.splice(w),c(z,{reference:E.reference||k,overflow:!1}))}e.fromChildrenBefore=g;function m(w,k,E={}){if(!k)return;const z=Array.from(k.children);return w<0?c(z,{reference:E.reference,overflow:!1}):w>=z.length-1?r():(z.splice(0,z.length-w-1),c(z,{reference:E.reference||k,overflow:!1}))}e.fromChildrenAfter=m;function b(w,k,E={}){if(!k)return;const z=k.children[w];return c(z,{overflow:E.overflow,reference:E.reference||k})}e.fromChildAt=b;function C(...w){try{const k=w.length,E={};let z,X;for(let J=0;J<k;J++){if(z||(z=c(w[J])),J===0&&J+1===k)X=u();else if(J+1<k)X=c(w[J+1]);else break;!z||!X||(E.width=Math.max(0,Math.min(z.right,X.right)-Math.max(z.left,X.left)),E.height=Math.max(0,Math.min(z.bottom,X.bottom)-Math.max(z.top,X.top)),E.y=Math.max(z.top,X.top),E.x=Math.max(z.left,X.left),E.width*E.height===0&&(E.width=0,E.height=0,E.y=NaN,E.x=NaN),z=r(E))}return r(E)}catch(k){console.error(k);return}}e.intersecting=C;function T(w,k={}){return r({x:typeof k.x=="number"?k.x:w.left,y:typeof k.y=="number"?k.y:w.top,width:typeof k.width=="number"?k.width:w.width,height:typeof k.height=="number"?k.height:w.height})}e.clone=T;function P(w,k){return r({x:Math.min(w.left,k.left),y:Math.min(w.top,k.top),width:Math.max(w.right,k.right)-Math.min(w.left,k.left),height:Math.max(w.bottom,k.bottom)-Math.min(w.top,k.top)})}e.concat=P;function R(w){return r({x:w.left,y:w.top,width:w.height,height:w.width})}e.rotate=R;function M(w,k){return!(w.top!==k.top||w.right!==k.right||w.bottom!==k.bottom||w.left!==k.left||w.width!==k.width||w.height!==k.height)}e.isEqual=M;function _(w,k){return es(k,w)}e.contains=_;function j(w){return`Rect(top=${w.top}, right=${w.right}, bottom=${w.bottom}, left=${w.left}, width=${w.width}, height=${w.height})`}e.toString=j;function Q(w){return Object.freeze({top:w.top,right:w.right,bottom:w.bottom,left:w.left,width:w.width,height:w.height})}e.toJSON=Q;function $(w){return!(typeof w.x!="number"||typeof w.y!="number"||typeof w.width!="number"||typeof w.height!="number")}e.isValidDescriptor=$;function K(w){return typeof w=="object"&&typeof w.top=="number"&&typeof w.right=="number"&&typeof w.bottom=="number"&&typeof w.left=="number"&&typeof w.width=="number"&&typeof w.height=="number"}e.isRect=K;function q(w){return w.top===0&&w.right===0&&w.bottom===0&&w.left===0&&w.width===0&&w.height===0}e.isZero=q})(we||(we={}));function ht(e){return e===window}function Ee(e){const r=N.useRef(e);return N.useEffect(()=>{r.current=e},[e]),r}function Br(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 Ht(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 Hr(){const[e,r]=N.useState(ke.zero);return N.useLayoutEffect(()=>{const i=()=>{const a=we.size(we.fromViewport());r(a)};return window.addEventListener("resize",i),i(),()=>{window.removeEventListener("resize",i)}},[]),e}function Be(e){const[r,i]=N.useState(we.zero),a=Hr();return Ht(e,{onResize:c=>{const u=we.from(c);u&&i(u)}}),Br(e,{onChange:c=>{const u=we.from(c);u&&i(u)}}),N.useLayoutEffect(()=>{const c=e.current,u=we.from(c);u&&i(u)},[ke.toString(a)]),r}H.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(", ")}})(H.ImageSource||(H.ImageSource={}));function Yr({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 T=M=>{if(C)return;const _=M.currentTarget;m.current?.(_)},P=M=>{if(C)return;const _=M.currentTarget;b.current?.(_)},R=new Image;return R.addEventListener("load",T),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",T),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),T=Ee(d),P=N.useCallback(_=>{a||m(void 0),b.current?.(_)},[a]),R=N.useCallback(_=>{m(ts(_)),C.current?.(_)},[]),M=N.useCallback(_=>{a||m(void 0),T.current?.(_)},[a]);return Yr({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 Ln=N.forwardRef(({alt:e,source:r,loadingMode:i,src:a,style:c,onLoadStart:u,onLoadComplete:d,onLoadError:g,onSizeChange:m,...b},C)=>{const T=r?H.ImageSource.asProps(r):void 0,P=zn({src:a,srcSet:T?.srcSet,sizes:T?.sizes},{onLoadStart:u,onLoadComplete:d,onLoadError:g}),R=ns();return N.useEffect(()=>{m?.(P)},[P?.width,P?.height]),x.jsx("img",{...b,...T,ref:C,alt:e,loading:i,src:a,style:{...R.root,...c}})});function ns(){return{root:{fontSize:"0"}}}process.env.NODE_ENV==="development"&&(Ln.displayName="Image");const Fn=N.forwardRef(({alt:e,loadingMode:r,sources:i=[],src:a,onLoadComplete:c,onLoadError:u,onLoadStart:d,onSizeChange:g,...m},b)=>x.jsxs("picture",{...m,ref:b,children:[i.map((C,T)=>x.jsx("source",{...H.ImageSource.asProps(C)},T)),x.jsx(Ln,{alt:e,loadingMode:r,src:a,style:{width:"100%",height:"100%"},onLoadComplete:c,onLoadError:u,onLoadStart:d,onSizeChange:g})]}));process.env.NODE_ENV==="development"&&(Fn.displayName="Picture");const Xr=N.forwardRef(({children:e,alt:r,aspectRatio:i=NaN,sources:a,loadingMode:c,src:u,style:d,onLoadStart:g,onLoadComplete:m,onLoadError:b,...C},T)=>{const P=k=>{j(k?k.width/k.height:NaN)},R=N.useRef(null),M=T??R,[_,j]=N.useState(NaN),Q=isNaN(i)?_:i,$=Be(M),K=$.width/$.height,q=ke.make(K>1?Math.max($.width,$.height*Q):Math.max($.width,Math.max($.height,$.width/Q)*Q),K>1?Math.max($.height,Math.max($.width,$.height*Q)/Q):Math.max($.height,$.width/Q)),w=Oe(e,{content:Yt,viewport:Xt});return x.jsxs("div",{...C,ref:M,style:ue(d,Vn.root),children:[x.jsx(Fn,{alt:r,sources:a,src:u,style:ue(Vn.viewport,{height:`${q.height}px`,maxWidth:"unset",width:`${q.width}px`}),onLoadComplete:m,onLoadError:b,onLoadStart:g,onSizeChange:k=>P(k)}),w.viewport&&x.jsx(me,{element:w.viewport,style:ue(Vn.viewport,{height:`${q.height}px`,pointerEvents:"none",width:`${q.width}px`})}),w.content]})}),Yt=({children:e,...r})=>x.jsx("div",{...r,children:e}),Xt=({children:e,...r})=>x.jsx("div",{...r,children:e}),rs=Object.assign(Xr,{Content:Yt,Viewport:Xt}),Vn={root:{overflow:"hidden"},viewport:{fontSize:"0",left:"50%",position:"absolute",top:"50%",transform:"translate(-50%, -50%)"}};process.env.NODE_ENV==="development"&&(Xr.displayName="CoverImage",Yt.displayName="CoverImage.Content",Xt.displayName="CoverImage.Viewport");function Ur(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 Kr(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]),T=N.useCallback(R=>{d(os(R)),m.current?.(R)},[]),P=N.useCallback(R=>{r||d(void 0),b.current?.(R)},[r]);return Ur(e,{onLoadStart:C,onLoadComplete:T,onLoadError:P}),u}function os(e){if(e&&typeof e.videoWidth=="number"&&typeof e.videoHeight=="number")return ke.make(e.videoWidth,e.videoHeight)}const Dn=N.forwardRef(({autoLoop:e=!0,autoPlay:r=!0,hasControls:i=!1,isMuted:a=!0,playsInline:c=!0,posterSrc:u,src:d,style:g,onCanPlay:m,onEnd:b,onFullscreenChange:C,onLoadMetadata:T,onLoadMetadataComplete:P,onLoadMetadataError:R,onPause:M,onPlay:_,onSizeChange:j,onTimeUpdate:Q,...$},K)=>{const q=N.useRef(null),w=K??q,k=Kr(d,{onLoadStart:T,onLoadComplete:P,onLoadError:R}),E=is();N.useEffect(()=>{if(!w.current)return;if(d.toLowerCase().endsWith(".m3u8")){const re=!!w.current.canPlayType("application/x-mpegURL"),oe=typeof window.Hls<"u"?window.Hls:void 0;if(!re&&oe?.isSupported()){const le=new oe;le.loadSource(d),le.attachMedia(w.current)}}const F=re=>{const oe=window.document.fullScreen||window.document.mozFullScreen||window.document.webkitIsFullScreen;oe!==void 0&&C?.(oe)};return w.current.muted=a,w.current.load(),w.current.addEventListener("webkitfullscreenchange",F),w.current.addEventListener("mozfullscreenchange",F),w.current.addEventListener("fullscreenchange",F),()=>{Y(),w.current?.removeEventListener("webkitfullscreenchange",F),w.current?.removeEventListener("mozfullscreenchange",F),w.current?.removeEventListener("fullscreenchange",F)}},[d]),N.useEffect(()=>{j?.(k)},[k]);const z=F=>{const re=F.currentTarget;r&&re.paused&&G(),m?.()},X=F=>{_?.()},J=F=>{M?.()},se=F=>{b?.()},te=F=>{const re=F.currentTarget;Q?.(re.currentTime,re.duration)},G=()=>{w.current&&w.current.play()},Y=()=>{w.current&&w.current.pause()};return x.jsx("video",{...$,ref:w,autoPlay:r,controls:i,loop:e,muted:a,playsInline:c,poster:u,style:{...E.root,...g},onCanPlay:z,onEnded:se,onPause:J,onPlay:X,onTimeUpdate:te,children:x.jsx("source",{src:d})})});function is(){return{root:{fontSize:"0"}}}process.env.NODE_ENV==="development"&&(Dn.displayName="Video");const Gr=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:T,onEnd:P,onFullscreenChange:R,onLoadMetadata:M,onLoadMetadataComplete:_,onLoadMetadataError:j,onPause:Q,onPlay:$,onSizeChange:K,...q},w)=>{const k=F=>{J(F?F.width/F.height:NaN),K?.(F)},E=w??N.useRef(null),z=Be(E),[X,J]=N.useState(NaN),se=isNaN(a)?X:a,te=z.width/z.height,G=ke.make(te>1?Math.max(z.width,z.height*se):Math.max(z.width,Math.max(z.height,z.width/se)*se),te>1?Math.max(z.height,Math.max(z.width,z.height*se)/se):Math.max(z.height,z.width/se)),Y=Oe(r,{content:Bn,viewport:Hn});return x.jsxs("div",{...q,ref:E,className:e,style:ue(i,Yn.root),children:[x.jsx(Dn,{autoLoop:c,autoPlay:u,hasControls:d,isMuted:g,playsInline:m,posterSrc:b,src:C,style:ue(Yn.viewport,{width:`${G.width}px`,height:`${G.height}px`,maxWidth:"unset"}),onCanPlay:T,onEnd:P,onFullscreenChange:R,onLoadMetadata:M,onLoadMetadataComplete:_,onLoadMetadataError:j,onPause:Q,onPlay:$,onSizeChange:F=>k(F)}),Y.viewport&&x.jsx(me,{element:Y.viewport,style:ue(Yn.viewport,{height:`${G.height}px`,pointerEvents:"none",width:`${G.width}px`})}),Y.content]})}),Bn=({children:e,...r})=>x.jsx("div",{...r,children:e}),Hn=({children:e,...r})=>x.jsx("div",{...r,children:e}),ss=Object.assign(Gr,{Content:Bn,Viewport:Hn}),Yn={root:{overflow:"hidden"},viewport:{fontSize:"0",left:"50%",position:"absolute",top:"50%",transform:"translate(-50%, -50%)"}};process.env.NODE_ENV==="development"&&(Gr.displayName="CoverVideo",Bn.displayName="CoverVideo.Content",Hn.displayName="CoverVideo.Viewport");const Xn=N.forwardRef((e,r)=>{switch(!0){case as(e):{const{action:i,children:a,className:c,isDisabled:u,label:d,opensInNewTab:g,...m}=e;return x.jsx("a",{...m,ref:r,"aria-disabled":u,"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 cs(e):{const{action:i,children:a,className:c,isDisabled:u,label:d,type:g="button",...m}=e;return x.jsx("button",{...m,ref:r,"aria-disabled":u,"aria-label":d,className:c,disabled:u,type:g,onClick:i,children:a??d})}default:console.error("[etudes::Button] Unknown button type");return}});function as(e){return typeof e.action=="string"}function cs(e){return typeof e.action=="function"||typeof e.type=="string"}process.env.NODE_ENV==="development"&&(Xn.displayName="Button");const Wr=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,T=i[C],P=typeof T=="string"?T:T?.value;a?.(P,C)},[d,r,e,i,a]);return x.jsx(Xn,{...c,ref:u,action:b,isDisabled:r,label:m})});process.env.NODE_ENV==="development"&&(Wr.displayName="OptionButton");var Un,Jr;function ls(){return Jr||(Jr=1,Un=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}),Un}var us=ls();const He=Rr(us);var Ut={exports:{}},fs=Ut.exports,Zr;function ds(){return Zr||(Zr=1,(function(e,r){(function(i,a){e.exports=a()})(fs,(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,_(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))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&&T(n,t)}function C(n){return C=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},C(n)}function T(n,t){return T=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,s){return o.__proto__=s,o},T(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 _(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},Q=void 0,$=void 0;function K(n){Q=n;var t=n.document.createTextNode("");t.ownerDocument!==n.document&&typeof n.wrap=="function"&&n.wrap(t)===t&&(n=n.wrap(n)),$=n}function q(n){return j(n)?n:(n.ownerDocument||n).defaultView||$.window}typeof window<"u"&&window&&K(window);var w=function(n){return!!n&&c(n)==="object"},k=function(n){return typeof n=="function"},E={window:function(n){return n===$||j(n)},docFrag:function(n){return w(n)&&n.nodeType===11},object:w,func:k,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=q(n)||$;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 w(n)&&!!n.constructor&&/function Object\b/.test(n.constructor.toString())},array:function(n){return w(n)&&n.length!==void 0&&k(n.splice)}};function z(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 X(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 J={id:"actions/drag",install:function(n){var t=n.actions,o=n.Interactable,s=n.defaults;o.prototype.draggable=J.draggable,t.map.drag=J,t.methodDict.drag="draggable",s.actions.drag=J.defaults},listeners:{"interactions:before-action-move":z,"interactions:action-resume":z,"interactions:action-move":X,"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:z,move:X,defaults:{startAxis:"xy",lockAxis:"xy"},getCursor:function(){return"move"},filterEventType:function(n){return n.search("drag")===0}},se=J,te={init:function(n){var t=n;te.document=t.document,te.DocumentFragment=t.DocumentFragment||G,te.SVGElement=t.SVGElement||G,te.SVGSVGElement=t.SVGSVGElement||G,te.SVGElementInstance=t.SVGElementInstance||G,te.Element=t.Element||G,te.HTMLElement=t.HTMLElement||te.Element,te.Event=t.Event,te.Touch=t.Touch||G,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 G(){}var Y=te,F={init:function(n){var t=Y.Element,o=n.navigator||{};F.supportsTouch="ontouchstart"in n||E.func(n.DocumentTouch)&&Y.document instanceof n.DocumentTouch,F.supportsPointerEvent=o.pointerEnabled!==!1&&!!Y.PointerEvent,F.isIOS=/iP(hone|od|ad)/.test(o.platform),F.isIOS7=/iP(hone|od|ad)/.test(o.platform)&&/OS 7[^\d]/.test(o.appVersion),F.isIe9=/MSIE 9/.test(o.userAgent),F.isOperaMobile=o.appName==="Opera"&&F.supportsTouch&&/Presto/.test(o.userAgent),F.prefixedMatchesSelector="matches"in t.prototype?"matches":"webkitMatchesSelector"in t.prototype?"webkitMatchesSelector":"mozMatchesSelector"in t.prototype?"mozMatchesSelector":"oMatchesSelector"in t.prototype?"oMatchesSelector":"msMatchesSelector",F.pEventTypes=F.supportsPointerEvent?Y.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,F.wheelEvent=Y.document&&"onmousewheel"in Y.document?"mousewheel":"wheel"},supportsTouch:null,supportsPointerEvent:null,isIOS7:null,isIOS:null,isIe9:null,isOperaMobile:null,prefixedMatchesSelector:null,pEventTypes:null,wheelEvent:null},re=F;function oe(n,t){if(n.contains)return n.contains(t);for(;t;){if(t===n)return!0;t=t.parentNode}return!1}function le(n,t){for(;E.element(n);){if(L(n,t))return n;n=D(n)}return null}function D(n){var t=n.parentNode;if(E.docFrag(t)){for(;(t=t.host)&&E.docFrag(t););return t}return t}function L(n,t){return $!==Q&&(t=t.replace(/\/deep\//g," ")),n[re.prefixedMatchesSelector](t)}var I=function(n){return n.parentNode||n.host};function W(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(L(n,t))return!0;if((n=D(n))===o)return L(n,t)}return!1}function Z(n){return n.correspondingUseElement||n}function pe(n){var t=n instanceof Y.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(!re.isIOS7&&o){var s={x:(t=(t=q(n))||$).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=D(n);return t}function Ne(n){return!!E.string(n)&&(Y.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"?D(o):n==="self"?t.getRect(o):le(o,n)}function Pe(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 Me(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 Ye(n,t,o){var s=o&&n.options[o];return Ce(Pe(s&&s.origin||n.options.origin,n,t,[n&&t]))||{x:0,y:0}}function Xe(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=ni(n)),E.array(n))return n.forEach((function(v){return Xe(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];Xe(n,p,o,s)}else if(E.object(t))for(var h in t)Xe(ni(h).map((function(v){return"".concat(n).concat(v)})),t[h],o,s);return s}function ni(n){return n.trim().split(/ +/)}var kt=function(n,t){return Math.sqrt(n*n+t*t)},Fc=["webkit","moz"];function En(n,t){n.__set||(n.__set={});var o=function(l){if(Fc.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 Nn(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 Y.Event||n instanceof Y.Touch}function Sn(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},re.isOperaMobile&&oi(n)?(Sn("screen",n,t),t.x+=window.scrollX,t.y+=window.scrollY):Sn("page",n,t),t}function Pt(n){return E.number(n.pointerId)?n.pointerId:n.identifier}function Vc(n,t,o){var s=t.length>1?si(t):t[0];ii(s,n.page),(function(l,f){f=f||{},re.isOperaMobile&&oi(l)?Sn("screen",l,f):Sn("client",l,f)})(s,n.client),n.timeStamp=o}function fr(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 dr(n){if(!n.length)return null;var t=fr(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 pr(n,t){var o=t+"X",s=t+"Y",l=fr(n),f=l[0][o]-l[1][o],p=l[0][s]-l[1][s];return kt(f,p)}function hr(n,t){var o=t+"X",s=t+"Y",l=fr(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 Y.Touch?"touch":"mouse"}function ci(n){var t=E.func(n.composedPath)?n.composedPath():n.path;return[Z(t?t[0]:n.target),Z(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)},It=function(n,t){for(var o=0;o<n.length;o++)if(t(n[o],o,n))return o;return-1},jt=function(n,t){return n[It(n,t)]},lt=(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=It(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 gr(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 O=y.options.drop.accept;if(!(E.element(O)&&O!==p||E.string(O)&&!L(p,O)||E.func(O)&&!O({dropzone:y,draggableElement:p})))for(var A=0,B=y.getAllElements();A<B.length;A++){var V=B[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,O=S.element,A=S.rect,B=y.dropCheck(t,o,l,f,O,A);p.push(B?O:null)}var V=(function(U){for(var ae,ie,fe,ye=[],xe=0;xe<U.length;xe++){var he=U[xe],be=U[ae];if(he&&xe!==ae)if(be){var Re=I(he),_e=I(be);if(Re!==he.ownerDocument)if(_e!==he.ownerDocument)if(Re!==_e){ye=ye.length?ye:W(be);var ze=void 0;if(be instanceof Y.HTMLElement&&he instanceof Y.SVGElement&&!(he instanceof Y.SVGSVGElement)){if(he===_e)continue;ze=he.ownerSVGElement}else ze=he;for(var Le=W(ze,be.ownerDocument),Ge=0;Le[Ge]&&Le[Ge]===ye[Ge];)Ge++;var An=[Le[Ge-1],Le[Ge],ye[Ge]];if(An[0])for(var Ft=An[0].lastChild;Ft;){if(Ft===An[1]){ae=xe,ye=Le;break}if(Ft===An[2])break;Ft=Ft.previousSibling}}else fe=be,(parseInt(q(ie=he).getComputedStyle(ie).zIndex,10)||0)>=(parseInt(q(fe).getComputedStyle(fe).zIndex,10)||0)&&(ae=xe);else ae=xe}else ae=xe}return ae})(p);return s.activeDrops[V]||null}function mr(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 lt(s,o,"dropactivate"),l.activate.target=null,l.activate.dropzone=null),o.type==="dragend"&&(l.deactivate=new lt(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 lt(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 lt(s,o,"dragenter"),o.dragEnter=s.cur.element,o.dropzone=s.cur.dropzone)),o.type==="dragend"&&s.cur.dropzone&&(l.drop=new lt(s,o,"drop"),o.dropzone=s.cur.dropzone,o.relatedTarget=s.cur.element),o.type==="dragmove"&&s.cur.dropzone&&(l.move=new lt(s,o,"dropmove"),o.dropzone=s.cur.dropzone)),l}function vr(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=gr(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=mr(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(se),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=Xe(h.listeners),S=Object.keys(v).reduce((function(O,A){return O[/^(enter|leave)/.test(A)?"drag".concat(A):/^(activate|deactivate|move)/.test(A)?"drop".concat(A):A]=v[A],O}),{}),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(O,A,B,V,U,ae,ie){var fe=!1;if(!(ie=ie||O.getRect(ae)))return!!O.options.drop.checker&&O.options.drop.checker(A,B,fe,O,ae,V,U);var ye=O.options.drop.overlap;if(ye==="pointer"){var xe=Ye(V,U,"drag"),he=ii(A);he.x+=xe.x,he.y+=xe.y;var be=he.x>ie.left&&he.x<ie.right,Re=he.y>ie.top&&he.y<ie.bottom;fe=be&&Re}var _e=V.getRect(U);if(_e&&ye==="center"){var ze=_e.left+_e.width/2,Le=_e.top+_e.height/2;fe=ze>=ie.left&&ze<=ie.right&&Le>=ie.top&&Le<=ie.bottom}return _e&&E.number(ye)&&(fe=Math.max(0,Math.min(ie.right,_e.right)-Math.max(ie.left,_e.left))*Math.max(0,Math.min(ie.bottom,_e.bottom)-Math.max(ie.top,_e.top))/(_e.width*_e.height)>=ye),O.options.drop.checker&&(fe=O.options.drop.checker(A,B,fe,O,ae,V,U)),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=gr(t,o.element),l.events=mr(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;vr(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),vr(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:gr,getDrop:di,getDropEvents:mr,fireDropEvents:vr,filterEventType:function(n){return n.search("drag")===0||n.search("drop")===0},defaults:{enabled:!1,accept:null,overlap:"pointer"}},Dc=hi;function yr(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=pr(l,h),o.box=dr(l),o.scale=1,o.ds=0,o.angle=hr(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=pr(l,h),o.box=dr(l),o.scale=o.distance/t.gesture.startDistance,o.angle=hr(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 br={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=br,t.methodDict.gesture="gesturable",s.actions.gesture=br.defaults},listeners:{"interactions:action-start":yr,"interactions:action-move":yr,"interactions:action-end":yr,"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}},Bc=br;function Hc(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 Ue,ot,Ke={id:"actions/resize",before:["actions/drag"],install:function(n){var t=n.actions,o=n.browser,s=n.Interactable,l=n.defaults;Ke.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),Ke.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=Ke,t.methodDict.resize="resizable",l.actions.resize=Ke.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,O=v.delta,A=v.previous;if(ne(A,y),p){if(ne(y,h),f==="reposition"){if(y.top>y.bottom){var B=y.top;y.top=y.bottom,y.bottom=B}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 U in y.width=y.right-y.left,y.height=y.bottom-y.top,y)O[U]=y[U]-A[U];l.edges=s.prepared.edges,l.rect=y,l.deltaRect=O}})(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]=Hc(S,h.edges[S],p,t._latestPointer.eventTarget,s,l,h.margin||Ke.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-Ke.defaultMargin,O=h.axis!=="x"&&p.y>l.bottom-Ke.defaultMargin;(y||O)&&(n.action={name:"resize",axes:(y?"x":"")+(O?"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=Ke.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},Yc=Ke,Xc={id:"actions",install:function(n){n.usePlugin(Bc),n.usePlugin(Yc),n.usePlugin(se),n.usePlugin(Dc)}},mi=0,Ze={request:function(n){return Ue(n)},cancel:function(n){return ot(n)},init:function(n){if(Ue=n.requestAnimationFrame,ot=n.cancelAnimationFrame,!Ue)for(var t=["ms","moz","webkit","o"],o=0;o<t.length;o++){var s=t[o];Ue=n["".concat(s,"RequestAnimationFrame")],ot=n["".concat(s,"CancelAnimationFrame")]||n["".concat(s,"CancelRequestAnimationFrame")]}Ue=Ue&&Ue.bind(n),ot=ot&&ot.bind(n),Ue||(Ue=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,Ze.cancel(ge.i),n.autoScroll=ge,ge.interaction=n,ge.prevTime=ge.now(),ge.i=Ze.request(ge.scroll)},stop:function(){ge.isScrolling=!1,ge.interaction&&(ge.interaction.autoScroll=null),Ze.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 O=yi(f),A={x:O.x-y.x,y:O.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&&(Ze.cancel(ge.i),ge.i=Ze.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,O=vi(y.container,h,v);if(E.window(O))p=o.clientX<ge.margin,s=o.clientY<ge.margin,l=o.clientX>O.innerWidth-ge.margin,f=o.clientY>O.innerHeight-ge.margin;else{var A=pe(O);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)||q(o)}function yi(n){return E.window(n)&&(n=window.document.body),{x:n.scrollLeft,y:n.scrollTop}}var Uc={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)}}},Kc=Uc;function Rt(n,t){var o=!1;return function(){return o||($.console.warn(t),o=!0),n.apply(this,arguments)}}function wr(n,t){return n.name=t.name,n.axis=t.axis,n.edges=t.edges,n}function Gc(n){return E.bool(n)?(this.options.styleCursor=n,this):n===null?(delete this.options.styleCursor,this):this.options.styleCursor}function Wc(n){return E.func(n)?(this.options.actionChecker=n,this):n===null?(delete this.options.actionChecker,this):this.options.actionChecker}var Jc={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,O){var A=h.getRect(y),B=v.buttons||{0:1,1:4,3:8,4:16}[v.button],V={action:null,interactable:h,interaction:S,element:y,rect:A,buttons:B};return O.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=Rt((function(o){return this._backCompatOption("ignoreFrom",o)}),"Interactable.ignoreFrom() has been deprecated. Use Interactble.draggable({ignoreFrom: newValue})."),t.prototype.allowFrom=Rt((function(o){return this._backCompatOption("allowFrom",o)}),"Interactable.allowFrom() has been deprecated. Use Interactble.draggable({allowFrom: newValue})."),t.prototype.actionChecker=Wc,t.prototype.styleCursor=Gc}};function bi(n,t,o,s,l){return t.testIgnoreAllow(t.options[n.name],o,s)&&t.options[n.name].enabled&&Tn(t,o,n,l)?n:null}function Zc(n,t,o,s,l,f,p){for(var h=0,v=s.length;h<v;h++){var S=s[h],y=l[h],O=S.getAction(t,o,n,y);if(O){var A=bi(O,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=Zc(n,t,o,f,p,s,l);if(S.action&&!S.interactable.options[S.action.name].manualStart)return S;h=D(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,wr(n.prepared,s),n.rect=l&&s.name?l.getRect(f):null,Ni(n,o),o.fire("autoStart:prepared",{interaction:n})}function Tn(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 O=0,A=s.interactions.list;O<A.length;O++){var B=A[O],V=B.prepared.name;if(B.interacting()&&(++v>=h||B.interactable===n&&((S+=V===o.name?1:0)>=f||B.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 xr(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)}xr(n.element,f||"",t)}else t.autoStart.cursorElement&&xr(t.autoStart.cursorElement,"",t)}var Qc={id:"auto-start/base",before:["actions"],install:function(n){var t=n.interactStatic,o=n.defaults;n.usePlugin(Jc),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:Tn,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||!Tn(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&&xr(o.element,"",t)}},maxInteractions:Ei,withinInteractionLimit:Tn,validateAction:bi},Er=Qc,$c={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 O=s,A=function(V){if(V!==o.interactable){var U=o.interactable.options.drag;if(!U.manualStart&&V.testIgnoreAllow(U,O,s)){var ae=V.getAction(o.downPointer,o.downEvent,o,O);if(ae&&ae.name==="drag"&&(function(ie,fe){if(!fe)return!1;var ye=fe.options.drag.startAxis;return ie==="xy"||ye==="xy"||ye===ie})(y,V)&&Er.validateAction(ae,V,O,s,t))return V}}};E.element(O);){var B=t.interactables.forEachMatch(O,A);if(B){o.prepared.name="drag",o.interactable=B,o.element=O;break}O=D(O)}}}}}};function Nr(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 qc={id:"auto-start/hold",install:function(n){var t=n.defaults;n.usePlugin(Er),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=Nr(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;Nr(t)>0&&(t.prepared.name=null)}},getHoldDuration:Nr},el=qc,tl={id:"auto-start",install:function(n){n.usePlugin(Er),n.usePlugin(el),n.usePlugin($c)}},nl=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 rl(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=nl,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=q(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)&&L(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||oe(f.element,o.target)))return void f.interactable.checkAndPreventDefault(o)}}})},listeners:["down","move","up","cancel"].reduce((function(n,t){return n["interactions:".concat(t)]=rl,n}),{})};function Cn(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 ut(n){var t={};for(var o in n){var s=n[o];E.plainObject(s)?t[o]=ut(s):E.array(s)?t[o]=ui(s):t[o]=s}return t}var Sr=(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],O=y.modifiers;return O&&O.length?O:["snap","snapSize","snapEdges","restrict","restrictEdges","restrictSize"].map((function(A){var B=y[A];return B&&B.enabled&&{options:B,methods:B._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,O=h[S],A=O.options,B=ne({},t.coords),V=null;(y=O.methods)!=null&&y.set&&this.shouldDo(A,s,o)&&(t.state=O,V=O.methods.set(t),Me(t.edges,t.rect,{x:t.coords.x-B.x,y:t.coords.y-B.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 U=this.result.coords,ae=this.result.rect;if(U&&ae){var ie=v.rect.left!==ae.left||v.rect.right!==ae.right||v.rect.top!==ae.top||v.rect.bottom!==ae.bottom;v.changed=ie||U.x!==v.coords.x||U.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 O=y[S],A=O[0],B=O[1];A.page.x+=B.x,A.page.y+=B.y,A.client.x+=B.x,A.client.y+=B.y}var V=this.result.rectDelta,U=t.rect||o.rect;U.left+=V.left,U.right+=V.right,U.top+=V.top,U.bottom+=V.bottom,U.width=U.right-U.left,U.height=U.bottom-U.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,O=[[s.start,p],[s.cur,v]];y<O.length;y++){var A=O[y],B=A[0],V=A[1];B.page.x-=V.x,B.page.y-=V.y,B.client.x-=V.x,B.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 ut(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 Qe(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 At(n){var t=n.iEvent,o=n.interaction.modification.result;o&&(t.modifiers=o.eventProps)}var ol={id:"modifiers/base",before:["actions"],install:function(n){n.defaults.perAction.modifiers=[]},listeners:{"interactions:new":function(n){var t=n.interaction;t.modification=new Sr(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":At,"interactions:action-move":At,"interactions:action-end":At,"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)}}},_i=ol,Ti={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 O=s.interactable,A=(O&&O.options||Ti).deltaSource,B=Ye(O,h,f),V=p==="start",U=p==="end",ae=V?P(y):s.prevEvent,ie=V?s.coords.start:U?{page:ae.page,client:ae.client,timeStamp:s.coords.cur.timeStamp}:s.coords.cur;return y.page=ne({},ie.page),y.client=ne({},ie.client),y.rect=ne({},s.rect),y.timeStamp=ie.timeStamp,U||(y.page.x-=B.x,y.page.y-=B.y,y.client.x-=B.x,y.client.y-=B.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=O,y.t0=V?s.pointers[s.pointers.length-1].downTime:ae.t0,y.x0=s.coords.start.page.x-B.x,y.y0=s.coords.start.page.y-B.y,y.clientX0=s.coords.start.client.x-B.x,y.clientY0=s.coords.start.client.y-B.y,y.delta=V||U?{x:0,y:0}:{x:y[A].x-ae[A].x,y:y[A].y-ae[A].y},y.dt=s.coords.delta.timeStamp,y.duration=y.timeStamp-y.t0,y.velocity=ne({},s.coords.velocity[A]),y.speed=kt(y.velocity.x,y.velocity.y),y.swipe=U||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 il=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})),sl=(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})({}),al=0,cl=(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=Rt((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=al++,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 sl)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)&&(wr(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=kt(l,f)>this.pointerMoveTolerance);var h,v,S,y=this.getPointerIndex(t),O={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",O),p||this.simulation||(this.interacting()&&(O.type=null,this.move(O)),this.pointerWasMoved&&Nn(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=Pt(t);return this.pointerType==="mouse"||this.pointerType==="pen"?this.pointers.length-1:It(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=Pt(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 il(v,t,o,null,null),S=this.pointers.length,this.pointers.push(y)),Vc(this.coords.cur,this.pointers.map((function(O){return O.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,En(this.downPointer,t),this.interacting()||(Nn(this.coords.start,this.coords.cur),Nn(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"&&(Me(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 Oi(n){ki(n.interaction)}function ki(n){if(!(function(o){return!(!o.offset.pending.x&&!o.offset.pending.y)})(n))return!1;var t=n.offset.pending;return Tr(n.coords.cur,t),Tr(n.coords.delta,t),Me(n.edges,n.rect,t),t.x=0,t.y=0,!0}function ll(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 Tr(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 ul={id:"offset",before:["modifiers","pointer-events","actions","inertia"],install:function(n){n.Interaction.prototype.offsetBy=ll},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&&(Tr(t.coords.cur,t.offset.total),t.offset.pending.x=0,t.offset.pending.y=0)})(n.interaction)},"interactions:before-action-start":Oi,"interactions:before-action-move":Oi,"interactions:before-action-end":function(n){var t=n.interaction;if(ki(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=ul,fl=(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=kn(o);if(!s||!s.enabled)return!1;var l=o.coords.velocity.client,f=kt(l.x,l.y),p=this.modification||(this.modification=new Sr(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=kn(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=Ze.request((function(){o.active&&t()}))}},{key:"inertiaTick",value:function(){var t,o,s,l,f,p,h,v=this,S=this.interaction,y=kn(S).resistance,O=(S._now()-this.t0)/1e3;if(O<this.te){var A,B=1-(Math.exp(-y*O)-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=B,t,s,f),y:Ii(h,o,l,p)}):A={x:this.targetOffset.x*B,y:this.targetOffset.y*B};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=kn(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"}),Nn(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,Ze.cancel(this.timeout)}}]),n})();function kn(n){var t=n.interactable,o=n.prepared;return t&&t.options&&o.name&&t.options[o.name].inertia}var dl={id:"inertia",before:["modifiers","actions"],install:function(n){var t=n.defaults;n.usePlugin(Pi),n.usePlugin(_i),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 fl(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=D(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":At,"interactions:action-inertiastart":At,"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 pl=dl;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=Xe(t,o);for(t in s)this.types[t]=li(this.types[t]||[],s[t])}},{key:"off",value:function(t,o){var s=Xe(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})(),hl=(function(){function n(t){u(this,n),this.currentTarget=void 0,this.originalEvent=void 0,this.type=void 0,this.originalEvent=t,En(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 Mt(n){return E.object(n)?{capture:!!n.capture,passive:!!n.passive}:{capture:!!n,passive:!1}}function Pn(n,t){return n===t||(typeof n=="boolean"?!!t.capture===n&&!t.passive:!!n.capture==!!t.capture&&!!n.passive==!!t.passive)}var gl={id:"events",install:function(n){var t,o=[],s={},l=[],f={add:p,remove:h,addDelegate:function(y,O,A,B,V){var U=Mt(V);if(!s[A]){s[A]=[];for(var ae=0;ae<l.length;ae++){var ie=l[ae];p(ie,A,v),p(ie,A,S,!0)}}var fe=s[A],ye=jt(fe,(function(xe){return xe.selector===y&&xe.context===O}));ye||(ye={selector:y,context:O,listeners:[]},fe.push(ye)),ye.listeners.push({func:B,options:U})},removeDelegate:function(y,O,A,B,V){var U,ae=Mt(V),ie=s[A],fe=!1;if(ie)for(U=ie.length-1;U>=0;U--){var ye=ie[U];if(ye.selector===y&&ye.context===O){for(var xe=ye.listeners,he=xe.length-1;he>=0;he--){var be=xe[he];if(be.func===B&&Pn(be.options,ae)){xe.splice(he,1),xe.length||(ie.splice(U,1),h(O,A,v),h(O,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,O,A,B){if(y.addEventListener){var V=Mt(B),U=jt(o,(function(ae){return ae.eventTarget===y}));U||(U={eventTarget:y,events:{}},o.push(U)),U.events[O]||(U.events[O]=[]),jt(U.events[O],(function(ae){return ae.func===A&&Pn(ae.options,V)}))||(y.addEventListener(O,A,f.supportsOptions?V:V.capture),U.events[O].push({func:A,options:V}))}}function h(y,O,A,B){if(y.addEventListener&&y.removeEventListener){var V=It(o,(function(Re){return Re.eventTarget===y})),U=o[V];if(U&&U.events)if(O!=="all"){var ae=!1,ie=U.events[O];if(ie){if(A==="all"){for(var fe=ie.length-1;fe>=0;fe--){var ye=ie[fe];h(y,O,ye.func,ye.options)}return}for(var xe=Mt(B),he=0;he<ie.length;he++){var be=ie[he];if(be.func===A&&Pn(be.options,xe)){y.removeEventListener(O,A,f.supportsOptions?xe:xe.capture),ie.splice(he,1),ie.length===0&&(delete U.events[O],ae=!0);break}}}ae&&!Object.keys(U.events).length&&o.splice(V,1)}else for(O in U.events)U.events.hasOwnProperty(O)&&h(y,O,"all")}}function v(y,O){for(var A=Mt(O),B=new hl(y),V=s[y.type],U=ci(y)[0],ae=U;E.element(ae);){for(var ie=0;ie<V.length;ie++){var fe=V[ie],ye=fe.selector,xe=fe.context;if(L(ae,ye)&&oe(xe,U)&&oe(xe,ae)){var he=fe.listeners;B.currentTarget=ae;for(var be=0;be<he.length;be++){var Re=he[be];Pn(Re.options,A)&&Re.func(B)}}}ae=D(ae)}}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}},Cr={methodOrder:["simulationResume","mouseOrPen","hasPointer","idle"],search:function(n){for(var t=0,o=Cr.methodOrder;t<o.length;t++){var s=o[t],l=Cr[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=D(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 O=y[S];if(!(O.pointerType!==s||/down/i.test(l)&&O.simulation))return O}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 ml=Cr,Or=["pointerDown","pointerMove","pointerUp","updatePointer","removePointer","windowBlur"];function zi(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 O=y[S],A={pointer:O,pointerId:Pt(O),pointerType:l,eventType:o.type,eventTarget:p,curEventTarget:h,scope:t},B=Li(A);v.push([A.pointer,A.eventTarget,A.curEventTarget,B])}}else{var V=!1;if(!re.supportsPointerEvent&&/mouse/.test(o.type)){for(var U=0;U<s.length&&!V;U++)V=s[U].pointerType!=="mouse"&&s[U].pointerIsDown;V=V||t.now()-t.prevTouchTime<500||o.timeStamp===0}if(!V){var ae={pointer:o,pointerId:Pt(o),pointerType:l,eventType:o.type,curEventTarget:h,eventTarget:p,scope:t},ie=Li(ae);v.push([ae.pointer,ae.eventTarget,ae.curEventTarget,ie])}}for(var fe=0;fe<v.length;fe++){var ye=v[fe],xe=ye[0],he=ye[1],be=ye[2];ye[3][n](xe,o,he,be)}}}function Li(n){var t=n.pointerType,o=n.scope,s={interaction:ml.search(n),searchDetails:n};return o.fire("interactions:find",s),s.interaction||o.interactions.new({pointerType:t})}function kr(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 O=f[y];h(o,O.type,O.listener,S)}}var vl={id:"core/interactions",install:function(n){for(var t={},o=0;o<Or.length;o++){var s=Or[o];t[s]=zi(s,n)}var l,f=re.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 B=A[O];n.documents.some((function(V){return oe(V.doc,B.downTarget)}))||S.removePointer(B.pointer,B.event)},O=0,A=S.pointers;O<A.length;O++)y()}}(l=Y.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})(cl),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 kr(n,"add")},"scope:remove-document":function(n){return kr(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:kr,doOnInteractions:zi,methodNames:Or},yl=vl,$e=(function(n){return n[n.On=0]="On",n[n.Off=1]="Off",n})($e||{}),bl=(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=q(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))&&Cn(v,f._actions)};(E.array(o)||E.object(o))&&this._onOff($e.Off,t,o,void 0,h),(E.array(s)||E.object(s))&&this._onOff($e.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]||{},ut(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||oe(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)&&oe(t,s))}},{key:"testIgnore",value:function(t,o,s){return!(!t||!E.element(s))&&(E.string(t)?ee(s,t,o):!!E.element(t)&&oe(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=Xe(o,s,f);for(var h in p){h==="wheel"&&(h=re.wheelEvent);for(var v=0,S=p[h];v<S.length;v++){var y=S[v];Cn(h,this._actions)?this.events[t===$e.On?"on":"off"](h,y):E.string(this.target)?this._scopeEvents[t===$e.On?"addDelegate":"removeDelegate"](this.target,this._context,h,y,l):this._scopeEvents[t===$e.On?"add":"remove"](this.target,h,y,l)}}return this}},{key:"on",value:function(t,o,s){return this._onOff($e.On,t,o,s)}},{key:"off",value:function(t,o,s){return this._onOff($e.Off,t,o,s)}},{key:"set",value:function(t){var o=this._defaults;for(var s in E.object(t)||(t={}),this.options=ut(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})(),wl=(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=It(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 jt(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)&&L(t,f.target):t===f.target)&&f.inContext(t)&&(p=o(f)),p!==void 0)return p}}}]),n})(),xl=(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=re,this.defaults=ut(Ti),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=dr,l.getTouchDistance=pr,l.getTouchAngle=hr,l.getElementRect=ve,l.getElementClientRect=pe,l.matchesSelector=L,l.closest=le,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=Rt((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 O in f)this.on(O,f[O],p);return this}return Cn(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=Rt((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 O in f)this.off(O,f[O],p);return this}var A;return Cn(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 re.supportsTouch},l.supportsPointerEvent=function(){return re.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 wl(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})(bl)}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)&&K(s),Y.init(s),re.init(s),Ze.init(s),o.window=s,o.document=s.document,o.usePlugin(yl),o.usePlugin(gl),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=q(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=q(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 xl,je=Vi.interactStatic,El=typeof globalThis<"u"?globalThis:window;Vi.init(El);var Nl=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},O=0;O<t.length;O++){var A=t[O],B=A[0],V=A[1],U=Math.round((s-S.x)/n[B]),ae=Math.round((l-S.y)/n[V]);y[B]=Math.max(h.left,Math.min(h.right,U*n[B]+S.x)),y[V]=Math.max(h.top,Math.min(h.bottom,ae*n[V]+S.y))}return y};return o.grid=n,o.coordFields=t,o}}),Sl={id:"snappers",install:function(n){var t=n.interactStatic;t.snappers=ne(t.snappers||{},Nl),t.createSnapGrid=t.snappers.grid}},_l=Sl,Tl={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 O=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=(O.left?1:-1)*(O.top?1:-1);t.edgeSign={x:A,y:A}}else t.edgeSign={x:O.left?-1:1,y:O.top?-1:1};if(h!==!1&&ne(s,O),y!=null&&y.length){var B=new Sr(n.interaction);B.copyFrom(n.interaction.modification),B.prepareStates(y),t.subModification=B,B.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?Cl:Ol;if(ne(n.edges,l),p(t,t.xIsPrimaryAxis,s,o),!t.subModification)return null;var h=ne({},o);Me(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 Cl(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 kl=Qe(Tl,"aspectRatio"),Di=function(){};Di._defaults={};var In=Di;function it(n,t,o){return E.func(n)?Pe(n,t.interactable,t.element,[o.x,o.y,t]):Pe(n,t.interactable,t.element)}var jn={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,O=S.bottom-S.top-t.height;y<0&&(v.left+=y,v.right+=y),O<0&&(v.top+=O,v.bottom+=O)}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}},Pl=Qe(jn,"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}},Il=Qe(zt,"restrictEdges"),jl=ne({get elementRect(){return{top:0,left:0,bottom:1,right:1}},set elementRect(n){}},jn.defaults),Rl=Qe({start:jn.start,set:jn.set,defaults:jl},"restrictRect"),Al={width:-1/0,height:-1/0},Ml={width:1/0,height:1/0},zl=Qe({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))||Al,h=De(it(f.max,t,n.coords))||Ml;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"),Pr={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 B=A.interaction.element,V=Ce(Pe(A.state.options.origin,null,null,[B])),U=V||Ye(A.interactable,B,A.interaction.prepared.name);return U})(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=Pe(v.offset,s,l,[o]);(t=Ce(y)||{x:0,y:0}).x+=S.x,t.y+=S.y}var O=v.relativePoints;p.offsets=f&&O&&O.length?O.map((function(A,B){return{index:B,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=Ye(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 O=y[S],A=h.x-O.x,B=h.y-O.y,V=0,U=l.targets.length;V<U;V++){var ae=l.targets[V],ie=void 0;(ie=E.func(ae)?ae(A,B,t._proxy,O,V):ae)&&v.push({x:(E.number(ie.x)?ie.x:A)+O.x,y:(E.number(ie.y)?ie.y:B)+O.y,range:E.number(ie.range)?ie.range:l.range,source:ae,index:V,offset:O})}for(var fe={target:null,inRange:!1,distance:0,range:0,delta:{x:0,y:0}},ye=0;ye<v.length;ye++){var xe=v[ye],he=xe.range,be=xe.x-h.x,Re=xe.y-h.y,_e=kt(be,Re),ze=_e<=he;he===1/0&&fe.inRange&&fe.range!==1/0&&(ze=!1),fe.target&&!(ze?fe.inRange&&he!==1/0?_e/he<fe.distance/fe.range:he===1/0&&fe.range!==1/0||_e<fe.distance:!fe.inRange&&_e<fe.distance)||(fe.target=xe,fe.distance=_e,fe.range=he,fe.inRange=ze,fe.delta.x=be,fe.delta.y=Re)}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}},Ll=Qe(Pr,"snap"),Rn={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"]],Pr.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 O=0,A=o.targetFields;O<A.length;O++){var B=A[O],V=B[0],U=B[1];if(V in y||U in y){y.x=y[V],y.y=y[U];break}}o.options.targets.push(y)}}var ae=Pr.set(n);return o.options=l,ae},defaults:{range:1/0,targets:null,offset:null,endOnly:!1,enabled:!1}},Fl=Qe(Rn,"snapSize"),Ir={aspectRatio:kl,restrictEdges:Il,restrict:Pl,restrictRect:Rl,restrictSize:zl,snapEdges:Qe({start:function(n){var t=n.edges;return t?(n.state.targetFields=n.state.targetFields||[[t.left?"left":"right",t.top?"top":"bottom"]],Rn.start(n)):null},set:Rn.set,defaults:ne(ut(Rn.defaults),{targets:void 0,range:void 0,offset:{x:0,y:0}})},"snapEdges"),snap:Ll,snapSize:Fl,spring:In,avoid:In,transform:In,rubberband:In},Vl={id:"modifiers",install:function(n){var t=n.interactStatic;for(var o in n.usePlugin(_i),n.usePlugin(_l),t.modifiers=Ir,Ir){var s=Ir[o],l=s._defaults,f=s._methods;l._methods=f,n.defaults.perAction[o]=l}}},Dl=Vl,Xi=(function(n){b(o,n);var t=R(o);function o(s,l,f,p,h,v){var S;if(u(this,o),En(P(S=t.call(this,h)),f),f!==l&&En(P(S),l),S.timeStamp=v,S.originalEvent=f,S.type=s,S.pointerId=Pt(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 O=S.timeStamp-h.tapTime;S.double=!!h.prevTap&&h.prevTap.type!=="doubletap"&&h.prevTap.target===S.target&&O<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),Lt={id:"pointer-events/base",before:["inertia","modifiers","auto-start","actions"],install:function(n){n.pointerEvents=Lt,n.defaults.actions.pointerEvents=Lt.defaults,ne(n.actions.phaselessTypes,Lt.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&&jr(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),O={interaction:l,pointer:f,event:p,eventTarget:h,type:"hold",targets:[],path:y,node:null},A=0;A<y.length;A++){var B=y[A];O.node=B,s.fire("pointerEvents:collect-targets",O)}if(O.targets.length){for(var V=1/0,U=0,ae=O.targets;U<ae.length;U++){var ie=ae[U].eventable.options.holdDuration;ie<V&&(V=ie)}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){jr(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){jr(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},O=0;O<v.length;O++){var A=v[O];for(var B in A.props||{})S[B]=A.props[B];var V=Ye(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&&O+1<v.length&&v[O+1].node!==S.currentTarget)break}if(t.fire("pointerEvents:fired",y),p==="tap"){var U=S.double?qe({interaction:o,pointer:s,event:l,eventTarget:f,type:"doubletap"},t):S;o.prevTap=U,o.tapTime=U.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},O=0;O<S.length;O++){var A=S[O];y.node=A,t.fire("pointerEvents:collect-targets",y)}return p==="hold"&&(y.targets=y.targets.filter((function(B){var V,U;return B.eventable.options.holdDuration===((V=o.pointers[h])==null||(U=V.hold)==null?void 0:U.duration)}))),y.targets}function jr(n){var t=n.interaction,o=n.pointerIndex,s=t.pointers[o].hold;s&&s.timeout&&(clearTimeout(s.timeout),s.timeout=null)}var Bl=Object.freeze({__proto__:null,default:Lt});function Hl(n){var t=n.interaction;t.holdIntervalHandle&&(clearInterval(t.holdIntervalHandle),t.holdIntervalHandle=null)}var Yl={id:"pointer-events/holdRepeat",install:function(n){n.usePlugin(Lt);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)]=Hl,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))}}})},Xl=Yl,Ul={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||{})}}},Kl=Ul,Gl={id:"pointer-events",install:function(n){n.usePlugin(Bl),n.usePlugin(Xl),n.usePlugin(Kl)}},Wl=Gl,Jl={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 O=p[y],A=s.getRect(O);if(!A)return 1;var B,V=jt(f.interactions.list,(function(ie){return ie.interacting()&&ie.interactable===s&&ie.element===O&&ie.prepared.name===l.name}));if(V)V.move(),v&&(B=V._reflowPromise||new h((function(ie){V._reflowResolve=ie})));else{var U=De(A),ae=(function(ie){return{coords:ie,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:U.x,y:U.y},client:{x:U.x,y:U.y},timeStamp:f.now()});B=(function(ie,fe,ye,xe,he){var be=ie.interactions.new({pointerType:"reflow"}),Re={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),wr(be.prepared,xe),be._doPhase(Re);var _e=ie.window,ze=_e.Promise,Le=ze?new ze((function(Ge){be._reflowResolve=Ge})):void 0;return be._reflowPromise=Le,be.start(xe,fe,ye),be._interacting?(be.move(Re),be.end(he)):(be.stop(),be._reflowResolve()),be.removePointer(he,he),Le})(f,s,O,l,ae)}v&&v.push(B)},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))}}},Zl=Jl;if(je.use(Si),je.use(Pi),je.use(Wl),je.use(pl),je.use(Dl),je.use(tl),je.use(Xc),je.use(Kc),je.use(Zl),je.default=je,c(e)==="object"&&e)try{e.exports=je}catch{}return je.default=je,je}))})(Ut)),Ut.exports}var ps=ds();const hs=Rr(ps);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 Qr(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=hs(b).draggable({inertia:!0,...u,onstart:({client:T})=>{const P=Se.make(T);d.current?.(P)},onmove:({client:T,clientX0:P,clientY0:R,dx:M,dy:_})=>{const j=Se.make(P,R),Q=Se.make(T),$=Se.make(M,_);g.current?.($,Q,j)},onend:({client:T,clientX0:P,clientY0:R})=>{const M=Se.make(P,R),_=Se.make(T);m.current?.(_,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,T]=N.useState(!1),[P,R]=N.useState(r),M=Ee(a),_=Ee(c),j=Ee(u),Q=Ee(i);return Qr(e,{onDragStart:w=>{b(!0),T(!1),M.current?.(w)},onDragMove:(w,k,E)=>{const z=Q.current(g.current,w.x,w.y);$r(g,z)&&R(z),b(!0),T(!1),_.current?.(w,k,E)},onDragEnd:(w,k)=>{b(!1),T(!0),j.current?.(w,k)},...d}),N.useEffect(()=>{$r(g,P)},[P]),{isDragging:m,isReleasing:C,value:P,setValue:R}}function $r(e,r){return He(e.current,r)?!1:(e.current=r,!0)}const Kn=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:T,...P},R)=>{const M=N.useCallback((z,X,J)=>z-X*r,[r]),_=N.useRef(null),j=Be(_),Q=zn({src:i},{onLoadStart:m,onLoadComplete:b,onLoadError:C}),[$,K]=N.useState(e),{isDragging:q,value:w,setValue:k}=st(_,{initialValue:0,transform:M,onDragStart:d,onDragEnd:g});N.useEffect(()=>{if(q||!Q)return;const z=ms(e,Q,we.size(j),a);z!==w&&k(z),e!==$&&K(e)},[e,Q,j.width,j.height,a]),N.useEffect(()=>{if(!q||!Q)return;const z=vs(w,Q,we.size(j),a);$!==z&&K(z)},[w,Q,j.width,j.height,a]),N.useEffect(()=>{c?.($,q),u?.($/360,q)},[$]),N.useEffect(()=>{T?.(Q)},[Q?.width,Q?.height]);const E=gs({src:i,displacement:w});return x.jsx("div",{...P,ref:R,"aria-valuenow":$,role:"slider",children:x.jsx("div",{ref:_,style:E.body})})});function gs({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 qr(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 ms(e,r,i,a){const{width:c}=qr(r,i),{width:u}=i,d=u*a;return e/360*c-d}function vs(e,r,i,a){const{width:c}=qr(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"&&(Kn.displayName="Panorama");const eo=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:T,onDragStart:P,onLoadImageComplete:R,onLoadImageError:M,onLoadImageStart:_,onImageSizeChange:j,onPositionChange:Q,...$},K)=>{const q=N.useRef(null),w=Be(q),[k,E]=N.useState(),[z,X]=N.useState(!1),se=N.useCallback(()=>{if(!k)return 0;const{width:L,height:I}=k;return I===0?0:L/I},[k?.width,k?.height])(),G=N.useCallback(()=>{const L=Math.min(360,Math.max(0,u??(m?m.width/(m.height*se)*360:0)));return w.width*(L/360)},[m?.width,m?.height,se,w.width,u])(),F=N.useCallback(()=>w.width<=0?b:((w.width-G)*.5+b*G)/w.width,[w.width,G,b])(),re=N.useCallback(()=>{X(!0),P?.()},[P]),oe=N.useCallback(()=>{X(!1),T?.()},[T]),le=Oe(c,{track:gt,reticle:Gt,indicator:Kt}),D=bs({autoDimension:a,panoramaRect:w,aspectRatio:se,reticleWidth:G});return x.jsxs("div",{...$,ref:K,className:ce(e,{dragging:z}),style:ue(r,D.root),children:[x.jsx(Kn,{ref:q,angle:i,speed:d,src:g,style:D.panorama,zeroAnchor:F,onAngleChange:C,onDragEnd:oe,onDragStart:re,onImageSizeChange:E,onLoadImageComplete:R,onLoadImageError:M,onLoadImageStart:_,onPositionChange:Q}),x.jsx("div",{style:D.body,children:x.jsxs("div",{style:D.controls,children:[x.jsx(me,{className:ce({dragging:z}),element:le.track??x.jsx(gt,{}),style:D.track}),x.jsx(me,{className:ce({dragging:z}),element:le.reticle??x.jsx(Gt,{}),style:D.reticle}),x.jsx(me,{className:ce({dragging:z}),element:le.track??x.jsx(gt,{}),style:D.track})]})}),x.jsx(me,{className:ce({dragging:z}),element:le.indicator??x.jsx(Kt,{}),style:D.indicator})]})}),Kt=({...e})=>x.jsx("div",{...e}),Gt=({...e})=>x.jsx("div",{...e}),gt=({...e})=>x.jsx("div",{...e}),ys=Object.assign(eo,{Indicator:Kt,Reticle:Gt,Track:gt});function bs({autoDimension:e="width",panoramaRect:r=we.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"&&(eo.displayName="PanoramaSlider",Kt.displayName="PanoramaSlider.Indicator",Gt.displayName="PanoramaSlider.Reticle",gt.displayName="PanoramaSlider.Track");const to=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 T=()=>{if(!a)if(c){if(!i)return;m?.(c),d?.()}else m?.(c),g?.()};return x.jsx("button",{...b,ref:C,"aria-disabled":a,"aria-label":u,"aria-selected":c,className:ce(r,{active:c,disabled:a||c&&!i}),disabled:a||c&&!i,onClick:T,children:e??u})});process.env.NODE_ENV==="development"&&(to.displayName="SelectableButton");function no({children:e,if:r}){switch(typeof r){case"function":return r()?x.jsx(x.Fragment,{children:e}):x.jsx(x.Fragment,{});default:return r?x.jsx(x.Fragment,{children:e}):x.jsx(x.Fragment,{})}}process.env.NODE_ENV==="development"&&(no.displayName="Conditional");function mt({in:e,children:r,render:i}){if(e==null)return x.jsx(x.Fragment,{});if(!(e instanceof Array))throw TypeError(`Provided list <${e}> is not an array`);return x.jsx(x.Fragment,{children:e.map((a,c)=>x.jsx(N.Fragment,{children:i?.(a,c)??(typeof r=="function"?r(a,c):r)},`item-${c}`))})}process.env.NODE_ENV==="development"&&(mt.displayName="Each");function ro({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"),x.jsx(x.Fragment,{});if(!xs(i))return console.error("[etudes::Switch] `Switch` children must be of `Case` type or `Default` type"),x.jsx(x.Fragment,{});const a=i.filter(u=>u.type===Wt);if(a.length>1)return console.error("[etudes::Switch] `Switch` can only have maximum one `Default` child"),x.jsx(x.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 Gn({children:e}){return e}function Wt({children:e}){return e}const ws=Object.assign(ro,{Case:Gn,Default:Wt});function xs(e){return e.every(r=>N.isValidElement(r)&&(r.type===Gn||r.type===Wt))}process.env.NODE_ENV==="development"&&(ro.displayName="Switch",Gn.displayName="Switch.Case",Wt.displayName="Switch.Default");const Wn=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)?Dt(a,{...r,ref:i}):a})));process.env.NODE_ENV==="development"&&(Wn.displayName="ExtractChild");function oo({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),T=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 Q=a??(C.current?Ns(C.current,b):"tl"),$=Es(j),K=Ts({alignment:Q,arrowSize:ke.make(u,c),gap:d,maxDialogWidth:m,fullDialogWidth:$.width,targetWidth:P.width}),q=ue(i,K.dialog);Object.keys(q).forEach(k=>j.style[k]=q[k]);const w=window.document.createElement("span");return Object.keys(K.arrow).forEach(k=>w.style[k]=K.arrow[k]),j.appendChild(w),j},[r,a,g,m,Fe(i),P.width,b,c,u,d]),M=N.useCallback(()=>{T.current&&(T.current.style.opacity="1",T.current.ariaHidden="false")},[]),_=N.useCallback(()=>{T.current&&(T.current.style.opacity="0",T.current.ariaHidden="true")},[]);return N.useEffect(()=>{const j=R();return C.current?.appendChild(j),T.current=j,()=>{C.current?.removeChild(j),T.current=void 0}},[R]),x.jsx(Wn,{ref:C,onMouseEnter:M,onMouseLeave:_,children:e})}function Es(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 Ns(e,r){const i=we.fromViewport(),a=we.intersecting(e);if(a){const c=a.left-i.left<r,u=i.right-a.right<r,d=a.top-i.top<r,g=i.bottom-a.bottom<r;if(c&&d)return"br";if(c&&g)return"tr";if(u&&d)return"bl";if(u&&g)return"tl";if(c)return"cr";if(u)return"cl";if(g)return"tc"}return"tc"}function Ss({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 _s({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 Ts({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`:"",...Ss({alignment:e,arrowSize:r,fullDialogWidth:i,gap:a,maxDialogWidth:c,targetWidth:u})},arrow:{background:"inherit",position:"absolute",..._s({alignment:e,arrowSize:r,fullDialogWidth:i,maxDialogWidth:c,targetWidth:u})}}}process.env.NODE_ENV==="development"&&(oo.displayName="WithTooltip");function Cs(){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 Os(e,{element:r,isEnabled:i=!0}={}){N.useLayoutEffect(()=>{if(!i)return;const a=r??window.document.documentElement,c=a.className;return a.classList.add(e),()=>{a.className=c}},[e,r,i])}function ks(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 Ps(){return typeof window>"u"?1:window.devicePixelRatio||1}function Is(){return N.useMemo(()=>Ps(),[])}function io(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),T=N.useCallback(M=>{if(!d.current)return;const _=Se.make(M.clientX,M.clientY),j=Se.subtract(_,g.current??d.current);g.current=_,b.current?.(j,_,d.current)},[]),P=N.useCallback(M=>{const _=e.current;if(!_||!d.current)return;const j=Se.make(M.clientX,M.clientY),Q=Se.subtract(g.current??d.current,j);C.current?.(j,Q,d.current),d.current=void 0,g.current=void 0,_.removeEventListener("mousemove",T),_.removeEventListener("mouseup",P,{capture:!0}),_.removeEventListener("mouseleave",P),i&&(_.style.cursor="grab")},[i,T]),R=N.useCallback(M=>{const _=e.current;if(!_)return;M.preventDefault();const j=Se.make(M.clientX,M.clientY);d.current=j,g.current=j,_.addEventListener("mousemove",T),_.addEventListener("mouseup",P,{capture:!0}),_.addEventListener("mouseleave",P),i&&(_.style.cursor="grabbing"),m.current?.(j)},[i,T,P]);N.useLayoutEffect(()=>{const M=e.current;if(!M||!r||!i)return;const _=M.style.cursor;return M.style.cursor="grab",()=>{M.style.cursor=_}},[r,i]),N.useLayoutEffect(()=>{const M=e.current;if(!(!M||!r))return M.addEventListener("mousedown",R),()=>{M.removeEventListener("mousedown",R),M.removeEventListener("mousemove",T),M.removeEventListener("mouseup",P,{capture:!0}),M.removeEventListener("mouseleave",P)}},[r,T,P,R])}function js(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 so(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 Rs(){const[e,r]=N.useState(!1);return N.useEffect(()=>(r(!0),()=>{r(!1)}),[]),e}function ao(){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 co(){return N.useMemo(()=>ao(),[])}function As(e,r,{isEnabled:i=!0,preventDefault:a=!0,capture:c=!0,target:u}={}){const d=Ee(r),g=Array.isArray(e)?e:[e],m=N.useMemo(()=>g.map(b=>b.toLowerCase()).sort(),[g]);N.useEffect(()=>{if(!i||m.length===0)return;const b=u&&typeof u=="object"&&"current"in u?u.current:u||window;if(!b)return;const C=T=>{const P=new Set([T.key.toLowerCase(),T.ctrlKey&&"control",T.metaKey&&"meta",T.shiftKey&&"shift",T.altKey&&"alt"].filter(Boolean));m.every(M=>P.has(M))&&P.size===m.length&&(a&&T.preventDefault(),d.current?.())};return b.addEventListener("keydown",C,{capture:c}),()=>{b.removeEventListener("keydown",C,{capture:c})}},[i,a,c,m.join(",")])}const Jn=typeof window<"u"?window.localStorage:void 0;function lo({defaultTTL:e=300}={}){return{get:zs,invalidate:uo,set:(r,i,a=e)=>Ls(r,i,a)}}function uo(e){Jn?.removeItem(e)}function Ms(e){const{timestamp:r,ttl:i}=e;return(Date.now()-r)/1e3>=i}function zs(e){const r=Jn?.getItem(e);if(!r)return;const i=JSON.parse(r);if(i)if(Ms(i)){uo(e);return}else return i.value}function Ls(e,r,i){const a={value:e,timestamp:Date.now(),ttl:i};return Jn?.setItem(r,JSON.stringify(a)),e}function Fs(e){return N.useMemo(()=>lo({defaultTTL:e}),[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=we.fromViewport(),r=we.clone(e,{x:0,y:0}),i=we.from(window,{overflow:!0});if(!i)return;const a=we.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 fo(e){const r=N.useRef(void 0);return N.useEffect(()=>{r.current=e},[e]),r.current}const Zn=typeof window<"u"?window.sessionStorage:void 0;function po({defaultTTL:e=300}={}){return{get:Hs,invalidate:ho,set:(r,i,a=e)=>Ys(r,i,a)}}function ho(e){Zn?.removeItem(e)}function Bs(e){const{timestamp:r,ttl:i}=e;return(Date.now()-r)/1e3>=i}function Hs(e){const r=Zn?.getItem(e);if(!r)return;const i=JSON.parse(r);if(i)if(Bs(i)){ho(e);return}else return i.value}function Ys(e,r,i){const a={value:e,timestamp:Date.now(),ttl:i};return Zn?.setItem(r,JSON.stringify(a)),e}function Xs(e){return N.useMemo(()=>po({defaultTTL:e}),[e])}function Qn(e){const[r,i]=N.useState(we.zero);return Ht(e,{onResize:a=>{const c=we.from(a);c&&i(c)}}),we.size(r)}function go(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 $n(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=go(e,{element:c,computed:!1});return $n(e,r,{element:c}),()=>{$n(e,u,{element:c})}},[e,r,i,a])}function Ks(){const[e,r]=N.useState("light");return N.useLayoutEffect(()=>{const i=window.matchMedia("(prefers-color-scheme: dark)");function a(c){r(c.matches?"dark":"light")}return r(i.matches?"dark":"light"),i.addEventListener("change",a),()=>{i.removeEventListener("change",a)}},[]),e}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 mo=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:T="none",onActivateAt:P,onDeselectAt:R,onCustomEvent:M,onSelectAt:_,onSelectionChange:j,ItemComponent:Q,...$},K)=>{const q=Js(C??[],d),w=Zs({itemLength:c,itemPadding:u,layout:g,numSegments:m,orientation:b}),k=G=>q.indexOf(G)>=0,E=G=>{k(G)?X(G):z(G)},z=G=>{if(k(G))return;let Y;switch(T){case"multiple":{Y=oe=>vo([...oe.filter(le=>le!==G),G]);break}case"single":{Y=oe=>[G];break}default:return}const F=q,re=Y(q);se(F,re)},X=G=>{if(!k(G))return;const Y=oe=>oe.filter(le=>le!==G),F=q,re=Y(q);se(F,re)},J=G=>{P?.(G),T!=="none"&&(a?E(G):z(G))},se=(G,Y)=>{if(He(G,Y))return;const F=G?.filter(oe=>Y.indexOf(oe)===-1)??[],re=Y.filter(oe=>G?.indexOf(oe)===-1);F.forEach(oe=>R?.(oe)),re.forEach(oe=>_?.(oe)),j?.(Y)};N.useEffect(()=>{const G=q;let Y;switch(T){case"multiple":Y=q;break;case"single":Y=q.slice(-1);break;default:Y=[];break}se(G,Y)},[T]);const te=Oe(r,{item:Jt});return x.jsx("div",{...$,ref:K,"aria-multiselectable":T==="multiple",className:ce(e),role:g==="grid"?"grid":T==="none"?"list":"listbox",style:ue(i,w.root),children:x.jsx(mt,{in:d,children:(G,Y)=>{const F=g==="grid"?"gridcell":T==="none"?"listitem":"option",re=k(Y),oe=ue(w.item,{pointerEvents:a!==!0&&k(Y)?"none":"auto",...Y>=d.length-1?{}:{...g==="list"?{...b==="vertical"?{marginBottom:`${u}px`}:{marginRight:`${u}px`}}:{}}});return Q?x.jsx(Q,{"aria-selected":re,className:ce({active:re}),index:Y,isSelected:k(Y),item:G,orientation:b,role:F,style:oe,onClick:()=>J(Y),onCustomEvent:(le,D)=>M?.(Y,le,D)}):x.jsx(me,{"aria-selected":re,className:ce({active:re}),element:te.item??x.jsx(Jt,{}),role:F,selectionMode:T,style:oe,onActivateAt:P,onClick:()=>J(Y),children:`${G}`})}})})}),Jt=({children:e,selectionMode:r,onActivateAt:i,...a})=>i||r==="single"||r==="multiple"?x.jsx("button",{...a,children:e}):x.jsx("div",{...a,children:e}),vt=Object.assign(mo,{Item:Jt});function Ws(e,r){return!!(isNaN(e)||e>=r.length||e<0)}function Js(e,r){return vo(e).filter(i=>!Ws(i,r))}function vo(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"&&(mo.displayName="Collection",Jt.displayName="Collection.Item");const yo=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:T,onExpandedSectionsChange:P,onExpandSectionAt:R,onHeaderCustomEvent:M,onItemCustomEvent:_,onSelectAt:j,onSelectionChange:Q,HeaderComponent:$,ItemComponent:K,...q},w)=>{const k=ea(g??{},d),E=qs(a??[],d),z=ta({orientation:c}),X=d.map(()=>N.useRef(null)),J=X.map(D=>Qn(D)),se=(D,L)=>(k[L]?.indexOf(D)??-1)>=0,te=D=>E.indexOf(D)>=0,G=D=>{let L;te(D)?L=I=>I.filter(W=>W!==D):i?L=I=>[D]:L=I=>[...I.filter(W=>W!==D),D],re(E,L(E))},Y=(D,L)=>{if(se(D,L))return;let I;switch(m){case"multiple":I=ee=>({...ee,[L]:$t([...(ee[L]??[]).filter(Z=>Z!==D),D])});break;case"single":I=ee=>({[L]:[D]});break;default:return}const W=I(k);oe(k,W)},F=(D,L)=>{if(!se(D,L))return;const W=(ee=>({...ee,[L]:(ee[L]??[]).filter(Z=>Z!==D)}))(k);oe(k,W)},re=(D,L)=>{if(He(D,L))return;const I=D?.filter(ee=>L.indexOf(ee)===-1)??[],W=L.filter(ee=>D?.indexOf(ee)===-1);I.forEach(ee=>C?.(ee)),W.forEach(ee=>R?.(ee)),P?.(L)},oe=(D,L)=>{if(He(D,L))return;const I=d.length;let W=[],ee=[];for(let Z=0;Z<I;Z++){const pe=D?.[Z]??[],ve=L[Z]??[],de=pe.filter(ne=>ve.indexOf(ne)===-1),Ne=ve.filter(ne=>pe?.indexOf(ne)===-1);W=[...W,...de.map(ne=>[ne,Z])],ee=[...ee,...Ne.map(ne=>[ne,Z])]}W.forEach(Z=>T?.(Z[0],Z[1])),ee.forEach(Z=>j?.(Z[0],Z[1])),Q?.(L)},le=Oe(e,{collapseIcon:er,expandIcon:qn,header:Zt,item:Qt,section:tr});return x.jsx("div",{...q,ref:w,style:ue(r,z.root),children:x.jsx(mt,{in:d,children:(D,L)=>{const{collectionPadding:I=0,items:W=[],itemLength:ee=50,itemPadding:Z=0,isSelectionTogglable:pe,layout:ve="list",maxVisible:de=-1,numSegments:Ne=1}=D,ne=ve==="list"?W.length:Math.ceil(W.length/Ne),Ve=de<0?ne:Math.min(ne,de),Pe=ee*Ve+Z*(Ve-1),Ce=!te(L),De=J[L];return x.jsxs(me,{element:le.section??x.jsx(tr,{}),style:ue(z.section,c==="vertical"?{marginTop:L===0?"0px":`${u}px`,...De.height>0?{height:Ce?`${De.height}px`:`${Pe+De.height+I}px`}:{visibility:"hidden"}}:{marginLeft:L===0?"0px":`${u}px`,...De.width>0?{width:Ce?`${De.width}px`:`${Pe+De.width+I}px`}:{visibility:"hidden"}}),children:[x.jsx("div",{ref:X[L],style:ue(z.headerContainer),children:$?x.jsx($,{"aria-expanded":!Ce,className:ce({collapsed:Ce,expanded:!Ce}),index:L,isCollapsed:Ce,role:"button",section:D,style:ue(z.header),onClick:()=>G(L),onCustomEvent:(Me,Ye)=>M?.(L,Me,Ye)}):x.jsxs(me,{"aria-expanded":!Ce,className:ce({collapsed:Ce,expanded:!Ce}),element:le.header??x.jsx(Zt,{}),role:"button",style:ue(z.header),onClick:()=>G(L),children:[x.jsx("span",{dangerouslySetInnerHTML:{__html:D.label}}),le.expandIcon&&x.jsx(me,{className:ce({collapsed:Ce,expanded:!Ce}),element:Ce?le.collapseIcon??le.expandIcon:le.expandIcon,style:ue(Ce?z.collapseIcon:z.expandIcon)})]})}),x.jsx("div",{role:"region",style:ue({pointerEvents:Ce?"none":"auto"},c==="vertical"?{width:"100%",height:`${Pe}px`,marginTop:`${I}px`,overflowY:de<0||de>=ne?"hidden":"scroll"}:{marginLeft:`${I}px`,overflowX:de<0||de>=ne?"hidden":"scroll",width:`${Pe}px`,height:"100%"}),children:x.jsx(vt,{className:ce({collapsed:Ce,expanded:!Ce}),isSelectionTogglable:pe,ItemComponent:K,itemLength:ee,itemPadding:Z,items:W,layout:ve,numSegments:Ne,orientation:c,selection:k[L]??[],selectionMode:m,style:ue(c==="vertical"?{width:"100%"}:{height:"100%"}),onActivateAt:Me=>b?.(Me,L),onCustomEvent:(Me,Ye,Xe)=>_?.(Me,L,Ye,Xe),onDeselectAt:Me=>F(Me,L),onSelectAt:Me=>Y(Me,L),children:!K&&(le.item??x.jsx(Qt,{}))})})]})}})})}),Zt=({children:e,...r})=>x.jsx("button",{...r,children:e}),qn=({children:e,...r})=>x.jsx("figure",{...r,children:e}),er=({children:e,...r})=>x.jsx("figure",{...r,children:e}),tr=({children:e,...r})=>x.jsx("div",{...r,children:e}),Qt=vt.Item,Qs=Object.assign(yo,{Header:Zt,ExpandIcon:qn,CollapseIcon:er,Section:tr,Item:Qt});function bo(e,r){return e>=r.length||e<0}function $s(e,r,i){if(bo(r,i))return!0;const a=i[r].items??[];return e>=a.length||e<0}function qs(e,r){return $t(e).filter(i=>!bo(i,r))}function ea(e,r){const i={};for(const a in r){if(!Object.hasOwn(r,a))continue;const c=$t([...e[a]??[]]);i[Number(a)]=$t(c).filter(u=>!$s(u,Number(a),r))}return i}function $t(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"&&(yo.displayName="Accordion",Zt.displayName="Accordion.Header",qn.displayName="Accordion.ExpandIcon",er.displayName="Accordion.CollapseIcon",Qt.displayName="Accordion.Item");const wo=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},T)=>{const P=N.useRef(void 0),R=N.useRef(null),M=N.useRef(void 0),_=N.useRef(void 0),j=N.useRef(void 0),Q=1e3,$=Ee(d),K=Ee(g),q=Ee(m),w=N.useRef(!1),k=N.useRef(!1),E=co(),[z,X]=N.useState(xo(R,c)),[J,se]=N.useState(!1),te=oa({scrollSnapEnabled:E||!J,orientation:c}),G=e>0,Y=N.useCallback(()=>{j.current!==void 0&&(clearTimeout(j.current),j.current=void 0)},[]),F=N.useCallback(()=>{Y(),j.current=setTimeout(()=>{clearTimeout(j.current),j.current=void 0},Q)},[Q,Y]),re=N.useCallback(()=>{na(R,r,c),F()},[r,c]),oe=N.useCallback(()=>{X(xo(R,c))},[c]),le=N.useCallback(Z=>{E||(M.current=Se.make(Z.clientX,Z.clientY),se(!0))},[E]),D=N.useCallback(Z=>{E||(_.current=Se.make(Z.clientX,Z.clientY),re(),se(!1))},[E,re]),L=N.useCallback(Z=>{const pe=M.current,ve=_.current;if(!pe||!ve)return;const de=5,Ne=Se.subtract(pe,ve);(Math.abs(Ne.x)>de||Math.abs(Ne.y)>de)&&Z.stopPropagation(),M.current=void 0,_.current=void 0},[]),I=N.useCallback(()=>{const Z=(r+a.length+1)%a.length;q.current?.(Z)},[J,r,a.length]),W=N.useCallback(({x:Z,y:pe})=>{const ve=R.current;!ve||w.current||(Y(),w.current=!0,requestAnimationFrame(()=>{switch(c){case"horizontal":ve.scrollLeft-=Z*1.5;break;case"vertical":ve.scrollTop-=pe*1.5;default:console.error(`[etudes::Carousel] Unsupported orientation: ${c}`)}w.current=!1}))},[c]),ee=N.useCallback(()=>{const Z=R.current;!Z||k.current||(k.current=!0,requestAnimationFrame(()=>{if(u&&oe(),!(j.current!==void 0)){const ve=Math.round(c==="horizontal"?Z.scrollLeft/Z.clientWidth:Z.scrollTop/Z.clientHeight),de=Math.max(0,Math.min(a.length-1,ve));de!==r&&(P.current=de,q.current?.(de))}k.current=!1}))},[a.length,r,c,u,oe]);return io(R,{isEnabled:!E&&i&&a.length>1,onDragMove:W}),so(J||!G?-1:e,{onInterval:I},[r]),N.useLayoutEffect(()=>{!G||E||(J?$.current?.():K.current?.())},[E,J,G]),N.useLayoutEffect(()=>{const Z=R.current;if(!Z)return;const pe=P.current===void 0,ve=P.current===r;return Z.addEventListener("scroll",ee),u&&oe(),ve||(P.current=r,pe||(q.current?.(r),re())),()=>{Z.removeEventListener("scroll",ee)}},[r,u,re,ee,oe]),x.jsx("div",{...C,ref:T,role:"region",onClick:L,onPointerCancel:D,onPointerDown:le,onPointerLeave:D,onPointerUp:D,children:x.jsx("div",{ref:R,style:ue(te.viewport),children:x.jsx(mt,{in:a,children:({style:Z,...pe},ve)=>x.jsx("div",{style:ue(te.itemContainer),children:x.jsx(b,{"aria-hidden":ve!==r,exposure:u?z?.[ve]:void 0,style:ue(Z,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 xo(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=we.intersecting(c,a);if(!u)return 0;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"&&(wo.displayName="Carousel");const Eo=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,...T},P)=>{const R=aa(b,g),M=N.useRef([]),_=sa(),j=Oe(e,{field:qt}),Q=w=>{w<0?M.current[0]?.focus():w>=g?M.current[g-1]?.focus():M.current[w]?.focus()},$=w=>k=>{const E=R[w],z=ca(k.target.value,E),X=No(R.slice(),z.split("").slice(0,g),w);C(X);const J=Math.min(w+z.length,g-1);Q(J)},K=w=>k=>{switch(k.key){case"Backspace":{if(k.preventDefault(),R[w]){const E=R.slice();E[w]="",C(E),Q(w-1)}else Q(w-1);break}case"ArrowLeft":{k.preventDefault(),Q(w-1);break}case"ArrowRight":{k.preventDefault(),Q(w+1);break}}},q=w=>k=>{k.preventDefault();const E=k.clipboardData.getData("text").trim(),z=No(R.slice(),E.split("").slice(0,g),w);C(z);const X=Math.min(w+E.length,g-1);Q(X)};return N.useEffect(()=>{if(!i)return;const w=R.findIndex(k=>k==="");w!==-1&&Q(w)},[i]),x.jsx("div",{...T,ref:P,style:ue(m,_.root),children:x.jsx(pt,{count:g,children:w=>x.jsx(me,{ref:k=>M.current[w]=k,"aria-disabled":c,"aria-required":u,autoComplete:r,disabled:c,element:j.field??x.jsx(qt,{}),inputMode:a,placeholder:d,required:u,style:ue(_.field),value:R[w],onChange:$(w),onKeyDown:K(w),onPaste:q(w)})})})}),qt=({...e})=>x.jsx("input",{...e,autoCapitalize:"off",autoCorrect:"off",type:"text"}),ia=Object.assign(Eo,{Field:qt});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 No(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"&&(Eo.displayName="CodeInput",qt.displayName="CodeInput.Field");const nr=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,...T},P)=>{const R=N.useCallback(M=>{const _=(g?.(M)??M)||r;C?.(_)},[C,g]);return x.jsx("input",{...T,ref:P,"aria-disabled":i,"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"&&(nr.displayName="TextField");const So=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?.(_(u-1))},C=()=>{d?.(_(u+1))},T=k=>{Q(k)},P=k=>{const E=M(k);E!==u?d?.(E):Q(R(E))},R=k=>k.toLocaleString(),M=k=>{const E=parseInt(k,10);return E.toString()!==k.replace(/^0+/,"")?u:_(E)},_=k=>{let E=k;return isNaN(c)||(E=Math.max(c,E)),isNaN(a)||(E=Math.min(a,E)),E},[j,Q]=N.useState(R(u)),$=fo(u),K=!isNaN(a)&&u+1>a,q=!isNaN(c)&&u-1<c;N.useEffect(()=>{if($===void 0||$===u)return;const k=_(u);Q(R(k))},[u,c,a]);const w=Oe(e,{textField:en,addButton:tn,subscribeButton:nn});return x.jsxs("div",{...g,ref:m,style:ue(r,rn.root),children:[x.jsx(me,{className:ce({disabled:q}),element:w.subscribeButton??x.jsx(nn,{}),style:ue(rn.subtract),onClick:()=>b()}),x.jsx(me,{element:w.textField??x.jsx(en,{}),isDisabled:!i,style:ue(rn.textField),value:j,onChange:T,onUnfocus:P}),x.jsx(me,{className:ce({disabled:K}),element:w.addButton??x.jsx(tn,{}),style:ue(rn.add),onClick:()=>C()})]})}),en=({...e})=>x.jsx(nr,{...e}),tn=({children:e,...r})=>x.jsx("button",{...r,children:e}),nn=({children:e,...r})=>x.jsx("button",{...r,children:e}),la=Object.assign(So,{TextField:en,AddButton:tn,SubtractButton:nn}),rn={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"&&(So.displayName="Counter",tn.displayName="Counter.AddButton",nn.displayName="Counter.SubtractButton",en.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,T=Math.max(0,Math.min(360,a)),P=Oe(e,{track:on,knob:sn}),R=da({angle:i,diameter:C});return x.jsxs("div",{...m,ref:b,style:ue(r,R.root),children:[x.jsx("div",{style:R.trackContainer,children:x.jsx("svg",{height:C,style:R.svgContainer,viewBox:`0 0 ${C} ${C}`,width:C,children:x.jsx(me,{cx:u,cy:u,element:P.track??x.jsx(on,{}),fill:"none",r:u-g/2,strokeDasharray:d,strokeWidth:g})})}),x.jsx("div",{style:ue(R.knobContainer),children:x.jsx("svg",{style:R.svgContainer,viewBox:`0 0 ${C} ${C}`,xmlns:"http://www.w3.org/2000/svg",children:x.jsx(me,{d:fa(u,u,u-c/2-(g-c)/2,-T/2,T/2),element:P.knob??x.jsx(sn,{}),fill:"none",strokeWidth:c})})})]})}),on=({...e})=>x.jsx("circle",{...e}),sn=({...e})=>x.jsx("path",{...e}),_o=Object.assign(ua,{Track:on,Knob:sn});function To(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=To(e,r,i,c),d=To(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",on.displayName="Dial.Track",sn.displayName="Dial.Knob");const Co=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:T=0,items:P=[],maxVisibleItems:R=-1,numSegments:M=1,orientation:_="vertical",selection:j=[],selectionMode:Q="single",onActivateAt:$,onCollapse:K,onDeselectAt:q,onExpand:w,onSelectAt:k,onSelectionChange:E,onToggleCustomEvent:z,ItemComponent:X,ToggleComponent:J,...se},te)=>{const G=N.useRef(null),Y=Be(G),F=P.length,re=va(P,R,M,m),oe=C??(_==="vertical"?Y.height:Y.width),le=oe*re+T*(re-1),D=ga(j,P),[L,I]=N.useState(u??!0),W=ya({isCollapsed:L,collectionPadding:c,isInverted:d,maxVisibleItems:R,menuLength:le,numItems:F,orientation:_}),ee=Oe(e,{collapseIcon:rr,collection:an,expandIcon:or,item:cn,toggle:ln}),Z=()=>{L&&(I(!1),w?.())},pe=()=>{L||(I(!0),K?.())},ve=()=>{L?Z():pe()},de=Ne=>{k?.(Ne),Q==="single"&&a&&pe()};return N.useEffect(()=>{u!==void 0&&I(u)},[u]),N.useEffect(()=>{const Ne=ne=>{if(L||!(ne.target instanceof Node))return;let Ve=!0,Pe=ne.target;for(;Pe;){if(Pe===G.current){Ve=!1;break}if(!Pe.parentNode)break;Pe=Pe.parentNode}Ve&&pe()};return window.addEventListener("click",Ne),()=>{window.removeEventListener("click",Ne)}},[L]),x.jsx("div",{...se,ref:te,className:ce(r,{collapsed:L,expanded:!L}),style:ue(i,W.root),children:x.jsxs("div",{ref:G,style:ue(W.body),children:[J?x.jsx(J,{"aria-expanded":!L,"aria-haspopup":"listbox",className:ce({collapsed:L,expanded:!L}),style:ue(W.toggle),onClick:ve,onCustomEvent:(Ne,ne)=>z?.(Ne,ne)}):x.jsxs(me,{"aria-expanded":!L,"aria-haspopup":"listbox",className:ce({collapsed:L,expanded:!L}),element:ee.toggle??x.jsx(ln,{}),style:ue(W.toggle),onClick:ve,children:[x.jsx("span",{dangerouslySetInnerHTML:{__html:g?.(D)??(D.length>0?D.map(Ne=>P[Ne]).join(", "):"")}}),ee.expandIcon&&x.jsx(me,{className:ce({collapsed:L,expanded:!L}),element:L?ee.collapseIcon??ee.expandIcon:ee.expandIcon,style:ue(L?W.collapseIcon:W.expandIcon)})]}),x.jsx(me,{element:ee.collection??x.jsx(an,{}),isSelectionTogglable:b,ItemComponent:X,itemLength:oe,itemPadding:T,items:P,layout:m,numSegments:M,orientation:_,selection:D,selectionMode:Q,style:ue(W.collection),onActivateAt:$,onDeselectAt:q,onSelectAt:de,onSelectionChange:E,children:!X&&(ee.item??x.jsx(cn,{}))})]})})}),an=vt,cn=vt.Item,ln=({children:e,...r})=>x.jsx("button",{...r,children:e}),rr=({children:e,...r})=>x.jsx("figure",{...r,"aria-hidden":!0,children:e}),or=({children:e,...r})=>x.jsx("figure",{...r,"aria-hidden":!0,children:e}),pa=Object.assign(Co,{Collection:an,CollapseIcon:rr,ExpandIcon:or,Item:cn,Toggle:ln});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;switch(a){case"grid":{const u=i<1?c:Math.ceil(c/i);return r<0?u:Math.min(u,r)}default: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"&&(Co.displayName="Dropdown",an.displayName="Dropdown.Collection",rr.displayName="Dropdown.CollapseIcon",or.displayName="Dropdown.ExpandIcon",cn.displayName="Dropdown.Item",ln.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 ko(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 un=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=Io(e,u),u.err)return u}else if(e[u]==="<"){let d=u;if(u++,e[u]==="!"){u=jo(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
- `&&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 T;return m.trim().length===0?T="Invalid space after '<'.":T="Tag '"+m+"' is an invalid name.",Te("InvalidTag",T,Ie(e,u))}const b=Ca(e,u);if(b===!1)return Te("InvalidAttr","Attributes for '"+m+"' have open quote.",Ie(e,u));let C=b.value;if(u=b.index,C[C.length-1]==="/"){const T=u-C.length;C=C.substring(0,C.length-1);const P=Ro(C,r);if(P===!0)a=!0;else return Te(P.err.code,P.err.msg,Ie(e,T+P.err.line))}else if(g)if(b.tagClosed){if(C.trim().length>0)return Te("InvalidTag","Closing tag '"+m+"' can't have attributes or invalid starting.",Ie(e,d));if(i.length===0)return Te("InvalidTag","Closing tag '"+m+"' has not been opened.",Ie(e,d));{const T=i.pop();if(m!==T.tagName){let P=Ie(e,T.tagStartPos);return Te("InvalidTag","Expected closing tag '"+T.tagName+"' (opened in line "+P.line+", col "+P.col+") instead of closing tag '"+m+"'.",Ie(e,d))}i.length==0&&(c=!0)}}else return Te("InvalidTag","Closing tag '"+m+"' doesn't have proper closing.",Ie(e,u));else{const T=Ro(C,r);if(T!==!0)return Te(T.err.code,T.err.msg,Ie(e,u-C.length+T.err.line));if(c===!0)return Te("InvalidXml","Multiple possible root nodes found.",Ie(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=jo(e,u);continue}else if(e[u+1]==="?"){if(u=Io(e,++u),u.err)return u}else break;else if(e[u]==="&"){const T=Pa(e,u);if(T==-1)return Te("InvalidChar","char '&' is not expected.",Ie(e,u));u=T}else if(c===!0&&!Po(e[u]))return Te("InvalidXml","Extra text at the end",Ie(e,u));e[u]==="<"&&u--}}else{if(Po(e[u]))continue;return Te("InvalidChar","char '"+e[u]+"' is not expected.",Ie(e,u))}if(a){if(i.length==1)return Te("InvalidTag","Unclosed tag '"+i[0].tagName+"'.",Ie(e,i[0].tagStartPos));if(i.length>0)return Te("InvalidXml","Invalid '"+JSON.stringify(i.map(u=>u.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return Te("InvalidXml","Start tag expected.",1);return!0}function Po(e){return e===" "||e===" "||e===`
8
- `||e==="\r"}function Io(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 Te("InvalidXml","XML declaration allowed only at the start of the document.",Ie(e,r));if(e[r]=="?"&&e[r+1]==">"){r++;break}else continue}return r}function jo(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 _a='"',Ta="'";function Ca(e,r){let i="",a="",c=!1;for(;r<e.length;r++){if(e[r]===_a||e[r]===Ta)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 Oa=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function Ro(e,r){const i=ko(e,Oa),a={};for(let c=0;c<i.length;c++){if(i[c][1].length===0)return Te("InvalidAttr","Attribute '"+i[c][2]+"' has no space in starting.",yt(i[c]));if(i[c][3]!==void 0&&i[c][4]===void 0)return Te("InvalidAttr","Attribute '"+i[c][2]+"' is without value.",yt(i[c]));if(i[c][3]===void 0&&!r.allowBooleanAttributes)return Te("InvalidAttr","boolean attribute '"+i[c][2]+"' is not allowed.",yt(i[c]));const u=i[c][2];if(!Ia(u))return Te("InvalidAttr","Attribute '"+u+"' is an invalid name.",yt(i[c]));if(!a.hasOwnProperty(u))a[u]=1;else return Te("InvalidAttr","Attribute '"+u+"' is repeated.",yt(i[c]))}return!0}function ka(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++,ka(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 Te(e,r,i){return{err:{code:e,msg:r,line:i.line||i,col:i.col}}}function Ia(e){return un(e)}function ja(e){return un(e)}function Ie(e,r){const i=e.substring(0,r).split(/\r?\n/);return{line:i.length,col:i[i.length-1].length+1}}function yt(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 fn;typeof Symbol!="function"?fn="@@xmlMetadata":fn=Symbol("XML Node Metadata");class et{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][fn]={startIndex:i})}static getMetaDataSymbol(){return fn}}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&&tt(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&&tt(r,"!ELEMENT",i)){i+=8;const{index:g}=this.readElementExp(r,i+1);i=g}else if(u&&tt(r,"!ATTLIST",i))i+=8;else if(u&&tt(r,"!NOTATION",i)){i+=9;const{index:g}=this.readNotationExp(r,i+1,this.suppressValidationErr);i=g}else if(tt(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=Ae(r,i);let a="";for(;i<r.length&&!/\s/.test(r[i])&&r[i]!=='"'&&r[i]!=="'";)a+=r[i],i++;if(bt(a),i=Ae(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=Ae(r,i);let a="";for(;i<r.length&&!/\s/.test(r[i]);)a+=r[i],i++;!this.suppressValidationErr&&bt(a),i=Ae(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=Ae(r,i);let u=null,d=null;if(c==="PUBLIC")[i,u]=this.readIdentifierVal(r,i,"publicIdentifier"),i=Ae(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=Ae(r,i);let a="";for(;i<r.length&&!/\s/.test(r[i]);)a+=r[i],i++;if(!this.suppressValidationErr&&!un(a))throw new Error(`Invalid element name: "${a}"`);i=Ae(r,i);let c="";if(r[i]==="E"&&tt(r,"MPTY",i))i+=4;else if(r[i]==="A"&&tt(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=Ae(r,i);let a="";for(;i<r.length&&!/\s/.test(r[i]);)a+=r[i],i++;bt(a),i=Ae(r,i);let c="";for(;i<r.length&&!/\s/.test(r[i]);)c+=r[i],i++;if(!bt(c))throw new Error(`Invalid attribute name: "${c}"`);i=Ae(r,i);let u="";if(r.substring(i,i+8).toUpperCase()==="NOTATION"){if(u="NOTATION",i+=8,i=Ae(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(),!bt(m))throw new Error(`Invalid notation name: "${m}"`);g.push(m),r[i]==="|"&&(i++,i=Ae(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=Ae(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 Ae=(e,r)=>{for(;r<e.length&&/\s/.test(e[r]);)r++;return r};function tt(e,r,i){for(let a=0;a<r.length;a++)if(r[a]!==e[i+a+1])return!1;return!0}function bt(e){if(un(e))return e;throw new Error(`Invalid entity name ${e}`)}const za=/^[-+]?0x[a-fA-F0-9]+$/,La=/^([\-\+])?(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&&za.test(i))return Ya(i,16);if(i.search(/.+[eE].+/)!==-1)return Ba(e,i,r);{const a=La.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 Ao(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=Ao(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?sr(e,this.options.parseTagValue,this.options.numberParseOptions):e.trim()===e?sr(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,i){if(this.options.ignoreAttributes!==!0&&typeof e=="string"){const a=ko(e,Wa),c=a.length,u={};for(let d=0;d<c;d++){const g=this.resolveNameSpace(a[d][1]);if(this.ignoreAttributesFn(g,r))continue;let m=a[d][4],b=this.options.attributeNamePrefix+g;if(g.length)if(this.options.transformAttributeName&&(b=this.options.transformAttributeName(b)),b==="__proto__"&&(b="#__proto__"),m!==void 0){this.options.trimValues&&(m=m.trim()),m=this.replaceEntitiesValue(m);const C=this.options.attributeValueProcessor(g,m,r);C==null?u[b]=m:typeof C!=typeof m||C!==m?u[b]=C:u[b]=sr(m,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(u[b]=!0)}if(!Object.keys(u).length)return;if(this.options.attributesGroupName){const d={};return d[this.options.attributesGroupName]=u,d}return u}}const Za=function(e){e=e.replace(/\r\n?/g,`
9
- `);const r=new et("!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=nt(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 T=0;C&&this.options.unpairedTags.indexOf(C)!==-1?(T=c.lastIndexOf(".",c.lastIndexOf(".")-1),this.tagsNodeStack.pop()):T=c.lastIndexOf("."),c=c.substring(0,T),i=this.tagsNodeStack.pop(),a="",d=m}else if(e[d+1]==="?"){let m=ir(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 et(m.tagName);b.add(this.options.textNodeName,""),m.tagName!==m.tagExp&&m.attrExpPresent&&(b[":@"]=this.buildAttributesMap(m.tagExp,c,m.tagName)),this.addChild(i,b,c,d)}d=m.closeIndex+1}else if(e.substr(d+1,3)==="!--"){const m=nt(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=nt(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=ir(e,d,this.options.removeNSPrefix),b=m.tagName;const C=m.rawTagName;let T=m.tagExp,P=m.attrExpPresent,R=m.closeIndex;this.options.transformTagName&&(b=this.options.transformTagName(b)),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 _=d;if(this.isItStopNode(this.stopNodesExact,this.stopNodesWildcard,c,b)){let j="";if(T.length>0&&T.lastIndexOf("/")===T.length-1)b[b.length-1]==="/"?(b=b.substr(0,b.length-1),c=c.substr(0,c.length-1),T=b):T=T.substr(0,T.length-1),d=m.closeIndex;else if(this.options.unpairedTags.indexOf(b)!==-1)d=m.closeIndex;else{const $=this.readStopNodeData(e,C,R+1);if(!$)throw new Error(`Unexpected end of ${C}`);d=$.i,j=$.tagContent}const Q=new et(b);b!==T&&P&&(Q[":@"]=this.buildAttributesMap(T,c,b)),j&&(j=this.parseTextData(j,b,c,!0,P,!0,!0)),c=c.substr(0,c.lastIndexOf(".")),Q.add(this.options.textNodeName,j),this.addChild(i,Q,c,_)}else{if(T.length>0&&T.lastIndexOf("/")===T.length-1){b[b.length-1]==="/"?(b=b.substr(0,b.length-1),c=c.substr(0,c.length-1),T=b):T=T.substr(0,T.length-1),this.options.transformTagName&&(b=this.options.transformTagName(b));const j=new et(b);b!==T&&P&&(j[":@"]=this.buildAttributesMap(T,c,b)),this.addChild(i,j,c,_),c=c.substr(0,c.lastIndexOf("."))}else{const j=new et(b);this.tagsNodeStack.push(i),b!==T&&P&&(j[":@"]=this.buildAttributesMap(T,c,b)),this.addChild(i,j,c,_),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 nt(e,r,i,a){const c=e.indexOf(r,i);if(c===-1)throw new Error(a);return c+r.length-1}function ir(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 T=m.indexOf(":");T!==-1&&(m=m.substr(T+1),b=m!==c.data.substr(T+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=nt(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=nt(e,"?>",i+1,"StopNode is not closed.");else if(e.substr(i+1,3)==="!--")i=nt(e,"-->",i+3,"StopNode is not closed.");else if(e.substr(i+1,2)==="![")i=nt(e,"]]>",i,"StopNode is not closed.")-2;else{const u=ir(e,i,">");u&&((u&&u.tagName)===r&&u.tagExp[u.tagExp.length-1]!=="/"&&c++,i=u.closeIndex)}}function sr(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 ar=et.getMetaDataSymbol();function rc(e,r){return Mo(e,r)}function Mo(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=Mo(d[g],r,m);const C=sc(b,r);d[ar]!==void 0&&(b[ar]=d[ar]),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 et.getMetaDataSymbol()}}const cc=`
10
- `;function lc(e,r){let i="";return r.format&&r.indentBy.length>0&&(i=cc),zo(e,r,"",i)}function zo(e,r,i,a){let c="",u=!1;for(let d=0;d<e.length;d++){const g=e[d],m=uc(g);if(m===void 0)continue;let b="";if(i.length===0?b=m:b=`${i}.${m}`,m===r.textNodeName){let M=g[m];fc(b,r)||(M=r.tagValueProcessor(m,M),M=Fo(M,r)),u&&(c+=a),c+=M,u=!1;continue}else if(m===r.cdataPropName){u&&(c+=a),c+=`<![CDATA[${g[m][0][r.textNodeName]}]]>`,u=!1;continue}else if(m===r.commentPropName){c+=a+`<!--${g[m][0][r.textNodeName]}-->`,u=!0;continue}else if(m[0]==="?"){const M=Lo(g[":@"],r),_=m==="?xml"?"":a;let j=g[m][0][r.textNodeName];j=j.length!==0?" "+j:"",c+=_+`<${m}${j}${M}?>`,u=!0;continue}let C=a;C!==""&&(C+=r.indentBy);const T=Lo(g[":@"],r),P=a+`<${m}${T}`,R=zo(g[m],r,b,C);r.unpairedTags.indexOf(m)!==-1?r.suppressUnpairedNode?c+=P+">":c+=P+"/>":(!R||R.length===0)&&r.suppressEmptyNode?c+=P+"/>":R&&R.endsWith(">")?c+=P+`>${R}${a}</${m}>`:(c+=P+">",R&&a!==""&&(R.includes("/>")||R.includes("</"))?c+=a+r.indentBy+R+a:c+=R,c+=`</${m}>`),u=!0}return c}function uc(e){const r=Object.keys(e);for(let i=0;i<r.length;i++){const a=r[i];if(e.hasOwnProperty(a)&&a!==":@")return a}}function Lo(e,r){let i="";if(e&&!r.ignoreAttributes)for(let a in e){if(!e.hasOwnProperty(a))continue;let c=r.attributeValueProcessor(a,e[a]);c=Fo(c,r),c===!0&&r.suppressBooleanAttributes?i+=` ${a.substr(r.attributeNamePrefix.length)}`:i+=` ${a.substr(r.attributeNamePrefix.length)}="${c}"`}return i}function fc(e,r){e=e.substr(0,e.length-r.textNodeName.length-1);let i=e.substr(e.lastIndexOf(".")+1);for(let a in r.stopNodes)if(r.stopNodes[a]===e||r.stopNodes[a]==="*."+i)return!0;return!1}function Fo(e,r){if(e&&e.length>0&&r.processEntities)for(let i=0;i<r.entities.length;i++){const a=r.entities[i];e=e.replace(a.regex,a.val)}return e}const dc={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(e,r){return r},attributeValueProcessor:function(e,r){return r},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&amp;"},{regex:new RegExp(">","g"),val:"&gt;"},{regex:new RegExp("<","g"),val:"&lt;"},{regex:new RegExp("'","g"),val:"&apos;"},{regex:new RegExp('"',"g"),val:"&quot;"}],processEntities:!0,stopNodes:[],oneListGroup:!1};function We(e){this.options=Object.assign({},dc,e),this.options.ignoreAttributes===!0||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=Ao(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=gc),this.processTextOrObjNode=pc,this.options.format?(this.indentate=hc,this.tagEndChar=`>
6
+ <%s key={someKey} {...props} />`,Z,de,Ne,de),L[de+Z]=!0)}if(de=null,ee!==void 0&&(i(ee),de=""+ee),d(W)&&(i(W.key),de=""+W.key),"key"in W){ee={};for(var ne in W)ne!=="key"&&(ee[ne]=W[ne])}else ee=W;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===X&&(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"),Q=Symbol.for("react.strict_mode"),$=Symbol.for("react.profiler"),K=Symbol.for("react.consumer"),q=Symbol.for("react.context"),w=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),E=Symbol.for("react.suspense_list"),z=Symbol.for("react.memo"),X=Symbol.for("react.lazy"),J=Symbol.for("react.activity"),se=Symbol.for("react.client.reference"),te=R.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G=Object.prototype.hasOwnProperty,Y=Array.isArray,F=console.createTask?console.createTask:function(){return null};R={react_stack_bottom_frame:function(I){return I()}};var re,oe={},le=R.react_stack_bottom_frame.bind(R,u)(),B=F(a(u)),L={};dt.Fragment=j,dt.jsx=function(I,W,ee){var Z=1e4>te.recentlyCreatedOwnerStacks++;return C(I,W,ee,!1,Z?Error("react-stack-top-frame"):le,Z?F(a(I)):B)},dt.jsxs=function(I,W,ee){var Z=1e4>te.recentlyCreatedOwnerStacks++;return C(I,W,ee,!0,Z?Error("react-stack-top-frame"):le,Z?F(a(I)):B)}})()),dt}var zr;function Wi(){return zr||(zr=1,process.env.NODE_ENV==="production"?Vt.exports=Ki():Vt.exports=Gi()),Vt.exports}var x=Wi();function Lr(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=Lr(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=Lr(e))&&(a&&(a+=" "),a+=r);return a}function pt({count:e=1,children:r,render:i}){return x.jsx(x.Fragment,{children:[...Array(e)].map((a,c)=>x.jsx(N.Fragment,{children:i?.(c)??(typeof r=="function"?r(c):r)},`element-${c}`))})}process.env.NODE_ENV==="development"&&(pt.displayName="Repeat");function Dt(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 Dt(r,i,...e?Array.isArray(e)?e:[e]:[])}process.env.NODE_ENV==="development"&&(me.displayName="Styled");function Ji(e){return e}function ke(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 ue(...e){return e.reduce((r,i)=>({...r,...i||{}}),{})}const Fr=N.forwardRef(({children:e,className:r,isActive:i=!1,isTailHidden:a=!1,isSplit:c=!1,numberOfBars:u=3,...d},g)=>{const m=ke(e,{bar:Bt}),b={root:ce({active:i}),bar:ce({active:i})},C=Qi({isSplit:c,isActive:i,isTailHidden:a});return x.jsx("div",{...d,ref:g,className:ce(r,b.root),children:x.jsx(pt,{count:c?2:1,children:_=>x.jsx("div",{"aria-hidden":!0,style:ue(C.section,C[`section${_}`]),children:x.jsx(pt,{count:u,children:P=>x.jsx(me,{"aria-hidden":!0,className:ce(b.bar),element:m.bar??x.jsx(Bt,{}),style:(()=>{switch(u){case 2:return ue(C.bar,C[`bar${_}${P===0?0:2}`]);case 3:default:return ue(C.bar,C[`bar${_}${P}`])}})()})})})})})}),Bt=({...e})=>x.jsx("span",{...e}),Mn=Object.assign(Fr,{Bar:Bt});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"&&(Fr.displayName="Burger",Bt.displayName="Burger.Bar");const Vr=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 x.jsx("button",{...C,ref:_,"aria-expanded":a,className:ce(r,R.root),style:ue(i,M.root),onClick:P,children:x.jsx(Mn,{isActive:a,isSplit:u,isTailHidden:c,numberOfBars:d,children:e})})}),Dr=Mn.Bar,$i=Object.assign(Vr,{Bar:Dr});function qi(){return{root:{background:"transparent",border:"none",display:"block",outline:"none"}}}process.env.NODE_ENV==="development"&&(Vr.displayName="BurgerButton",Dr.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=we.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=we.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=we.intersecting.apply(null,c);return u?u.width*u.height!==0:!1}}}catch(i){return console.error(i),!1}}var Oe;(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})(Oe||(Oe={}));var we;(e=>{e.zero=r();function r(w=0,O=0,E=0,z=0){if(typeof w=="number"&&typeof O=="number"){const X=w,J=O;return{top:J,right:X+E,bottom:J+z,left:X,width:E,height:z}}else if(Se.isPoint(w)&&Oe.isSize(O)){const X=w,J=O;return{top:X.y,right:X.x+J.width,bottom:X.y+J.height,left:X.x,width:J.width,height:J.height}}else{const X=w;if(!$(X))throw Error("Invalid parameters passed to constructor");return{top:X.y,right:X.x+X.width,bottom:X.y+X.height,left:X.x,width:X.width,height:X.height}}}e.make=r;function i(w){return Se.make({x:(w.right-w.left)/2+w.left,y:(w.bottom-w.top)/2+w.top})}e.center=i;function a(w){return Oe.make({width:w.width,height:w.height})}e.size=a;function c(w,O={}){try{if(w==null)return;if(K(w))return w;if(ht(w))return c(document.documentElement||document.body.parentNode||document.body,O);const E=w instanceof Array?w:[w],z=E.length,X=O.reference||window,J=u(),se=ht(X)?J:c(O.reference);if(!J||!se)return;let te;for(let G=0;G<z;G++){const Y=E[G],F=Y.getBoundingClientRect(),re=r({x:F.left+J.left-(ht(X)?0:se.left),y:F.top+J.top-(ht(X)?0:se.top),width:O.overflow?Y.scrollWidth:Y instanceof HTMLElement?Y.offsetWidth:F.width,height:O.overflow?Y.scrollHeight:Y instanceof HTMLElement?Y.offsetHeight:F.height});te=te?P(te,re):re}return te}catch(E){console.error(E);return}}e.from=c;function u(){const w=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,z=window.pageYOffset!==void 0?window.pageYOffset:(document.documentElement||document.body.parentNode||document.body).scrollTop;return r({x:E,y:z,width:w,height:O})}e.fromViewport=u;function d(w,O={}){if(w)return ht(w)?c(Array.from(document.body.children)):c(Array.from(w.children),{overflow:O.overflow,reference:O.reference||w})}e.fromChildrenOf=d;function g(w,O,E={}){if(!O)return;const z=Array.from(O.children);return w<=0?r():w>=z.length?c(z,{reference:E.reference,overflow:!1}):(z.splice(w),c(z,{reference:E.reference||O,overflow:!1}))}e.fromChildrenBefore=g;function m(w,O,E={}){if(!O)return;const z=Array.from(O.children);return w<0?c(z,{reference:E.reference,overflow:!1}):w>=z.length-1?r():(z.splice(0,z.length-w-1),c(z,{reference:E.reference||O,overflow:!1}))}e.fromChildrenAfter=m;function b(w,O,E={}){if(!O)return;const z=O.children[w];return c(z,{overflow:E.overflow,reference:E.reference||O})}e.fromChildAt=b;function C(...w){try{const O=w.length,E={};let z,X;for(let J=0;J<O;J++){if(z||(z=c(w[J])),J===0&&J+1===O)X=u();else if(J+1<O)X=c(w[J+1]);else break;!z||!X||(E.width=Math.max(0,Math.min(z.right,X.right)-Math.max(z.left,X.left)),E.height=Math.max(0,Math.min(z.bottom,X.bottom)-Math.max(z.top,X.top)),E.y=Math.max(z.top,X.top),E.x=Math.max(z.left,X.left),E.width*E.height===0&&(E.width=0,E.height=0,E.y=NaN,E.x=NaN),z=r(E))}return r(E)}catch(O){console.error(O);return}}e.intersecting=C;function _(w,O={}){return r({x:typeof O.x=="number"?O.x:w.left,y:typeof O.y=="number"?O.y:w.top,width:typeof O.width=="number"?O.width:w.width,height:typeof O.height=="number"?O.height:w.height})}e.clone=_;function P(w,O){return r({x:Math.min(w.left,O.left),y:Math.min(w.top,O.top),width:Math.max(w.right,O.right)-Math.min(w.left,O.left),height:Math.max(w.bottom,O.bottom)-Math.min(w.top,O.top)})}e.concat=P;function R(w){return r({x:w.left,y:w.top,width:w.height,height:w.width})}e.rotate=R;function M(w,O){return!(w.top!==O.top||w.right!==O.right||w.bottom!==O.bottom||w.left!==O.left||w.width!==O.width||w.height!==O.height)}e.isEqual=M;function T(w,O){return es(O,w)}e.contains=T;function j(w){return`Rect(top=${w.top}, right=${w.right}, bottom=${w.bottom}, left=${w.left}, width=${w.width}, height=${w.height})`}e.toString=j;function Q(w){return Object.freeze({top:w.top,right:w.right,bottom:w.bottom,left:w.left,width:w.width,height:w.height})}e.toJSON=Q;function $(w){return!(typeof w.x!="number"||typeof w.y!="number"||typeof w.width!="number"||typeof w.height!="number")}e.isValidDescriptor=$;function K(w){return typeof w=="object"&&typeof w.top=="number"&&typeof w.right=="number"&&typeof w.bottom=="number"&&typeof w.left=="number"&&typeof w.width=="number"&&typeof w.height=="number"}e.isRect=K;function q(w){return w.top===0&&w.right===0&&w.bottom===0&&w.left===0&&w.width===0&&w.height===0}e.isZero=q})(we||(we={}));function ht(e){return e===window}function Ee(e){const r=N.useRef(e);return N.useEffect(()=>{r.current=e},[e]),r}function Br(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 Ht(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 Hr(){const[e,r]=N.useState(Oe.zero);return N.useLayoutEffect(()=>{const i=()=>{const a=we.size(we.fromViewport());r(a)};return window.addEventListener("resize",i),i(),()=>{window.removeEventListener("resize",i)}},[]),e}function Be(e){const[r,i]=N.useState(we.zero),a=Hr();return Ht(e,{onResize:c=>{const u=we.from(c);u&&i(u)}}),Br(e,{onChange:c=>{const u=we.from(c);u&&i(u)}}),N.useLayoutEffect(()=>{const c=e.current,u=we.from(c);u&&i(u)},[Oe.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 Yr({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 Yr({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 Oe.make(e.width,e.height)}const Ln=N.forwardRef(({alt:e,source:r,loadingMode:i,src:a,style:c,onLoadStart:u,onLoadComplete:d,onLoadError:g,onSizeChange:m,...b},C)=>{const _=r?D.ImageSource.asProps(r):void 0,P=zn({src:a,srcSet:_?.srcSet,sizes:_?.sizes},{onLoadStart:u,onLoadComplete:d,onLoadError:g}),R=ns();return N.useEffect(()=>{m?.(P)},[P?.width,P?.height]),x.jsx("img",{...b,..._,ref:C,alt:e,loading:i,src:a,style:{...R.root,...c}})});function ns(){return{root:{fontSize:"0"}}}process.env.NODE_ENV==="development"&&(Ln.displayName="Image");const Fn=N.forwardRef(({alt:e,loadingMode:r,sources:i=[],src:a,onLoadComplete:c,onLoadError:u,onLoadStart:d,onSizeChange:g,...m},b)=>x.jsxs("picture",{...m,ref:b,children:[i.map((C,_)=>x.jsx("source",{...D.ImageSource.asProps(C)},_)),x.jsx(Ln,{alt:e,loadingMode:r,src:a,style:{width:"100%",height:"100%"},onLoadComplete:c,onLoadError:u,onLoadStart:d,onSizeChange:g})]}));process.env.NODE_ENV==="development"&&(Fn.displayName="Picture");const Xr=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),Q=isNaN(i)?T:i,$=Be(M),K=$.width/$.height,q=Oe.make(K>1?Math.max($.width,$.height*Q):Math.max($.width,Math.max($.height,$.width/Q)*Q),K>1?Math.max($.height,Math.max($.width,$.height*Q)/Q):Math.max($.height,$.width/Q)),w=ke(e,{content:Yt,viewport:Xt});return x.jsxs("div",{...C,ref:M,style:ue(d,Vn.root),children:[x.jsx(Fn,{alt:r,sources:a,src:u,style:ue(Vn.viewport,{height:`${q.height}px`,maxWidth:"unset",width:`${q.width}px`}),onLoadComplete:m,onLoadError:b,onLoadStart:g,onSizeChange:O=>P(O)}),w.viewport&&x.jsx(me,{element:w.viewport,style:ue(Vn.viewport,{height:`${q.height}px`,pointerEvents:"none",width:`${q.width}px`})}),w.content]})}),Yt=({children:e,...r})=>x.jsx("div",{...r,children:e}),Xt=({children:e,...r})=>x.jsx("div",{...r,children:e}),rs=Object.assign(Xr,{Content:Yt,Viewport:Xt}),Vn={root:{overflow:"hidden"},viewport:{fontSize:"0",left:"50%",position:"absolute",top:"50%",transform:"translate(-50%, -50%)"}};process.env.NODE_ENV==="development"&&(Xr.displayName="CoverImage",Yt.displayName="CoverImage.Content",Xt.displayName="CoverImage.Viewport");function Ur(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 Kr(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(os(R)),m.current?.(R)},[]),P=N.useCallback(R=>{r||d(void 0),b.current?.(R)},[r]);return Ur(e,{onLoadStart:C,onLoadComplete:_,onLoadError:P}),u}function os(e){if(e&&typeof e.videoWidth=="number"&&typeof e.videoHeight=="number")return Oe.make(e.videoWidth,e.videoHeight)}const Dn=N.forwardRef(({autoLoop:e=!0,autoPlay:r=!0,hasControls:i=!1,isMuted:a=!0,playsInline:c=!0,posterSrc:u,src:d,style:g,onCanPlay:m,onEnd:b,onFullscreenChange:C,onLoadMetadata:_,onLoadMetadataComplete:P,onLoadMetadataError:R,onPause:M,onPlay:T,onSizeChange:j,onTimeUpdate:Q,...$},K)=>{const q=N.useRef(null),w=K??q,O=Kr(d,{onLoadStart:_,onLoadComplete:P,onLoadError:R}),E=is();N.useEffect(()=>{if(!w.current)return;if(d.toLowerCase().endsWith(".m3u8")){const re=!!w.current.canPlayType("application/x-mpegURL"),oe=typeof window.Hls<"u"?window.Hls:void 0;if(!re&&oe?.isSupported()){const le=new oe;le.loadSource(d),le.attachMedia(w.current)}}const F=re=>{const oe=window.document.fullScreen||window.document.mozFullScreen||window.document.webkitIsFullScreen;oe!==void 0&&C?.(oe)};return w.current.muted=a,w.current.load(),w.current.addEventListener("webkitfullscreenchange",F),w.current.addEventListener("mozfullscreenchange",F),w.current.addEventListener("fullscreenchange",F),()=>{Y(),w.current?.removeEventListener("webkitfullscreenchange",F),w.current?.removeEventListener("mozfullscreenchange",F),w.current?.removeEventListener("fullscreenchange",F)}},[d]),N.useEffect(()=>{j?.(O)},[O]);const z=F=>{const re=F.currentTarget;r&&re.paused&&G(),m?.()},X=F=>{T?.()},J=F=>{M?.()},se=F=>{b?.()},te=F=>{const re=F.currentTarget;Q?.(re.currentTime,re.duration)},G=()=>{w.current&&w.current.play()},Y=()=>{w.current&&w.current.pause()};return x.jsx("video",{...$,ref:w,autoPlay:r,controls:i,loop:e,muted:a,playsInline:c,poster:u,style:{...E.root,...g},onCanPlay:z,onEnded:se,onPause:J,onPlay:X,onTimeUpdate:te,children:x.jsx("source",{src:d})})});function is(){return{root:{fontSize:"0"}}}process.env.NODE_ENV==="development"&&(Dn.displayName="Video");const Gr=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:Q,onPlay:$,onSizeChange:K,...q},w)=>{const O=F=>{J(F?F.width/F.height:NaN),K?.(F)},E=w??N.useRef(null),z=Be(E),[X,J]=N.useState(NaN),se=isNaN(a)?X:a,te=z.width/z.height,G=Oe.make(te>1?Math.max(z.width,z.height*se):Math.max(z.width,Math.max(z.height,z.width/se)*se),te>1?Math.max(z.height,Math.max(z.width,z.height*se)/se):Math.max(z.height,z.width/se)),Y=ke(r,{content:Bn,viewport:Hn});return x.jsxs("div",{...q,ref:E,className:e,style:ue(i,Yn.root),children:[x.jsx(Dn,{autoLoop:c,autoPlay:u,hasControls:d,isMuted:g,playsInline:m,posterSrc:b,src:C,style:ue(Yn.viewport,{width:`${G.width}px`,height:`${G.height}px`,maxWidth:"unset"}),onCanPlay:_,onEnd:P,onFullscreenChange:R,onLoadMetadata:M,onLoadMetadataComplete:T,onLoadMetadataError:j,onPause:Q,onPlay:$,onSizeChange:F=>O(F)}),Y.viewport&&x.jsx(me,{element:Y.viewport,style:ue(Yn.viewport,{height:`${G.height}px`,pointerEvents:"none",width:`${G.width}px`})}),Y.content]})}),Bn=({children:e,...r})=>x.jsx("div",{...r,children:e}),Hn=({children:e,...r})=>x.jsx("div",{...r,children:e}),ss=Object.assign(Gr,{Content:Bn,Viewport:Hn}),Yn={root:{overflow:"hidden"},viewport:{fontSize:"0",left:"50%",position:"absolute",top:"50%",transform:"translate(-50%, -50%)"}};process.env.NODE_ENV==="development"&&(Gr.displayName="CoverVideo",Bn.displayName="CoverVideo.Content",Hn.displayName="CoverVideo.Viewport");const Xn=N.forwardRef((e,r)=>{switch(!0){case as(e):{const{action:i,children:a,className:c,isDisabled:u,label:d,opensInNewTab:g,...m}=e;return x.jsx("a",{...m,ref:r,"aria-disabled":u,"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 cs(e):{const{action:i,children:a,className:c,isDisabled:u,label:d,type:g="button",...m}=e;return x.jsx("button",{...m,ref:r,"aria-disabled":u,"aria-label":d,className:c,disabled:u,type:g,onClick:i,children:a??d})}default:console.error("[etudes::Button] Unknown button type");return}});function as(e){return typeof e.action=="string"}function cs(e){return typeof e.action=="function"||typeof e.type=="string"}process.env.NODE_ENV==="development"&&(Xn.displayName="Button");const Wr=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 x.jsx(Xn,{...c,ref:u,action:b,isDisabled:r,label:m})});process.env.NODE_ENV==="development"&&(Wr.displayName="OptionButton");var Un,Jr;function ls(){return Jr||(Jr=1,Un=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}),Un}var us=ls();const He=Rr(us);var Ut={exports:{}},fs=Ut.exports,Zr;function ds(){return Zr||(Zr=1,(function(e,r){(function(i,a){e.exports=a()})(fs,(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},Q=void 0,$=void 0;function K(n){Q=n;var t=n.document.createTextNode("");t.ownerDocument!==n.document&&typeof n.wrap=="function"&&n.wrap(t)===t&&(n=n.wrap(n)),$=n}function q(n){return j(n)?n:(n.ownerDocument||n).defaultView||$.window}typeof window<"u"&&window&&K(window);var w=function(n){return!!n&&c(n)==="object"},O=function(n){return typeof n=="function"},E={window:function(n){return n===$||j(n)},docFrag:function(n){return w(n)&&n.nodeType===11},object:w,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=q(n)||$;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 w(n)&&!!n.constructor&&/function Object\b/.test(n.constructor.toString())},array:function(n){return w(n)&&n.length!==void 0&&O(n.splice)}};function z(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 X(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 J={id:"actions/drag",install:function(n){var t=n.actions,o=n.Interactable,s=n.defaults;o.prototype.draggable=J.draggable,t.map.drag=J,t.methodDict.drag="draggable",s.actions.drag=J.defaults},listeners:{"interactions:before-action-move":z,"interactions:action-resume":z,"interactions:action-move":X,"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:z,move:X,defaults:{startAxis:"xy",lockAxis:"xy"},getCursor:function(){return"move"},filterEventType:function(n){return n.search("drag")===0}},se=J,te={init:function(n){var t=n;te.document=t.document,te.DocumentFragment=t.DocumentFragment||G,te.SVGElement=t.SVGElement||G,te.SVGSVGElement=t.SVGSVGElement||G,te.SVGElementInstance=t.SVGElementInstance||G,te.Element=t.Element||G,te.HTMLElement=t.HTMLElement||te.Element,te.Event=t.Event,te.Touch=t.Touch||G,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 G(){}var Y=te,F={init:function(n){var t=Y.Element,o=n.navigator||{};F.supportsTouch="ontouchstart"in n||E.func(n.DocumentTouch)&&Y.document instanceof n.DocumentTouch,F.supportsPointerEvent=o.pointerEnabled!==!1&&!!Y.PointerEvent,F.isIOS=/iP(hone|od|ad)/.test(o.platform),F.isIOS7=/iP(hone|od|ad)/.test(o.platform)&&/OS 7[^\d]/.test(o.appVersion),F.isIe9=/MSIE 9/.test(o.userAgent),F.isOperaMobile=o.appName==="Opera"&&F.supportsTouch&&/Presto/.test(o.userAgent),F.prefixedMatchesSelector="matches"in t.prototype?"matches":"webkitMatchesSelector"in t.prototype?"webkitMatchesSelector":"mozMatchesSelector"in t.prototype?"mozMatchesSelector":"oMatchesSelector"in t.prototype?"oMatchesSelector":"msMatchesSelector",F.pEventTypes=F.supportsPointerEvent?Y.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,F.wheelEvent=Y.document&&"onmousewheel"in Y.document?"mousewheel":"wheel"},supportsTouch:null,supportsPointerEvent:null,isIOS7:null,isIOS:null,isIe9:null,isOperaMobile:null,prefixedMatchesSelector:null,pEventTypes:null,wheelEvent:null},re=F;function oe(n,t){if(n.contains)return n.contains(t);for(;t;){if(t===n)return!0;t=t.parentNode}return!1}function le(n,t){for(;E.element(n);){if(L(n,t))return n;n=B(n)}return null}function B(n){var t=n.parentNode;if(E.docFrag(t)){for(;(t=t.host)&&E.docFrag(t););return t}return t}function L(n,t){return $!==Q&&(t=t.replace(/\/deep\//g," ")),n[re.prefixedMatchesSelector](t)}var I=function(n){return n.parentNode||n.host};function W(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(L(n,t))return!0;if((n=B(n))===o)return L(n,t)}return!1}function Z(n){return n.correspondingUseElement||n}function pe(n){var t=n instanceof Y.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(!re.isIOS7&&o){var s={x:(t=(t=q(n))||$).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=B(n);return t}function Ne(n){return!!E.string(n)&&(Y.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"?B(o):n==="self"?t.getRect(o):le(o,n)}function Pe(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 Me(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 Ye(n,t,o){var s=o&&n.options[o];return Ce(Pe(s&&s.origin||n.options.origin,n,t,[n&&t]))||{x:0,y:0}}function Xe(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=ni(n)),E.array(n))return n.forEach((function(v){return Xe(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];Xe(n,p,o,s)}else if(E.object(t))for(var h in t)Xe(ni(h).map((function(v){return"".concat(n).concat(v)})),t[h],o,s);return s}function ni(n){return n.trim().split(/ +/)}var Ot=function(n,t){return Math.sqrt(n*n+t*t)},Dc=["webkit","moz"];function En(n,t){n.__set||(n.__set={});var o=function(l){if(Dc.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 Nn(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 Y.Event||n instanceof Y.Touch}function Sn(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},re.isOperaMobile&&oi(n)?(Sn("screen",n,t),t.x+=window.scrollX,t.y+=window.scrollY):Sn("page",n,t),t}function Pt(n){return E.number(n.pointerId)?n.pointerId:n.identifier}function Bc(n,t,o){var s=t.length>1?si(t):t[0];ii(s,n.page),(function(l,f){f=f||{},re.isOperaMobile&&oi(l)?Sn("screen",l,f):Sn("client",l,f)})(s,n.client),n.timeStamp=o}function fr(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 dr(n){if(!n.length)return null;var t=fr(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 pr(n,t){var o=t+"X",s=t+"Y",l=fr(n),f=l[0][o]-l[1][o],p=l[0][s]-l[1][s];return Ot(f,p)}function hr(n,t){var o=t+"X",s=t+"Y",l=fr(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 Y.Touch?"touch":"mouse"}function ci(n){var t=E.func(n.composedPath)?n.composedPath():n.path;return[Z(t?t[0]:n.target),Z(n.currentTarget)]}var Tn=(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(Tn.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)},It=function(n,t){for(var o=0;o<n.length;o++)if(t(n[o],o,n))return o;return-1},jt=function(n,t){return n[It(n,t)]},lt=(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=It(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})(Tn);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 gr(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)&&!L(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(U){for(var ae,ie,fe,ye=[],xe=0;xe<U.length;xe++){var he=U[xe],be=U[ae];if(he&&xe!==ae)if(be){var Re=I(he),Te=I(be);if(Re!==he.ownerDocument)if(Te!==he.ownerDocument)if(Re!==Te){ye=ye.length?ye:W(be);var ze=void 0;if(be instanceof Y.HTMLElement&&he instanceof Y.SVGElement&&!(he instanceof Y.SVGSVGElement)){if(he===Te)continue;ze=he.ownerSVGElement}else ze=he;for(var Le=W(ze,be.ownerDocument),Ge=0;Le[Ge]&&Le[Ge]===ye[Ge];)Ge++;var An=[Le[Ge-1],Le[Ge],ye[Ge]];if(An[0])for(var Ft=An[0].lastChild;Ft;){if(Ft===An[1]){ae=xe,ye=Le;break}if(Ft===An[2])break;Ft=Ft.previousSibling}}else fe=be,(parseInt(q(ie=he).getComputedStyle(ie).zIndex,10)||0)>=(parseInt(q(fe).getComputedStyle(fe).zIndex,10)||0)&&(ae=xe);else ae=xe}else ae=xe}return ae})(p);return s.activeDrops[V]||null}function mr(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 lt(s,o,"dropactivate"),l.activate.target=null,l.activate.dropzone=null),o.type==="dragend"&&(l.deactivate=new lt(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 lt(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 lt(s,o,"dragenter"),o.dragEnter=s.cur.element,o.dropzone=s.cur.dropzone)),o.type==="dragend"&&s.cur.dropzone&&(l.drop=new lt(s,o,"drop"),o.dropzone=s.cur.dropzone,o.relatedTarget=s.cur.element),o.type==="dragmove"&&s.cur.dropzone&&(l.move=new lt(s,o,"dropmove"),o.dropzone=s.cur.dropzone)),l}function vr(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=gr(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=mr(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(se),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=Xe(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,U,ae,ie){var fe=!1;if(!(ie=ie||k.getRect(ae)))return!!k.options.drop.checker&&k.options.drop.checker(A,H,fe,k,ae,V,U);var ye=k.options.drop.overlap;if(ye==="pointer"){var xe=Ye(V,U,"drag"),he=ii(A);he.x+=xe.x,he.y+=xe.y;var be=he.x>ie.left&&he.x<ie.right,Re=he.y>ie.top&&he.y<ie.bottom;fe=be&&Re}var Te=V.getRect(U);if(Te&&ye==="center"){var ze=Te.left+Te.width/2,Le=Te.top+Te.height/2;fe=ze>=ie.left&&ze<=ie.right&&Le>=ie.top&&Le<=ie.bottom}return Te&&E.number(ye)&&(fe=Math.max(0,Math.min(ie.right,Te.right)-Math.max(ie.left,Te.left))*Math.max(0,Math.min(ie.bottom,Te.bottom)-Math.max(ie.top,Te.top))/(Te.width*Te.height)>=ye),k.options.drop.checker&&(fe=k.options.drop.checker(A,H,fe,k,ae,V,U)),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=gr(t,o.element),l.events=mr(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;vr(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),vr(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:gr,getDrop:di,getDropEvents:mr,fireDropEvents:vr,filterEventType:function(n){return n.search("drag")===0||n.search("drop")===0},defaults:{enabled:!1,accept:null,overlap:"pointer"}},Hc=hi;function yr(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=pr(l,h),o.box=dr(l),o.scale=1,o.ds=0,o.angle=hr(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=pr(l,h),o.box=dr(l),o.scale=o.distance/t.gesture.startDistance,o.angle=hr(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 br={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=br,t.methodDict.gesture="gesturable",s.actions.gesture=br.defaults},listeners:{"interactions:action-start":yr,"interactions:action-move":yr,"interactions:action-end":yr,"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}},Yc=br;function Xc(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 Ue,ot,Ke={id:"actions/resize",before:["actions/drag"],install:function(n){var t=n.actions,o=n.browser,s=n.Interactable,l=n.defaults;Ke.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),Ke.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=Ke,t.methodDict.resize="resizable",l.actions.resize=Ke.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 U in y.width=y.right-y.left,y.height=y.bottom-y.top,y)k[U]=y[U]-A[U];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]=Xc(S,h.edges[S],p,t._latestPointer.eventTarget,s,l,h.margin||Ke.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-Ke.defaultMargin,k=h.axis!=="x"&&p.y>l.bottom-Ke.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=Ke.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},Uc=Ke,Kc={id:"actions",install:function(n){n.usePlugin(Yc),n.usePlugin(Uc),n.usePlugin(se),n.usePlugin(Hc)}},mi=0,Ze={request:function(n){return Ue(n)},cancel:function(n){return ot(n)},init:function(n){if(Ue=n.requestAnimationFrame,ot=n.cancelAnimationFrame,!Ue)for(var t=["ms","moz","webkit","o"],o=0;o<t.length;o++){var s=t[o];Ue=n["".concat(s,"RequestAnimationFrame")],ot=n["".concat(s,"CancelAnimationFrame")]||n["".concat(s,"CancelRequestAnimationFrame")]}Ue=Ue&&Ue.bind(n),ot=ot&&ot.bind(n),Ue||(Ue=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,Ze.cancel(ge.i),n.autoScroll=ge,ge.interaction=n,ge.prevTime=ge.now(),ge.i=Ze.request(ge.scroll)},stop:function(){ge.isScrolling=!1,ge.interaction&&(ge.interaction.autoScroll=null),Ze.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&&(Ze.cancel(ge.i),ge.i=Ze.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)||q(o)}function yi(n){return E.window(n)&&(n=window.document.body),{x:n.scrollLeft,y:n.scrollTop}}var Gc={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)}}},Wc=Gc;function Rt(n,t){var o=!1;return function(){return o||($.console.warn(t),o=!0),n.apply(this,arguments)}}function wr(n,t){return n.name=t.name,n.axis=t.axis,n.edges=t.edges,n}function Jc(n){return E.bool(n)?(this.options.styleCursor=n,this):n===null?(delete this.options.styleCursor,this):this.options.styleCursor}function Zc(n){return E.func(n)?(this.options.actionChecker=n,this):n===null?(delete this.options.actionChecker,this):this.options.actionChecker}var Qc={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=Rt((function(o){return this._backCompatOption("ignoreFrom",o)}),"Interactable.ignoreFrom() has been deprecated. Use Interactble.draggable({ignoreFrom: newValue})."),t.prototype.allowFrom=Rt((function(o){return this._backCompatOption("allowFrom",o)}),"Interactable.allowFrom() has been deprecated. Use Interactble.draggable({allowFrom: newValue})."),t.prototype.actionChecker=Zc,t.prototype.styleCursor=Jc}};function bi(n,t,o,s,l){return t.testIgnoreAllow(t.options[n.name],o,s)&&t.options[n.name].enabled&&_n(t,o,n,l)?n:null}function $c(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=$c(n,t,o,f,p,s,l);if(S.action&&!S.interactable.options[S.action.name].manualStart)return S;h=B(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,wr(n.prepared,s),n.rect=l&&s.name?l.getRect(f):null,Ni(n,o),o.fire("autoStart:prepared",{interaction:n})}function _n(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 xr(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)}xr(n.element,f||"",t)}else t.autoStart.cursorElement&&xr(t.autoStart.cursorElement,"",t)}var qc={id:"auto-start/base",before:["actions"],install:function(n){var t=n.interactStatic,o=n.defaults;n.usePlugin(Qc),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:_n,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||!_n(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&&xr(o.element,"",t)}},maxInteractions:Ei,withinInteractionLimit:_n,validateAction:bi},Er=qc,el={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 U=o.interactable.options.drag;if(!U.manualStart&&V.testIgnoreAllow(U,k,s)){var ae=V.getAction(o.downPointer,o.downEvent,o,k);if(ae&&ae.name==="drag"&&(function(ie,fe){if(!fe)return!1;var ye=fe.options.drag.startAxis;return ie==="xy"||ye==="xy"||ye===ie})(y,V)&&Er.validateAction(ae,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=B(k)}}}}}};function Nr(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 tl={id:"auto-start/hold",install:function(n){var t=n.defaults;n.usePlugin(Er),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=Nr(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;Nr(t)>0&&(t.prepared.name=null)}},getHoldDuration:Nr},nl=tl,rl={id:"auto-start",install:function(n){n.usePlugin(Er),n.usePlugin(nl),n.usePlugin(el)}},ol=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 il(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=ol,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=q(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)&&L(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||oe(f.element,o.target)))return void f.interactable.checkAndPreventDefault(o)}}})},listeners:["down","move","up","cancel"].reduce((function(n,t){return n["interactions:".concat(t)]=il,n}),{})};function Cn(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 ut(n){var t={};for(var o in n){var s=n[o];E.plainObject(s)?t[o]=ut(s):E.array(s)?t[o]=ui(s):t[o]=s}return t}var Sr=(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=kn(),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=kn(),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=kn(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),Me(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 U=this.result.coords,ae=this.result.rect;if(U&&ae){var ie=v.rect.left!==ae.left||v.rect.right!==ae.right||v.rect.top!==ae.top||v.rect.bottom!==ae.bottom;v.changed=ie||U.x!==v.coords.x||U.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,U=t.rect||o.rect;U.left+=V.left,U.right+=V.right,U.top+=V.top,U.bottom+=V.bottom,U.width=U.right-U.left,U.height=U.bottom-U.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 ut(o)})),this.result=kn(ne({},t.result.coords),ne({},t.result.rect))}},{key:"destroy",value:function(){for(var t in this)this[t]=null}}]),n})();function kn(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 Qe(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 At(n){var t=n.iEvent,o=n.interaction.modification.result;o&&(t.modifiers=o.eventProps)}var sl={id:"modifiers/base",before:["actions"],install:function(n){n.defaults.perAction.modifiers=[]},listeners:{"interactions:new":function(n){var t=n.interaction;t.modification=new Sr(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":At,"interactions:action-move":At,"interactions:action-end":At,"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=sl,_i={base:{preventDefault:"auto",deltaSource:"page"},perAction:{enabled:!1,origin:{x:0,y:0}},actions:{}},Tr=(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=Ye(k,h,f),V=p==="start",U=p==="end",ae=V?P(y):s.prevEvent,ie=V?s.coords.start:U?{page:ae.page,client:ae.client,timeStamp:s.coords.cur.timeStamp}:s.coords.cur;return y.page=ne({},ie.page),y.client=ne({},ie.client),y.rect=ne({},s.rect),y.timeStamp=ie.timeStamp,U||(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:ae.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||U?{x:0,y:0}:{x:y[A].x-ae[A].x,y:y[A].y-ae[A].y},y.dt=s.coords.delta.timeStamp,y.duration=y.timeStamp-y.t0,y.velocity=ne({},s.coords.velocity[A]),y.speed=Ot(y.velocity.x,y.velocity.y),y.swipe=U||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})(Tn);Object.defineProperties(Tr.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 al=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})),cl=(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})({}),ll=0,ul=(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=Rt((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=ll++,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 cl)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)&&(wr(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=Ot(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&&Nn(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=Pt(t);return this.pointerType==="mouse"||this.pointerType==="pen"?this.pointers.length-1:It(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=Pt(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 al(v,t,o,null,null),S=this.pointers.length,this.pointers.push(y)),Bc(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,En(this.downPointer,t),this.interacting()||(Nn(this.coords.start,this.coords.cur),Nn(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 Tr(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"&&(Me(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 _r(n.coords.cur,t),_r(n.coords.delta,t),Me(n.edges,n.rect,t),t.x=0,t.y=0,!0}function fl(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 _r(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 dl={id:"offset",before:["modifiers","pointer-events","actions","inertia"],install:function(n){n.Interaction.prototype.offsetBy=fl},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&&(_r(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=dl,pl=(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=On(o);if(!s||!s.enabled)return!1;var l=o.coords.velocity.client,f=Ot(l.x,l.y),p=this.modification||(this.modification=new Sr(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=On(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=Ze.request((function(){o.active&&t()}))}},{key:"inertiaTick",value:function(){var t,o,s,l,f,p,h,v=this,S=this.interaction,y=On(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=On(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"}),Nn(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,Ze.cancel(this.timeout)}}]),n})();function On(n){var t=n.interactable,o=n.prepared;return t&&t.options&&o.name&&t.options[o.name].inertia}var hl={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 pl(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=B(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":At,"interactions:action-inertiastart":At,"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 gl=hl;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=Xe(t,o);for(t in s)this.types[t]=li(this.types[t]||[],s[t])}},{key:"off",value:function(t,o){var s=Xe(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})(),ml=(function(){function n(t){u(this,n),this.currentTarget=void 0,this.originalEvent=void 0,this.type=void 0,this.originalEvent=t,En(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 Mt(n){return E.object(n)?{capture:!!n.capture,passive:!!n.passive}:{capture:!!n,passive:!1}}function Pn(n,t){return n===t||(typeof n=="boolean"?!!t.capture===n&&!t.passive:!!n.capture==!!t.capture&&!!n.passive==!!t.passive)}var vl={id:"events",install:function(n){var t,o=[],s={},l=[],f={add:p,remove:h,addDelegate:function(y,k,A,H,V){var U=Mt(V);if(!s[A]){s[A]=[];for(var ae=0;ae<l.length;ae++){var ie=l[ae];p(ie,A,v),p(ie,A,S,!0)}}var fe=s[A],ye=jt(fe,(function(xe){return xe.selector===y&&xe.context===k}));ye||(ye={selector:y,context:k,listeners:[]},fe.push(ye)),ye.listeners.push({func:H,options:U})},removeDelegate:function(y,k,A,H,V){var U,ae=Mt(V),ie=s[A],fe=!1;if(ie)for(U=ie.length-1;U>=0;U--){var ye=ie[U];if(ye.selector===y&&ye.context===k){for(var xe=ye.listeners,he=xe.length-1;he>=0;he--){var be=xe[he];if(be.func===H&&Pn(be.options,ae)){xe.splice(he,1),xe.length||(ie.splice(U,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=Mt(H),U=jt(o,(function(ae){return ae.eventTarget===y}));U||(U={eventTarget:y,events:{}},o.push(U)),U.events[k]||(U.events[k]=[]),jt(U.events[k],(function(ae){return ae.func===A&&Pn(ae.options,V)}))||(y.addEventListener(k,A,f.supportsOptions?V:V.capture),U.events[k].push({func:A,options:V}))}}function h(y,k,A,H){if(y.addEventListener&&y.removeEventListener){var V=It(o,(function(Re){return Re.eventTarget===y})),U=o[V];if(U&&U.events)if(k!=="all"){var ae=!1,ie=U.events[k];if(ie){if(A==="all"){for(var fe=ie.length-1;fe>=0;fe--){var ye=ie[fe];h(y,k,ye.func,ye.options)}return}for(var xe=Mt(H),he=0;he<ie.length;he++){var be=ie[he];if(be.func===A&&Pn(be.options,xe)){y.removeEventListener(k,A,f.supportsOptions?xe:xe.capture),ie.splice(he,1),ie.length===0&&(delete U.events[k],ae=!0);break}}}ae&&!Object.keys(U.events).length&&o.splice(V,1)}else for(k in U.events)U.events.hasOwnProperty(k)&&h(y,k,"all")}}function v(y,k){for(var A=Mt(k),H=new ml(y),V=s[y.type],U=ci(y)[0],ae=U;E.element(ae);){for(var ie=0;ie<V.length;ie++){var fe=V[ie],ye=fe.selector,xe=fe.context;if(L(ae,ye)&&oe(xe,U)&&oe(xe,ae)){var he=fe.listeners;H.currentTarget=ae;for(var be=0;be<he.length;be++){var Re=he[be];Pn(Re.options,A)&&Re.func(H)}}}ae=B(ae)}}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}},Cr={methodOrder:["simulationResume","mouseOrPen","hasPointer","idle"],search:function(n){for(var t=0,o=Cr.methodOrder;t<o.length;t++){var s=o[t],l=Cr[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=B(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 yl=Cr,kr=["pointerDown","pointerMove","pointerUp","updatePointer","removePointer","windowBlur"];function zi(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:Pt(k),pointerType:l,eventType:o.type,eventTarget:p,curEventTarget:h,scope:t},H=Li(A);v.push([A.pointer,A.eventTarget,A.curEventTarget,H])}}else{var V=!1;if(!re.supportsPointerEvent&&/mouse/.test(o.type)){for(var U=0;U<s.length&&!V;U++)V=s[U].pointerType!=="mouse"&&s[U].pointerIsDown;V=V||t.now()-t.prevTouchTime<500||o.timeStamp===0}if(!V){var ae={pointer:o,pointerId:Pt(o),pointerType:l,eventType:o.type,curEventTarget:h,eventTarget:p,scope:t},ie=Li(ae);v.push([ae.pointer,ae.eventTarget,ae.curEventTarget,ie])}}for(var fe=0;fe<v.length;fe++){var ye=v[fe],xe=ye[0],he=ye[1],be=ye[2];ye[3][n](xe,o,he,be)}}}function Li(n){var t=n.pointerType,o=n.scope,s={interaction:yl.search(n),searchDetails:n};return o.fire("interactions:find",s),s.interaction||o.interactions.new({pointerType:t})}function Or(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 bl={id:"core/interactions",install:function(n){for(var t={},o=0;o<kr.length;o++){var s=kr[o];t[s]=zi(s,n)}var l,f=re.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 oe(V.doc,H.downTarget)}))||S.removePointer(H.pointer,H.event)},k=0,A=S.pointers;k<A.length;k++)y()}}(l=Y.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})(ul),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 Or(n,"add")},"scope:remove-document":function(n){return Or(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:Or,doOnInteractions:zi,methodNames:kr},wl=bl,$e=(function(n){return n[n.On=0]="On",n[n.Off=1]="Off",n})($e||{}),xl=(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=q(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))&&Cn(v,f._actions)};(E.array(o)||E.object(o))&&this._onOff($e.Off,t,o,void 0,h),(E.array(s)||E.object(s))&&this._onOff($e.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]||{},ut(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||oe(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)&&oe(t,s))}},{key:"testIgnore",value:function(t,o,s){return!(!t||!E.element(s))&&(E.string(t)?ee(s,t,o):!!E.element(t)&&oe(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=Xe(o,s,f);for(var h in p){h==="wheel"&&(h=re.wheelEvent);for(var v=0,S=p[h];v<S.length;v++){var y=S[v];Cn(h,this._actions)?this.events[t===$e.On?"on":"off"](h,y):E.string(this.target)?this._scopeEvents[t===$e.On?"addDelegate":"removeDelegate"](this.target,this._context,h,y,l):this._scopeEvents[t===$e.On?"add":"remove"](this.target,h,y,l)}}return this}},{key:"on",value:function(t,o,s){return this._onOff($e.On,t,o,s)}},{key:"off",value:function(t,o,s){return this._onOff($e.Off,t,o,s)}},{key:"set",value:function(t){var o=this._defaults;for(var s in E.object(t)||(t={}),this.options=ut(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})(),El=(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=It(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 jt(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)&&L(t,f.target):t===f.target)&&f.inContext(t)&&(p=o(f)),p!==void 0)return p}}}]),n})(),Nl=(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=re,this.defaults=ut(_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=dr,l.getTouchDistance=pr,l.getTouchAngle=hr,l.getElementRect=ve,l.getElementClientRect=pe,l.matchesSelector=L,l.closest=le,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=Rt((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 Cn(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=Rt((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 Cn(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 re.supportsTouch},l.supportsPointerEvent=function(){return re.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=Tr,this.Interactable=void 0,this.interactables=new El(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})(xl)}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)&&K(s),Y.init(s),re.init(s),Ze.init(s),o.window=s,o.document=s.document,o.usePlugin(wl),o.usePlugin(vl),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=q(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=q(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 Nl,je=Vi.interactStatic,Sl=typeof globalThis<"u"?globalThis:window;Vi.init(Sl);var Tl=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],U=Math.round((s-S.x)/n[H]),ae=Math.round((l-S.y)/n[V]);y[H]=Math.max(h.left,Math.min(h.right,U*n[H]+S.x)),y[V]=Math.max(h.top,Math.min(h.bottom,ae*n[V]+S.y))}return y};return o.grid=n,o.coordFields=t,o}}),_l={id:"snappers",install:function(n){var t=n.interactStatic;t.snappers=ne(t.snappers||{},Tl),t.createSnapGrid=t.snappers.grid}},Cl=_l,kl={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 Sr(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?Ol:Pl;if(ne(n.edges,l),p(t,t.xIsPrimaryAxis,s,o),!t.subModification)return null;var h=ne({},o);Me(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 Ol(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 Pl(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 Il=Qe(kl,"aspectRatio"),Di=function(){};Di._defaults={};var In=Di;function it(n,t,o){return E.func(n)?Pe(n,t.interactable,t.element,[o.x,o.y,t]):Pe(n,t.interactable,t.element)}var jn={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}},jl=Qe(jn,"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}},Rl=Qe(zt,"restrictEdges"),Al=ne({get elementRect(){return{top:0,left:0,bottom:1,right:1}},set elementRect(n){}},jn.defaults),Ml=Qe({start:jn.start,set:jn.set,defaults:Al},"restrictRect"),zl={width:-1/0,height:-1/0},Ll={width:1/0,height:1/0},Fl=Qe({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))||zl,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"),Pr={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(Pe(A.state.options.origin,null,null,[H])),U=V||Ye(A.interactable,H,A.interaction.prepared.name);return U})(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=Pe(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=Ye(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,U=l.targets.length;V<U;V++){var ae=l.targets[V],ie=void 0;(ie=E.func(ae)?ae(A,H,t._proxy,k,V):ae)&&v.push({x:(E.number(ie.x)?ie.x:A)+k.x,y:(E.number(ie.y)?ie.y:H)+k.y,range:E.number(ie.range)?ie.range:l.range,source:ae,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 xe=v[ye],he=xe.range,be=xe.x-h.x,Re=xe.y-h.y,Te=Ot(be,Re),ze=Te<=he;he===1/0&&fe.inRange&&fe.range!==1/0&&(ze=!1),fe.target&&!(ze?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=xe,fe.distance=Te,fe.range=he,fe.inRange=ze,fe.delta.x=be,fe.delta.y=Re)}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}},Vl=Qe(Pr,"snap"),Rn={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"]],Pr.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],U=H[1];if(V in y||U in y){y.x=y[V],y.y=y[U];break}}o.options.targets.push(y)}}var ae=Pr.set(n);return o.options=l,ae},defaults:{range:1/0,targets:null,offset:null,endOnly:!1,enabled:!1}},Dl=Qe(Rn,"snapSize"),Ir={aspectRatio:Il,restrictEdges:Rl,restrict:jl,restrictRect:Ml,restrictSize:Fl,snapEdges:Qe({start:function(n){var t=n.edges;return t?(n.state.targetFields=n.state.targetFields||[[t.left?"left":"right",t.top?"top":"bottom"]],Rn.start(n)):null},set:Rn.set,defaults:ne(ut(Rn.defaults),{targets:void 0,range:void 0,offset:{x:0,y:0}})},"snapEdges"),snap:Vl,snapSize:Dl,spring:In,avoid:In,transform:In,rubberband:In},Bl={id:"modifiers",install:function(n){var t=n.interactStatic;for(var o in n.usePlugin(Ti),n.usePlugin(Cl),t.modifiers=Ir,Ir){var s=Ir[o],l=s._defaults,f=s._methods;l._methods=f,n.defaults.perAction[o]=l}}},Hl=Bl,Xi=(function(n){b(o,n);var t=R(o);function o(s,l,f,p,h,v){var S;if(u(this,o),En(P(S=t.call(this,h)),f),f!==l&&En(P(S),l),S.timeStamp=v,S.originalEvent=f,S.type=s,S.pointerId=Pt(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})(Tn),Lt={id:"pointer-events/base",before:["inertia","modifiers","auto-start","actions"],install:function(n){n.pointerEvents=Lt,n.defaults.actions.pointerEvents=Lt.defaults,ne(n.actions.phaselessTypes,Lt.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&&jr(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,U=0,ae=k.targets;U<ae.length;U++){var ie=ae[U].eventable.options.holdDuration;ie<V&&(V=ie)}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){jr(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){jr(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=Ye(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 U=S.double?qe({interaction:o,pointer:s,event:l,eventTarget:f,type:"doubletap"},t):S;o.prevTap=U,o.tapTime=U.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,U;return H.eventable.options.holdDuration===((V=o.pointers[h])==null||(U=V.hold)==null?void 0:U.duration)}))),y.targets}function jr(n){var t=n.interaction,o=n.pointerIndex,s=t.pointers[o].hold;s&&s.timeout&&(clearTimeout(s.timeout),s.timeout=null)}var Yl=Object.freeze({__proto__:null,default:Lt});function Xl(n){var t=n.interaction;t.holdIntervalHandle&&(clearInterval(t.holdIntervalHandle),t.holdIntervalHandle=null)}var Ul={id:"pointer-events/holdRepeat",install:function(n){n.usePlugin(Lt);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)]=Xl,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))}}})},Kl=Ul,Gl={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||{})}}},Wl=Gl,Jl={id:"pointer-events",install:function(n){n.usePlugin(Yl),n.usePlugin(Kl),n.usePlugin(Wl)}},Zl=Jl,Ql={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=jt(f.interactions.list,(function(ie){return ie.interacting()&&ie.interactable===s&&ie.element===k&&ie.prepared.name===l.name}));if(V)V.move(),v&&(H=V._reflowPromise||new h((function(ie){V._reflowResolve=ie})));else{var U=De(A),ae=(function(ie){return{coords:ie,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:U.x,y:U.y},client:{x:U.x,y:U.y},timeStamp:f.now()});H=(function(ie,fe,ye,xe,he){var be=ie.interactions.new({pointerType:"reflow"}),Re={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),wr(be.prepared,xe),be._doPhase(Re);var Te=ie.window,ze=Te.Promise,Le=ze?new ze((function(Ge){be._reflowResolve=Ge})):void 0;return be._reflowPromise=Le,be.start(xe,fe,ye),be._interacting?(be.move(Re),be.end(he)):(be.stop(),be._reflowResolve()),be.removePointer(he,he),Le})(f,s,k,l,ae)}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))}}},$l=Ql;if(je.use(Si),je.use(Pi),je.use(Zl),je.use(gl),je.use(Hl),je.use(rl),je.use(Kc),je.use(Wc),je.use($l),je.default=je,c(e)==="object"&&e)try{e.exports=je}catch{}return je.default=je,je}))})(Ut)),Ut.exports}var ps=ds();const hs=Rr(ps);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 Qr(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=hs(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),Q=Se.make(_),$=Se.make(M,T);g.current?.($,Q,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),Q=Ee(i);return Qr(e,{onDragStart:w=>{b(!0),_(!1),M.current?.(w)},onDragMove:(w,O,E)=>{const z=Q.current(g.current,w.x,w.y);$r(g,z)&&R(z),b(!0),_(!1),T.current?.(w,O,E)},onDragEnd:(w,O)=>{b(!1),_(!0),j.current?.(w,O)},...d}),N.useEffect(()=>{$r(g,P)},[P]),{isDragging:m,isReleasing:C,value:P,setValue:R}}function $r(e,r){return He(e.current,r)?!1:(e.current=r,!0)}const Kn=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((z,X,J)=>z-X*r,[r]),T=N.useRef(null),j=Be(T),Q=zn({src:i},{onLoadStart:m,onLoadComplete:b,onLoadError:C}),[$,K]=N.useState(e),{isDragging:q,value:w,setValue:O}=st(T,{initialValue:0,transform:M,onDragStart:d,onDragEnd:g});N.useEffect(()=>{if(q||!Q)return;const z=ms(e,Q,we.size(j),a);z!==w&&O(z),e!==$&&K(e)},[e,Q,j.width,j.height,a]),N.useEffect(()=>{if(!q||!Q)return;const z=vs(w,Q,we.size(j),a);$!==z&&K(z)},[w,Q,j.width,j.height,a]),N.useEffect(()=>{c?.($,q),u?.($/360,q)},[$]),N.useEffect(()=>{_?.(Q)},[Q?.width,Q?.height]);const E=gs({src:i,displacement:w});return x.jsx("div",{...P,ref:R,"aria-valuenow":$,role:"slider",children:x.jsx("div",{ref:T,style:E.body})})});function gs({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 qr(e,r){const{width:i,height:a}=e,{height:c}=r;if(a<=0)return Oe.zero;const d=c/a*i;return Oe.make(d,c)}function ms(e,r,i,a){const{width:c}=qr(r,i),{width:u}=i,d=u*a;return e/360*c-d}function vs(e,r,i,a){const{width:c}=qr(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"&&(Kn.displayName="Panorama");const eo=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:Q,...$},K)=>{const q=N.useRef(null),w=Be(q),[O,E]=N.useState(),[z,X]=N.useState(!1),se=N.useCallback(()=>{if(!O)return 0;const{width:L,height:I}=O;return I===0?0:L/I},[O?.width,O?.height])(),G=N.useCallback(()=>{const L=Math.min(360,Math.max(0,u??(m?m.width/(m.height*se)*360:0)));return w.width*(L/360)},[m?.width,m?.height,se,w.width,u])(),F=N.useCallback(()=>w.width<=0?b:((w.width-G)*.5+b*G)/w.width,[w.width,G,b])(),re=N.useCallback(()=>{X(!0),P?.()},[P]),oe=N.useCallback(()=>{X(!1),_?.()},[_]),le=ke(c,{track:gt,reticle:Gt,indicator:Kt}),B=bs({autoDimension:a,panoramaRect:w,aspectRatio:se,reticleWidth:G});return x.jsxs("div",{...$,ref:K,className:ce(e,{dragging:z}),style:ue(r,B.root),children:[x.jsx(Kn,{ref:q,angle:i,speed:d,src:g,style:B.panorama,zeroAnchor:F,onAngleChange:C,onDragEnd:oe,onDragStart:re,onImageSizeChange:E,onLoadImageComplete:R,onLoadImageError:M,onLoadImageStart:T,onPositionChange:Q}),x.jsx("div",{style:B.body,children:x.jsxs("div",{style:B.controls,children:[x.jsx(me,{className:ce({dragging:z}),element:le.track??x.jsx(gt,{}),style:B.track}),x.jsx(me,{className:ce({dragging:z}),element:le.reticle??x.jsx(Gt,{}),style:B.reticle}),x.jsx(me,{className:ce({dragging:z}),element:le.track??x.jsx(gt,{}),style:B.track})]})}),x.jsx(me,{className:ce({dragging:z}),element:le.indicator??x.jsx(Kt,{}),style:B.indicator})]})}),Kt=({...e})=>x.jsx("div",{...e}),Gt=({...e})=>x.jsx("div",{...e}),gt=({...e})=>x.jsx("div",{...e}),ys=Object.assign(eo,{Indicator:Kt,Reticle:Gt,Track:gt});function bs({autoDimension:e="width",panoramaRect:r=we.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"&&(eo.displayName="PanoramaSlider",Kt.displayName="PanoramaSlider.Indicator",Gt.displayName="PanoramaSlider.Reticle",gt.displayName="PanoramaSlider.Track");const to=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 x.jsx("button",{...b,ref:C,"aria-disabled":a,"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"&&(to.displayName="SelectableButton");function no({children:e,if:r}){switch(typeof r){case"function":return r()?x.jsx(x.Fragment,{children:e}):x.jsx(x.Fragment,{});default:return r?x.jsx(x.Fragment,{children:e}):x.jsx(x.Fragment,{})}}process.env.NODE_ENV==="development"&&(no.displayName="Conditional");function mt({in:e,children:r,render:i}){if(e==null)return x.jsx(x.Fragment,{});if(!(e instanceof Array))throw TypeError(`Provided list <${e}> is not an array`);return x.jsx(x.Fragment,{children:e.map((a,c)=>x.jsx(N.Fragment,{children:i?.(a,c)??(typeof r=="function"?r(a,c):r)},`item-${c}`))})}process.env.NODE_ENV==="development"&&(mt.displayName="Each");function ro({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"),x.jsx(x.Fragment,{});if(!xs(i))return console.error("[etudes::Switch] `Switch` children must be of `Case` type or `Default` type"),x.jsx(x.Fragment,{});const a=i.filter(u=>u.type===Wt);if(a.length>1)return console.error("[etudes::Switch] `Switch` can only have maximum one `Default` child"),x.jsx(x.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 Gn({children:e}){return e}function Wt({children:e}){return e}const ws=Object.assign(ro,{Case:Gn,Default:Wt});function xs(e){return e.every(r=>N.isValidElement(r)&&(r.type===Gn||r.type===Wt))}process.env.NODE_ENV==="development"&&(ro.displayName="Switch",Gn.displayName="Switch.Case",Wt.displayName="Switch.Default");const Wn=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)?Dt(a,{...r,ref:i}):a})));process.env.NODE_ENV==="development"&&(Wn.displayName="ExtractChild");function oo({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 Q=a??(C.current?Ns(C.current,b):"tl"),$=Es(j),K=_s({alignment:Q,arrowSize:Oe.make(u,c),gap:d,maxDialogWidth:m,fullDialogWidth:$.width,targetWidth:P.width}),q=ue(i,K.dialog);Object.keys(q).forEach(O=>j.style[O]=q[O]);const w=window.document.createElement("span");return Object.keys(K.arrow).forEach(O=>w.style[O]=K.arrow[O]),j.appendChild(w),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]),x.jsx(Wn,{ref:C,onMouseEnter:M,onMouseLeave:T,children:e})}function Es(e){if(typeof window>"u")return Oe.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),Oe.make(i.width,i.height)}function Ns(e,r){const i=we.fromViewport(),a=we.intersecting(e);if(a){const c=a.left-i.left<r,u=i.right-a.right<r,d=a.top-i.top<r,g=i.bottom-a.bottom<r;if(c&&d)return"br";if(c&&g)return"tr";if(u&&d)return"bl";if(u&&g)return"tl";if(c)return"cr";if(u)return"cl";if(g)return"tc"}return"tc"}function Ss({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 Ts({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 _s({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`:"",...Ss({alignment:e,arrowSize:r,fullDialogWidth:i,gap:a,maxDialogWidth:c,targetWidth:u})},arrow:{background:"inherit",position:"absolute",...Ts({alignment:e,arrowSize:r,fullDialogWidth:i,maxDialogWidth:c,targetWidth:u})}}}process.env.NODE_ENV==="development"&&(oo.displayName="WithTooltip");function Cs(){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 ks(e,{element:r,isEnabled:i=!0}={}){N.useLayoutEffect(()=>{if(!i)return;const a=r??window.document.documentElement,c=a.className;return a.classList.add(e),()=>{a.className=c}},[e,r,i])}function Os(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 Ps(){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 Is(){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 js(){return typeof window>"u"?1:window.devicePixelRatio||1}function Rs(){return N.useMemo(()=>js(),[])}function io(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),Q=Se.subtract(g.current??d.current,j);C.current?.(j,Q,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 As(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 so(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 Ms(){const[e,r]=N.useState(!1);return N.useEffect(()=>(r(!0),()=>{r(!1)}),[]),e}function ao(){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 co(){return N.useMemo(()=>ao(),[])}function zs(e,r,{isEnabled:i=!0,preventDefault:a=!0,capture:c=!0,target:u}={}){const d=Ee(r),g=Array.isArray(e)?e:[e],m=N.useMemo(()=>g.map(b=>b.toLowerCase()).sort(),[g]);N.useEffect(()=>{if(!i||m.length===0)return;const b=u&&typeof u=="object"&&"current"in u?u.current:u||window;if(!b)return;const C=_=>{const P=new Set([_.key.toLowerCase(),_.ctrlKey&&"control",_.metaKey&&"meta",_.shiftKey&&"shift",_.altKey&&"alt"].filter(Boolean));m.every(M=>P.has(M))&&P.size===m.length&&(a&&_.preventDefault(),d.current?.())};return b.addEventListener("keydown",C,{capture:c}),()=>{b.removeEventListener("keydown",C,{capture:c})}},[i,a,c,m.join(",")])}const Jn=typeof window<"u"?window.localStorage:void 0;function lo({defaultTTL:e=300}={}){return{get:Fs,invalidate:uo,set:(r,i,a=e)=>Vs(r,i,a)}}function uo(e){Jn?.removeItem(e)}function Ls(e){const{timestamp:r,ttl:i}=e;return(Date.now()-r)/1e3>=i}function Fs(e){const r=Jn?.getItem(e);if(!r)return;const i=JSON.parse(r);if(i)if(Ls(i)){uo(e);return}else return i.value}function Vs(e,r,i){const a={value:e,timestamp:Date.now(),ttl:i};return Jn?.setItem(r,JSON.stringify(a)),e}function Ds(e){return N.useMemo(()=>lo({defaultTTL:e}),[e])}function Bs(e,r=[]){const i=Ee(e),a=N.useRef(void 0),c=N.useRef(!1);N.useLayoutEffect(()=>{const u=()=>{const g=Hs();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 Hs(){const e=we.fromViewport(),r=we.clone(e,{x:0,y:0}),i=we.from(window,{overflow:!0});if(!i)return;const a=we.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 fo(e){const r=N.useRef(void 0);return N.useEffect(()=>{r.current=e},[e]),r.current}const Zn=typeof window<"u"?window.sessionStorage:void 0;function po({defaultTTL:e=300}={}){return{get:Xs,invalidate:ho,set:(r,i,a=e)=>Us(r,i,a)}}function ho(e){Zn?.removeItem(e)}function Ys(e){const{timestamp:r,ttl:i}=e;return(Date.now()-r)/1e3>=i}function Xs(e){const r=Zn?.getItem(e);if(!r)return;const i=JSON.parse(r);if(i)if(Ys(i)){ho(e);return}else return i.value}function Us(e,r,i){const a={value:e,timestamp:Date.now(),ttl:i};return Zn?.setItem(r,JSON.stringify(a)),e}function Ks(e){return N.useMemo(()=>po({defaultTTL:e}),[e])}function Qn(e){const[r,i]=N.useState(we.zero);return Ht(e,{onResize:a=>{const c=we.from(a);c&&i(c)}}),we.size(r)}function go(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 $n(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 Gs(e,r,{element:i,isEnabled:a=!0}={}){N.useLayoutEffect(()=>{if(!a)return;const c=i??window.document.documentElement,u=go(e,{element:c,computed:!1});return $n(e,r,{element:c}),()=>{$n(e,u,{element:c})}},[e,r,i,a])}function Ws(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 Js(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 mo=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:Q,...$},K)=>{const q=Qs(C??[],d),w=$s({itemLength:c,itemPadding:u,layout:g,numSegments:m,orientation:b}),O=G=>q.indexOf(G)>=0,E=G=>{O(G)?X(G):z(G)},z=G=>{if(O(G))return;let Y;switch(_){case"multiple":{Y=oe=>vo([...oe.filter(le=>le!==G),G]);break}case"single":{Y=oe=>[G];break}default:return}const F=q,re=Y(q);se(F,re)},X=G=>{if(!O(G))return;const Y=oe=>oe.filter(le=>le!==G),F=q,re=Y(q);se(F,re)},J=G=>{P?.(G),_!=="none"&&(a?E(G):z(G))},se=(G,Y)=>{if(He(G,Y))return;const F=G?.filter(oe=>Y.indexOf(oe)===-1)??[],re=Y.filter(oe=>G?.indexOf(oe)===-1);F.forEach(oe=>R?.(oe)),re.forEach(oe=>T?.(oe)),j?.(Y)};N.useEffect(()=>{const G=q;let Y;switch(_){case"multiple":Y=q;break;case"single":Y=q.slice(-1);break;default:Y=[];break}se(G,Y)},[_]);const te=ke(r,{item:Jt});return x.jsx("div",{...$,ref:K,"aria-multiselectable":_==="multiple",className:ce(e),role:g==="grid"?"grid":_==="none"?"list":"listbox",style:ue(i,w.root),children:x.jsx(mt,{in:d,children:(G,Y)=>{const F=g==="grid"?"gridcell":_==="none"?"listitem":"option",re=O(Y),oe=ue(w.item,{pointerEvents:a!==!0&&O(Y)?"none":"auto",...Y>=d.length-1?{}:{...g==="list"?{...b==="vertical"?{marginBottom:`${u}px`}:{marginRight:`${u}px`}}:{}}});return Q?x.jsx(Q,{"aria-selected":re,className:ce({active:re}),index:Y,isSelected:O(Y),item:G,orientation:b,role:F,style:oe,onClick:()=>J(Y),onCustomEvent:(le,B)=>M?.(Y,le,B)}):x.jsx(me,{"aria-selected":re,className:ce({active:re}),element:te.item??x.jsx(Jt,{}),role:F,selectionMode:_,style:oe,onActivateAt:P,onClick:()=>J(Y),children:`${G}`})}})})}),Jt=({children:e,selectionMode:r,onActivateAt:i,...a})=>i||r==="single"||r==="multiple"?x.jsx("button",{...a,children:e}):x.jsx("div",{...a,children:e}),vt=Object.assign(mo,{Item:Jt});function Zs(e,r){return!!(isNaN(e)||e>=r.length||e<0)}function Qs(e,r){return vo(e).filter(i=>!Zs(i,r))}function vo(e){return e.sort((r,i)=>r-i)}function $s({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"&&(mo.displayName="Collection",Jt.displayName="Collection.Item");const yo=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:Q,HeaderComponent:$,ItemComponent:K,...q},w)=>{const O=na(g??{},d),E=ta(a??[],d),z=ra({orientation:c}),X=d.map(()=>N.useRef(null)),J=X.map(B=>Qn(B)),se=(B,L)=>(O[L]?.indexOf(B)??-1)>=0,te=B=>E.indexOf(B)>=0,G=B=>{let L;te(B)?L=I=>I.filter(W=>W!==B):i?L=I=>[B]:L=I=>[...I.filter(W=>W!==B),B],re(E,L(E))},Y=(B,L)=>{if(se(B,L))return;let I;switch(m){case"multiple":I=ee=>({...ee,[L]:$t([...(ee[L]??[]).filter(Z=>Z!==B),B])});break;case"single":I=ee=>({[L]:[B]});break;default:return}const W=I(O);oe(O,W)},F=(B,L)=>{if(!se(B,L))return;const W=(ee=>({...ee,[L]:(ee[L]??[]).filter(Z=>Z!==B)}))(O);oe(O,W)},re=(B,L)=>{if(He(B,L))return;const I=B?.filter(ee=>L.indexOf(ee)===-1)??[],W=L.filter(ee=>B?.indexOf(ee)===-1);I.forEach(ee=>C?.(ee)),W.forEach(ee=>R?.(ee)),P?.(L)},oe=(B,L)=>{if(He(B,L))return;const I=d.length;let W=[],ee=[];for(let Z=0;Z<I;Z++){const pe=B?.[Z]??[],ve=L[Z]??[],de=pe.filter(ne=>ve.indexOf(ne)===-1),Ne=ve.filter(ne=>pe?.indexOf(ne)===-1);W=[...W,...de.map(ne=>[ne,Z])],ee=[...ee,...Ne.map(ne=>[ne,Z])]}W.forEach(Z=>_?.(Z[0],Z[1])),ee.forEach(Z=>j?.(Z[0],Z[1])),Q?.(L)},le=ke(e,{collapseIcon:er,expandIcon:qn,header:Zt,item:Qt,section:tr});return x.jsx("div",{...q,ref:w,style:ue(r,z.root),children:x.jsx(mt,{in:d,children:(B,L)=>{const{collectionPadding:I=0,items:W=[],itemLength:ee=50,itemPadding:Z=0,isSelectionTogglable:pe,layout:ve="list",maxVisible:de=-1,numSegments:Ne=1}=B,ne=ve==="list"?W.length:Math.ceil(W.length/Ne),Ve=de<0?ne:Math.min(ne,de),Pe=ee*Ve+Z*(Ve-1),Ce=!te(L),De=J[L];return x.jsxs(me,{element:le.section??x.jsx(tr,{}),style:ue(z.section,c==="vertical"?{marginTop:L===0?"0px":`${u}px`,...De.height>0?{height:Ce?`${De.height}px`:`${Pe+De.height+I}px`}:{visibility:"hidden"}}:{marginLeft:L===0?"0px":`${u}px`,...De.width>0?{width:Ce?`${De.width}px`:`${Pe+De.width+I}px`}:{visibility:"hidden"}}),children:[x.jsx("div",{ref:X[L],style:ue(z.headerContainer),children:$?x.jsx($,{"aria-expanded":!Ce,className:ce({collapsed:Ce,expanded:!Ce}),index:L,isCollapsed:Ce,role:"button",section:B,style:ue(z.header),onClick:()=>G(L),onCustomEvent:(Me,Ye)=>M?.(L,Me,Ye)}):x.jsxs(me,{"aria-expanded":!Ce,className:ce({collapsed:Ce,expanded:!Ce}),element:le.header??x.jsx(Zt,{}),role:"button",style:ue(z.header),onClick:()=>G(L),children:[x.jsx("span",{dangerouslySetInnerHTML:{__html:B.label}}),le.expandIcon&&x.jsx(me,{className:ce({collapsed:Ce,expanded:!Ce}),element:Ce?le.collapseIcon??le.expandIcon:le.expandIcon,style:ue(Ce?z.collapseIcon:z.expandIcon)})]})}),x.jsx("div",{role:"region",style:ue({pointerEvents:Ce?"none":"auto"},c==="vertical"?{width:"100%",height:`${Pe}px`,marginTop:`${I}px`,overflowY:de<0||de>=ne?"hidden":"scroll"}:{marginLeft:`${I}px`,overflowX:de<0||de>=ne?"hidden":"scroll",width:`${Pe}px`,height:"100%"}),children:x.jsx(vt,{className:ce({collapsed:Ce,expanded:!Ce}),isSelectionTogglable:pe,ItemComponent:K,itemLength:ee,itemPadding:Z,items:W,layout:ve,numSegments:Ne,orientation:c,selection:O[L]??[],selectionMode:m,style:ue(c==="vertical"?{width:"100%"}:{height:"100%"}),onActivateAt:Me=>b?.(Me,L),onCustomEvent:(Me,Ye,Xe)=>T?.(Me,L,Ye,Xe),onDeselectAt:Me=>F(Me,L),onSelectAt:Me=>Y(Me,L),children:!K&&(le.item??x.jsx(Qt,{}))})})]})}})})}),Zt=({children:e,...r})=>x.jsx("button",{...r,children:e}),qn=({children:e,...r})=>x.jsx("figure",{...r,children:e}),er=({children:e,...r})=>x.jsx("figure",{...r,children:e}),tr=({children:e,...r})=>x.jsx("div",{...r,children:e}),Qt=vt.Item,qs=Object.assign(yo,{Header:Zt,ExpandIcon:qn,CollapseIcon:er,Section:tr,Item:Qt});function bo(e,r){return e>=r.length||e<0}function ea(e,r,i){if(bo(r,i))return!0;const a=i[r].items??[];return e>=a.length||e<0}function ta(e,r){return $t(e).filter(i=>!bo(i,r))}function na(e,r){const i={};for(const a in r){if(!Object.hasOwn(r,a))continue;const c=$t([...e[a]??[]]);i[Number(a)]=$t(c).filter(u=>!ea(u,Number(a),r))}return i}function $t(e){return e.sort((r,i)=>r-i)}function ra({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"&&(yo.displayName="Accordion",Zt.displayName="Accordion.Header",qn.displayName="Accordion.ExpandIcon",er.displayName="Accordion.CollapseIcon",Qt.displayName="Accordion.Item");const wo=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),Q=1e3,$=Ee(d),K=Ee(g),q=Ee(m),w=N.useRef(!1),O=N.useRef(!1),E=co(),[z,X]=N.useState(xo(R,c)),[J,se]=N.useState(!1),te=sa({scrollSnapEnabled:E||!J,orientation:c}),G=e>0,Y=N.useCallback(()=>{j.current!==void 0&&(clearTimeout(j.current),j.current=void 0)},[]),F=N.useCallback(()=>{Y(),j.current=setTimeout(()=>{clearTimeout(j.current),j.current=void 0},Q)},[Q,Y]),re=N.useCallback(()=>{oa(R,r,c),F()},[r,c]),oe=N.useCallback(()=>{X(xo(R,c))},[c]),le=N.useCallback(Z=>{E||(M.current=Se.make(Z.clientX,Z.clientY),se(!0))},[E]),B=N.useCallback(Z=>{E||(T.current=Se.make(Z.clientX,Z.clientY),re(),se(!1))},[E,re]),L=N.useCallback(Z=>{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)&&Z.stopPropagation(),M.current=void 0,T.current=void 0},[]),I=N.useCallback(()=>{const Z=(r+a.length+1)%a.length;q.current?.(Z)},[J,r,a.length]),W=N.useCallback(({x:Z,y:pe})=>{const ve=R.current;!ve||w.current||(Y(),w.current=!0,requestAnimationFrame(()=>{switch(c){case"horizontal":ve.scrollLeft-=Z*1.5;break;case"vertical":ve.scrollTop-=pe*1.5;default:console.error(`[etudes::Carousel] Unsupported orientation: ${c}`)}w.current=!1}))},[c]),ee=N.useCallback(()=>{const Z=R.current;!Z||O.current||(O.current=!0,requestAnimationFrame(()=>{if(u&&oe(),!(j.current!==void 0)){const ve=Math.round(c==="horizontal"?Z.scrollLeft/Z.clientWidth:Z.scrollTop/Z.clientHeight),de=Math.max(0,Math.min(a.length-1,ve));de!==r&&(P.current=de,q.current?.(de))}O.current=!1}))},[a.length,r,c,u,oe]);return io(R,{isEnabled:!E&&i&&a.length>1,onDragMove:W}),so(J||!G?-1:e,{onInterval:I},[r]),N.useLayoutEffect(()=>{!G||E||(J?$.current?.():K.current?.())},[E,J,G]),N.useLayoutEffect(()=>{const Z=R.current;if(!Z)return;const pe=P.current===void 0,ve=P.current===r;return Z.addEventListener("scroll",ee),u&&oe(),ve||(P.current=r,pe||(q.current?.(r),re())),()=>{Z.removeEventListener("scroll",ee)}},[r,u,re,ee,oe]),x.jsx("div",{...C,ref:_,role:"region",onClick:L,onPointerCancel:B,onPointerDown:le,onPointerLeave:B,onPointerUp:B,children:x.jsx("div",{ref:R,style:ue(te.viewport),children:x.jsx(mt,{in:a,children:({style:Z,...pe},ve)=>x.jsx("div",{style:ue(te.itemContainer),children:x.jsx(b,{"aria-hidden":ve!==r,exposure:u?z?.[ve]:void 0,style:ue(Z,te.item),...pe})})})})})});function oa(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 xo(e,r){const i=e?.current;if(!i)return;const a=[];for(let c=0;c<i.children.length;c++)a.push(ia(c,e,r));return a}function ia(e,r,i){const a=r?.current,c=a?.children[e];if(!c)return 0;const u=we.intersecting(c,a);if(!u)return 0;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 sa({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"&&(wo.displayName="Carousel");const Eo=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=la(b,g),M=N.useRef([]),T=ca(),j=ke(e,{field:qt}),Q=w=>{w<0?M.current[0]?.focus():w>=g?M.current[g-1]?.focus():M.current[w]?.focus()},$=w=>O=>{const E=R[w],z=ua(O.target.value,E),X=No(R.slice(),z.split("").slice(0,g),w);C(X);const J=Math.min(w+z.length,g-1);Q(J)},K=w=>O=>{switch(O.key){case"Backspace":{if(O.preventDefault(),R[w]){const E=R.slice();E[w]="",C(E),Q(w-1)}else Q(w-1);break}case"ArrowLeft":{O.preventDefault(),Q(w-1);break}case"ArrowRight":{O.preventDefault(),Q(w+1);break}}},q=w=>O=>{O.preventDefault();const E=O.clipboardData.getData("text").trim(),z=No(R.slice(),E.split("").slice(0,g),w);C(z);const X=Math.min(w+E.length,g-1);Q(X)};return N.useEffect(()=>{if(!i)return;const w=R.findIndex(O=>O==="");w!==-1&&Q(w)},[i]),x.jsx("div",{..._,ref:P,style:ue(m,T.root),children:x.jsx(pt,{count:g,children:w=>x.jsx(me,{ref:O=>M.current[w]=O,"aria-disabled":c,"aria-required":u,autoComplete:r,disabled:c,element:j.field??x.jsx(qt,{}),inputMode:a,placeholder:d,required:u,style:ue(T.field),value:R[w],onChange:$(w),onKeyDown:K(w),onPaste:q(w)})})})}),qt=({...e})=>x.jsx("input",{...e,autoCapitalize:"off",autoCorrect:"off",type:"text"}),aa=Object.assign(Eo,{Field:qt});function ca(){return{root:{alignItems:"stretch",display:"flex",justifyContent:"stretch"},field:{caretColor:"transparent",flex:"1",minWidth:"0"}}}function la(e,r){const i=e.slice(0,r);for(;i.length<r;)i.push("");return i}function No(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 ua(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"&&(Eo.displayName="CodeInput",qt.displayName="CodeInput.Field");const nr=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 x.jsx("input",{..._,ref:P,"aria-disabled":i,"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"&&(nr.displayName="TextField");const So=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=>{Q(O)},P=O=>{const E=M(O);E!==u?d?.(E):Q(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,Q]=N.useState(R(u)),$=fo(u),K=!isNaN(a)&&u+1>a,q=!isNaN(c)&&u-1<c;N.useEffect(()=>{if($===void 0||$===u)return;const O=T(u);Q(R(O))},[u,c,a]);const w=ke(e,{textField:en,addButton:tn,subscribeButton:nn});return x.jsxs("div",{...g,ref:m,style:ue(r,rn.root),children:[x.jsx(me,{className:ce({disabled:q}),element:w.subscribeButton??x.jsx(nn,{}),style:ue(rn.subtract),onClick:()=>b()}),x.jsx(me,{element:w.textField??x.jsx(en,{}),isDisabled:!i,style:ue(rn.textField),value:j,onChange:_,onUnfocus:P}),x.jsx(me,{className:ce({disabled:K}),element:w.addButton??x.jsx(tn,{}),style:ue(rn.add),onClick:()=>C()})]})}),en=({...e})=>x.jsx(nr,{...e}),tn=({children:e,...r})=>x.jsx("button",{...r,children:e}),nn=({children:e,...r})=>x.jsx("button",{...r,children:e}),fa=Object.assign(So,{TextField:en,AddButton:tn,SubtractButton:nn}),rn={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"&&(So.displayName="Counter",tn.displayName="Counter.AddButton",nn.displayName="Counter.SubtractButton",en.displayName="Counter.TextField");const da=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=ke(e,{track:on,knob:sn}),R=ha({angle:i,diameter:C});return x.jsxs("div",{...m,ref:b,style:ue(r,R.root),children:[x.jsx("div",{style:R.trackContainer,children:x.jsx("svg",{height:C,style:R.svgContainer,viewBox:`0 0 ${C} ${C}`,width:C,children:x.jsx(me,{cx:u,cy:u,element:P.track??x.jsx(on,{}),fill:"none",r:u-g/2,strokeDasharray:d,strokeWidth:g})})}),x.jsx("div",{style:ue(R.knobContainer),children:x.jsx("svg",{style:R.svgContainer,viewBox:`0 0 ${C} ${C}`,xmlns:"http://www.w3.org/2000/svg",children:x.jsx(me,{d:pa(u,u,u-c/2-(g-c)/2,-_/2,_/2),element:P.knob??x.jsx(sn,{}),fill:"none",strokeWidth:c})})})]})}),on=({...e})=>x.jsx("circle",{...e}),sn=({...e})=>x.jsx("path",{...e}),To=Object.assign(da,{Track:on,Knob:sn});function _o(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 pa(e,r,i,a,c){const u=_o(e,r,i,c),d=_o(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 ha({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"&&(To.displayName="Dial",on.displayName="Dial.Track",sn.displayName="Dial.Knob");const Co=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:Q="single",onActivateAt:$,onCollapse:K,onDeselectAt:q,onExpand:w,onSelectAt:O,onSelectionChange:E,onToggleCustomEvent:z,ItemComponent:X,ToggleComponent:J,...se},te)=>{const G=N.useRef(null),Y=Be(G),F=P.length,re=ba(P,R,M,m),oe=C??(T==="vertical"?Y.height:Y.width),le=oe*re+_*(re-1),B=va(j,P),[L,I]=N.useState(u??!0),W=wa({isCollapsed:L,collectionPadding:c,isInverted:d,maxVisibleItems:R,menuLength:le,numItems:F,orientation:T}),ee=ke(e,{collapseIcon:rr,collection:an,expandIcon:or,item:cn,toggle:ln}),Z=()=>{L&&(I(!1),w?.())},pe=()=>{L||(I(!0),K?.())},ve=()=>{L?Z():pe()},de=Ne=>{O?.(Ne),Q==="single"&&a&&pe()};return N.useEffect(()=>{u!==void 0&&I(u)},[u]),N.useEffect(()=>{const Ne=ne=>{if(L||!(ne.target instanceof Node))return;let Ve=!0,Pe=ne.target;for(;Pe;){if(Pe===G.current){Ve=!1;break}if(!Pe.parentNode)break;Pe=Pe.parentNode}Ve&&pe()};return window.addEventListener("click",Ne),()=>{window.removeEventListener("click",Ne)}},[L]),x.jsx("div",{...se,ref:te,className:ce(r,{collapsed:L,expanded:!L}),style:ue(i,W.root),children:x.jsxs("div",{ref:G,style:ue(W.body),children:[J?x.jsx(J,{"aria-expanded":!L,"aria-haspopup":"listbox",className:ce({collapsed:L,expanded:!L}),style:ue(W.toggle),onClick:ve,onCustomEvent:(Ne,ne)=>z?.(Ne,ne)}):x.jsxs(me,{"aria-expanded":!L,"aria-haspopup":"listbox",className:ce({collapsed:L,expanded:!L}),element:ee.toggle??x.jsx(ln,{}),style:ue(W.toggle),onClick:ve,children:[x.jsx("span",{dangerouslySetInnerHTML:{__html:g?.(B)??(B.length>0?B.map(Ne=>P[Ne]).join(", "):"")}}),ee.expandIcon&&x.jsx(me,{className:ce({collapsed:L,expanded:!L}),element:L?ee.collapseIcon??ee.expandIcon:ee.expandIcon,style:ue(L?W.collapseIcon:W.expandIcon)})]}),x.jsx(me,{element:ee.collection??x.jsx(an,{}),isSelectionTogglable:b,ItemComponent:X,itemLength:oe,itemPadding:_,items:P,layout:m,numSegments:M,orientation:T,selection:B,selectionMode:Q,style:ue(W.collection),onActivateAt:$,onDeselectAt:q,onSelectAt:de,onSelectionChange:E,children:!X&&(ee.item??x.jsx(cn,{}))})]})})}),an=vt,cn=vt.Item,ln=({children:e,...r})=>x.jsx("button",{...r,children:e}),rr=({children:e,...r})=>x.jsx("figure",{...r,"aria-hidden":!0,children:e}),or=({children:e,...r})=>x.jsx("figure",{...r,"aria-hidden":!0,children:e}),ga=Object.assign(Co,{Collection:an,CollapseIcon:rr,ExpandIcon:or,Item:cn,Toggle:ln});function ma(e,r){return!!(isNaN(e)||e>=r.length||e<0)}function va(e,r){return ya(e).filter(i=>!ma(i,r))}function ya(e){return e.sort((r,i)=>r-i)}function ba(e,r,i,a){const c=e.length;switch(a){case"grid":{const u=i<1?c:Math.ceil(c/i);return r<0?u:Math.min(u,r)}default:return r<0?c:Math.min(c,r)}}function wa({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"&&(Co.displayName="Dropdown",an.displayName="Dropdown.Collection",rr.displayName="Dropdown.CollapseIcon",or.displayName="Dropdown.ExpandIcon",cn.displayName="Dropdown.Item",ln.displayName="Dropdown.Toggle");const ko=":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",xa=ko+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",Ea="["+ko+"]["+xa+"]*",Na=new RegExp("^"+Ea+"$");function Oo(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 un=function(e){const r=Na.exec(e);return!(r===null||typeof r>"u")};function Sa(e){return typeof e<"u"}const Ta={allowBooleanAttributes:!1,unpairedTags:[]};function _a(e,r){r=Object.assign({},Ta,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=Io(e,u),u.err)return u}else if(e[u]==="<"){let d=u;if(u++,e[u]==="!"){u=jo(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
+ `&&e[u]!=="\r";u++)m+=e[u];if(m=m.trim(),m[m.length-1]==="/"&&(m=m.substring(0,m.length-1),u--),!Aa(m)){let _;return m.trim().length===0?_="Invalid space after '<'.":_="Tag '"+m+"' is an invalid name.",_e("InvalidTag",_,Ie(e,u))}const b=Oa(e,u);if(b===!1)return _e("InvalidAttr","Attributes for '"+m+"' have open quote.",Ie(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=Ro(C,r);if(P===!0)a=!0;else return _e(P.err.code,P.err.msg,Ie(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.",Ie(e,d));if(i.length===0)return _e("InvalidTag","Closing tag '"+m+"' has not been opened.",Ie(e,d));{const _=i.pop();if(m!==_.tagName){let P=Ie(e,_.tagStartPos);return _e("InvalidTag","Expected closing tag '"+_.tagName+"' (opened in line "+P.line+", col "+P.col+") instead of closing tag '"+m+"'.",Ie(e,d))}i.length==0&&(c=!0)}}else return _e("InvalidTag","Closing tag '"+m+"' doesn't have proper closing.",Ie(e,u));else{const _=Ro(C,r);if(_!==!0)return _e(_.err.code,_.err.msg,Ie(e,u-C.length+_.err.line));if(c===!0)return _e("InvalidXml","Multiple possible root nodes found.",Ie(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=jo(e,u);continue}else if(e[u+1]==="?"){if(u=Io(e,++u),u.err)return u}else break;else if(e[u]==="&"){const _=ja(e,u);if(_==-1)return _e("InvalidChar","char '&' is not expected.",Ie(e,u));u=_}else if(c===!0&&!Po(e[u]))return _e("InvalidXml","Extra text at the end",Ie(e,u));e[u]==="<"&&u--}}else{if(Po(e[u]))continue;return _e("InvalidChar","char '"+e[u]+"' is not expected.",Ie(e,u))}if(a){if(i.length==1)return _e("InvalidTag","Unclosed tag '"+i[0].tagName+"'.",Ie(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 Po(e){return e===" "||e===" "||e===`
8
+ `||e==="\r"}function Io(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.",Ie(e,r));if(e[r]=="?"&&e[r+1]==">"){r++;break}else continue}return r}function jo(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 Ca='"',ka="'";function Oa(e,r){let i="",a="",c=!1;for(;r<e.length;r++){if(e[r]===Ca||e[r]===ka)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 Pa=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function Ro(e,r){const i=Oo(e,Pa),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.",yt(i[c]));if(i[c][3]!==void 0&&i[c][4]===void 0)return _e("InvalidAttr","Attribute '"+i[c][2]+"' is without value.",yt(i[c]));if(i[c][3]===void 0&&!r.allowBooleanAttributes)return _e("InvalidAttr","boolean attribute '"+i[c][2]+"' is not allowed.",yt(i[c]));const u=i[c][2];if(!Ra(u))return _e("InvalidAttr","Attribute '"+u+"' is an invalid name.",yt(i[c]));if(!a.hasOwnProperty(u))a[u]=1;else return _e("InvalidAttr","Attribute '"+u+"' is repeated.",yt(i[c]))}return!0}function Ia(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 ja(e,r){if(r++,e[r]===";")return-1;if(e[r]==="#")return r++,Ia(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 Ra(e){return un(e)}function Aa(e){return un(e)}function Ie(e,r){const i=e.substring(0,r).split(/\r?\n/);return{line:i.length,col:i[i.length-1].length+1}}function yt(e){return e.startIndex+e[1].length}const Ma={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},za=function(e){return Object.assign({},Ma,e)};let fn;typeof Symbol!="function"?fn="@@xmlMetadata":fn=Symbol("XML Node Metadata");class et{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][fn]={startIndex:i})}static getMetaDataSymbol(){return fn}}class La{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&&tt(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&&tt(r,"!ELEMENT",i)){i+=8;const{index:g}=this.readElementExp(r,i+1);i=g}else if(u&&tt(r,"!ATTLIST",i))i+=8;else if(u&&tt(r,"!NOTATION",i)){i+=9;const{index:g}=this.readNotationExp(r,i+1,this.suppressValidationErr);i=g}else if(tt(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=Ae(r,i);let a="";for(;i<r.length&&!/\s/.test(r[i])&&r[i]!=='"'&&r[i]!=="'";)a+=r[i],i++;if(bt(a),i=Ae(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=Ae(r,i);let a="";for(;i<r.length&&!/\s/.test(r[i]);)a+=r[i],i++;!this.suppressValidationErr&&bt(a),i=Ae(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=Ae(r,i);let u=null,d=null;if(c==="PUBLIC")[i,u]=this.readIdentifierVal(r,i,"publicIdentifier"),i=Ae(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=Ae(r,i);let a="";for(;i<r.length&&!/\s/.test(r[i]);)a+=r[i],i++;if(!this.suppressValidationErr&&!un(a))throw new Error(`Invalid element name: "${a}"`);i=Ae(r,i);let c="";if(r[i]==="E"&&tt(r,"MPTY",i))i+=4;else if(r[i]==="A"&&tt(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=Ae(r,i);let a="";for(;i<r.length&&!/\s/.test(r[i]);)a+=r[i],i++;bt(a),i=Ae(r,i);let c="";for(;i<r.length&&!/\s/.test(r[i]);)c+=r[i],i++;if(!bt(c))throw new Error(`Invalid attribute name: "${c}"`);i=Ae(r,i);let u="";if(r.substring(i,i+8).toUpperCase()==="NOTATION"){if(u="NOTATION",i+=8,i=Ae(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(),!bt(m))throw new Error(`Invalid notation name: "${m}"`);g.push(m),r[i]==="|"&&(i++,i=Ae(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=Ae(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 Ae=(e,r)=>{for(;r<e.length&&/\s/.test(e[r]);)r++;return r};function tt(e,r,i){for(let a=0;a<r.length;a++)if(r[a]!==e[i+a+1])return!1;return!0}function bt(e){if(un(e))return e;throw new Error(`Invalid entity name ${e}`)}const Fa=/^[-+]?0x[a-fA-F0-9]+$/,Va=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,Da={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};function Ba(e,r={}){if(r=Object.assign({},Da,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&&Fa.test(i))return Ua(i,16);if(i.search(/.+[eE].+/)!==-1)return Ya(e,i,r);{const a=Va.exec(i);if(a){const c=a[1]||"",u=a[2];let d=Xa(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 Ha=/^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;function Ya(e,r,i){if(!i.eNotation)return e;const a=r.match(Ha);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 Xa(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 Ua(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 Ao(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 Ka{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=Ga,this.parseXml=$a,this.parseTextData=Wa,this.resolveNameSpace=Ja,this.buildAttributesMap=Qa,this.isItStopNode=nc,this.replaceEntitiesValue=ec,this.readStopNodeData=oc,this.saveTextToParentTag=tc,this.addChild=qa,this.ignoreAttributesFn=Ao(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 Ga(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 Wa(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?sr(e,this.options.parseTagValue,this.options.numberParseOptions):e.trim()===e?sr(e,this.options.parseTagValue,this.options.numberParseOptions):e}}function Ja(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 Za=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function Qa(e,r,i){if(this.options.ignoreAttributes!==!0&&typeof e=="string"){const a=Oo(e,Za),c=a.length,u={};for(let d=0;d<c;d++){const g=this.resolveNameSpace(a[d][1]);if(this.ignoreAttributesFn(g,r))continue;let m=a[d][4],b=this.options.attributeNamePrefix+g;if(g.length)if(this.options.transformAttributeName&&(b=this.options.transformAttributeName(b)),b==="__proto__"&&(b="#__proto__"),m!==void 0){this.options.trimValues&&(m=m.trim()),m=this.replaceEntitiesValue(m);const C=this.options.attributeValueProcessor(g,m,r);C==null?u[b]=m:typeof C!=typeof m||C!==m?u[b]=C:u[b]=sr(m,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(u[b]=!0)}if(!Object.keys(u).length)return;if(this.options.attributesGroupName){const d={};return d[this.options.attributesGroupName]=u,d}return u}}const $a=function(e){e=e.replace(/\r\n?/g,`
9
+ `);const r=new et("!xml");let i=r,a="",c="";const u=new La(this.options.processEntities);for(let d=0;d<e.length;d++)if(e[d]==="<")if(e[d+1]==="/"){const m=nt(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=ir(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 et(m.tagName);b.add(this.options.textNodeName,""),m.tagName!==m.tagExp&&m.attrExpPresent&&(b[":@"]=this.buildAttributesMap(m.tagExp,c,m.tagName)),this.addChild(i,b,c,d)}d=m.closeIndex+1}else if(e.substr(d+1,3)==="!--"){const m=nt(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=nt(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=ir(e,d,this.options.removeNSPrefix),b=m.tagName;const C=m.rawTagName;let _=m.tagExp,P=m.attrExpPresent,R=m.closeIndex;this.options.transformTagName&&(b=this.options.transformTagName(b)),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 $=this.readStopNodeData(e,C,R+1);if(!$)throw new Error(`Unexpected end of ${C}`);d=$.i,j=$.tagContent}const Q=new et(b);b!==_&&P&&(Q[":@"]=this.buildAttributesMap(_,c,b)),j&&(j=this.parseTextData(j,b,c,!0,P,!0,!0)),c=c.substr(0,c.lastIndexOf(".")),Q.add(this.options.textNodeName,j),this.addChild(i,Q,c,T)}else{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),this.options.transformTagName&&(b=this.options.transformTagName(b));const j=new et(b);b!==_&&P&&(j[":@"]=this.buildAttributesMap(_,c,b)),this.addChild(i,j,c,T),c=c.substr(0,c.lastIndexOf("."))}else{const j=new et(b);this.tagsNodeStack.push(i),b!==_&&P&&(j[":@"]=this.buildAttributesMap(_,c,b)),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 ec=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 tc(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 nc(e,r,i,a){return!!(r&&r.has(a)||e&&e.has(i))}function rc(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 nt(e,r,i,a){const c=e.indexOf(r,i);if(c===-1)throw new Error(a);return c+r.length-1}function ir(e,r,i,a=">"){const c=rc(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 oc(e,r,i){const a=i;let c=1;for(;i<e.length;i++)if(e[i]==="<")if(e[i+1]==="/"){const u=nt(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=nt(e,"?>",i+1,"StopNode is not closed.");else if(e.substr(i+1,3)==="!--")i=nt(e,"-->",i+3,"StopNode is not closed.");else if(e.substr(i+1,2)==="![")i=nt(e,"]]>",i,"StopNode is not closed.")-2;else{const u=ir(e,i,">");u&&((u&&u.tagName)===r&&u.tagExp[u.tagExp.length-1]!=="/"&&c++,i=u.closeIndex)}}function sr(e,r,i){if(r&&typeof e=="string"){const a=e.trim();return a==="true"?!0:a==="false"?!1:Ba(e,i)}else return Sa(e)?e:""}const ar=et.getMetaDataSymbol();function ic(e,r){return Mo(e,r)}function Mo(e,r,i){let a;const c={};for(let u=0;u<e.length;u++){const d=e[u],g=sc(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=Mo(d[g],r,m);const C=cc(b,r);d[ar]!==void 0&&(b[ar]=d[ar]),d[":@"]?ac(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 sc(e){const r=Object.keys(e);for(let i=0;i<r.length;i++){const a=r[i];if(a!==":@")return a}}function ac(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 cc(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 lc{constructor(r){this.externalEntities={},this.options=za(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=_a(r,i);if(u!==!0)throw Error(`${u.err.msg}:${u.err.line}:${u.err.col}`)}const a=new Ka(this.options);a.addExternalEntities(this.externalEntities);const c=a.parseXml(r);return this.options.preserveOrder||c===void 0?c:ic(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 et.getMetaDataSymbol()}}const uc=`
10
+ `;function fc(e,r){let i="";return r.format&&r.indentBy.length>0&&(i=uc),zo(e,r,"",i)}function zo(e,r,i,a){let c="",u=!1;for(let d=0;d<e.length;d++){const g=e[d],m=dc(g);if(m===void 0)continue;let b="";if(i.length===0?b=m:b=`${i}.${m}`,m===r.textNodeName){let M=g[m];pc(b,r)||(M=r.tagValueProcessor(m,M),M=Fo(M,r)),u&&(c+=a),c+=M,u=!1;continue}else if(m===r.cdataPropName){u&&(c+=a),c+=`<![CDATA[${g[m][0][r.textNodeName]}]]>`,u=!1;continue}else if(m===r.commentPropName){c+=a+`<!--${g[m][0][r.textNodeName]}-->`,u=!0;continue}else if(m[0]==="?"){const M=Lo(g[":@"],r),T=m==="?xml"?"":a;let j=g[m][0][r.textNodeName];j=j.length!==0?" "+j:"",c+=T+`<${m}${j}${M}?>`,u=!0;continue}let C=a;C!==""&&(C+=r.indentBy);const _=Lo(g[":@"],r),P=a+`<${m}${_}`,R=zo(g[m],r,b,C);r.unpairedTags.indexOf(m)!==-1?r.suppressUnpairedNode?c+=P+">":c+=P+"/>":(!R||R.length===0)&&r.suppressEmptyNode?c+=P+"/>":R&&R.endsWith(">")?c+=P+`>${R}${a}</${m}>`:(c+=P+">",R&&a!==""&&(R.includes("/>")||R.includes("</"))?c+=a+r.indentBy+R+a:c+=R,c+=`</${m}>`),u=!0}return c}function dc(e){const r=Object.keys(e);for(let i=0;i<r.length;i++){const a=r[i];if(e.hasOwnProperty(a)&&a!==":@")return a}}function Lo(e,r){let i="";if(e&&!r.ignoreAttributes)for(let a in e){if(!e.hasOwnProperty(a))continue;let c=r.attributeValueProcessor(a,e[a]);c=Fo(c,r),c===!0&&r.suppressBooleanAttributes?i+=` ${a.substr(r.attributeNamePrefix.length)}`:i+=` ${a.substr(r.attributeNamePrefix.length)}="${c}"`}return i}function pc(e,r){e=e.substr(0,e.length-r.textNodeName.length-1);let i=e.substr(e.lastIndexOf(".")+1);for(let a in r.stopNodes)if(r.stopNodes[a]===e||r.stopNodes[a]==="*."+i)return!0;return!1}function Fo(e,r){if(e&&e.length>0&&r.processEntities)for(let i=0;i<r.entities.length;i++){const a=r.entities[i];e=e.replace(a.regex,a.val)}return e}const hc={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(e,r){return r},attributeValueProcessor:function(e,r){return r},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&amp;"},{regex:new RegExp(">","g"),val:"&gt;"},{regex:new RegExp("<","g"),val:"&lt;"},{regex:new RegExp("'","g"),val:"&apos;"},{regex:new RegExp('"',"g"),val:"&quot;"}],processEntities:!0,stopNodes:[],oneListGroup:!1};function We(e){this.options=Object.assign({},hc,e),this.options.ignoreAttributes===!0||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=Ao(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=vc),this.processTextOrObjNode=gc,this.options.format?(this.indentate=mc,this.tagEndChar=`>
11
11
  `,this.newLine=`
12
- `):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}We.prototype.build=function(e){return this.options.preserveOrder?lc(e,this.options):(Array.isArray(e)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(e={[this.options.arrayNodeName]:e}),this.j2x(e,0,[]).val)},We.prototype.j2x=function(e,r,i){let a="",c="";const u=i.join(".");for(let d in e)if(Object.prototype.hasOwnProperty.call(e,d))if(typeof e[d]>"u")this.isAttribute(d)&&(c+="");else if(e[d]===null)this.isAttribute(d)||d===this.options.cdataPropName?c+="":d[0]==="?"?c+=this.indentate(r)+"<"+d+"?"+this.tagEndChar:c+=this.indentate(r)+"<"+d+"/"+this.tagEndChar;else if(e[d]instanceof Date)c+=this.buildTextValNode(e[d],d,"",r);else if(typeof e[d]!="object"){const g=this.isAttribute(d);if(g&&!this.ignoreAttributesFn(g,u))a+=this.buildAttrPairStr(g,""+e[d]);else if(!g)if(d===this.options.textNodeName){let m=this.options.tagValueProcessor(d,""+e[d]);c+=this.replaceEntitiesValue(m)}else c+=this.buildTextValNode(e[d],d,"",r)}else if(Array.isArray(e[d])){const g=e[d].length;let m="",b="";for(let C=0;C<g;C++){const T=e[d][C];if(!(typeof T>"u"))if(T===null)d[0]==="?"?c+=this.indentate(r)+"<"+d+"?"+this.tagEndChar:c+=this.indentate(r)+"<"+d+"/"+this.tagEndChar;else if(typeof T=="object")if(this.options.oneListGroup){const P=this.j2x(T,r+1,i.concat(d));m+=P.val,this.options.attributesGroupName&&T.hasOwnProperty(this.options.attributesGroupName)&&(b+=P.attrStr)}else m+=this.processTextOrObjNode(T,d,r,i);else if(this.options.oneListGroup){let P=this.options.tagValueProcessor(d,T);P=this.replaceEntitiesValue(P),m+=P}else m+=this.buildTextValNode(T,d,"",r)}this.options.oneListGroup&&(m=this.buildObjectNode(m,d,b,r)),c+=m}else if(this.options.attributesGroupName&&d===this.options.attributesGroupName){const g=Object.keys(e[d]),m=g.length;for(let b=0;b<m;b++)a+=this.buildAttrPairStr(g[b],""+e[d][g[b]])}else c+=this.processTextOrObjNode(e[d],d,r,i);return{attrStr:a,val:c}},We.prototype.buildAttrPairStr=function(e,r){return r=this.options.attributeValueProcessor(e,""+r),r=this.replaceEntitiesValue(r),this.options.suppressBooleanAttributes&&r==="true"?" "+e:" "+e+'="'+r+'"'};function pc(e,r,i,a){const c=this.j2x(e,i+1,a.concat(r));return e[this.options.textNodeName]!==void 0&&Object.keys(e).length===1?this.buildTextValNode(e[this.options.textNodeName],r,c.attrStr,i):this.buildObjectNode(c.val,r,c.attrStr,i)}We.prototype.buildObjectNode=function(e,r,i,a){if(e==="")return r[0]==="?"?this.indentate(a)+"<"+r+i+"?"+this.tagEndChar:this.indentate(a)+"<"+r+i+this.closeTag(r)+this.tagEndChar;{let c="</"+r+this.tagEndChar,u="";return r[0]==="?"&&(u="?",c=""),(i||i==="")&&e.indexOf("<")===-1?this.indentate(a)+"<"+r+i+u+">"+e+c:this.options.commentPropName!==!1&&r===this.options.commentPropName&&u.length===0?this.indentate(a)+`<!--${e}-->`+this.newLine:this.indentate(a)+"<"+r+i+u+this.tagEndChar+e+this.indentate(a)+c}},We.prototype.closeTag=function(e){let r="";return this.options.unpairedTags.indexOf(e)!==-1?this.options.suppressUnpairedNode||(r="/"):this.options.suppressEmptyNode?r="/":r=`></${e}`,r},We.prototype.buildTextValNode=function(e,r,i,a){if(this.options.cdataPropName!==!1&&r===this.options.cdataPropName)return this.indentate(a)+`<![CDATA[${e}]]>`+this.newLine;if(this.options.commentPropName!==!1&&r===this.options.commentPropName)return this.indentate(a)+`<!--${e}-->`+this.newLine;if(r[0]==="?")return this.indentate(a)+"<"+r+i+"?"+this.tagEndChar;{let c=this.options.tagValueProcessor(r,e);return c=this.replaceEntitiesValue(c),c===""?this.indentate(a)+"<"+r+i+this.closeTag(r)+this.tagEndChar:this.indentate(a)+"<"+r+i+">"+c+"</"+r+this.tagEndChar}},We.prototype.replaceEntitiesValue=function(e){if(e&&e.length>0&&this.options.processEntities)for(let r=0;r<this.options.entities.length;r++){const i=this.options.entities[r];e=e.replace(i.regex,i.val)}return e};function hc(e){return this.options.indentBy.repeat(e)}function gc(e){return e.startsWith(this.options.attributeNamePrefix)&&e!==this.options.textNodeName?e.substr(this.attrPrefixLen):!1}const Vo=N.forwardRef(({fillMode:e="preserve",svg:r,shouldStripClasses:i=!0,shouldStripIds:a=!0,shouldStripPositions:c=!0,shouldStripStyles:u=!0,...d},g)=>{const b=["id"].map(M=>`@_${M}`),C=["class"].map(M=>`@_${M}`),T=["fill","stroke","style"].map(M=>`@_${M}`),P=["x","y"].map(M=>`@_${M}`),R=()=>{const M=new ac({attributeNamePrefix:"@_",ignoreAttributes:!1,ignoreDeclaration:!0,ignorePiTags:!0,removeNSPrefix:!0,trimValues:!0,updateTag:(Q,$,K)=>{if(u&&Q.toLowerCase()==="style")return!1;const q=Object.keys(K);for(const w of q)Q.toLowerCase()==="svg"&&(c&&P.includes(w.toLowerCase())&&delete K[w],e!=="preserve"&&(w.toLowerCase()==="@_width"&&delete K[w],w.toLowerCase()==="@_height"&&delete K[w])),a&&b.includes(w.toLowerCase())&&delete K[w],i&&C.includes(w.toLowerCase())&&delete K[w],u&&T.includes(w.toLowerCase())&&delete K[w];if(Q.toLowerCase()==="svg")switch(e){case"fill":K["@_width"]="100%",K["@_height"]="100%";break;case"width":K["@_width"]="100%";break;case"height":K["@_height"]="100%";break}return Q}}),_=new We({attributeNamePrefix:"@_",format:!1,ignoreAttributes:!1}),j=M.parse(r);return _.build(j)};return x.jsx("figure",{...d,ref:g,dangerouslySetInnerHTML:{__html:R()},role:"img"})});process.env.NODE_ENV==="development"&&(Vo.displayName="FlatSVG");const Do=N.forwardRef(({onSubmit:e,...r},i)=>x.jsx("form",{...r,ref:i,onSubmit:a=>{a.preventDefault(),e()}}));process.env.NODE_ENV!=="production"&&(Do.displayName="Form");const Bo="base-",Ho=N.forwardRef(({alignSections:e=!1,children:r,className:i,horizontalSpacing:a=0,isReversed:c=!1,orientation:u="vertical",sections:d=3,verticalSpacing:g=0,...m},b)=>{const C=N.useRef(null),[T,P]=N.useState(NaN),[R,M]=N.useState(NaN),[_,j]=N.useState(NaN),[Q,$]=N.useState(NaN),K=()=>we.from(C.current)?.width??0,q=()=>we.from(C.current)?.height??0,w=()=>{const X=C.current;if(!X)return;const J=X.children,se=d;if(se<=0){console.error("[etudes::MasonryGrid] You must specify a minimum of 1 section(s) (a.k.a. row(s) for horizontal orientation, column(s) for vertical orientation) for a MasonryGrid instance");return}if(u==="vertical"){const te=[...new Array(se)].map(()=>0);for(const F of Array.from(J)){if(!(F instanceof HTMLElement))continue;const re=Xo(F,d),[oe,le]=Yo(te,re);F.role="gridcell",F.style.position="absolute",F.style.width=`calc(${100/se*re}% - ${a*(se-1)/se*re}px + ${a*(re-1)}px)`,F.style.height="",F.style.left=`calc(${100/se*oe}% - ${a*(se-1)/se*oe}px + ${a*oe}px)`,F.style.top=`${le+(le===0?0:g)}px`;for(let D=0;D<re;D++)te[oe+D]=le+(le===0?0:g)+(we.from(F)?.height??0);if(e&&oe+re===se){const D=wt(te);for(let L=0;L<se;L++)te[L]=D}}const G=K(),Y=wt(te,se);if(P(G),M(Y),isNaN(Y)||(X.style.height=`${Y}px`),c)for(const F of Array.from(J))F instanceof HTMLElement&&(F.style.left=`calc(${G}px - ${F.style.left} - ${F.getBoundingClientRect().width}px)`)}else{const te=[...new Array(se)].map(()=>0);for(const F of Array.from(J)){if(!(F instanceof HTMLElement))continue;const re=Xo(F,d),[oe,le]=Yo(te,re);F.style.position="absolute",F.style.width="",F.style.height=`calc(${100/se*re}% - ${g*(se-1)/se*re}px + ${g*(re-1)}px)`,F.style.top=`calc(${100/se*oe}% - ${g*(se-1)/se*oe}px + ${g*oe}px)`,F.style.left=`${le+(le===0?0:a)}px`;for(let D=0;D<re;D++)te[oe+D]=le+(le===0?0:a)+(we.from(F)?.width??0);if(e&&oe+re===se){const D=wt(te);for(let L=0;L<se;L++)te[L]=D}}const G=q(),Y=wt(te,se);if(M(G),P(Y),isNaN(Y)||(X.style.width=`${Y}px`),c)for(const F of Array.from(J))F instanceof HTMLElement&&(F.style.top=`calc(${G}px - ${F.style.top} - ${F.getBoundingClientRect().height}px)`)}},k=N.useCallback(X=>{const J=we.size(we.from(X)??we.zero),se=K(),te=q();(T!==se||R!==te||J.width!==_||J.height!==Q)&&(w(),j(J.width),$(J.height))},[e,a,c,d,g,u]);Ht(C,{onResize:k}),N.useEffect(()=>{const X=yc(C.current?.innerHTML);if(X.length===0)return w();const J=X.length;for(let se=0;se<J;se++){const te=X[se],G=new Image;G.src=te,G.onload=()=>w()}},[r]);const E=mc({orientation:u}),z=vc({orientation:u,minHeight:R,minWidth:T});return x.jsx("div",{...m,ref:b,className:ce(i,E.root),role:"grid",children:x.jsx("div",{ref:C,style:z.body,children:r})})});function mc({orientation:e="horizontal"}){return{root:ce(e)}}function vc({orientation:e="horizontal",minHeight:r=NaN,minWidth:i=NaN}){return{body:{height:e==="horizontal"?"100%":"auto",minHeight:e==="vertical"&&!isNaN(r)?`${r}px`:"",minWidth:e==="horizontal"&&!isNaN(i)?`${i}px`:"",padding:"0",width:e==="horizontal"?"auto":"100%"}}}function Yo(e,r){const i=e.length;let a=NaN,c=1/0;for(let u=0;u<i;u++){const d=e[u],g=d<c,m=u+r<=i;let b=!0;for(let C=1;C<r;C++)e[u+C]>d&&(b=!1);g&&m&&b&&(a=u,c=d)}return isNaN(a)?[0,wt(e,r)]:[a,c]}function wt(e,r){let i=e;return r!=null&&!isNaN(r)&&(i=i.slice(0,Math.max(1,Math.min(r,e.length)))),i.reduce((a,c,u)=>c>a?c:a,0)}function Xo(e,r){const i=e.classList;for(const a of Array.from(i))if(a.startsWith(Bo)){const c=parseFloat(a.replace(Bo,""));if(!isNaN(c))return Math.min(Math.max(c,1),r)}return 1}function yc(e){if(!e)return[];const r=/<img.*?src=(["'])(.*?)\1/g,i=/<img.*?src=(["'])(.*?)\1/,a=r.exec(e)??[],c=[];for(const u of a){const d=i.exec(u)?.[2];d&&c.push(d)}return c}process.env.NODE_ENV==="development"&&(Ho.displayName="MasonryGrid");const Uo=N.forwardRef(({children:e,className:r,decimalPlaces:i=2,isClipped:a=!1,knobHeight:c=28,knobPadding:u=0,knobWidth:d=40,max:g,min:m,orientation:b="vertical",range:C,steps:T=-1,onChange:P,...R},M)=>{const _=N.useRef(null),j=Be(_),Q=N.useRef(null),$=N.useRef(null),[K,q]=N.useState(C??[m,g]),w=Tc(m,g,T),[k,E]=K.map(W=>rt(W,m,g,b,j,d,c,a)),z=E-k,X=Oe(e,{gutter:dn,highlight:pn,knob:Et,knobContainer:hn,label:xt}),J=N.useCallback((W,ee,Z)=>{const pe=b==="horizontal"?ee:Z,ve=rt(m,m,g,b,j,d,c,a),de=rt(K[1],m,g,b,j,d,c,a),Ne=rt(W,m,g,b,j,d,c,a)+pe;return Ko(Math.max(ve,Math.min(de,Ne)),m,g,b,j,d,c,a)},[d,c,a,m,g,b,K[1],we.toString(j)]),se=N.useCallback((W,ee,Z)=>{const pe=b==="horizontal"?ee:Z,ve=rt(K[0],m,g,b,j,d,c,a),de=rt(g,m,g,b,j,d,c,a),Ne=rt(W,m,g,b,j,d,c,a)+pe;return Ko(Math.max(ve,Math.min(de,Ne)),m,g,b,j,d,c,a)},[d,c,a,m,g,b,K[0],we.toString(j)]),{isDragging:te,isReleasing:G,value:Y,setValue:F}=st(Q,{initialValue:C?.[0]??m,transform:J}),{isDragging:re,isReleasing:oe,value:le,setValue:D}=st($,{initialValue:C?.[1]??g,transform:se}),L=wc({isDraggingEndKnob:re,isDraggingStartKnob:te,isReleasingEndKnob:oe,isReleasingStartKnob:G}),I=xc({orientation:b,highlightLength:z,start:k,knobPadding:u,knobWidth:d,knobHeight:c});return N.useEffect(()=>{q([Y,le])},[Y,le]),N.useEffect(()=>{P?.(K)},[K[0],K[1]]),N.useEffect(()=>{te||re||oe||He(C,K)||(q(C??[m,g]),F(C?.[0]??m),D(C?.[1]??g))},[C?.[0],C?.[1],te,re,oe]),N.useEffect(()=>{w&&F(Go(Y,w))},[G,Fe(w)]),N.useEffect(()=>{!w||!oe||D(Go(le,w))},[oe,Fe(w)]),x.jsx("div",{...R,ref:M,"aria-valuemax":g,"aria-valuemin":m,className:ce(r,b),role:"slider",children:x.jsxs("div",{ref:_,style:I.body,children:[x.jsx(me,{element:X.gutter??x.jsx(dn,{}),style:ue(I.gutter)}),x.jsx(me,{element:X.highlight??x.jsx(pn,{}),style:ue(I.highlight)}),x.jsx(me,{ref:Q,className:L.startKnobContainer,disabled:He([Y,le],[m,m]),element:X.knobContainer??x.jsx(hn,{}),style:ue(I.knobContainer,{pointerEvents:He([Y,le],[m,m])?"none":"auto"},b==="horizontal"?{left:`${k}px`,top:`${j.height*.5}px`}:{left:`${j.width*.5}px`,top:`${k}px`}),children:x.jsxs(me,{className:L.startKnob,element:X.knob??x.jsx(Et,{}),style:ue(I.knob),children:[x.jsx("div",{style:I.knobHitBox}),X.label&&x.jsx(me,{className:L.startLabel,element:X.label??x.jsx(xt,{}),style:ue(I.label),children:Number(Y.toFixed(i)).toLocaleString()})]})}),x.jsx(me,{ref:$,className:L.endKnobContainer,disabled:He([Y,le],[g,g]),element:X.knobContainer??x.jsx(hn,{}),style:ue(I.knobContainer,{pointerEvents:He([Y,le],[g,g])?"none":"auto"},b==="horizontal"?{left:`${E}px`,top:`${j.height*.5}px`}:{left:`${j.width*.5}px`,top:`${E}px`}),children:x.jsxs(me,{className:L.endKnob,element:X.knob??x.jsx(Et,{}),style:ue(I.knob),children:[x.jsx("div",{style:I.knobHitBox}),X.label&&x.jsx(me,{className:L.endLabel,element:X.label??x.jsx(xt,{}),style:ue(I.label),children:Number(le.toFixed(i)).toLocaleString()})]})})]})})}),dn=({...e})=>x.jsx("div",{...e}),xt=({...e})=>x.jsx("div",{...e}),pn=({...e})=>x.jsx("div",{...e}),Et=({...e})=>x.jsx("div",{...e}),hn=({...e})=>x.jsx("button",{...e}),bc=Object.assign(Uo,{Gutter:dn,Highlight:pn,Knob:Et,KnobContainer:hn,Label:xt});function wc({isDraggingStartKnob:e=!1,isReleasingStartKnob:r=!1,isDraggingEndKnob:i=!1,isReleasingEndKnob:a=!1}){return{startKnobContainer:ce({dragging:e,releasing:r}),startKnob:ce({dragging:e,releasing:r}),startLabel:ce({dragging:e,releasing:r}),endKnobContainer:ce({dragging:i,releasing:a}),endKnob:ce({dragging:i,releasing:a}),endLabel:ce({dragging:i,releasing:a})}}function xc({orientation:e="horizontal",knobWidth:r=0,knobHeight:i=0,highlightLength:a=0,start:c=0,knobPadding:u=0}){return{body:{height:"100%",width:"100%"},gutter:{display:"block",top:"0",left:"0",position:"absolute",width:"100%",height:"100%"},highlight:{left:"0",position:"absolute",top:"0",...e==="horizontal"?{height:"100%",width:`${a}px`,transform:`translate(${c}px, 0)`}:{height:`${a}px`,width:"100%",transform:`translate(0, ${c}px)`}},knobContainer:{background:"none",border:"none",outline:"none",position:"absolute",transform:"translate(-50%, -50%)",zIndex:"1"},knob:{height:`${i}px`,touchAction:"none",width:`${r}px`},knobHitBox:{background:"none",height:`calc(100% + ${u*2}px)`,left:`-${u}px`,padding:`${u}px`,position:"absolute",top:`-${u}px`,width:`calc(100% + ${u*2}px)`},label:{pointerEvents:"none",position:"relative",userSelect:"none"}}}function Ec(e,r,i){return(e-r)/(i-r)}function Nc(e,r,i,a,c,u){switch(r){case"horizontal":{const d=u?i.width-a:i.width;return(e-(u?a*.5:0))/d}case"vertical":{const d=u?i.height-c:i.height;return(e-(u?c*.5:0))/d}default:return console.error(`[etudes::RangeSlider] Invalid orientation: ${r}`),NaN}}function Sc(e,r,i){return e*(i-r)+r}function Ko(e,r,i,a,c,u,d,g){const m=Nc(e,a,c,u,d,g);return Sc(m,r,i)}function _c(e,r,i,a,c,u){switch(r){case"horizontal":{const d=u?i.width-a:i.width;return e*d+(u?a*.5:0)}case"vertical":{const d=u?i.height-c:i.height;return e*d+(u?c*.5:0)}default:return console.error(`[etudes::RangeSlider] Invalid orientation: ${r}`),NaN}}function rt(e,r,i,a,c,u,d,g){const m=Ec(e,r,i);return _c(m,a,c,u,d,g)}function Go(e,r){const i=r.length;let a=0,c=1/0;for(let u=0;u<i;u++){const d=r[u],g=Math.abs(e-d);g<c&&(c=g,a=u)}return r[a]}function Tc(e,r,i){if(!(i<0))return[e,...[...Array(i)].map((a,c)=>e+(c+1)*(r-e)/(1+i)),r]}process.env.NODE_ENV==="development"&&(Uo.displayName="RangeSlider",dn.displayName="RangeSlider.Gutter",xt.displayName="RangeSlider.Label",pn.displayName="RangeSlider.Highlight",Et.displayName="RangeSlider.Knob");const Wo=N.forwardRef(({children:e,id:r,isRequired:i=!1,name:a,options:c,placeholder:u,value:d="",onChange:g,...m},b)=>{const C=Oe(e,{expandIcon:cr,option:Nt,toggle:gn});return x.jsxs("div",{...m,ref:b,style:lr.root,children:[x.jsxs(me,{"aria-required":i?"true":void 0,element:C.toggle??x.jsx(gn,{}),name:a,required:i,style:lr.select,value:d,onChange:T=>g?.(T.target.value),children:[u!==void 0&&x.jsx(me,{disabled:!0,hidden:!0,element:C.option??x.jsx(Nt,{}),value:"",children:u}),c.map((T,P)=>x.jsx(me,{element:C.option??x.jsx(Nt,{}),value:T,children:T},`${P}-${T}`))]}),C.expandIcon&&x.jsx(me,{element:C.expandIcon,style:lr.expandIcon})]})}),cr=({children:e,style:r,...i})=>x.jsx("figure",{...i,"aria-hidden":!0,style:ue(r,{pointerEvents:"none"}),children:e}),gn=({children:e,...r})=>x.jsx("select",{...r,children:e}),Nt=({...e})=>x.jsx("option",{...e}),Cc=Object.assign(Wo,{ExpandIcon:cr,Option:Nt,Toggle:gn}),lr={root:{alignItems:"center",display:"flex",flexDirection:"row",justifyContent:"flex-end",position:"relative"},select:{appearance:"none",boxSizing:"border-box",height:"100%",left:0,position:"absolute",top:0,width:"100%"},expandIcon:{pointerEvents:"none",zIndex:1}};process.env.NODE_ENV==="development"&&(Wo.displayName="Select",cr.displayName="Select.ExpandIcon",Nt.displayName="Select.Option",gn.displayName="Select.Toggle");const Jo=N.forwardRef(({children:e,className:r,isClipped:i=!1,isInverted:a=!1,isTrackInteractive:c=!0,knobHeight:u=30,knobPadding:d=0,knobWidth:g=30,onlyDispatchesOnDragEnd:m=!1,orientation:b="vertical",position:C=0,trackPadding:T=0,labelProvider:P,onDragEnd:R,onDragStart:M,onChange:_,...j},Q)=>{const $=N.useRef(null),K=N.useRef(null),q=N.useCallback((re,oe,le)=>{const D=we.from($.current)??we.zero,L=a?1-re:re;switch(b){case"horizontal":{const I=i?D.width-g:D.width,W=L*I+oe,ee=Math.max(0,Math.min(1,W/I));return a?1-ee:ee}case"vertical":{const I=i?D.height-u:D.height,W=L*I+le,ee=Math.max(0,Math.min(1,W/I));return a?1-ee:ee}default:return console.error(`[etudes::Slider] Invalid orientation: ${b}`),NaN}},[$.current,i,a,g,u,b]),w=N.useCallback(re=>{if(!c)return;const oe=we.from($.current)??we.zero,le=we.fromViewport();switch(b){case"horizontal":{const D=(re.clientX+le.left-oe.left)/oe.width,L=a?1-D:D;X(L);break}case"vertical":{const D=(re.clientY+le.top-oe.top)/oe.height,L=a?1-D:D;X(L);break}default:console.error(`[etudes::Slider] Invalid orientation: ${b}`)}},[$.current,a,c,b]),{isDragging:k,isReleasing:E,value:z,setValue:X}=st(K,{initialValue:C,transform:q,onDragStart:M,onDragEnd:R}),J=a?1-z:z,G=kc({orientation:b,isAtEnd:a?z===0:z===1,isAtStart:a?z===1:z===0,isDragging:k,isReleasing:E}),Y=Pc({orientation:b,isClipped:i,naturalPosition:J,knobPadding:d,knobHeight:u,knobWidth:g,isTrackInteractive:c});N.useEffect(()=>{k||C===z||X(C)},[C]),N.useEffect(()=>{k&&m||_?.(z,k)},[z]),N.useEffect(()=>{k||!m||_?.(z,!0)},[k]);const F=Oe(e,{knob:St,knobContainer:_t,label:Tt,track:at});return x.jsx("div",{...j,ref:Q,"aria-orientation":b,"aria-valuenow":z,className:ce(r,G.root),role:"slider",children:x.jsxs("div",{ref:$,style:Y.body,children:[x.jsx(me,{className:ce(a?"end":"start",G.track),element:F.track??x.jsx(at,{}),style:ue(Y.track,b==="vertical"?{height:`calc(${J*100}% - ${T<=0?0:u*.5}px - ${T}px)`,top:"0"}:{left:"0",width:`calc(${J*100}% - ${T<=0?0:g*.5}px - ${T}px)`}),onClick:w,children:x.jsx("div",{style:Y.trackHitBox})}),x.jsx(me,{className:ce(a?"start":"end",G.track),element:F.track??x.jsx(at,{}),style:ue(Y.track,b==="vertical"?{bottom:"0",height:`calc(${(1-J)*100}% - ${T<=0?0:u*.5}px - ${T}px)`}:{right:"0",width:`calc(${(1-J)*100}% - ${T<=0?0:g*.5}px - ${T}px)`}),onClick:w,children:x.jsx("div",{style:Y.trackHitBox})}),x.jsx(me,{ref:K,className:ce(G.knobContainer),element:F.knobContainer??x.jsx(_t,{}),style:Y.knobContainer,children:x.jsxs(me,{className:ce(G.knob),element:F.knob??x.jsx(St,{}),style:ue(Y.knob),children:[x.jsx("div",{style:Y.knobHitBox}),P&&x.jsx(me,{className:ce(G.label),element:F.label??x.jsx(Tt,{}),style:ue(Y.label),children:P(z)})]})})]})})}),at=({...e})=>x.jsx("div",{...e}),St=({...e})=>x.jsx("div",{...e}),_t=({...e})=>x.jsx("button",{...e}),Tt=({...e})=>x.jsx("div",{...e}),Oc=Object.assign(Jo,{Track:at,Knob:St,KnobContainer:_t,Label:Tt});function kc({orientation:e="vertical",isAtEnd:r=!1,isAtStart:i=!1,isDragging:a=!1,isReleasing:c=!1}){return{root:ce(e,{"at-end":r,"at-start":i,dragging:a,releasing:c}),track:ce(e,{"at-end":r,"at-start":i,dragging:a,releasing:c}),knob:ce(e,{"at-end":r,"at-start":i,dragging:a,releasing:c}),knobContainer:ce(e,{"at-end":r,"at-start":i,dragging:a,releasing:c}),label:ce(e,{"at-end":r,"at-start":i,dragging:a,releasing:c})}}function Pc({orientation:e="vertical",isClipped:r=!1,naturalPosition:i=0,knobPadding:a=0,knobHeight:c=0,knobWidth:u=0,isTrackInteractive:d=!0}){return{body:{height:"100%",width:"100%"},knobContainer:{background:"none",border:"none",outline:"none",position:"absolute",transform:"translate(-50%, -50%)",zIndex:"1",...e==="vertical"?{left:"50%",top:r?`calc(${i*100}% + ${c*.5-i*c}px)`:`${i*100}%`}:{left:r?`calc(${i*100}% + ${u*.5-i*u}px)`:`${i*100}%`,top:"50%"}},knob:{height:`${c}px`,touchAction:"none",width:`${u}px`},knobHitBox:{background:"none",height:`calc(100% + ${a*2}px)`,left:`-${a}px`,padding:`${a}px`,position:"absolute",top:`-${a}px`,width:`calc(100% + ${a*2}px)`},label:{pointerEvents:"none",userSelect:"none"},track:{cursor:d?"pointer":"auto",pointerEvents:d?"auto":"none",position:"absolute",...e==="vertical"?{left:"0",margin:"0 auto",right:"0",width:"100%"}:{bottom:"0",height:"100%",margin:"auto 0",top:"0"}},trackHitBox:{height:"100%",minHeight:"20px",minWidth:"20px",position:"absolute",transform:e==="horizontal"?"translate(0, -50%)":"translate(-50%, 0)",width:"100%"}}}process.env.NODE_ENV==="development"&&(Jo.displayName="Slider",at.displayName="Slider.Track",St.displayName="Slider.Knob",_t.displayName="Slider.KnobContainer",Tt.displayName="Slider.Label");const Zo=N.forwardRef(({children:e,className:r,index:i=0,isClipped:a=!1,isInverted:c=!1,isTrackInteractive:u=!0,knobHeight:d=30,knobPadding:g=0,knobWidth:m=30,labelProvider:b,onlyDispatchesOnDragEnd:C=!1,orientation:T="vertical",steps:P=Qo(10),trackPadding:R=0,onDragEnd:M,onDragStart:_,onIndexChange:j,onPositionChange:Q,...$},K)=>{const q=N.useRef(null),w=N.useRef(null),k=Be(q),[E,z]=N.useState(i),X=N.useCallback((I,W,ee)=>{const Z=c?Je(I):I;switch(T){case"horizontal":{const pe=a?k.width-m:k.width,ve=Z*pe+W,de=bn(ve/pe);return c?Je(de):de}case"vertical":{const pe=a?k.height-d:k.height,ve=Z*pe+ee,de=bn(ve/pe);return c?Je(de):de}default:return console.error(`[etudes::StepSlider] Invalid orientation: ${T}`),NaN}},[k.width,k.height,a,c,m,d,T]),{isDragging:J,isReleasing:se,value:te,setValue:G}=st(w,{initialValue:ct(i,P),transform:X,onDragStart:_,onDragEnd:M}),Y=N.useCallback(I=>{if(!u)return;const W=we.fromViewport();switch(T){case"horizontal":{const ee=(I.clientX+W.left-k.left)/k.width,Z=c?Je(ee):ee,pe=Ot(Z,P);if(pe===E){const ve=Z>te?pe+1:pe-1;z(bn(ve,P.length-1))}else z(pe);break}case"vertical":{const ee=(I.clientY+W.top-k.top)/k.height,Z=c?Je(ee):ee,pe=Ot(Z,P);if(pe===E){const ve=Z>te?pe+1:pe-1,de=ct(ve,P);G(de),z(bn(ve,P.length-1))}else{const ve=ct(pe,P);G(ve),z(pe)}break}default:console.error(`[etudes::StepSlider] Invalid orientation: ${T}`)}},[k.width,k.left,k.top,k.height,E,te,c,u,T,Fe(P)]),F=c?Je(te):te,le=jc({orientation:T,isAtEnd:c?te===0:te===1,isAtStart:c?te===1:te===0,isDragging:J,isReleasing:se}),D=Rc({orientation:T,naturalPosition:F,isClipped:a,knobPadding:g,knobHeight:d,knobWidth:m,isTrackInteractive:u}),L=Oe(e,{knob:mn,knobContainer:vn,label:yn,track:Ct});return N.useEffect(()=>{J||(G(ct(i,P)),z(i))},[i,J,Fe(P)]),N.useEffect(()=>{if(J){if(C)return;z(Ot(te,P))}else{const I=Ot(te,P),W=ct(I,P);G(W),z(I)}},[te,J,C,Fe(P)]),N.useEffect(()=>{Q?.(te,J)},[te,J]),N.useEffect(()=>{j?.(E,J)},[E,J]),x.jsx("div",{...$,ref:K,"aria-valuenow":E,className:ce(r,le.root),role:"slider",children:x.jsxs("div",{ref:q,style:D.body,children:[x.jsx(me,{className:ce(c?"end":"start",le.track),element:L.track??x.jsx(Ct,{}),style:ue(D.track,T==="vertical"?{height:`calc(${F*100}% - ${R<=0?0:d*.5}px - ${R}px)`,top:"0"}:{left:"0",width:`calc(${F*100}% - ${R<=0?0:m*.5}px - ${R}px)`}),onClick:Y,children:x.jsx("div",{style:D.trackHitBox})}),x.jsx(me,{className:ce(c?"start":"end",le.track),element:L.track??x.jsx(Ct,{}),style:ue(D.track,T==="vertical"?{bottom:"0",height:`calc(${Je(F)*100}% - ${R<=0?0:d*.5}px - ${R}px)`}:{right:"0",width:`calc(${Je(F)*100}% - ${R<=0?0:m*.5}px - ${R}px)`}),onClick:Y,children:x.jsx("div",{style:D.trackHitBox})}),x.jsx(me,{ref:w,className:ce(le.knobContainer),element:L.knobContainer??x.jsx(vn,{}),style:ue(D.knobContainer),children:x.jsxs(me,{className:ce(le.knob),element:L.knob??x.jsx(mn,{}),style:ue(D.knob),children:[x.jsx("div",{style:D.knobHitBox}),P&&b&&x.jsx(me,{className:ce(le.label),element:L.label??x.jsx(yn,{}),style:ue(D.label),children:b(te,Ot(te,P))})]})})]})})}),mn=({...e})=>x.jsx("div",{...e}),vn=({...e})=>x.jsx("button",{...e}),yn=({...e})=>x.jsx("div",{...e}),Ct=({...e})=>x.jsx("div",{...e});function Qo(e){if(e<=1)return console.error("[etudes::StepSlider] `length` value must be greater than or equal to 2"),[];if(Math.round(e)!==e)return console.error("[etudes::StepSlider] `length` value must be an integer"),[];const r=1/(e-1);return Array(e).fill(null).map((i,a)=>r*a)}const Ic=Object.assign(Zo,{Knob:mn,KnobContainer:vn,Label:yn,Track:Ct,generateSteps:Qo});function Ot(e,r){let i=-1,a=NaN;for(let c=0,u=r.length;c<u;c++){const d=ct(c,r);if(isNaN(d))continue;const g=Math.abs(e-d);(isNaN(a)||g<a)&&(a=g,i=c)}return i}function ct(e,r){return e>=r.length?NaN:r[e]}function jc({orientation:e="vertical",isAtEnd:r=!1,isAtStart:i=!1,isDragging:a=!1,isReleasing:c=!1}){return{root:ce(e,{"at-end":r,"at-start":i,dragging:a,releasing:c}),track:ce(e,{"at-end":r,"at-start":i,dragging:a,releasing:c}),knob:ce(e,{"at-end":r,"at-start":i,dragging:a,releasing:c}),knobContainer:ce(e,{"at-end":r,"at-start":i,dragging:a,releasing:c}),label:ce(e,{"at-end":r,"at-start":i,dragging:a,releasing:c})}}function Rc({orientation:e="vertical",naturalPosition:r=0,isClipped:i=!1,knobPadding:a=0,knobHeight:c=0,knobWidth:u=0,isTrackInteractive:d=!1}){return{body:{height:"100%",width:"100%"},knobContainer:{background:"none",border:"none",outline:"none",position:"absolute",transform:"translate3d(-50%, -50%, 0)",zIndex:"1",...e==="vertical"?{left:"50%",top:i?`calc(${r*100}% + ${c*.5-r*c}px)`:`${r*100}%`}:{left:i?`calc(${r*100}% + ${u*.5-r*u}px)`:`${r*100}%`,top:"50%"}},knob:{height:`${c}px`,touchAction:"none",width:`${u}px`},knobHitBox:{background:"none",height:`calc(100% + ${a*2}px)`,left:`-${a}px`,padding:`${a}px`,position:"absolute",top:`-${a}px`,width:`calc(100% + ${a*2}px)`},label:{pointerEvents:"none",userSelect:"none"},track:{cursor:d?"pointer":"auto",pointerEvents:d?"auto":"none",position:"absolute",...e==="vertical"?{left:"0",margin:"0 auto",right:"0",width:"100%"}:{bottom:"0",height:"100%",margin:"auto 0",top:"0"}},trackHitBox:{height:"100%",minHeight:"20px",minWidth:"20px",position:"absolute",transform:e==="horizontal"?"translate3d(0, -50%, 0)":"translate3d(-50%, 0, 0)",width:"100%"}}}function Je(e){return 1-e}function bn(e,r=1,i=0){return Math.max(i,Math.min(r,e))}process.env.NODE_ENV==="development"&&(Zo.displayName="StepSlider",Ct.displayName="StepSlider.Track",mn.displayName="StepSlider.Knob",vn.displayName="StepSlider.KnobContainer",yn.displayName="StepSlider.Label");const $o=N.forwardRef(({children:e,isEnabled:r=!0,threshold:i=.5,onSwipeDown:a,onSwipeLeft:c,onSwipeRight:u,onSwipeUp:d,...g},m)=>{const[b,C]=N.useState(void 0),[T,P]=N.useState(void 0),[R,M]=N.useState(NaN),_=(K,q)=>{if(isNaN(K)||isNaN(q))return $();C(Se.make(K,q))},j=(K,q)=>{const w=b;if(w===void 0)return;const k=w.x!==K||w.y!==q,E=!isNaN(R);k&&(E||M(Date.now()),P(Se.make(K,q)))},Q=()=>{const K=R,q=b,w=T;if(isNaN(K)||q===void 0||w===void 0)return;const k=Date.now()-K,E=w.x-q.x,z=w.y-q.y,X=E/k,J=z/k;r&&(Math.abs(X)>=i&&Math.abs(X)>Math.abs(J)?X>0?u?.():c?.():Math.abs(J)>=i&&Math.abs(J)>Math.abs(X)&&(J>0?a?.():d?.())),$()},$=()=>{C(void 0),P(void 0),M(NaN)};return x.jsx("div",{...g,ref:m,onMouseDown:K=>_(K.clientX,K.clientY),onMouseLeave:()=>$(),onMouseMove:K=>j(K.clientX,K.clientY),onMouseUp:()=>Q(),onTouchEnd:()=>Q(),onTouchMove:K=>j(K.targetTouches[0].clientX,K.targetTouches[0].clientY),onTouchStart:K=>_(K.targetTouches[0].clientX,K.targetTouches[0].clientY),children:e})});process.env.NODE_ENV==="development"&&($o.displayName="SwipeRegion");const qo=N.forwardRef(({onChange:e,...r},i)=>x.jsx("textarea",{...r,ref:i,onChange:a=>e(a.target.value)}));process.env.NODE_ENV==="development"&&(qo.displayName="TextArea");const ei=N.forwardRef(({className:e,children:r,isInverted:i=!1,isOn:a=!1,orientation:c="horizontal",style:u,onChange:d,...g},m)=>{const b=N.useRef(null),C=Qn(b),T=Oe(r,{knob:xn,track:wn}),P=Mc({isOn:a}),R=zc({isOn:a,isInverted:i,orientation:c,knobSize:C});return x.jsxs("label",{...g,ref:m,className:ce(e,P.root),style:ue(u,R.root),children:[x.jsx("input",{checked:a,style:R.input,type:"checkbox",onChange:M=>d?.(M.target.checked)}),x.jsx(me,{className:P.track,element:T.track??x.jsx(wn,{}),style:R.track,children:x.jsx("div",{style:{position:"relative",width:"100%",height:"100%"},children:x.jsx(me,{ref:b,className:P.knob,element:T.knob??x.jsx(xn,{}),style:R.knob})})})]})}),wn=({children:e,...r})=>x.jsx("div",{...r,children:e}),xn=({children:e,...r})=>x.jsx("div",{...r,children:e}),Ac=Object.assign(ei,{Knob:xn,Track:wn});function Mc({isOn:e=!1}){return{root:ce({active:e}),knob:ce({active:e}),track:ce({active:e})}}function zc({isOn:e=!1,isInverted:r=!1,knobSize:i=ke.zero,orientation:a="horizontal"}){return{root:{alignItems:"center",display:"flex",justifyContent:"start",position:"relative",...a==="horizontal"?{flexDirection:"row"}:{flexDirection:"column"}},input:{position:"absolute",top:0,left:0,opacity:0,width:0,height:0},knob:{position:"absolute",...a==="horizontal"?{...i.height>0?{top:`calc((100% - ${i.height}px) / 2)`}:{visibility:"hidden"},...i.width>0?{...r?{left:e?"0":`calc(100% - ${i.width}px)`}:{left:e?`calc(100% - ${i.width}px)`:"0"}}:{visibility:"hidden"}}:{...i.width>0?{left:`calc((100% - ${i.width}px) / 2)`}:{visibility:"hidden"},...i.height>0?{...r?{top:e?"0":`calc(100% - ${i.height}px)`}:{top:e?`calc(100% - ${i.height}px)`:"0"}}:{visibility:"hidden"}}},track:{position:"relative"}}}process.env.NODE_ENV==="development"&&(ei.displayName="Toggle",xn.displayName="Toggle.Knob",wn.displayName="Toggle.Track");function ur(e){return e==null?"":Array.isArray(e)?JSON.stringify(e.map(ur)):typeof e=="object"?JSON.stringify(Object.entries(e).sort(([r],[i])=>r.localeCompare(i)).map(([r,i])=>[r,ur(i)])):Fe(e)}function ti({children:e,...r}){return x.jsx(x.Fragment,{children:N.Children.map(e,i=>N.isValidElement(i)?Dt(i,{...r}):i)})}process.env.NODE_ENV==="development"&&(ti.displayName="ExtractChildren");function Lc({children:e,fallback:r=void 0}){const[i,a]=N.useState(!1);if(N.useEffect(()=>{a(typeof window<"u")},[]),!!i)return x.jsx(N.Suspense,{fallback:r,children:e})}H.Accordion=Qs,H.Burger=Mn,H.BurgerButton=$i,H.Button=Xn,H.Carousel=wo,H.CodeInput=ia,H.Collection=vt,H.Conditional=no,H.Counter=la,H.CoverImage=rs,H.CoverVideo=ss,H.Dial=_o,H.Dropdown=pa,H.Each=mt,H.ExtractChild=Wn,H.ExtractChildren=ti,H.FlatSVG=Vo,H.Form=Do,H.Image=Ln,H.MasonryGrid=Ho,H.NoSSR=Lc,H.OptionButton=Wr,H.Panorama=Kn,H.PanoramaSlider=ys,H.Picture=Fn,H.RangeSlider=bc,H.Repeat=pt,H.Select=Cc,H.SelectableButton=to,H.Slider=Oc,H.StepSlider=Ic,H.Styled=me,H.SwipeRegion=$o,H.Switch=ws,H.TextArea=qo,H.TextField=nr,H.Toggle=Ac,H.Video=Dn,H.WithTooltip=oo,H._Content=Yt,H._Knob=St,H._KnobContainer=_t,H._Label=Tt,H._Track=at,H._Viewport=Xt,H.asClassNameDict=Ji,H.asComponentDict=Oe,H.asStyleDict=Zi,H.cloneStyledElement=Dt,H.createKey=Fe,H.createKeyDeep=ur,H.createLocalCache=lo,H.createSessionCache=po,H.getStyle=go,H.isTouchDevice=ao,H.setStyle=$n,H.styles=ue,H.useAgent=Cs,H.useClassName=Os,H.useClickOutside=ks,H.useDPR=Is,H.useDrag=io,H.useDropzone=js,H.useImageLoader=Yr,H.useImageSize=zn,H.useInertiaDrag=Qr,H.useInertiaDragValue=st,H.useIntersectionObserver=Br,H.useInterval=so,H.useIsMounted=Rs,H.useIsTouchDevice=co,H.useKeyboardShortcut=As,H.useLatest=Ee,H.useLocalCache=Fs,H.usePosition=Vs,H.usePrevious=fo,H.useRect=Be,H.useSessionCache=Xs,H.useSize=Qn,H.useSizeObserver=Ht,H.useStyle=Us,H.useSystemColorScheme=Ks,H.useTimeout=Gs,H.useVideoMetadataLoader=Ur,H.useVideoSize=Kr,H.useViewportSize=Hr,Object.defineProperty(H,Symbol.toStringTag,{value:"Module"})}));
12
+ `):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}We.prototype.build=function(e){return this.options.preserveOrder?fc(e,this.options):(Array.isArray(e)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(e={[this.options.arrayNodeName]:e}),this.j2x(e,0,[]).val)},We.prototype.j2x=function(e,r,i){let a="",c="";const u=i.join(".");for(let d in e)if(Object.prototype.hasOwnProperty.call(e,d))if(typeof e[d]>"u")this.isAttribute(d)&&(c+="");else if(e[d]===null)this.isAttribute(d)||d===this.options.cdataPropName?c+="":d[0]==="?"?c+=this.indentate(r)+"<"+d+"?"+this.tagEndChar:c+=this.indentate(r)+"<"+d+"/"+this.tagEndChar;else if(e[d]instanceof Date)c+=this.buildTextValNode(e[d],d,"",r);else if(typeof e[d]!="object"){const g=this.isAttribute(d);if(g&&!this.ignoreAttributesFn(g,u))a+=this.buildAttrPairStr(g,""+e[d]);else if(!g)if(d===this.options.textNodeName){let m=this.options.tagValueProcessor(d,""+e[d]);c+=this.replaceEntitiesValue(m)}else c+=this.buildTextValNode(e[d],d,"",r)}else if(Array.isArray(e[d])){const g=e[d].length;let m="",b="";for(let C=0;C<g;C++){const _=e[d][C];if(!(typeof _>"u"))if(_===null)d[0]==="?"?c+=this.indentate(r)+"<"+d+"?"+this.tagEndChar:c+=this.indentate(r)+"<"+d+"/"+this.tagEndChar;else if(typeof _=="object")if(this.options.oneListGroup){const P=this.j2x(_,r+1,i.concat(d));m+=P.val,this.options.attributesGroupName&&_.hasOwnProperty(this.options.attributesGroupName)&&(b+=P.attrStr)}else m+=this.processTextOrObjNode(_,d,r,i);else if(this.options.oneListGroup){let P=this.options.tagValueProcessor(d,_);P=this.replaceEntitiesValue(P),m+=P}else m+=this.buildTextValNode(_,d,"",r)}this.options.oneListGroup&&(m=this.buildObjectNode(m,d,b,r)),c+=m}else if(this.options.attributesGroupName&&d===this.options.attributesGroupName){const g=Object.keys(e[d]),m=g.length;for(let b=0;b<m;b++)a+=this.buildAttrPairStr(g[b],""+e[d][g[b]])}else c+=this.processTextOrObjNode(e[d],d,r,i);return{attrStr:a,val:c}},We.prototype.buildAttrPairStr=function(e,r){return r=this.options.attributeValueProcessor(e,""+r),r=this.replaceEntitiesValue(r),this.options.suppressBooleanAttributes&&r==="true"?" "+e:" "+e+'="'+r+'"'};function gc(e,r,i,a){const c=this.j2x(e,i+1,a.concat(r));return e[this.options.textNodeName]!==void 0&&Object.keys(e).length===1?this.buildTextValNode(e[this.options.textNodeName],r,c.attrStr,i):this.buildObjectNode(c.val,r,c.attrStr,i)}We.prototype.buildObjectNode=function(e,r,i,a){if(e==="")return r[0]==="?"?this.indentate(a)+"<"+r+i+"?"+this.tagEndChar:this.indentate(a)+"<"+r+i+this.closeTag(r)+this.tagEndChar;{let c="</"+r+this.tagEndChar,u="";return r[0]==="?"&&(u="?",c=""),(i||i==="")&&e.indexOf("<")===-1?this.indentate(a)+"<"+r+i+u+">"+e+c:this.options.commentPropName!==!1&&r===this.options.commentPropName&&u.length===0?this.indentate(a)+`<!--${e}-->`+this.newLine:this.indentate(a)+"<"+r+i+u+this.tagEndChar+e+this.indentate(a)+c}},We.prototype.closeTag=function(e){let r="";return this.options.unpairedTags.indexOf(e)!==-1?this.options.suppressUnpairedNode||(r="/"):this.options.suppressEmptyNode?r="/":r=`></${e}`,r},We.prototype.buildTextValNode=function(e,r,i,a){if(this.options.cdataPropName!==!1&&r===this.options.cdataPropName)return this.indentate(a)+`<![CDATA[${e}]]>`+this.newLine;if(this.options.commentPropName!==!1&&r===this.options.commentPropName)return this.indentate(a)+`<!--${e}-->`+this.newLine;if(r[0]==="?")return this.indentate(a)+"<"+r+i+"?"+this.tagEndChar;{let c=this.options.tagValueProcessor(r,e);return c=this.replaceEntitiesValue(c),c===""?this.indentate(a)+"<"+r+i+this.closeTag(r)+this.tagEndChar:this.indentate(a)+"<"+r+i+">"+c+"</"+r+this.tagEndChar}},We.prototype.replaceEntitiesValue=function(e){if(e&&e.length>0&&this.options.processEntities)for(let r=0;r<this.options.entities.length;r++){const i=this.options.entities[r];e=e.replace(i.regex,i.val)}return e};function mc(e){return this.options.indentBy.repeat(e)}function vc(e){return e.startsWith(this.options.attributeNamePrefix)&&e!==this.options.textNodeName?e.substr(this.attrPrefixLen):!1}const Vo=N.forwardRef(({fillMode:e="preserve",svg:r,shouldStripClasses:i=!0,shouldStripIds:a=!0,shouldStripPositions:c=!0,shouldStripStyles:u=!0,...d},g)=>{const b=["id"].map(M=>`@_${M}`),C=["class"].map(M=>`@_${M}`),_=["fill","stroke","style"].map(M=>`@_${M}`),P=["x","y"].map(M=>`@_${M}`),R=()=>{const M=new lc({attributeNamePrefix:"@_",ignoreAttributes:!1,ignoreDeclaration:!0,ignorePiTags:!0,removeNSPrefix:!0,trimValues:!0,updateTag:(Q,$,K)=>{if(u&&Q.toLowerCase()==="style")return!1;const q=Object.keys(K);for(const w of q)Q.toLowerCase()==="svg"&&(c&&P.includes(w.toLowerCase())&&delete K[w],e!=="preserve"&&(w.toLowerCase()==="@_width"&&delete K[w],w.toLowerCase()==="@_height"&&delete K[w])),a&&b.includes(w.toLowerCase())&&delete K[w],i&&C.includes(w.toLowerCase())&&delete K[w],u&&_.includes(w.toLowerCase())&&delete K[w];if(Q.toLowerCase()==="svg")switch(e){case"fill":K["@_width"]="100%",K["@_height"]="100%";break;case"width":K["@_width"]="100%";break;case"height":K["@_height"]="100%";break}return Q}}),T=new We({attributeNamePrefix:"@_",format:!1,ignoreAttributes:!1}),j=M.parse(r);return T.build(j)};return x.jsx("figure",{...d,ref:g,dangerouslySetInnerHTML:{__html:R()},role:"img"})});process.env.NODE_ENV==="development"&&(Vo.displayName="FlatSVG");const Do=N.forwardRef(({onSubmit:e,...r},i)=>x.jsx("form",{...r,ref:i,onSubmit:a=>{a.preventDefault(),e()}}));process.env.NODE_ENV!=="production"&&(Do.displayName="Form");const Bo="base-",Ho=N.forwardRef(({alignSections:e=!1,children:r,className:i,horizontalSpacing:a=0,isReversed:c=!1,orientation:u="vertical",sections:d=3,verticalSpacing:g=0,...m},b)=>{const C=N.useRef(null),[_,P]=N.useState(NaN),[R,M]=N.useState(NaN),[T,j]=N.useState(NaN),[Q,$]=N.useState(NaN),K=()=>we.from(C.current)?.width??0,q=()=>we.from(C.current)?.height??0,w=()=>{const X=C.current;if(!X)return;const J=X.children,se=d;if(se<=0){console.error("[etudes::MasonryGrid] You must specify a minimum of 1 section(s) (a.k.a. row(s) for horizontal orientation, column(s) for vertical orientation) for a MasonryGrid instance");return}if(u==="vertical"){const te=[...new Array(se)].map(()=>0);for(const F of Array.from(J)){if(!(F instanceof HTMLElement))continue;const re=Xo(F,d),[oe,le]=Yo(te,re);F.role="gridcell",F.style.position="absolute",F.style.width=`calc(${100/se*re}% - ${a*(se-1)/se*re}px + ${a*(re-1)}px)`,F.style.height="",F.style.left=`calc(${100/se*oe}% - ${a*(se-1)/se*oe}px + ${a*oe}px)`,F.style.top=`${le+(le===0?0:g)}px`;for(let B=0;B<re;B++)te[oe+B]=le+(le===0?0:g)+(we.from(F)?.height??0);if(e&&oe+re===se){const B=wt(te);for(let L=0;L<se;L++)te[L]=B}}const G=K(),Y=wt(te,se);if(P(G),M(Y),isNaN(Y)||(X.style.height=`${Y}px`),c)for(const F of Array.from(J))F instanceof HTMLElement&&(F.style.left=`calc(${G}px - ${F.style.left} - ${F.getBoundingClientRect().width}px)`)}else{const te=[...new Array(se)].map(()=>0);for(const F of Array.from(J)){if(!(F instanceof HTMLElement))continue;const re=Xo(F,d),[oe,le]=Yo(te,re);F.style.position="absolute",F.style.width="",F.style.height=`calc(${100/se*re}% - ${g*(se-1)/se*re}px + ${g*(re-1)}px)`,F.style.top=`calc(${100/se*oe}% - ${g*(se-1)/se*oe}px + ${g*oe}px)`,F.style.left=`${le+(le===0?0:a)}px`;for(let B=0;B<re;B++)te[oe+B]=le+(le===0?0:a)+(we.from(F)?.width??0);if(e&&oe+re===se){const B=wt(te);for(let L=0;L<se;L++)te[L]=B}}const G=q(),Y=wt(te,se);if(M(G),P(Y),isNaN(Y)||(X.style.width=`${Y}px`),c)for(const F of Array.from(J))F instanceof HTMLElement&&(F.style.top=`calc(${G}px - ${F.style.top} - ${F.getBoundingClientRect().height}px)`)}},O=N.useCallback(X=>{const J=we.size(we.from(X)??we.zero),se=K(),te=q();(_!==se||R!==te||J.width!==T||J.height!==Q)&&(w(),j(J.width),$(J.height))},[e,a,c,d,g,u]);Ht(C,{onResize:O}),N.useEffect(()=>{const X=wc(C.current?.innerHTML);if(X.length===0)return w();const J=X.length;for(let se=0;se<J;se++){const te=X[se],G=new Image;G.src=te,G.onload=()=>w()}},[r]);const E=yc({orientation:u}),z=bc({orientation:u,minHeight:R,minWidth:_});return x.jsx("div",{...m,ref:b,className:ce(i,E.root),role:"grid",children:x.jsx("div",{ref:C,style:z.body,children:r})})});function yc({orientation:e="horizontal"}){return{root:ce(e)}}function bc({orientation:e="horizontal",minHeight:r=NaN,minWidth:i=NaN}){return{body:{height:e==="horizontal"?"100%":"auto",minHeight:e==="vertical"&&!isNaN(r)?`${r}px`:"",minWidth:e==="horizontal"&&!isNaN(i)?`${i}px`:"",padding:"0",width:e==="horizontal"?"auto":"100%"}}}function Yo(e,r){const i=e.length;let a=NaN,c=1/0;for(let u=0;u<i;u++){const d=e[u],g=d<c,m=u+r<=i;let b=!0;for(let C=1;C<r;C++)e[u+C]>d&&(b=!1);g&&m&&b&&(a=u,c=d)}return isNaN(a)?[0,wt(e,r)]:[a,c]}function wt(e,r){let i=e;return r!=null&&!isNaN(r)&&(i=i.slice(0,Math.max(1,Math.min(r,e.length)))),i.reduce((a,c,u)=>c>a?c:a,0)}function Xo(e,r){const i=e.classList;for(const a of Array.from(i))if(a.startsWith(Bo)){const c=parseFloat(a.replace(Bo,""));if(!isNaN(c))return Math.min(Math.max(c,1),r)}return 1}function wc(e){if(!e)return[];const r=/<img.*?src=(["'])(.*?)\1/g,i=/<img.*?src=(["'])(.*?)\1/,a=r.exec(e)??[],c=[];for(const u of a){const d=i.exec(u)?.[2];d&&c.push(d)}return c}process.env.NODE_ENV==="development"&&(Ho.displayName="MasonryGrid");const Uo=N.forwardRef(({children:e,className:r,decimalPlaces:i=2,isClipped:a=!1,knobHeight:c=28,knobPadding:u=0,knobWidth:d=40,max:g,min:m,orientation:b="vertical",range:C,steps:_=-1,onChange:P,...R},M)=>{const T=N.useRef(null),j=Be(T),Q=N.useRef(null),$=N.useRef(null),[K,q]=N.useState(C??[m,g]),w=kc(m,g,_),[O,E]=K.map(W=>rt(W,m,g,b,j,d,c,a)),z=E-O,X=ke(e,{gutter:dn,highlight:pn,knob:Et,knobContainer:hn,label:xt}),J=N.useCallback((W,ee,Z)=>{const pe=b==="horizontal"?ee:Z,ve=rt(m,m,g,b,j,d,c,a),de=rt(K[1],m,g,b,j,d,c,a),Ne=rt(W,m,g,b,j,d,c,a)+pe;return Ko(Math.max(ve,Math.min(de,Ne)),m,g,b,j,d,c,a)},[d,c,a,m,g,b,K[1],we.toString(j)]),se=N.useCallback((W,ee,Z)=>{const pe=b==="horizontal"?ee:Z,ve=rt(K[0],m,g,b,j,d,c,a),de=rt(g,m,g,b,j,d,c,a),Ne=rt(W,m,g,b,j,d,c,a)+pe;return Ko(Math.max(ve,Math.min(de,Ne)),m,g,b,j,d,c,a)},[d,c,a,m,g,b,K[0],we.toString(j)]),{isDragging:te,isReleasing:G,value:Y,setValue:F}=st(Q,{initialValue:C?.[0]??m,transform:J}),{isDragging:re,isReleasing:oe,value:le,setValue:B}=st($,{initialValue:C?.[1]??g,transform:se}),L=Ec({isDraggingEndKnob:re,isDraggingStartKnob:te,isReleasingEndKnob:oe,isReleasingStartKnob:G}),I=Nc({orientation:b,highlightLength:z,start:O,knobPadding:u,knobWidth:d,knobHeight:c});return N.useEffect(()=>{q([Y,le])},[Y,le]),N.useEffect(()=>{P?.(K)},[K[0],K[1]]),N.useEffect(()=>{te||re||oe||He(C,K)||(q(C??[m,g]),F(C?.[0]??m),B(C?.[1]??g))},[C?.[0],C?.[1],te,re,oe]),N.useEffect(()=>{w&&F(Go(Y,w))},[G,Fe(w)]),N.useEffect(()=>{!w||!oe||B(Go(le,w))},[oe,Fe(w)]),x.jsx("div",{...R,ref:M,"aria-valuemax":g,"aria-valuemin":m,className:ce(r,b),role:"slider",children:x.jsxs("div",{ref:T,style:I.body,children:[x.jsx(me,{element:X.gutter??x.jsx(dn,{}),style:ue(I.gutter)}),x.jsx(me,{element:X.highlight??x.jsx(pn,{}),style:ue(I.highlight)}),x.jsx(me,{ref:Q,className:L.startKnobContainer,disabled:He([Y,le],[m,m]),element:X.knobContainer??x.jsx(hn,{}),style:ue(I.knobContainer,{pointerEvents:He([Y,le],[m,m])?"none":"auto"},b==="horizontal"?{left:`${O}px`,top:`${j.height*.5}px`}:{left:`${j.width*.5}px`,top:`${O}px`}),children:x.jsxs(me,{className:L.startKnob,element:X.knob??x.jsx(Et,{}),style:ue(I.knob),children:[x.jsx("div",{style:I.knobHitBox}),X.label&&x.jsx(me,{className:L.startLabel,element:X.label??x.jsx(xt,{}),style:ue(I.label),children:Number(Y.toFixed(i)).toLocaleString()})]})}),x.jsx(me,{ref:$,className:L.endKnobContainer,disabled:He([Y,le],[g,g]),element:X.knobContainer??x.jsx(hn,{}),style:ue(I.knobContainer,{pointerEvents:He([Y,le],[g,g])?"none":"auto"},b==="horizontal"?{left:`${E}px`,top:`${j.height*.5}px`}:{left:`${j.width*.5}px`,top:`${E}px`}),children:x.jsxs(me,{className:L.endKnob,element:X.knob??x.jsx(Et,{}),style:ue(I.knob),children:[x.jsx("div",{style:I.knobHitBox}),X.label&&x.jsx(me,{className:L.endLabel,element:X.label??x.jsx(xt,{}),style:ue(I.label),children:Number(le.toFixed(i)).toLocaleString()})]})})]})})}),dn=({...e})=>x.jsx("div",{...e}),xt=({...e})=>x.jsx("div",{...e}),pn=({...e})=>x.jsx("div",{...e}),Et=({...e})=>x.jsx("div",{...e}),hn=({...e})=>x.jsx("button",{...e}),xc=Object.assign(Uo,{Gutter:dn,Highlight:pn,Knob:Et,KnobContainer:hn,Label:xt});function Ec({isDraggingStartKnob:e=!1,isReleasingStartKnob:r=!1,isDraggingEndKnob:i=!1,isReleasingEndKnob:a=!1}){return{startKnobContainer:ce({dragging:e,releasing:r}),startKnob:ce({dragging:e,releasing:r}),startLabel:ce({dragging:e,releasing:r}),endKnobContainer:ce({dragging:i,releasing:a}),endKnob:ce({dragging:i,releasing:a}),endLabel:ce({dragging:i,releasing:a})}}function Nc({orientation:e="horizontal",knobWidth:r=0,knobHeight:i=0,highlightLength:a=0,start:c=0,knobPadding:u=0}){return{body:{height:"100%",width:"100%"},gutter:{display:"block",top:"0",left:"0",position:"absolute",width:"100%",height:"100%"},highlight:{left:"0",position:"absolute",top:"0",...e==="horizontal"?{height:"100%",width:`${a}px`,transform:`translate(${c}px, 0)`}:{height:`${a}px`,width:"100%",transform:`translate(0, ${c}px)`}},knobContainer:{background:"none",border:"none",outline:"none",position:"absolute",transform:"translate(-50%, -50%)",zIndex:"1"},knob:{height:`${i}px`,touchAction:"none",width:`${r}px`},knobHitBox:{background:"none",height:`calc(100% + ${u*2}px)`,left:`-${u}px`,padding:`${u}px`,position:"absolute",top:`-${u}px`,width:`calc(100% + ${u*2}px)`},label:{pointerEvents:"none",position:"relative",userSelect:"none"}}}function Sc(e,r,i){return(e-r)/(i-r)}function Tc(e,r,i,a,c,u){switch(r){case"horizontal":{const d=u?i.width-a:i.width;return(e-(u?a*.5:0))/d}case"vertical":{const d=u?i.height-c:i.height;return(e-(u?c*.5:0))/d}default:return console.error(`[etudes::RangeSlider] Invalid orientation: ${r}`),NaN}}function _c(e,r,i){return e*(i-r)+r}function Ko(e,r,i,a,c,u,d,g){const m=Tc(e,a,c,u,d,g);return _c(m,r,i)}function Cc(e,r,i,a,c,u){switch(r){case"horizontal":{const d=u?i.width-a:i.width;return e*d+(u?a*.5:0)}case"vertical":{const d=u?i.height-c:i.height;return e*d+(u?c*.5:0)}default:return console.error(`[etudes::RangeSlider] Invalid orientation: ${r}`),NaN}}function rt(e,r,i,a,c,u,d,g){const m=Sc(e,r,i);return Cc(m,a,c,u,d,g)}function Go(e,r){const i=r.length;let a=0,c=1/0;for(let u=0;u<i;u++){const d=r[u],g=Math.abs(e-d);g<c&&(c=g,a=u)}return r[a]}function kc(e,r,i){if(!(i<0))return[e,...[...Array(i)].map((a,c)=>e+(c+1)*(r-e)/(1+i)),r]}process.env.NODE_ENV==="development"&&(Uo.displayName="RangeSlider",dn.displayName="RangeSlider.Gutter",xt.displayName="RangeSlider.Label",pn.displayName="RangeSlider.Highlight",Et.displayName="RangeSlider.Knob");const Wo=N.forwardRef(({children:e,id:r,isRequired:i=!1,name:a,options:c,placeholder:u,value:d="",onChange:g,...m},b)=>{const C=ke(e,{expandIcon:cr,option:Nt,toggle:gn});return x.jsxs("div",{...m,ref:b,style:lr.root,children:[x.jsxs(me,{"aria-required":i?"true":void 0,element:C.toggle??x.jsx(gn,{}),name:a,required:i,style:lr.select,value:d,onChange:_=>g?.(_.target.value),children:[u!==void 0&&x.jsx(me,{disabled:!0,hidden:!0,element:C.option??x.jsx(Nt,{}),value:"",children:u}),c.map((_,P)=>x.jsx(me,{element:C.option??x.jsx(Nt,{}),value:_,children:_},`${P}-${_}`))]}),C.expandIcon&&x.jsx(me,{element:C.expandIcon,style:lr.expandIcon})]})}),cr=({children:e,style:r,...i})=>x.jsx("figure",{...i,"aria-hidden":!0,style:ue(r,{pointerEvents:"none"}),children:e}),gn=({children:e,...r})=>x.jsx("select",{...r,children:e}),Nt=({...e})=>x.jsx("option",{...e}),Oc=Object.assign(Wo,{ExpandIcon:cr,Option:Nt,Toggle:gn}),lr={root:{alignItems:"center",display:"flex",flexDirection:"row",justifyContent:"flex-end",position:"relative"},select:{appearance:"none",boxSizing:"border-box",height:"100%",left:0,position:"absolute",top:0,width:"100%"},expandIcon:{pointerEvents:"none",zIndex:1}};process.env.NODE_ENV==="development"&&(Wo.displayName="Select",cr.displayName="Select.ExpandIcon",Nt.displayName="Select.Option",gn.displayName="Select.Toggle");const Jo=N.forwardRef(({children:e,className:r,isClipped:i=!1,isInverted:a=!1,isTrackInteractive:c=!0,knobHeight:u=30,knobPadding:d=0,knobWidth:g=30,onlyDispatchesOnDragEnd:m=!1,orientation:b="vertical",position:C=0,trackPadding:_=0,labelProvider:P,onDragEnd:R,onDragStart:M,onChange:T,...j},Q)=>{const $=N.useRef(null),K=N.useRef(null),q=N.useCallback((re,oe,le)=>{const B=we.from($.current)??we.zero,L=a?1-re:re;switch(b){case"horizontal":{const I=i?B.width-g:B.width,W=L*I+oe,ee=Math.max(0,Math.min(1,W/I));return a?1-ee:ee}case"vertical":{const I=i?B.height-u:B.height,W=L*I+le,ee=Math.max(0,Math.min(1,W/I));return a?1-ee:ee}default:return console.error(`[etudes::Slider] Invalid orientation: ${b}`),NaN}},[$.current,i,a,g,u,b]),w=N.useCallback(re=>{if(!c)return;const oe=we.from($.current)??we.zero,le=we.fromViewport();switch(b){case"horizontal":{const B=(re.clientX+le.left-oe.left)/oe.width,L=a?1-B:B;X(L);break}case"vertical":{const B=(re.clientY+le.top-oe.top)/oe.height,L=a?1-B:B;X(L);break}default:console.error(`[etudes::Slider] Invalid orientation: ${b}`)}},[$.current,a,c,b]),{isDragging:O,isReleasing:E,value:z,setValue:X}=st(K,{initialValue:C,transform:q,onDragStart:M,onDragEnd:R}),J=a?1-z:z,G=Ic({orientation:b,isAtEnd:a?z===0:z===1,isAtStart:a?z===1:z===0,isDragging:O,isReleasing:E}),Y=jc({orientation:b,isClipped:i,naturalPosition:J,knobPadding:d,knobHeight:u,knobWidth:g,isTrackInteractive:c});N.useEffect(()=>{O||C===z||X(C)},[C]),N.useEffect(()=>{O&&m||T?.(z,O)},[z]),N.useEffect(()=>{O||!m||T?.(z,!0)},[O]);const F=ke(e,{knob:St,knobContainer:Tt,label:_t,track:at});return x.jsx("div",{...j,ref:Q,"aria-orientation":b,"aria-valuenow":z,className:ce(r,G.root),role:"slider",children:x.jsxs("div",{ref:$,style:Y.body,children:[x.jsx(me,{className:ce(a?"end":"start",G.track),element:F.track??x.jsx(at,{}),style:ue(Y.track,b==="vertical"?{height:`calc(${J*100}% - ${_<=0?0:u*.5}px - ${_}px)`,top:"0"}:{left:"0",width:`calc(${J*100}% - ${_<=0?0:g*.5}px - ${_}px)`}),onClick:w,children:x.jsx("div",{style:Y.trackHitBox})}),x.jsx(me,{className:ce(a?"start":"end",G.track),element:F.track??x.jsx(at,{}),style:ue(Y.track,b==="vertical"?{bottom:"0",height:`calc(${(1-J)*100}% - ${_<=0?0:u*.5}px - ${_}px)`}:{right:"0",width:`calc(${(1-J)*100}% - ${_<=0?0:g*.5}px - ${_}px)`}),onClick:w,children:x.jsx("div",{style:Y.trackHitBox})}),x.jsx(me,{ref:K,className:ce(G.knobContainer),element:F.knobContainer??x.jsx(Tt,{}),style:Y.knobContainer,children:x.jsxs(me,{className:ce(G.knob),element:F.knob??x.jsx(St,{}),style:ue(Y.knob),children:[x.jsx("div",{style:Y.knobHitBox}),P&&x.jsx(me,{className:ce(G.label),element:F.label??x.jsx(_t,{}),style:ue(Y.label),children:P(z)})]})})]})})}),at=({...e})=>x.jsx("div",{...e}),St=({...e})=>x.jsx("div",{...e}),Tt=({...e})=>x.jsx("button",{...e}),_t=({...e})=>x.jsx("div",{...e}),Pc=Object.assign(Jo,{Track:at,Knob:St,KnobContainer:Tt,Label:_t});function Ic({orientation:e="vertical",isAtEnd:r=!1,isAtStart:i=!1,isDragging:a=!1,isReleasing:c=!1}){return{root:ce(e,{"at-end":r,"at-start":i,dragging:a,releasing:c}),track:ce(e,{"at-end":r,"at-start":i,dragging:a,releasing:c}),knob:ce(e,{"at-end":r,"at-start":i,dragging:a,releasing:c}),knobContainer:ce(e,{"at-end":r,"at-start":i,dragging:a,releasing:c}),label:ce(e,{"at-end":r,"at-start":i,dragging:a,releasing:c})}}function jc({orientation:e="vertical",isClipped:r=!1,naturalPosition:i=0,knobPadding:a=0,knobHeight:c=0,knobWidth:u=0,isTrackInteractive:d=!0}){return{body:{height:"100%",width:"100%"},knobContainer:{background:"none",border:"none",outline:"none",position:"absolute",transform:"translate(-50%, -50%)",zIndex:"1",...e==="vertical"?{left:"50%",top:r?`calc(${i*100}% + ${c*.5-i*c}px)`:`${i*100}%`}:{left:r?`calc(${i*100}% + ${u*.5-i*u}px)`:`${i*100}%`,top:"50%"}},knob:{height:`${c}px`,touchAction:"none",width:`${u}px`},knobHitBox:{background:"none",height:`calc(100% + ${a*2}px)`,left:`-${a}px`,padding:`${a}px`,position:"absolute",top:`-${a}px`,width:`calc(100% + ${a*2}px)`},label:{pointerEvents:"none",userSelect:"none"},track:{cursor:d?"pointer":"auto",pointerEvents:d?"auto":"none",position:"absolute",...e==="vertical"?{left:"0",margin:"0 auto",right:"0",width:"100%"}:{bottom:"0",height:"100%",margin:"auto 0",top:"0"}},trackHitBox:{height:"100%",minHeight:"20px",minWidth:"20px",position:"absolute",transform:e==="horizontal"?"translate(0, -50%)":"translate(-50%, 0)",width:"100%"}}}process.env.NODE_ENV==="development"&&(Jo.displayName="Slider",at.displayName="Slider.Track",St.displayName="Slider.Knob",Tt.displayName="Slider.KnobContainer",_t.displayName="Slider.Label");const Zo=N.forwardRef(({children:e,className:r,index:i=0,isClipped:a=!1,isInverted:c=!1,isTrackInteractive:u=!0,knobHeight:d=30,knobPadding:g=0,knobWidth:m=30,labelProvider:b,onlyDispatchesOnDragEnd:C=!1,orientation:_="vertical",steps:P=Qo(10),trackPadding:R=0,onDragEnd:M,onDragStart:T,onIndexChange:j,onPositionChange:Q,...$},K)=>{const q=N.useRef(null),w=N.useRef(null),O=Be(q),[E,z]=N.useState(i),X=N.useCallback((I,W,ee)=>{const Z=c?Je(I):I;switch(_){case"horizontal":{const pe=a?O.width-m:O.width,ve=Z*pe+W,de=bn(ve/pe);return c?Je(de):de}case"vertical":{const pe=a?O.height-d:O.height,ve=Z*pe+ee,de=bn(ve/pe);return c?Je(de):de}default:return console.error(`[etudes::StepSlider] Invalid orientation: ${_}`),NaN}},[O.width,O.height,a,c,m,d,_]),{isDragging:J,isReleasing:se,value:te,setValue:G}=st(w,{initialValue:ct(i,P),transform:X,onDragStart:T,onDragEnd:M}),Y=N.useCallback(I=>{if(!u)return;const W=we.fromViewport();switch(_){case"horizontal":{const ee=(I.clientX+W.left-O.left)/O.width,Z=c?Je(ee):ee,pe=kt(Z,P);if(pe===E){const ve=Z>te?pe+1:pe-1;z(bn(ve,P.length-1))}else z(pe);break}case"vertical":{const ee=(I.clientY+W.top-O.top)/O.height,Z=c?Je(ee):ee,pe=kt(Z,P);if(pe===E){const ve=Z>te?pe+1:pe-1,de=ct(ve,P);G(de),z(bn(ve,P.length-1))}else{const ve=ct(pe,P);G(ve),z(pe)}break}default:console.error(`[etudes::StepSlider] Invalid orientation: ${_}`)}},[O.width,O.left,O.top,O.height,E,te,c,u,_,Fe(P)]),F=c?Je(te):te,le=Ac({orientation:_,isAtEnd:c?te===0:te===1,isAtStart:c?te===1:te===0,isDragging:J,isReleasing:se}),B=Mc({orientation:_,naturalPosition:F,isClipped:a,knobPadding:g,knobHeight:d,knobWidth:m,isTrackInteractive:u}),L=ke(e,{knob:mn,knobContainer:vn,label:yn,track:Ct});return N.useEffect(()=>{J||(G(ct(i,P)),z(i))},[i,J,Fe(P)]),N.useEffect(()=>{if(J){if(C)return;z(kt(te,P))}else{const I=kt(te,P),W=ct(I,P);G(W),z(I)}},[te,J,C,Fe(P)]),N.useEffect(()=>{Q?.(te,J)},[te,J]),N.useEffect(()=>{j?.(E,J)},[E,J]),x.jsx("div",{...$,ref:K,"aria-valuenow":E,className:ce(r,le.root),role:"slider",children:x.jsxs("div",{ref:q,style:B.body,children:[x.jsx(me,{className:ce(c?"end":"start",le.track),element:L.track??x.jsx(Ct,{}),style:ue(B.track,_==="vertical"?{height:`calc(${F*100}% - ${R<=0?0:d*.5}px - ${R}px)`,top:"0"}:{left:"0",width:`calc(${F*100}% - ${R<=0?0:m*.5}px - ${R}px)`}),onClick:Y,children:x.jsx("div",{style:B.trackHitBox})}),x.jsx(me,{className:ce(c?"start":"end",le.track),element:L.track??x.jsx(Ct,{}),style:ue(B.track,_==="vertical"?{bottom:"0",height:`calc(${Je(F)*100}% - ${R<=0?0:d*.5}px - ${R}px)`}:{right:"0",width:`calc(${Je(F)*100}% - ${R<=0?0:m*.5}px - ${R}px)`}),onClick:Y,children:x.jsx("div",{style:B.trackHitBox})}),x.jsx(me,{ref:w,className:ce(le.knobContainer),element:L.knobContainer??x.jsx(vn,{}),style:ue(B.knobContainer),children:x.jsxs(me,{className:ce(le.knob),element:L.knob??x.jsx(mn,{}),style:ue(B.knob),children:[x.jsx("div",{style:B.knobHitBox}),P&&b&&x.jsx(me,{className:ce(le.label),element:L.label??x.jsx(yn,{}),style:ue(B.label),children:b(te,kt(te,P))})]})})]})})}),mn=({...e})=>x.jsx("div",{...e}),vn=({...e})=>x.jsx("button",{...e}),yn=({...e})=>x.jsx("div",{...e}),Ct=({...e})=>x.jsx("div",{...e});function Qo(e){if(e<=1)return console.error("[etudes::StepSlider] `length` value must be greater than or equal to 2"),[];if(Math.round(e)!==e)return console.error("[etudes::StepSlider] `length` value must be an integer"),[];const r=1/(e-1);return Array(e).fill(null).map((i,a)=>r*a)}const Rc=Object.assign(Zo,{Knob:mn,KnobContainer:vn,Label:yn,Track:Ct,generateSteps:Qo});function kt(e,r){let i=-1,a=NaN;for(let c=0,u=r.length;c<u;c++){const d=ct(c,r);if(isNaN(d))continue;const g=Math.abs(e-d);(isNaN(a)||g<a)&&(a=g,i=c)}return i}function ct(e,r){return e>=r.length?NaN:r[e]}function Ac({orientation:e="vertical",isAtEnd:r=!1,isAtStart:i=!1,isDragging:a=!1,isReleasing:c=!1}){return{root:ce(e,{"at-end":r,"at-start":i,dragging:a,releasing:c}),track:ce(e,{"at-end":r,"at-start":i,dragging:a,releasing:c}),knob:ce(e,{"at-end":r,"at-start":i,dragging:a,releasing:c}),knobContainer:ce(e,{"at-end":r,"at-start":i,dragging:a,releasing:c}),label:ce(e,{"at-end":r,"at-start":i,dragging:a,releasing:c})}}function Mc({orientation:e="vertical",naturalPosition:r=0,isClipped:i=!1,knobPadding:a=0,knobHeight:c=0,knobWidth:u=0,isTrackInteractive:d=!1}){return{body:{height:"100%",width:"100%"},knobContainer:{background:"none",border:"none",outline:"none",position:"absolute",transform:"translate3d(-50%, -50%, 0)",zIndex:"1",...e==="vertical"?{left:"50%",top:i?`calc(${r*100}% + ${c*.5-r*c}px)`:`${r*100}%`}:{left:i?`calc(${r*100}% + ${u*.5-r*u}px)`:`${r*100}%`,top:"50%"}},knob:{height:`${c}px`,touchAction:"none",width:`${u}px`},knobHitBox:{background:"none",height:`calc(100% + ${a*2}px)`,left:`-${a}px`,padding:`${a}px`,position:"absolute",top:`-${a}px`,width:`calc(100% + ${a*2}px)`},label:{pointerEvents:"none",userSelect:"none"},track:{cursor:d?"pointer":"auto",pointerEvents:d?"auto":"none",position:"absolute",...e==="vertical"?{left:"0",margin:"0 auto",right:"0",width:"100%"}:{bottom:"0",height:"100%",margin:"auto 0",top:"0"}},trackHitBox:{height:"100%",minHeight:"20px",minWidth:"20px",position:"absolute",transform:e==="horizontal"?"translate3d(0, -50%, 0)":"translate3d(-50%, 0, 0)",width:"100%"}}}function Je(e){return 1-e}function bn(e,r=1,i=0){return Math.max(i,Math.min(r,e))}process.env.NODE_ENV==="development"&&(Zo.displayName="StepSlider",Ct.displayName="StepSlider.Track",mn.displayName="StepSlider.Knob",vn.displayName="StepSlider.KnobContainer",yn.displayName="StepSlider.Label");const $o=N.forwardRef(({children:e,isEnabled:r=!0,threshold:i=.5,onSwipeDown:a,onSwipeLeft:c,onSwipeRight:u,onSwipeUp:d,...g},m)=>{const[b,C]=N.useState(void 0),[_,P]=N.useState(void 0),[R,M]=N.useState(NaN),T=(K,q)=>{if(isNaN(K)||isNaN(q))return $();C(Se.make(K,q))},j=(K,q)=>{const w=b;if(w===void 0)return;const O=w.x!==K||w.y!==q,E=!isNaN(R);O&&(E||M(Date.now()),P(Se.make(K,q)))},Q=()=>{const K=R,q=b,w=_;if(isNaN(K)||q===void 0||w===void 0)return;const O=Date.now()-K,E=w.x-q.x,z=w.y-q.y,X=E/O,J=z/O;r&&(Math.abs(X)>=i&&Math.abs(X)>Math.abs(J)?X>0?u?.():c?.():Math.abs(J)>=i&&Math.abs(J)>Math.abs(X)&&(J>0?a?.():d?.())),$()},$=()=>{C(void 0),P(void 0),M(NaN)};return x.jsx("div",{...g,ref:m,onMouseDown:K=>T(K.clientX,K.clientY),onMouseLeave:()=>$(),onMouseMove:K=>j(K.clientX,K.clientY),onMouseUp:()=>Q(),onTouchEnd:()=>Q(),onTouchMove:K=>j(K.targetTouches[0].clientX,K.targetTouches[0].clientY),onTouchStart:K=>T(K.targetTouches[0].clientX,K.targetTouches[0].clientY),children:e})});process.env.NODE_ENV==="development"&&($o.displayName="SwipeRegion");const qo=N.forwardRef(({onChange:e,...r},i)=>x.jsx("textarea",{...r,ref:i,onChange:a=>e(a.target.value)}));process.env.NODE_ENV==="development"&&(qo.displayName="TextArea");const ei=N.forwardRef(({className:e,children:r,isInverted:i=!1,isOn:a=!1,orientation:c="horizontal",style:u,onChange:d,...g},m)=>{const b=N.useRef(null),C=Qn(b),_=ke(r,{knob:xn,track:wn}),P=Lc({isOn:a}),R=Fc({isOn:a,isInverted:i,orientation:c,knobSize:C});return x.jsxs("label",{...g,ref:m,className:ce(e,P.root),style:ue(u,R.root),children:[x.jsx("input",{checked:a,style:R.input,type:"checkbox",onChange:M=>d?.(M.target.checked)}),x.jsx(me,{className:P.track,element:_.track??x.jsx(wn,{}),style:R.track,children:x.jsx("div",{style:{position:"relative",width:"100%",height:"100%"},children:x.jsx(me,{ref:b,className:P.knob,element:_.knob??x.jsx(xn,{}),style:R.knob})})})]})}),wn=({children:e,...r})=>x.jsx("div",{...r,children:e}),xn=({children:e,...r})=>x.jsx("div",{...r,children:e}),zc=Object.assign(ei,{Knob:xn,Track:wn});function Lc({isOn:e=!1}){return{root:ce({active:e}),knob:ce({active:e}),track:ce({active:e})}}function Fc({isOn:e=!1,isInverted:r=!1,knobSize:i=Oe.zero,orientation:a="horizontal"}){return{root:{alignItems:"center",display:"flex",justifyContent:"start",position:"relative",...a==="horizontal"?{flexDirection:"row"}:{flexDirection:"column"}},input:{position:"absolute",top:0,left:0,opacity:0,width:0,height:0},knob:{position:"absolute",...a==="horizontal"?{...i.height>0?{top:`calc((100% - ${i.height}px) / 2)`}:{visibility:"hidden"},...i.width>0?{...r?{left:e?"0":`calc(100% - ${i.width}px)`}:{left:e?`calc(100% - ${i.width}px)`:"0"}}:{visibility:"hidden"}}:{...i.width>0?{left:`calc((100% - ${i.width}px) / 2)`}:{visibility:"hidden"},...i.height>0?{...r?{top:e?"0":`calc(100% - ${i.height}px)`}:{top:e?`calc(100% - ${i.height}px)`:"0"}}:{visibility:"hidden"}}},track:{position:"relative"}}}process.env.NODE_ENV==="development"&&(ei.displayName="Toggle",xn.displayName="Toggle.Knob",wn.displayName="Toggle.Track");function ur(e){return e==null?"":Array.isArray(e)?JSON.stringify(e.map(ur)):typeof e=="object"?JSON.stringify(Object.entries(e).sort(([r],[i])=>r.localeCompare(i)).map(([r,i])=>[r,ur(i)])):Fe(e)}function ti({children:e,...r}){return x.jsx(x.Fragment,{children:N.Children.map(e,i=>N.isValidElement(i)?Dt(i,{...r}):i)})}process.env.NODE_ENV==="development"&&(ti.displayName="ExtractChildren");function Vc({children:e,fallback:r=void 0}){const[i,a]=N.useState(!1);if(N.useEffect(()=>{a(typeof window<"u")},[]),!!i)return x.jsx(N.Suspense,{fallback:r,children:e})}D.Accordion=qs,D.Burger=Mn,D.BurgerButton=$i,D.Button=Xn,D.Carousel=wo,D.CodeInput=aa,D.Collection=vt,D.Conditional=no,D.Counter=fa,D.CoverImage=rs,D.CoverVideo=ss,D.Dial=To,D.Dropdown=ga,D.Each=mt,D.ExtractChild=Wn,D.ExtractChildren=ti,D.FlatSVG=Vo,D.Form=Do,D.Image=Ln,D.MasonryGrid=Ho,D.NoSSR=Vc,D.OptionButton=Wr,D.Panorama=Kn,D.PanoramaSlider=ys,D.Picture=Fn,D.RangeSlider=xc,D.Repeat=pt,D.Select=Oc,D.SelectableButton=to,D.Slider=Pc,D.StepSlider=Rc,D.Styled=me,D.SwipeRegion=$o,D.Switch=ws,D.TextArea=qo,D.TextField=nr,D.Toggle=zc,D.Video=Dn,D.WithTooltip=oo,D._Content=Yt,D._Knob=St,D._KnobContainer=Tt,D._Label=_t,D._Track=at,D._Viewport=Xt,D.asClassNameDict=Ji,D.asComponentDict=ke,D.asStyleDict=Zi,D.cloneStyledElement=Dt,D.createKey=Fe,D.createKeyDeep=ur,D.createLocalCache=lo,D.createSessionCache=po,D.getStyle=go,D.isTouchDevice=ao,D.setStyle=$n,D.styles=ue,D.useAgent=Cs,D.useClassName=ks,D.useClickOutside=Os,D.useCopyBlobToClipboard=Ps,D.useDPR=Rs,D.useDownloadBlob=Is,D.useDrag=io,D.useDropzone=As,D.useImageLoader=Yr,D.useImageSize=zn,D.useInertiaDrag=Qr,D.useInertiaDragValue=st,D.useIntersectionObserver=Br,D.useInterval=so,D.useIsMounted=Ms,D.useIsTouchDevice=co,D.useKeyboardShortcut=zs,D.useLatest=Ee,D.useLocalCache=Ds,D.usePosition=Bs,D.usePrevious=fo,D.useRect=Be,D.useSessionCache=Ks,D.useSize=Qn,D.useSizeObserver=Ht,D.useStyle=Gs,D.useSystemColorScheme=Ws,D.useTimeout=Js,D.useVideoMetadataLoader=Ur,D.useVideoSize=Kr,D.useViewportSize=Hr,Object.defineProperty(D,Symbol.toStringTag,{value:"Module"})}));