== Changelog ==
= 2.2.27 =
* The iCal export box (Bookings > iCal Imports and the apartment edit screen) now shows the direct-only link first as the recommended option. The link with all reservations, including imported iCal blocks, is collapsed under "Advanced" with a warning that a misconfigured import can make blocks circulate endlessly between channels. The iCal guide in the documentation was updated the same way.
* Added a restricted "Property Manager" role and a new `vstrb_manage_bookings` capability. Users with this role can open Bookings (reservations), Calendar and Guest Registrations, confirm reservations and mark payments as paid without WordPress administrator access. Rates, Apartment Content, iCal Imports and Settings still require an administrator. Administrators have the new capability automatically.

= 2.2.26 =
* Fixed booking-form service names remaining in English when the form language is set to a short code such as `cs`.
* Added an optional setting in Settings > iCal, "Closed periods in iCal export" (off by default). When enabled, closed months, date ranges and days of the year set in an apartment are added to its iCal export as "Blocked" events for the next 2 years, so Booking.com, Airbnb and other portals block them too. Applies to both the full and the direct-only export.

= 2.2.25 =
* The guest portal now shows a payment QR code (Czech QR platba, PAY by square, EPC/SEPA or Swiss QR-bill, depending on the account and currency) under the bank transfer instructions when bank transfer is available and an amount is due.

= 2.2.24 =
* Airbnb iCal events labelled "Not available" without a reservation ID are again not imported as blocked dates by default (the 2.2.20 change was reverted). Airbnb uses them for owner blocks and its own availability rules, and they appear and disappear from the feed, which blocked dates and triggered false "iCal reservation cancelled" emails.
* Added an optional global setting in Settings > iCal Imports, "Import Airbnb 'Not available' events as blocked dates" (off by default; applies to all apartments and feeds), for those who block dates directly in Airbnb. Real reservations are always imported. Added translations in all bundled languages.
* Added payment QR codes for EUR payments to Slovak accounts (PAY by square), Swiss and Liechtenstein accounts (QR-bill) and other SEPA IBANs (EPC QR), in addition to the existing Czech QR for CZK. Updated the IBAN setting description and translations.
* Unified booking form validation notices: minimum-stay and similar quote messages appear as warnings, and warning/error notices share configurable colors and corner radius in Styling.
* Updated translations for the unified validation notice settings in all bundled languages.
* Added a separate setting for document photos in the public guest registration form (Settings): show as optional, required, or hide the upload completely, independently of the reservation photo uploads in the admin. Added translations in all bundled languages.
* Removed the obsolete standalone "Price per night" accommodation pricing mode; use "Price per unit / night" instead.

= 2.2.23 =
* Fixed HTML-encoded umlauts appearing as entities in booking-form calculator service labels when the widget uses a different language.

= 2.2.22 =
* Added an extra guest fee per apartment: set the number of guests included in the price and a per-night fee (per currency) for each additional guest. Children under the free accommodation age limit are not charged, and the fee is included in the total, deposit, and balance.

= 2.2.21 =
* Fixed HTML-encoded characters such as German umlauts appearing literally in price calculator rate and service labels when the booking form uses another language.

= 2.2.20 =
* With whole-week bookings enabled, the availability calendar now shows only the weekly price on change-over days; per-night prices on other days are hidden.

= 2.2.19 =
* Send guests a payment receipt email after each newly matched payment, including the paid amount, remaining balance, payment reference, and guest reservation portal link.

= 2.2.18 =
* Added optional whole-week bookings with a configurable change-over day and minimum and maximum week limits.
* Highlighted change-over days in the availability calendar, preselected the minimum stay in full weeks on the first click, and set the end date on the second click; a third click starts a new selection. Weekly prices use the existing nightly rates.

= 2.2.17 =
* Fixed German umlauts and other HTML-encoded characters in service names and details on the public booking form.

= 2.2.16 =
* Added search templates for `[vstrb_search]`: `template="classic|compact|full|modern|minimal|showcase"`. A template sets the form look and the default result layout, description, amenities and link; explicit attributes (`result_layout`, `show_description`, `show_amenities`, `amenities_limit`, `show_link`) still override it.
* The search form is now a single row (check-in, check-out, guests, rooms, button) and no longer offers children; the booking form keeps its own children option.
* Added a rooms filter to `[vstrb_search]` (minimum number of rooms, hidden with `show_rooms="0"`).
* Added `form_labels="icons"` to `[vstrb_search]`: icons inside the fields with tooltips and a magnifier icon on the search button instead of text labels.
* Added the template, field labels and rooms filter options to the "Accommodation search" block, and a new "Accommodation search" Elementor widget with all search options and style controls.
* `[vstrb_search]` now uses a modern range date picker: pick the check-in date and the check-out date opens immediately, with the stay range highlighted.
* Hardened the search result photo arrows and date picker arrows against theme button styles that distorted them.

