valtech-components 2.0.447 → 2.0.448

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.
@@ -37,7 +37,6 @@ export { APP_IDS, FIREBASE_PROJECTS, SHARED_EMULATOR_CONFIG, collections, create
37
37
  export { FirebaseService } from './firebase.service';
38
38
  // Firestore
39
39
  export { FirestoreService } from './firestore.service';
40
- export { FirestoreCollection } from './firestore-collection';
41
40
  // Utilidades
42
41
  export { QueryBuilder, query } from './utils/query-builder';
43
42
  export { buildPath, extractPathParams, getCollectionPath, getDocumentId, isCollectionPath, isDocumentPath, isValidPath, joinPath, } from './utils/path-builder';
@@ -45,4 +44,4 @@ export { buildPath, extractPathParams, getCollectionPath, getDocumentId, isColle
45
44
  export { StorageService } from './storage.service';
46
45
  // Messaging (FCM)
47
46
  export { MessagingService } from './messaging.service';
48
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9zcmMvbGliL3NlcnZpY2VzL2ZpcmViYXNlL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0dBNEJHO0FBRUgsUUFBUTtBQUNSLGNBQWMsU0FBUyxDQUFDO0FBRXhCLGdCQUFnQjtBQUNoQixPQUFPLEVBQUUsdUJBQXVCLEVBQUUsWUFBWSxFQUFFLHNCQUFzQixFQUFFLE1BQU0sVUFBVSxDQUFDO0FBRXpGLHdDQUF3QztBQUN4QyxPQUFPLEVBQ0wsT0FBTyxFQUNQLGlCQUFpQixFQUNqQixzQkFBc0IsRUFDdEIsV0FBVyxFQUNYLG9CQUFvQixFQUNwQixjQUFjLEVBQ2QsWUFBWSxHQUdiLE1BQU0saUJBQWlCLENBQUM7QUFFekIsWUFBWT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NEb2N1bWVudFBhdGgsXG4gIGlzVmFsaWRQYXRoLFxuICBqb2luUGF0aCxcbn0gZnJvbSAnLi91dGlscy9wYXRoLWJ1aWxkZXInO1xuXG4vLyBTdG9yYWdlXG5leHBvcnQgeyBTdG9yYWdlU2VydmljZSB9IGZyb20gJy4vc3RvcmFnZS5zZXJ2aWNlJztcblxuLy8gTWVzc2FnaW5nIChGQ00pXG5leHBvcnQgeyBNZXNzYWdpbmdTZXJ2aWNlIH0gZnJvbSAnLi9tZXNzYWdpbmcuc2VydmljZSc7XG4iXX0=
@@ -22358,270 +22358,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
22358
22358
  args: [{ providedIn: 'root' }]
22359
22359
  }] });
22360
22360
 
