@devschile/chucao 1.7.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (165) hide show
  1. package/README.md +14 -12
  2. package/dist/chucao/chucao.css +1 -1
  3. package/dist/chucao/chucao.esm.js +1 -1
  4. package/dist/chucao/index.esm.js +1 -1
  5. package/dist/chucao/index.esm.js.map +1 -1
  6. package/dist/chucao/p-10658dc9.entry.js +2 -0
  7. package/dist/chucao/p-10658dc9.entry.js.map +1 -0
  8. package/dist/chucao/p-19dde4f9.entry.js +2 -0
  9. package/dist/chucao/p-19dde4f9.entry.js.map +1 -0
  10. package/dist/chucao/p-2e20c7a1.entry.js +2 -0
  11. package/dist/chucao/p-2e20c7a1.entry.js.map +1 -0
  12. package/dist/chucao/p-66dce533.entry.js +2 -0
  13. package/dist/chucao/p-66dce533.entry.js.map +1 -0
  14. package/dist/chucao/p-75184fe1.entry.js +2 -0
  15. package/dist/chucao/p-75184fe1.entry.js.map +1 -0
  16. package/dist/chucao/p-96c852f5.entry.js +2 -0
  17. package/dist/chucao/p-96c852f5.entry.js.map +1 -0
  18. package/dist/chucao/p-BaKXvAYc.js +3 -0
  19. package/dist/chucao/p-BaKXvAYc.js.map +1 -0
  20. package/dist/chucao/{p-fe8e9537.entry.js → p-a0ec231a.entry.js} +2 -2
  21. package/dist/chucao/{p-488c7838.entry.js → p-e48912c7.entry.js} +2 -2
  22. package/dist/chucao/{p-20492b73.entry.js → p-f04d2f75.entry.js} +2 -2
  23. package/dist/chucao/{p-053d58a4.entry.js → p-f62e1da2.entry.js} +2 -2
  24. package/dist/cjs/ch-accordion.cjs.entry.js +1 -1
  25. package/dist/cjs/ch-alert_8.cjs.entry.js +185 -8
  26. package/dist/cjs/ch-alert_8.cjs.entry.js.map +1 -1
  27. package/dist/cjs/ch-checkbox.cjs.entry.js +62 -3
  28. package/dist/cjs/ch-checkbox.cjs.entry.js.map +1 -1
  29. package/dist/cjs/ch-divider.cjs.entry.js +1 -1
  30. package/dist/cjs/ch-link.cjs.entry.js +1 -1
  31. package/dist/cjs/ch-modal.cjs.entry.js +167 -0
  32. package/dist/cjs/ch-modal.cjs.entry.js.map +1 -0
  33. package/dist/cjs/ch-radio.cjs.entry.js +62 -3
  34. package/dist/cjs/ch-radio.cjs.entry.js.map +1 -1
  35. package/dist/cjs/ch-tabs.cjs.entry.js +1 -1
  36. package/dist/cjs/ch-textarea.cjs.entry.js +62 -3
  37. package/dist/cjs/ch-textarea.cjs.entry.js.map +1 -1
  38. package/dist/cjs/ch-tooltip.cjs.entry.js +82 -0
  39. package/dist/cjs/ch-tooltip.cjs.entry.js.map +1 -0
  40. package/dist/cjs/chucao.cjs.js +2 -2
  41. package/dist/cjs/{index-ls4U227d.js → index-C9Abf0td.js} +204 -9
  42. package/dist/cjs/index-C9Abf0td.js.map +1 -0
  43. package/dist/cjs/index.cjs.js +5 -0
  44. package/dist/cjs/index.cjs.js.map +1 -1
  45. package/dist/cjs/loader.cjs.js +2 -2
  46. package/dist/collection/collection-manifest.json +2 -0
  47. package/dist/collection/components/ch-card/ch-card.js +1 -1
  48. package/dist/collection/components/ch-checkbox/ch-checkbox.css +10 -0
  49. package/dist/collection/components/ch-checkbox/ch-checkbox.js +64 -4
  50. package/dist/collection/components/ch-checkbox/ch-checkbox.js.map +1 -1
  51. package/dist/collection/components/ch-input/ch-input.css +11 -0
  52. package/dist/collection/components/ch-input/ch-input.js +64 -4
  53. package/dist/collection/components/ch-input/ch-input.js.map +1 -1
  54. package/dist/collection/components/ch-modal/ch-modal.css +69 -0
  55. package/dist/collection/components/ch-modal/ch-modal.js +278 -0
  56. package/dist/collection/components/ch-modal/ch-modal.js.map +1 -0
  57. package/dist/collection/components/ch-radio/ch-radio.css +10 -0
  58. package/dist/collection/components/ch-radio/ch-radio.js +64 -4
  59. package/dist/collection/components/ch-radio/ch-radio.js.map +1 -1
  60. package/dist/collection/components/ch-select/ch-select.css +11 -0
  61. package/dist/collection/components/ch-select/ch-select.js +64 -4
  62. package/dist/collection/components/ch-select/ch-select.js.map +1 -1
  63. package/dist/collection/components/ch-switch/ch-switch.css +10 -0
  64. package/dist/collection/components/ch-switch/ch-switch.js +64 -4
  65. package/dist/collection/components/ch-switch/ch-switch.js.map +1 -1
  66. package/dist/collection/components/ch-textarea/ch-textarea.css +11 -0
  67. package/dist/collection/components/ch-textarea/ch-textarea.js +64 -4
  68. package/dist/collection/components/ch-textarea/ch-textarea.js.map +1 -1
  69. package/dist/collection/components/ch-tooltip/ch-tooltip.css +100 -0
  70. package/dist/collection/components/ch-tooltip/ch-tooltip.js +168 -0
  71. package/dist/collection/components/ch-tooltip/ch-tooltip.js.map +1 -0
  72. package/dist/collection/tokens/tokens.js +4 -0
  73. package/dist/collection/tokens/tokens.js.map +1 -1
  74. package/dist/collection/tokens/types.js.map +1 -1
  75. package/dist/components/ch-accordion.js +1 -1
  76. package/dist/components/ch-alert.js +1 -1
  77. package/dist/components/ch-badge.js +1 -1
  78. package/dist/components/ch-button.js +1 -1
  79. package/dist/components/ch-card.js +1 -1
  80. package/dist/components/ch-checkbox.js +1 -1
  81. package/dist/components/ch-checkbox.js.map +1 -1
  82. package/dist/components/ch-divider.js +1 -1
  83. package/dist/components/ch-input.js +1 -1
  84. package/dist/components/ch-input.js.map +1 -1
  85. package/dist/components/ch-link.js +1 -1
  86. package/dist/components/ch-modal.d.ts +11 -0
  87. package/dist/components/ch-modal.js +2 -0
  88. package/dist/components/ch-modal.js.map +1 -0
  89. package/dist/components/ch-radio.js +1 -1
  90. package/dist/components/ch-radio.js.map +1 -1
  91. package/dist/components/ch-select.js +1 -1
  92. package/dist/components/ch-select.js.map +1 -1
  93. package/dist/components/ch-spinner.js +1 -1
  94. package/dist/components/ch-switch.js +1 -1
  95. package/dist/components/ch-switch.js.map +1 -1
  96. package/dist/components/ch-tabs.js +1 -1
  97. package/dist/components/ch-textarea.js +1 -1
  98. package/dist/components/ch-textarea.js.map +1 -1
  99. package/dist/components/ch-tooltip.d.ts +11 -0
  100. package/dist/components/ch-tooltip.js +2 -0
  101. package/dist/components/ch-tooltip.js.map +1 -0
  102. package/dist/components/index.js +1 -1
  103. package/dist/components/index.js.map +1 -1
  104. package/dist/components/p-DL-bL54o.js +2 -0
  105. package/dist/components/p-DL-bL54o.js.map +1 -0
  106. package/dist/esm/ch-accordion.entry.js +1 -1
  107. package/dist/esm/ch-alert_8.entry.js +185 -8
  108. package/dist/esm/ch-alert_8.entry.js.map +1 -1
  109. package/dist/esm/ch-checkbox.entry.js +62 -3
  110. package/dist/esm/ch-checkbox.entry.js.map +1 -1
  111. package/dist/esm/ch-divider.entry.js +1 -1
  112. package/dist/esm/ch-link.entry.js +1 -1
  113. package/dist/esm/ch-modal.entry.js +165 -0
  114. package/dist/esm/ch-modal.entry.js.map +1 -0
  115. package/dist/esm/ch-radio.entry.js +62 -3
  116. package/dist/esm/ch-radio.entry.js.map +1 -1
  117. package/dist/esm/ch-tabs.entry.js +1 -1
  118. package/dist/esm/ch-textarea.entry.js +62 -3
  119. package/dist/esm/ch-textarea.entry.js.map +1 -1
  120. package/dist/esm/ch-tooltip.entry.js +80 -0
  121. package/dist/esm/ch-tooltip.entry.js.map +1 -0
  122. package/dist/esm/chucao.js +3 -3
  123. package/dist/esm/{index-pfWAsOzE.js → index-BaKXvAYc.js} +204 -10
  124. package/dist/esm/index-BaKXvAYc.js.map +1 -0
  125. package/dist/esm/index.js +5 -1
  126. package/dist/esm/index.js.map +1 -1
  127. package/dist/esm/loader.js +3 -3
  128. package/dist/types/components/ch-checkbox/ch-checkbox.d.ts +9 -0
  129. package/dist/types/components/ch-input/ch-input.d.ts +9 -0
  130. package/dist/types/components/ch-modal/ch-modal.d.ts +67 -0
  131. package/dist/types/components/ch-radio/ch-radio.d.ts +9 -0
  132. package/dist/types/components/ch-select/ch-select.d.ts +9 -0
  133. package/dist/types/components/ch-switch/ch-switch.d.ts +9 -0
  134. package/dist/types/components/ch-textarea/ch-textarea.d.ts +9 -0
  135. package/dist/types/components/ch-tooltip/ch-tooltip.d.ts +47 -0
  136. package/dist/types/components.d.ts +240 -0
  137. package/dist/types/tokens/tokens.d.ts +4 -0
  138. package/dist/types/tokens/types.d.ts +1 -1
  139. package/dist-react/components.d.ts +10 -1
  140. package/dist-react/components.js +21 -0
  141. package/dist-react/components.ts +31 -1
  142. package/dist-vue/index.d.ts +2 -0
  143. package/dist-vue/index.js +15 -0
  144. package/dist-vue/index.ts +19 -0
  145. package/hydrate/index.js +836 -61
  146. package/hydrate/index.mjs +836 -61
  147. package/package.json +4 -1
  148. package/dist/chucao/p-0305f2eb.entry.js +0 -2
  149. package/dist/chucao/p-0305f2eb.entry.js.map +0 -1
  150. package/dist/chucao/p-9a614e82.entry.js +0 -2
  151. package/dist/chucao/p-9a614e82.entry.js.map +0 -1
  152. package/dist/chucao/p-ad3206a2.entry.js +0 -2
  153. package/dist/chucao/p-ad3206a2.entry.js.map +0 -1
  154. package/dist/chucao/p-c598f978.entry.js +0 -2
  155. package/dist/chucao/p-c598f978.entry.js.map +0 -1
  156. package/dist/chucao/p-pfWAsOzE.js +0 -3
  157. package/dist/chucao/p-pfWAsOzE.js.map +0 -1
  158. package/dist/cjs/index-ls4U227d.js.map +0 -1
  159. package/dist/components/p-ONE3uKkF.js +0 -2
  160. package/dist/components/p-ONE3uKkF.js.map +0 -1
  161. package/dist/esm/index-pfWAsOzE.js.map +0 -1
  162. /package/dist/chucao/{p-fe8e9537.entry.js.map → p-a0ec231a.entry.js.map} +0 -0
  163. /package/dist/chucao/{p-488c7838.entry.js.map → p-e48912c7.entry.js.map} +0 -0
  164. /package/dist/chucao/{p-20492b73.entry.js.map → p-f04d2f75.entry.js.map} +0 -0
  165. /package/dist/chucao/{p-053d58a4.entry.js.map → p-f62e1da2.entry.js.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"ch-textarea.entry.js","sources":["src/components/ch-textarea/ch-textarea.css?tag=ch-textarea&encapsulation=shadow","src/components/ch-textarea/ch-textarea.tsx"],"sourcesContent":[":host {\n display: inline-block;\n width: 100%;\n}\n\n.label {\n display: block;\n margin-bottom: var(--spacing-sm);\n font-size: var(--typography-size-sm);\n font-weight: var(--typography-weight-semibold);\n color: var(--text);\n}\n\n.textarea {\n box-sizing: border-box;\n width: 100%;\n min-height: var(--spacing-6xl);\n padding: var(--spacing-xl) var(--spacing-3xl);\n border-radius: var(--radius);\n border: var(--border-width) solid var(--border);\n background: var(--surface);\n color: var(--text);\n backdrop-filter: blur(var(--effect-blur));\n font-family: inherit;\n font-size: inherit;\n line-height: var(--spacing-5xl);\n resize: vertical;\n transition:\n border-color var(--duration-normal) var(--easing-default),\n box-shadow var(--duration-normal) var(--easing-default);\n}\n\n.textarea::placeholder {\n color: var(--text-muted);\n}\n\n.textarea:focus {\n border-color: var(--accent);\n box-shadow: var(--shadow-focus-ring);\n outline: none;\n}\n\n.textarea--invalid {\n border-color: var(--color-status-warning);\n}\n\n.textarea--invalid:focus {\n border-color: var(--color-status-warning);\n box-shadow: 0 0 0 3px var(--color-status-warning-background);\n}\n\n.textarea:disabled {\n opacity: var(--opacity-disabled);\n cursor: not-allowed;\n}\n\n.hint,\n.error {\n margin: var(--spacing-sm) 0 0;\n font-size: var(--typography-size-sm);\n color: var(--text-muted);\n}\n\n.error {\n color: var(--color-status-warning);\n}\n","import { Component, Event, type EventEmitter, Host, Prop, h } from '@stencil/core';\n\nlet textareaIds = 0;\n\nconst DEFAULT_ROWS = 4;\n\n@Component({\n tag: 'ch-textarea',\n styleUrl: 'ch-textarea.css',\n shadow: true,\n})\nexport class ChTextarea {\n private readonly textareaId = `ch-textarea-${++textareaIds}`;\n private readonly hintId = `${this.textareaId}-hint`;\n private readonly errorId = `${this.textareaId}-error`;\n\n /**\n * Visible label rendered above the textarea and associated with it via\n * `for`/`id`, so assistive technology announces the textarea's purpose.\n */\n @Prop() label?: string;\n\n /**\n * The value of the textarea.\n */\n @Prop({ mutable: true }) value = '';\n\n /**\n * Placeholder text shown when the textarea is empty.\n */\n @Prop() placeholder?: string;\n\n /**\n * The number of visible rows of the textarea.\n */\n @Prop() rows = DEFAULT_ROWS;\n\n /**\n * The name of the textarea, submitted with form data.\n */\n @Prop() name?: string;\n\n /**\n * Whether the textarea is disabled.\n */\n @Prop() disabled = false;\n\n /**\n * Whether the textarea is required.\n */\n @Prop() required = false;\n\n /**\n * Helper text rendered below the textarea, associated via `aria-describedby`.\n * Replaced by `errorMessage` when the textarea is invalid.\n */\n @Prop() hint?: string;\n\n /**\n * Error message rendered below the textarea when it is invalid.\n */\n @Prop() errorMessage?: string;\n\n /**\n * Whether the textarea is in an invalid state; toggles `aria-invalid` and error styling.\n */\n @Prop() invalid = false;\n\n /**\n * Emitted on every keystroke, with the current textarea value.\n */\n @Event() chInput: EventEmitter<string>;\n\n /**\n * Emitted when the textarea value is committed (on native `change`).\n */\n @Event() chChange: EventEmitter<string>;\n\n private handleInput = (ev: InputEvent) => {\n this.value = (ev.target as HTMLTextAreaElement).value;\n this.chInput.emit(this.value);\n };\n\n private handleChange = (ev: Event) => {\n this.value = (ev.target as HTMLTextAreaElement).value;\n this.chChange.emit(this.value);\n };\n\n private get describedBy(): string | undefined {\n if (this.invalid && this.errorMessage) {\n return this.errorId;\n }\n if (this.hint) {\n return this.hintId;\n }\n return undefined;\n }\n\n render() {\n return (\n <Host>\n {this.label && (\n <label class=\"label\" htmlFor={this.textareaId}>\n {this.label}\n </label>\n )}\n <textarea\n id={this.label ? this.textareaId : undefined}\n class={{ 'textarea': true, 'textarea--invalid': this.invalid }}\n rows={this.rows}\n name={this.name}\n placeholder={this.placeholder}\n disabled={this.disabled}\n required={this.required}\n value={this.value}\n aria-invalid={this.invalid ? 'true' : undefined}\n aria-describedby={this.describedBy}\n onInput={this.handleInput}\n onChange={this.handleChange}\n ></textarea>\n {this.hint && !(this.invalid && this.errorMessage) && (\n <p class=\"hint\" id={this.hintId}>\n {this.hint}\n </p>\n )}\n {this.invalid && this.errorMessage && (\n <p class=\"error\" id={this.errorId}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,EAAA,EAC5B,IAAI,CAAC,IAAI,CACR,CACL,EACA,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,YAAY,KAChC,CAAA,CAAA,GAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAG,KAAK,EAAC,OAAO,EAAC,EAAE,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,EAAC,OAAO,EAAA,EAC5C,IAAI,CAAC,YAAY,CAChB,CACL,CACI;;;;;;;"}
1
+ {"version":3,"file":"ch-textarea.entry.js","sources":["src/components/ch-textarea/ch-textarea.css?tag=ch-textarea&encapsulation=shadow","src/components/ch-textarea/ch-textarea.tsx"],"sourcesContent":[":host {\n display: inline-block;\n width: 100%;\n}\n\n.label {\n display: block;\n margin-bottom: var(--spacing-sm);\n font-size: var(--typography-size-sm);\n font-weight: var(--typography-weight-semibold);\n color: var(--text);\n}\n\n.textarea {\n box-sizing: border-box;\n width: 100%;\n min-height: var(--spacing-6xl);\n padding: var(--spacing-xl) var(--spacing-3xl);\n border-radius: var(--radius);\n border: var(--border-width) solid var(--border);\n background: var(--surface);\n color: var(--text);\n backdrop-filter: blur(var(--effect-blur));\n font-family: inherit;\n font-size: inherit;\n line-height: var(--spacing-5xl);\n resize: vertical;\n transition:\n border-color var(--duration-normal) var(--easing-default),\n box-shadow var(--duration-normal) var(--easing-default);\n}\n\n.textarea::placeholder {\n color: var(--text-muted);\n}\n\n.textarea:focus {\n border-color: var(--accent);\n box-shadow: var(--shadow-focus-ring);\n outline: none;\n}\n\n.textarea--invalid {\n border-color: var(--color-status-warning);\n}\n\n.textarea--invalid:focus {\n border-color: var(--color-status-warning);\n box-shadow: 0 0 0 3px var(--color-status-warning-background);\n}\n\n:host([data-touched]:invalid) .textarea,\n:host(:user-invalid) .textarea {\n border-color: var(--color-status-warning);\n}\n\n:host([data-touched]:invalid) .textarea:focus,\n:host(:user-invalid) .textarea:focus {\n border-color: var(--color-status-warning);\n box-shadow: 0 0 0 3px var(--color-status-warning-background);\n}\n\n.textarea:disabled {\n opacity: var(--opacity-disabled);\n cursor: not-allowed;\n}\n\n.hint,\n.error {\n margin: var(--spacing-sm) 0 0;\n font-size: var(--typography-size-sm);\n color: var(--text-muted);\n}\n\n.error {\n color: var(--color-status-warning);\n}\n","import { AttachInternals, Component, Element, Event, type EventEmitter, Host, Prop, State, Watch, h } from '@stencil/core';\n\nlet textareaIds = 0;\n\nconst DEFAULT_ROWS = 4;\n\n@Component({\n tag: 'ch-textarea',\n styleUrl: 'ch-textarea.css',\n shadow: true,\n formAssociated: true,\n})\nexport class ChTextarea {\n private readonly textareaId = `ch-textarea-${++textareaIds}`;\n private readonly hintId = `${this.textareaId}-hint`;\n private readonly errorId = `${this.textareaId}-error`;\n private initialValue = '';\n\n @AttachInternals() internals!: ElementInternals;\n @State() formDisabled = false;\n @Element() private host!: HTMLElement;\n\n /**\n * Visible label rendered above the textarea and associated with it via\n * `for`/`id`, so assistive technology announces the textarea's purpose.\n */\n @Prop() label?: string;\n\n /**\n * The value of the textarea.\n */\n @Prop({ mutable: true }) value = '';\n\n /**\n * Placeholder text shown when the textarea is empty.\n */\n @Prop() placeholder?: string;\n\n /**\n * The number of visible rows of the textarea.\n */\n @Prop() rows = DEFAULT_ROWS;\n\n /**\n * The name of the textarea, submitted with form data.\n */\n @Prop({ reflect: true }) name?: string;\n\n /**\n * Whether the textarea is disabled.\n */\n @Prop({ reflect: true }) disabled = false;\n\n /**\n * Whether the textarea is required.\n */\n @Prop({ reflect: true }) required = false;\n\n /**\n * Helper text rendered below the textarea, associated via `aria-describedby`.\n * Replaced by `errorMessage` when the textarea is invalid.\n */\n @Prop() hint?: string;\n\n /**\n * Error message rendered below the textarea when it is invalid.\n */\n @Prop() errorMessage?: string;\n\n /**\n * Whether the textarea is in an invalid state; toggles `aria-invalid` and error styling.\n */\n @Prop() invalid = false;\n\n /**\n * Emitted on every keystroke, with the current textarea value.\n */\n @Event() chInput: EventEmitter<string>;\n\n /**\n * Emitted when the textarea value is committed (on native `change`).\n */\n @Event() chChange: EventEmitter<string>;\n\n private handleInput = (ev: InputEvent) => {\n this.value = (ev.target as HTMLTextAreaElement).value;\n this.chInput.emit(this.value);\n };\n\n private handleChange = (ev: Event) => {\n this.value = (ev.target as HTMLTextAreaElement).value;\n this.chChange.emit(this.value);\n };\n\n @Watch('value')\n @Watch('required')\n @Watch('invalid')\n @Watch('errorMessage')\n protected syncForm(): void {\n const internals = this.internals;\n if (typeof internals?.setFormValue !== 'function') {\n return;\n }\n internals.setFormValue(this.value);\n const flags: ValidityStateFlags = {};\n let message: string | undefined;\n if (this.required && this.value === '') {\n flags.valueMissing = true;\n }\n if (this.invalid && this.errorMessage) {\n flags.customError = true;\n }\n message = this.errorMessage ?? (flags.valueMissing ? 'Please fill out this field.' : undefined);\n internals.setValidity(flags, message);\n }\n\n componentDidLoad() {\n this.initialValue = this.value;\n this.syncForm();\n this.host.addEventListener('change', this.markTouched);\n this.host.addEventListener('focusout', this.markTouched);\n this.host.addEventListener('invalid', this.markTouched);\n }\n\n private markTouched = (): void => {\n this.host.setAttribute('data-touched', '');\n };\n\n formResetCallback(): void {\n this.value = this.initialValue;\n }\n\n formDisabledCallback(isDisabled: boolean): void {\n this.formDisabled = isDisabled;\n }\n\n private get describedBy(): string | undefined {\n if (this.invalid && this.errorMessage) {\n return this.errorId;\n }\n if (this.hint) {\n return this.hintId;\n }\n return undefined;\n }\n\n render() {\n return (\n <Host>\n {this.label && (\n <label class=\"label\" htmlFor={this.textareaId}>\n {this.label}\n </label>\n )}\n <textarea\n id={this.label ? this.textareaId : undefined}\n class={{ 'textarea': true, 'textarea--invalid': this.invalid }}\n rows={this.rows}\n name={this.name}\n placeholder={this.placeholder}\n disabled={this.disabled || this.formDisabled}\n required={this.required}\n value={this.value}\n aria-invalid={this.invalid ? 'true' : undefined}\n aria-describedby={this.describedBy}\n onInput={this.handleInput}\n onChange={this.handleChange}\n ></textarea>\n {this.hint && !(this.invalid && this.errorMessage) && (\n <p class=\"hint\" id={this.hintId}>\n {this.hint}\n </p>\n )}\n {this.invalid && this.errorMessage && (\n <p class=\"error\" id={this.errorId} role=\"alert\">\n {this.errorMessage}\n </p>\n )}\n </Host>\n );\n }\n}\n"],"names":[],"mappings":";;AAAA,MAAM,aAAa,GAAG,MAAM,CAAC,8+CAA8+C,CAAC;;ACE5gD,IAAI,WAAW,GAAG,CAAC;AAEnB,MAAM,YAAY,GAAG,CAAC;MAQT,UAAU,GAAA,MAAA;;;;;;;;;;;;;AACJ,IAAA,UAAU,GAAG,CAAA,YAAA,EAAe,EAAE,WAAW,EAAE;AAC3C,IAAA,MAAM,GAAG,CAAA,EAAG,IAAI,CAAC,UAAU,OAAO;AAClC,IAAA,OAAO,GAAG,CAAA,EAAG,IAAI,CAAC,UAAU,QAAQ;IAC7C,YAAY,GAAG,EAAE;AAEN,IAAA,SAAS;IACnB,YAAY,GAAG,KAAK;;AAG7B;;;AAGG;AACK,IAAA,KAAK;AAEb;;AAEG;IACsB,KAAK,GAAG,EAAE;AAEnC;;AAEG;AACK,IAAA,WAAW;AAEnB;;AAEG;IACK,IAAI,GAAG,YAAY;AAE3B;;AAEG;AACsB,IAAA,IAAI;AAE7B;;AAEG;IACsB,QAAQ,GAAG,KAAK;AAEzC;;AAEG;IACsB,QAAQ,GAAG,KAAK;AAEzC;;;AAGG;AACK,IAAA,IAAI;AAEZ;;AAEG;AACK,IAAA,YAAY;AAEpB;;AAEG;IACK,OAAO,GAAG,KAAK;AAEvB;;AAEG;AACM,IAAA,OAAO;AAEhB;;AAEG;AACM,IAAA,QAAQ;AAET,IAAA,WAAW,GAAG,CAAC,EAAc,KAAI;QACvC,IAAI,CAAC,KAAK,GAAI,EAAE,CAAC,MAA8B,CAAC,KAAK;QACrD,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC;AAC/B,KAAC;AAEO,IAAA,YAAY,GAAG,CAAC,EAAS,KAAI;QACnC,IAAI,CAAC,KAAK,GAAI,EAAE,CAAC,MAA8B,CA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,IAAI,CAAC,IAAI,IAAI,EAAE,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,YAAY,CAAC,KAChD,CAAA,CAAA,GAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAG,KAAK,EAAC,MAAM,EAAC,EAAE,EAAE,IAAI,CAAC,MAAM,EAAA,EAC5B,IAAI,CAAC,IAAI,CACR,CACL,EACA,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,YAAY,KAChC,CAAA,CAAA,GAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAG,KAAK,EAAC,OAAO,EAAC,EAAE,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,EAAC,OAAO,EAAA,EAC5C,IAAI,CAAC,YAAY,CAChB,CACL,CACI;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,80 @@
1
+ import { r as registerInstance, a as getElement, h, H as Host } from './index-BaKXvAYc.js';
2
+
3
+ const chTooltipCss = () => `:host{display:inline-block}.anchor{position:relative;display:inline-flex}.bubble{position:absolute;z-index:var(--z-index-dropdown);width:max-content;max-width:16rem;padding:var(--spacing-md) var(--spacing-2xl);border:var(--border-width) solid var(--border);border-radius:var(--radius-sm);background:var(--color-background-base);color:var(--text);font-family:var(--font-body);font-size:var(--typography-size-sm);line-height:1.4;opacity:0;visibility:hidden;transition:opacity var(--duration-fast) var(--easing-default), visibility var(--duration-fast) var(--easing-default)}.bubble--visible{opacity:1;visibility:visible}.bubble::before{content:'';position:absolute}.bubble--top{bottom:100%;left:50%;transform:translateX(-50%);margin-bottom:var(--spacing-md)}.bubble--top::before{top:100%;left:0;right:0;height:var(--spacing-md)}.bubble--bottom{top:100%;left:50%;transform:translateX(-50%);margin-top:var(--spacing-md)}.bubble--bottom::before{bottom:100%;left:0;right:0;height:var(--spacing-md)}.bubble--left{right:100%;top:50%;transform:translateY(-50%);margin-right:var(--spacing-md)}.bubble--left::before{left:100%;top:0;bottom:0;width:var(--spacing-md)}.bubble--right{left:100%;top:50%;transform:translateY(-50%);margin-left:var(--spacing-md)}.bubble--right::before{right:100%;top:0;bottom:0;width:var(--spacing-md)}@media (prefers-reduced-motion: reduce){.bubble{transition:none}}`;
4
+
5
+ let tooltipIds = 0;
6
+ const ChTooltip = class {
7
+ constructor(hostRef) {
8
+ registerInstance(this, hostRef);
9
+ }
10
+ get el() { return getElement(this); }
11
+ fallbackId = `ch-tooltip-${++tooltipIds}`;
12
+ /**
13
+ * Which side of the trigger the bubble is placed on.
14
+ */
15
+ placement = 'top';
16
+ // Hover and focus are tracked apart so that neither cancels the other: a
17
+ // pointer passing over and away must not hide a tooltip whose trigger still
18
+ // holds keyboard focus.
19
+ hovered = false;
20
+ focused = false;
21
+ dismissed = false;
22
+ get visible() {
23
+ return (this.hovered || this.focused) && !this.dismissed;
24
+ }
25
+ componentDidLoad() {
26
+ this.associate();
27
+ }
28
+ handleMouseEnter() {
29
+ this.hovered = true;
30
+ this.dismissed = false;
31
+ }
32
+ handleMouseLeave() {
33
+ this.hovered = false;
34
+ }
35
+ handleFocusIn() {
36
+ this.focused = true;
37
+ this.dismissed = false;
38
+ }
39
+ handleFocusOut() {
40
+ this.focused = false;
41
+ }
42
+ /**
43
+ * Listens on the document because a tooltip opened by hovering leaves focus
44
+ * wherever it was, so a host-scoped handler would never see the key.
45
+ */
46
+ handleKeyDown(event) {
47
+ if (event.key === 'Escape' && this.visible) {
48
+ this.dismissed = true;
49
+ }
50
+ }
51
+ slotted(name) {
52
+ return Array.from(this.el.children).find(child => child.getAttribute('slot') === name);
53
+ }
54
+ /**
55
+ * Points the trigger at the text with `aria-describedby`. Re-run on
56
+ * `slotchange` because a framework re-render can replace the slotted nodes
57
+ * and take the attributes with them.
58
+ */
59
+ associate = () => {
60
+ const trigger = this.slotted('trigger');
61
+ const content = this.slotted('content');
62
+ if (!trigger || !content) {
63
+ return;
64
+ }
65
+ if (!content.id) {
66
+ content.id = this.fallbackId;
67
+ }
68
+ content.setAttribute('role', 'tooltip');
69
+ trigger.setAttribute('aria-describedby', content.id);
70
+ };
71
+ render() {
72
+ return (h(Host, { key: '654d4a12f84c94e014691e911e7c63c6c45b8755' }, h("span", { key: '726269e02fedc37efc39f1561d8b9baf83d6a4cc', class: "anchor" }, h("slot", { key: '876cb19249032d6d1c66f22bd2c255683b6a7f66', name: "trigger", onSlotchange: this.associate }), h("span", { key: '7436eb75b40b33d0b6c8ce194245d4a08a29facb', class: { 'bubble': true, [`bubble--${this.placement}`]: true, 'bubble--visible': this.visible } }, h("slot", { key: '24648cc6078d61803793df011058da9515b466b5', name: "content", onSlotchange: this.associate })))));
73
+ }
74
+ };
75
+ ChTooltip.style = chTooltipCss();
76
+
77
+ export { ChTooltip as ch_tooltip };
78
+ //# sourceMappingURL=ch-tooltip.entry.js.map
79
+
80
+ //# sourceMappingURL=ch-tooltip.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ch-tooltip.entry.js","sources":["src/components/ch-tooltip/ch-tooltip.css?tag=ch-tooltip&encapsulation=shadow","src/components/ch-tooltip/ch-tooltip.tsx"],"sourcesContent":[":host {\n display: inline-block;\n}\n\n.anchor {\n position: relative;\n display: inline-flex;\n}\n\n.bubble {\n position: absolute;\n z-index: var(--z-index-dropdown);\n width: max-content;\n max-width: 16rem;\n padding: var(--spacing-md) var(--spacing-2xl);\n border: var(--border-width) solid var(--border);\n border-radius: var(--radius-sm);\n background: var(--color-background-base);\n color: var(--text);\n font-family: var(--font-body);\n font-size: var(--typography-size-sm);\n line-height: 1.4;\n opacity: 0;\n visibility: hidden;\n transition:\n opacity var(--duration-fast) var(--easing-default),\n visibility var(--duration-fast) var(--easing-default);\n}\n\n.bubble--visible {\n opacity: 1;\n visibility: visible;\n}\n\n.bubble::before {\n content: '';\n position: absolute;\n}\n\n.bubble--top {\n bottom: 100%;\n left: 50%;\n transform: translateX(-50%);\n margin-bottom: var(--spacing-md);\n}\n\n.bubble--top::before {\n top: 100%;\n left: 0;\n right: 0;\n height: var(--spacing-md);\n}\n\n.bubble--bottom {\n top: 100%;\n left: 50%;\n transform: translateX(-50%);\n margin-top: var(--spacing-md);\n}\n\n.bubble--bottom::before {\n bottom: 100%;\n left: 0;\n right: 0;\n height: var(--spacing-md);\n}\n\n.bubble--left {\n right: 100%;\n top: 50%;\n transform: translateY(-50%);\n margin-right: var(--spacing-md);\n}\n\n.bubble--left::before {\n left: 100%;\n top: 0;\n bottom: 0;\n width: var(--spacing-md);\n}\n\n.bubble--right {\n left: 100%;\n top: 50%;\n transform: translateY(-50%);\n margin-left: var(--spacing-md);\n}\n\n.bubble--right::before {\n right: 100%;\n top: 0;\n bottom: 0;\n width: var(--spacing-md);\n}\n\n@media (prefers-reduced-motion: reduce) {\n .bubble {\n transition: none;\n }\n}\n","import { Component, Element, Host, Listen, Prop, State, h } from '@stencil/core';\n\nexport type ChTooltipPlacement = 'top' | 'bottom' | 'left' | 'right';\n\nlet tooltipIds = 0;\n\n/**\n * Short help text shown on hover and on focus.\n *\n * Both the trigger and the text come from the consumer's light DOM through\n * named slots. That is what makes the accessible association work: an\n * `aria-describedby` IDREF only resolves within a single tree, and slotted\n * nodes stay in the document tree even though they render inside the shadow\n * root. Keeping the text in the shadow root instead would need a reference\n * pointing into a shadow tree, which the platform does not allow — element\n * reflection only points outwards, and `referenceTarget` is not available yet.\n *\n * The trigger has to be a natively focusable element (`<button>`, `<a>`,\n * `<input>`). A chucao component such as `ch-button` will not be described,\n * because `aria-*` set on a custom element host does not reach the native\n * element inside it — see the discussion in issue #47.\n */\n@Component({\n tag: 'ch-tooltip',\n styleUrl: 'ch-tooltip.css',\n shadow: true,\n})\nexport class ChTooltip {\n @Element() private el: HTMLElement;\n\n private readonly fallbackId = `ch-tooltip-${++tooltipIds}`;\n\n /**\n * Which side of the trigger the bubble is placed on.\n */\n @Prop() placement: ChTooltipPlacement = 'top';\n\n // Hover and focus are tracked apart so that neither cancels the other: a\n // pointer passing over and away must not hide a tooltip whose trigger still\n // holds keyboard focus.\n @State() hovered = false;\n @State() focused = false;\n @State() dismissed = false;\n\n private get visible() {\n return (this.hovered || this.focused) && !this.dismissed;\n }\n\n componentDidLoad() {\n this.associate();\n }\n\n @Listen('mouseenter')\n handleMouseEnter() {\n this.hovered = true;\n this.dismissed = false;\n }\n\n @Listen('mouseleave')\n handleMouseLeave() {\n this.hovered = false;\n }\n\n @Listen('focusin')\n handleFocusIn() {\n this.focused = true;\n this.dismissed = false;\n }\n\n @Listen('focusout')\n handleFocusOut() {\n this.focused = false;\n }\n\n /**\n * Listens on the document because a tooltip opened by hovering leaves focus\n * wherever it was, so a host-scoped handler would never see the key.\n */\n @Listen('keydown', { target: 'document' })\n handleKeyDown(event: KeyboardEvent) {\n if (event.key === 'Escape' && this.visible) {\n this.dismissed = true;\n }\n }\n\n private slotted(name: string) {\n return Array.from(this.el.children).find(child => child.getAttribute('slot') === name);\n }\n\n /**\n * Points the trigger at the text with `aria-describedby`. Re-run on\n * `slotchange` because a framework re-render can replace the slotted nodes\n * and take the attributes with them.\n */\n private associate = () => {\n const trigger = this.slotted('trigger');\n const content = this.slotted('content');\n if (!trigger || !content) {\n return;\n }\n if (!content.id) {\n content.id = this.fallbackId;\n }\n content.setAttribute('role', 'tooltip');\n trigger.setAttribute('aria-describedby', content.id);\n };\n\n render() {\n return (\n <Host>\n <span class=\"anchor\">\n <slot name=\"trigger\" onSlotchange={this.associate}></slot>\n <span class={{ 'bubble': true, [`bubble--${this.placement}`]: true, 'bubble--visible': this.visible }}>\n <slot name=\"content\" onSlotchange={this.associate}></slot>\n </span>\n </span>\n </Host>\n );\n }\n}\n"],"names":[],"mappings":";;AAAA,MAAM,YAAY,GAAG,MAAM,CAAC,02CAA02C,CAAC;;ACIv4C,IAAI,UAAU,GAAG,CAAC;MAuBL,SAAS,GAAA,MAAA;;;;;AAGH,IAAA,UAAU,GAAG,CAAA,WAAA,EAAc,EAAE,UAAU,EAAE;AAE1D;;AAEG;IACK,SAAS,GAAuB,KAAK;;;;IAKpC,OAAO,GAAG,KAAK;IACf,OAAO,GAA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UAAU;;AAE9B,QAAA,OAAO,CAAC,YAAY,CAAC,MAAM,EAAE,SAAS,CAAC;QACvC,OAAO,CAAC,YAAY,CAAC,kBAAkB,EAAE,OAAO,CAAC,EAAE,CAAC;AACtD,KAAC;IAED,MAAM,GAAA;QACJ,QACE,EAAC,IAAI,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,EACH,CAAA,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAM,KAAK,EAAC,QAAQ,EAAA,EAClB,CAAA,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAM,IAAI,EAAC,SAAS,EAAC,YAAY,EAAE,IAAI,CAAC,SAAS,EAAA,CAAS,EAC1D,CAAA,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAM,KAAK,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAA,QAAA,EAAW,IAAI,CAAC,SAAS,CAAA,CAAE,GAAG,IAAI,EAAE,iBAAiB,EAAE,IAAI,CAAC,OAAO,EAAE,EAAA,EACnG,CAAA,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAM,IAAI,EAAC,SAAS,EAAC,YAAY,EAAE,IAAI,CAAC,SAAS,EAAA,CAAS,CACrD,CACF,CACF;;;;;;;"}
@@ -1,5 +1,5 @@
1
- import { p as promiseResolve, g as globalScripts, b as bootstrapLazy } from './index-pfWAsOzE.js';
2
- export { s as setNonce } from './index-pfWAsOzE.js';
1
+ import { p as promiseResolve, g as globalScripts, b as bootstrapLazy } from './index-BaKXvAYc.js';
2
+ export { s as setNonce } from './index-BaKXvAYc.js';
3
3
 
4
4
  /*
5
5
  Stencil Client Patch Browser v4.44.0 | MIT Licensed | https://stenciljs.com
@@ -16,7 +16,7 @@ var patchBrowser = () => {
16
16
 
17
17
  patchBrowser().then(async (options) => {
18
18
  await globalScripts();
19
- return bootstrapLazy([["ch-alert_8",[[769,"ch-alert",{"variant":[1],"dismissLabel":[1,"dismiss-label"]}],[769,"ch-badge",{"variant":[1]}],[769,"ch-button",{"variant":[1],"disabled":[4],"label":[1]}],[257,"ch-card"],[513,"ch-input",{"label":[1],"type":[1],"value":[1025],"placeholder":[1],"name":[1],"disabled":[4],"required":[4],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4]}],[513,"ch-select",{"label":[1],"options":[16],"value":[1025],"placeholder":[1],"name":[1],"disabled":[4],"required":[4],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4]}],[513,"ch-spinner",{"size":[1],"label":[1]}],[513,"ch-switch",{"label":[1],"name":[1],"value":[1],"checked":[1028],"disabled":[4],"required":[4],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4]}]]],["ch-accordion",[[769,"ch-accordion",{"items":[16],"value":[1025]}]]],["ch-checkbox",[[513,"ch-checkbox",{"label":[1],"name":[1],"value":[1],"checked":[1028],"disabled":[4],"required":[4],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4]}]]],["ch-divider",[[513,"ch-divider",{"orientation":[1]}]]],["ch-link",[[769,"ch-link",{"href":[1],"target":[1],"variant":[1],"disabled":[4]}]]],["ch-radio",[[513,"ch-radio",{"label":[1],"options":[16],"value":[1025],"name":[1],"disabled":[4],"required":[4],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4]}]]],["ch-tabs",[[769,"ch-tabs",{"tabs":[16],"value":[1025],"label":[1]}]]],["ch-textarea",[[513,"ch-textarea",{"label":[1],"value":[1025],"placeholder":[1],"rows":[2],"name":[1],"disabled":[4],"required":[4],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4]}]]]], options);
19
+ return bootstrapLazy([["ch-alert_8",[[769,"ch-alert",{"variant":[1],"dismissLabel":[1,"dismiss-label"]}],[769,"ch-badge",{"variant":[1]}],[769,"ch-button",{"variant":[1],"disabled":[4],"label":[1]}],[257,"ch-card"],[577,"ch-input",{"label":[1],"type":[1],"value":[1025],"placeholder":[1],"name":[513],"disabled":[516],"required":[516],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4],"formDisabled":[32]},null,{"value":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}],[577,"ch-select",{"label":[1],"options":[16],"value":[1025],"placeholder":[1],"name":[513],"disabled":[516],"required":[516],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4],"formDisabled":[32]},null,{"value":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}],[513,"ch-spinner",{"size":[1],"label":[1]}],[577,"ch-switch",{"label":[1],"name":[513],"value":[1],"checked":[1028],"disabled":[516],"required":[516],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4],"formDisabled":[32]},null,{"checked":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}]]],["ch-accordion",[[769,"ch-accordion",{"items":[16],"value":[1025]}]]],["ch-checkbox",[[577,"ch-checkbox",{"label":[1],"name":[513],"value":[1],"checked":[1028],"disabled":[516],"required":[516],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4],"formDisabled":[32]},null,{"checked":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}]]],["ch-divider",[[513,"ch-divider",{"orientation":[1]}]]],["ch-link",[[769,"ch-link",{"href":[1],"target":[1],"variant":[1],"disabled":[4]}]]],["ch-modal",[[769,"ch-modal",{"open":[1028],"label":[1],"closeLabel":[1,"close-label"]},null,{"open":[{"handleOpenChange":0}]}]]],["ch-radio",[[577,"ch-radio",{"label":[1],"options":[16],"value":[1025],"name":[513],"disabled":[516],"required":[516],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4],"formDisabled":[32]},null,{"value":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}]]],["ch-tabs",[[769,"ch-tabs",{"tabs":[16],"value":[1025],"label":[1]}]]],["ch-textarea",[[577,"ch-textarea",{"label":[1],"value":[1025],"placeholder":[1],"rows":[2],"name":[513],"disabled":[516],"required":[516],"hint":[1],"errorMessage":[1,"error-message"],"invalid":[4],"formDisabled":[32]},null,{"value":[{"syncForm":0}],"required":[{"syncForm":0}],"invalid":[{"syncForm":0}],"errorMessage":[{"syncForm":0}]}]]],["ch-tooltip",[[769,"ch-tooltip",{"placement":[1],"hovered":[32],"focused":[32],"dismissed":[32]},[[1,"mouseenter","handleMouseEnter"],[1,"mouseleave","handleMouseLeave"],[0,"focusin","handleFocusIn"],[0,"focusout","handleFocusOut"],[4,"keydown","handleKeyDown"]]]]]], options);
20
20
  });
21
21
  //# sourceMappingURL=chucao.js.map
22
22
 
@@ -1,8 +1,8 @@
1
1
  const NAMESPACE = 'chucao';
2
- const BUILD = /* chucao */ { hotModuleReplacement: false, lazyLoad: true, prop: true, propChangeCallback: false, updatable: true};
2
+ const BUILD = /* chucao */ { hotModuleReplacement: false, lazyLoad: true, propChangeCallback: true, state: true, updatable: true};
3
3
 
4
4
  const globalScripts = () => {};
5
- const globalStyles = ":root{--color-background-base:#100a1c;--color-background-top-glow:#201e40;--color-background-bottom-glow:#261226;--color-surface-default:rgba(32, 30, 64, 0.6);--color-surface-hover:rgba(45, 212, 191, 0.08);--color-border-default:rgba(255, 255, 255, 0.08);--color-border-hover:rgba(45, 212, 191, 0.3);--color-accent-default:#2dd4bf;--color-accent-hover:#5ee8d4;--color-accent-text:#06210f;--color-status-positive:#4ade80;--color-status-positive-background:rgba(34, 197, 94, 0.18);--color-status-warning:#f87171;--color-status-warning-background:rgba(248, 113, 113, 0.15);--color-text-primary:#ffffff;--color-text-secondary:rgba(255, 255, 255, 0.55);--color-brand-huemul-dark:#85422b;--color-brand-huemul-light:#b45b38;--color-brand-stroke:#1d1d1b;--typography-body:Fira Sans, Droid Sans, Helvetica Neue, sans-serif;--typography-heading:Inconsolata, monospace;--typography-size-xs:0.68rem;--typography-size-sm:0.85rem;--typography-size-md:1rem;--typography-size-lg:1.25rem;--typography-size-xl:1.5rem;--typography-weight-regular:400;--typography-weight-semibold:600;--typography-weight-bold:700;--typography-tracking-badge:0.03em;--spacing-2xs:0.18rem;--spacing-xs:0.25rem;--spacing-sm:0.35rem;--spacing-md:0.5rem;--spacing-lg:0.6rem;--spacing-xl:0.8rem;--spacing-2xl:1rem;--spacing-3xl:1.25rem;--spacing-4xl:1.35rem;--spacing-5xl:1.5rem;--spacing-6xl:2rem;--spacing-shift:2px;--spacing-elevate:1px;--radius-sm:6px;--radius-md:8px;--radius-pill:999px;--border-width:1px;--border-accent-bar:3px;--shadow-focus-ring:0 0 0 3px rgba(45, 212, 191, 0.12);--shadow-card-hover:0 4px 20px rgba(45, 212, 191, 0.06);--effect-blur:10px;--duration-fast:150ms;--duration-normal:200ms;--duration-spin:800ms;--easing-default:ease;--easing-linear:linear;--focus-outline-width:2px;--focus-outline-offset:2px;--opacity-disabled:0.5;--z-index-base:0;--z-index-dropdown:100;--z-index-modal:1000;--layout-max-width:68rem}@font-face{font-family:'Fira Sans';font-style:normal;font-weight:400;font-display:swap;src:url('https://static.devschile.cl/chucao/fonts/fira-sans-latin-400-normal.woff2') format('woff2')}@font-face{font-family:'Fira Sans';font-style:normal;font-weight:600;font-display:swap;src:url('https://static.devschile.cl/chucao/fonts/fira-sans-latin-600-normal.woff2') format('woff2')}@font-face{font-family:'Fira Sans';font-style:normal;font-weight:700;font-display:swap;src:url('https://static.devschile.cl/chucao/fonts/fira-sans-latin-700-normal.woff2') format('woff2')}@font-face{font-family:'Inconsolata';font-style:normal;font-weight:400;font-display:swap;src:url('https://static.devschile.cl/chucao/fonts/inconsolata-latin-400-normal.woff2') format('woff2')}:root{--bg:var(--color-background-base);--bg-gradient:radial-gradient(50% 30% ellipse at center top, var(--color-background-top-glow) 0%, rgba(0, 0, 0, 0) 100%),\n radial-gradient(60% 50% ellipse at center bottom, var(--color-background-bottom-glow) 0%, var(--color-background-base) 100%);--surface:var(--color-surface-default);--surface-hover:var(--color-surface-hover);--border:var(--color-border-default);--border-hover:var(--color-border-hover);--text:var(--color-text-primary);--text-muted:var(--color-text-secondary);--accent:var(--color-accent-default);--accent-hover:var(--color-accent-hover);--font-body:var(--typography-body);--font-heading:var(--typography-heading);--radius:var(--radius-sm)}body{font-family:var(--font-body)}.ch-container{width:100%;max-width:var(--layout-max-width);margin-inline:auto}.ch-visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0}.ch-flex{display:flex}.ch-flex-col{display:flex;flex-direction:column}.ch-items-center{align-items:center}.ch-justify-center{justify-content:center}.ch-justify-between{justify-content:space-between}.ch-gap-sm{gap:var(--spacing-md)}.ch-gap-md{gap:var(--spacing-2xl)}.ch-text-center{text-align:center}.ch-text-primary{color:var(--text)}.ch-text-muted{color:var(--text-muted)}.ch-text-accent{color:var(--accent)}.ch-heading{font-family:var(--font-heading)}";
5
+ const globalStyles = ":root{--color-background-base:#100a1c;--color-background-top-glow:#201e40;--color-background-bottom-glow:#261226;--color-surface-default:rgba(32, 30, 64, 0.6);--color-surface-hover:rgba(45, 212, 191, 0.08);--color-scrim-default:rgba(0, 0, 0, 0.6);--color-border-default:rgba(255, 255, 255, 0.08);--color-border-hover:rgba(45, 212, 191, 0.3);--color-accent-default:#2dd4bf;--color-accent-hover:#5ee8d4;--color-accent-text:#06210f;--color-status-positive:#4ade80;--color-status-positive-background:rgba(34, 197, 94, 0.18);--color-status-warning:#f87171;--color-status-warning-background:rgba(248, 113, 113, 0.15);--color-text-primary:#ffffff;--color-text-secondary:rgba(255, 255, 255, 0.55);--color-brand-huemul-dark:#85422b;--color-brand-huemul-light:#b45b38;--color-brand-stroke:#1d1d1b;--typography-body:Fira Sans, Droid Sans, Helvetica Neue, sans-serif;--typography-heading:Inconsolata, monospace;--typography-size-xs:0.68rem;--typography-size-sm:0.85rem;--typography-size-md:1rem;--typography-size-lg:1.25rem;--typography-size-xl:1.5rem;--typography-weight-regular:400;--typography-weight-semibold:600;--typography-weight-bold:700;--typography-tracking-badge:0.03em;--spacing-2xs:0.18rem;--spacing-xs:0.25rem;--spacing-sm:0.35rem;--spacing-md:0.5rem;--spacing-lg:0.6rem;--spacing-xl:0.8rem;--spacing-2xl:1rem;--spacing-3xl:1.25rem;--spacing-4xl:1.35rem;--spacing-5xl:1.5rem;--spacing-6xl:2rem;--spacing-shift:2px;--spacing-elevate:1px;--radius-sm:6px;--radius-md:8px;--radius-pill:999px;--border-width:1px;--border-accent-bar:3px;--shadow-focus-ring:0 0 0 3px rgba(45, 212, 191, 0.12);--shadow-card-hover:0 4px 20px rgba(45, 212, 191, 0.06);--effect-blur:10px;--duration-fast:150ms;--duration-normal:200ms;--duration-spin:800ms;--easing-default:ease;--easing-linear:linear;--focus-outline-width:2px;--focus-outline-offset:2px;--opacity-disabled:0.5;--z-index-base:0;--z-index-dropdown:100;--z-index-modal:1000;--layout-max-width:68rem}@font-face{font-family:'Fira Sans';font-style:normal;font-weight:400;font-display:swap;src:url('https://static.devschile.cl/chucao/fonts/fira-sans-latin-400-normal.woff2') format('woff2')}@font-face{font-family:'Fira Sans';font-style:normal;font-weight:600;font-display:swap;src:url('https://static.devschile.cl/chucao/fonts/fira-sans-latin-600-normal.woff2') format('woff2')}@font-face{font-family:'Fira Sans';font-style:normal;font-weight:700;font-display:swap;src:url('https://static.devschile.cl/chucao/fonts/fira-sans-latin-700-normal.woff2') format('woff2')}@font-face{font-family:'Inconsolata';font-style:normal;font-weight:400;font-display:swap;src:url('https://static.devschile.cl/chucao/fonts/inconsolata-latin-400-normal.woff2') format('woff2')}:root{--bg:var(--color-background-base);--bg-gradient:radial-gradient(50% 30% ellipse at center top, var(--color-background-top-glow) 0%, rgba(0, 0, 0, 0) 100%),\n radial-gradient(60% 50% ellipse at center bottom, var(--color-background-bottom-glow) 0%, var(--color-background-base) 100%);--surface:var(--color-surface-default);--surface-hover:var(--color-surface-hover);--border:var(--color-border-default);--border-hover:var(--color-border-hover);--text:var(--color-text-primary);--text-muted:var(--color-text-secondary);--accent:var(--color-accent-default);--accent-hover:var(--color-accent-hover);--font-body:var(--typography-body);--font-heading:var(--typography-heading);--radius:var(--radius-sm)}body{font-family:var(--font-body)}.ch-container{width:100%;max-width:var(--layout-max-width);margin-inline:auto}.ch-visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0}.ch-flex{display:flex}.ch-flex-col{display:flex;flex-direction:column}.ch-items-center{align-items:center}.ch-justify-center{justify-content:center}.ch-justify-between{justify-content:space-between}.ch-gap-sm{gap:var(--spacing-md)}.ch-gap-md{gap:var(--spacing-2xl)}.ch-text-center{text-align:center}.ch-text-primary{color:var(--text)}.ch-text-muted{color:var(--text-muted)}.ch-text-accent{color:var(--accent)}.ch-heading{font-family:var(--font-heading)}";
6
6
 
7
7
  /*
8
8
  Stencil Client Platform v4.44.0 | MIT Licensed | https://stenciljs.com
@@ -85,7 +85,7 @@ var registerInstance = (lazyInstance, hostRef) => {
85
85
  if (!hostRef) return;
86
86
  lazyInstance.__stencil__getHostRef = () => hostRef;
87
87
  hostRef.$lazyInstance$ = lazyInstance;
88
- if (hostRef.$cmpMeta$.$flags$ & 512 /* hasModernPropertyDecls */ && (BUILD.prop)) {
88
+ if (hostRef.$cmpMeta$.$flags$ & 512 /* hasModernPropertyDecls */ && (BUILD.state)) {
89
89
  reWireGetterSetter(lazyInstance, hostRef);
90
90
  }
91
91
  };
@@ -168,6 +168,12 @@ var HYDRATE_CHILD_ID = "c-id";
168
168
  var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
169
169
  var MAX_LAZY_LOAD_RETRIES = 3;
170
170
  var LAZY_LOAD_RETRY_INTERVAL_MS = 1e3;
171
+ var FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS = [
172
+ "formAssociatedCallback",
173
+ "formResetCallback",
174
+ "formDisabledCallback",
175
+ "formStateRestoreCallback"
176
+ ];
171
177
  var win = typeof window !== "undefined" ? window : {};
172
178
  var plt = {
173
179
  $flags$: 0,
@@ -178,6 +184,23 @@ var plt = {
178
184
  rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
179
185
  ce: (eventName, opts) => new CustomEvent(eventName, opts)
180
186
  };
187
+ var supportsListenerOptions = /* @__PURE__ */ (() => {
188
+ var _a;
189
+ let supportsListenerOptions2 = false;
190
+ try {
191
+ (_a = win.document) == null ? void 0 : _a.addEventListener(
192
+ "e",
193
+ null,
194
+ Object.defineProperty({}, "passive", {
195
+ get() {
196
+ supportsListenerOptions2 = true;
197
+ }
198
+ })
199
+ );
200
+ } catch (e) {
201
+ }
202
+ return supportsListenerOptions2;
203
+ })();
181
204
  var promiseResolve = (v) => Promise.resolve(v);
182
205
  var supportsConstructableStylesheets = /* @__PURE__ */ (() => {
183
206
  try {
@@ -964,6 +987,31 @@ var findCorrespondingNode = (node, type) => {
964
987
  return sibling;
965
988
  };
966
989
 
990
+ // src/runtime/normalize-watchers.ts
991
+ var normalizeWatchers = (raw) => {
992
+ if (!raw) return void 0;
993
+ const keys = Object.keys(raw);
994
+ if (keys.length === 0) return void 0;
995
+ let hasLegacy = false;
996
+ for (const propName of keys) {
997
+ if (hasLegacy) break;
998
+ for (const h2 of raw[propName]) {
999
+ if (typeof h2 === "string") {
1000
+ hasLegacy = true;
1001
+ break;
1002
+ }
1003
+ }
1004
+ }
1005
+ if (!hasLegacy) return raw;
1006
+ const out = {};
1007
+ for (const propName of keys) {
1008
+ out[propName] = raw[propName].map(
1009
+ (h2) => typeof h2 === "string" ? { [h2]: 0 } : h2
1010
+ );
1011
+ }
1012
+ return out;
1013
+ };
1014
+
967
1015
  // src/utils/remote-value.ts
968
1016
  var RemoteValue = class _RemoteValue {
969
1017
  /**
@@ -1083,7 +1131,9 @@ var parsePropertyValue = (propValue, propType, isFormAssociated) => {
1083
1131
  }
1084
1132
  if (propValue != null && !isComplexType(propValue)) {
1085
1133
  if (propType & 4 /* Boolean */) {
1086
- {
1134
+ if (isFormAssociated && typeof propValue === "string") {
1135
+ return propValue === "" || !!propValue;
1136
+ } else {
1087
1137
  return propValue === "false" ? false : propValue === "" || !!propValue;
1088
1138
  }
1089
1139
  }
@@ -1536,6 +1586,14 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
1536
1586
  const isHostElement = isHost(renderFnResults);
1537
1587
  const rootVnode = isHostElement ? renderFnResults : h(null, null, renderFnResults);
1538
1588
  hostTagName = hostElm.tagName;
1589
+ if (cmpMeta.$attrsToReflect$) {
1590
+ rootVnode.$attrs$ = rootVnode.$attrs$ || {};
1591
+ cmpMeta.$attrsToReflect$.forEach(([propName, attribute]) => {
1592
+ {
1593
+ rootVnode.$attrs$[attribute] = hostElm[propName];
1594
+ }
1595
+ });
1596
+ }
1539
1597
  if (isInitialLoad && rootVnode.$attrs$) {
1540
1598
  for (const key of Object.keys(rootVnode.$attrs$)) {
1541
1599
  if (hostElm.hasAttribute(key) && !["key", "ref", "style", "class"].includes(key)) {
@@ -1595,6 +1653,13 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
1595
1653
  let maybePromise;
1596
1654
  if (isInitialLoad) {
1597
1655
  {
1656
+ {
1657
+ hostRef.$flags$ |= 256 /* isListenReady */;
1658
+ if (hostRef.$queuedListeners$) {
1659
+ hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event, elm));
1660
+ hostRef.$queuedListeners$ = void 0;
1661
+ }
1662
+ }
1598
1663
  if (hostRef.$fetchedCbList$.length) {
1599
1664
  hostRef.$fetchedCbList$.forEach((cb) => cb(elm));
1600
1665
  }
@@ -1727,16 +1792,40 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
1727
1792
  `Couldn't find host element for "${cmpMeta.$tagName$}" as it is unknown to this Stencil runtime. This usually happens when integrating a 3rd party Stencil component with another Stencil component or application. Please reach out to the maintainers of the 3rd party Stencil component or report this on the Stencil Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/stenciljs/core/issues/5457).`
1728
1793
  );
1729
1794
  }
1795
+ const elm = hostRef.$hostElement$ ;
1730
1796
  const oldVal = hostRef.$instanceValues$.get(propName);
1731
1797
  const flags = hostRef.$flags$;
1732
1798
  const instance = hostRef.$lazyInstance$ ;
1733
1799
  newVal = parsePropertyValue(
1734
1800
  newVal,
1735
- cmpMeta.$members$[propName][0]);
1801
+ cmpMeta.$members$[propName][0],
1802
+ !!(cmpMeta.$flags$ & 64 /* formAssociated */)
1803
+ );
1736
1804
  const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
1737
1805
  const didValueChange = newVal !== oldVal && !areBothNaN;
1738
1806
  if ((!(flags & 8 /* isConstructingInstance */) || oldVal === void 0) && didValueChange) {
1739
1807
  hostRef.$instanceValues$.set(propName, newVal);
1808
+ if (cmpMeta.$watchers$) {
1809
+ const watchMethods = cmpMeta.$watchers$[propName];
1810
+ if (watchMethods) {
1811
+ watchMethods.map((watcher) => {
1812
+ try {
1813
+ const [[watchMethodName, watcherFlags]] = Object.entries(watcher);
1814
+ if (flags & 128 /* isWatchReady */ || watcherFlags & 1 /* Immediate */) {
1815
+ if (!instance) {
1816
+ hostRef.$fetchedCbList$.push(() => {
1817
+ hostRef.$lazyInstance$[watchMethodName](newVal, oldVal, propName);
1818
+ });
1819
+ } else {
1820
+ instance[watchMethodName](newVal, oldVal, propName);
1821
+ }
1822
+ }
1823
+ } catch (e) {
1824
+ consoleError(e, elm);
1825
+ }
1826
+ });
1827
+ }
1828
+ }
1740
1829
  if (flags & 2 /* hasRendered */) {
1741
1830
  if (instance.componentShouldUpdate) {
1742
1831
  const shouldUpdate = instance.componentShouldUpdate(newVal, oldVal, propName);
@@ -1755,7 +1844,38 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
1755
1844
  var proxyComponent = (Cstr, cmpMeta, flags) => {
1756
1845
  var _a, _b;
1757
1846
  const prototype = Cstr.prototype;
1847
+ if (cmpMeta.$flags$ & 64 /* formAssociated */ && flags & 1 /* isElementConstructor */) {
1848
+ FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS.forEach((cbName) => {
1849
+ Object.defineProperty(prototype, cbName, {
1850
+ value(...args) {
1851
+ var _a2;
1852
+ const hostRef = getHostRef(this);
1853
+ const instance = hostRef == null ? void 0 : hostRef.$lazyInstance$ ;
1854
+ if (!instance) {
1855
+ (_a2 = hostRef == null ? void 0 : hostRef.$onReadyPromise$) == null ? void 0 : _a2.then((asyncInstance) => {
1856
+ const cb = asyncInstance[cbName];
1857
+ typeof cb === "function" && cb.call(asyncInstance, ...args);
1858
+ });
1859
+ } else {
1860
+ const cb = instance[cbName] ;
1861
+ typeof cb === "function" && cb.call(instance, ...args);
1862
+ }
1863
+ }
1864
+ });
1865
+ });
1866
+ }
1758
1867
  if (cmpMeta.$members$ || BUILD.propChangeCallback) {
1868
+ {
1869
+ if (Cstr.watchers && !cmpMeta.$watchers$) {
1870
+ cmpMeta.$watchers$ = normalizeWatchers(Cstr.watchers);
1871
+ }
1872
+ if (Cstr.deserializers && !cmpMeta.$deserializers$) {
1873
+ cmpMeta.$deserializers$ = Cstr.deserializers;
1874
+ }
1875
+ if (Cstr.serializers && !cmpMeta.$serializers$) {
1876
+ cmpMeta.$serializers$ = Cstr.serializers;
1877
+ }
1878
+ }
1759
1879
  const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
1760
1880
  members.map(([memberName, [memberFlags]]) => {
1761
1881
  if ((memberFlags & 31 /* Prop */ || (flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {
@@ -1793,7 +1913,9 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
1793
1913
  origSetter.apply(this, [
1794
1914
  parsePropertyValue(
1795
1915
  newValue,
1796
- memberFlags)
1916
+ memberFlags,
1917
+ !!(cmpMeta.$flags$ & 64 /* formAssociated */)
1918
+ )
1797
1919
  ]);
1798
1920
  newValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
1799
1921
  setValue(this, memberName, newValue, cmpMeta);
@@ -1818,7 +1940,9 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
1818
1940
  }
1819
1941
  ref.$lazyInstance$[memberName] = parsePropertyValue(
1820
1942
  newValue,
1821
- memberFlags);
1943
+ memberFlags,
1944
+ !!(cmpMeta.$flags$ & 64 /* formAssociated */)
1945
+ );
1822
1946
  setValue(this, memberName, ref.$lazyInstance$[memberName], cmpMeta);
1823
1947
  };
1824
1948
  if (ref.$lazyInstance$) {
@@ -1877,8 +2001,12 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
1877
2001
  /* @__PURE__ */ new Set([
1878
2002
  ...Object.keys((_b = cmpMeta.$watchers$) != null ? _b : {}),
1879
2003
  ...members.filter(([_, m]) => m[0] & 31 /* HasAttribute */).map(([propName, m]) => {
2004
+ var _a2;
1880
2005
  const attrName = m[1] || propName;
1881
2006
  attrNameToPropName.set(attrName, propName);
2007
+ if (m[0] & 512 /* ReflectAttr */) {
2008
+ (_a2 = cmpMeta.$attrsToReflect$) == null ? void 0 : _a2.push([propName, attrName]);
2009
+ }
1882
2010
  return attrName;
1883
2011
  })
1884
2012
  ])
@@ -1915,6 +2043,11 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
1915
2043
  throw new Error(`Constructor for "${cmpMeta.$tagName$}#${hostRef.$modeName$}" was not found`);
1916
2044
  }
1917
2045
  if (!Cstr.isProxied) {
2046
+ {
2047
+ cmpMeta.$watchers$ = normalizeWatchers(Cstr.watchers);
2048
+ cmpMeta.$serializers$ = Cstr.serializers;
2049
+ cmpMeta.$deserializers$ = Cstr.deserializers;
2050
+ }
1918
2051
  proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
1919
2052
  Cstr.isProxied = true;
1920
2053
  }
@@ -1930,6 +2063,9 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
1930
2063
  {
1931
2064
  hostRef.$flags$ &= -9 /* isConstructingInstance */;
1932
2065
  }
2066
+ {
2067
+ hostRef.$flags$ |= 128 /* isWatchReady */;
2068
+ }
1933
2069
  endNewInstance();
1934
2070
  {
1935
2071
  fireConnectedCallback(hostRef.$lazyInstance$, elm);
@@ -2020,6 +2156,7 @@ var connectedCallback = (elm) => {
2020
2156
  initializeComponent(elm, hostRef, cmpMeta);
2021
2157
  }
2022
2158
  } else {
2159
+ addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
2023
2160
  if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
2024
2161
  fireConnectedCallback(hostRef.$lazyInstance$, elm);
2025
2162
  } else if (hostRef.$flags$ & 1024 /* hasFailedLoad */) {
@@ -2039,6 +2176,12 @@ var disconnectInstance = (instance, elm) => {
2039
2176
  var disconnectedCallback = async (elm) => {
2040
2177
  if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
2041
2178
  const hostRef = getHostRef(elm);
2179
+ {
2180
+ if (hostRef == null ? void 0 : hostRef.$rmListeners$) {
2181
+ hostRef.$rmListeners$.map((rmListener) => rmListener());
2182
+ hostRef.$rmListeners$ = void 0;
2183
+ }
2184
+ }
2042
2185
  if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
2043
2186
  disconnectInstance(hostRef.$lazyInstance$, elm);
2044
2187
  } else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
@@ -2080,6 +2223,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
2080
2223
  }
2081
2224
  lazyBundles.map((lazyBundle) => {
2082
2225
  lazyBundle[1].map((compactMeta) => {
2226
+ var _a2, _b;
2083
2227
  const cmpMeta = {
2084
2228
  $flags$: compactMeta[0],
2085
2229
  $tagName$: compactMeta[1],
@@ -2089,6 +2233,17 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
2089
2233
  {
2090
2234
  cmpMeta.$members$ = compactMeta[2];
2091
2235
  }
2236
+ {
2237
+ cmpMeta.$listeners$ = compactMeta[3];
2238
+ }
2239
+ {
2240
+ cmpMeta.$attrsToReflect$ = [];
2241
+ }
2242
+ {
2243
+ cmpMeta.$watchers$ = normalizeWatchers(compactMeta[4]);
2244
+ cmpMeta.$serializers$ = (_a2 = compactMeta[5]) != null ? _a2 : {};
2245
+ cmpMeta.$deserializers$ = (_b = compactMeta[6]) != null ? _b : {};
2246
+ }
2092
2247
  const tagName = transformTag(cmpMeta.$tagName$);
2093
2248
  const HostElement = class extends HTMLElement {
2094
2249
  ["s-p"];
@@ -2120,6 +2275,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
2120
2275
  }
2121
2276
  if (!this.hasRegisteredEventListeners) {
2122
2277
  this.hasRegisteredEventListeners = true;
2278
+ addHostEventListeners(this, hostRef, cmpMeta.$listeners$);
2123
2279
  }
2124
2280
  if (appLoadFallback) {
2125
2281
  clearTimeout(appLoadFallback);
@@ -2153,6 +2309,9 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
2153
2309
  return (_a3 = getHostRef(this)) == null ? void 0 : _a3.$onReadyPromise$;
2154
2310
  }
2155
2311
  };
2312
+ if (cmpMeta.$flags$ & 64 /* formAssociated */) {
2313
+ HostElement.formAssociated = true;
2314
+ }
2156
2315
  cmpMeta.$lazyBundleId$ = lazyBundle[0];
2157
2316
  if (!exclude.includes(tagName) && !customElements2.get(tagName)) {
2158
2317
  cmpTags.push(tagName);
@@ -2183,6 +2342,41 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
2183
2342
  }
2184
2343
  endBootstrap();
2185
2344
  };
2345
+ var addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
2346
+ if (listeners && win.document) {
2347
+ listeners.map(([flags, name, method]) => {
2348
+ const target = getHostListenerTarget(win.document, elm, flags) ;
2349
+ const handler = hostListenerProxy(hostRef, method);
2350
+ const opts = hostListenerOpts(flags);
2351
+ plt.ael(target, name, handler, opts);
2352
+ (hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
2353
+ });
2354
+ }
2355
+ };
2356
+ var hostListenerProxy = (hostRef, methodName) => (ev) => {
2357
+ var _a;
2358
+ try {
2359
+ {
2360
+ if (hostRef.$flags$ & 256 /* isListenReady */) {
2361
+ (_a = hostRef.$lazyInstance$) == null ? void 0 : _a[methodName](ev);
2362
+ } else {
2363
+ (hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
2364
+ }
2365
+ }
2366
+ } catch (e) {
2367
+ consoleError(e, hostRef.$hostElement$);
2368
+ }
2369
+ };
2370
+ var getHostListenerTarget = (doc, elm, flags) => {
2371
+ if (flags & 4 /* TargetDocument */) {
2372
+ return doc;
2373
+ }
2374
+ return elm;
2375
+ };
2376
+ var hostListenerOpts = (flags) => supportsListenerOptions ? {
2377
+ passive: (flags & 1 /* Passive */) !== 0,
2378
+ capture: (flags & 2 /* Capture */) !== 0
2379
+ } : (flags & 2 /* Capture */) !== 0;
2186
2380
 
2187
2381
  // src/runtime/nonce.ts
2188
2382
  var setNonce = (nonce) => plt.$nonce$ = nonce;
@@ -2190,7 +2384,7 @@ function transformTag(tag) {
2190
2384
  return tag;
2191
2385
  }
2192
2386
 
2193
- export { Host as H, bootstrapLazy as b, createEvent as c, globalScripts as g, h, promiseResolve as p, registerInstance as r, setNonce as s };
2194
- //# sourceMappingURL=index-pfWAsOzE.js.map
2387
+ export { Host as H, getElement as a, bootstrapLazy as b, createEvent as c, globalScripts as g, h, promiseResolve as p, registerInstance as r, setNonce as s };
2388
+ //# sourceMappingURL=index-BaKXvAYc.js.map
2195
2389
 
2196
- //# sourceMappingURL=index-pfWAsOzE.js.map
2390
+ //# sourceMappingURL=index-BaKXvAYc.js.map