@plainsheet/core 0.7.12 → 1.0.1

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,5 +1,6 @@
1
- import { AnimationTimingFunction } from '../utils/animation/animation.type';
1
+ import { StyleCreators } from './animation.type';
2
2
  import { AnimationFrame } from '../utils/animation/animation-frame';
3
+ import { AnimationTimingFunction } from '../utils/animation/animation.type';
3
4
 
4
5
  export interface TranslateContainerParams {
5
6
  startY: number;
@@ -17,4 +18,18 @@ export type TranslateContainerParamsExceptAnimation = Omit<TranslateContainerPar
17
18
  export type TranslateContainer = ReturnType<typeof translateContainerWithAnim>;
18
19
  export declare function translateContainer(params: TranslateContainerParams): void;
19
20
  export declare const translateContainerWithAnim: (animTimingFunction: AnimationTimingFunction, animDuration: number) => (params: TranslateContainerParamsExceptAnimation) => void;
21
+ export interface AnimateBackdropParams {
22
+ backdrop: HTMLElement;
23
+ styleCreators: StyleCreators;
24
+ animationFrame: AnimationFrame;
25
+ animationTimingFunction: AnimationTimingFunction;
26
+ /**
27
+ * In Milliseconds.
28
+ */
29
+ animationDuration: number;
30
+ onEnd?: () => void;
31
+ }
32
+ export type AnimateBackdropParamsExceptAnimation = Omit<AnimateBackdropParams, "animationTimingFunction" | "animationDuration">;
33
+ export declare function animateBackdrop(params: AnimateBackdropParams): void;
34
+ export declare const animateBackdropWithAnim: (animTimingFunction: AnimationTimingFunction, animDuration: number) => (params: AnimateBackdropParamsExceptAnimation) => void;
20
35
  //# sourceMappingURL=animation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"animation.d.ts","sourceRoot":"","sources":["../../src/animation/animation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAElF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAGzE,MAAM,WAAW,wBAAwB;IACvC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE,cAAc,CAAC;IAC/B,oBAAoB,EAAE,WAAW,CAAC;IAClC,KAAK,CAAC,EAAE,MAAM,IAAI,CAAC;IACnB,uBAAuB,EAAE,uBAAuB,CAAC;IACjD;;OAEG;IACH,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AACD,MAAM,MAAM,uCAAuC,GAAG,IAAI,CACxD,wBAAwB,EACxB,yBAAyB,GAAG,mBAAmB,CAChD,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,UAAU,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE/E,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,wBAAwB,GAAG,IAAI,CA0BzE;AAED,eAAO,MAAM,0BAA0B,GACpC,oBAAoB,uBAAuB,EAAE,cAAc,MAAM,MACjE,QAAQ,uCAAuC,SAM/C,CAAC"}
1
+ {"version":3,"file":"animation.d.ts","sourceRoot":"","sources":["../../src/animation/animation.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAElF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAEzE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD,MAAM,WAAW,wBAAwB;IACvC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE,cAAc,CAAC;IAC/B,oBAAoB,EAAE,WAAW,CAAC;IAClC,KAAK,CAAC,EAAE,MAAM,IAAI,CAAC;IACnB,uBAAuB,EAAE,uBAAuB,CAAC;IACjD;;OAEG;IACH,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AACD,MAAM,MAAM,uCAAuC,GAAG,IAAI,CACxD,wBAAwB,EACxB,yBAAyB,GAAG,mBAAmB,CAChD,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,UAAU,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE/E,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,wBAAwB,GAAG,IAAI,CA0BzE;AAED,eAAO,MAAM,0BAA0B,uBAChB,uBAAuB,gBAAgB,MAAM,cACzD,uCAAuC,SAM/C,CAAC;AAEJ,MAAM,WAAW,qBAAqB;IACpC,QAAQ,EAAE,WAAW,CAAC;IACtB,aAAa,EAAE,aAAa,CAAC;IAC7B,cAAc,EAAE,cAAc,CAAC;IAC/B,uBAAuB,EAAE,uBAAuB,CAAC;IACjD;;OAEG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,IAAI,CAAC;CACpB;AACD,MAAM,MAAM,oCAAoC,GAAG,IAAI,CACrD,qBAAqB,EACrB,yBAAyB,GAAG,mBAAmB,CAChD,CAAC;AACF,wBAAgB,eAAe,CAAC,MAAM,EAAE,qBAAqB,GAAG,IAAI,CAuBnE;AACD,eAAO,MAAM,uBAAuB,uBACb,uBAAuB,gBAAgB,MAAM,cACzD,oCAAoC,SAM5C,CAAC"}
@@ -1,6 +1,11 @@
1
+ import { GetMutableKeys } from '@plainsheet/utility';
2
+
1
3
  export type Position = number;
2
4
  export interface Coordinates {
3
5
  x: Position;
4
6
  y: Position;
5
7
  }
8
+ export type StyleCreators = Partial<Record<Extract<GetMutableKeys<CSSStyleDeclaration>, string>, StyleCreator>>;
9
+ type StyleCreator = (percent: number) => string;
10
+ export {};
6
11
  //# sourceMappingURL=animation.type.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"animation.type.d.ts","sourceRoot":"","sources":["../../src/animation/animation.type.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC;AAE9B,MAAM,WAAW,WAAW;IAC1B,CAAC,EAAE,QAAQ,CAAC;IACZ,CAAC,EAAE,QAAQ,CAAC;CACb"}
1
+ {"version":3,"file":"animation.type.d.ts","sourceRoot":"","sources":["../../src/animation/animation.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC;AAE9B,MAAM,WAAW,WAAW;IAC1B,CAAC,EAAE,QAAQ,CAAC;IACZ,CAAC,EAAE,QAAQ,CAAC;CACb;AAED,MAAM,MAAM,aAAa,GAAG,OAAO,CACjC,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC,mBAAmB,CAAC,EAAE,MAAM,CAAC,EAAE,YAAY,CAAC,CAC3E,CAAC;AACF,KAAK,YAAY,GAAG,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,CAAC"}
@@ -1,5 +1,5 @@
1
- import { BottomSheetCoreProps } from './types/bottom-sheet-props.type';
2
1
  import { BottomSheetCore } from './types/bottom-sheet.type';
2
+ import { BottomSheetCoreProps } from './types/bottom-sheet-props.type';
3
3
 
4
4
  export declare function createBottomSheet(props: BottomSheetCoreProps): BottomSheetCore;
5
5
  //# sourceMappingURL=bottom-sheet.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"bottom-sheet.d.ts","sourceRoot":"","sources":["../src/bottom-sheet.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAC9B,OAAO,0BAA0B,CAAC;AAClC,OAAO,2BAA2B,CAAC;AACnC,OAAO,wBAAwB,CAAC;AAChC,OAAO,yBAAyB,CAAC;AAiBjC,OAAO,KAAK,EAEV,oBAAoB,EAErB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAajE,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,oBAAoB,GAC1B,eAAe,CA0YjB"}
1
+ {"version":3,"file":"bottom-sheet.d.ts","sourceRoot":"","sources":["../src/bottom-sheet.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAC9B,OAAO,0BAA0B,CAAC;AAClC,OAAO,2BAA2B,CAAC;AACnC,OAAO,wBAAwB,CAAC;AAChC,OAAO,yBAAyB,CAAC;AAoBjC,OAAO,KAAK,EAEV,oBAAoB,EAErB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAajE,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,oBAAoB,GAC1B,eAAe,CAgajB"}
@@ -1,5 +1,5 @@
1
- import { BottomSheetPosition, SnapPoints } from '../types/bottom-sheet-props.type';
2
1
  import { DraggingDirection } from './position-calculator.type';
2
+ import { BottomSheetPosition, SnapPoints } from '../types/bottom-sheet-props.type';
3
3
 
4
4
  /** It expects the bottom sheet to be open. */
5
5
  export declare function convertDefaultPositionToYCoordinate(viewportHeight: number, containerHeight: number, marginTop: number, position: BottomSheetPosition): number;
@@ -1,7 +1,7 @@
1
- import { BottomSheetState, DraggingState } from '../types';
2
- import { AnimationFrame } from '../utils/animation/animation-frame';
3
- import { TabEvent, TabEventListener } from '../utils/event-listeners/TabEventListener';
4
1
  import { BottomSheetCoreProps } from '../types/bottom-sheet-props.type';
2
+ import { TabEvent, TabEventListener } from '../utils/event-listeners/TabEventListener';
3
+ import { AnimationFrame } from '../utils/animation/animation-frame';
4
+ import { BottomSheetState, DraggingState } from '../types';
5
5
 
6
6
  export declare const handleDragTriggerClick: (draggingState: DraggingState, eventTrigger: EventTarget | null, contentWrapper: HTMLElement) => void;
7
7
  export declare const handleDragStart: (mouseEventListener: TabEventListener, bottomSheetContainer: HTMLElement, bottomSheetProps: Required<BottomSheetCoreProps>, draggingState: DraggingState) => (event: TabEvent) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"dragging-handler.d.ts","sourceRoot":"","sources":["../../src/event-handlers/dragging-handler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AASjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAGzE,OAAO,KAAK,EACV,QAAQ,EACR,gBAAgB,EACjB,MAAM,2CAA2C,CAAC;AACnD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAI7E,eAAO,MAAM,sBAAsB,GACjC,eAAe,aAAa,EAC5B,cAAc,WAAW,GAAG,IAAI,EAChC,gBAAgB,WAAW,KAC1B,IAYF,CAAC;AAEF,eAAO,MAAM,eAAe,GAExB,oBAAoB,gBAAgB,EACpC,sBAAsB,WAAW,EACjC,kBAAkB,QAAQ,CAAC,oBAAoB,CAAC,EAChD,eAAe,aAAa,MAE7B,OAAO,QAAQ,SAKf,CAAC;AAEJ,eAAO,MAAM,cAAc,GAEvB,oBAAoB,gBAAgB,EACpC,sBAAsB,WAAW,EACjC,kBAAkB,QAAQ,CAAC,oBAAoB,CAAC,EAChD,eAAe,aAAa,EAC5B,gBAAgB,cAAc,MAE/B,OAAO,QAAQ,SAUf,CAAC;AAyFJ,eAAO,MAAM,aAAa,GAEtB,eAAe,gBAAgB,EAC/B,sBAAsB,WAAW,EACjC,kBAAkB,QAAQ,CAAC,oBAAoB,CAAC,EAChD,eAAe,aAAa,EAC5B,gBAAgB,cAAc,EAC9B,SAAS,MAAM,IAAI,EACnB,kBAAkB,gBAAgB,MAEnC,OAAO,QAAQ,SAmHf,CAAC"}
1
+ {"version":3,"file":"dragging-handler.d.ts","sourceRoot":"","sources":["../../src/event-handlers/dragging-handler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AASjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAGzE,OAAO,KAAK,EACV,QAAQ,EACR,gBAAgB,EACjB,MAAM,2CAA2C,CAAC;AACnD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAI7E,eAAO,MAAM,sBAAsB,kBAClB,aAAa,gBACd,WAAW,GAAG,IAAI,kBAChB,WAAW,KAC1B,IAYF,CAAC;AAEF,eAAO,MAAM,eAAe,uBAEJ,gBAAgB,wBACd,WAAW,oBACf,SAAS,oBAAoB,CAAC,iBACjC,aAAa,aAEtB,QAAQ,SAQf,CAAC;AAEJ,eAAO,MAAM,cAAc,uBAEH,gBAAgB,wBACd,WAAW,oBACf,SAAS,oBAAoB,CAAC,iBACjC,aAAa,kBACZ,cAAc,aAExB,QAAQ,SAUf,CAAC;AAyFJ,eAAO,MAAM,aAAa,kBAEP,gBAAgB,wBACT,WAAW,oBACf,SAAS,oBAAoB,CAAC,iBACjC,aAAa,kBACZ,cAAc,WACrB,MAAM,IAAI,oBACD,gBAAgB,aAE5B,QAAQ,SAmHf,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"bottom-sheet-defaults.d.ts","sourceRoot":"","sources":["../../src/initializer/bottom-sheet-defaults.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAGjF,MAAM,MAAM,0BAA0B,GAAG,MAAM,wBAAwB,CAAC;AAExE,eAAO,MAAM,0BAA0B,EAAE,wBAuCxC,CAAC"}
1
+ {"version":3,"file":"bottom-sheet-defaults.d.ts","sourceRoot":"","sources":["../../src/initializer/bottom-sheet-defaults.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAGjF,MAAM,MAAM,0BAA0B,GAAG,MAAM,wBAAwB,CAAC;AAExE,eAAO,MAAM,0BAA0B,EAAE,wBA4CxC,CAAC"}
@@ -1,6 +1,6 @@
1
- import { BottomSheetState, DraggingState } from '../types';
2
- import { AnimationFrame } from '../utils/animation/animation-frame';
3
1
  import { BottomSheetCoreProps } from '../types/bottom-sheet-props.type';
2
+ import { AnimationFrame } from '../utils/animation/animation-frame';
3
+ import { BottomSheetState, DraggingState } from '../types';
4
4
 
5
5
  export interface InitializerOptions {
6
6
  animationFrame: AnimationFrame;
@@ -1,7 +1,7 @@
1
- import { BottomSheetCoreProps, BottomSheetState, RequiredBottomSheetProps } from '../types';
2
- import { AnimationTimingFunction } from '../utils';
3
- import { ObserverSetHandler } from '../utils/proxy/observe';
4
1
  import { BottomSheetElements, InitializeEventsReturnType } from './bottom-sheet-initializer';
2
+ import { ObserverSetHandler } from '../utils/proxy/observe';
3
+ import { AnimationTimingFunction } from '../utils';
4
+ import { BottomSheetCoreProps, BottomSheetState, RequiredBottomSheetProps } from '../types';
5
5
 
6
6
  export declare function overwriteDefaultProps(props: BottomSheetCoreProps): RequiredBottomSheetProps;
7
7
  export declare function interpretAnimationTimingsProp(draggingAnimationTimings: BottomSheetCoreProps["draggingAnimationTimings"]): AnimationTimingFunction;
@@ -1 +1 @@
1
- {"version":3,"file":"bottom-sheet-props-initializer.d.ts","sourceRoot":"","sources":["../../src/initializer/bottom-sheet-props-initializer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oBAAoB,EACpB,gBAAgB,EAChB,wBAAwB,EACzB,MAAM,WAAW,CAAC;AACnB,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;AAezD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAIlE,OAAO,KAAK,EACV,mBAAmB,EACnB,0BAA0B,EAC3B,MAAM,4BAA4B,CAAC;AAGpC,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,oBAAoB,GAC1B,wBAAwB,CAuB1B;AAED,wBAAgB,6BAA6B,CAC3C,wBAAwB,EAAE,oBAAoB,CAAC,0BAA0B,CAAC,GACzE,uBAAuB,CAWzB;AAED,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,mBAAmB,EAC7B,gBAAgB,EAAE,gBAAgB,EAClC,iBAAiB,EAAE,QAAQ,CAAC,oBAAoB,CAAC,EACjD,aAAa,EAAE,0BAA0B,GACxC,kBAAkB,CA8LpB"}
1
+ {"version":3,"file":"bottom-sheet-props-initializer.d.ts","sourceRoot":"","sources":["../../src/initializer/bottom-sheet-props-initializer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oBAAoB,EACpB,gBAAgB,EAChB,wBAAwB,EACzB,MAAM,WAAW,CAAC;AACnB,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;AAkBzD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAIlE,OAAO,KAAK,EACV,mBAAmB,EACnB,0BAA0B,EAC3B,MAAM,4BAA4B,CAAC;AAGpC,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,oBAAoB,GAC1B,wBAAwB,CAuB1B;AAED,wBAAgB,6BAA6B,CAC3C,wBAAwB,EAAE,oBAAoB,CAAC,0BAA0B,CAAC,GACzE,uBAAuB,CAWzB;AAED,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,mBAAmB,EAC7B,gBAAgB,EAAE,gBAAgB,EAClC,iBAAiB,EAAE,QAAQ,CAAC,oBAAoB,CAAC,EACjD,aAAa,EAAE,0BAA0B,GACxC,kBAAkB,CAqNpB"}
@@ -1,2 +1,2 @@
1
- (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode('.pbs-root{position:fixed;left:0;bottom:0;display:flex;flex-direction:column;align-items:center;justify-content:flex-start;width:100%;height:fit-content;max-height:100vh;z-index:2}.pbs-dialog-reset{background-color:transparent;color:inherit;border:none;outline:none;padding:0;margin:0}.pbs-backdrop{position:fixed;top:0;left:0;width:100%;height:100%;background-color:transparent;z-index:1;transition:background-color .2s ease-out}.pbs-backdrop.hidden{visibility:hidden}.pbs-backdrop.open{background-color:#454545b3}.pbs-backdrop.transparent{background-color:transparent}.pbs-container{--pbs-container-background-color: rgb(240, 240, 240);background-color:var(--pbs-container-background-color);position:relative;display:none;flex-direction:column;align-items:center;justify-content:flex-start;width:92%;height:fit-content;max-height:100vh;border-radius:10px 10px 0 0}.pbs-container.open{display:flex}.pbs-container .pbs-gap-filler{position:absolute;bottom:calc(-100vh + .5px);left:0;background-color:var(--pbs-container-background-color);content:"";width:100%;height:100vh}.pbs-handle{position:relative;display:flex;align-items:center;justify-content:center;flex-shrink:0;width:100%;height:30px;cursor:pointer}.pbs-handle.hidden{display:none}.pbs-button-reset{background-color:transparent;-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:none;border:none}button:focus.pbs-button-reset{outline:none}.pbs-handle-bar{background-color:#a8a8a8;position:relative;width:12%;height:7px;border-radius:12px}.pbs-handle-bar.hidden{display:none}.pbs-content-wrapper{position:relative;width:100%;height:fit-content;max-height:100%;overflow-y:scroll}.pbs-content-wrapper::-webkit-scrollbar{display:none}.example{-ms-overflow-style:none;scrollbar-width:none}')),document.head.appendChild(e)}}catch(n){console.error("vite-plugin-css-injected-by-js",n)}})();
2
- "use strict";var Lt=Object.defineProperty;var At=(t,n,e)=>n in t?Lt(t,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[n]=e;var U=(t,n,e)=>At(t,typeof n!="symbol"?n+"":n,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function H(t){return typeof t=="string"}function Bt(t,n){return t.classList.contains(Z(n))}function W(t,n){t.classList.add(Z(n))}function rt(t,n){t.classList.remove(Z(n))}function _(t,n,e){H(e)&&(H(n)&&rt(t,n),W(t,e))}function Z(t){return H(t)?t.trim().replace(/\./g,""):""}function M(t){return t.map(n=>Z(n)).filter(Boolean).join(" ")}const lt="open",ut="hidden";function et(t,n){const e=n;if(Array.isArray(t)){t.forEach(r=>{q(r,e),r.setAttribute("aria-modal",e?"true":"false")});return}q(t,e),t.setAttribute("aria-modal",e?"true":"false")}function q(t,n){n?(W(t,lt),rt(t,ut)):(W(t,ut),rt(t,lt))}function yt(t){return t instanceof HTMLElement}function Y(t){return typeof t=="number"&&!Number.isNaN(t)}function Dt(t){yt(t)&&t.focus()}function Yt(t){if(!yt(t)||t.offsetParent===null||"disabled"in t&&t.disabled)return!1;const e=t.getAttribute("tabindex"),r=Y(e)?parseInt(e,10):-1,i=["INPUT","BUTTON","SELECT","TEXTAREA","A","AREA","IFRAME"].includes(t.tagName),a=t instanceof HTMLAnchorElement&&t.href!==""||t instanceof HTMLAreaElement&&t.href!=="";return i||a||r>-1}var T=(t=>(t.Backdrop="pbs-backdrop",t.Root="pbs-root",t.Container="pbs-container",t.GapFiller="pbs-gap-filler",t.Handle="pbs-handle",t.HandleBar="pbs-handle-bar",t.ContentWrapper="pbs-content-wrapper",t))(T||{}),ot=(t=>(t.Button="pbs-button-reset",t.Dialog="pbs-dialog-reset",t))(ot||{}),K=(t=>(t.Hidden="hidden",t))(K||{});function N(t,n,e){const r=document.createElement(t);return n.split(" ").forEach(i=>{W(r,i)}),H(e)&&r.setAttribute("data-testid",e),r}function dt(t,n,e,r){switch(r){case"content-height":return n>=t?Et(t,n,e):0;case"middle":return-(t/2-n);case"top":return-(t-n)+e;default:return 0}}function Ct(t,n){const e=n<t,r=n>t;return{isUp:e,isDown:r,stayedSame:n===t}}function Tt(t,n){return n<t?-(t-n):n-t}function $(t,n){return t>n?t-n:n-t}function It(t,n){const e=t<n,r=t>n;return{isUp:e,isDown:r,stayedSame:t===n}}function ft(t,n,e){const r=t==="above";return e.filter(o=>{const i=o*n.viewportHeight;return r?n.visibleHeight<i:n.visibleHeight>i})}function Et(t,n,e){return-(t-n)+e}function gt(t){return Number(t.replace("px",""))}function J(t,...n){return Number(t.toFixed(...n))}function vt(t){const n=/(?<type>\w+)\((?<values>[^)]+)\)/g,e=[];let r;for(;(r=n.exec(t))!==null;){const o=r[1],i=r[2].split(",").map(a=>a.trim());e.push({type:o,values:i})}return e}function Nt(t){const n=t.style.transform,e=vt(n);return{transform:n,transformValues:e}}function wt(t,n){const e=t.find(r=>r.type.startsWith(n));return e||null}const it="translate";function I(t){const n=t.style.transform,e=vt(n),r=wt(e,it);return St(r??{type:it,values:[]})}function Q(t,{x:n,y:e}){const{transform:r,transformValues:o}=Nt(t),i=wt(o,it);if(i){const a=St(i);t.style.transform=`translate(${n??a.x??0}px,${e??a.y??0}px)`;return}if(r){t.style.transform=`${r}, translate(${n??0}px,${e??0}px)`;return}t.style.transform=`translate(${n??0}px,${e??0}px)`}function St(t){if(t.type!=="translate")throw new Error(`Could not get coordinates from ${t.type}, since is not translate.`);const n=t.values[0],e=t.values[1];return{x:gt(n)??0,y:gt(e)??0}}function at(t){return t!=null}function ht(t,{min:n,max:e}){return at(e)&&t>=e?e:at(n)&&t<=n?n:t}const xt=(t,n,e)=>{n instanceof HTMLElement&&!Bt(n,T.Handle)&&e.scrollTop>=1||(t.isDragging=!0)},Ft=(t,n,e,r)=>o=>{r.startY=t.getCoordinates(o).y,r.containerStartTranslate=I(n),e.onDragStart()},Mt=(t,n,e,r,o)=>i=>{Pt(i,t,e,r,o,n,e.marginTop)};function Pt(t,n,e,r,o,i,a){if(!r.isDragging||!Y(r.startY))return;const u=n.getCoordinates(t).y,s=Tt(r.startY,u),b=window.innerHeight,l=i.clientHeight,d=l-(r.containerStartTranslate.y+s);if(d>=b)return;const y=Ct(r.startY,u);if(y.isUp&&!e.expandable&&d>=l||e.preventClosing&&d<=l)return;o.start(()=>{Q(i,{y:r.containerStartTranslate.y+s})},0);const E=b-a,c=l-r.containerStartTranslate.y;if(y.isUp){const C=E-c,w=E-d,k=ht(1-J(w/C,2),{min:0,max:1});e.onDragMove(y,k)}else if(y.isDown){const C=ht(J(1-d/c,2),{min:0,max:1});e.onDragMove(y,C)}}const Rt=(t,n,e,r,o,i,a)=>u=>{if(!r.isDragging||(r.isDragging=!1,!Y(r.startY)))return;e.onDragEnd();const s=r.startY,b=t.getCoordinates(u).y,l=I(n).y,d=Ct(s,b),y=window.innerHeight,E=n.clientHeight;if(d.isUp){if(!e.expandable)return;const c=[...e.snapPoints].sort((k,B)=>k-B),C=E+-l;for(const k of c){const B=k*window.innerHeight;if(C<=B){const O=$(C,B);a.translateContainer({startY:l,endY:l-O,animationFrame:o,bottomSheetContainer:n});return}}const w=Et(y,E,e.marginTop);a.translateContainer({startY:l,endY:w,animationFrame:o,bottomSheetContainer:n})}else if(d.isDown){const c=[...e.snapPoints].sort((C,w)=>w-C);for(const C of c){const w=C*window.innerHeight,k=E+-l;if(k>=w){const B=$(k,w);a.translateContainer({startY:l,endY:l+B,animationFrame:o,bottomSheetContainer:n});return}}if(e.preventClosing){const C=E+-l;if(C>=E){const w=$(C,E);a.translateContainer({startY:l,endY:l+w,animationFrame:o,bottomSheetContainer:n})}return}i()}};var G=(t=>(t[t.All=-1]="All",t[t.None=0]="None",t[t.Capture=1]="Capture",t[t.Target=2]="Target",t[t.Bubble=3]="Bubble",t))(G||{});function mt(t){switch(t){case 0:return 0;case 1:return 1;case 2:return 2;case 3:return 3;default:return-1}}const Gt={eventPhase:G.All};class V{constructor(n){U(this,"currentTarget");this.currentTarget=n}addEventListeners({onStart:n,onStartOptions:e=Gt,onMove:r,onEnd:o}){this.addTouchEventListeners({onStart:n,onStartOptions:e,onMove:r,onEnd:o}),this.addMouseEventListeners({onStart:n,onStartOptions:e,onMove:r,onEnd:o})}addTouchEventListeners({onStart:n,onStartOptions:e,onMove:r,onEnd:o}){n&&this.currentTarget.addEventListener("touchstart",i=>{if(e.eventPhase===G.All){n(i);return}mt(i.eventPhase)===e.eventPhase&&n(i)},{passive:!0}),r&&this.currentTarget.addEventListener("touchmove",r),o&&this.currentTarget.addEventListener("touchend",o)}addMouseEventListeners({onStart:n,onStartOptions:e,onMove:r,onEnd:o}){n&&this.currentTarget.addEventListener("mousedown",i=>{if(e.eventPhase===G.All){n(i);return}mt(i.eventPhase)===e.eventPhase&&n(i)},{passive:!0}),r&&this.currentTarget.addEventListener("mousemove",r),o&&this.currentTarget.addEventListener("mouseup",i=>{o(i)})}removeEventListeners({onStart:n,onMove:e,onEnd:r}){n&&this.currentTarget.removeEventListener("touchstart",n),r&&this.currentTarget.removeEventListener("touchend",r),e&&this.currentTarget.removeEventListener("touchmove",e),n&&this.currentTarget.removeEventListener("mousedown",n),e&&this.currentTarget.removeEventListener("mousemove",e),r&&this.currentTarget.removeEventListener("mouseup",r)}getCoordinates(n){if(n.type==="touchstart"||n.type==="mousedown"){if("touches"in n)return{x:n.touches[0].clientX,y:n.touches[0].clientY};if(n instanceof MouseEvent)return{x:n.clientX,y:n.clientY}}if(n.type==="touchend"||n.type==="mouseup"||n.type==="mousemove"||n.type==="touchmove"){if("touches"in n)return{x:n.changedTouches[0].clientX,y:n.changedTouches[0].clientY};if(n instanceof MouseEvent)return{x:n.clientX,y:n.clientY}}return{x:0,y:0}}}function Ht(t){const n=t;return`${n} ${n} 0px 0px`}function jt(t,n){const e=Ut(t);_t(e),e.bottomSheetContainer.style.width=t.width;const r=document.createElement("div");r.innerHTML=t.content??"";const o=window.innerHeight;e.bottomSheetContainer.style.maxHeight=`${o}px`,e.bottomSheetContentWrapper.appendChild(r);const i=Vt({bottomSheetElements:e,bottomSheetProps:t,options:n});return t.rootStyle&&Object.assign(e.bottomSheetRoot.style,t.rootStyle),t.backdropStyle&&Object.assign(e.bottomSheetBackdrop.style,t.backdropStyle),t.containerGapFillerStyle&&Object.assign(e.bottomSheetContainer.style,t.containerStyle),t.containerStyle&&Object.assign(e.bottomSheetContainerGapFiller.style,t.containerGapFillerStyle),t.handleStyle&&Object.assign(e.bottomSheetHandleBar.style,t.handleStyle),t.contentWrapperStyle&&Object.assign(e.bottomSheetContentWrapper.style,t.contentWrapperStyle),{elements:e,eventHandlers:i}}function Ut(t){const n=N("dialog",M([T.Root,ot.Dialog,t.rootClass]),T.Root);n.ariaLabel=t.ariaLabel;const e=N("section",M([T.Container,t.containerClass]),T.Container);t.containerBorderRadius&&(e.style.borderRadius=Ht(t.containerBorderRadius));const r=N("div",T.GapFiller,T.GapFiller);t.containerBackgroundColor&&(e.style.backgroundColor=t.containerBackgroundColor,r.style.backgroundColor=t.containerBackgroundColor);const o=N("button",M([T.Handle,ot.Button,t.shouldShowHandle?null:K.Hidden,t.handleClass]),T.Handle);o.setAttribute("type","button"),o.ariaLabel="bottom sheet close button";const i=N("span",M([T.HandleBar,t.shouldShowHandle?null:K.Hidden]),T.HandleBar),a=N("article",M([T.ContentWrapper,t.contentWrapperClass]),T.ContentWrapper),u=N("div",M([T.Backdrop,t.backdropClass,K.Hidden]),T.Backdrop);return t.backdropColor&&(u.style.backgroundColor=t.backdropColor),t.backDropTransition&&(u.style.transition=t.backDropTransition),{bottomSheetRoot:n,bottomSheetBackdrop:u,bottomSheetContainer:e,bottomSheetHandle:o,bottomSheetHandleBar:i,bottomSheetContentWrapper:a,bottomSheetContainerGapFiller:r}}function _t({bottomSheetRoot:t,bottomSheetContainer:n,bottomSheetHandle:e,bottomSheetHandleBar:r,bottomSheetContentWrapper:o,bottomSheetContainerGapFiller:i}){t.appendChild(n),e.appendChild(r),n.appendChild(e),n.appendChild(o),n.appendChild(i)}function Vt({bottomSheetElements:t,bottomSheetProps:n,options:e}){const{bottomSheetRoot:r,bottomSheetContainer:o,bottomSheetHandle:i,bottomSheetContainerGapFiller:a,bottomSheetContentWrapper:u,bottomSheetBackdrop:s}=t,{animationFrame:b}=e,l=new V(i),d=new V(u),y=new V(a);let E=[];const c=new V(window),C=Ft(c,o,n,e.draggingState),w=Mt(c,o,n,e.draggingState,b),k=Rt(c,o,n,e.draggingState,b,e.onClose,e.bottomSheetState);function B(S){S.target instanceof Element&&!r.contains(S.target)&&e.onClose()}function O(S){xt(e.draggingState,S.target,t.bottomSheetContentWrapper)}function x(S){const L=S??n;L.draggable&&L.backgroundDraggable&&(d.addEventListeners({onStart:O,onStartOptions:{eventPhase:G.Target}}),y.addEventListeners({onStart:O})),L.draggable&&c.addEventListeners({onStart:C,onMove:w,onEnd:k}),L.draggable&&window.document.addEventListener("keyup",p=>{p.key==="Escape"&&e.onClose()}),i.addEventListener("keyup",p=>{if(p.key==="ArrowUp"){e.moveUp();return}if(p.key==="ArrowDown"){e.moveDown();return}if(p.shiftKey&&p.key==="Tab"){const F=nt(t.bottomSheetContentWrapper);Dt(F)}})}function X(S){const L=S??n;n.shouldCloseOnOutsideClick&&!n.preventClosing?s.addEventListener("click",B):s.style.pointerEvents="none",L.draggable&&(l.addEventListeners({onStart:O}),E.forEach(p=>{p.removeEventListeners({onStart:O})}),E=n.dragTriggers.reduce((p,F)=>{const g=r.querySelectorAll(F);if(!g.length)return p;const h=Array.from(g).map(f=>f instanceof HTMLElement?new V(f):null).filter(f=>!!f);return[...p,...h]},[]),E.forEach(p=>{p.addEventListeners({onStart:O,onStartOptions:{eventPhase:G.Target}})}))}function tt(){s.removeEventListener("click",B)}function nt(S){let L=[...Array.from(S.childNodes).reverse()];for(;L.length;){const p=L.shift();if(Yt(p))return p;p&&(L=[...L,...Array.from(p.childNodes).reverse()])}return null}function z(){l.removeEventListeners({onStart:O}),d.removeEventListeners({onStart:O}),y.removeEventListeners({onStart:O}),E.forEach(S=>{S.removeEventListeners({onStart:O})}),c.removeEventListeners({onStart:C,onMove:w,onEnd:k})}return{attachEventListeners:x,clearEventListeners:z,attacheOnOpenEventListeners:X,clearOnOpenEventListeners:tt}}class $t{constructor(){U(this,"animationId");U(this,"isInProgress");U(this,"startedAt");this.animationId=null,this.isInProgress=!1,this.startedAt=null}start(n,e,r=!1){this.isInProgress=!0;const o=i=>{this.startedAt||(this.startedAt=i);const a=i-this.startedAt,s=e===0?1:J(a/e,2),b=s>=1&&!r;n(s),b?this.stop():this.animationId=requestAnimationFrame(o)};this.animationId=requestAnimationFrame(o)}stop(){this.isInProgress=!1,this.startedAt=null,Y(this.animationId)&&cancelAnimationFrame(this.animationId)}}function Wt(t){const{startY:n,endY:e,bottomSheetContainer:r,animationFrame:o,onEnd:i,animationTimingFunction:a,animationDuration:u}=t,s=Tt(n,e);o.stop();let b=!1;o.start(l=>{Q(r,{y:n+s*a(l)}),!b&&l>=1&&(i==null||i(),b=!0)},u)}const st=(t,n)=>e=>{Wt({...e,animationTimingFunction:t,animationDuration:n})},R={TOP:"top",MIDDLE:"middle",CONTENT_HEIGHT:"content-height",CLOSED:"closed"};function Xt(t){return!(!Y(t)||t>1||t<0)}function zt(t,n){const e={set(r,o,i,a){return n(o,i),Reflect.set(r,o,i,a)}};return new Proxy(t,e)}function Kt(...t){console.error(t)}const P={EASE:"ease",EASE_IN:"ease-in",EASE_OUT:"ease-out",EASE_IN_OUT:"ease-in-out",SPRING:"spring"};function qt(t){for(const n of Object.values(P))if(n===t)return!0;return!1}function Ot(t){return!!(t instanceof Object&&"p1x"in t&&"p1y"in t&&"p2x"in t&&"p2y"in t&&Y(t.p1x)&&Y(t.p1y)&&Y(t.p2x)&&Y(t.p2y))}function j(t,n,e,r){return function(s){return u(i(s))};function i(s){let b=0,l=1,d=s,y;if(s===0||s===1)return s;for(;b<l;){if(y=a(d),Math.abs(y-s)<.001)return d;s>y?b=d:l=d,d=(l+b)/2}return d}function a(s){return 3*t*s*Math.pow(1-s,2)+3*e*Math.pow(s,2)*(1-s)+Math.pow(s,3)}function u(s){return 3*n*s*Math.pow(1-s,2)+3*r*Math.pow(s,2)*(1-s)+Math.pow(s,3)}}const bt=j(.25,.1,.25,1),Jt=j(.42,0,1,1),kt=j(.42,0,.58,1),Qt=j(.4,.1,.6,1),Zt=j(.45,1.5,.55,1);function tn(t){switch(t){case P.EASE:return bt;case P.EASE_IN:return Jt;case P.EASE_OUT:return kt;case P.EASE_IN_OUT:return Qt;case P.SPRING:return Zt;default:return bt}}function pt(t){return typeof t=="boolean"}const nn={ariaLabel:"Bottom sheet",content:"",defaultPosition:R.CONTENT_HEIGHT,marginTop:20,snapPoints:[],width:"92%",dragTriggers:[],beforeOpen:()=>{},afterOpen:()=>{},beforeClose:()=>{},afterClose:()=>{},onDragStart:()=>{},onDragMove:()=>{},onDragEnd:()=>{},expandable:!0,preventClosing:!1,draggable:!0,backgroundDraggable:!0,shouldCloseOnOutsideClick:!0,shouldShowBackdrop:!0,shouldShowHandle:!0,backDropTransition:null,backdropColor:null,containerBackgroundColor:null,containerBorderRadius:null,rootClass:null,containerClass:null,handleClass:null,contentWrapperClass:null,backdropClass:null,draggingAnimationTimings:"ease-in-out",draggingAnimationDuration:180,rootStyle:{},containerStyle:{},handleStyle:{},contentWrapperStyle:{},backdropStyle:{},containerGapFillerStyle:{}};function en(t){const n={...nn},e=Object.entries(t).reduce((o,i)=>{const[a,u]=i;return at(u)&&(o[a]=u),o},{});return{...n,...e}}function ct(t){if(Ot(t)){const{p1x:n,p1y:e,p2x:r,p2y:o}=t;return j(n,e,r,o)}return qt(t)?tn(t):kt}function rn(t,n,e,r){function o(i,a){switch(i){case"content":H(a)&&(t.bottomSheetContentWrapper.innerHTML=a);break;case"width":H(a)&&(t.bottomSheetContainer.style.width=a);break;case"shouldShowHandle":pt(a)||q(t.bottomSheetHandle,!1);break;case"shouldShowBackdrop":pt(a)||q(t.bottomSheetBackdrop,!1);break;case"containerBorderRadius":H(a)&&(t.bottomSheetContainer.style.borderRadius=Ht(a));break;case"containerBackgroundColor":H(a)&&(t.bottomSheetContainer.style.backgroundColor=a,t.bottomSheetContainerGapFiller.style.backgroundColor=a);break;case"backdropColor":H(a)&&(t.bottomSheetBackdrop.style.backgroundColor=a);break;case"backDropTransition":H(a)&&(t.bottomSheetBackdrop.style.transition=a);break;case"rootClass":if(!H(a))return;_(t.bottomSheetRoot,e.rootClass,a);break;case"containerClass":if(!H(a))return;_(t.bottomSheetContainer,e.containerClass,a);break;case"handleClass":if(!H(a))return;_(t.bottomSheetHandle,e.handleClass,a);break;case"contentWrapperClass":if(!H(a))return;_(t.bottomSheetContentWrapper,e.contentWrapperClass,a);break;case"backdropClass":if(!H(a))return;_(t.bottomSheetBackdrop,e.backdropClass,a);break;case"expandable":r.clearEventListeners(),r.attachEventListeners(e);break;case"preventClosing":r.clearEventListeners(),r.attachEventListeners(e);break;case"draggable":r.clearEventListeners(),r.attachEventListeners(e);break;case"dragTriggers":r.clearEventListeners(),r.attachEventListeners(e);break;case"draggingAnimationTimings":if(Ot(a)){const u=ct(a),s=st(u,e.draggingAnimationDuration);n.translateContainer=s}break;case"draggingAnimationDuration":if(Y(a)){const u=ct(e.draggingAnimationTimings),s=st(u,a);n.translateContainer=s}break;case"rootStyle":e.rootStyle&&Object.assign(t.bottomSheetRoot.style,e.rootStyle);break;case"backdropStyle":e.backdropStyle&&Object.assign(t.bottomSheetBackdrop.style,e.backdropStyle);break;case"containerStyle":e.containerStyle&&Object.assign(t.bottomSheetContainer.style,e.containerStyle);break;case"containerGapFillerStyle":e.containerGapFillerStyle&&Object.assign(t.bottomSheetContainerGapFiller.style,e.containerGapFillerStyle);break;case"handleStyle":e.handleStyle&&Object.assign(t.bottomSheetHandleBar.style,e.handleStyle);break;case"contentWrapperStyle":e.contentWrapperStyle&&Object.assign(t.bottomSheetContentWrapper.style,e.contentWrapperStyle);break}}return o}function on(t){const n=en(t),e=ct(t.draggingAnimationTimings),o={isMounted:!1,translateContainer:st(e,n.draggingAnimationDuration)},i={startY:null,containerStartTranslate:{x:0,y:0},isDragging:!1,originalDocumentOverflowY:null,originalDocumentOverscrollBehavior:null};function a(){i.originalDocumentOverflowY&&i.originalDocumentOverflowY!=="hidden"&&(document.body.style.overflowY=i.originalDocumentOverflowY),i.originalDocumentOverscrollBehavior&&(document.body.style.position=i.originalDocumentOverscrollBehavior)}const u=new $t,s={animationFrame:u,onClose:B,bottomSheetState:o,draggingState:i,snapTo:F,moveUp:L,moveDown:p},{elements:b,eventHandlers:l}=jt(n,s),d=zt(n,rn(b,o,n,l)),{bottomSheetBackdrop:y,bottomSheetRoot:E,bottomSheetContainer:c}=b,C=g=>{const h=g??window.document.body;h.appendChild(E),h.appendChild(y);const f=window.innerHeight;Q(c,{y:f}),l.attachEventListeners(),o.isMounted=!0},w=()=>{l.clearEventListeners(),Object.values(b).forEach(g=>{g.remove()}),a(),o.isMounted=!1},k=()=>{var D;if(O()||Kt('Bottom Sheet is not mounted yet. call the "mount" method first.'),(D=t.beforeOpen)==null||D.call(t),x())return;et(y,!0),d.shouldShowBackdrop||W(y,"transparent"),et([c],!0),Q(c,{y:c.clientHeight});const h=window.innerHeight,f=dt(h,c.clientHeight,d.marginTop,d.defaultPosition),m=I(c).y;o.translateContainer({startY:m,endY:f,animationFrame:u,bottomSheetContainer:c,onEnd:t.afterOpen});const v=document.body.style.overflowY;i.originalDocumentOverflowY=v||"initial";const A=document.body.style.overscrollBehavior;i.originalDocumentOverscrollBehavior=A||"initial",document.body.style.overflow="hidden",document.body.style.overscrollBehavior="contain",b.bottomSheetHandle.focus(),l.attacheOnOpenEventListeners()};function B(){var f;if(X())return;(f=t.beforeClose)==null||f.call(t);const g=I(c).y,h=c.clientHeight;o.translateContainer({startY:g,endY:h,animationFrame:u,bottomSheetContainer:c,onEnd:()=>{var m;(m=t.afterClose)==null||m.call(t),et([y,c],!1),l.clearOnOpenEventListeners()}}),a()}function O(){return o.isMounted}function x(){const g=I(c).y,h=window.innerHeight,f=c.clientHeight>=h?h:c.clientHeight;return g<=f}function X(){return!x()}function tt(){const g=I(c).y,h=c.clientHeight,f=window.innerHeight;if(g<=5&&g>=-5)return R.CONTENT_HEIGHT;const m=h-g;if(m===f/2)return R.MIDDLE;const v=f-d.marginTop,A=10;return m<=v+A&&m>=v-A?R.TOP:R.CLOSED}function nt(){return c.clientHeight}function z(g){if(!x())return;const h=I(c).y,m=c.clientHeight-h,v=window.innerHeight-g,A=It(m,v),D=$(m,v);o.translateContainer({startY:h,endY:h+(A.isUp?-D:D),animationFrame:u,bottomSheetContainer:c})}function S(g,{viewportHeight:h,visibleHeight:f}){let m=null;for(const v of g){const A=v*h,D=$(f,A);(m===null||D<m)&&(m=D)}return{minOffset:m}}function L(){const g=[...d.snapPoints].reverse(),h=I(c).y,f=c.clientHeight,m=f-h;if(!d.expandable&&m>=f)return;const v=window.innerHeight,A=ft("above",{visibleHeight:m,viewportHeight:v},g),{minOffset:D}=S(A,{visibleHeight:m,viewportHeight:v});if(D===null&&m<v-d.marginTop){o.translateContainer({startY:h,endY:dt(v,f,d.marginTop,"top"),animationFrame:u,bottomSheetContainer:c});return}Y(D)&&o.translateContainer({startY:h,endY:h-D,animationFrame:u,bottomSheetContainer:c})}function p(){const g=I(c).y,f=c.clientHeight-g;if(f<1)return;const m=window.innerHeight,v=ft("below",{visibleHeight:f,viewportHeight:m},d.snapPoints),{minOffset:A}=S(v,{visibleHeight:f,viewportHeight:m});Y(A)&&o.translateContainer({startY:g,endY:g+A,animationFrame:u,bottomSheetContainer:c})}function F(g){const h=window.innerHeight;if(!Xt(g))return;const f=J(h*g,2);z(f)}return{props:d,elements:b,mount:C,unmount:w,open:k,close:B,getIsMounted:O,getIsOpen:x,getIsClosed:X,getPosition:tt,getHeight:nt,moveTo:z,snapTo:F}}function an(){return{elements:{bottomSheetRoot:void 0,bottomSheetBackdrop:void 0,bottomSheetContainer:void 0,bottomSheetHandle:void 0,bottomSheetHandleBar:void 0,bottomSheetContentWrapper:void 0,bottomSheetContainerGapFiller:void 0},mount:()=>{},unmount:()=>{},open:()=>{},close:()=>{},getIsMounted:()=>!1,getHeight:()=>0,getIsOpen:()=>!1,getIsClosed:()=>!0,getPosition:()=>R.CLOSED,moveTo:()=>{},snapTo:()=>{},props:{content:""}}}exports.ClassNames=T;exports.createBottomSheet=on;exports.createPlaceholderBottomSheet=an;
1
+ (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode('.pbs-root{position:fixed;left:0;bottom:0;display:flex;flex-direction:column;align-items:center;justify-content:flex-start;width:100%;height:fit-content;max-height:100vh;z-index:2}.pbs-dialog-reset{background-color:transparent;color:inherit;border:none;outline:none;padding:0;margin:0}.pbs-backdrop{position:fixed;top:0;left:0;width:100%;height:100%;background-color:transparent;z-index:1;backface-visibility:"hidden"}.pbs-backdrop.hidden{visibility:hidden}.pbs-backdrop.open{background-color:#454545b3}.pbs-backdrop.transparent{background-color:transparent}.pbs-container{--pbs-container-background-color: rgb(240, 240, 240);background-color:var(--pbs-container-background-color);position:relative;display:none;flex-direction:column;align-items:center;justify-content:flex-start;width:92%;height:fit-content;max-height:100vh;border-radius:10px 10px 0 0}.pbs-container.open{display:flex}.pbs-container .pbs-gap-filler{position:absolute;bottom:calc(-100vh + .5px);left:0;background-color:var(--pbs-container-background-color);content:"";width:100%;height:100vh}.pbs-handle{position:relative;display:flex;align-items:center;justify-content:center;flex-shrink:0;width:100%;height:30px;cursor:pointer}.pbs-handle.hidden{display:none}.pbs-button-reset{background-color:transparent;-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:none;border:none}button:focus.pbs-button-reset{outline:none}.pbs-handle-bar{background-color:#a8a8a8;position:relative;width:12%;height:7px;border-radius:12px}.pbs-handle-bar.hidden{display:none}.pbs-content-wrapper{position:relative;width:100%;height:fit-content;max-height:100%;overflow-y:scroll}.pbs-content-wrapper::-webkit-scrollbar{display:none}.example{-ms-overflow-style:none;scrollbar-width:none}')),document.head.appendChild(e)}}catch(n){console.error("vite-plugin-css-injected-by-js",n)}})();
2
+ "use strict";var Nt=Object.defineProperty;var It=(t,n,e)=>n in t?Nt(t,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[n]=e;var _=(t,n,e)=>(It(t,typeof n!="symbol"?n+"":n,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function w(t){return typeof t=="string"}function at(t,n){return t.classList.contains(rt(n))}function X(t,n){t.classList.add(rt(n))}function st(t,n){t.classList.remove(rt(n))}function V(t,n,e){w(e)&&(w(n)&&st(t,n),X(t,e))}function rt(t){return w(t)?t.trim().replace(/\./g,""):""}function x(t){return t.map(n=>rt(n)).filter(Boolean).join(" ")}const ct="open",lt="hidden";function xt(t){return Mt(t)}function Q(t,n){const e=n;if(Array.isArray(t)){t.forEach(r=>{tt(r,e),r.setAttribute("aria-modal",e?"true":"false")});return}tt(t,e),t.setAttribute("aria-modal",e?"true":"false")}function tt(t,n){n?(X(t,ct),st(t,lt)):(X(t,lt),st(t,ct))}function Mt(t){return at(t,ct)&&!at(t,lt)}function St(t){return t instanceof HTMLElement}function B(t){return typeof t=="number"&&!Number.isNaN(t)}function Pt(t){St(t)&&t.focus()}function Rt(t){if(!St(t)||t.offsetParent===null||"disabled"in t&&t.disabled)return!1;const e=t.getAttribute("tabindex"),r=B(e)?parseInt(e,10):-1,a=["INPUT","BUTTON","SELECT","TEXTAREA","A","AREA","IFRAME"].includes(t.tagName),o=t instanceof HTMLAnchorElement&&t.href!==""||t instanceof HTMLAreaElement&&t.href!=="";return a||o||r>-1}var v=(t=>(t.Backdrop="pbs-backdrop",t.Root="pbs-root",t.Container="pbs-container",t.GapFiller="pbs-gap-filler",t.Handle="pbs-handle",t.HandleBar="pbs-handle-bar",t.ContentWrapper="pbs-content-wrapper",t))(v||{}),ut=(t=>(t.Button="pbs-button-reset",t.Dialog="pbs-dialog-reset",t))(ut||{}),Z=(t=>(t.Hidden="hidden",t))(Z||{});function N(t,n,e){const r=document.createElement(t);return n.split(" ").forEach(a=>{X(r,a)}),w(e)&&r.setAttribute("data-testid",e),r}function pt(t,n,e,r){switch(r){case"content-height":return n>=t?At(t,n,e):0;case"middle":return-(t/2-n);case"top":return-(t-n)+e;default:return 0}}function Ht(t,n){const e=n<t,r=n>t;return{isUp:e,isDown:r,stayedSame:n===t}}function Ot(t,n){return n<t?-(t-n):n-t}function W(t,n){return t>n?t-n:n-t}function Gt(t,n){const e=t<n,r=t>n;return{isUp:e,isDown:r,stayedSame:t===n}}function yt(t,n,e){const r=t==="above";return e.filter(i=>{const a=i*n.viewportHeight;return r?n.visibleHeight<a:n.visibleHeight>a})}function At(t,n,e){return-(t-n)+e}function Ct(t){return Number(t.replace("px",""))}function nt(t,...n){return Number(t.toFixed(...n))}function Lt(t){const n=/(?<type>\w+)\((?<values>[^)]+)\)/g,e=[];let r;for(;(r=n.exec(t))!==null;){const i=r[1],a=r[2].split(",").map(o=>o.trim());e.push({type:i,values:a})}return e}function jt(t){const n=t.style.transform,e=Lt(n);return{transform:n,transformValues:e}}function Bt(t,n){const e=t.find(r=>r.type.startsWith(n));return e||null}const dt="translate";function F(t){const n=t.style.transform,e=Lt(n),r=Bt(e,dt);return Dt(r??{type:dt,values:[]})}function et(t,{x:n,y:e}){const{transform:r,transformValues:i}=jt(t),a=Bt(i,dt);if(a){const o=Dt(a);t.style.transform=`translate(${n??o.x??0}px,${e??o.y??0}px)`;return}if(r){t.style.transform=`${r}, translate(${n??0}px,${e??0}px)`;return}t.style.transform=`translate(${n??0}px,${e??0}px)`}function Dt(t){if(t.type!=="translate")throw new Error(`Could not get coordinates from ${t.type}, since is not translate.`);const n=t.values[0],e=t.values[1];return{x:Ct(n)??0,y:Ct(e)??0}}function ft(t){return t!=null}function Tt(t,{min:n,max:e}){return ft(e)&&t>=e?e:ft(n)&&t<=n?n:t}const Ut=(t,n,e)=>{n instanceof HTMLElement&&!at(n,v.Handle)&&e.scrollTop>=1||(t.isDragging=!0)},_t=(t,n,e,r)=>i=>{r.isDragging&&(r.startY=t.getCoordinates(i).y,r.containerStartTranslate=F(n),e.onDragStart())},Vt=(t,n,e,r,i)=>a=>{$t(a,t,e,r,i,n,e.marginTop)};function $t(t,n,e,r,i,a,o){if(!r.isDragging||!B(r.startY))return;const l=n.getCoordinates(t).y,s=Ot(r.startY,l),g=window.innerHeight,d=a.clientHeight,b=d-(r.containerStartTranslate.y+s);if(b>=g)return;const C=Ht(r.startY,l);if(C.isUp&&!e.expandable&&b>=d||e.preventClosing&&b<=d)return;i.start(()=>{et(a,{y:r.containerStartTranslate.y+s})},0);const f=g-o,T=d-r.containerStartTranslate.y;if(C.isUp){const E=f-T,c=f-b,O=Tt(1-nt(c/E,2),{min:0,max:1});e.onDragMove(C,O)}else if(C.isDown){const E=Tt(nt(1-b/T,2),{min:0,max:1});e.onDragMove(C,E)}}const Wt=(t,n,e,r,i,a,o)=>l=>{if(!r.isDragging||(r.isDragging=!1,!B(r.startY)))return;e.onDragEnd();const s=r.startY,g=t.getCoordinates(l).y,d=F(n).y,b=Ht(s,g),C=window.innerHeight,f=n.clientHeight;if(b.isUp){if(!e.expandable)return;const T=[...e.snapPoints].sort((O,Y)=>O-Y),E=f+-d;for(const O of T){const Y=O*window.innerHeight;if(E<=Y){const A=W(E,Y);o.translateContainer({startY:d,endY:d-A,animationFrame:i,bottomSheetContainer:n});return}}const c=At(C,f,e.marginTop);o.translateContainer({startY:d,endY:c,animationFrame:i,bottomSheetContainer:n})}else if(b.isDown){const T=[...e.snapPoints].sort((E,c)=>c-E);for(const E of T){const c=E*window.innerHeight,O=f+-d;if(O>=c){const Y=W(O,c);o.translateContainer({startY:d,endY:d+Y,animationFrame:i,bottomSheetContainer:n});return}}if(e.preventClosing){const E=f+-d;if(E>=f){const c=W(E,f);o.translateContainer({startY:d,endY:d+c,animationFrame:i,bottomSheetContainer:n})}return}a()}};var G=(t=>(t[t.All=-1]="All",t[t.None=0]="None",t[t.Capture=1]="Capture",t[t.Target=2]="Target",t[t.Bubble=3]="Bubble",t))(G||{});function Et(t){switch(t){case 0:return 0;case 1:return 1;case 2:return 2;case 3:return 3;default:return-1}}const Xt={eventPhase:G.All};class ${constructor(n){_(this,"currentTarget");this.currentTarget=n}addEventListeners({onStart:n,onStartOptions:e=Xt,onMove:r,onEnd:i}){this.addTouchEventListeners({onStart:n,onStartOptions:e,onMove:r,onEnd:i}),this.addMouseEventListeners({onStart:n,onStartOptions:e,onMove:r,onEnd:i})}addTouchEventListeners({onStart:n,onStartOptions:e,onMove:r,onEnd:i}){n&&this.currentTarget.addEventListener("touchstart",a=>{if(e.eventPhase===G.All){n(a);return}Et(a.eventPhase)===e.eventPhase&&n(a)},{passive:!0}),r&&this.currentTarget.addEventListener("touchmove",r),i&&this.currentTarget.addEventListener("touchend",i)}addMouseEventListeners({onStart:n,onStartOptions:e,onMove:r,onEnd:i}){n&&this.currentTarget.addEventListener("mousedown",a=>{if(e.eventPhase===G.All){n(a);return}Et(a.eventPhase)===e.eventPhase&&n(a)},{passive:!0}),r&&this.currentTarget.addEventListener("mousemove",r),i&&this.currentTarget.addEventListener("mouseup",a=>{i(a)})}removeEventListeners({onStart:n,onMove:e,onEnd:r}){n&&this.currentTarget.removeEventListener("touchstart",n),r&&this.currentTarget.removeEventListener("touchend",r),e&&this.currentTarget.removeEventListener("touchmove",e),n&&this.currentTarget.removeEventListener("mousedown",n),e&&this.currentTarget.removeEventListener("mousemove",e),r&&this.currentTarget.removeEventListener("mouseup",r)}getCoordinates(n){if(n.type==="touchstart"||n.type==="mousedown"){if("touches"in n)return{x:n.touches[0].clientX,y:n.touches[0].clientY};if(n instanceof MouseEvent)return{x:n.clientX,y:n.clientY}}if(n.type==="touchend"||n.type==="mouseup"||n.type==="mousemove"||n.type==="touchmove"){if("touches"in n)return{x:n.changedTouches[0].clientX,y:n.changedTouches[0].clientY};if(n instanceof MouseEvent)return{x:n.clientX,y:n.clientY}}return{x:0,y:0}}}function Yt(t){const n=t;return`${n} ${n} 0px 0px`}function zt(t,n){const e=Kt(t);qt(e),e.bottomSheetContainer.style.width=t.width;const r=document.createElement("div");r.innerHTML=t.content??"";const i=window.innerHeight;e.bottomSheetContainer.style.maxHeight=`${i}px`,e.bottomSheetContentWrapper.appendChild(r);const a=Jt({bottomSheetElements:e,bottomSheetProps:t,options:n});return t.rootStyle&&Object.assign(e.bottomSheetRoot.style,t.rootStyle),t.backdropStyle&&Object.assign(e.bottomSheetBackdrop.style,t.backdropStyle),t.containerGapFillerStyle&&Object.assign(e.bottomSheetContainer.style,t.containerStyle),t.containerStyle&&Object.assign(e.bottomSheetContainerGapFiller.style,t.containerGapFillerStyle),t.handleStyle&&Object.assign(e.bottomSheetHandleBar.style,t.handleStyle),t.contentWrapperStyle&&Object.assign(e.bottomSheetContentWrapper.style,t.contentWrapperStyle),{elements:e,eventHandlers:a}}function Kt(t){const n=N("dialog",x([v.Root,ut.Dialog,t.rootClass]),v.Root);n.ariaLabel=t.ariaLabel;const e=N("section",x([v.Container,t.containerClass]),v.Container);t.containerBorderRadius&&(e.style.borderRadius=Yt(t.containerBorderRadius));const r=N("div",v.GapFiller,v.GapFiller);t.containerBackgroundColor&&(e.style.backgroundColor=t.containerBackgroundColor,r.style.backgroundColor=t.containerBackgroundColor);const i=N("button",x([v.Handle,ut.Button,t.shouldShowHandle?null:Z.Hidden,t.handleClass]),v.Handle);i.setAttribute("type","button"),i.ariaLabel="bottom sheet close button";const a=N("span",x([v.HandleBar,t.shouldShowHandle?null:Z.Hidden]),v.HandleBar),o=N("article",x([v.ContentWrapper,t.contentWrapperClass]),v.ContentWrapper),l=N("div",x([v.Backdrop,t.backdropClass,Z.Hidden]),v.Backdrop);return t.backdropColor&&(l.style.backgroundColor=t.backdropColor),t.backDropTransition&&(l.style.transition=t.backDropTransition),{bottomSheetRoot:n,bottomSheetBackdrop:l,bottomSheetContainer:e,bottomSheetHandle:i,bottomSheetHandleBar:a,bottomSheetContentWrapper:o,bottomSheetContainerGapFiller:r}}function qt({bottomSheetRoot:t,bottomSheetContainer:n,bottomSheetHandle:e,bottomSheetHandleBar:r,bottomSheetContentWrapper:i,bottomSheetContainerGapFiller:a}){t.appendChild(n),e.appendChild(r),n.appendChild(e),n.appendChild(i),n.appendChild(a)}function Jt({bottomSheetElements:t,bottomSheetProps:n,options:e}){const{bottomSheetRoot:r,bottomSheetContainer:i,bottomSheetHandle:a,bottomSheetContainerGapFiller:o,bottomSheetContentWrapper:l,bottomSheetBackdrop:s}=t,{animationFrame:g}=e,d=new $(a),b=new $(l),C=new $(o);let f=[];const T=new $(window),E=_t(T,i,n,e.draggingState),c=Vt(T,i,n,e.draggingState,g),O=Wt(T,i,n,e.draggingState,g,e.onClose,e.bottomSheetState);function Y(S){S.target instanceof Element&&!r.contains(S.target)&&e.onClose()}function A(S){Ut(e.draggingState,S.target,t.bottomSheetContentWrapper)}function z(S){const H=S??n;H.draggable&&H.backgroundDraggable&&(b.addEventListeners({onStart:A,onStartOptions:{eventPhase:G.Target}}),C.addEventListeners({onStart:A})),H.draggable&&T.addEventListeners({onStart:E,onMove:c,onEnd:O}),H.draggable&&window.document.addEventListener("keyup",y=>{y.key==="Escape"&&e.onClose()}),a.addEventListener("keyup",y=>{if(y.key==="ArrowUp"){e.moveUp();return}if(y.key==="ArrowDown"){e.moveDown();return}if(y.shiftKey&&y.key==="Tab"){const U=ot(t.bottomSheetContentWrapper);Pt(U)}})}function K(S){const H=S??n;n.shouldCloseOnOutsideClick&&!n.preventClosing?s.addEventListener("click",Y):s.style.pointerEvents="none",H.draggable&&(d.addEventListeners({onStart:A}),f.forEach(y=>{y.removeEventListeners({onStart:A})}),f=n.dragTriggers.reduce((y,U)=>{const q=r.querySelectorAll(U);if(!q.length)return y;const J=Array.from(q).map(u=>u instanceof HTMLElement?new $(u):null).filter(u=>!!u);return[...y,...J]},[]),f.forEach(y=>{y.addEventListeners({onStart:A,onStartOptions:{eventPhase:G.Target}})}))}function I(){s.removeEventListener("click",Y)}function ot(S){let H=[...Array.from(S.childNodes).reverse()];for(;H.length;){const y=H.shift();if(Rt(y))return y;y&&(H=[...H,...Array.from(y.childNodes).reverse()])}return null}function it(){d.removeEventListeners({onStart:A}),b.removeEventListeners({onStart:A}),C.removeEventListeners({onStart:A}),f.forEach(S=>{S.removeEventListeners({onStart:A})}),T.removeEventListeners({onStart:E,onMove:c,onEnd:O})}return{attachEventListeners:z,clearEventListeners:it,attacheOnOpenEventListeners:K,clearOnOpenEventListeners:I}}class vt{constructor(){_(this,"animationId");_(this,"isInProgress");_(this,"startedAt");this.animationId=null,this.isInProgress=!1,this.startedAt=null}start(n,e,r=!1){this.isInProgress=!0;const i=a=>{this.startedAt||(this.startedAt=a);const o=a-this.startedAt,s=e===0?1:nt(o/e,2),g=s>=1&&!r;n(s),g?this.stop():this.animationId=requestAnimationFrame(i)};this.animationId=requestAnimationFrame(i)}stop(){this.isInProgress=!1,this.startedAt=null,B(this.animationId)&&cancelAnimationFrame(this.animationId)}}function Qt(t){const{startY:n,endY:e,bottomSheetContainer:r,animationFrame:i,onEnd:a,animationTimingFunction:o,animationDuration:l}=t,s=Ot(n,e);i.stop();let g=!1;i.start(d=>{et(r,{y:n+s*o(d)}),!g&&d>=1&&(a==null||a(),g=!0)},l)}const gt=(t,n)=>e=>{Qt({...e,animationTimingFunction:t,animationDuration:n})};function Zt(t){const{backdrop:n,animationFrame:e,animationTimingFunction:r,animationDuration:i,onEnd:a}=t;e.stop();let o=!1;e.start(l=>{Object.entries(t.styleCreators).forEach(([s,g])=>{n.style[s]=g(Number(r(l).toFixed(2)))}),!o&&l>=1&&(a==null||a(),o=!0)},i)}const mt=(t,n)=>e=>{Zt({...e,animationTimingFunction:t,animationDuration:n})},P={TOP:"top",MIDDLE:"middle",CONTENT_HEIGHT:"content-height",CLOSED:"closed"};function tn(t){return!(!B(t)||t>1||t<0)}function nn(t,n){const e={set(r,i,a,o){return n(i,a),Reflect.set(r,i,a,o)}};return new Proxy(t,e)}function en(...t){console.error(t)}const M={EASE:"ease",EASE_IN:"ease-in",EASE_OUT:"ease-out",EASE_IN_OUT:"ease-in-out",SPRING:"spring"};function ht(t){for(const n of Object.values(M))if(n===t)return!0;return!1}function bt(t){return!!(t instanceof Object&&"p1x"in t&&"p1y"in t&&"p2x"in t&&"p2y"in t&&B(t.p1x)&&B(t.p1y)&&B(t.p2x)&&B(t.p2y))}function j(t,n,e,r){return function(s){return l(a(s))};function a(s){let g=0,d=1,b=s,C;if(s===0||s===1)return s;for(;g<d;){if(C=o(b),Math.abs(C-s)<.001)return b;s>C?g=b:d=b,b=(d+g)/2}return b}function o(s){return 3*t*s*Math.pow(1-s,2)+3*e*Math.pow(s,2)*(1-s)+Math.pow(s,3)}function l(s){return 3*n*s*Math.pow(1-s,2)+3*r*Math.pow(s,2)*(1-s)+Math.pow(s,3)}}const kt=j(.25,.1,.25,1),rn=j(.42,0,1,1),Ft=j(.42,0,.58,1),on=j(.4,.1,.6,1),an=j(.45,1.5,.55,1);function sn(t){switch(t){case M.EASE:return kt;case M.EASE_IN:return rn;case M.EASE_OUT:return Ft;case M.EASE_IN_OUT:return on;case M.SPRING:return an;default:return kt}}function wt(t){return typeof t=="boolean"}const cn={ariaLabel:"Bottom sheet",content:"",defaultPosition:P.CONTENT_HEIGHT,marginTop:20,snapPoints:[],width:"92%",dragTriggers:[],beforeOpen:()=>{},afterOpen:()=>{},beforeClose:()=>{},afterClose:()=>{},onDragStart:()=>{},onDragMove:()=>{},onDragEnd:()=>{},expandable:!0,preventClosing:!1,draggable:!0,backgroundDraggable:!0,shouldCloseOnOutsideClick:!0,shouldShowBackdrop:!0,shouldShowHandle:!0,backDropTransition:null,backdropColor:null,containerBackgroundColor:null,containerBorderRadius:null,rootClass:null,containerClass:null,handleClass:null,contentWrapperClass:null,backdropClass:null,draggingAnimationTimings:"ease-in-out",draggingAnimationDuration:180,backdropAnimationTimings:"ease-out",backdropAnimationDuration:180,backdropAnimStyleCreators:{opacity:t=>`${1-t}`},rootStyle:{},containerStyle:{},handleStyle:{},contentWrapperStyle:{},backdropStyle:{},containerGapFillerStyle:{}};function ln(t){const n={...cn},e=Object.entries(t).reduce((i,a)=>{const[o,l]=a;return ft(l)&&(i[o]=l),i},{});return{...n,...e}}function R(t){if(bt(t)){const{p1x:n,p1y:e,p2x:r,p2y:i}=t;return j(n,e,r,i)}return ht(t)?sn(t):Ft}function un(t,n,e,r){function i(a,o){switch(a){case"content":w(o)&&(t.bottomSheetContentWrapper.innerHTML=o);break;case"width":w(o)&&(t.bottomSheetContainer.style.width=o);break;case"shouldShowHandle":wt(o)||tt(t.bottomSheetHandle,!1);break;case"shouldShowBackdrop":wt(o)||tt(t.bottomSheetBackdrop,!1);break;case"containerBorderRadius":w(o)&&(t.bottomSheetContainer.style.borderRadius=Yt(o));break;case"containerBackgroundColor":w(o)&&(t.bottomSheetContainer.style.backgroundColor=o,t.bottomSheetContainerGapFiller.style.backgroundColor=o);break;case"backdropColor":w(o)&&(t.bottomSheetBackdrop.style.backgroundColor=o);break;case"backDropTransition":w(o)&&(t.bottomSheetBackdrop.style.transition=o);break;case"rootClass":if(!w(o))return;V(t.bottomSheetRoot,e.rootClass,o);break;case"containerClass":if(!w(o))return;V(t.bottomSheetContainer,e.containerClass,o);break;case"handleClass":if(!w(o))return;V(t.bottomSheetHandle,e.handleClass,o);break;case"contentWrapperClass":if(!w(o))return;V(t.bottomSheetContentWrapper,e.contentWrapperClass,o);break;case"backdropClass":if(!w(o))return;V(t.bottomSheetBackdrop,e.backdropClass,o);break;case"expandable":r.clearEventListeners(),r.attachEventListeners(e);break;case"preventClosing":r.clearEventListeners(),r.attachEventListeners(e);break;case"draggable":r.clearEventListeners(),r.attachEventListeners(e);break;case"dragTriggers":r.clearEventListeners(),r.attachEventListeners(e);break;case"draggingAnimationTimings":if(bt(o)||ht(o)){const l=R(o),s=gt(l,e.draggingAnimationDuration);n.translateContainer=s}break;case"draggingAnimationDuration":if(B(o)){const l=R(e.draggingAnimationTimings),s=gt(l,o);n.translateContainer=s}break;case"backdropAnimationTimings":if(bt(o)||ht(o)){const l=R(o),s=mt(l,e.backdropAnimationDuration);n.animateBackdrop=s}break;case"backdropAnimationDuration":if(B(o)){const l=R(e.backdropAnimationTimings),s=mt(l,o);n.animateBackdrop=s}break;case"rootStyle":e.rootStyle&&Object.assign(t.bottomSheetRoot.style,e.rootStyle);break;case"backdropStyle":e.backdropStyle&&Object.assign(t.bottomSheetBackdrop.style,e.backdropStyle);break;case"containerStyle":e.containerStyle&&Object.assign(t.bottomSheetContainer.style,e.containerStyle);break;case"containerGapFillerStyle":e.containerGapFillerStyle&&Object.assign(t.bottomSheetContainerGapFiller.style,e.containerGapFillerStyle);break;case"handleStyle":e.handleStyle&&Object.assign(t.bottomSheetHandleBar.style,e.handleStyle);break;case"contentWrapperStyle":e.contentWrapperStyle&&Object.assign(t.bottomSheetContentWrapper.style,e.contentWrapperStyle);break}}return i}function dn(t){const n=ln(t),e=R(t.draggingAnimationTimings),r=gt(e,n.draggingAnimationDuration),i=R(t.backdropAnimationTimings),a=mt(i,n.backdropAnimationDuration),o={isMounted:!1,translateContainer:r,animateBackdrop:a},l={startY:null,containerStartTranslate:{x:0,y:0},isDragging:!1,originalDocumentOverflowY:null,originalDocumentOverscrollBehavior:null};function s(){l.originalDocumentOverflowY&&l.originalDocumentOverflowY!=="hidden"&&(document.body.style.overflowY=l.originalDocumentOverflowY),l.originalDocumentOverscrollBehavior&&(document.body.style.position=l.originalDocumentOverscrollBehavior)}const g=new vt,d={animationFrame:g,onClose:z,bottomSheetState:o,draggingState:l,snapTo:J,moveUp:U,moveDown:q},{elements:b,eventHandlers:C}=zt(n,d),f=nn(n,un(b,o,n,C)),{bottomSheetBackdrop:T,bottomSheetRoot:E,bottomSheetContainer:c}=b,O=u=>{const h=u??window.document.body;h.appendChild(E),h.appendChild(T);const p=window.innerHeight;et(c,{y:p}),C.attachEventListeners(),o.isMounted=!0},Y=()=>{C.clearEventListeners(),Object.values(b).forEach(u=>{u.remove()}),s(),o.isMounted=!1},A=()=>{var D;if(K()||en('Bottom Sheet is not mounted yet. call the "mount" method first.'),(D=t.beforeOpen)==null||D.call(t),I())return;Q(T,!0),f.shouldShowBackdrop||X(T,"transparent"),Q([c],!0),et(c,{y:c.clientHeight});const h=window.innerHeight,p=pt(h,c.clientHeight,f.marginTop,f.defaultPosition),m=F(c).y;o.translateContainer({startY:m,endY:p,animationFrame:g,bottomSheetContainer:c,onEnd:t.afterOpen});const k=document.body.style.overflowY;l.originalDocumentOverflowY=k||"initial";const L=document.body.style.overscrollBehavior;l.originalDocumentOverscrollBehavior=L||"initial",document.body.style.overflow="hidden",document.body.style.overscrollBehavior="contain",b.bottomSheetHandle.focus(),C.attacheOnOpenEventListeners()};function z(){var p;if(!xt(c))return;(p=t.beforeClose)==null||p.call(t);const u=F(c).y,h=c.clientHeight;if(o.translateContainer({startY:u,endY:h,animationFrame:g,bottomSheetContainer:c,onEnd:()=>{var m;(m=t.afterClose)==null||m.call(t),Q([c],!1),C.clearOnOpenEventListeners()}}),Object.keys(f.backdropAnimStyleCreators).length>0){const m=new vt;o.animateBackdrop({animationFrame:m,backdrop:T,styleCreators:f.backdropAnimStyleCreators,onEnd:()=>{Q([T],!1),T.style.opacity="1"}})}s()}function K(){return o.isMounted}function I(){const u=F(c).y,h=window.innerHeight,p=c.clientHeight>=h?h:c.clientHeight;return u<=p}function ot(){return!I()}function it(){const u=F(c).y,h=c.clientHeight,p=window.innerHeight;if(u<=5&&u>=-5)return P.CONTENT_HEIGHT;const m=h-u;if(m===p/2)return P.MIDDLE;const k=p-f.marginTop,L=10;return m<=k+L&&m>=k-L?P.TOP:P.CLOSED}function S(){return c.clientHeight}function H(u){if(!I())return;const h=F(c).y,m=c.clientHeight-h,k=window.innerHeight-u,L=Gt(m,k),D=W(m,k);o.translateContainer({startY:h,endY:h+(L.isUp?-D:D),animationFrame:g,bottomSheetContainer:c})}function y(u,{viewportHeight:h,visibleHeight:p}){let m=null;for(const k of u){const L=k*h,D=W(p,L);(m===null||D<m)&&(m=D)}return{minOffset:m}}function U(){const u=[...f.snapPoints].reverse(),h=F(c).y,p=c.clientHeight,m=p-h;if(!f.expandable&&m>=p)return;const k=window.innerHeight,L=yt("above",{visibleHeight:m,viewportHeight:k},u),{minOffset:D}=y(L,{visibleHeight:m,viewportHeight:k});if(D===null&&m<k-f.marginTop){o.translateContainer({startY:h,endY:pt(k,p,f.marginTop,"top"),animationFrame:g,bottomSheetContainer:c});return}B(D)&&o.translateContainer({startY:h,endY:h-D,animationFrame:g,bottomSheetContainer:c})}function q(){const u=F(c).y,p=c.clientHeight-u;if(p<1)return;const m=window.innerHeight,k=yt("below",{visibleHeight:p,viewportHeight:m},f.snapPoints),{minOffset:L}=y(k,{visibleHeight:p,viewportHeight:m});B(L)&&o.translateContainer({startY:u,endY:u+L,animationFrame:g,bottomSheetContainer:c})}function J(u){const h=window.innerHeight;if(!tn(u))return;const p=nt(h*u,2);H(p)}return{props:f,elements:b,mount:O,unmount:Y,open:A,close:z,getIsMounted:K,getIsOpen:I,getIsClosed:ot,getPosition:it,getHeight:S,moveTo:H,snapTo:J}}function fn(){return{elements:{bottomSheetRoot:void 0,bottomSheetBackdrop:void 0,bottomSheetContainer:void 0,bottomSheetHandle:void 0,bottomSheetHandleBar:void 0,bottomSheetContentWrapper:void 0,bottomSheetContainerGapFiller:void 0},mount:()=>{},unmount:()=>{},open:()=>{},close:()=>{},getIsMounted:()=>!1,getHeight:()=>0,getIsOpen:()=>!1,getIsClosed:()=>!0,getPosition:()=>P.CLOSED,moveTo:()=>{},snapTo:()=>{},props:{content:""}}}exports.ClassNames=v;exports.createBottomSheet=dn;exports.createPlaceholderBottomSheet=fn;