22361
- /**
22362
- * Firestore Collection
22363
- *
22364
- * Clase base abstracta para crear servicios de colección tipados.
22365
- * Extiende esta clase para tener un servicio dedicado por entidad.
22366
- */
22367
- /**
22368
- * Clase base para servicios de colección tipados.
22369
- *
22370
- * Extiende esta clase para crear un servicio dedicado para cada entidad,
22371
- * con métodos personalizados y tipado fuerte.
22372
- *
22373
- * @example
22374
- * ```typescript
22375
- * // Definir el modelo
22376
- * interface User extends FirestoreDocument {
22377
- * name: string;
22378
- * email: string;
22379
- * role: 'admin' | 'user';
22380
- * active: boolean;
22381
- * }
22382
- *
22383
- * // Crear el servicio
22384
- * @Injectable({ providedIn: 'root' })
22385
- * export class UsersCollection extends FirestoreCollection<User> {
22386
- * constructor() {
22387
- * super('users');
22388
- * }
22389
- *
22390
- * // Métodos personalizados
22391
- * async getActiveUsers(): Promise<User[]> {
22392
- * return this.query({
22393
- * where: [{ field: 'active', operator: '==', value: true }]
22394
- * });
22395
- * }
22396
- *
22397
- * async getAdmins(): Promise<User[]> {
22398
- * return this.query({
22399
- * where: [{ field: 'role', operator: '==', value: 'admin' }]
22400
- * });
22401
- * }
22402
- *
22403
- * watchOnlineUsers(): Observable<User[]> {
22404
- * return this.watchQuery({
22405
- * where: [{ field: 'status', operator: '==', value: 'online' }]
22406
- * });
22407
- * }
22408
- * }
22409
- *
22410
- * // Usar en componentes
22411
- * @Component({...})
22412
- * export class UsersComponent {
22413
- * private users = inject(UsersCollection);
22414
- *
22415
- * admins$ = this.users.getAdmins();
22416
- * onlineUsers$ = this.users.watchOnlineUsers();
22417
- *
22418
- * async createUser(data: Omit<User, 'id'>) {
22419
- * const user = await this.users.create(data);
22420
- * }
22421
- * }
22422
- * ```
22423
- */
22424
- class FirestoreCollection {
22425
- /**
22426
- * @param collectionPath - Ruta de la colección en Firestore
22427
- * @param options - Opciones de configuración
22428
- */
22429
- constructor(collectionPath, options = {}) {
22430
- this.firestore = inject(FirestoreService);
22431
- this.collectionPath = collectionPath;
22432
- this.options = {
22433
- softDelete: false,
22434
- timestamps: true,
22435
- ...options,
22436
- };
22437
- }
22438
- // ===========================================================================
22439
- // LECTURAS ONE-TIME
22440
- // ===========================================================================
22441
- /**
22442
- * Obtiene un documento por ID.
22443
- */
22444
- async getById(id) {
22445
- return this.firestore.getDoc(this.collectionPath, id);
22446
- }
22447
- /**
22448
- * Obtiene todos los documentos de la colección.
22449
- */
22450
- async getAll(options) {
22451
- const queryOptions = this.applyDefaultFilters(options);
22452
- return this.firestore.getDocs(this.collectionPath, queryOptions);
22453
- }
22454
- /**
22455
- * Ejecuta una query personalizada.
22456
- */
22457
- async query(options) {
22458
- const queryOptions = this.applyDefaultFilters(options);
22459
- return this.firestore.getDocs(this.collectionPath, queryOptions);
22460
- }
22461
- /**
22462
- * Obtiene documentos con paginación.
22463
- */
22464
- async paginate(options) {
22465
- const queryOptions = this.applyDefaultFilters(options);
22466
- return this.firestore.getPaginated(this.collectionPath, queryOptions);
22467
- }
22468
- /**
22469
- * Obtiene el primer documento que coincida con la query.
22470
- */
22471
- async getFirst(options) {
22472
- const queryOptions = this.applyDefaultFilters({
22473
- ...options,
22474
- limit: 1,
22475
- });
22476
- const results = await this.firestore.getDocs(this.collectionPath, queryOptions);
22477
- return results[0] ?? null;
22478
- }
22479
- /**
22480
- * Cuenta los documentos que coinciden con la query.
22481
- * Nota: Esto carga todos los documentos, usar con cuidado en colecciones grandes.
22482
- */
22483
- async count(options) {
22484
- const queryOptions = this.applyDefaultFilters(options);
22485
- const results = await this.firestore.getDocs(this.collectionPath, queryOptions);
22486
- return results.length;
22487
- }
22488
- /**
22489
- * Verifica si un documento existe.
22490
- */
22491
- async exists(id) {
22492
- return this.firestore.exists(this.collectionPath, id);
22493
- }
22494
- // ===========================================================================
22495
- // SUBSCRIPCIONES REAL-TIME
22496
- // ===========================================================================
22497
- /**
22498
- * Suscribe a cambios de un documento.
22499
- */
22500
- watch(id) {
22501
- return this.firestore.docChanges(this.collectionPath, id);
22502
- }
22503
- /**
22504
- * Suscribe a cambios de la colección.
22505
- */
22506
- watchAll(options) {
22507
- const queryOptions = this.applyDefaultFilters(options);
22508
- return this.firestore.collectionChanges(this.collectionPath, queryOptions);
22509
- }
22510
- /**
22511
- * Suscribe a una query personalizada.
22512
- */
22513
- watchQuery(options) {
22514
- const queryOptions = this.applyDefaultFilters(options);
22515
- return this.firestore.collectionChanges(this.collectionPath, queryOptions);
22516
- }
22517
- // ===========================================================================
22518
- // ESCRITURA
22519
- // ===========================================================================
22520
- /**
22521
- * Crea un nuevo documento con ID auto-generado.
22522
- */
22523
- async create(data) {
22524
- return this.firestore.addDoc(this.collectionPath, data);
22525
- }
22526
- /**
22527
- * Crea un documento con ID específico.
22528
- */
22529
- async createWithId(id, data) {
22530
- return this.firestore.setDoc(this.collectionPath, id, data);
22531
- }
22532
- /**
22533
- * Actualiza campos de un documento.
22534
- */
22535
- async update(id, data) {
22536
- return this.firestore.updateDoc(this.collectionPath, id, data);
22537
- }
22538
- /**
22539
- * Elimina un documento.
22540
- * Si softDelete está habilitado, marca como eliminado en lugar de borrar.
22541
- */
22542
- async delete(id) {
22543
- if (this.options.softDelete) {
22544
- return this.firestore.updateDoc(this.collectionPath, id, {
22545
- deletedAt: new Date(),
22546
- });
22547
- }
22548
- return this.firestore.deleteDoc(this.collectionPath, id);
22549
- }
22550
- /**
22551
- * Restaura un documento soft-deleted.
22552
- */
22553
- async restore(id) {
22554
- if (!this.options.softDelete) {
22555
- throw new Error('Soft delete no está habilitado para esta colección');
22556
- }
22557
- return this.firestore.updateDoc(this.collectionPath, id, {
22558
- deletedAt: null,
22559
- });
22560
- }
22561
- // ===========================================================================
22562
- // SUB-COLECCIONES
22563
- // ===========================================================================
22564
- /**
22565
- * Obtiene una referencia a una sub-colección.
22566
- *
22567
- * @example
22568
- * ```typescript
22569
- * // En UsersCollection
22570
- * getUserDocuments(userId: string) {
22571
- * return this.subcollection<Document>(userId, 'documents');
22572
- * }
22573
- *
22574
- * // Uso
22575
- * const docs = await users.getUserDocuments('user123').getAll();
22576
- * ```
22577
- */
22578
- subcollection(parentId, subcollectionName) {
22579
- const subPath = `${this.collectionPath}/${parentId}/${subcollectionName}`;
22580
- return {
22581
- getById: (id) => this.firestore.getDoc(subPath, id),
22582
- getAll: (options) => this.firestore.getDocs(subPath, options),
22583
- watch: (id) => this.firestore.docChanges(subPath, id),
22584
- watchAll: (options) => this.firestore.collectionChanges(subPath, options),
22585
- create: (data) => this.firestore.addDoc(subPath, data),
22586
- update: (id, data) => this.firestore.updateDoc(subPath, id, data),
22587
- delete: (id) => this.firestore.deleteDoc(subPath, id),
22588
- };
22589
- }
22590
- // ===========================================================================
22591
- // MÉTODOS PROTEGIDOS (para override en subclases)
22592
- // ===========================================================================
22593
- /**
22594
- * Aplica filtros por defecto a las queries.
22595
- * Override este método para agregar filtros globales (ej: excluir soft-deleted).
22596
- */
22597
- applyDefaultFilters(options) {
22598
- if (!this.options.softDelete) {
22599
- return options ?? {};
22600
- }
22601
- // Excluir documentos soft-deleted por defecto
22602
- const whereClause = { field: 'deletedAt', operator: '==', value: null };
22603
- return {
22604
- ...options,
22605
- where: [...(options?.where ?? []), whereClause],
22606
- };
22607
- }
22608
- // ===========================================================================
22609
- // UTILIDADES
22610
- // ===========================================================================
22611
- /**
22612
- * Genera un nuevo ID sin crear el documento.
22613
- */
22614
- generateId() {
22615
- return this.firestore.generateId(this.collectionPath);
22616
- }
22617
- /**
22618
- * Obtiene la ruta de la colección.
22619
- */
22620
- getPath() {
22621
- return this.collectionPath;
22622
- }
22623
- }
22624
-
22625
22361
  /**
22626
22362
  * Query Builder
22627
22363
  *
@@ -23877,5 +23613,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
23877
23613
  * Generated bundle index. Do not edit.
23878
23614
  */