= 2.2.15 =
* Added Elementor support: native Elementor widgets for apartment photos, description, property details, amenities, availability calendar, and booking form, with widget-specific controls and icons.
* Elementor widgets now expose the full shortcode options: gallery caption position, alignment, offsets and colors; booking form design, field order, guest, child, country and consent options, discount code and lazy loading; availability calendar design.
* Added Elementor style controls (typography and colors) for the widget title, gallery captions, property details labels, values and icons, description, and amenities.
* The apartment page wizard offers Elementor as a page editor and, when Elementor is active, creates pages with native Vachr widgets instead of generic shortcode widgets.
* Fixed gallery aspect ratio and link options in the Elementor widget and Elementor widget base class compatibility.

= 2.2.14 =
* Added configurable initial accommodation results to `[vstrb_search]`; it shows three accommodations by default, and `initial_results="0"` disables the initial list.
* Search result cards now show available guest and child capacity, room and bed counts, and floor area with icons.
* Added icon and text display options to `[vstrb_unit_details]`; compact icon display is now the default.

= 2.1.81 =
* Fixed frontend handling of REST API validation errors so guests see specific messages, including the configured minimum or maximum stay and guest limit, instead of a generic booking error.
* Improve rate group deletion logic with enhanced error handling and clearer success messages

= 2.1.80 =
* Unified guest payment requests and unpaid reservation reminders into one configurable schedule that always requests the current outstanding amount.
* Kept staff payment notifications on their existing staff rules and removed duplicate guest balance-request emails.
* Aligned the one-time automatic card charge with the final configured guest reminder day; sends the regular payment reminder if a charge fails or needs authentication.
* Migrated existing reminder and balance-request days into the unified schedule and updated translations in all bundled languages.

= 2.1.79 =
* Added configurable advance-payment rules based on the time between booking and arrival, with global defaults and per-apartment overrides or opt-outs.
* Added partial-payment tracking that displays amounts received and the remaining balance.
* Added automatic balance requests a configurable number of days before arrival, including card checkout links and bank-transfer instructions.
* Added optional off-session card charging through Stripe and Mollie when the guest explicitly authorizes future charges; sends a payment link if automatic collection needs additional authentication or fails.
* Added translations for the advance-payment and balance-collection settings, booking form, and guest emails in all bundled languages.

= 2.1.78 =
* Added multiple bank email parser profiles with sender-based profile selection and profile-specific reference, amount, and currency patterns.
* Added amount and currency extraction to the email-payment parser test and import audit.
* Improved the bank-profile settings layout and added translations for all bundled languages.
* Added accommodation-template placeholders for reservation ID, payment amount, and payment currency, and clarified invoice-number and payment-reference placeholders.
* Made placeholder guidance visible in the accommodation editor and updated the documentation and translations in all available languages; documented the Czech-only variable symbol in Czech.

= 2.1.77 =
* Replaced the PHP IMAP-extension dependency with a stream-based IMAP client for broader compatibility with managed hosting.
* Improved mailbox diagnostics to report the failing connection or IMAP command and its server/PHP error details.
* Expanded built-in bank email parsing to recognize common payment-reference labels used in multiple countries.
* Renamed the country-specific parser setting to describe national reference formats, including Czech VS and similar identifiers.
* Expanded the email-payment audit log with sender, subject, matching result, and the matched reservation details.
* Recent audit now displays up to 50 processed emails, including why messages were not matched.
* Added optional AI-assisted generation of bank email reference regexes through the connected WordPress AI provider.
* Generated patterns are checked against the supplied sample and require review and saving before use.
* Disabled AI regex generation until a configured AI provider is connected and added a settings hint.
* Clarified the national payment-reference template by listing supported countries and their common reference labels.
* Added a complete international payment-reference regex example to the custom-parser field placeholder.

= 2.1.74 =
* Added an optional IMAP email importer that reads bank payment notifications and matches payment references or Czech variable symbols to reservations.
* Added configurable bank sender allowlists, built-in parser templates, custom regular expressions, a parser test, manual import controls, and a recent import audit.
* Added automatic import scheduling every 15 minutes and duplicate-message protection; ambiguous or unmatched payments are never applied automatically.
* Added setup guidance and translations for the email payment settings in all available languages.

