import { EventEmitter } from '../../stencil-public-runtime'; import { FormHook } from "../../features/form-hook/form-hook"; import { FormElement, FormInputLocalization } from "../../features/form-hook/index"; import { LanguageKeys } from "../../features/multi-lingual/index"; import { BranchSlotDay } from './branch-slot-dropdown'; import { BranchDateStep } from './branch-date-dropdown'; import { BranchSlotSelection } from './branch-slot-picker'; type Status = 'idle' | 'loading' | 'ready' | 'empty' | 'error'; /** * Branch-aware booking slot field, month-calendar variant. * * Same contract and same data as `branch-slot-picker` — the same endpoint, the * same `slotChange` payload, the same standalone-without-a-form behaviour. The * difference is entirely in the panel: a month grid first, then that day's * times, on a sliding track. Customers who have never used a horizontal day * strip have used a month calendar, and the second step arrives already scoped * to one day rather than sitting under the first. * * The two are meant to be interchangeable, so a deployment can pick whichever * its audience reads faster without anything downstream changing. */ export declare class BranchDatePicker implements FormElement { /** Field name. Only meaningful when `form` is supplied. */ name: string; /** Optional — omit for standalone use and listen to `slotChange` instead. */ form?: FormHook; /** Full URL of the calendar endpoint, e.g. `https://…/api/public/calendar`. */ calendarApi: string; /** Integration ids. The field stays idle until all four are present. */ companyId: string; branchId: string; departmentId: string; brandId: string; /** How far ahead to ask. The endpoint caps its own response at 15 days. */ daysAhead: number; /** ISO calendar date, read as UTC. Omit it to use the wall clock. */ today?: string; /** * Weekdays the branch never books on, `0` Sunday … `6` Saturday. Accepts an * array or a `"5,6"` string. Matching days stay on the grid, struck through, * rather than being dropped — see `~lib/slot-day-rules`. */ disabledWeekdays?: string | number[]; /** One-off blackout dates as `YYYY-MM-DD`, same accepted shapes as above. */ disabledDates?: string | string[]; /** * First column of the grid, `0` Sunday … `6` Saturday. Left unset it comes * from the active locale, which is right far more often than any constant. */ weekStartsOn?: number; /** Gap between the trigger and the panel, matching shift-select's default. */ gap: number; /** * Floor for the panel width on desktop. The panel is portaled to `` and * positioned fixed, so it is free to be wider than the field — and than the * form around it — which is the point: seven columns stop reading as a * calendar much below this, and form fields are routinely narrower. */ minPanelWidth: number; /** Tallest the panel may get before its panes scroll. Also capped to the viewport. */ maxPanelHeight: number; label?: string; wrapperId: string; wrapperClass: string; isRequired: boolean; isDisabled: boolean; language: LanguageKeys; localization?: FormInputLocalization; /** Preselects a slot, in the same `YYYY-MM-DDTHH:mm` form the field emits. */ defaultValue?: string; status: Status; days: BranchSlotDay[]; selectedDate: string; selectedRaw: string; isOpen: boolean; dropdownAncestorClasses: string; /** * The day whose times are on the second pane. Kept apart from `selectedDate` * so browsing the calendar and then dismissing the panel leaves the committed * selection untouched. */ draftDate: string; step: BranchDateStep; /** Month on screen as `YYYY-MM`, and which way the last change travelled. */ monthKey: string; monthDirection: number; /** Fires on every confirmed day+time selection. The standalone contract. */ slotChange: EventEmitter; el: HTMLElement; /** * The response as it arrived, before the disable rules are layered on. Kept so * a rule change re-decorates without a refetch. */ private fetchedDays; private abortController?; private dropdownEl; private lockedScrollY; private boundKeyDown; componentWillLoad(): void; componentDidLoad(): void; disconnectedCallback(): void; onOpenChange(isOpen: boolean): void; /** * Pinning the body position rather than just hiding overflow: on iOS, * `overflow: hidden` alone still lets the page rubber-band behind the sheet. */ private lockScroll; private releaseScroll; onRulesChange(): void; onTargetChange(): void; /** FormElement contract. */ reset(newValue?: unknown): void; getValue(): string; /** Lets a host force a refetch, e.g. after a token refresh. */ refresh(): Promise; openDropdown(): Promise; closeDropdown(): Promise; private get isRtl(); private get copy(); private get intlLocales(); /** * `0` Sunday … `6` Saturday. `getWeekInfo` is the only thing that knows the * region's answer; it is missing on older WebViews, hence the guard and the * Monday default the rest of Intl assumes. */ private get weekStart(); private pad; private get todayIso(); /** `2026-08-13 09:00 AM` → minutes since midnight. */ private minutesOf; private toFormValue; private displayTime; private formatDay; private formatMonth; /** 7 January 2024 was a Sunday, so it indexes weekdays without a lookup table. */ private formatWeekday; private queryUrl; /** * Overlapping work periods of equal priority make the endpoint emit the same * slot more than once, and a merged response is not necessarily ordered. Both * are fixed here rather than in the panel, so anything reading `days` gets * clean data. */ private normalise; /** Layers the disable rules over the response without discarding anything. */ private applyDayRules; private firstOpenDay; private lastOpenDay; private load; private setDropdownRef; private getTriggerEl; private isTriggerInView; /** * Below this width the panel is a bottom sheet pinned to the viewport, so it * is not anchored to anything and none of the positioning below applies. Kept * in sync with the media query in branch-date-dropdown.css. */ private get isSheet(); /** Anchor to the trigger, flip up when space below is short. */ private adjustDropdownPosition; private handleResize; private handleScroll; private handleKeyDown; private closeOnOutsideClick; private toggle; private get monthBounds(); /** Months with nothing bookable in them are not worth walking into. */ private handleMonth; private handleDate; private handleBack; private handleTime; /** What the trigger shows: the committed slot, or why it cannot be opened. */ private triggerText; render(): any; } export {};