23879
23615
 
23880
- export { APP_IDS, ARTICLE_SPACING, AccordionComponent, ActionHeaderComponent, ActionType, AlertBoxComponent, ArticleBuilder, ArticleComponent, AvatarComponent, BannerComponent, BaseDefault, BoxComponent, BreadcrumbComponent, ButtonComponent, ButtonGroupComponent, COMMON_COUNTRY_CODES, COMMON_CURRENCIES, CURRENCY_INFO, CardComponent, CardSection, CardType, CardsCarouselComponent, CheckInputComponent, ChipGroupComponent, ClearDefault, ClearDefaultBlock, ClearDefaultFull, ClearDefaultRound, ClearDefaultRoundBlock, ClearDefaultRoundFull, CodeDisplayComponent, CommandDisplayComponent, CommentComponent, CommentInputComponent, CommentSectionComponent, CompanyFooterComponent, ComponentStates, ConfirmationDialogService, ContentLoaderComponent, CountdownComponent, CurrencyInputComponent, DEFAULT_CANCEL_BUTTON, DEFAULT_CONFIRM_BUTTON, DEFAULT_COUNTDOWN_LABELS, DEFAULT_COUNTDOWN_LABELS_EN, DEFAULT_EMPTY_STATE, DEFAULT_LEGEND_LABELS, DEFAULT_MODAL_CANCEL_BUTTON, DEFAULT_MODAL_CONFIRM_BUTTON, DEFAULT_PAGE_SIZE_OPTIONS, DEFAULT_PAYMENT_STATUS_COLORS, DEFAULT_PAYMENT_STATUS_LABELS, DEFAULT_PLATFORMS, DEFAULT_STATUS_COLORS, DEFAULT_STATUS_LABELS, DEFAULT_WINNER_LABELS, DataTableComponent, DateInputComponent, DateRangeInputComponent, DisplayComponent, DividerComponent, DownloadService, EmailInputComponent, ExpandableTextComponent, FIREBASE_PROJECTS, FabComponent, FileInputComponent, FirebaseService, FirestoreCollection, FirestoreService, FooterComponent, FooterLinksComponent, FormComponent, FormFooterComponent, FunHeaderComponent, GlowCardComponent, HeaderComponent, HintComponent, HorizontalScrollComponent, HourInputComponent, HrefComponent, Icon, IconComponent, IconService, ImageComponent, InAppBrowserService, InfoComponent, InputType, ItemListComponent, LanguageSelectorComponent, LayeredCardComponent, LayoutComponent, LinkComponent, LinkProcessorService, LinksAccordionComponent, LinksCakeComponent, LocalStorageService, LocaleService, MODAL_SIZES, MOTION, MenuComponent, MessagingService, ModalService, MultiSelectSearchComponent, NavigationService, NoContentComponent, NotesBoxComponent, NumberFromToComponent, NumberInputComponent, NumberStepperComponent, OutlineDefault, OutlineDefaultBlock, OutlineDefaultFull, OutlineDefaultRound, OutlineDefaultRoundBlock, OutlineDefaultRoundFull, PLATFORM_CONFIGS, PageContentComponent, PageTemplateComponent, PageWrapperComponent, PaginationComponent, ParticipantCardComponent, PasswordInputComponent, PhoneInputComponent, PillComponent, PinInputComponent, PlainCodeBoxComponent, PopoverSelectorComponent, PriceTagComponent, PrimarySolidBlockButton, PrimarySolidBlockHrefButton, PrimarySolidBlockIconButton, PrimarySolidBlockIconHrefButton, PrimarySolidDefaultRoundButton, PrimarySolidDefaultRoundHrefButton, PrimarySolidDefaultRoundIconButton, PrimarySolidDefaultRoundIconHrefButton, PrimarySolidFullButton, PrimarySolidFullHrefButton, PrimarySolidFullIconButton, PrimarySolidFullIconHrefButton, PrimarySolidLargeRoundButton, PrimarySolidLargeRoundHrefButton, PrimarySolidLargeRoundIconButton, PrimarySolidLargeRoundIconHrefButton, PrimarySolidSmallRoundButton, PrimarySolidSmallRoundHrefButton, PrimarySolidSmallRoundIconButton, PrimarySolidSmallRoundIconHrefButton, ProcessLinksPipe, ProgressBarComponent, ProgressRingComponent, ProgressStatusComponent, PrompterComponent, QR_PRESETS, QrCodeComponent, QrGeneratorService, QueryBuilder, QuoteBoxComponent, RadioInputComponent, RaffleStatusCardComponent, RangeInputComponent, RatingComponent, RecapCardComponent, RightsFooterComponent, SHARED_EMULATOR_CONFIG, SKELETON_PRESETS, SearchSelectorComponent, SearchbarComponent, SecondarySolidBlockButton, SecondarySolidBlockHrefButton, SecondarySolidBlockIconButton, SecondarySolidBlockIconHrefButton, SecondarySolidDefaultRoundButton, SecondarySolidDefaultRoundHrefButton, SecondarySolidDefaultRoundIconButton, SecondarySolidDefaultRoundIconHrefButton, SecondarySolidFullButton, SecondarySolidFullHrefButton, SecondarySolidFullIconButton, SecondarySolidFullIconHrefButton, SecondarySolidLargeRoundButton, SecondarySolidLargeRoundHrefButton, SecondarySolidLargeRoundIconButton, SecondarySolidLargeRoundIconHrefButton, SecondarySolidSmallRoundButton, SecondarySolidSmallRoundHrefButton, SecondarySolidSmallRoundIconButton, SecondarySolidSmallRoundIconHrefButton, SegmentControlComponent, SelectSearchComponent, ShareButtonsComponent, SimpleComponent, SkeletonComponent, SolidBlockButton, SolidDefault, SolidDefaultBlock, SolidDefaultButton, SolidDefaultFull, SolidDefaultRound, SolidDefaultRoundBlock, SolidDefaultRoundButton, SolidDefaultRoundFull, SolidFullButton, SolidLargeButton, SolidLargeRoundButton, SolidSmallButton, SolidSmallRoundButton, StatsCardComponent, StepperComponent, StorageService, SwipeCarouselComponent, TabbedContentComponent, TabsComponent, TestimonialCardComponent, TestimonialCarouselComponent, TextComponent, TextInputComponent, TextareaInputComponent, ThemeOption, ThemeService, TicketGridComponent, TimelineComponent, TitleBlockComponent, TitleComponent, ToastService, ToggleInputComponent, ToolbarActionType, ToolbarComponent, VALTECH_FIREBASE_CONFIG, WinnerDisplayComponent, WizardComponent, WizardFooterComponent, applyDefaultValueToControl, buildPath, collections, createFirebaseConfig, createGlowCardProps, createNumberFromToField, createTitleProps, extractPathParams, getCollectionPath, getDocumentId, goToTop, hasEmulators, isAtEnd, isCollectionPath, isDocumentPath, isEmulatorMode, isValidPath, joinPath, maxLength, provideValtechFirebase, query, replaceSpecialChars, resolveColor, resolveInputDefaultValue, storagePaths };
23616
+ export { APP_IDS, ARTICLE_SPACING, AccordionComponent, ActionHeaderComponent, ActionType, AlertBoxComponent, ArticleBuilder, ArticleComponent, AvatarComponent, BannerComponent, BaseDefault, BoxComponent, BreadcrumbComponent, ButtonComponent, ButtonGroupComponent, COMMON_COUNTRY_CODES, COMMON_CURRENCIES, CURRENCY_INFO, CardComponent, CardSection, CardType, CardsCarouselComponent, CheckInputComponent, ChipGroupComponent, ClearDefault, ClearDefaultBlock, ClearDefaultFull, ClearDefaultRound, ClearDefaultRoundBlock, ClearDefaultRoundFull, CodeDisplayComponent, CommandDisplayComponent, CommentComponent, CommentInputComponent, CommentSectionComponent, CompanyFooterComponent, ComponentStates, ConfirmationDialogService, ContentLoaderComponent, CountdownComponent, CurrencyInputComponent, DEFAULT_CANCEL_BUTTON, DEFAULT_CONFIRM_BUTTON, DEFAULT_COUNTDOWN_LABELS, DEFAULT_COUNTDOWN_LABELS_EN, DEFAULT_EMPTY_STATE, DEFAULT_LEGEND_LABELS, DEFAULT_MODAL_CANCEL_BUTTON, DEFAULT_MODAL_CONFIRM_BUTTON, DEFAULT_PAGE_SIZE_OPTIONS, DEFAULT_PAYMENT_STATUS_COLORS, DEFAULT_PAYMENT_STATUS_LABELS, DEFAULT_PLATFORMS, DEFAULT_STATUS_COLORS, DEFAULT_STATUS_LABELS, DEFAULT_WINNER_LABELS, DataTableComponent, DateInputComponent, DateRangeInputComponent, DisplayComponent, DividerComponent, DownloadService, EmailInputComponent, ExpandableTextComponent, FIREBASE_PROJECTS, FabComponent, FileInputComponent, FirebaseService, FirestoreService, FooterComponent, FooterLinksComponent, FormComponent, FormFooterComponent, FunHeaderComponent, GlowCardComponent, HeaderComponent, HintComponent, HorizontalScrollComponent, HourInputComponent, HrefComponent, Icon, IconComponent, IconService, ImageComponent, InAppBrowserService, InfoComponent, InputType, ItemListComponent, LanguageSelectorComponent, LayeredCardComponent, LayoutComponent, LinkComponent, LinkProcessorService, LinksAccordionComponent, LinksCakeComponent, LocalStorageService, LocaleService, MODAL_SIZES, MOTION, MenuComponent, MessagingService, ModalService, MultiSelectSearchComponent, NavigationService, NoContentComponent, NotesBoxComponent, NumberFromToComponent, NumberInputComponent, NumberStepperComponent, OutlineDefault, OutlineDefaultBlock, OutlineDefaultFull, OutlineDefaultRound, OutlineDefaultRoundBlock, OutlineDefaultRoundFull, PLATFORM_CONFIGS, PageContentComponent, PageTemplateComponent, PageWrapperComponent, PaginationComponent, ParticipantCardComponent, PasswordInputComponent, PhoneInputComponent, PillComponent, PinInputComponent, PlainCodeBoxComponent, PopoverSelectorComponent, PriceTagComponent, PrimarySolidBlockButton, PrimarySolidBlockHrefButton, PrimarySolidBlockIconButton, PrimarySolidBlockIconHrefButton, PrimarySolidDefaultRoundButton, PrimarySolidDefaultRoundHrefButton, PrimarySolidDefaultRoundIconButton, PrimarySolidDefaultRoundIconHrefButton, PrimarySolidFullButton, PrimarySolidFullHrefButton, PrimarySolidFullIconButton, PrimarySolidFullIconHrefButton, PrimarySolidLargeRoundButton, PrimarySolidLargeRoundHrefButton, PrimarySolidLargeRoundIconButton, PrimarySolidLargeRoundIconHrefButton, PrimarySolidSmallRoundButton, PrimarySolidSmallRoundHrefButton, PrimarySolidSmallRoundIconButton, PrimarySolidSmallRoundIconHrefButton, ProcessLinksPipe, ProgressBarComponent, ProgressRingComponent, ProgressStatusComponent, PrompterComponent, QR_PRESETS, QrCodeComponent, QrGeneratorService, QueryBuilder, QuoteBoxComponent, RadioInputComponent, RaffleStatusCardComponent, RangeInputComponent, RatingComponent, RecapCardComponent, RightsFooterComponent, SHARED_EMULATOR_CONFIG, SKELETON_PRESETS, SearchSelectorComponent, SearchbarComponent, SecondarySolidBlockButton, SecondarySolidBlockHrefButton, SecondarySolidBlockIconButton, SecondarySolidBlockIconHrefButton, SecondarySolidDefaultRoundButton, SecondarySolidDefaultRoundHrefButton, SecondarySolidDefaultRoundIconButton, SecondarySolidDefaultRoundIconHrefButton, SecondarySolidFullButton, SecondarySolidFullHrefButton, SecondarySolidFullIconButton, SecondarySolidFullIconHrefButton, SecondarySolidLargeRoundButton, SecondarySolidLargeRoundHrefButton, SecondarySolidLargeRoundIconButton, SecondarySolidLargeRoundIconHrefButton, SecondarySolidSmallRoundButton, SecondarySolidSmallRoundHrefButton, SecondarySolidSmallRoundIconButton, SecondarySolidSmallRoundIconHrefButton, SegmentControlComponent, SelectSearchComponent, ShareButtonsComponent, SimpleComponent, SkeletonComponent, SolidBlockButton, SolidDefault, SolidDefaultBlock, SolidDefaultButton, SolidDefaultFull, SolidDefaultRound, SolidDefaultRoundBlock, SolidDefaultRoundButton, SolidDefaultRoundFull, SolidFullButton, SolidLargeButton, SolidLargeRoundButton, SolidSmallButton, SolidSmallRoundButton, StatsCardComponent, StepperComponent, StorageService, SwipeCarouselComponent, TabbedContentComponent, TabsComponent, TestimonialCardComponent, TestimonialCarouselComponent, TextComponent, TextInputComponent, TextareaInputComponent, ThemeOption, ThemeService, TicketGridComponent, TimelineComponent, TitleBlockComponent, TitleComponent, ToastService, ToggleInputComponent, ToolbarActionType, ToolbarComponent, VALTECH_FIREBASE_CONFIG, WinnerDisplayComponent, WizardComponent, WizardFooterComponent, applyDefaultValueToControl, buildPath, collections, createFirebaseConfig, createGlowCardProps, createNumberFromToField, createTitleProps, extractPathParams, getCollectionPath, getDocumentId, goToTop, hasEmulators, isAtEnd, isCollectionPath, isDocumentPath, isEmulatorMode, isValidPath, joinPath, maxLength, provideValtechFirebase, query, replaceSpecialChars, resolveColor, resolveInputDefaultValue, storagePaths };
23881
23617
  //# sourceMappingURL=valtech-components.mjs.map