= 2.1.73 =
* Fixed Stripe webhook handling for successful PaymentIntent events and linked them to their reservation through the Checkout Session reference.
* Added reservation metadata to Stripe PaymentIntents for reliable webhook matching.
* Fixed payment return handling when the booking form is loaded lazily, so the thank-you message appears after returning from checkout.
* Updated Stripe webhook setup instructions to include both supported success events.

= 2.1.72 =
* SVN commit for JS file

= 2.1.71 =
* Added configurable email reminders for guests with unpaid reservations, based on selected day intervals after the reservation is created.
* Added staff alerts for unpaid direct reservations, with configurable recipients and timing before arrival.
* Added payment-method filters for unpaid reservation alerts and reminders.

= 2.1.70 =
* Added an editable booking form block with toolbar settings and shortcode conversion, and updated the page wizard to create configured booking form blocks.
* Added payment-method choices and a direct link to payment settings in the page wizard, plus settings controls for existing booking-form shortcodes.
* Completed translations for the page wizard and booking form block in all available language catalogs, and fixed generated shortcode attribute formatting.

= 2.1.69 =
* Added a global local-time setting for daily staff notification emails and kept the schedule stable across daylight-saving changes.
* Improved frontend asset cache invalidation by including each asset's modification time in its version and invalidating custom styling after saving Appearance settings.

= 2.1.68 =
* Added a custom phone country-code option so guests can enter a prefix that is not in the catalogue.

= 2.1.67 =
* Fixed the nationality selector so the complete country list remains available beyond the first 50 results.
* Added country calling prefixes for all ISO country/territory entries, with browser-region preselection for country and phone fields, alphabetical fallback, a custom phone-prefix option, and a filter for site-specific custom prefixes.

= 2.1.66 =
* Added booking-form calendar month and month-column controls to the **Create apartment page** wizard.
* The generated booking form defaults to 2 calendar months in 1 column and keeps the selected values in the generated shortcode.

= 2.1.64 =
* Show a valid discount code in calendar prices while keeping stay-length discounts for the complete selected-date calculation.
* Apply stay-length discounts after the discount code and keep the same order in the quote and reservation price breakdown.

= 2.1.63 =
* Excluded all stay-length pricing adjustments from individual calendar-day previews; complete stay pricing remains in the quote.

= 2.1.62 =
* Kept stay-length discounts and discount codes out of individual calendar-day previews; they are applied in the complete reservation quote after dates are selected.

= 2.1.61 =
* Fixed the calendar preview so discounts that require a minimum stay are not applied to individual day prices.

= 2.1.60 =
* Applied discount codes to the final accommodation price after seasonal and other pricing discounts.

= 2.1.59 =
* Improved handling of discount codes together with other accommodation pricing adjustments.

= 2.1.58 =
* Fixed calendar discount-code prices so they match the final reservation calculation when other pricing adjustments are active.

= 2.1.57 =
* Added support for multiple reusable discount codes per accommodation and applied matching codes to calendar prices.

= 2.1.56 =
* Added reusable percentage discount codes per accommodation with optional booking-form visibility, validity dates, and support for the `discount_code` GET parameter.
* Recorded applied discount codes and amounts in reservations and booking emails.

= 2.1.55 =
* Added a document collection page action to the accommodation list.
* Renamed the accommodation setup button from Add Apartment to Add Accommodation.
* Added translations for the new document collection page and accommodation button in all supported plugin languages.

= 2.1.54 =
* Added configurable staff booking page links to notification emails, including a direct reservation filter.
* Added a password-protected staff booking shortcode with status controls and a reset link for current and upcoming reservations.
* Added shortcode field filtering with the `fields` parameter and immediate creation of the protected page from notification settings.
* Added a configurable option to automatically confirm bookings submitted through forms without an enabled payment method.
* Added translations for the new booking confirmation option in all supported plugin languages.
* Fixed payment-free booking forms being submitted as cash payments, which could incorrectly mark the booking as paid and confirmed.
* Added a confirmation email to guests when staff changes a reservation status to confirmed.
* Added staff controls to mark a reservation payment as paid from the staff booking page.
* Improved visibility of pending reservation and payment statuses with red status chips in the admin table and staff booking shortcode.

= 2.1.52 =
* Updated pending booking emails and the post-submission message so they clearly state that the request is being processed and is not yet confirmed.
* Updated the corresponding English and translated language files.

= 2.1.51 =
* Fixed translations for the wizard's Add Services and Add Amenities buttons.

= 2.1.50 =
* Fixed base currency switching in the apartment setup wizard when no apartment exists yet. Selecting a different base currency now replaces the initial currency and switches the price form without adding a duplicate currency.

= 2.1.49 =
* Fixed a fatal error after saving guest registration when an older UbyPort plugin does not provide the confirmation_url() method. Registration now returns a successful response without a confirmation link when the method is unavailable.

= 2.1.48 =
* Added base currency selection to the apartment setup wizard.
* Expanded the wizard currency selector with the full supported ISO currency catalog.
* Automatically added a newly selected base currency to the plugin's available currencies.
* Updated wizard pricing fields and validation for the selected base currency.

= 2.1.47 =
* Improved apartment setup wizard validation: errors in hidden steps now open the relevant step and show the browser validation message.
* Made `0 / 0` a valid way to disable the optional basic long-stay discount.
* Added a Terms and Conditions wizard step that creates, assigns, and preserves a required consent checkbox for the apartment.
* Displayed the wizard-created Terms and Conditions checkbox immediately before the booking form submit button.
* Added asset modification times to frontend cache-busting versions so changed JavaScript is fetched automatically.

= 2.1.44 =
* Added the total number of guests, adult and child counts, and child ages to reservation information and customer confirmation emails.
* Added a configurable calendar color for available dates, including live preview and translations for all available plugin languages.
* Fixed calendar and booking-form styling when the Lazy-load Booking Form option is enabled.
* Added styling cache invalidation after saving appearance settings.

= 2.1.43 =
* Added a dedicated `vstrb_booking_child_ages` database table for structured child ages instead of storing them in generic booking metadata.
* Added an idempotent migration for child ages created by version 2.1.42.

= 2.1.42 =
* Added dynamically generated child-age fields to the booking form. The fields follow the selected number of children, require ages from 0 to 17, and are enabled by default.
* Saved child ages with reservations and displayed them in the administration.
* Added the `show_children_ages="0"` shortcode option for disabling the fields on a specific booking form.

= 2.1.40 =
* Improved guest registration actions, compacted reservation pairing controls, and separated WinTOP actions from the main registration actions.
* Added modal editing for bookings, price offers, guest contacts, guests, and invoices to keep reservation tables uncluttered.
* Improved modal behaviour so only the selected editing form is shown and it can be reliably closed.

= 2.1.39 =
* Improved the bookings row actions menu and updated multilingual labels for creating offers and viewing guest registrations.

= 2.1.38 =
* Fixed bookings created without any enabled payment method being incorrectly marked as paid. They now remain pending until a payment is actually recorded.

= 2.1.36 =
* Added historical billing contact selection when editing invoices.
* Added proforma invoice access from the invoices and transactions page.

= 2.1.35 =
* Fixed guest-registration document photos silently failing to upload when larger than the server's upload limit (common with phone camera photos). Photos are now shrunk to fit in the browser before upload (with a server-side fallback resize too) and are uploaded one at a time in the background after the registration itself is saved, so no photo can ever delay or block the registration. A progress notice is shown while photos are still uploading and the guest is warned before leaving the page early; any upload that still fails is reported to the guest instead of being dropped silently.

= 2.1.34 =
* Fixed detail, guest/contact editing, and expandable guest controls in the administration when scripts are loaded from cache or in a different order.
* Added reliable cache busting for the plugin's custom CSS and JavaScript assets.

= 2.1.33 =
* Fixed guest-registration country and nationality selectors: full country lists, search, and correct dropdown positioning.

= 2.1.32 =
* Added configurable booking form layout and section order to the page creation wizard.
* Added translations for the new booking form layout controls.

= 2.1.31 =
* Updated the default English accommodation menu labels.

= 2.1.30 =
* Renamed the accommodation menu labels in all available translations.

= 2.1.19 =
* Added Czech translations for the document-photo upload labels.
* Reduced the maximum document-photo size from 15 MB to 1 MB per file.

= 2.1.18 =
* Changed guest uploads to per-person document-photo fields.
* Removed public media URLs for document photos and added protected admin-only downloads.

= 2.1.17 =
* Added the photo upload field to the public guest/contact registration form.
* Connected uploaded photos to the matched reservation, with a registration folder fallback when no reservation is matched.
* Added the registration photo-path database field and migration.

= 2.1.16 =
* Added reservation photo uploads with multiple-file support, previews, deletion, and per-reservation folders.
* Added a configurable server-side photo storage path with a secure admin download fallback for folders outside public WordPress uploads.
* Added optional, required, and disabled modes for reservation photo uploads.

= 2.1.15 =
* Improved caching to improve performance and ensure refreshed booking data is displayed correctly.

= 2.1.11 =
* Improved frontend form accessibility by associating labels with controls and adding accessible calendar navigation labels.

= 2.1.10 =
* Improved booking-list performance with indexes for checkout dates, apartment/date ranges, status/date, and source/date filters.
* Added a composite booking metadata index for booking and metadata-key lookups.

= 2.1.9 =
* Prevented caching of booking REST API responses by WP Super Cache, browsers, CDNs, and reverse proxies.
* Added WP Super Cache and CDN configuration guidance for the booking API.

= 2.1.8 =
* Improved responsive calendar pricing: prices are shown inline when they fit, reveal on hover when space is limited, and wrap safely for selected compact calendar days.
* Added localized currency symbols for supported currencies, including €, $, £, ¥, Kč, and Ft.
* Prevented available-day labels from taking space needed by calendar prices.
* Added check-in and check-out date inputs below the booking calendar, synchronized with calendar selection and the price quote.
* Added availability validation for manually entered dates in the quote and booking endpoints.

= 2.1.6 =
* fixed missing file

= 2.1.4 =
* Added an apartment-page wizard that creates editable Gutenberg pages with a chosen layout, language, currency, booking form, calendar, amenities, and image placeholder.
* Added direct access to the apartment-page wizard from the Apartments menu and apartment row actions.

= 2.1.3 =
* Enhanced the apartment setup wizard with clearer basic details, a simplified monthly availability selection, separate amenities, and automatic public-code generation.
* Streamlined base pricing to show only the selected price input, added basic long-stay discounts, and linked to advanced pricing policies.
* Added the apartment-wizard strings to all bundled language catalogs.

= 2.1.2 =
* Added a guided apartment setup wizard with inline catalog additions and validation.
* Simplified apartment availability configuration with monthly booking selection and advanced options.
* Added a basic long-stay discount and direct access to advanced pricing policies in the apartment wizard.

= 2.1.1 =
* Documented staff task automation, signed confirmation links, escalation timing, the staff calendar, and the structured notification migration.
* Reorganized Settings into tabs for general options, notifications, payments, invoicing, calendar, appearance, services, amenities, and contact fields.
* Kept iCal Imports as a dedicated Bookings menu item and updated administration links accordingly.

= 2.1.0 =
* Replaced pipe-separated staff notification editing with a structured notification type and recipient form.
* Added optional per-task confirmation, ordered email escalation, and takeover notices.
* Added the color-coded `[vstrb_staff_tasks]` staff calendar with daily task details.
* Existing staff rules are automatically presented in the new structured editor and retained on save.
* Consolidated general, notification, payment, invoicing, calendar, appearance, services, amenities, and contact-field configuration into tabs on the Settings page while keeping iCal imports in the main plugin menu.

= 2.0.18 =
* Fixed WordPress coding-standard issues in iCal export and cancelled-booking cleanup queries.

= 2.0.17 =
* Fixed iCal import safety so HTTP errors, invalid calendar responses, or empty parsed feeds do not remove existing imported reservations.
* Changed iCal cancellation cleanup to mark missing imported reservations as cancelled first, then permanently delete only old unlinked cancelled records after a retention period.

= 2.0.16 =
* Added a separate iCal export URL for direct booking-system reservations only, excluding imported external iCal blocks.

= 2.0.15 =
* Added an admin extension hook for booking row actions so Pro modules can add booking-specific invoice actions.
* Added a public admin helper for issuing an invoice for an existing booking through the invoicing workflow.

= 2.0.14 =
* Fixed an incomplete 2.0.12 package: bundled the previously missing payment QR and country-list files (`includes/payment-qr.php`, `includes/countries.php`, `assets/payment-qr.js`) and the `assets/vendor` libraries (tom-select, qrcodejs) that the plugin requires.
* Added translations

= 2.0.12 =
* Added an isolated live preview to the Styling administration page.
* Styling changes are now previewed immediately without affecting the published booking calendar or form until they are saved.
* Added desktop and mobile preview widths.
* The preview includes representative available, occupied, selected, check-in, check-out, discount, and surcharge calendar states.
* Added live previews for calendar colors, typography, headings, price badges, form background, maximum width, and booking button styling.
* Added preview support for an external custom CSS URL when Custom CSS mode is enabled.
