@prolibu-suite/cobalt-core 0.10.0 → 0.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/custom-elements.json +395 -29
- package/dist/cjs/co-accordion.cjs.entry.js +4 -4
- package/dist/cjs/co-action-bar.cjs.entry.js +1 -1
- package/dist/cjs/co-audio-player.cjs.entry.js +82 -12
- package/dist/cjs/co-avatar.cjs.entry.js +72 -0
- package/dist/cjs/co-button.cjs.entry.js +1 -1
- package/dist/cjs/co-checkbox.cjs.entry.js +3 -3
- package/dist/cjs/co-chip_2.cjs.entry.js +62 -10
- package/dist/cjs/co-color-picker.cjs.entry.js +40 -10
- package/dist/cjs/co-data-table.cjs.entry.js +82 -4
- package/dist/cjs/co-input.cjs.entry.js +6 -2
- package/dist/cjs/co-menu-item.cjs.entry.js +1 -1
- package/dist/cjs/co-modal.cjs.entry.js +7 -3
- package/dist/cjs/co-navbar.cjs.entry.js +2 -2
- package/dist/cjs/co-number-field.cjs.entry.js +3 -3
- package/dist/cjs/co-overlay.cjs.entry.js +1 -1
- package/dist/cjs/co-page-header.cjs.entry.js +1 -1
- package/dist/cjs/co-phone-field.cjs.entry.js +1 -1
- package/dist/cjs/co-progress-bar.cjs.entry.js +2 -2
- package/dist/cjs/co-progress-circle.cjs.entry.js +2 -2
- package/dist/cjs/co-provider-logo_2.cjs.entry.js +1 -1
- package/dist/cjs/co-radio.cjs.entry.js +3 -3
- package/dist/cjs/co-rating.cjs.entry.js +3 -3
- package/dist/cjs/co-ref-field.cjs.entry.js +100 -9
- package/dist/cjs/co-rich-text-editor.cjs.entry.js +3 -3
- package/dist/cjs/co-row.cjs.entry.js +2 -2
- package/dist/cjs/co-select.cjs.entry.js +4 -4
- package/dist/cjs/co-separator.cjs.entry.js +1 -1
- package/dist/cjs/co-sidebar.cjs.entry.js +2 -2
- package/dist/cjs/co-slider.cjs.entry.js +2 -2
- package/dist/cjs/co-switch.cjs.entry.js +3 -3
- package/dist/cjs/co-tab-group.cjs.entry.js +2 -2
- package/dist/cjs/co-tab.cjs.entry.js +2 -2
- package/dist/cjs/co-tags-field.cjs.entry.js +5 -5
- package/dist/cjs/co-textarea.cjs.entry.js +4 -4
- package/dist/cjs/co-time-field.cjs.entry.js +1 -1
- package/dist/cjs/co-toggle-button-group.cjs.entry.js +3 -3
- package/dist/cjs/co-toggle-button.cjs.entry.js +3 -3
- package/dist/cjs/{co-avatar_2.cjs.entry.js → co-tooltip.cjs.entry.js} +2 -70
- package/dist/cjs/co-video.cjs.entry.js +2 -2
- package/dist/cjs/cobalt.cjs.js +1 -1
- package/dist/cjs/index-MDAnKsze.js +12 -8
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cobalt/cobalt.esm.js +1 -1
- package/dist/cobalt/{p-82266f11.entry.js → p-000a15b8.entry.js} +1 -1
- package/dist/cobalt/{p-fe7e8813.entry.js → p-148d4aa6.entry.js} +1 -1
- package/dist/cobalt/p-16f8cee6.entry.js +1 -0
- package/dist/cobalt/p-239c5c5f.entry.js +1 -0
- package/dist/cobalt/{p-4d897896.entry.js → p-28764b8e.entry.js} +1 -1
- package/dist/cobalt/{p-73c6d735.entry.js → p-2a30c143.entry.js} +1 -1
- package/dist/cobalt/{p-85501c6a.entry.js → p-2f0f3bb1.entry.js} +1 -1
- package/dist/cobalt/{p-e01f9b9a.entry.js → p-2fba312b.entry.js} +1 -1
- package/dist/cobalt/p-354d5089.entry.js +1 -0
- package/dist/cobalt/{p-5298c030.entry.js → p-383a998e.entry.js} +1 -1
- package/dist/cobalt/{p-325b91b6.entry.js → p-3c4f7026.entry.js} +1 -1
- package/dist/cobalt/p-416795f5.entry.js +1 -0
- package/dist/cobalt/{p-54c987d7.entry.js → p-5a3e4c81.entry.js} +1 -1
- package/dist/cobalt/p-5adf117c.entry.js +1 -0
- package/dist/cobalt/{p-83a9a05a.entry.js → p-5ca394b1.entry.js} +1 -1
- package/dist/cobalt/{p-1a589c8e.entry.js → p-5e4973a6.entry.js} +1 -1
- package/dist/cobalt/{p-b565104d.entry.js → p-6c82a892.entry.js} +1 -1
- package/dist/cobalt/{p-83ea631d.entry.js → p-789c4b3e.entry.js} +1 -1
- package/dist/cobalt/{p-ea20f048.entry.js → p-7e8e6907.entry.js} +1 -1
- package/dist/cobalt/{p-10b82207.entry.js → p-8471abe2.entry.js} +1 -1
- package/dist/cobalt/p-8f2199ff.entry.js +1 -0
- package/dist/cobalt/p-9246e09c.entry.js +1 -0
- package/dist/cobalt/{p-eb063cc0.entry.js → p-93fe45fd.entry.js} +1 -1
- package/dist/cobalt/{p-ad33c40e.entry.js → p-95cfcb34.entry.js} +1 -1
- package/dist/cobalt/{p-bd683db3.entry.js → p-9cf738ed.entry.js} +1 -1
- package/dist/cobalt/p-a2462d7a.entry.js +1 -0
- package/dist/cobalt/p-a325ea0c.entry.js +1 -0
- package/dist/cobalt/{p-e8a4e6b0.entry.js → p-b5bba7fe.entry.js} +1 -1
- package/dist/cobalt/{p-6bf6bc3e.entry.js → p-b821d9de.entry.js} +1 -1
- package/dist/cobalt/{p-92b092db.entry.js → p-be34e447.entry.js} +1 -1
- package/dist/cobalt/p-c7d7d7f7.entry.js +1 -0
- package/dist/cobalt/{p-aae86f96.entry.js → p-d0b2c418.entry.js} +1 -1
- package/dist/cobalt/{p-50bcc76f.entry.js → p-d3344187.entry.js} +1 -1
- package/dist/cobalt/p-d375014b.entry.js +1 -0
- package/dist/cobalt/p-d9d9e8ae.entry.js +1 -0
- package/dist/cobalt/p-e371ec7a.entry.js +1 -0
- package/dist/cobalt/p-eadfd661.entry.js +1 -0
- package/dist/cobalt/p-ef301976.entry.js +1 -0
- package/dist/cobalt/{p-f68dd124.entry.js → p-fb2d1144.entry.js} +1 -1
- package/dist/collection/components/co-accordion/co-accordion.css +2 -2
- package/dist/collection/components/co-accordion/co-accordion.js +4 -4
- package/dist/collection/components/co-action-bar/co-action-bar.css +9 -2
- package/dist/collection/components/co-audio-player/co-audio-player.js +138 -12
- package/dist/collection/components/co-autocomplete/co-autocomplete.js +1 -1
- package/dist/collection/components/co-avatar-group/co-avatar-group.js +1 -1
- package/dist/collection/components/co-button/co-button.css +6 -3
- package/dist/collection/components/co-checkbox/co-checkbox.js +22 -3
- package/dist/collection/components/co-checkbox-group/co-checkbox-group.js +1 -1
- package/dist/collection/components/co-color-picker/co-color-picker.js +40 -10
- package/dist/collection/components/co-combobox/co-combobox.js +1 -1
- package/dist/collection/components/co-command-search/co-command-search.js +1 -1
- package/dist/collection/components/co-data-table/co-data-table.css +63 -2
- package/dist/collection/components/co-data-table/co-data-table.js +59 -4
- package/dist/collection/components/co-data-table/headerTruncationLogic.js +34 -0
- package/dist/collection/components/co-date-range-picker/co-date-range-picker.js +2 -2
- package/dist/collection/components/co-input/co-input.js +17 -5
- package/dist/collection/components/co-menu-item/co-menu-item.css +9 -0
- package/dist/collection/components/co-modal/co-modal.css +6 -0
- package/dist/collection/components/co-modal/co-modal.js +33 -2
- package/dist/collection/components/co-navbar/co-navbar.js +2 -2
- package/dist/collection/components/co-number-field/co-number-field.js +3 -3
- package/dist/collection/components/co-option-list/co-option-list.js +32 -3
- package/dist/collection/components/co-option-list/optionListLogic.js +31 -8
- package/dist/collection/components/co-overlay/co-overlay.js +1 -1
- package/dist/collection/components/co-page-header/co-page-header.js +1 -1
- package/dist/collection/components/co-phone-field/co-phone-field.js +1 -1
- package/dist/collection/components/co-popover/co-popover.js +1 -1
- package/dist/collection/components/co-progress-bar/co-progress-bar.js +2 -2
- package/dist/collection/components/co-progress-circle/co-progress-circle.js +2 -2
- package/dist/collection/components/co-radio/co-radio.js +3 -3
- package/dist/collection/components/co-radio-group/co-radio-group.js +1 -1
- package/dist/collection/components/co-rating/co-rating.js +3 -3
- package/dist/collection/components/co-ref-field/co-ref-field.css +40 -0
- package/dist/collection/components/co-ref-field/co-ref-field.js +207 -11
- package/dist/collection/components/co-rich-text-editor/co-rich-text-editor.js +3 -3
- package/dist/collection/components/co-row/co-row.js +2 -2
- package/dist/collection/components/co-segmented-bar/co-segmented-bar.js +1 -1
- package/dist/collection/components/co-select/co-select.js +24 -5
- package/dist/collection/components/co-separator/co-separator.js +1 -1
- package/dist/collection/components/co-sidebar/co-sidebar.js +2 -2
- package/dist/collection/components/co-sidebar-nav/co-sidebar-nav.js +1 -1
- package/dist/collection/components/co-skeleton/co-skeleton.js +1 -1
- package/dist/collection/components/co-slider/co-slider.js +2 -2
- package/dist/collection/components/co-switch/co-switch.js +3 -3
- package/dist/collection/components/co-tab/co-tab.js +2 -2
- package/dist/collection/components/co-tab-group/co-tab-group.js +2 -2
- package/dist/collection/components/co-tags-field/co-tags-field.js +5 -5
- package/dist/collection/components/co-textarea/co-textarea.js +4 -4
- package/dist/collection/components/co-time-field/co-time-field.js +1 -1
- package/dist/collection/components/co-toast/co-toast.js +2 -2
- package/dist/collection/components/co-toggle-button/co-toggle-button.css +6 -5
- package/dist/collection/components/co-toggle-button/co-toggle-button.js +2 -2
- package/dist/collection/components/co-toggle-button-group/co-toggle-button-group.css +9 -5
- package/dist/collection/components/co-toggle-button-group/co-toggle-button-group.js +2 -2
- package/dist/collection/components/co-tooltip/co-tooltip.js +2 -2
- package/dist/collection/components/co-transfer-list/co-transfer-list.js +1 -1
- package/dist/collection/components/co-video/co-video.js +2 -2
- package/dist/components/co-accordion.js +1 -1
- package/dist/components/co-action-bar.js +1 -1
- package/dist/components/co-audio-player.js +1 -1
- package/dist/components/co-autocomplete.js +1 -1
- package/dist/components/co-avatar-group.js +1 -1
- package/dist/components/co-avatar.js +1 -1
- package/dist/components/co-button.js +1 -1
- package/dist/components/co-calendar-month.js +1 -1
- package/dist/components/co-calendar-timegrid.js +1 -1
- package/dist/components/co-checkbox.js +1 -1
- package/dist/components/co-color-picker.js +1 -1
- package/dist/components/co-column-picker.js +1 -1
- package/dist/components/co-combobox.js +1 -1
- package/dist/components/co-command-search.js +1 -1
- package/dist/components/co-data-table.js +1 -1
- package/dist/components/co-date-picker.js +1 -1
- package/dist/components/co-date-range-picker.js +1 -1
- package/dist/components/co-date-range.js +1 -1
- package/dist/components/co-date-time-picker.js +1 -1
- package/dist/components/co-drawer.js +1 -1
- package/dist/components/co-event-calendar.js +1 -1
- package/dist/components/co-file-field.js +1 -1
- package/dist/components/co-input.js +1 -1
- package/dist/components/co-lightbox.js +1 -1
- package/dist/components/co-list-item.js +1 -1
- package/dist/components/co-menu-item.js +1 -1
- package/dist/components/co-modal.js +1 -1
- package/dist/components/co-navbar.js +1 -1
- package/dist/components/co-number-field.js +1 -1
- package/dist/components/co-option-list.js +1 -1
- package/dist/components/co-overlay.js +1 -1
- package/dist/components/co-page-header.js +1 -1
- package/dist/components/co-phone-field.js +1 -1
- package/dist/components/co-progress-bar.js +1 -1
- package/dist/components/co-progress-circle.js +1 -1
- package/dist/components/co-radio.js +1 -1
- package/dist/components/co-rating.js +1 -1
- package/dist/components/co-ref-field.js +1 -1
- package/dist/components/co-rich-text-editor.js +1 -1
- package/dist/components/co-row.js +1 -1
- package/dist/components/co-select.js +1 -1
- package/dist/components/co-separator.js +1 -1
- package/dist/components/co-sidebar-nav.js +1 -1
- package/dist/components/co-sidebar.js +1 -1
- package/dist/components/co-skeleton.js +1 -1
- package/dist/components/co-slider.js +1 -1
- package/dist/components/co-switch.js +1 -1
- package/dist/components/co-tab-group.js +1 -1
- package/dist/components/co-tab.js +1 -1
- package/dist/components/co-tags-field.js +1 -1
- package/dist/components/co-textarea.js +1 -1
- package/dist/components/co-time-field.js +1 -1
- package/dist/components/co-toggle-button-group.js +1 -1
- package/dist/components/co-toggle-button.js +1 -1
- package/dist/components/co-tooltip.js +1 -1
- package/dist/components/co-video.js +1 -1
- package/dist/components/p-7TncUlLN.js +1 -0
- package/dist/components/{p-BxP8OBw6.js → p-B9xitpGU.js} +1 -1
- package/dist/components/{p-x4grh-eZ.js → p-CBTGN490.js} +1 -1
- package/dist/components/{p-CXPRaTuo.js → p-CLsAo0-A.js} +1 -1
- package/dist/components/{p-B1QFLcY9.js → p-D2ldYZo1.js} +1 -1
- package/dist/components/{p-Bv6U5y3d.js → p-D3mVYO-G.js} +1 -1
- package/dist/components/{p-DkDTmHCg.js → p-DDV_bRcU.js} +1 -1
- package/dist/components/{p-Be_kyNRE.js → p-DSnJWzQw.js} +1 -1
- package/dist/components/{p-BBP5__CY.js → p-DTi2O4O8.js} +1 -1
- package/dist/components/p-De7w9k6_.js +1 -0
- package/dist/components/{p-Cl3AdEQJ.js → p-DoHLTC0n.js} +1 -1
- package/dist/components/{p-CnX3L8aF.js → p-DxtNejr2.js} +1 -1
- package/dist/components/p-wjt4IAGZ.js +1 -0
- package/dist/components/{p-DIo66nBr.js → p-zuhal3IZ.js} +1 -1
- package/dist/esm/co-accordion.entry.js +4 -4
- package/dist/esm/co-action-bar.entry.js +1 -1
- package/dist/esm/co-audio-player.entry.js +82 -12
- package/dist/esm/co-avatar.entry.js +70 -0
- package/dist/esm/co-button.entry.js +1 -1
- package/dist/esm/co-checkbox.entry.js +3 -3
- package/dist/esm/co-chip_2.entry.js +62 -10
- package/dist/esm/co-color-picker.entry.js +40 -10
- package/dist/esm/co-data-table.entry.js +82 -4
- package/dist/esm/co-input.entry.js +6 -2
- package/dist/esm/co-menu-item.entry.js +1 -1
- package/dist/esm/co-modal.entry.js +7 -3
- package/dist/esm/co-navbar.entry.js +2 -2
- package/dist/esm/co-number-field.entry.js +3 -3
- package/dist/esm/co-overlay.entry.js +1 -1
- package/dist/esm/co-page-header.entry.js +1 -1
- package/dist/esm/co-phone-field.entry.js +1 -1
- package/dist/esm/co-progress-bar.entry.js +2 -2
- package/dist/esm/co-progress-circle.entry.js +2 -2
- package/dist/esm/co-provider-logo_2.entry.js +1 -1
- package/dist/esm/co-radio.entry.js +3 -3
- package/dist/esm/co-rating.entry.js +3 -3
- package/dist/esm/co-ref-field.entry.js +100 -9
- package/dist/esm/co-rich-text-editor.entry.js +3 -3
- package/dist/esm/co-row.entry.js +2 -2
- package/dist/esm/co-select.entry.js +4 -4
- package/dist/esm/co-separator.entry.js +1 -1
- package/dist/esm/co-sidebar.entry.js +2 -2
- package/dist/esm/co-slider.entry.js +2 -2
- package/dist/esm/co-switch.entry.js +3 -3
- package/dist/esm/co-tab-group.entry.js +2 -2
- package/dist/esm/co-tab.entry.js +2 -2
- package/dist/esm/co-tags-field.entry.js +5 -5
- package/dist/esm/co-textarea.entry.js +4 -4
- package/dist/esm/co-time-field.entry.js +1 -1
- package/dist/esm/co-toggle-button-group.entry.js +3 -3
- package/dist/esm/co-toggle-button.entry.js +3 -3
- package/dist/esm/{co-avatar_2.entry.js → co-tooltip.entry.js} +3 -70
- package/dist/esm/co-video.entry.js +2 -2
- package/dist/esm/cobalt.js +1 -1
- package/dist/esm/index-DH5lfRNj.js +12 -8
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/co-accordion/co-accordion.d.ts +6 -0
- package/dist/types/components/co-audio-player/co-audio-player.d.ts +25 -0
- package/dist/types/components/co-checkbox/co-checkbox.d.ts +4 -0
- package/dist/types/components/co-color-picker/co-color-picker.d.ts +4 -2
- package/dist/types/components/co-data-table/co-data-table.d.ts +15 -0
- package/dist/types/components/co-data-table/headerTruncationLogic.d.ts +24 -0
- package/dist/types/components/co-input/co-input.d.ts +5 -1
- package/dist/types/components/co-modal/co-modal.d.ts +10 -0
- package/dist/types/components/co-option-list/co-option-list.d.ts +13 -0
- package/dist/types/components/co-option-list/optionListLogic.d.ts +23 -6
- package/dist/types/components/co-ref-field/co-ref-field.d.ts +38 -0
- package/dist/types/components/co-select/co-select.d.ts +6 -0
- package/dist/types/components.d.ts +79 -3
- package/package.json +2 -2
- package/dist/cobalt/p-15d59169.entry.js +0 -1
- package/dist/cobalt/p-1788aab5.entry.js +0 -1
- package/dist/cobalt/p-20a39218.entry.js +0 -1
- package/dist/cobalt/p-3cc3ff93.entry.js +0 -1
- package/dist/cobalt/p-4908f33f.entry.js +0 -1
- package/dist/cobalt/p-63825d7f.entry.js +0 -1
- package/dist/cobalt/p-6f700f0d.entry.js +0 -1
- package/dist/cobalt/p-88195a63.entry.js +0 -1
- package/dist/cobalt/p-8fa5dc4a.entry.js +0 -1
- package/dist/cobalt/p-b1e8d69e.entry.js +0 -1
- package/dist/cobalt/p-b48917c9.entry.js +0 -1
- package/dist/cobalt/p-c32c176a.entry.js +0 -1
- package/dist/cobalt/p-e48f4e45.entry.js +0 -1
- package/dist/cobalt/p-ef5ca521.entry.js +0 -1
- package/dist/components/p-9ceBPSd1.js +0 -1
- package/dist/components/p-B2IsXte7.js +0 -1
- package/dist/components/p-BsTO1uUA.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,c as i,h as t,a as o}from"./p-DH5lfRNj.js";import{R as r}from"./p-fMqVDypp.js";import{F as s}from"./p-D_zA1Pv4.js";import{i as a}from"./p-BRbgGqLw.js";const c=class{constructor(t){e(this,t),this.coChange=i(this,"coChange",7),this.coClear=i(this,"coClear",7),this.coSearch=i(this,"coSearch",7),this.coLoadMore=i(this,"coLoadMore",7),this.coOpen=i(this,"coOpen",3),this.coClose=i(this,"coClose",3),this.coRemove=i(this,"coRemove",7),this.coFooterPrimary=i(this,"coFooterPrimary",7),this.coFooterSecondary=i(this,"coFooterSecondary",7),this.coPinToggle=i(this,"coPinToggle",7),this.coListReorder=i(this,"coListReorder",7),this.coEditSelected=i(this,"coEditSelected",7),this.required=!1,this.placeholder="Select…",this.disabled=!1,this.clearable=!0,this.editable=!1,this.editLabel="Edit",this.multiple=!1,this.status="default",this.layout="vertical",this.size="md",this.variant="default",this.value="",this.options="[]",this.selectedDisplay="[]",this.loading=!1,this.total=0,this.searchable=!0,this.searchPlaceholder="Search…",this.searchDebounce=350,this.emptyMessage="No results found",this.showFooter=!1,this.footerPrimaryLabel="Ok",this.footerSecondaryLabel="New",this.maxChips=0,this.panelTheme="auto",this.colorMode="dot",this.triggerBadgeIcon="",this.triggerBadgeLabel="",this.inheritedLabel="",this.inheritedBadgeLabel="",this.avatarShape="circle",this.pinnable=!1,this.listReorderable=!1,this.inheritedTruncated=!1,this.isOpen=!1,this.overflowCount=0,this.lastChipsKey="\0",this.pendingFocus=!1,this.hasPanelSlot=!1,this.handlePopoverOpen=()=>{this.isOpen=!0},this.handlePopoverClose=()=>{this.isOpen=!1},this.measureInherited=()=>{const e=this.inheritedEl,i=!!e&&e.scrollWidth>e.clientWidth+1;i!==this.inheritedTruncated&&(this.inheritedTruncated=i)},this.setInheritedEl=e=>{var i,t;const o=e||void 0;o!==this.inheritedEl&&(this.inheritedEl&&(null===(i=this.inheritedResizeObserver)||void 0===i||i.unobserve(this.inheritedEl)),this.inheritedEl=o,o?null===(t=this.inheritedResizeObserver)||void 0===t||t.observe(o):this.inheritedTruncated&&(this.inheritedTruncated=!1))},this.handleTriggerClick=e=>{this.disabled&&e.stopPropagation()},this.handleTriggerKeyDown=e=>{this.disabled||e.target===this.triggerEl&&("Enter"===e.key||" "===e.key?(e.preventDefault(),this.isOpen=!this.isOpen):"ArrowDown"!==e.key||this.isOpen||(e.preventDefault(),this.isOpen=!0))},this.handleListChange=e=>{if(!this.multiple&&null===e.value)return this.value="",this.coClear.emit(),void(this.isOpen=!1);this.handleOptionClick(e.item)},this.handleOptionClick=e=>{if(this.multiple){const i=this.parsedValue;let t;t=i.indexOf(e._id)>=0?i.filter((i=>i!==e._id)):[...i,e._id],this.value=JSON.stringify(t),this.coChange.emit({value:t,item:e})}else this.value=e._id,this.coChange.emit({value:e._id,item:e}),this.isOpen=!1},this.handleReorder=e=>{this.value=JSON.stringify(e.value),this.coChange.emit({value:e.value,item:e.item})},this.handleClear=e=>{e.stopPropagation(),this.value=this.multiple?"[]":"",this.coClear.emit()},this.handleEditClick=e=>{e.stopPropagation();const i=this.effectiveDisplayItems[0];i&&this.coEditSelected.emit(i._id)},this.handleRemoveChip=(e,i)=>{var t;i.stopPropagation();const o=null!==(t=this.effectiveDisplayItems.find((i=>i._id===e)))&&void 0!==t?t:{_id:e,label:e},r=this.parsedValue.filter((i=>i!==e));this.value=JSON.stringify(r),this.coRemove.emit(e),this.coChange.emit({value:r,item:o})},this.handleFooterPrimary=()=>{this.coFooterPrimary.emit(),this.isOpen=!1},this.handleFooterSecondary=()=>{this.coFooterSecondary.emit()}}get normalizedSize(){return"default"===this.size?"md":this.size}get parsedOptions(){try{const e="string"==typeof this.options?JSON.parse(this.options):this.options;return Array.isArray(e)?e:[]}catch(e){return[]}}get parsedSelectedDisplay(){try{const e="string"==typeof this.selectedDisplay?JSON.parse(this.selectedDisplay):this.selectedDisplay;return Array.isArray(e)?e:[]}catch(e){return[]}}get effectiveDisplayItems(){const e=this.parsedValue;if(0===e.length)return[];const i=new Map;for(const e of this.parsedSelectedDisplay)i.set(e._id,e);for(const e of this.parsedOptions)i.has(e._id)||i.set(e._id,{_id:e._id,label:e.label,description:e.description,color:e.color,avatar:e.avatar,image:e.image});return e.map((e=>i.get(e))).filter(Boolean)}get parsedValue(){if(!this.value)return[];try{const e=JSON.parse(this.value);return Array.isArray(e)?e:[this.value]}catch(e){return this.value?[this.value]:[]}}connectedCallback(){this.resizeObserver=new ResizeObserver((()=>this.calcOverflow())),this.inheritedResizeObserver=new ResizeObserver((()=>this.measureInherited())),this.inheritedEl&&this.inheritedResizeObserver.observe(this.inheritedEl)}componentDidRender(){var e,i,t,o;this.chipsEl!==this.observedChipsEl&&(null===(e=this.resizeObserver)||void 0===e||e.disconnect(),this.chipsEl&&(null===(i=this.resizeObserver)||void 0===i||i.observe(this.chipsEl)),this.observedChipsEl=this.chipsEl);const r=null===(t=this.chipsEl)||void 0===t?void 0:t.querySelectorAll(".co-ref-field__chip"),s=r?Array.from(r,(e=>e.textContent)).join(""):"";s!==this.lastChipsKey&&(this.lastChipsKey=s,this.calcOverflow()),this.pendingFocus&&(null===(o=this.optionListEl)||void 0===o?void 0:o.isConnected)&&(this.pendingFocus=!1,this.optionListEl.focusSearch())}disconnectedCallback(){var e,i;null===(e=this.resizeObserver)||void 0===e||e.disconnect(),null===(i=this.inheritedResizeObserver)||void 0===i||i.disconnect()}calcOverflow(){if(!this.multiple||this.maxChips>0||!this.chipsEl)return void(0!==this.overflowCount&&(this.overflowCount=0));const e=Array.from(this.chipsEl.querySelectorAll(".co-ref-field__chip"));if(0===e.length)return void(0!==this.overflowCount&&(this.overflowCount=0));const i=this.chipsEl.getBoundingClientRect().right;let t=0;for(let o=e.length-1;o>=0&&e[o].getBoundingClientRect().right>i+1;o--)t++;t!==this.overflowCount&&(this.overflowCount=t)}onOpenChange(e){e?(this.hasPanelSlot=!!this.el.querySelector(':scope > [slot="panel"]'),this.coOpen.emit(),this.pendingFocus=!0):(this.coClose.emit(),this.restoreTriggerFocus())}onInheritedLabelChange(){requestAnimationFrame(this.measureInherited)}restoreTriggerFocus(){var e;const i=document.activeElement;(i===this.el||this.el.contains(i))&&(null===(e=this.triggerEl)||void 0===e||e.focus())}async selectOption(e){this.handleOptionClick(e)}async closePanel(){this.isOpen=!1}async openPanel(){this.disabled||(this.isOpen=!0)}renderTrigger(){const e=this.effectiveDisplayItems,i=e.length>0;return t("div",{class:{"co-ref-field__trigger":!0,"co-ref-field--open":this.isOpen,"co-ref-field--disabled":this.disabled,[`co-ref-field--${this.normalizedSize}`]:!0,[`co-ref-field--${this.status}`]:"default"!==this.status,"co-ref-field--flat":"flat"===this.variant},role:"combobox","aria-expanded":this.isOpen?"true":"false","aria-haspopup":"listbox","aria-label":this.label||void 0,"aria-disabled":this.disabled?"true":void 0,"aria-controls":this.isOpen?c.LIST_ID:void 0,tabIndex:this.disabled?-1:0,ref:e=>this.triggerEl=e,onClick:this.handleTriggerClick,onKeyDown:this.handleTriggerKeyDown},this.iconLeft&&t("span",{class:"co-ref-field__icon"},t("co-icon",{name:this.iconLeft,size:16})),t("div",{class:"co-ref-field__value"},!i&&this.inheritedLabel&&t("co-tooltip",{block:!0,class:"co-ref-field__inherited-tip",content:this.inheritedLabel,placement:"top",disabled:!this.inheritedTruncated},t("span",{class:"co-ref-field__inherited",part:"trigger-inherited",ref:this.setInheritedEl},this.inheritedLabel)),!i&&!this.inheritedLabel&&t("span",{class:"co-ref-field__placeholder",part:"trigger-placeholder"},this.placeholder),i&&!this.multiple&&this.renderSingleValue(e[0]),i&&this.multiple&&this.renderMultipleValue(e)),!i&&this.inheritedLabel&&this.inheritedBadgeLabel&&t("span",{class:"co-ref-field__inherited-badge",part:"trigger-inherited-badge"},this.inheritedBadgeLabel),i&&this.triggerBadgeIcon&&t("span",{class:"co-ref-field__trigger-badge",part:"trigger-badge",role:"img",title:this.triggerBadgeLabel||void 0,"aria-label":this.triggerBadgeLabel||void 0},t("co-icon",{name:this.triggerBadgeIcon,size:11,weight:"fill"})),i&&!this.multiple&&this.editable&&!this.disabled&&t("button",{class:"co-ref-field__edit",part:"trigger-edit",tabIndex:-1,onClick:this.handleEditClick,type:"button",title:this.editLabel||void 0,"aria-label":this.editLabel||void 0},t("co-icon",{name:"pencil-simple",size:14})),i&&this.clearable&&!this.disabled&&t("button",{class:"co-ref-field__clear",part:"trigger-clear",tabIndex:-1,onClick:this.handleClear,type:"button"},t("co-icon",{name:"x",size:14})),t("span",{class:"co-ref-field__caret",part:"trigger-chevron"},t("co-icon",{name:"caret-up-down",size:16})))}renderItemAvatar(e){return e.image||e.avatar?t("co-avatar",{class:"co-ref-field__avatar",type:e.image?"image":"text",src:e.image,text:e.avatar,color:e.color,size:"xxs",shape:this.avatarShape}):e.color?t("span",{class:"co-ref-field__color-dot",style:{backgroundColor:e.color}}):null}renderSingleValue(e){return t("div",{class:"co-ref-field__selected"},this.renderItemAvatar(e),t("span",{class:"co-ref-field__selected-label",part:"trigger-text"},e.label))}renderMultipleValue(e){const i=this.maxChips>0,o=Math.min(this.overflowCount,Math.max(0,e.length-1)),r=i?e.slice(0,this.maxChips):e,c=i?e.length-this.maxChips:o,l=e.length-(i?0:o);return t("div",{class:"co-ref-field__chips-row"},t("div",{class:"co-ref-field__chips",ref:e=>this.chipsEl=e},r.map(((e,o)=>{const r="fill"===this.colorMode&&!!e.color&&!(e.image||e.avatar);return t(s,{key:e._id,baseClass:"co-ref-field__chip",label:e.label,modifiers:{"co-ref-field__chip--avatar":!(!e.image&&!e.avatar),"co-ref-field__chip--fill":r,"co-ref-field__chip--fill-light":r&&a(e.color),"co-ref-field__chip--clipped":!i&&o>=l,[`co-ref-field__chip--${this.normalizedSize}`]:!0},style:r?{backgroundColor:e.color}:void 0,onRemove:i=>this.handleRemoveChip(e._id,i)},e.image||e.avatar?this.renderItemAvatar(e):e.color&&!r?t("span",{class:"co-ref-field__chip-dot",style:{backgroundColor:e.color}}):null)}))),c>0&&t("span",{class:"co-ref-field__chip-overflow"},"+",c))}renderFooter(e){return this.showFooter?t("div",{class:"co-ref-field__footer",slot:e?"footer":void 0},this.footerSecondaryLabel&&t("button",{class:"co-ref-field__footer-btn co-ref-field__footer-btn--secondary",type:"button",onClick:this.handleFooterSecondary},t("co-icon",{name:"plus",size:16}),t("span",null,this.footerSecondaryLabel)),t("button",{class:"co-ref-field__footer-btn co-ref-field__footer-btn--primary",type:"button",onClick:this.handleFooterPrimary},t("co-icon",{name:"check",size:16}),t("span",null,this.footerPrimaryLabel))):null}renderPanel(){const e={"co-ref-field__panel":!0,"co-ref-field__panel--dark":"dark"===this.panelTheme,"co-ref-field__panel--light":"light"===this.panelTheme},i=this.panelWidth?{width:this.panelWidth}:void 0;return this.hasPanelSlot?t("div",{class:Object.assign(Object.assign({},e),{"co-ref-field__panel--custom":!0}),id:c.LIST_ID,style:i},t("slot",{name:"panel"}),this.renderFooter(!1)):t("div",{class:e,style:i},t("co-option-list",{id:c.LIST_ID,ref:e=>this.optionListEl=e,items:"string"==typeof this.options?this.options:JSON.stringify(this.options),value:this.value,selectedItems:"string"==typeof this.selectedDisplay?this.selectedDisplay:JSON.stringify(this.selectedDisplay),multiple:this.multiple,selectedFirst:this.multiple,reorderable:this.multiple,pinnable:this.pinnable,listReorderable:this.listReorderable,selectedAffordance:"deselect",searchable:this.searchable,searchPlaceholder:this.searchPlaceholder,searchDebounce:this.searchDebounce,loading:this.loading,total:this.total,emptyMessage:this.emptyMessage,avatarShape:this.avatarShape,onCoSearch:e=>this.coSearch.emit(e.detail),onCoChange:e=>this.handleListChange(e.detail),onCoReorder:e=>this.handleReorder(e.detail),onCoPinToggle:e=>this.coPinToggle.emit(e.detail),onCoListReorder:e=>this.coListReorder.emit(e.detail),onCoLoadMore:()=>this.coLoadMore.emit()},t("slot",{name:"panel-footer",slot:"footer"}),this.renderFooter(!0)))}render(){return t("div",{key:"fa7de667cc9002d1a4a042b0d200524cbcb89b78",class:"co-ref-field"},(this.label||this.secondaryLabel)&&t("div",{key:"a6ddd5b71364e4f5bdf63b04faa09bfc0a32f6bc",class:"co-ref-field__labels"},this.label&&t("label",{key:"766f803c8be77f72e52e4d3cdd7b6d7a363a146a",class:"co-ref-field__label"},this.labelIcon&&t("co-icon",{key:"a8b6c7f189af4b9f37de8c3cc96cb489fd9183e4",class:"co-ref-field__label-icon",name:this.labelIcon,size:16}),this.label,t(r,{key:"643edcb040ef9a91040e8d52f628bc0af06c36ba",required:this.required})),this.secondaryLabel&&t("span",{key:"7a107c578e003760423acc6d450f2a42a0868375",class:"co-ref-field__secondary-label"},this.secondaryLabel)),t("co-popover",{key:"9938ca629c5927156ea137adfefd1d927104312b",open:this.isOpen,placement:"bottom-start",matchWidth:!this.panelWidth,offset:4,onCoOpen:this.handlePopoverOpen,onCoClose:this.handlePopoverClose},t("div",{key:"7618ea5fb13e4944596fd728cf934b5c28bd29ab",slot:"trigger"},this.renderTrigger()),this.isOpen&&this.renderPanel()),this.helperText&&t("div",{key:"1dd9fc7659e8f8791bb4b785407b0e89b32107c8",class:`co-ref-field__helper co-ref-field__helper--${this.status}`},"default"!==this.status&&t("co-icon",{key:"399674b95ebcc91581f1f1cea54451f8ee33d9da",name:"error"===this.status?"warning-circle":"success"===this.status?"check-circle":"info",size:14}),t("span",{key:"640adc4e5cd4cd742a171cac1319b75489cb7ef8"},this.helperText)))}get el(){return o(this)}static get watchers(){return{isOpen:[{onOpenChange:0}],inheritedLabel:[{onInheritedLabelChange:0}]}}};c.LIST_ID="co-ref-field-list",c.style=":host{display:block;font-family:var(--co-font-family-primary);font-size:var(--co-font-size-14);letter-spacing:var(--co-font-letter-spacing-body);line-height:1;position:relative}.co-ref-field{display:flex;flex-direction:column;gap:var(--co-spacing-sm2)}.co-ref-field__labels{display:flex;align-items:center;justify-content:space-between;padding:0 var(--co-spacing-xs);gap:var(--co-spacing-sm2)}.co-ref-field__label{display:inline-flex;align-items:center;color:var(--co-ref-field-label-color, var(--co-semantic-text-secondary));font-family:var(--co-ref-field-label-font-family, var(--co-font-family-primary));font-size:var(--co-ref-field-label-font-size, var(--co-font-size-14));font-weight:var(--co-ref-field-label-font-weight, 400);line-height:1;white-space:nowrap;cursor:default;text-transform:var(--co-ref-field-label-text-transform, none);letter-spacing:var(--co-ref-field-label-letter-spacing, var(--co-font-letter-spacing-body))}.co-ref-field__secondary-label{color:var(--co-semantic-text-muted);font-family:var(--co-font-family-mono);font-size:var(--co-font-size-12);font-weight:400;line-height:1;white-space:nowrap;text-align:right}.co-ref-field__trigger{display:flex;align-items:center;gap:var(--co-spacing-sm2);padding:var(--co-spacing-sm2) var(--co-spacing-md);background:var(--co-ref-field-trigger-bg, var(--co-semantic-surface-page));border:1px solid var(--co-ref-field-trigger-border-color, var(--co-semantic-border-field));border-radius:var(--co-border-radius-xs);min-height:40px;box-sizing:border-box;cursor:pointer;transition:border-color var(--co-motion-duration-fast) var(--co-motion-ease-out), box-shadow var(--co-motion-duration-fast) var(--co-motion-ease-out)}.co-ref-field--flat{background:transparent;border-color:transparent}.co-ref-field--s{min-height:28px;padding:var(--co-spacing-xxs) var(--co-spacing-sm);font-size:var(--co-font-size-12)}.co-ref-field--sm{min-height:32px;padding:var(--co-spacing-xs) var(--co-spacing-sm);font-size:var(--co-font-size-12)}.co-ref-field--lg{min-height:48px;padding:var(--co-spacing-sm) var(--co-spacing-lg);font-size:var(--co-font-size-16)}.co-ref-field--open{border-color:var(--co-semantic-border-focus);box-shadow:0 0 0 2px var(--co-semantic-border-focus-ring)}.co-ref-field__trigger:focus-visible{outline:none;border-color:var(--co-semantic-border-focus);box-shadow:0 0 0 2px var(--co-semantic-border-focus-ring)}.co-ref-field--disabled{background:var(--co-semantic-surface-disabled);border-color:transparent;cursor:not-allowed}.co-ref-field--error{border-color:var(--co-semantic-status-error)}.co-ref-field--success{border-color:var(--co-semantic-status-success)}.co-ref-field--warning{border-color:var(--co-color-status-review)}.co-ref-field--s .co-ref-field__selected{--co-avatar-size:20px}.co-ref-field--sm .co-ref-field__selected{--co-avatar-size:22px}.co-ref-field--md .co-ref-field__selected{--co-avatar-size:22px}.co-ref-field--lg .co-ref-field__selected{--co-avatar-size:28px}.co-ref-field__icon{flex-shrink:0;color:var(--co-semantic-text-muted);display:flex;align-items:center}.co-ref-field__label-icon{flex-shrink:0;margin-right:var(--co-spacing-xs);color:var(--co-semantic-text-secondary)}.co-ref-field__value{flex:1;min-width:0;display:flex;align-items:center}.co-ref-field__placeholder{color:var(--co-semantic-text-muted);font-size:inherit;font-weight:400;line-height:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.co-ref-field__inherited-tip{min-width:0;max-width:100%}.co-ref-field__inherited{display:block;color:var(--co-semantic-text-secondary);font-size:inherit;font-weight:400;line-height:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.co-ref-field__inherited-badge{flex-shrink:0;display:inline-flex;align-items:center;box-sizing:border-box;height:22px;padding:0 var(--co-spacing-sm2);border:1px solid var(--co-ref-field-inherited-badge-border, var(--co-semantic-border-default));border-radius:var(--co-border-radius-full);color:var(--co-ref-field-inherited-badge-color, var(--co-semantic-text-secondary));font-size:var(--co-font-size-12);font-weight:400;line-height:1;white-space:nowrap}.co-ref-field__caret{flex-shrink:0;color:var(--co-semantic-text-muted);display:flex;align-items:center}.co-ref-field__trigger-badge{flex-shrink:0;display:grid;place-items:center;width:18px;height:18px;border-radius:var(--co-border-radius-xxs);background:var(--co-ref-field-trigger-badge-bg, rgba(0, 0, 0, 0.22));color:var(--co-semantic-text-default)}.co-ref-field__clear{flex-shrink:0;display:flex;align-items:center;padding:0;margin:0;border:none;background:transparent;cursor:pointer;color:var(--co-semantic-text-muted);transition:color var(--co-motion-duration-fast) var(--co-motion-ease-out)}.co-ref-field__clear:hover{color:var(--co-semantic-text-default)}.co-ref-field__edit{flex-shrink:0;display:flex;align-items:center;padding:0;margin:0;border:none;background:transparent;cursor:pointer;color:var(--co-semantic-text-muted);transition:color var(--co-motion-duration-fast) var(--co-motion-ease-out)}.co-ref-field__edit:hover{color:var(--co-semantic-text-default)}.co-ref-field__selected{display:flex;align-items:center;gap:var(--co-spacing-sm);min-width:0}.co-ref-field__color-dot{width:10px;height:10px;min-width:10px;border-radius:var(--co-border-radius-full);flex-shrink:0}.co-ref-field__avatar{flex-shrink:0}.co-ref-field__selected-label{color:var(--co-semantic-text-default);font-size:inherit;font-weight:400;line-height:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.co-ref-field__chips-row{flex:1;min-width:0;display:flex;align-items:center;gap:var(--co-spacing-xs)}.co-ref-field__chips{flex:1;min-width:0;display:flex;flex-wrap:nowrap;overflow:hidden;gap:var(--co-spacing-xs);align-items:center}.co-ref-field__chip{display:inline-flex;align-items:center;gap:var(--co-spacing-sm);padding:0 var(--co-spacing-sm2);background:var(--co-color-gray-100);border-radius:var(--co-border-radius-full);line-height:1;max-width:min(160px, 100%);flex-shrink:0}.co-ref-field__chip--avatar{padding-left:var(--co-spacing-xxs)}.co-ref-field__chip--s{min-height:20px;--co-avatar-size:20px;font-size:var(--co-font-size-12)}.co-ref-field__chip--sm{min-height:22px;--co-avatar-size:22px;font-size:var(--co-font-size-12)}.co-ref-field__chip--md{min-height:22px;--co-avatar-size:22px;font-size:var(--co-font-size-14)}.co-ref-field__chip--lg{min-height:28px;--co-avatar-size:28px;font-size:var(--co-font-size-14)}.co-ref-field__chip--clipped{visibility:hidden}.co-ref-field__chip-dot{width:8px;height:8px;min-width:8px;border-radius:var(--co-border-radius-full);flex-shrink:0}.co-ref-field__chip--fill{color:var(--co-color-base-blanco);border-radius:var(--co-spacing-sm)}.co-ref-field__chip--fill-light{color:var(--co-color-base-negro)}.co-ref-field__chip--fill .co-ref-field__chip-label,.co-ref-field__chip--fill .co-ref-field__chip-remove{color:inherit}.co-ref-field__chip--fill .co-ref-field__chip-remove{opacity:0.72}.co-ref-field__chip--fill .co-ref-field__chip-remove:hover{color:inherit;opacity:1}.co-ref-field__chip-label{color:var(--co-semantic-text-default);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}.co-ref-field__chip-remove{display:flex;align-items:center;padding:0;margin:0;border:none;background:transparent;cursor:pointer;color:var(--co-color-gray-500);transition:color var(--co-motion-duration-fast) var(--co-motion-ease-out);flex-shrink:0}.co-ref-field__chip-remove:hover{color:var(--co-semantic-text-default)}.co-ref-field__chip-overflow{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;padding:var(--co-spacing-xs) var(--co-spacing-sm);background:var(--co-color-opacity-negro-8);border-radius:var(--co-border-radius-full);font-size:var(--co-font-size-12);font-weight:600;color:var(--co-semantic-text-secondary);line-height:1}.co-ref-field__panel{display:flex;flex-direction:column;border-radius:var(--co-border-radius-sm, 12px);overflow:hidden}.co-ref-field__panel--dark{--co-semantic-surface-page:#0A0A0A;--co-semantic-surface-primary:#0A0A0A;--co-semantic-surface-hover:rgba(255, 255, 255, 0.08);--co-semantic-surface-muted:rgba(255, 255, 255, 0.12);--co-semantic-text-default:#ffffff;--co-semantic-text-secondary:rgba(255, 255, 255, 0.8);--co-semantic-text-muted:rgba(255, 255, 255, 0.5);--co-semantic-border-subtle:rgba(255, 255, 255, 0.12);--co-semantic-border-default:rgba(255, 255, 255, 0.16);background:#0A0A0A;color:#ffffff}.co-ref-field__panel--light{--co-semantic-surface-page:#ffffff;--co-semantic-surface-primary:#ffffff;--co-semantic-surface-hover:var(--co-color-gray-100, #f5f5f5);--co-semantic-surface-muted:var(--co-color-gray-200, #e5e5e5);--co-semantic-text-default:var(--co-color-gray-700, #1F1C1B);--co-semantic-text-secondary:rgba(0, 0, 0, 0.6);--co-semantic-text-muted:rgba(0, 0, 0, 0.45);--co-semantic-border-subtle:var(--co-color-gray-200, #e5e5e5);--co-semantic-border-default:var(--co-color-gray-300, #d4d4d4);background:#ffffff;color:var(--co-color-gray-700, #1F1C1B)}.co-ref-field__footer{display:flex;gap:var(--co-spacing-sm2);border-top:1px solid var(--co-semantic-border-subtle);padding:var(--co-spacing-sm2)}.co-ref-field__footer-btn{flex:1;display:flex;align-items:center;justify-content:center;gap:var(--co-spacing-sm);padding:var(--co-spacing-sm2) var(--co-spacing-md);border-radius:var(--co-border-radius-xs);font-family:var(--co-font-family-primary);font-size:var(--co-font-size-12, 12px);font-weight:500;line-height:1;letter-spacing:var(--co-font-letter-spacing-body);white-space:nowrap;cursor:pointer;transition:opacity var(--co-motion-duration-fast) var(--co-motion-ease-out);box-sizing:border-box;min-height:32px}.co-ref-field__footer-btn:hover{opacity:0.85}.co-ref-field__footer-btn--secondary{background:transparent;color:var(--co-semantic-text-default);border:1px solid var(--co-semantic-border-default)}.co-ref-field__footer-btn--primary{background:var(--co-semantic-surface-primary);color:var(--co-semantic-on-primary);border:none}.co-ref-field__helper{display:flex;align-items:center;gap:var(--co-spacing-xs);padding:0 var(--co-spacing-xs);font-size:var(--co-font-size-14);font-weight:400;color:var(--co-semantic-text-muted)}.co-ref-field__helper--error{color:var(--co-semantic-status-error)}.co-ref-field__helper--success{color:var(--co-semantic-status-success)}.co-ref-field__helper--warning{color:var(--co-color-status-review)}:host([layout='horizontal']) .co-ref-field{display:grid;grid-template-columns:var(--co-field-label-width, max-content) 1fr;align-items:start;column-gap:var(--co-spacing-md);row-gap:var(--co-spacing-sm2)}:host([layout='horizontal']) .co-ref-field__labels{grid-column:1;grid-row:1;padding-top:var(--co-spacing-sm2);min-width:0}:host([layout='horizontal']) .co-ref-field__label{white-space:normal}:host([layout='horizontal']) .co-ref-field>:not(.co-ref-field__labels){grid-column:2;min-width:0}.co-field-required{margin-left:2px;color:var(--co-color-status-error)}.co-field-required__caption{margin-left:4px;color:var(--co-semantic-text-muted);font-size:var(--co-font-size-12);font-weight:400}.co-field-required__caption::before{content:var(--co-field-required-text, ' (required)')}";export{c as co_ref_field}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,h as o,a as i}from"./p-DH5lfRNj.js";import{c as s,g as e,f as a}from"./p-DFHRS9cJ.js";const r=class{constructor(o){t(this,o),this.content="",this.placement="top",this.offset=8,this.showDelay=80,this.hideDelay=100,this.disabled=!1,this.arrow=!0,this.flip=!0,this.maxWidth="280px",this.block=!1,this.visible=!1,this.actualPlacement="top",this.closing=!1,this.suppressed=!1,this.scrollParents=[],this.cachedOffsetAncestor=null,this.offsetAncestorComputed=!1,this.scheduleShow=()=>{this.disabled||!this.content||this.suppressed||(this.clearHideTimeout(),this.visible||(this.showTimeout=setTimeout((()=>{this.visible=!0}),this.showDelay)))},this.scheduleHide=()=>{this.clearShowTimeout(),this.visible&&(this.hideTimeout=setTimeout((()=>{this.visible=!1}),this.hideDelay))},this.hideImmediate=()=>{this.clearTimers(),this.visible=!1},this.finishClose=()=>{clearTimeout(this.closeFallbackTimer),this.visible||(this.closing=!1,this.panelEl=void 0)},this.handlePanelTransitionEnd=t=>{!this.visible&&this.closing&&t.target===this.panelEl&&"opacity"===t.propertyName&&this.finishClose()},this.handleMouseEnter=()=>{this.scheduleShow()},this.handleMouseLeave=()=>{this.suppressed=!1,this.scheduleHide()},this.handlePointerDown=()=>{this.suppressed=!0,this.hideImmediate()},this.handleFocusIn=()=>{this.scheduleShow()},this.handleFocusOut=()=>{this.suppressed=!1,this.scheduleHide()},this.handleKeyDown=t=>{"Escape"===t.key&&this.visible&&this.hideImmediate()},this.updatePosition=()=>{if(!this.visible||!this.triggerEl||!this.panelEl)return;const t=this.triggerEl.getBoundingClientRect(),o=this.panelEl.getBoundingClientRect();if(0===o.width&&0===o.height)return;const{top:i,left:a,actualPlacement:r}=s(t,o,{placement:this.placement,offset:this.offset,flip:this.flip});this.actualPlacement=r;let n=i,h=a;if(!this.panelEl.matches(":popover-open")&&(this.offsetAncestorComputed||(this.cachedOffsetAncestor=e(this.panelEl),(this.cachedOffsetAncestor||this.panelEl.isConnected)&&(this.offsetAncestorComputed=!0)),this.cachedOffsetAncestor)){const t=this.cachedOffsetAncestor.getBoundingClientRect();n-=t.top,h-=t.left}this.panelEl&&(this.panelEl.style.top=`${n}px`,this.panelEl.style.left=`${h}px`,this.panelEl.classList.add("co-tooltip__panel--positioned"))},this.scheduleUpdate=()=>{this.rafId&&cancelAnimationFrame(this.rafId),this.rafId=requestAnimationFrame(this.updatePosition)}}disconnectedCallback(){this.clearTimers(),this.cleanupListeners(),clearTimeout(this.closeFallbackTimer),this.closing=!1}onVisibleChange(t){t?(this.closing=!1,clearTimeout(this.closeFallbackTimer),this.scheduleUpdate(),requestAnimationFrame((()=>{requestAnimationFrame((()=>{this.updatePosition()}))})),this.addScrollListeners()):(this.cleanupListeners(),this.cachedOffsetAncestor=null,this.offsetAncestorComputed=!1,this.closing=!0,clearTimeout(this.closeFallbackTimer),this.closeFallbackTimer=setTimeout((()=>this.finishClose()),250))}onDisabledChange(t){t&&this.visible&&(this.visible=!1,this.clearTimers())}clearShowTimeout(){this.showTimeout&&(clearTimeout(this.showTimeout),this.showTimeout=void 0)}clearHideTimeout(){this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=void 0)}clearTimers(){this.clearShowTimeout(),this.clearHideTimeout()}promotePanel(){const t=this.panelEl;if(t&&"function"==typeof t.showPopover)try{t.matches(":popover-open")||t.showPopover()}catch(t){}}addScrollListeners(){window.addEventListener("resize",this.scheduleUpdate,{passive:!0}),window.addEventListener("scroll",this.scheduleUpdate,{passive:!0,capture:!0}),this.scrollParents=a(this.el);for(const t of this.scrollParents)t.addEventListener("scroll",this.scheduleUpdate,{passive:!0})}cleanupListeners(){this.rafId&&(cancelAnimationFrame(this.rafId),this.rafId=void 0),window.removeEventListener("resize",this.scheduleUpdate),window.removeEventListener("scroll",this.scheduleUpdate,{capture:!0});for(const t of this.scrollParents)t.removeEventListener("scroll",this.scheduleUpdate);this.scrollParents=[]}render(){const t=this.actualPlacement.split("-")[0];return o("div",{key:"f02722680bdcda5ad96f395d6759fac291c40485",class:"co-tooltip"},o("div",{key:"10a259df8bc3bf039fe94257597c7065ec5306b7",class:"co-tooltip__trigger",ref:t=>this.triggerEl=t,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave,onPointerDown:this.handlePointerDown,onFocusin:this.handleFocusIn,onFocusout:this.handleFocusOut,onKeyDown:this.handleKeyDown,"aria-describedby":this.visible?"tooltip-panel":void 0},o("slot",{key:"a9829875262900841ca3b66fdccda1c8f87e6715"})),(this.visible||this.closing)&&this.content&&o("div",{key:"daaafa93cd8360ccb01cdaf862fe7240a1f56abd",id:"tooltip-panel",class:{"co-tooltip__panel":!0,[`co-tooltip__panel--${t}`]:!0,"co-tooltip__panel--closing":this.closing},role:"tooltip",popover:"manual",onTransitionEnd:this.handlePanelTransitionEnd,ref:t=>{t&&t!==this.panelEl&&(this.panelEl=t,this.promotePanel(),this.scheduleUpdate())},style:{maxWidth:this.maxWidth}},this.arrow&&o("div",{key:"2f47f815efe70e6f5f51ed792080ec9e11312976",class:`co-tooltip__arrow co-tooltip__arrow--${t}`}),o("span",{key:"92bbcdb27aa99c93e467c16343ac293a21f59424",class:"co-tooltip__content"},this.content)))}get el(){return i(this)}static get watchers(){return{visible:[{onVisibleChange:0}],disabled:[{onDisabledChange:0}]}}};r.style=":host{display:inline-block;position:relative}.co-tooltip{display:inline-block}.co-tooltip__trigger{display:inline-block}:host([block]){display:block;width:100%;min-width:0}:host([block]) .co-tooltip,:host([block]) .co-tooltip__trigger{display:block;width:100%;min-width:0}.co-tooltip__panel{position:fixed;inset:auto;top:0;left:0;margin:0;border:0;max-height:none;overflow:visible;z-index:10000;visibility:hidden;opacity:0;pointer-events:none;background:var(--co-color-base-negro, #1f1c1b);color:var(--co-color-base-blanco, #fff);font-family:var(--co-font-family-primary, 'Geist', sans-serif);font-size:var(--co-font-size-12, 12px);line-height:1.4;font-weight:400;text-transform:none;letter-spacing:var(--co-font-letter-spacing-body, normal);padding:var(--co-spacing-xs, 4px) var(--co-spacing-sm, 8px);border-radius:var(--co-border-radius-xxs, 4px);box-shadow:0 4px 12px rgba(31, 28, 27, 0.12);white-space:normal;word-wrap:break-word;transition:opacity var(--co-motion-duration-fast) var(--co-motion-ease-out), transform var(--co-motion-duration-fast) var(--co-motion-ease-out)}.co-tooltip__panel--positioned{visibility:visible;opacity:1}.co-tooltip__panel--closing{visibility:visible;opacity:0;transition:opacity var(--co-motion-duration-instant) var(--co-motion-ease-in), transform var(--co-motion-duration-instant) var(--co-motion-ease-in)}.co-tooltip__panel--top{transform:translateY(4px)}.co-tooltip__panel--top.co-tooltip__panel--positioned{transform:translateY(0)}.co-tooltip__panel--bottom{transform:translateY(-4px)}.co-tooltip__panel--bottom.co-tooltip__panel--positioned{transform:translateY(0)}.co-tooltip__panel--left{transform:translateX(4px)}.co-tooltip__panel--left.co-tooltip__panel--positioned{transform:translateX(0)}.co-tooltip__panel--right{transform:translateX(-4px)}.co-tooltip__panel--right.co-tooltip__panel--positioned{transform:translateX(0)}.co-tooltip__arrow{position:absolute;width:0;height:0;border:5px solid transparent}.co-tooltip__arrow--top{bottom:-10px;left:50%;transform:translateX(-50%);border-top-color:var(--co-color-base-negro, #1f1c1b);border-bottom:none}.co-tooltip__arrow--bottom{top:-5px;left:50%;transform:translateX(-50%);border-bottom-color:var(--co-color-base-negro, #1f1c1b);border-top:none}.co-tooltip__arrow--left{right:-10px;top:50%;transform:translateY(-50%);border-left-color:var(--co-color-base-negro, #1f1c1b);border-right:none}.co-tooltip__arrow--right{left:-5px;top:50%;transform:translateY(-50%);border-right-color:var(--co-color-base-negro, #1f1c1b);border-left:none}.co-tooltip__content{display:block}";export{r as co_tooltip}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as i,c as t,h as e,H as o,a as s}from"./p-DH5lfRNj.js";const r={es:{play:"Reproducir",pause:"Pausar",mute:"Silenciar",unmute:"Activar sonido",volume:"Volumen",fullscreen:"Pantalla completa",exitFullscreen:"Salir de pantalla completa",speed:"Velocidad",pip:"Imagen en imagen",exitPip:"Salir de imagen en imagen",download:"Descargar",seek:"Buscar",normal:"Normal",error:"Error al reproducir el video",retry:"Reintentar",player:"Reproductor de video"},en:{play:"Play",pause:"Pause",mute:"Mute",unmute:"Unmute",volume:"Volume",fullscreen:"Fullscreen",exitFullscreen:"Exit fullscreen",speed:"Speed",pip:"Picture in picture",exitPip:"Exit picture in picture",download:"Download",seek:"Seek",normal:"Normal",error:"Error playing video",retry:"Retry",player:"Video player"},pt:{play:"Reproduzir",pause:"Pausar",mute:"Silenciar",unmute:"Ativar som",volume:"Volume",fullscreen:"Tela cheia",exitFullscreen:"Sair da tela cheia",speed:"Velocidade",pip:"Imagem em imagem",exitPip:"Sair de imagem em imagem",download:"Baixar",seek:"Buscar",normal:"Normal",error:"Erro ao reproduzir o vídeo",retry:"Tentar novamente",player:"Reprodutor de vídeo"}},a={1:{es:"La carga del video fue interrumpida",en:"Video loading was aborted",pt:"O carregamento do vídeo foi interrompido"},2:{es:"Error de red al cargar el video",en:"Network error while loading video",pt:"Erro de rede ao carregar o vídeo"},3:{es:"Error al decodificar el video",en:"Error decoding video",pt:"Erro ao decodificar o vídeo"},4:{es:"Formato de video no soportado",en:"Video format not supported",pt:"Formato de vídeo não suportado"}},n=class{constructor(e){i(this,e),this.coPlay=t(this,"coPlay",7),this.coPause=t(this,"coPause",7),this.coEnded=t(this,"coEnded",7),this.coReady=t(this,"coReady",7),this.coError=t(this,"coError",7),this.coTimeUpdate=t(this,"coTimeUpdate",3),this.coSeeked=t(this,"coSeeked",7),this.coVolumeChange=t(this,"coVolumeChange",7),this.coFullscreenChange=t(this,"coFullscreenChange",7),this.coPlaybackRateChange=t(this,"coPlaybackRateChange",7),this.coPipChange=t(this,"coPipChange",7),this.coDownload=t(this,"coDownload",7),this.coThresholdReached=t(this,"coThresholdReached",7),this.src="",this.poster="",this.type="",this.preload="metadata",this.autoplay=!1,this.loop=!1,this.muted=!1,this.volume=1,this.currentTime=0,this.playbackRate=1,this.playbackRates="[0.5, 0.75, 1, 1.25, 1.5, 2]",this.controls=!0,this.showPlay=!0,this.showVolume=!0,this.showProgress=!0,this.showTime=!0,this.showFullscreen=!0,this.showSpeed=!1,this.showPip=!1,this.showDownload=!1,this.allowDownload=!1,this.aspectRatio="16:9",this.rounded="lg",this.controlsAutoHide=!0,this.controlsAutoHideDelay=3e3,this.disabled=!1,this.watchThreshold=0,this.locale="es",this.isPlaying=!1,this.internalCurrentTime=0,this.duration=0,this.buffered=0,this.volumeLevel=1,this.isMuted=!1,this.isFullscreen=!1,this.internalPlaybackRate=1,this.isLoading=!0,this.showControlBar=!0,this.hasError=!1,this.errorMessage="",this.showSpeedMenu=!1,this.isPip=!1,this.thresholdFired=!1,this.hasStarted=!1,this.isSeeking=!1,this.showVolumeSlider=!1,this.lastTimeUpdateEmit=0,this.parsedRates=[.5,.75,1,1.25,1.5,2],this.seekFromTime=0,this.externalTimeUpdate=!1,this.resetControlsTimer=()=>{this.controlsAutoHide&&this.controls&&(this.showControlBar=!0,this.controlsTimer&&clearTimeout(this.controlsTimer),this.controlsTimer=setTimeout((()=>{this.isPlaying&&!this.showSpeedMenu&&(this.showControlBar=!1)}),this.controlsAutoHideDelay))},this.handleContainerMouseMove=()=>{this.resetControlsTimer()},this.handleContainerMouseLeave=()=>{this.isPlaying&&this.controlsAutoHide&&(this.showControlBar=!1,this.showSpeedMenu=!1)},this.handleContainerTouchStart=()=>{this.controlsAutoHide&&(this.showControlBar&&this.isPlaying?this.showControlBar=!1:this.resetControlsTimer())},this.onLoadedMetadata=()=>{this.videoEl&&(this.duration=this.videoEl.duration,this.hasError=!1,this.coReady.emit({duration:this.duration,width:this.videoEl.videoWidth,height:this.videoEl.videoHeight}),this.currentTime>0&&this.currentTime<this.duration&&(this.videoEl.currentTime=this.currentTime))},this.onPlay=()=>{this.isPlaying=!0,this.hasStarted=!0,this.coPlay.emit(),this.resetControlsTimer()},this.onPause=()=>{this.isPlaying=!1,this.showControlBar=!0,this.coPause.emit(),this.controlsTimer&&clearTimeout(this.controlsTimer)},this.onEnded=()=>{this.isPlaying=!1,this.showControlBar=!0,this.coEnded.emit()},this.onTimeUpdate=()=>{if(!this.videoEl||this.isSeeking)return;this.internalCurrentTime=this.videoEl.currentTime,this.externalTimeUpdate=!0,this.currentTime=this.videoEl.currentTime;const i=performance.now();if(i-this.lastTimeUpdateEmit>250){this.lastTimeUpdateEmit=i;const t=this.duration>0?Math.round(this.internalCurrentTime/this.duration*100):0;this.coTimeUpdate.emit({currentTime:this.internalCurrentTime,duration:this.duration,progressPercent:t}),this.watchThreshold>0&&!this.thresholdFired&&t>=this.watchThreshold&&(this.thresholdFired=!0,this.coThresholdReached.emit({threshold:this.watchThreshold,currentTime:this.internalCurrentTime,duration:this.duration}))}},this.onWaiting=()=>{this.isLoading=!0},this.onCanPlay=()=>{this.isLoading=!1},this.onError=()=>{var i,t;if(!(null===(i=this.videoEl)||void 0===i?void 0:i.error))return;const e=this.videoEl.error.code,o=(null===(t=a[e])||void 0===t?void 0:t[this.locale])||this.t.error;this.hasError=!0,this.errorMessage=o,this.isLoading=!1,this.coError.emit({code:e,message:o})},this.onProgress=()=>{if(!this.videoEl||this.duration<=0)return;const i=this.videoEl.buffered;i.length>0&&(this.buffered=i.end(i.length-1)/this.duration*100)},this.onNativeVolumeChange=()=>{this.videoEl&&(this.volumeLevel=this.videoEl.volume,this.isMuted=this.videoEl.muted,this.volume=this.videoEl.volume,this.muted=this.videoEl.muted,this.coVolumeChange.emit({volume:this.volumeLevel,muted:this.isMuted}))},this.onNativeRateChange=()=>{this.videoEl&&(this.internalPlaybackRate=this.videoEl.playbackRate,this.playbackRate=this.videoEl.playbackRate,this.coPlaybackRateChange.emit({rate:this.internalPlaybackRate}))},this.handlePlayClick=()=>{!this.disabled&&this.videoEl&&(this.isPlaying?this.videoEl.pause():this.videoEl.play().catch((()=>{})))},this.handleBigPlayClick=()=>{this.disabled||this.handlePlayClick()},this.handleMuteClick=()=>{!this.disabled&&this.videoEl&&(this.videoEl.muted=!this.videoEl.muted)},this.isDraggingVolume=!1,this.handleVolumeMouseEnter=()=>{this.showVolumeSlider=!0},this.handleVolumeMouseLeave=()=>{this.isDraggingVolume||(this.showVolumeSlider=!1)},this.handleProgressPointerDown=i=>{if(this.disabled||!this.videoEl)return;i.preventDefault(),this.isSeeking=!0,this.seekFromTime=this.videoEl.currentTime,this.seekFromPointerEvent(i);const t=i=>this.seekFromPointerEvent(i),e=()=>{this.videoEl&&this.coSeeked.emit({from:this.seekFromTime,to:this.videoEl.currentTime}),this.isSeeking=!1,document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",e)};document.addEventListener("pointermove",t),document.addEventListener("pointerup",e)},this.handleVolumePointerDown=i=>{if(this.disabled||!this.videoEl)return;i.preventDefault(),i.stopPropagation(),this.isDraggingVolume=!0,this.showVolumeSlider=!0,this.setVolumeFromPointerEvent(i);const t=i=>this.setVolumeFromPointerEvent(i),e=()=>{this.isDraggingVolume=!1,document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",e)};document.addEventListener("pointermove",t),document.addEventListener("pointerup",e)},this.handleSpeedClick=i=>{i.stopPropagation(),this.showSpeedMenu=!this.showSpeedMenu},this.handleSpeedSelect=i=>{!this.disabled&&this.videoEl&&(this.videoEl.playbackRate=i,this.showSpeedMenu=!1)},this.handleFullscreenClick=()=>{if(!this.disabled)if(document.fullscreenElement||document.webkitFullscreenElement)document.exitFullscreen?document.exitFullscreen().catch((()=>{})):document.webkitExitFullscreen&&document.webkitExitFullscreen();else{const i=this.el;i.requestFullscreen?i.requestFullscreen().catch((()=>{})):i.webkitRequestFullscreen?i.webkitRequestFullscreen():this.videoEl&&this.videoEl.webkitEnterFullscreen&&this.videoEl.webkitEnterFullscreen()}},this.handleFullscreenChange=()=>{const i=document.fullscreenElement||document.webkitFullscreenElement;this.isFullscreen=i===this.el,this.coFullscreenChange.emit({fullscreen:this.isFullscreen})},this.handlePipClick=async()=>{if(!this.disabled&&this.videoEl)try{this.isPip?await document.exitPictureInPicture():await this.videoEl.requestPictureInPicture()}catch(i){}},this.handleEnterPip=()=>{this.isPip=!0,this.coPipChange.emit({pip:!0})},this.handleLeavePip=()=>{this.isPip=!1,this.coPipChange.emit({pip:!1})},this.handleDownloadClick=()=>{if(!this.allowDownload||!this.src)return;this.coDownload.emit({src:this.src});const i=document.createElement("a");i.href=this.src,i.download="",i.target="_blank",i.rel="noopener",document.body.appendChild(i),i.click(),document.body.removeChild(i)},this.handleRetryClick=()=>{this.videoEl&&(this.hasError=!1,this.errorMessage="",this.isLoading=!0,this.videoEl.load())},this.handleKeyDown=i=>{var t,e;if(this.disabled||!this.videoEl)return;const o=null===(e=null===(t=i.target)||void 0===t?void 0:t.tagName)||void 0===e?void 0:e.toLowerCase();if("input"!==o&&"textarea"!==o)switch(i.key){case" ":case"k":case"K":i.preventDefault(),this.handlePlayClick();break;case"ArrowRight":i.preventDefault(),this.videoEl.currentTime=Math.min(this.duration,this.videoEl.currentTime+5);break;case"ArrowLeft":i.preventDefault(),this.videoEl.currentTime=Math.max(0,this.videoEl.currentTime-5);break;case"ArrowUp":i.preventDefault(),this.videoEl.volume=Math.min(1,this.videoEl.volume+.1);break;case"ArrowDown":i.preventDefault(),this.videoEl.volume=Math.max(0,this.videoEl.volume-.1);break;case"m":case"M":i.preventDefault(),this.handleMuteClick();break;case"f":case"F":i.preventDefault(),this.handleFullscreenClick();break;case"Escape":this.showSpeedMenu&&(i.preventDefault(),this.showSpeedMenu=!1)}},this.handleVideoAreaClick=()=>{this.disabled||(this.handlePlayClick(),this.resetControlsTimer())}}get t(){return r[this.locale]||r.es}get progressPercent(){return this.duration<=0?0:this.internalCurrentTime/this.duration*100}get pipSupported(){return"undefined"!=typeof document&&"pictureInPictureEnabled"in document&&document.pictureInPictureEnabled}onSrcChange(){this.resetState()}onMutedChange(){this.videoEl&&(this.videoEl.muted=this.muted),this.isMuted=this.muted}onVolumeChange(){const i=Math.max(0,Math.min(1,this.volume));this.videoEl&&(this.videoEl.volume=i),this.volumeLevel=i}onCurrentTimeChange(){this.externalTimeUpdate?this.externalTimeUpdate=!1:this.videoEl&&Math.abs(this.videoEl.currentTime-this.currentTime)>.5&&(this.videoEl.currentTime=this.currentTime)}onPlaybackRateChange(){this.videoEl&&(this.videoEl.playbackRate=this.playbackRate),this.internalPlaybackRate=this.playbackRate}onPlaybackRatesChange(){this.parseRates()}componentWillLoad(){var i,t;this.parseRates(),this.volumeLevel=Math.max(0,Math.min(1,null!==(i=this.volume)&&void 0!==i?i:1)),this.isMuted=null!==(t=this.muted)&&void 0!==t&&t,this.internalPlaybackRate=this.playbackRate||1}componentDidLoad(){this.videoEl&&(this.bindVideoEvents(),this.videoEl.volume=this.volumeLevel,this.videoEl.muted=this.isMuted,this.videoEl.playbackRate=this.internalPlaybackRate,this.videoEl.readyState>=1&&this.onLoadedMetadata(),this.videoEl.readyState>=3&&this.onCanPlay(),this.autoplay&&this.muted&&this.videoEl.play().catch((()=>{}))),document.addEventListener("fullscreenchange",this.handleFullscreenChange),document.addEventListener("webkitfullscreenchange",this.handleFullscreenChange)}disconnectedCallback(){this.controlsTimer&&clearTimeout(this.controlsTimer),document.removeEventListener("fullscreenchange",this.handleFullscreenChange),document.removeEventListener("webkitfullscreenchange",this.handleFullscreenChange),this.videoEl&&(this.videoEl.removeEventListener("loadedmetadata",this.onLoadedMetadata),this.videoEl.removeEventListener("play",this.onPlay),this.videoEl.removeEventListener("pause",this.onPause),this.videoEl.removeEventListener("ended",this.onEnded),this.videoEl.removeEventListener("timeupdate",this.onTimeUpdate),this.videoEl.removeEventListener("waiting",this.onWaiting),this.videoEl.removeEventListener("canplay",this.onCanPlay),this.videoEl.removeEventListener("error",this.onError),this.videoEl.removeEventListener("progress",this.onProgress),this.videoEl.removeEventListener("volumechange",this.onNativeVolumeChange),this.videoEl.removeEventListener("ratechange",this.onNativeRateChange),this.videoEl.removeEventListener("enterpictureinpicture",this.handleEnterPip),this.videoEl.removeEventListener("leavepictureinpicture",this.handleLeavePip))}async play(){var i;await(null===(i=this.videoEl)||void 0===i?void 0:i.play())}async pause(){var i;null===(i=this.videoEl)||void 0===i||i.pause()}async togglePlay(){var i,t;this.isPlaying?null===(i=this.videoEl)||void 0===i||i.pause():await(null===(t=this.videoEl)||void 0===t?void 0:t.play())}async seek(i){this.videoEl&&(this.videoEl.currentTime=i)}async setVolume(i){const t=Math.max(0,Math.min(1,i));this.volume=t,this.videoEl&&(this.videoEl.volume=t),this.volumeLevel=t}async toggleMute(){this.handleMuteClick()}async toggleFullscreen(){this.handleFullscreenClick()}async togglePip(){this.handlePipClick()}parseRates(){try{const i=JSON.parse(this.playbackRates);Array.isArray(i)&&(this.parsedRates=i.filter((i=>"number"==typeof i&&i>0)).sort(((i,t)=>i-t)))}catch(i){this.parsedRates=[.5,.75,1,1.25,1.5,2]}}resetState(){this.isPlaying=!1,this.internalCurrentTime=0,this.duration=0,this.buffered=0,this.hasError=!1,this.errorMessage="",this.thresholdFired=!1,this.hasStarted=!1,this.isLoading=!0,this.showSpeedMenu=!1}bindVideoEvents(){this.videoEl&&(this.videoEl.addEventListener("loadedmetadata",this.onLoadedMetadata),this.videoEl.addEventListener("play",this.onPlay),this.videoEl.addEventListener("pause",this.onPause),this.videoEl.addEventListener("ended",this.onEnded),this.videoEl.addEventListener("timeupdate",this.onTimeUpdate),this.videoEl.addEventListener("waiting",this.onWaiting),this.videoEl.addEventListener("canplay",this.onCanPlay),this.videoEl.addEventListener("error",this.onError),this.videoEl.addEventListener("progress",this.onProgress),this.videoEl.addEventListener("volumechange",this.onNativeVolumeChange),this.videoEl.addEventListener("ratechange",this.onNativeRateChange),this.videoEl.addEventListener("enterpictureinpicture",this.handleEnterPip),this.videoEl.addEventListener("leavepictureinpicture",this.handleLeavePip))}formatTime(i){if(!isFinite(i)||i<0)return"0:00";const t=Math.floor(i/3600),e=Math.floor(i%3600/60),o=Math.floor(i%60);return t>0?`${t}:${e.toString().padStart(2,"0")}:${o.toString().padStart(2,"0")}`:`${e}:${o.toString().padStart(2,"0")}`}seekFromPointerEvent(i){if(!this.progressTrackEl||!this.videoEl)return;const t=this.progressTrackEl.getBoundingClientRect(),e=Math.max(0,Math.min(1,(i.clientX-t.left)/t.width))*this.duration;this.videoEl.currentTime=e,this.internalCurrentTime=e}setVolumeFromPointerEvent(i){if(!this.volumeTrackEl||!this.videoEl)return;const t=this.volumeTrackEl.getBoundingClientRect(),e=Math.max(0,Math.min(1,(i.clientX-t.left)/t.width));this.videoEl.volume=e,e>0&&this.videoEl.muted&&(this.videoEl.muted=!1)}renderBigPlayButton(){return this.isPlaying||this.hasError||this.isLoading?null:e("button",{class:"co-video__big-play",part:"big-play",onClick:this.handleBigPlayClick,"aria-label":this.t.play,tabindex:"-1"},e("div",{class:"co-video__big-play-circle"},e("co-icon",{name:"play",size:32,weight:"fill"})))}renderPoster(){return!this.poster||this.hasStarted?null:e("div",{class:"co-video__poster",part:"poster",style:{backgroundImage:`url(${this.poster})`}})}renderLoader(){return!this.isLoading||this.hasError?null:e("div",{class:"co-video__loader"},e("div",{class:"co-video__spinner"}))}renderError(){return this.hasError?e("div",{class:"co-video__error"},e("co-icon",{name:"warning-circle",size:48,weight:"regular"}),e("p",{class:"co-video__error-text"},this.errorMessage||this.t.error),e("button",{class:"co-video__error-retry",onClick:this.handleRetryClick},e("co-icon",{name:"arrow-clockwise",size:16,weight:"bold"}),this.t.retry)):null}renderProgressBar(){if(!this.showProgress)return null;const i=this.progressPercent,t=this.buffered;return e("div",{class:"co-video__progress",part:"progress",role:"slider","aria-label":this.t.seek,"aria-valuenow":Math.round(this.internalCurrentTime),"aria-valuemin":0,"aria-valuemax":Math.round(this.duration),tabindex:0,ref:i=>this.progressTrackEl=i,onPointerDown:this.handleProgressPointerDown},e("div",{class:"co-video__progress-track"},e("div",{class:"co-video__progress-buffered",style:{width:`${t}%`}}),e("div",{class:"co-video__progress-played",style:{width:`${i}%`}})),e("div",{class:"co-video__progress-thumb",style:{left:`${i}%`}}))}renderVolumeControl(){if(!this.showVolume)return null;const i=this.isMuted?0:100*this.volumeLevel;return e("div",{class:"co-video__volume",onMouseEnter:this.handleVolumeMouseEnter,onMouseLeave:this.handleVolumeMouseLeave},e("button",{class:"co-video__btn",onClick:this.handleMuteClick,"aria-label":this.isMuted?this.t.unmute:this.t.mute},e("co-icon",{name:this.isMuted||0===this.volumeLevel?"speaker-x":this.volumeLevel<.5?"speaker-low":"speaker-high",size:20,weight:"fill"})),e("div",{class:{"co-video__volume-slider-wrap":!0,"co-video__volume-slider-wrap--visible":this.showVolumeSlider}},e("div",{class:"co-video__volume-slider",onPointerDown:this.handleVolumePointerDown,role:"slider","aria-label":this.t.volume,"aria-valuenow":Math.round(i),"aria-valuemin":0,"aria-valuemax":100},e("div",{class:"co-video__volume-track",ref:i=>this.volumeTrackEl=i},e("div",{class:"co-video__volume-fill",style:{width:`${i}%`}}),e("div",{class:"co-video__volume-thumb",style:{left:`${i}%`}})))))}renderSpeedMenu(){return this.showSpeed?e("div",{class:"co-video__speed-wrap"},e("button",{class:"co-video__btn co-video__btn--speed",onClick:this.handleSpeedClick,"aria-label":this.t.speed,"aria-haspopup":"listbox","aria-expanded":this.showSpeedMenu?"true":"false"},e("span",{class:"co-video__speed-label"},1===this.internalPlaybackRate?"1x":`${this.internalPlaybackRate}x`)),this.showSpeedMenu&&e("div",{class:"co-video__speed-menu",role:"listbox","aria-label":this.t.speed},this.parsedRates.map((i=>e("button",{class:{"co-video__speed-option":!0,"co-video__speed-option--active":i===this.internalPlaybackRate},role:"option","aria-selected":i===this.internalPlaybackRate?"true":"false",onClick:()=>this.handleSpeedSelect(i)},e("span",null,1===i?this.t.normal:`${i}x`),i===this.internalPlaybackRate&&e("co-icon",{name:"check",size:14,weight:"bold"})))))):null}renderControls(){return this.controls?e("div",{class:{"co-video__controls":!0,"co-video__controls--hidden":!this.showControlBar},part:"controls",onClick:i=>i.stopPropagation()},this.renderProgressBar(),e("div",{class:"co-video__toolbar",part:"toolbar"},e("div",{class:"co-video__toolbar-left"},this.showPlay&&e("button",{class:"co-video__btn",onClick:this.handlePlayClick,"aria-label":this.isPlaying?this.t.pause:this.t.play},e("co-icon",{name:this.isPlaying?"pause":"play",size:20,weight:"fill"})),this.renderVolumeControl(),this.showTime&&e("span",{class:"co-video__time","aria-live":"off"},this.formatTime(this.internalCurrentTime)," / ",this.formatTime(this.duration))),e("div",{class:"co-video__toolbar-right"},this.renderSpeedMenu(),this.showPip&&this.pipSupported&&e("button",{class:"co-video__btn",onClick:this.handlePipClick,"aria-label":this.isPip?this.t.exitPip:this.t.pip},e("co-icon",{name:"picture-in-picture",size:20,weight:this.isPip?"fill":"regular"})),this.showDownload&&e("button",{class:{"co-video__btn":!0,"co-video__btn--disabled":!this.allowDownload},onClick:this.handleDownloadClick,"aria-label":this.t.download,disabled:!this.allowDownload},e("co-icon",{name:"download-simple",size:20,weight:"regular"})),this.showFullscreen&&e("button",{class:"co-video__btn",onClick:this.handleFullscreenClick,"aria-label":this.isFullscreen?this.t.exitFullscreen:this.t.fullscreen},e("co-icon",{name:this.isFullscreen?"corners-in":"corners-out",size:20,weight:"regular"}))))):null}render(){const i=`co-video--${this.aspectRatio.replace(":","-")}`;return e(o,{key:"57e64ad600356a7243a63db39a54ee20e45b3f81"},e("div",{key:"4f76f20be1f9c0d6994c58fc41fc5a9cda08de20",class:{"co-video":!0,[i]:!0,[`co-video--rounded-${this.rounded}`]:!0,"co-video--disabled":this.disabled,"co-video--fullscreen":this.isFullscreen,"co-video--playing":this.isPlaying},part:"container",ref:i=>this.containerEl=i,role:"region","aria-label":this.t.player,tabindex:0,onKeyDown:this.handleKeyDown,onMouseMove:this.handleContainerMouseMove,onMouseLeave:this.handleContainerMouseLeave,onTouchStart:this.handleContainerTouchStart},e("video",{key:"518abe8e649c46e5478f4f2d8b37f827fb1559c0",ref:i=>this.videoEl=i,class:"co-video__native",part:"video",src:this.src||void 0,poster:void 0,preload:this.preload,loop:this.loop,playsinline:!0,tabindex:-1,controlsList:this.allowDownload?void 0:"nodownload"}),this.renderPoster(),this.renderLoader(),this.renderBigPlayButton(),this.renderError(),e("div",{key:"368f4a7857a0def28ebfe830fff8c38280c35900",class:"co-video__click-area",onClick:this.handleVideoAreaClick}),this.renderControls()))}get el(){return s(this)}static get watchers(){return{src:[{onSrcChange:0}],muted:[{onMutedChange:0}],volume:[{onVolumeChange:0}],currentTime:[{onCurrentTimeChange:0}],playbackRate:[{onPlaybackRateChange:0}],playbackRates:[{onPlaybackRatesChange:0}]}}};n.style=":host{display:block;font-family:var(--co-font-family-primary);--co-video-controls-bg:linear-gradient(transparent, rgba(0, 0, 0, 0.75));--co-video-controls-color:#fff;--co-video-progress-height:4px;--co-video-progress-height-hover:8px;--co-video-accent:var(--co-color-base-blanco);--co-video-buffered:rgba(255, 255, 255, 0.25);--co-video-btn-hover:rgba(255, 255, 255, 0.16)}.co-video{position:relative;width:100%;background:#000;overflow:hidden;outline:none;user-select:none;-webkit-user-select:none}.co-video:focus-visible{outline:2px solid var(--co-semantic-border-focus-ring);outline-offset:2px}.co-video--16-9{aspect-ratio:16 / 9}.co-video--4-3{aspect-ratio:4 / 3}.co-video--1-1{aspect-ratio:1 / 1}.co-video--21-9{aspect-ratio:21 / 9}.co-video--auto{height:100%}.co-video--rounded-none{border-radius:0}.co-video--rounded-sm{border-radius:var(--co-border-radius-xs)}.co-video--rounded-md{border-radius:var(--co-border-radius-sm)}.co-video--rounded-lg{border-radius:var(--co-border-radius-lg)}.co-video--rounded-xl{border-radius:var(--co-border-radius-xl)}:host(:fullscreen){width:100%;height:100%}:host(:fullscreen) .co-video{border-radius:0 !important;aspect-ratio:unset;width:100%;height:100%}.co-video--disabled{opacity:0.5;pointer-events:none}.co-video__native{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;display:block}.co-video__click-area{position:absolute;inset:0;z-index:1;cursor:pointer}.co-video__poster{position:absolute;inset:0;z-index:1;background-size:cover;background-position:center;background-repeat:no-repeat}.co-video__loader{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;z-index:3;pointer-events:none}.co-video__spinner{width:40px;height:40px;border:3px solid rgba(255, 255, 255, 0.15);border-top-color:#fff;border-radius:50%;animation:co-video-spin 0.7s linear infinite}@keyframes co-video-spin{to{transform:rotate(360deg)}}.co-video__big-play{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;z-index:2;cursor:pointer;background:transparent;border:none;padding:0;color:#fff}.co-video__big-play-circle{width:72px;height:72px;border-radius:var(--co-border-radius-full);background:rgba(0, 0, 0, 0.5);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);display:flex;align-items:center;justify-content:center;transition:transform var(--co-motion-duration-base) var(--co-motion-ease-out), background var(--co-motion-duration-base) var(--co-motion-ease-out)}.co-video__big-play:hover .co-video__big-play-circle{transform:scale(1.1);background:rgba(0, 0, 0, 0.7)}.co-video__error{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--co-spacing-md);z-index:4;background:rgba(0, 0, 0, 0.85);color:#fff}.co-video__error-text{font-size:var(--co-font-size-14);color:rgba(255, 255, 255, 0.7);margin:0;text-align:center;padding:0 var(--co-spacing-xl)}.co-video__error-retry{display:inline-flex;align-items:center;gap:var(--co-spacing-xs);padding:var(--co-spacing-sm2) var(--co-spacing-lg);border:1px solid rgba(255, 255, 255, 0.3);border-radius:var(--co-border-radius-full);background:transparent;color:#fff;font-family:var(--co-font-family-primary);font-size:var(--co-font-size-14);cursor:pointer;transition:background var(--co-motion-duration-fast) var(--co-motion-ease-out), border-color var(--co-motion-duration-fast) var(--co-motion-ease-out)}.co-video__error-retry:hover{background:rgba(255, 255, 255, 0.1);border-color:rgba(255, 255, 255, 0.5)}.co-video__controls{position:absolute;bottom:0;left:0;right:0;background:var(--co-video-controls-bg);padding:var(--co-spacing-3xl) var(--co-spacing-lg) var(--co-spacing-md);z-index:5;opacity:1;transition:opacity var(--co-motion-duration-slow) var(--co-motion-ease-out)}.co-video__controls--hidden{opacity:0;pointer-events:none}.co-video__progress{position:relative;width:100%;height:var(--co-video-progress-height);cursor:pointer;transition:height var(--co-motion-duration-fast) var(--co-motion-ease-out);margin-bottom:var(--co-spacing-sm);outline:none;touch-action:none}.co-video__progress:hover,.co-video__progress:focus-visible{height:var(--co-video-progress-height-hover)}.co-video__progress:focus-visible{outline:2px solid var(--co-semantic-border-focus-ring);outline-offset:4px;border-radius:var(--co-border-radius-full)}.co-video__progress-track{position:absolute;inset:0;background:rgba(255, 255, 255, 0.2);border-radius:var(--co-border-radius-full);overflow:hidden}.co-video__progress-buffered{position:absolute;top:0;left:0;height:100%;background:var(--co-video-buffered);border-radius:var(--co-border-radius-full);transition:width var(--co-motion-duration-slow) var(--co-motion-ease-out)}.co-video__progress-played{position:absolute;top:0;left:0;height:100%;background:var(--co-video-accent);border-radius:var(--co-border-radius-full)}.co-video__progress-thumb{position:absolute;top:50%;width:14px;height:14px;border-radius:var(--co-border-radius-full);background:var(--co-video-accent);transform:translate(-50%, -50%) scale(0);transition:transform var(--co-motion-duration-fast) var(--co-motion-ease-out);pointer-events:none}.co-video__progress:hover .co-video__progress-thumb{transform:translate(-50%, -50%) scale(1)}.co-video__toolbar{display:flex;align-items:center;justify-content:space-between;gap:var(--co-spacing-sm)}.co-video__toolbar-left,.co-video__toolbar-right{display:flex;align-items:center;gap:var(--co-spacing-sm)}.co-video__btn{display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;border:none;background:transparent;color:var(--co-video-controls-color);cursor:pointer;border-radius:var(--co-border-radius-xs);padding:0;transition:background var(--co-motion-duration-fast) var(--co-motion-ease-out);flex-shrink:0}.co-video__btn:hover{background:var(--co-video-btn-hover)}.co-video__btn:focus-visible{outline:2px solid #fff;outline-offset:2px}.co-video__btn--disabled{opacity:0.4;cursor:not-allowed;pointer-events:none}.co-video__time{font-size:var(--co-font-size-12);color:var(--co-video-controls-color);white-space:nowrap;padding:0 var(--co-spacing-xs);font-variant-numeric:tabular-nums}.co-video__volume{display:flex;align-items:center;position:relative}.co-video__volume-slider-wrap{width:0;overflow:hidden;transition:width var(--co-motion-duration-base) var(--co-motion-ease-out), opacity var(--co-motion-duration-base) var(--co-motion-ease-out);opacity:0}.co-video__volume-slider-wrap--visible{width:96px;opacity:1;overflow:visible}.co-video__volume-slider{width:96px;height:20px;display:flex;align-items:center;cursor:pointer;touch-action:none;padding:0 10px}.co-video__volume-track{position:relative;width:100%;height:4px;background:rgba(255, 255, 255, 0.2);border-radius:var(--co-border-radius-full)}.co-video__volume-fill{position:absolute;top:0;left:0;height:100%;background:var(--co-video-accent);border-radius:var(--co-border-radius-full)}.co-video__volume-thumb{position:absolute;top:50%;width:12px;height:12px;border-radius:var(--co-border-radius-full);background:var(--co-video-accent);transform:translate(-50%, -50%);pointer-events:none}.co-video__speed-wrap{position:relative}.co-video__btn--speed{width:auto;padding:0 var(--co-spacing-sm)}.co-video__speed-label{font-family:var(--co-font-family-primary);font-size:var(--co-font-size-13, 13px);font-weight:500;color:var(--co-video-controls-color)}.co-video__speed-menu{position:absolute;bottom:100%;right:0;margin-bottom:var(--co-spacing-xs);background:rgba(20, 20, 20, 0.92);backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);border-radius:var(--co-border-radius-sm);padding:var(--co-spacing-xs) 0;min-width:130px;box-shadow:var(--co-shadow-lg);z-index:10}.co-video__speed-option{display:flex;align-items:center;justify-content:space-between;width:100%;padding:var(--co-spacing-sm) var(--co-spacing-lg);color:#fff;font-size:var(--co-font-size-14);font-family:var(--co-font-family-primary);cursor:pointer;background:transparent;border:none;transition:background var(--co-motion-duration-fast) var(--co-motion-ease-out);text-align:left}.co-video__speed-option:hover{background:rgba(255, 255, 255, 0.08)}.co-video__speed-option--active{font-weight:600}@media (max-width: 480px){.co-video__volume-slider-wrap{display:none}.co-video__toolbar{gap:var(--co-spacing-xxs)}.co-video__btn{width:32px;height:32px}.co-video__big-play-circle{width:56px;height:56px}.co-video__time{font-size:var(--co-font-size-11, 11px)}.co-video__controls{padding:var(--co-spacing-2xl) var(--co-spacing-sm2) var(--co-spacing-sm)}}";export{n as co_video}
|
|
1
|
+
import{r as i,c as t,h as e,H as o,a as s}from"./p-DH5lfRNj.js";const r={es:{play:"Reproducir",pause:"Pausar",mute:"Silenciar",unmute:"Activar sonido",volume:"Volumen",fullscreen:"Pantalla completa",exitFullscreen:"Salir de pantalla completa",speed:"Velocidad",pip:"Imagen en imagen",exitPip:"Salir de imagen en imagen",download:"Descargar",seek:"Buscar",normal:"Normal",error:"Error al reproducir el video",retry:"Reintentar",player:"Reproductor de video"},en:{play:"Play",pause:"Pause",mute:"Mute",unmute:"Unmute",volume:"Volume",fullscreen:"Fullscreen",exitFullscreen:"Exit fullscreen",speed:"Speed",pip:"Picture in picture",exitPip:"Exit picture in picture",download:"Download",seek:"Seek",normal:"Normal",error:"Error playing video",retry:"Retry",player:"Video player"},pt:{play:"Reproduzir",pause:"Pausar",mute:"Silenciar",unmute:"Ativar som",volume:"Volume",fullscreen:"Tela cheia",exitFullscreen:"Sair da tela cheia",speed:"Velocidade",pip:"Imagem em imagem",exitPip:"Sair de imagem em imagem",download:"Baixar",seek:"Buscar",normal:"Normal",error:"Erro ao reproduzir o vídeo",retry:"Tentar novamente",player:"Reprodutor de vídeo"}},a={1:{es:"La carga del video fue interrumpida",en:"Video loading was aborted",pt:"O carregamento do vídeo foi interrompido"},2:{es:"Error de red al cargar el video",en:"Network error while loading video",pt:"Erro de rede ao carregar o vídeo"},3:{es:"Error al decodificar el video",en:"Error decoding video",pt:"Erro ao decodificar o vídeo"},4:{es:"Formato de video no soportado",en:"Video format not supported",pt:"Formato de vídeo não suportado"}},n=class{constructor(e){i(this,e),this.coPlay=t(this,"coPlay",7),this.coPause=t(this,"coPause",7),this.coEnded=t(this,"coEnded",7),this.coReady=t(this,"coReady",7),this.coError=t(this,"coError",7),this.coTimeUpdate=t(this,"coTimeUpdate",3),this.coSeeked=t(this,"coSeeked",7),this.coVolumeChange=t(this,"coVolumeChange",7),this.coFullscreenChange=t(this,"coFullscreenChange",7),this.coPlaybackRateChange=t(this,"coPlaybackRateChange",7),this.coPipChange=t(this,"coPipChange",7),this.coDownload=t(this,"coDownload",7),this.coThresholdReached=t(this,"coThresholdReached",7),this.src="",this.poster="",this.type="",this.preload="metadata",this.autoplay=!1,this.loop=!1,this.muted=!1,this.volume=1,this.currentTime=0,this.playbackRate=1,this.playbackRates="[0.5, 0.75, 1, 1.25, 1.5, 2]",this.controls=!0,this.showPlay=!0,this.showVolume=!0,this.showProgress=!0,this.showTime=!0,this.showFullscreen=!0,this.showSpeed=!1,this.showPip=!1,this.showDownload=!1,this.allowDownload=!1,this.aspectRatio="16:9",this.rounded="lg",this.controlsAutoHide=!0,this.controlsAutoHideDelay=3e3,this.disabled=!1,this.watchThreshold=0,this.locale="es",this.isPlaying=!1,this.internalCurrentTime=0,this.duration=0,this.buffered=0,this.volumeLevel=1,this.isMuted=!1,this.isFullscreen=!1,this.internalPlaybackRate=1,this.isLoading=!0,this.showControlBar=!0,this.hasError=!1,this.errorMessage="",this.showSpeedMenu=!1,this.isPip=!1,this.thresholdFired=!1,this.hasStarted=!1,this.isSeeking=!1,this.showVolumeSlider=!1,this.lastTimeUpdateEmit=0,this.parsedRates=[.5,.75,1,1.25,1.5,2],this.seekFromTime=0,this.externalTimeUpdate=!1,this.resetControlsTimer=()=>{this.controlsAutoHide&&this.controls&&(this.showControlBar=!0,this.controlsTimer&&clearTimeout(this.controlsTimer),this.controlsTimer=setTimeout((()=>{this.isPlaying&&!this.showSpeedMenu&&(this.showControlBar=!1)}),this.controlsAutoHideDelay))},this.handleContainerMouseMove=()=>{this.resetControlsTimer()},this.handleContainerMouseLeave=()=>{this.isPlaying&&this.controlsAutoHide&&(this.showControlBar=!1,this.showSpeedMenu=!1)},this.handleContainerTouchStart=()=>{this.controlsAutoHide&&(this.showControlBar&&this.isPlaying?this.showControlBar=!1:this.resetControlsTimer())},this.onLoadedMetadata=()=>{this.videoEl&&(this.duration=this.videoEl.duration,this.hasError=!1,this.coReady.emit({duration:this.duration,width:this.videoEl.videoWidth,height:this.videoEl.videoHeight}),this.currentTime>0&&this.currentTime<this.duration&&(this.videoEl.currentTime=this.currentTime))},this.onPlay=()=>{this.isPlaying=!0,this.hasStarted=!0,this.coPlay.emit(),this.resetControlsTimer()},this.onPause=()=>{this.isPlaying=!1,this.showControlBar=!0,this.coPause.emit(),this.controlsTimer&&clearTimeout(this.controlsTimer)},this.onEnded=()=>{this.isPlaying=!1,this.showControlBar=!0,this.coEnded.emit()},this.onTimeUpdate=()=>{if(!this.videoEl||this.isSeeking)return;this.internalCurrentTime=this.videoEl.currentTime,this.externalTimeUpdate=!0,this.currentTime=this.videoEl.currentTime;const i=performance.now();if(i-this.lastTimeUpdateEmit>250){this.lastTimeUpdateEmit=i;const t=this.duration>0?Math.round(this.internalCurrentTime/this.duration*100):0;this.coTimeUpdate.emit({currentTime:this.internalCurrentTime,duration:this.duration,progressPercent:t}),this.watchThreshold>0&&!this.thresholdFired&&t>=this.watchThreshold&&(this.thresholdFired=!0,this.coThresholdReached.emit({threshold:this.watchThreshold,currentTime:this.internalCurrentTime,duration:this.duration}))}},this.onWaiting=()=>{this.isLoading=!0},this.onCanPlay=()=>{this.isLoading=!1},this.onError=()=>{var i,t;if(!(null===(i=this.videoEl)||void 0===i?void 0:i.error))return;const e=this.videoEl.error.code,o=(null===(t=a[e])||void 0===t?void 0:t[this.locale])||this.t.error;this.hasError=!0,this.errorMessage=o,this.isLoading=!1,this.coError.emit({code:e,message:o})},this.onProgress=()=>{if(!this.videoEl||this.duration<=0)return;const i=this.videoEl.buffered;i.length>0&&(this.buffered=i.end(i.length-1)/this.duration*100)},this.onNativeVolumeChange=()=>{this.videoEl&&(this.volumeLevel=this.videoEl.volume,this.isMuted=this.videoEl.muted,this.volume=this.videoEl.volume,this.muted=this.videoEl.muted,this.coVolumeChange.emit({volume:this.volumeLevel,muted:this.isMuted}))},this.onNativeRateChange=()=>{this.videoEl&&(this.internalPlaybackRate=this.videoEl.playbackRate,this.playbackRate=this.videoEl.playbackRate,this.coPlaybackRateChange.emit({rate:this.internalPlaybackRate}))},this.handlePlayClick=()=>{!this.disabled&&this.videoEl&&(this.isPlaying?this.videoEl.pause():this.videoEl.play().catch((()=>{})))},this.handleBigPlayClick=()=>{this.disabled||this.handlePlayClick()},this.handleMuteClick=()=>{!this.disabled&&this.videoEl&&(this.videoEl.muted=!this.videoEl.muted)},this.isDraggingVolume=!1,this.handleVolumeMouseEnter=()=>{this.showVolumeSlider=!0},this.handleVolumeMouseLeave=()=>{this.isDraggingVolume||(this.showVolumeSlider=!1)},this.handleProgressPointerDown=i=>{if(this.disabled||!this.videoEl)return;i.preventDefault(),this.isSeeking=!0,this.seekFromTime=this.videoEl.currentTime,this.seekFromPointerEvent(i);const t=i=>this.seekFromPointerEvent(i),e=()=>{this.videoEl&&this.coSeeked.emit({from:this.seekFromTime,to:this.videoEl.currentTime}),this.isSeeking=!1,document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",e)};document.addEventListener("pointermove",t),document.addEventListener("pointerup",e)},this.handleVolumePointerDown=i=>{if(this.disabled||!this.videoEl)return;i.preventDefault(),i.stopPropagation(),this.isDraggingVolume=!0,this.showVolumeSlider=!0,this.setVolumeFromPointerEvent(i);const t=i=>this.setVolumeFromPointerEvent(i),e=()=>{this.isDraggingVolume=!1,document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",e)};document.addEventListener("pointermove",t),document.addEventListener("pointerup",e)},this.handleSpeedClick=i=>{i.stopPropagation(),this.showSpeedMenu=!this.showSpeedMenu},this.handleSpeedSelect=i=>{!this.disabled&&this.videoEl&&(this.videoEl.playbackRate=i,this.showSpeedMenu=!1)},this.handleFullscreenClick=()=>{if(!this.disabled)if(document.fullscreenElement||document.webkitFullscreenElement)document.exitFullscreen?document.exitFullscreen().catch((()=>{})):document.webkitExitFullscreen&&document.webkitExitFullscreen();else{const i=this.el;i.requestFullscreen?i.requestFullscreen().catch((()=>{})):i.webkitRequestFullscreen?i.webkitRequestFullscreen():this.videoEl&&this.videoEl.webkitEnterFullscreen&&this.videoEl.webkitEnterFullscreen()}},this.handleFullscreenChange=()=>{const i=document.fullscreenElement||document.webkitFullscreenElement;this.isFullscreen=i===this.el,this.coFullscreenChange.emit({fullscreen:this.isFullscreen})},this.handlePipClick=async()=>{if(!this.disabled&&this.videoEl)try{this.isPip?await document.exitPictureInPicture():await this.videoEl.requestPictureInPicture()}catch(i){}},this.handleEnterPip=()=>{this.isPip=!0,this.coPipChange.emit({pip:!0})},this.handleLeavePip=()=>{this.isPip=!1,this.coPipChange.emit({pip:!1})},this.handleDownloadClick=()=>{if(!this.allowDownload||!this.src)return;this.coDownload.emit({src:this.src});const i=document.createElement("a");i.href=this.src,i.download="",i.target="_blank",i.rel="noopener",document.body.appendChild(i),i.click(),document.body.removeChild(i)},this.handleRetryClick=()=>{this.videoEl&&(this.hasError=!1,this.errorMessage="",this.isLoading=!0,this.videoEl.load())},this.handleKeyDown=i=>{var t,e;if(this.disabled||!this.videoEl)return;const o=null===(e=null===(t=i.target)||void 0===t?void 0:t.tagName)||void 0===e?void 0:e.toLowerCase();if("input"!==o&&"textarea"!==o)switch(i.key){case" ":case"k":case"K":i.preventDefault(),this.handlePlayClick();break;case"ArrowRight":i.preventDefault(),this.videoEl.currentTime=Math.min(this.duration,this.videoEl.currentTime+5);break;case"ArrowLeft":i.preventDefault(),this.videoEl.currentTime=Math.max(0,this.videoEl.currentTime-5);break;case"ArrowUp":i.preventDefault(),this.videoEl.volume=Math.min(1,this.videoEl.volume+.1);break;case"ArrowDown":i.preventDefault(),this.videoEl.volume=Math.max(0,this.videoEl.volume-.1);break;case"m":case"M":i.preventDefault(),this.handleMuteClick();break;case"f":case"F":i.preventDefault(),this.handleFullscreenClick();break;case"Escape":this.showSpeedMenu&&(i.preventDefault(),this.showSpeedMenu=!1)}},this.handleVideoAreaClick=()=>{this.disabled||(this.handlePlayClick(),this.resetControlsTimer())}}get t(){return r[this.locale]||r.es}get progressPercent(){return this.duration<=0?0:this.internalCurrentTime/this.duration*100}get pipSupported(){return"undefined"!=typeof document&&"pictureInPictureEnabled"in document&&document.pictureInPictureEnabled}onSrcChange(){this.resetState()}onMutedChange(){this.videoEl&&(this.videoEl.muted=this.muted),this.isMuted=this.muted}onVolumeChange(){const i=Math.max(0,Math.min(1,this.volume));this.videoEl&&(this.videoEl.volume=i),this.volumeLevel=i}onCurrentTimeChange(){this.externalTimeUpdate?this.externalTimeUpdate=!1:this.videoEl&&Math.abs(this.videoEl.currentTime-this.currentTime)>.5&&(this.videoEl.currentTime=this.currentTime)}onPlaybackRateChange(){this.videoEl&&(this.videoEl.playbackRate=this.playbackRate),this.internalPlaybackRate=this.playbackRate}onPlaybackRatesChange(){this.parseRates()}componentWillLoad(){var i,t;this.parseRates(),this.volumeLevel=Math.max(0,Math.min(1,null!==(i=this.volume)&&void 0!==i?i:1)),this.isMuted=null!==(t=this.muted)&&void 0!==t&&t,this.internalPlaybackRate=this.playbackRate||1}componentDidLoad(){this.videoEl&&(this.bindVideoEvents(),this.videoEl.volume=this.volumeLevel,this.videoEl.muted=this.isMuted,this.videoEl.playbackRate=this.internalPlaybackRate,this.videoEl.readyState>=1&&this.onLoadedMetadata(),this.videoEl.readyState>=3&&this.onCanPlay(),this.autoplay&&this.muted&&this.videoEl.play().catch((()=>{}))),document.addEventListener("fullscreenchange",this.handleFullscreenChange),document.addEventListener("webkitfullscreenchange",this.handleFullscreenChange)}disconnectedCallback(){this.controlsTimer&&clearTimeout(this.controlsTimer),document.removeEventListener("fullscreenchange",this.handleFullscreenChange),document.removeEventListener("webkitfullscreenchange",this.handleFullscreenChange),this.videoEl&&(this.videoEl.removeEventListener("loadedmetadata",this.onLoadedMetadata),this.videoEl.removeEventListener("play",this.onPlay),this.videoEl.removeEventListener("pause",this.onPause),this.videoEl.removeEventListener("ended",this.onEnded),this.videoEl.removeEventListener("timeupdate",this.onTimeUpdate),this.videoEl.removeEventListener("waiting",this.onWaiting),this.videoEl.removeEventListener("canplay",this.onCanPlay),this.videoEl.removeEventListener("error",this.onError),this.videoEl.removeEventListener("progress",this.onProgress),this.videoEl.removeEventListener("volumechange",this.onNativeVolumeChange),this.videoEl.removeEventListener("ratechange",this.onNativeRateChange),this.videoEl.removeEventListener("enterpictureinpicture",this.handleEnterPip),this.videoEl.removeEventListener("leavepictureinpicture",this.handleLeavePip))}async play(){var i;await(null===(i=this.videoEl)||void 0===i?void 0:i.play())}async pause(){var i;null===(i=this.videoEl)||void 0===i||i.pause()}async togglePlay(){var i,t;this.isPlaying?null===(i=this.videoEl)||void 0===i||i.pause():await(null===(t=this.videoEl)||void 0===t?void 0:t.play())}async seek(i){this.videoEl&&(this.videoEl.currentTime=i)}async setVolume(i){const t=Math.max(0,Math.min(1,i));this.volume=t,this.videoEl&&(this.videoEl.volume=t),this.volumeLevel=t}async toggleMute(){this.handleMuteClick()}async toggleFullscreen(){this.handleFullscreenClick()}async togglePip(){this.handlePipClick()}parseRates(){try{const i=JSON.parse(this.playbackRates);Array.isArray(i)&&(this.parsedRates=i.filter((i=>"number"==typeof i&&i>0)).sort(((i,t)=>i-t)))}catch(i){this.parsedRates=[.5,.75,1,1.25,1.5,2]}}resetState(){this.isPlaying=!1,this.internalCurrentTime=0,this.duration=0,this.buffered=0,this.hasError=!1,this.errorMessage="",this.thresholdFired=!1,this.hasStarted=!1,this.isLoading=!0,this.showSpeedMenu=!1}bindVideoEvents(){this.videoEl&&(this.videoEl.addEventListener("loadedmetadata",this.onLoadedMetadata),this.videoEl.addEventListener("play",this.onPlay),this.videoEl.addEventListener("pause",this.onPause),this.videoEl.addEventListener("ended",this.onEnded),this.videoEl.addEventListener("timeupdate",this.onTimeUpdate),this.videoEl.addEventListener("waiting",this.onWaiting),this.videoEl.addEventListener("canplay",this.onCanPlay),this.videoEl.addEventListener("error",this.onError),this.videoEl.addEventListener("progress",this.onProgress),this.videoEl.addEventListener("volumechange",this.onNativeVolumeChange),this.videoEl.addEventListener("ratechange",this.onNativeRateChange),this.videoEl.addEventListener("enterpictureinpicture",this.handleEnterPip),this.videoEl.addEventListener("leavepictureinpicture",this.handleLeavePip))}formatTime(i){if(!isFinite(i)||i<0)return"0:00";const t=Math.floor(i/3600),e=Math.floor(i%3600/60),o=Math.floor(i%60);return t>0?`${t}:${e.toString().padStart(2,"0")}:${o.toString().padStart(2,"0")}`:`${e}:${o.toString().padStart(2,"0")}`}seekFromPointerEvent(i){if(!this.progressTrackEl||!this.videoEl)return;const t=this.progressTrackEl.getBoundingClientRect(),e=Math.max(0,Math.min(1,(i.clientX-t.left)/t.width))*this.duration;this.videoEl.currentTime=e,this.internalCurrentTime=e}setVolumeFromPointerEvent(i){if(!this.volumeTrackEl||!this.videoEl)return;const t=this.volumeTrackEl.getBoundingClientRect(),e=Math.max(0,Math.min(1,(i.clientX-t.left)/t.width));this.videoEl.volume=e,e>0&&this.videoEl.muted&&(this.videoEl.muted=!1)}renderBigPlayButton(){return this.isPlaying||this.hasError||this.isLoading?null:e("button",{class:"co-video__big-play",part:"big-play",onClick:this.handleBigPlayClick,"aria-label":this.t.play,tabindex:"-1"},e("div",{class:"co-video__big-play-circle"},e("co-icon",{name:"play",size:32,weight:"fill"})))}renderPoster(){return!this.poster||this.hasStarted?null:e("div",{class:"co-video__poster",part:"poster",style:{backgroundImage:`url(${this.poster})`}})}renderLoader(){return!this.isLoading||this.hasError?null:e("div",{class:"co-video__loader"},e("div",{class:"co-video__spinner"}))}renderError(){return this.hasError?e("div",{class:"co-video__error"},e("co-icon",{name:"warning-circle",size:48,weight:"regular"}),e("p",{class:"co-video__error-text"},this.errorMessage||this.t.error),e("button",{class:"co-video__error-retry",onClick:this.handleRetryClick},e("co-icon",{name:"arrow-clockwise",size:16,weight:"bold"}),this.t.retry)):null}renderProgressBar(){if(!this.showProgress)return null;const i=this.progressPercent,t=this.buffered;return e("div",{class:"co-video__progress",part:"progress",role:"slider","aria-label":this.t.seek,"aria-valuenow":Math.round(this.internalCurrentTime),"aria-valuemin":0,"aria-valuemax":Math.round(this.duration),tabindex:0,ref:i=>this.progressTrackEl=i,onPointerDown:this.handleProgressPointerDown},e("div",{class:"co-video__progress-track"},e("div",{class:"co-video__progress-buffered",style:{width:`${t}%`}}),e("div",{class:"co-video__progress-played",style:{width:`${i}%`}})),e("div",{class:"co-video__progress-thumb",style:{left:`${i}%`}}))}renderVolumeControl(){if(!this.showVolume)return null;const i=this.isMuted?0:100*this.volumeLevel;return e("div",{class:"co-video__volume",onMouseEnter:this.handleVolumeMouseEnter,onMouseLeave:this.handleVolumeMouseLeave},e("button",{class:"co-video__btn",onClick:this.handleMuteClick,"aria-label":this.isMuted?this.t.unmute:this.t.mute},e("co-icon",{name:this.isMuted||0===this.volumeLevel?"speaker-x":this.volumeLevel<.5?"speaker-low":"speaker-high",size:20,weight:"fill"})),e("div",{class:{"co-video__volume-slider-wrap":!0,"co-video__volume-slider-wrap--visible":this.showVolumeSlider}},e("div",{class:"co-video__volume-slider",onPointerDown:this.handleVolumePointerDown,role:"slider","aria-label":this.t.volume,"aria-valuenow":Math.round(i),"aria-valuemin":0,"aria-valuemax":100},e("div",{class:"co-video__volume-track",ref:i=>this.volumeTrackEl=i},e("div",{class:"co-video__volume-fill",style:{width:`${i}%`}}),e("div",{class:"co-video__volume-thumb",style:{left:`${i}%`}})))))}renderSpeedMenu(){return this.showSpeed?e("div",{class:"co-video__speed-wrap"},e("button",{class:"co-video__btn co-video__btn--speed",onClick:this.handleSpeedClick,"aria-label":this.t.speed,"aria-haspopup":"listbox","aria-expanded":this.showSpeedMenu?"true":"false"},e("span",{class:"co-video__speed-label"},1===this.internalPlaybackRate?"1x":`${this.internalPlaybackRate}x`)),this.showSpeedMenu&&e("div",{class:"co-video__speed-menu",role:"listbox","aria-label":this.t.speed},this.parsedRates.map((i=>e("button",{class:{"co-video__speed-option":!0,"co-video__speed-option--active":i===this.internalPlaybackRate},role:"option","aria-selected":i===this.internalPlaybackRate?"true":"false",onClick:()=>this.handleSpeedSelect(i)},e("span",null,1===i?this.t.normal:`${i}x`),i===this.internalPlaybackRate&&e("co-icon",{name:"check",size:14,weight:"bold"})))))):null}renderControls(){return this.controls?e("div",{class:{"co-video__controls":!0,"co-video__controls--hidden":!this.showControlBar},part:"controls",onClick:i=>i.stopPropagation()},this.renderProgressBar(),e("div",{class:"co-video__toolbar",part:"toolbar"},e("div",{class:"co-video__toolbar-left"},this.showPlay&&e("button",{class:"co-video__btn",onClick:this.handlePlayClick,"aria-label":this.isPlaying?this.t.pause:this.t.play},e("co-icon",{name:this.isPlaying?"pause":"play",size:20,weight:"fill"})),this.renderVolumeControl(),this.showTime&&e("span",{class:"co-video__time","aria-live":"off"},this.formatTime(this.internalCurrentTime)," / ",this.formatTime(this.duration))),e("div",{class:"co-video__toolbar-right"},this.renderSpeedMenu(),this.showPip&&this.pipSupported&&e("button",{class:"co-video__btn",onClick:this.handlePipClick,"aria-label":this.isPip?this.t.exitPip:this.t.pip},e("co-icon",{name:"picture-in-picture",size:20,weight:this.isPip?"fill":"regular"})),this.showDownload&&e("button",{class:{"co-video__btn":!0,"co-video__btn--disabled":!this.allowDownload},onClick:this.handleDownloadClick,"aria-label":this.t.download,disabled:!this.allowDownload},e("co-icon",{name:"download-simple",size:20,weight:"regular"})),this.showFullscreen&&e("button",{class:"co-video__btn",onClick:this.handleFullscreenClick,"aria-label":this.isFullscreen?this.t.exitFullscreen:this.t.fullscreen},e("co-icon",{name:this.isFullscreen?"corners-in":"corners-out",size:20,weight:"regular"}))))):null}render(){const i=`co-video--${this.aspectRatio.replace(":","-")}`;return e(o,{key:"61eac04c652cdce63bd06c3103e632ee4bd2d791"},e("div",{key:"52180564b673a7d1ce91922636fc333242f8043d",class:{"co-video":!0,[i]:!0,[`co-video--rounded-${this.rounded}`]:!0,"co-video--disabled":this.disabled,"co-video--fullscreen":this.isFullscreen,"co-video--playing":this.isPlaying},part:"container",ref:i=>this.containerEl=i,role:"region","aria-label":this.t.player,tabindex:0,onKeyDown:this.handleKeyDown,onMouseMove:this.handleContainerMouseMove,onMouseLeave:this.handleContainerMouseLeave,onTouchStart:this.handleContainerTouchStart},e("video",{key:"8351b12f368bc6a4903aca40665ec5fb0f559592",ref:i=>this.videoEl=i,class:"co-video__native",part:"video",src:this.src||void 0,poster:void 0,preload:this.preload,loop:this.loop,playsinline:!0,tabindex:-1,controlsList:this.allowDownload?void 0:"nodownload"}),this.renderPoster(),this.renderLoader(),this.renderBigPlayButton(),this.renderError(),e("div",{key:"a0bd076367f9a65bf1c023c6cf5ef37a3314565d",class:"co-video__click-area",onClick:this.handleVideoAreaClick}),this.renderControls()))}get el(){return s(this)}static get watchers(){return{src:[{onSrcChange:0}],muted:[{onMutedChange:0}],volume:[{onVolumeChange:0}],currentTime:[{onCurrentTimeChange:0}],playbackRate:[{onPlaybackRateChange:0}],playbackRates:[{onPlaybackRatesChange:0}]}}};n.style=":host{display:block;font-family:var(--co-font-family-primary);--co-video-controls-bg:linear-gradient(transparent, rgba(0, 0, 0, 0.75));--co-video-controls-color:#fff;--co-video-progress-height:4px;--co-video-progress-height-hover:8px;--co-video-accent:var(--co-color-base-blanco);--co-video-buffered:rgba(255, 255, 255, 0.25);--co-video-btn-hover:rgba(255, 255, 255, 0.16)}.co-video{position:relative;width:100%;background:#000;overflow:hidden;outline:none;user-select:none;-webkit-user-select:none}.co-video:focus-visible{outline:2px solid var(--co-semantic-border-focus-ring);outline-offset:2px}.co-video--16-9{aspect-ratio:16 / 9}.co-video--4-3{aspect-ratio:4 / 3}.co-video--1-1{aspect-ratio:1 / 1}.co-video--21-9{aspect-ratio:21 / 9}.co-video--auto{height:100%}.co-video--rounded-none{border-radius:0}.co-video--rounded-sm{border-radius:var(--co-border-radius-xs)}.co-video--rounded-md{border-radius:var(--co-border-radius-sm)}.co-video--rounded-lg{border-radius:var(--co-border-radius-lg)}.co-video--rounded-xl{border-radius:var(--co-border-radius-xl)}:host(:fullscreen){width:100%;height:100%}:host(:fullscreen) .co-video{border-radius:0 !important;aspect-ratio:unset;width:100%;height:100%}.co-video--disabled{opacity:0.5;pointer-events:none}.co-video__native{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;display:block}.co-video__click-area{position:absolute;inset:0;z-index:1;cursor:pointer}.co-video__poster{position:absolute;inset:0;z-index:1;background-size:cover;background-position:center;background-repeat:no-repeat}.co-video__loader{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;z-index:3;pointer-events:none}.co-video__spinner{width:40px;height:40px;border:3px solid rgba(255, 255, 255, 0.15);border-top-color:#fff;border-radius:50%;animation:co-video-spin 0.7s linear infinite}@keyframes co-video-spin{to{transform:rotate(360deg)}}.co-video__big-play{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;z-index:2;cursor:pointer;background:transparent;border:none;padding:0;color:#fff}.co-video__big-play-circle{width:72px;height:72px;border-radius:var(--co-border-radius-full);background:rgba(0, 0, 0, 0.5);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);display:flex;align-items:center;justify-content:center;transition:transform var(--co-motion-duration-base) var(--co-motion-ease-out), background var(--co-motion-duration-base) var(--co-motion-ease-out)}.co-video__big-play:hover .co-video__big-play-circle{transform:scale(1.1);background:rgba(0, 0, 0, 0.7)}.co-video__error{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--co-spacing-md);z-index:4;background:rgba(0, 0, 0, 0.85);color:#fff}.co-video__error-text{font-size:var(--co-font-size-14);color:rgba(255, 255, 255, 0.7);margin:0;text-align:center;padding:0 var(--co-spacing-xl)}.co-video__error-retry{display:inline-flex;align-items:center;gap:var(--co-spacing-xs);padding:var(--co-spacing-sm2) var(--co-spacing-lg);border:1px solid rgba(255, 255, 255, 0.3);border-radius:var(--co-border-radius-full);background:transparent;color:#fff;font-family:var(--co-font-family-primary);font-size:var(--co-font-size-14);cursor:pointer;transition:background var(--co-motion-duration-fast) var(--co-motion-ease-out), border-color var(--co-motion-duration-fast) var(--co-motion-ease-out)}.co-video__error-retry:hover{background:rgba(255, 255, 255, 0.1);border-color:rgba(255, 255, 255, 0.5)}.co-video__controls{position:absolute;bottom:0;left:0;right:0;background:var(--co-video-controls-bg);padding:var(--co-spacing-3xl) var(--co-spacing-lg) var(--co-spacing-md);z-index:5;opacity:1;transition:opacity var(--co-motion-duration-slow) var(--co-motion-ease-out)}.co-video__controls--hidden{opacity:0;pointer-events:none}.co-video__progress{position:relative;width:100%;height:var(--co-video-progress-height);cursor:pointer;transition:height var(--co-motion-duration-fast) var(--co-motion-ease-out);margin-bottom:var(--co-spacing-sm);outline:none;touch-action:none}.co-video__progress:hover,.co-video__progress:focus-visible{height:var(--co-video-progress-height-hover)}.co-video__progress:focus-visible{outline:2px solid var(--co-semantic-border-focus-ring);outline-offset:4px;border-radius:var(--co-border-radius-full)}.co-video__progress-track{position:absolute;inset:0;background:rgba(255, 255, 255, 0.2);border-radius:var(--co-border-radius-full);overflow:hidden}.co-video__progress-buffered{position:absolute;top:0;left:0;height:100%;background:var(--co-video-buffered);border-radius:var(--co-border-radius-full);transition:width var(--co-motion-duration-slow) var(--co-motion-ease-out)}.co-video__progress-played{position:absolute;top:0;left:0;height:100%;background:var(--co-video-accent);border-radius:var(--co-border-radius-full)}.co-video__progress-thumb{position:absolute;top:50%;width:14px;height:14px;border-radius:var(--co-border-radius-full);background:var(--co-video-accent);transform:translate(-50%, -50%) scale(0);transition:transform var(--co-motion-duration-fast) var(--co-motion-ease-out);pointer-events:none}.co-video__progress:hover .co-video__progress-thumb{transform:translate(-50%, -50%) scale(1)}.co-video__toolbar{display:flex;align-items:center;justify-content:space-between;gap:var(--co-spacing-sm)}.co-video__toolbar-left,.co-video__toolbar-right{display:flex;align-items:center;gap:var(--co-spacing-sm)}.co-video__btn{display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;border:none;background:transparent;color:var(--co-video-controls-color);cursor:pointer;border-radius:var(--co-border-radius-xs);padding:0;transition:background var(--co-motion-duration-fast) var(--co-motion-ease-out);flex-shrink:0}.co-video__btn:hover{background:var(--co-video-btn-hover)}.co-video__btn:focus-visible{outline:2px solid #fff;outline-offset:2px}.co-video__btn--disabled{opacity:0.4;cursor:not-allowed;pointer-events:none}.co-video__time{font-size:var(--co-font-size-12);color:var(--co-video-controls-color);white-space:nowrap;padding:0 var(--co-spacing-xs);font-variant-numeric:tabular-nums}.co-video__volume{display:flex;align-items:center;position:relative}.co-video__volume-slider-wrap{width:0;overflow:hidden;transition:width var(--co-motion-duration-base) var(--co-motion-ease-out), opacity var(--co-motion-duration-base) var(--co-motion-ease-out);opacity:0}.co-video__volume-slider-wrap--visible{width:96px;opacity:1;overflow:visible}.co-video__volume-slider{width:96px;height:20px;display:flex;align-items:center;cursor:pointer;touch-action:none;padding:0 10px}.co-video__volume-track{position:relative;width:100%;height:4px;background:rgba(255, 255, 255, 0.2);border-radius:var(--co-border-radius-full)}.co-video__volume-fill{position:absolute;top:0;left:0;height:100%;background:var(--co-video-accent);border-radius:var(--co-border-radius-full)}.co-video__volume-thumb{position:absolute;top:50%;width:12px;height:12px;border-radius:var(--co-border-radius-full);background:var(--co-video-accent);transform:translate(-50%, -50%);pointer-events:none}.co-video__speed-wrap{position:relative}.co-video__btn--speed{width:auto;padding:0 var(--co-spacing-sm)}.co-video__speed-label{font-family:var(--co-font-family-primary);font-size:var(--co-font-size-13, 13px);font-weight:500;color:var(--co-video-controls-color)}.co-video__speed-menu{position:absolute;bottom:100%;right:0;margin-bottom:var(--co-spacing-xs);background:rgba(20, 20, 20, 0.92);backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);border-radius:var(--co-border-radius-sm);padding:var(--co-spacing-xs) 0;min-width:130px;box-shadow:var(--co-shadow-lg);z-index:10}.co-video__speed-option{display:flex;align-items:center;justify-content:space-between;width:100%;padding:var(--co-spacing-sm) var(--co-spacing-lg);color:#fff;font-size:var(--co-font-size-14);font-family:var(--co-font-family-primary);cursor:pointer;background:transparent;border:none;transition:background var(--co-motion-duration-fast) var(--co-motion-ease-out);text-align:left}.co-video__speed-option:hover{background:rgba(255, 255, 255, 0.08)}.co-video__speed-option--active{font-weight:600}@media (max-width: 480px){.co-video__volume-slider-wrap{display:none}.co-video__toolbar{gap:var(--co-spacing-xxs)}.co-video__btn{width:32px;height:32px}.co-video__big-play-circle{width:56px;height:56px}.co-video__time{font-size:var(--co-font-size-11, 11px)}.co-video__controls{padding:var(--co-spacing-2xl) var(--co-spacing-sm2) var(--co-spacing-sm)}}";export{n as co_video}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r,h as s}from"./p-DH5lfRNj.js";const o=class{constructor(s){r(this,s),this.value=0,this.status="default",this.variant="solid",this.thickness=4,this.indeterminate=!1}render(){const r=Math.max(0,Math.min(100,this.value)),o=this.indeterminate;return s("div",{key:"
|
|
1
|
+
import{r,h as s}from"./p-DH5lfRNj.js";const o=class{constructor(s){r(this,s),this.value=0,this.status="default",this.variant="solid",this.thickness=4,this.indeterminate=!1}render(){const r=Math.max(0,Math.min(100,this.value)),o=this.indeterminate;return s("div",{key:"bcf5e566cfa6726eac8578288797d1004e4003fb",class:{"co-progress-bar":!0,[`co-progress-bar--${this.status}`]:!0,[`co-progress-bar--${this.variant}`]:!0,"co-progress-bar--indeterminate":o},role:"progressbar","aria-valuenow":o?void 0:r,"aria-valuemin":0,"aria-valuemax":100,part:"bar",style:{height:`${this.thickness}px`}},s("div",{key:"932537ab1521b2d7fcd0e1bb57c027a276dacaf3",class:"co-progress-bar__fill",style:o?void 0:{width:`${r}%`}}))}};o.style=":host{display:block;width:100%}.co-progress-bar{width:100%;border-radius:9999px;overflow:hidden;background:var(--co-semantic-border-subtle);position:relative}.co-progress-bar__fill{height:100%;border-radius:9999px;transition:width 0.3s ease}.co-progress-bar--solid .co-progress-bar__fill{background:var(--co-semantic-status-info)}.co-progress-bar--solid.co-progress-bar--success .co-progress-bar__fill{background:var(--co-semantic-status-success)}.co-progress-bar--solid.co-progress-bar--warning .co-progress-bar__fill{background:var(--co-semantic-status-warning)}.co-progress-bar--solid.co-progress-bar--error .co-progress-bar__fill{background:var(--co-semantic-status-error)}.co-progress-bar--dashed{background:transparent;border:2px dashed var(--co-semantic-border-subtle)}.co-progress-bar--dashed .co-progress-bar__fill{background:transparent;border-bottom:2px dashed var(--co-semantic-status-info);border-radius:0}.co-progress-bar--dashed.co-progress-bar--success .co-progress-bar__fill{border-bottom-color:var(--co-semantic-status-success)}.co-progress-bar--dashed.co-progress-bar--warning .co-progress-bar__fill{border-bottom-color:var(--co-semantic-status-warning)}.co-progress-bar--dashed.co-progress-bar--error .co-progress-bar__fill{border-bottom-color:var(--co-semantic-status-error)}.co-progress-bar--dashed.co-progress-bar--default{border-color:var(--co-semantic-border-subtle, rgba(31, 28, 27, 0.08))}.co-progress-bar--indeterminate .co-progress-bar__fill{width:40%;transition:none;animation:co-progress-indeterminate 1.4s ease-in-out infinite;will-change:transform}@keyframes co-progress-indeterminate{0%{transform:translateX(-110%)}100%{transform:translateX(360%)}}@media (prefers-reduced-motion: reduce){.co-progress-bar--indeterminate .co-progress-bar__fill{animation:none;width:100%;opacity:0.45}}";export{o as co_progress_bar}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as e,h as o,a as i}from"./p-DH5lfRNj.js";import{a as n}from"./p-Ch1jfwZ2.js";const s=["a[href]","area[href]","button:not([disabled])",'input:not([disabled]):not([type="hidden"])',"select:not([disabled])","textarea:not([disabled])","iframe","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])','[tabindex]:not([tabindex="-1"])'].join(",");function r(t){return Array.from(t.querySelectorAll(s)).filter((t=>!t.hasAttribute("disabled")&&"true"!==t.getAttribute("aria-hidden")&&(null!==t.offsetParent||t.getClientRects().length>0)))}let a=0,c="";const h=class{constructor(o){t(this,o),this.coClose=e(this,"coClose",7),this.coAfterClose=e(this,"coAfterClose",3),this.coAfterOpen=e(this,"coAfterOpen",3),this.open=!1,this.trapFocus=!1,this.closeOnEscape=!1,this.hasLock=!1,this.handleClick=()=>{this.coClose.emit()},this.handleTransitionEnd=t=>{if(t.target!==this.overlayEl)return;const e=n(t.propertyName,this.open,"opacity");"after-open"===e?this.coAfterOpen.emit():"after-close"===e&&this.coAfterClose.emit()}}onOpenChange(t){t?this.acquireLock():this.releaseLock(),this.syncPopover(),this.trapFocus&&(t?this.captureAndFocus():this.restoreFocus())}componentDidLoad(){this.open&&this.acquireLock(),this.syncPopover(),this.open&&this.trapFocus&&this.captureAndFocus()}disconnectedCallback(){this.releaseLock(),this.trapFocus&&this.restoreFocus()}acquireLock(){this.hasLock||(this.hasLock=!0,"undefined"!=typeof document&&(0===a&&(c=document.body.style.overflow,document.body.style.overflow="hidden"),a++))}releaseLock(){this.hasLock&&(this.hasLock=!1,"undefined"!=typeof document&&0!==a&&(a--,0===a&&(document.body.style.overflow=c)))}syncPopover(){const t=this.overlayEl;if(t&&"function"==typeof t.showPopover)try{const e=t.matches(":popover-open");this.open&&!e?t.showPopover():!this.open&&e&&t.hidePopover()}catch(t){}}captureAndFocus(){var t;"undefined"!=typeof document&&(this.returnFocusEl=document.activeElement),t=()=>{var t;if(!this.open)return;const e=r(this.el);e.length>0?e[0].focus():null===(t=this.overlayEl)||void 0===t||t.focus()},"function"==typeof requestAnimationFrame?requestAnimationFrame(t):t()}restoreFocus(){const t=this.returnFocusEl;this.returnFocusEl=null,t&&"function"==typeof t.focus&&t.focus()}deepActiveElement(){if("undefined"==typeof document)return null;let t=document.activeElement;for(;t&&t.shadowRoot&&t.shadowRoot.activeElement;)t=t.shadowRoot.activeElement;return t}handleKeydown(t){this.open&&(this.closeOnEscape&&"Escape"===t.key?this.coClose.emit():this.trapFocus&&"Tab"===t.key&&this.trapTab(t))}trapTab(t){var e;const o=r(this.el);if(0===o.length)return t.preventDefault(),void(null===(e=this.overlayEl)||void 0===e||e.focus());const i=o.indexOf(this.deepActiveElement()),n=function(t,e,o){return t<=0?-1:o?e<=0?t-1:e-1:-1===e||e>=t-1?0:e+1}(o.length,i,t.shiftKey);n<0||(t.preventDefault(),o[n].focus())}render(){return o("div",{key:"
|
|
1
|
+
import{r as t,c as e,h as o,a as i}from"./p-DH5lfRNj.js";import{a as n}from"./p-Ch1jfwZ2.js";const s=["a[href]","area[href]","button:not([disabled])",'input:not([disabled]):not([type="hidden"])',"select:not([disabled])","textarea:not([disabled])","iframe","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])','[tabindex]:not([tabindex="-1"])'].join(",");function r(t){return Array.from(t.querySelectorAll(s)).filter((t=>!t.hasAttribute("disabled")&&"true"!==t.getAttribute("aria-hidden")&&(null!==t.offsetParent||t.getClientRects().length>0)))}let a=0,c="";const h=class{constructor(o){t(this,o),this.coClose=e(this,"coClose",7),this.coAfterClose=e(this,"coAfterClose",3),this.coAfterOpen=e(this,"coAfterOpen",3),this.open=!1,this.trapFocus=!1,this.closeOnEscape=!1,this.hasLock=!1,this.handleClick=()=>{this.coClose.emit()},this.handleTransitionEnd=t=>{if(t.target!==this.overlayEl)return;const e=n(t.propertyName,this.open,"opacity");"after-open"===e?this.coAfterOpen.emit():"after-close"===e&&this.coAfterClose.emit()}}onOpenChange(t){t?this.acquireLock():this.releaseLock(),this.syncPopover(),this.trapFocus&&(t?this.captureAndFocus():this.restoreFocus())}componentDidLoad(){this.open&&this.acquireLock(),this.syncPopover(),this.open&&this.trapFocus&&this.captureAndFocus()}disconnectedCallback(){this.releaseLock(),this.trapFocus&&this.restoreFocus()}acquireLock(){this.hasLock||(this.hasLock=!0,"undefined"!=typeof document&&(0===a&&(c=document.body.style.overflow,document.body.style.overflow="hidden"),a++))}releaseLock(){this.hasLock&&(this.hasLock=!1,"undefined"!=typeof document&&0!==a&&(a--,0===a&&(document.body.style.overflow=c)))}syncPopover(){const t=this.overlayEl;if(t&&"function"==typeof t.showPopover)try{const e=t.matches(":popover-open");this.open&&!e?t.showPopover():!this.open&&e&&t.hidePopover()}catch(t){}}captureAndFocus(){var t;"undefined"!=typeof document&&(this.returnFocusEl=document.activeElement),t=()=>{var t;if(!this.open)return;const e=r(this.el);e.length>0?e[0].focus():null===(t=this.overlayEl)||void 0===t||t.focus()},"function"==typeof requestAnimationFrame?requestAnimationFrame(t):t()}restoreFocus(){const t=this.returnFocusEl;this.returnFocusEl=null,t&&"function"==typeof t.focus&&t.focus()}deepActiveElement(){if("undefined"==typeof document)return null;let t=document.activeElement;for(;t&&t.shadowRoot&&t.shadowRoot.activeElement;)t=t.shadowRoot.activeElement;return t}handleKeydown(t){this.open&&(this.closeOnEscape&&"Escape"===t.key?this.coClose.emit():this.trapFocus&&"Tab"===t.key&&this.trapTab(t))}trapTab(t){var e;const o=r(this.el);if(0===o.length)return t.preventDefault(),void(null===(e=this.overlayEl)||void 0===e||e.focus());const i=o.indexOf(this.deepActiveElement()),n=function(t,e,o){return t<=0?-1:o?e<=0?t-1:e-1:-1===e||e>=t-1?0:e+1}(o.length,i,t.shiftKey);n<0||(t.preventDefault(),o[n].focus())}render(){return o("div",{key:"4fafc87768eca581018ff578875b2362cf5297d2",class:{"co-overlay":!0,"co-overlay--open":this.open},part:"overlay",popover:"manual",tabindex:this.trapFocus?-1:void 0,ref:t=>this.overlayEl=t,onClick:this.handleClick,onTransitionEnd:this.handleTransitionEnd},o("slot",{key:"2d18410bb6774701806101d38b6d41293b0e7ff9"}))}get el(){return i(this)}static get watchers(){return{open:[{onOpenChange:0}]}}};h.style=":host{display:contents}.co-overlay{position:fixed;inset:0;z-index:1000;margin:0;border:0;padding:0;width:auto;height:auto;max-width:none;max-height:none;overflow:visible;display:flex;align-items:center;justify-content:center;background:var(--co-overlay-bg, rgba(0, 0, 0, 0.4));-webkit-backdrop-filter:blur(var(--co-overlay-blur, 2px));backdrop-filter:blur(var(--co-overlay-blur, 2px));opacity:0;pointer-events:none;transition:opacity var(--co-motion-duration-fast) var(--co-motion-ease-in)}.co-overlay--open{opacity:1;pointer-events:auto;transition:opacity var(--co-motion-duration-base) var(--co-motion-ease-out)}";export{h as co_overlay}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,c as e,h as a,a as o}from"./p-DH5lfRNj.js";const i=class{constructor(a){t(this,a),this.coSort=e(this,"coSort",7),this.coRowSelect=e(this,"coRowSelect",7),this.coSelectAll=e(this,"coSelectAll",7),this.coColumnResize=e(this,"coColumnResize",7),this.coColumnPin=e(this,"coColumnPin",7),this.coHeaderFilter=e(this,"coHeaderFilter",7),this.coRowDblClick=e(this,"coRowDblClick",7),this.coRowClick=e(this,"coRowClick",7),this.coEmptyAction=e(this,"coEmptyAction",7),this.columns="[]",this.rows="[]",this.rowKey="_id",this.loading=!1,this.skeletonRows=10,this.emptyTitle="",this.emptyMessage="No records found",this.emptyIcon="magnifying-glass",this.emptyActionVariant="stroke",this.sortField="",this.sortOrder="",this.filteredFields="[]",this.indirectFilteredFields="[]",this.selectable=!1,this.selectedKeys="[]",this.resizable=!0,this.parsedColumns=[],this.parsedRows=[],this.parsedSelectedKeys=new Set,this.parsedFilteredFields=[],this.parsedIndirectFields=[],this.columnWidths=new Map,this.headerMeasurePending=!1,this.resizingColumn=null,this.resizeStartX=0,this.resizeStartWidth=0,this.resizeEdgeExtra=0,this.resizeLastClientX=0,this.resizeAutoScrollRaf=0,this.resizePendingScroll=0,this.suppressNextSort=!1}parseColumns(){this.headerMeasurePending=!0;try{const t="string"==typeof this.columns?JSON.parse(this.columns):this.columns;this.parsedColumns=t,t.forEach((t=>{t.width&&!this.columnWidths.has(t.field)&&this.columnWidths.set(t.field,t.width)}))}catch(t){this.parsedColumns=[]}}parseRows(){try{this.parsedRows="string"==typeof this.rows?JSON.parse(this.rows):this.rows}catch(t){this.parsedRows=[]}}parseSelectedKeys(){try{const t="string"==typeof this.selectedKeys?JSON.parse(this.selectedKeys):this.selectedKeys;this.parsedSelectedKeys=new Set(t)}catch(t){this.parsedSelectedKeys=new Set}}parseFilteredFields(){try{this.parsedFilteredFields="string"==typeof this.filteredFields?JSON.parse(this.filteredFields):this.filteredFields||[]}catch(t){this.parsedFilteredFields=[]}}parseIndirectFields(){try{this.parsedIndirectFields="string"==typeof this.indirectFilteredFields?JSON.parse(this.indirectFilteredFields):this.indirectFilteredFields||[]}catch(t){this.parsedIndirectFields=[]}}componentWillLoad(){this.headerLabelEls=new Map,this.truncatedHeaders={},this.parseColumns(),this.parseRows(),this.parseSelectedKeys(),this.parseFilteredFields(),this.parseIndirectFields()}componentDidLoad(){"undefined"!=typeof ResizeObserver&&(this.headerResizeObserver=new ResizeObserver((()=>this.measureHeaderTruncation())),this.headerLabelEls.forEach((t=>this.headerResizeObserver.observe(t)))),this.measureHeaderTruncation()}disconnectedCallback(){var t;null===(t=this.headerResizeObserver)||void 0===t||t.disconnect(),this.headerResizeObserver=void 0}componentDidRender(){if(this.headerMeasurePending&&(this.headerMeasurePending=!1,this.measureHeaderTruncation()),this.resizePendingScroll){const t=this.el.querySelector(".co-data-table__scroll");t&&(t.scrollLeft+=this.resizePendingScroll),this.resizePendingScroll=0}}handleSort(t){if(this.suppressNextSort)return void(this.suppressNextSort=!1);let e;e=this.sortField===t?"asc"===this.sortOrder?"desc":"desc"===this.sortOrder?"":"asc":"asc",this.sortField=""===e?"":t,this.sortOrder=e,this.coSort.emit({field:t,order:e})}isAllSelected(){return 0!==this.parsedRows.length&&this.parsedRows.every((t=>this.parsedSelectedKeys.has(String(t[this.rowKey]))))}isSomeSelected(){if(0===this.parsedRows.length)return!1;const t=this.parsedRows.filter((t=>this.parsedSelectedKeys.has(String(t[this.rowKey])))).length;return t>0&&t<this.parsedRows.length}handleSelectAll(){const t=!this.isAllSelected()&&!this.isSomeSelected();this.coSelectAll.emit({selected:!this.isAllSelected()||t})}handleRowSelect(t){const e=String(t[this.rowKey]),a=!this.parsedSelectedKeys.has(e);this.coRowSelect.emit({key:e,selected:a})}handleResizeStart(t,e){e.preventDefault(),e.stopPropagation(),this.resizingColumn=t,this.resizeStartX=e.clientX,this.resizeStartWidth=this.columnWidths.get(t)||150,this.resizeEdgeExtra=0,this.resizeLastClientX=e.clientX;const a=this.el.querySelector(".co-data-table__scroll"),o=()=>{var t;return(null===(t=this.parsedColumns.find((t=>t.field===this.resizingColumn)))||void 0===t?void 0:t.minWidth)||80},i=()=>{const t=this.resizingColumn;if(!t)return 0;const e=function({startWidth:t,minWidth:e,pointerDelta:a,autoScrollExtra:o}){return Math.max(e,t+a+o)}({startWidth:this.resizeStartWidth,minWidth:o(),pointerDelta:this.resizeLastClientX-this.resizeStartX,autoScrollExtra:this.resizeEdgeExtra});return this.columnWidths=new Map(this.columnWidths.set(t,e)),e},s=()=>{this.resizeAutoScrollRaf=0;const t=this.resizingColumn;if(!t||!a)return;const e=a.getBoundingClientRect(),c=function({pointerX:t,containerLeft:e,containerRight:a,edgeZone:o=72,maxSpeed:i=24}){const s=a-e;if(s<=0)return 0;const c=Math.min(o,s/3),r=a-c;if(t>r)return Math.min(i,(t-r)/c*i);const n=e+c;return t<n?-Math.min(i,(n-t)/c*i):0}({pointerX:this.resizeLastClientX,containerLeft:e.left,containerRight:e.right});c&&(c<0&&(this.columnWidths.get(t)||this.resizeStartWidth)<=o()||(this.resizeEdgeExtra+=c,this.resizePendingScroll+=c,i(),this.resizeAutoScrollRaf=requestAnimationFrame(s)))},c=t=>{this.resizingColumn&&(this.resizeLastClientX=t.clientX,i(),this.resizeAutoScrollRaf||(this.resizeAutoScrollRaf=requestAnimationFrame(s)))},r=()=>{if(this.resizeAutoScrollRaf&&(cancelAnimationFrame(this.resizeAutoScrollRaf),this.resizeAutoScrollRaf=0),this.resizingColumn){const t=this.columnWidths.get(this.resizingColumn)||150;this.coColumnResize.emit({field:this.resizingColumn,width:t}),this.suppressNextSort=!0}this.resizingColumn=null,document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",r)};document.addEventListener("mousemove",c),document.addEventListener("mouseup",r)}handleRowClick(t,e){this.coRowClick.emit({row:t,index:e})}handleRowDblClick(t,e){this.coRowDblClick.emit({row:t,index:e})}measureHeaderTruncation(){const t=function(t,e){let a=Object.keys(t).some((t=>!e.has(t)));const o={};return e.forEach(((e,i)=>{const s=function(t){return!!t&&t.scrollWidth>t.clientWidth+1}(e);o[i]=s,!!t[i]!==s&&(a=!0)})),a?o:t}(this.truncatedHeaders,this.headerLabelEls);t!==this.truncatedHeaders&&(this.truncatedHeaders=t)}registerHeaderLabel(t,e){var a,o,i;const s=this.headerLabelEls.get(t);if(e){if(s===e)return;s&&(null===(a=this.headerResizeObserver)||void 0===a||a.unobserve(s)),this.headerLabelEls.set(t,e),null===(o=this.headerResizeObserver)||void 0===o||o.observe(e)}else s&&(null===(i=this.headerResizeObserver)||void 0===i||i.unobserve(s),this.headerLabelEls.delete(t))}handleColumnPin(t,e){e.stopPropagation(),this.coColumnPin.emit({field:t})}handleColumnFilter(t,e){e.stopPropagation();const a=e.currentTarget.getBoundingClientRect();this.coHeaderFilter.emit({field:t,rect:{top:a.top,left:a.left,bottom:a.bottom,right:a.right,width:a.width,height:a.height}})}formatCellValue(t){if(null==t)return"";if("boolean"==typeof t)return t?"Yes":"No";if("string"==typeof t){if(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}/.test(t))try{const e=new Date(t);if(!isNaN(e.getTime()))return e.toLocaleDateString("es",{year:"numeric",month:"short",day:"numeric"})+" "+e.toLocaleTimeString("es",{hour:"2-digit",minute:"2-digit"})}catch(t){}return t}return"number"==typeof t?String(t):Array.isArray(t)?t.map((t=>this.formatCellValue(t))).join(", "):"object"==typeof t?t.firstName||t.lastName?[t.firstName,t.lastName].filter(Boolean).join(" "):t.name?String(t.name):t.title?String(t.title):t.label?String(t.label):t.stageName?String(t.stageName):t.companyName?String(t.companyName):t.dealName?String(t.dealName):t._id&&Object.keys(t).length<=3?String(t._id):JSON.stringify(t):String(t)}getColumnStyle(t){return Object.assign({},t.sticky?{left:this.selectable?"48px":"0px"}:{})}getColumnWidth(t){return this.columnWidths.get(t.field)||t.width||t.minWidth||150}getTableWidth(){let t=this.selectable?48:0;for(const e of this.parsedColumns)t+=this.getColumnWidth(e);return t}renderColgroup(){return a("colgroup",null,this.selectable&&a("col",{style:{width:"48px"}}),this.parsedColumns.map((t=>a("col",{style:{width:`${this.getColumnWidth(t)}px`,minWidth:`${t.minWidth||80}px`}}))))}renderSortIcon(t){if(!t.sortable)return null;const e=this.sortField===t.field&&""!==this.sortOrder;return a("span",{class:{"co-data-table__sort-icon":!0,"co-data-table__sort-icon--active":e}},a("co-icon",{name:e?"asc"===this.sortOrder?"caret-up":"caret-down":"caret-up-down",size:16,weight:e?"fill":"regular"}))}renderHeader(){return a("thead",{class:"co-data-table__head"},a("tr",{class:"co-data-table__header-row"},this.selectable&&a("th",{class:"co-data-table__th co-data-table__th--checkbox co-data-table__th--sticky",style:{left:"0px"}},a("co-checkbox",{size:"small",checked:this.isAllSelected(),indeterminate:this.isSomeSelected(),onCoChange:()=>this.handleSelectAll()})),this.parsedColumns.map(((t,e)=>a("th",{class:{"co-data-table__th":!0,"co-data-table__th--sticky":!!t.sticky,"co-data-table__th--sortable":!!t.sortable,"co-data-table__th--sorted":this.sortField===t.field,[`co-data-table__th--align-${t.align||"left"}`]:!0},style:this.getColumnStyle(t),"aria-sort":t.sortable&&this.sortField===t.field&&""!==this.sortOrder?"asc"===this.sortOrder?"ascending":"descending":void 0},a("span",{class:"co-data-table__th-content"},a("span",{class:{"co-data-table__pin-icon":!0,"co-data-table__pin-icon--active":!!t.sticky},title:t.sticky?"Unpin column":"Pin column",onClick:e=>this.handleColumnPin(t.field,e)},a("co-icon",{name:"push-pin",size:14,weight:t.sticky?"fill":"regular"})),t.sortable?a("button",{type:"button",class:"co-data-table__sort-button","aria-label":`Sort by ${t.label}`,onClick:()=>this.handleSort(t.field)},a("co-tooltip",{block:!0,class:"co-data-table__th-tip",content:t.label,placement:"top",disabled:!this.truncatedHeaders[t.field]},a("span",{class:"co-data-table__th-label",ref:e=>this.registerHeaderLabel(t.field,e)},t.label)),this.renderSortIcon(t)):a("co-tooltip",{block:!0,class:"co-data-table__th-tip",content:t.label,placement:"top",disabled:!this.truncatedHeaders[t.field]},a("span",{class:"co-data-table__th-label",ref:e=>this.registerHeaderLabel(t.field,e)},t.label)),t.filterable&&a("span",{class:{"co-data-table__filter-icon":!0,"co-data-table__filter-icon--active":this.parsedFilteredFields.includes(t.field),"co-data-table__filter-icon--indirect":!this.parsedFilteredFields.includes(t.field)&&this.parsedIndirectFields.includes(t.field)},title:this.parsedFilteredFields.includes(t.field)?"Edit column filter":this.parsedIndirectFields.includes(t.field)?"Filtered by other filters":"Filter column",onClick:e=>this.handleColumnFilter(t.field,e)},a("co-icon",{name:"funnel",size:14,weight:this.parsedFilteredFields.includes(t.field)?"fill":"regular"}))),this.resizable&&e<this.parsedColumns.length-1&&a("span",{class:{"co-data-table__resize-handle":!0,"co-data-table__resize-handle--active":this.resizingColumn===t.field},onMouseDown:e=>this.handleResizeStart(t.field,e),onClick:t=>t.stopPropagation()}))))))}renderSkeletonBody(){return a("tbody",{class:"co-data-table__body co-data-table__body--skeleton","aria-hidden":"true"},Array.from({length:this.skeletonRows}).map(((t,e)=>a("tr",{class:"co-data-table__row co-data-table__row--skeleton",key:`skeleton-${e}`},this.selectable&&a("td",{class:"co-data-table__td co-data-table__td--checkbox co-data-table__td--sticky",style:{left:"0px"}},a("div",{class:"co-data-table__skeleton co-data-table__skeleton--checkbox"})),this.parsedColumns.map((t=>a("td",{class:{"co-data-table__td":!0,"co-data-table__td--sticky":!!t.sticky},style:Object.assign({},this.getColumnStyle(t))},a("div",{class:"co-data-table__skeleton"}))))))))}renderEmpty(){return this.loading||this.parsedRows.length>0?null:a("div",{class:"co-data-table__empty",part:"empty"},a("div",{class:"co-data-table__empty-icon"},a("co-icon",{name:this.emptyIcon,size:32,weight:"regular"})),this.emptyTitle&&a("h3",{class:"co-data-table__empty-title"},this.emptyTitle),this.emptyMessage&&a("p",{class:"co-data-table__empty-message"},this.emptyMessage),a("div",{class:"co-data-table__empty-action"},this.emptyActionLabel?a("co-button",{variant:this.emptyActionVariant,size:"m",label:this.emptyActionLabel,iconLeft:this.emptyActionIcon,onClick:()=>this.coEmptyAction.emit()}):a("slot",{name:"empty-action"})))}render(){return a("div",{key:"6f71533676a2c66ae46b1ee9940b405744cef174",class:{"co-data-table":!0,"co-data-table--resizing":null!==this.resizingColumn,"co-data-table--loading":this.loading,"co-data-table--empty":!this.loading&&0===this.parsedRows.length}},a("div",{key:"8176dca34858e32ba2ce008ac44cf444ea952f08",class:"co-data-table__scroll"},a("table",{key:"f285815728244a7161d91dbed6ca87b158db4de6",class:"co-data-table__table",style:{width:`${this.getTableWidth()}px`,minWidth:"100%"}},this.renderColgroup(),this.renderHeader(),a("slot",{key:"97f4ed9020a7bdb8b262313a10451e9aff754a8e"}),this.loading?this.renderSkeletonBody():null)),this.renderEmpty())}get el(){return o(this)}static get watchers(){return{columns:[{parseColumns:0}],rows:[{parseRows:0}],selectedKeys:[{parseSelectedKeys:0}],filteredFields:[{parseFilteredFields:0}],indirectFilteredFields:[{parseIndirectFields:0}]}}};i.style="co-data-table{display:block;flex:1;min-height:0;overflow:hidden;contain:layout}.co-data-table{position:relative;font-family:var(--co-font-family-primary);background:var(--co-color-base-blanco);display:flex;flex-direction:column;height:100%}.co-data-table--resizing{cursor:col-resize;user-select:none}.co-data-table__scroll{flex:1;overflow-x:auto;overflow-y:auto;min-height:0}.co-data-table__table{min-width:100%;border-collapse:separate;border-spacing:0;table-layout:fixed}.co-data-table__head{position:sticky;top:0;z-index:2}.co-data-table__header-row{height:40px}.co-data-table__th{position:relative;height:40px;padding:0 var(--co-spacing-md);background:var(--co-color-base-blanco);border-bottom:1px solid color-mix(in srgb, var(--co-semantic-border-default) 75%, transparent);border-right:1px solid color-mix(in srgb, var(--co-semantic-border-default) 75%, transparent);text-align:left;vertical-align:middle;font-size:var(--co-font-size-14);font-weight:500;color:var(--co-semantic-text-default);letter-spacing:var(--co-font-letter-spacing-body);line-height:1;white-space:nowrap;overflow:hidden;box-sizing:border-box}.co-data-table__th:last-child{border-right:none}.co-data-table__th--sortable{cursor:pointer}.co-data-table__th--sortable:hover{background-image:linear-gradient(var(--co-semantic-surface-hover), var(--co-semantic-surface-hover))}.co-data-table__th-content{display:flex;align-items:center;justify-content:space-between;gap:var(--co-spacing-sm)}.co-data-table__pin-icon{display:flex;align-items:center;flex-shrink:0;color:var(--co-color-gray-300);cursor:pointer;opacity:0;transition:opacity var(--co-motion-duration-fast) var(--co-motion-ease-out), color var(--co-motion-duration-fast) var(--co-motion-ease-out)}.co-data-table__pin-icon--active{opacity:1;color:var(--co-semantic-text-default)}.co-data-table__th:hover .co-data-table__pin-icon{opacity:1}.co-data-table__pin-icon:hover{color:var(--co-semantic-text-default)}.co-data-table__filter-icon{display:flex;align-items:center;flex-shrink:0;color:var(--co-color-gray-300);cursor:pointer;opacity:0;transition:opacity var(--co-motion-duration-fast) var(--co-motion-ease-out), color var(--co-motion-duration-fast) var(--co-motion-ease-out)}.co-data-table__th:hover .co-data-table__filter-icon{opacity:1}.co-data-table__filter-icon:hover{color:var(--co-semantic-text-default)}.co-data-table__filter-icon--active{opacity:1;color:var(--co-color-primary-azul)}.co-data-table__filter-icon--indirect{opacity:0.45;color:var(--co-semantic-text-muted)}.co-data-table__th-tip{flex:1;min-width:0}.co-data-table__th-label{display:block;overflow:hidden;text-overflow:ellipsis}.co-data-table__sort-icon{display:flex;align-items:center;flex-shrink:0;color:var(--co-color-gray-400);transition:color var(--co-motion-duration-fast) var(--co-motion-ease-out)}.co-data-table__sort-icon--active{color:var(--co-semantic-text-default)}.co-data-table__sort-button{flex:1;min-width:0;display:flex;align-items:center;justify-content:space-between;gap:var(--co-spacing-sm);background:transparent;border:0;padding:0;margin:0;font:inherit;color:inherit;letter-spacing:inherit;text-align:left;cursor:pointer}.co-data-table__sort-button:focus-visible{outline:2px solid var(--co-semantic-border-focus, var(--co-color-primary-azul));outline-offset:-2px;border-radius:var(--co-border-radius-xxs)}.co-data-table__th--checkbox,.co-data-table__td--checkbox{width:48px;min-width:48px;max-width:48px;padding:0 var(--co-spacing-md);text-align:center;line-height:0;}.co-data-table__th.co-data-table__th--checkbox,.co-data-table__td.co-data-table__td--checkbox{border-right:none}.co-data-table__th--sticky,.co-data-table__td--sticky{position:sticky;z-index:1;background:var(--co-color-base-blanco)}.co-data-table__th--sticky{z-index:3}.co-data-table__th.co-data-table__th--sticky,.co-data-table__td.co-data-table__td--sticky{overflow:visible}.co-data-table__td--sticky::after,.co-data-table__th--sticky::after{content:'';position:absolute;top:0;right:-4px;bottom:0;width:4px;pointer-events:none;opacity:0;background:linear-gradient(to right, var(--co-color-opacity-negro-8), transparent);transition:opacity var(--co-motion-duration-fast) var(--co-motion-ease-out)}.co-data-table__td--sticky::before{content:'';position:absolute;inset:0;z-index:-1;pointer-events:none;background-color:var(--co-semantic-surface-hover);opacity:0;transition:opacity var(--co-motion-duration-fast) var(--co-motion-ease-out), background-color var(--co-motion-duration-fast) var(--co-motion-ease-out)}.co-data-table__row:hover .co-data-table__td--sticky::before{opacity:1}.co-data-table__row--selected .co-data-table__td--sticky::before{opacity:1;background-color:var(--co-color-opacity-negro-4)}.co-data-table__row--selected:hover .co-data-table__td--sticky::before{background-color:var(--co-color-opacity-negro-8)}.co-data-table__resize-handle{position:absolute;top:0;right:-2px;width:5px;height:100%;cursor:col-resize;z-index:1}.co-data-table__resize-handle:hover{background:var(--co-color-primary-azul);opacity:0.3}.co-data-table__resize-handle--active{background:var(--co-color-primary-azul);opacity:0.3}.co-data-table__row{height:48px;transition:background-color var(--co-motion-duration-fast) var(--co-motion-ease-out);content-visibility:auto;contain-intrinsic-size:auto 48px}.co-data-table__row:hover{background:var(--co-semantic-surface-hover)}.co-data-table__row--selected{background:var(--co-color-opacity-negro-4)}.co-data-table__row--selected:hover{background:var(--co-color-opacity-negro-8)}.co-data-table__td{height:48px;padding:0 var(--co-spacing-md);background:transparent;border-bottom:1px solid color-mix(in srgb, var(--co-semantic-border-default) 75%, transparent);border-right:1px solid color-mix(in srgb, var(--co-semantic-border-default) 75%, transparent);vertical-align:middle;font-size:var(--co-font-size-12);font-weight:var(--co-font-weight-medium);color:var(--co-semantic-text-default);letter-spacing:var(--co-font-letter-spacing-body);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;box-sizing:border-box}.co-data-table__td:last-child{border-right:none}.co-data-table__th--align-center,.co-data-table__td--align-center{text-align:center}.co-data-table__th--align-right,.co-data-table__td--align-right{text-align:right}.co-data-table__cell-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block}.co-data-table--empty .co-data-table__scroll{flex:0 0 auto;overflow:hidden}.co-data-table__empty{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;flex:1;min-height:280px;padding:var(--co-spacing-3xl) var(--co-spacing-lg);gap:var(--co-spacing-lg) }.co-data-table__empty-icon{display:inline-flex;align-items:center;justify-content:center;width:64px;height:64px;border-radius:var(--co-border-radius-full);background:var(--co-semantic-surface-muted);color:var(--co-semantic-text-secondary);margin-bottom:var(--co-spacing-sm)}.co-data-table__empty-title{font-size:var(--co-font-size-24);font-weight:var(--co-font-weight-medium, 500);line-height:1.25;color:var(--co-semantic-text-default);letter-spacing:-0.03em}.co-data-table__empty-message{font-size:var(--co-font-size-14);font-weight:400;color:var(--co-semantic-text-secondary);margin:0;max-width:538px ;line-height:1.25}.co-data-table__empty-action{margin-top:var(--co-spacing-md);display:inline-flex}.co-data-table__empty-action:empty{display:none}.co-data-table__skeleton{height:14px;border-radius:var(--co-border-radius-xxs);background:linear-gradient( 90deg, var(--co-semantic-surface-secondary) 0%, var(--co-semantic-surface-hover, rgba(0, 0, 0, 0.04)) 50%, var(--co-semantic-surface-secondary) 100% );background-size:200% 100%;animation:co-dt-shimmer 1.2s ease-in-out infinite;width:70%}.co-data-table__skeleton--checkbox{width:16px;height:16px;margin:0 auto}@keyframes co-dt-shimmer{0%{background-position:200% 0}100%{background-position:-200% 0}}@media (prefers-reduced-motion: reduce){.co-data-table__skeleton{animation:none}}.co-data-table__row--skeleton{pointer-events:none;content-visibility:visible}.co-data-table__row--flash-create{animation:co-dt-flash-create 1s ease-out}.co-data-table__row--flash-update{animation:co-dt-flash-update 1s ease-out}.co-data-table__row--flash-delete{animation:co-dt-flash-delete 0.5s ease-out forwards}@keyframes co-dt-flash-create{0%{background-color:rgba(2, 162, 112, 0.15)}100%{background-color:transparent}}@keyframes co-dt-flash-update{0%{background-color:rgba(37, 99, 235, 0.15)}100%{background-color:transparent}}@keyframes co-dt-flash-delete{0%{opacity:1;background-color:rgba(170, 46, 27, 0.1)}100%{opacity:0;height:0;padding:0;overflow:hidden}}";export{i as co_data_table}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as i,h as r}from"./p-DH5lfRNj.js";const a=class{constructor(r){t(this,r),this.coChange=i(this,"coChange",7),this.value=0,this.max=5,this.size="small",this.disabled=!1,this.readOnly=!1,this.icon="star",this.status="default",this.hoverValue=0,this.handleClick=t=>{if(this.disabled||this.readOnly)return;const i=this.value===t?0:t;this.value=i,this.coChange.emit(i)},this.handleMouseEnter=t=>{this.disabled||this.readOnly||(this.hoverValue=t)},this.handleMouseLeave=()=>{this.hoverValue=0}}get statusIcon(){return{error:"warning-circle",success:"check-circle",warning:"warning",info:"info"}[this.status]||null}render(){const t="large"===this.size?28:20,i=this.hoverValue||this.value,a=Array.from({length:this.max},((t,i)=>i+1));return r("div",{key:"
|
|
1
|
+
import{r as t,c as i,h as r}from"./p-DH5lfRNj.js";const a=class{constructor(r){t(this,r),this.coChange=i(this,"coChange",7),this.value=0,this.max=5,this.size="small",this.disabled=!1,this.readOnly=!1,this.icon="star",this.status="default",this.hoverValue=0,this.handleClick=t=>{if(this.disabled||this.readOnly)return;const i=this.value===t?0:t;this.value=i,this.coChange.emit(i)},this.handleMouseEnter=t=>{this.disabled||this.readOnly||(this.hoverValue=t)},this.handleMouseLeave=()=>{this.hoverValue=0}}get statusIcon(){return{error:"warning-circle",success:"check-circle",warning:"warning",info:"info"}[this.status]||null}render(){const t="large"===this.size?28:20,i=this.hoverValue||this.value,a=Array.from({length:this.max},((t,i)=>i+1));return r("div",{key:"a825b7cf49067c0a12ccddb81554c172d90a888f",class:{"co-rating":!0,"co-rating--disabled":this.disabled,"co-rating--readonly":this.readOnly,[`co-rating--${this.size}`]:!0}},this.label&&r("label",{key:"354b3b676401d0265e5f64aed1b137b97a147468",class:"co-rating__label"},this.label),r("div",{key:"29c8af2cde2482ac803e75025dc5533c7051c2ff",class:"co-rating__stars",onMouseLeave:this.handleMouseLeave},a.map((a=>r("button",{class:{"co-rating__star":!0,"co-rating__star--active":a<=i,"co-rating__star--hover":this.hoverValue>0&&a<=this.hoverValue},type:"button",tabIndex:this.disabled||this.readOnly?-1:0,disabled:this.disabled,onClick:()=>this.handleClick(a),onMouseEnter:()=>this.handleMouseEnter(a),"aria-label":`${a} of ${this.max}`},r("co-icon",{name:this.icon,size:t,weight:a<=i?"fill":"regular"}))))),this.helperText&&r("div",{key:"0fcc95b7e125f1ef57c67ed9e46d4511da5d3eaa",class:`co-rating__helper co-rating__helper--${this.status}`},this.statusIcon&&r("co-icon",{key:"c9cb1f60e902c0b52a45225bedacd92ba08ae0b4",name:this.statusIcon,size:14,weight:"fill",class:"co-rating__helper-icon"}),r("span",{key:"8a5479175de97fccb5947f2f8f2c87888481b104",class:"co-rating__helper-text"},this.helperText)))}};a.style=":host{display:inline-block;font-family:var(--co-font-family-primary);line-height:1}.co-rating{display:flex;flex-direction:column;gap:var(--co-spacing-sm2)}.co-rating__label{color:var(--co-semantic-text-secondary);font-size:var(--co-font-size-14);font-weight:400;cursor:default;padding:0 var(--co-spacing-xs)}.co-rating--disabled .co-rating__label{color:var(--co-semantic-text-disabled)}.co-rating__stars{display:inline-flex;gap:var(--co-spacing-xs)}.co-rating__star{display:flex;align-items:center;justify-content:center;padding:0;margin:0;border:none;background:transparent;cursor:pointer;color:var(--co-semantic-border-subtle);transition:color var(--co-motion-duration-fast) var(--co-motion-ease-out), transform var(--co-motion-duration-fast) var(--co-motion-ease-out)}.co-rating__star:hover:not(:disabled){transform:scale(1.15)}.co-rating__star--active{color:#F5A623;}.co-rating__star--hover{color:#F5A623}.co-rating--disabled .co-rating__star{cursor:not-allowed;opacity:0.5}.co-rating--readonly .co-rating__star{cursor:default}.co-rating__helper{display:flex;align-items:center;gap:var(--co-spacing-xs);padding:0 var(--co-spacing-xs)}.co-rating__helper-icon{flex-shrink:0;display:flex;align-items:center}.co-rating__helper-text{color:var(--co-semantic-text-muted);font-size:var(--co-font-size-14);font-weight:400;line-height:1}.co-rating__helper--error .co-rating__helper-icon,.co-rating__helper--error .co-rating__helper-text{color:var(--co-semantic-status-error)}.co-rating__helper--success .co-rating__helper-icon,.co-rating__helper--success .co-rating__helper-text{color:var(--co-semantic-status-success)}.co-rating__helper--warning .co-rating__helper-icon,.co-rating__helper--warning .co-rating__helper-text{color:var(--co-color-status-review)}.co-rating__helper--info .co-rating__helper-icon,.co-rating__helper--info .co-rating__helper-text{color:var(--co-semantic-status-info)}";export{a as co_rating}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,c as t,h as a,a as r}from"./p-DH5lfRNj.js";import{R as o}from"./p-fMqVDypp.js";const c=class{constructor(a){e(this,a),this.coInput=t(this,"coInput",7),this.coChange=t(this,"coChange",7),this.coFocus=t(this,"coFocus",7),this.coBlur=t(this,"coBlur",7),this.coClear=t(this,"coClear",7),this.value="",this.placeholder="",this.required=!1,this.disabled=!1,this.readonly=!1,this.rows=4,this.status="default",this.layout="vertical",this.size="md",this.variant="default",this.clearable=!1,this.resize="vertical",this.hasFocus=!1,this.handleInput=e=>{this.value=e.target.value,this.coInput.emit(this.value)},this.handleFocus=()=>{this.hasFocus=!0,this.coFocus.emit()},this.handleBlur=()=>{this.hasFocus=!1,this.coChange.emit(this.value),this.coBlur.emit()},this.handleClear=()=>{var e;this.value="",this.coClear.emit(),this.coInput.emit(""),null===(e=this.textareaEl)||void 0===e||e.focus()}}get hasValue(){return null!=this.value&&""!==this.value}get charCount(){var e;return(null!==(e=this.value)&&void 0!==e?e:"").length}render(){const e=this.clearable&&this.hasValue&&!this.disabled&&!this.readonly,t=null!=this.maxLength&&this.charCount>this.maxLength,r="default"!==this.status?`co-textarea--${this.status}`:"";return a("div",{key:"
|
|
1
|
+
import{r as e,c as t,h as a,a as r}from"./p-DH5lfRNj.js";import{R as o}from"./p-fMqVDypp.js";const c=class{constructor(a){e(this,a),this.coInput=t(this,"coInput",7),this.coChange=t(this,"coChange",7),this.coFocus=t(this,"coFocus",7),this.coBlur=t(this,"coBlur",7),this.coClear=t(this,"coClear",7),this.value="",this.placeholder="",this.required=!1,this.disabled=!1,this.readonly=!1,this.rows=4,this.status="default",this.layout="vertical",this.size="md",this.variant="default",this.clearable=!1,this.resize="vertical",this.hasFocus=!1,this.handleInput=e=>{this.value=e.target.value,this.coInput.emit(this.value)},this.handleFocus=()=>{this.hasFocus=!0,this.coFocus.emit()},this.handleBlur=()=>{this.hasFocus=!1,this.coChange.emit(this.value),this.coBlur.emit()},this.handleClear=()=>{var e;this.value="",this.coClear.emit(),this.coInput.emit(""),null===(e=this.textareaEl)||void 0===e||e.focus()}}get hasValue(){return null!=this.value&&""!==this.value}get charCount(){var e;return(null!==(e=this.value)&&void 0!==e?e:"").length}render(){const e=this.clearable&&this.hasValue&&!this.disabled&&!this.readonly,t=null!=this.maxLength&&this.charCount>this.maxLength,r="default"!==this.status?`co-textarea--${this.status}`:"";return a("div",{key:"c5d9a8fc2c47e2ac4787441d2837b9bf600aceb8",class:{"co-textarea":!0,"co-textarea--disabled":this.disabled,"co-textarea--focused":this.hasFocus,"co-textarea--filled":this.hasValue,"co-textarea--over-limit":t,[`co-textarea--${this.size}`]:!0,[r]:!!r,"co-textarea--flat":"flat"===this.variant},part:"wrapper"},(this.label||this.secondaryLabel)&&a("div",{key:"4c71cdc7a1d8063b4fc88613cc6840ae4d8fffbd",class:"co-textarea__labels"},this.label&&a("label",{key:"7a332a79ca80a5e7e6e0e18431871c83175cf6ad",class:"co-textarea__label",part:"label"},this.label,a(o,{key:"f266eeff511590081664ff5677e85f91bb8cc6c6",required:this.required})),this.secondaryLabel&&a("span",{key:"43d1d98374cd6cdb9e9ebbed9a0677d36ccf0242",class:"co-textarea__secondary-label"},this.secondaryLabel)),a("div",{key:"31b9a71972fc8bf6db1e01f6ef421d1cd01c0c71",class:"co-textarea__field",part:"field"},a("textarea",{key:"c6e42c9cb50919f8d28d52acc6ac67824d2ab9bc",ref:e=>this.textareaEl=e,class:{"co-textarea__native":!0,[`co-textarea__native--resize-${this.resize}`]:!0},rows:this.rows,value:this.value,placeholder:this.placeholder,disabled:this.disabled,readOnly:this.readonly,required:this.required,"aria-invalid":"error"===this.status||t?"true":"false",onInput:this.handleInput,onFocus:this.handleFocus,onBlur:this.handleBlur,part:"input"}),e&&a("button",{key:"37ade2676d789e93699b31c60ee1922287613c99",class:"co-textarea__clear",type:"button",tabIndex:-1,onClick:this.handleClear,"aria-label":"Clear"},a("co-icon",{key:"635e46dd3780dce114beeda02e05a8dc512f0e64",name:"x-circle",size:16,weight:"fill"}))),(this.helperText||null!=this.maxLength)&&a("div",{key:"c845c82bba32624dbb23b518283f646fc573766e",class:"co-textarea__footer"},this.helperText&&a("div",{key:"3cf30fdfbab68e06fc757b7a64b7d89cbefe53ac",class:{"co-textarea__helper":!0,"co-textarea__helper--error":"error"===this.status},part:"helper"},"error"===this.status&&a("co-icon",{key:"16009fbd88a7f4769bb1ddf1cbadf8aaf3dce17b",name:"warning-circle",size:14,class:"co-textarea__helper-icon"}),a("span",{key:"3986eda7ec8df0da750a410bf6c361b864386d64",class:"co-textarea__helper-text"},this.helperText)),null!=this.maxLength&&a("span",{key:"7ed3ab0c254b0d69f90016dcdc419408410ea457",class:{"co-textarea__counter":!0,"co-textarea__counter--over":t},part:"counter"},this.charCount,"/",this.maxLength)))}get el(){return r(this)}};c.style=":host{display:block;font-family:var(--co-font-family-primary);font-size:var(--co-font-size-14);letter-spacing:var(--co-font-letter-spacing-body);line-height:1}.co-textarea{display:flex;flex-direction:column;gap:var(--co-spacing-sm2)}.co-textarea__labels{display:flex;align-items:center;justify-content:space-between;padding:0 var(--co-spacing-xs);gap:var(--co-spacing-sm2)}.co-textarea__label{color:var(--co-semantic-text-secondary);font-size:var(--co-font-size-14);font-weight:400;letter-spacing:var(--co-font-letter-spacing-body);line-height:1;white-space:nowrap;cursor:default}.co-textarea__secondary-label{color:var(--co-semantic-text-secondary);font-size:var(--co-font-size-14);font-weight:400;letter-spacing:var(--co-font-letter-spacing-body);line-height:1;white-space:nowrap;text-align:right}.co-field-required{margin-left:2px;color:var(--co-color-status-error)}.co-field-required__caption{margin-left:4px;color:var(--co-semantic-text-muted);font-size:var(--co-font-size-12);font-weight:400}.co-field-required__caption::before{content:var(--co-field-required-text, ' (required)')}.co-textarea__field{position:relative;display:flex;background:var(--co-semantic-surface-page);border:1px solid var(--co-semantic-border-field);border-radius:var(--co-border-radius-xs);transition:border-color var(--co-motion-duration-fast) var(--co-motion-ease-out), box-shadow var(--co-motion-duration-fast) var(--co-motion-ease-out);box-sizing:border-box;overflow:hidden}.co-textarea--flat .co-textarea__field{background:transparent;-webkit-backdrop-filter:none;backdrop-filter:none;border-color:transparent}.co-textarea__native{width:100%;border:none;outline:none;background:transparent;font-family:var(--co-font-family-primary);font-size:var(--co-font-size-14);font-weight:400;line-height:1.5;color:var(--co-semantic-text-default);padding:var(--co-spacing-sm2) var(--co-spacing-md);margin:0;box-sizing:border-box}.co-textarea__native::placeholder{color:var(--co-semantic-text-muted)}.co-textarea--s .co-textarea__native{padding:var(--co-spacing-xxs) var(--co-spacing-sm);font-size:var(--co-font-size-12)}.co-textarea--sm .co-textarea__native{padding:var(--co-spacing-xs) var(--co-spacing-sm);font-size:var(--co-font-size-14)}.co-textarea--lg .co-textarea__native{padding:var(--co-spacing-sm) var(--co-spacing-lg);font-size:var(--co-font-size-16)}.co-textarea__native--resize-vertical{resize:vertical}.co-textarea__native--resize-none{resize:none}.co-textarea__native--resize-both{resize:both}.co-textarea__clear{position:absolute;top:var(--co-spacing-sm2);right:var(--co-spacing-sm2);display:flex;align-items:center;justify-content:center;width:24px;height:24px;border:none;border-radius:var(--co-border-radius-xxs);background:transparent;color:var(--co-semantic-text-muted);cursor:pointer;padding:0;transition:color var(--co-motion-duration-fast) var(--co-motion-ease-out), background var(--co-motion-duration-fast) var(--co-motion-ease-out)}.co-textarea__clear:hover{color:var(--co-semantic-text-default);background:var(--co-semantic-surface-hover)}.co-textarea__footer{display:flex;align-items:center;justify-content:space-between;padding:0 var(--co-spacing-xs);gap:var(--co-spacing-md)}.co-textarea__helper{display:flex;align-items:center;gap:var(--co-spacing-xs);flex:1;min-width:0}.co-textarea__helper-icon{flex-shrink:0;color:var(--co-semantic-text-muted);display:flex;align-items:center}.co-textarea__helper-text{color:var(--co-semantic-text-muted);font-size:var(--co-font-size-14);font-weight:400;line-height:1;letter-spacing:var(--co-font-letter-spacing-body)}.co-textarea__counter{color:var(--co-semantic-text-muted);font-size:var(--co-font-size-12, 12px);font-weight:400;line-height:1;white-space:nowrap;flex-shrink:0}.co-textarea__counter--over{color:var(--co-color-status-error);font-weight:500}.co-textarea--focused .co-textarea__field{border-color:var(--co-semantic-border-focus);box-shadow:0 0 0 2px var(--co-semantic-border-focus-ring)}.co-textarea--disabled{opacity:0.6;pointer-events:none}.co-textarea--disabled .co-textarea__field{background:var(--co-semantic-surface-disabled);border-color:transparent}.co-textarea--error .co-textarea__field{border-color:var(--co-semantic-status-error)}.co-textarea--error.co-textarea--focused .co-textarea__field{border-color:var(--co-semantic-status-error);box-shadow:0 0 0 2px rgba(170, 46, 27, 0.12)}.co-textarea--error .co-textarea__helper-icon,.co-textarea--error .co-textarea__helper-text{color:var(--co-semantic-status-error)}.co-textarea--success .co-textarea__field{border-color:var(--co-semantic-status-success)}.co-textarea--success.co-textarea--focused .co-textarea__field{border-color:var(--co-semantic-status-success);box-shadow:0 0 0 2px rgba(10, 119, 36, 0.12)}.co-textarea--warning .co-textarea__field{border-color:var(--co-semantic-status-warning)}.co-textarea--warning.co-textarea--focused .co-textarea__field{border-color:var(--co-semantic-status-warning);box-shadow:0 0 0 2px rgba(253, 191, 0, 0.12)}.co-textarea--over-limit .co-textarea__field{border-color:var(--co-semantic-status-error)}:host([layout='horizontal']) .co-textarea{display:grid;grid-template-columns:var(--co-field-label-width, max-content) 1fr;align-items:start;column-gap:var(--co-spacing-md);row-gap:var(--co-spacing-sm2)}:host([layout='horizontal']) .co-textarea__labels{grid-column:1;grid-row:1;padding-top:var(--co-spacing-sm2);min-width:0}:host([layout='horizontal']) .co-textarea__label{white-space:normal}:host([layout='horizontal']) .co-textarea>:not(.co-textarea__labels){grid-column:2;min-width:0}";export{c as co_textarea}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as o,c as e,h as r,a as i}from"./p-DH5lfRNj.js";import{R as t}from"./p-fMqVDypp.js";import{h as a,a as s,p as c,b as n,i as l}from"./p-BRbgGqLw.js";import{l as h,f as d}from"./p-gKnOhsd2.js";const p={en:{swatches:"Color presets",groupNeutrals:"Neutrals",groupBrand:"Brand colors",area:"Saturation and brightness",hue:"Hue",hueValue:"{n} degrees",saturation:"Saturation",satValue:"Saturation {n}%",brightness:"Brightness",briValue:"Brightness {n}%",area2D:"2D slider",hexField:"Hex code",eyedropper:"Pick a color from the screen",copy:"Copy"},es:{swatches:"Colores predefinidos",groupNeutrals:"Neutros",groupBrand:"Colores de marca",area:"Saturación y brillo",hue:"Matiz",hueValue:"{n} grados",saturation:"Saturación",satValue:"Saturación {n} %",brightness:"Brillo",briValue:"Brillo {n} %",area2D:"Control 2D",hexField:"Código hexadecimal",eyedropper:"Elegir un color de la pantalla",copy:"Copiar"},pt:{swatches:"Cores predefinidas",groupNeutrals:"Neutros",groupBrand:"Cores da marca",area:"Saturação e brilho",hue:"Matiz",hueValue:"{n} graus",saturation:"Saturação",satValue:"Saturação {n} %",brightness:"Brilho",briValue:"Brilho {n} %",area2D:"Controle 2D",hexField:"Código hexadecimal",eyedropper:"Escolher uma cor da tela",copy:"Copiar"}},u=o=>{var e;return"string"==typeof o?{key:o,name:o,value:o,synthesizedKey:!0}:null!=o.key?{key:o.key,name:o.name,value:o.value}:{key:null!==(e=o.name)&&void 0!==e?e:o.value,name:o.name,value:o.value,synthesizedKey:!0}},b=[{key:"black",name:"Black",value:"#1F1C1B"},{key:"gray",name:"Gray",value:"#585858"},{key:"silver",name:"Silver",value:"#C4C4C4"},{key:"smoke",name:"Smoke",value:"#E3E3E3"},{key:"bone",name:"Bone",value:"#F7F6F0"},{key:"green",name:"Green",value:"#02A270"},{key:"olive",name:"Olive",value:"#AAB43C"},{key:"yellow",name:"Yellow",value:"#FDBF00"},{key:"orange",name:"Orange",value:"#F0821E"},{key:"red",name:"Red",value:"#EB1E1E"},{key:"pink",name:"Pink",value:"#F32A73"},{key:"burgundy",name:"Burgundy",value:"#811137"},{key:"violet",name:"Violet",value:"#5F4BD7"},{key:"electricBlue",name:"Electric blue",value:"#000AFF"},{key:"blue",name:"Blue",value:"#2563EB"},{key:"lightBlue",name:"Light blue",value:"#00BEE6"},{key:"teal",name:"Teal",value:"#00AFAF"}],f=["black","gray","silver","smoke","bone"],g=b.filter((o=>!f.includes(o.key))).map((o=>o.key)),v=new Set(f),m=new Set(g),k=/^#?[0-9a-f]*$/i,x=Object.freeze({h:0,s:100,v:100}),_=o=>o.reduce(((o,e)=>o.concat(e.items)),[]),y=class{constructor(r){o(this,r),this.coChange=e(this,"coChange",7),this.coInput=e(this,"coInput",7),this.value="",this.placeholder="Select color",this.disabled=!1,this.required=!1,this.status="default",this.layout="vertical",this.size="md",this.presets="",this.locale="en",this.isOpen=!1,this.copied=!1,this.hsv=x,this.hexDraft="",this.hexEditing=!1,this.areaAxis="s",this.emitted="",this.committed="",this.focusedIndex=0,this.areaDragging=!1,this.handlePopoverOpen=()=>{this.isOpen=!0,this.areaDragging=!1,this.resetHexDraft();const o=this.flatPresets.findIndex((o=>o.value.toUpperCase()===(this.value||"").toUpperCase()));this.focusedIndex=o>=0?o:0},this.handlePopoverClose=()=>{this.isOpen=!1,this.finishHexEdit(),this.restoreTriggerFocus()},this.handleTriggerKeyDown=o=>{this.disabled||("Enter"===o.key||" "===o.key?(o.preventDefault(),this.isOpen=!this.isOpen):"ArrowDown"!==o.key||this.isOpen||(o.preventDefault(),this.isOpen=!0))},this.pointerToHsv=o=>{var e;const r=null===(e=this.areaEl)||void 0===e?void 0:e.getBoundingClientRect();if(!(r&&r.width>0&&r.height>0))return!1;const i=Math.min(Math.max((o.clientX-r.left)/r.width,0),1),t=Math.min(Math.max((o.clientY-r.top)/r.height,0),1);return this.previewHsv({s:100*i,v:100*(1-t)}),!0},this.handleAreaPointerDown=o=>{var e,r;this.disabled||0!==o.button||(null===(r=null===(e=this.areaEl)||void 0===e?void 0:e.setPointerCapture)||void 0===r||r.call(e,o.pointerId),this.areaDragging=this.pointerToHsv(o))},this.handleAreaPointerMove=o=>{!this.disabled&&this.areaDragging&&1===o.buttons&&this.pointerToHsv(o)},this.handleAreaPointerCancel=()=>{this.areaDragging=!1},this.handleAreaPointerUp=o=>{this.areaDragging&&0===o.button&&(this.areaDragging=!1,this.disabled||this.commit(a(this.hsv)))},this.handleAreaKeyDown=o=>{if(this.disabled)return;const e=y.AREA_KEYS[o.key];if(!e)return;o.preventDefault();const r=Math.min(100,Math.max(0,this.hsv[e.axis]+e.dir*(o.shiftKey?10:1)));this.focusAxis(e.axis),this.previewHsv({[e.axis]:r}),this.commit(a(this.hsv))},this.handleHueKeyDown=o=>{if(this.disabled||!o.shiftKey)return;const e="ArrowRight"===o.key||"ArrowUp"===o.key?1:"ArrowLeft"===o.key||"ArrowDown"===o.key?-1:0;if(!e)return;o.preventDefault();const r=Math.min(360,Math.max(0,this.hsv.h+10*e));this.previewHsv({h:r}),this.commit(a(this.hsv))},this.handleGridKeyDown=o=>{var e;if(this.disabled)return;const r=this.presetGroups,i=_(r),t=i.length;if(!t)return;const a=Math.min(Math.max(this.focusedIndex,0),t-1);let s=a;switch(o.key){case"ArrowRight":s=(a+1)%t;break;case"ArrowLeft":s=(a-1+t)%t;break;case"ArrowDown":s=this.verticalNeighbor(r,a,1);break;case"ArrowUp":s=this.verticalNeighbor(r,a,-1);break;case"Home":s=0;break;case"End":s=t-1;break;case"Enter":case" ":return o.preventDefault(),void this.handleSwatchClick(i[a].value);default:return}o.preventDefault(),this.focusedIndex=s,null===(e=this.optionEls()[s])||void 0===e||e.focus()},this.handleHexInput=o=>{var e,r;if(this.disabled)return;const i=o.target,t=this.escapeHex(i.value);if(i.value!==t){const o=null!==(e=i.selectionStart)&&void 0!==e?e:i.value.length,a=Math.min(this.escapeHex(i.value.slice(0,o)).length,t.length);i.value=t,null===(r=i.setSelectionRange)||void 0===r||r.call(i,a,a)}this.hexEditing=!0,this.hexDraft=t,s(t)&&this.previewHex(this.expandHex(t))},this.handleHexBlur=()=>{this.finishHexEdit()},this.handleHexKeyDown=o=>{"Enter"===o.key&&(o.preventDefault(),this.finishHexEdit())},this.handleHexPaste=o=>{var e,r;if(this.disabled)return;const i=(null!==(r=null===(e=o.clipboardData)||void 0===e?void 0:e.getData("text"))&&void 0!==r?r:"").trim(),t=c(i);if(t)return o.preventDefault(),this.hexEditing=!1,this.hexDraft=this.escapeHex(t),void this.commit(t);k.test(i)||o.preventDefault()},this.handleEyeDropper=async()=>{if(this.finishHexEdit(),this.hasEyeDropper)try{const o=window.EyeDropper,{sRGBHex:e}=await(new o).open(),r=c(e);r&&this.commit(r)}catch(o){}}}syncFromValue(o){if(this.syncHexDraft(o),(o||"").toUpperCase()===(this.emitted||"").toUpperCase())return;this.committed=o,this.emitted=o;const e=n(o||"");e&&(this.hsv=e)}componentWillLoad(){const o=n(this.value||"");this.hsv=null!=o?o:x,this.areaAxis="s",this.resetHexDraft(),this.committed=this.value,this.emitted=this.value}previewHsv(o){this.hsv=Object.assign(Object.assign({},this.hsv),o),this.emitPreview(a(this.hsv))}previewHex(o){const e=n(o);e&&(this.hsv=e),this.emitPreview(o)}emitPreview(o){this.emitted=o,this.value=o,this.coInput.emit(o)}commit(o){if(a(this.hsv)!==o){const e=n(o);e&&(this.hsv=e)}this.emitted=o,this.committed=o,this.value=o,this.coChange.emit(o)}get strings(){return p[h(this.locale)]}get parsedPresets(){if(Array.isArray(this.presets))return this.presets.map(u);if("string"==typeof this.presets&&this.presets.trim())try{const o=JSON.parse(this.presets);if(Array.isArray(o))return o.map((o=>u(o)))}catch(o){}return b}get presetGroups(){const o=this.parsedPresets,e=function(o){const e=[],r=[];for(const i of o){if(i.synthesizedKey)return null;if(v.has(i.key))e.push(i);else{if(!m.has(i.key))return null;r.push(i)}}return e.length&&r.length?{neutrals:e,brand:r}:null}(o);return e?[{label:this.strings.groupNeutrals,items:e.neutrals,from:0},{label:this.strings.groupBrand,items:e.brand,from:e.neutrals.length}]:[{label:void 0,items:o,from:0}]}get flatPresets(){return _(this.presetGroups)}restoreTriggerFocus(){var o;const e=document.activeElement;(e===this.el||this.el.contains(e))&&(null===(o=this.triggerEl)||void 0===o||o.focus())}handleSwatchClick(o){this.disabled||(this.commit(o),this.isOpen=!1,this.restoreTriggerFocus())}focusAxis(o){this.areaAxis=o;const e="s"===o?this.satEl:this.valEl;e&&(e.removeAttribute("aria-hidden"),e.focus())}optionEls(){var o,e;return Array.from(null!==(e=null===(o=this.gridEl)||void 0===o?void 0:o.querySelectorAll('[role="option"]'))&&void 0!==e?e:[])}verticalNeighbor(o,e,r){const i=o.findIndex((o=>e>=o.from&&e<o.from+o.items.length));if(i<0)return e;const t=o[i],a=e-t.from,s=a%6,c=Math.ceil(t.items.length/6),n=Math.floor(a/6)+r;if(n>=0&&n<c)return t.from+Math.min(6*n+s,t.items.length-1);const l=o[i+r];if(!l)return e;const h=Math.ceil(l.items.length/6)||1;return l.from+Math.min(6*(1===r?0:h-1)+s,l.items.length-1)}renderArea(){const{h:o,s:e,v:i}=this.hsv,t="s"===this.areaAxis;return r("div",{class:"co-color-picker__area",role:"group","aria-label":this.strings.area,ref:o=>this.areaEl=o,style:{"--co-color-picker-hue":`${o}`},onPointerDown:this.handleAreaPointerDown,onPointerMove:this.handleAreaPointerMove,onPointerUp:this.handleAreaPointerUp,onPointerCancel:this.handleAreaPointerCancel},r("span",{class:"co-color-picker__area-thumb",role:"presentation",style:{left:`${e}%`,top:100-i+"%",background:this.value}}),r("input",{type:"range",min:"0",max:"100",step:"1",class:"co-color-picker__channel","data-channel":"s",value:Math.round(e),ref:o=>this.satEl=o,tabIndex:t?0:-1,"aria-hidden":t?void 0:"true","aria-label":this.strings.saturation,"aria-roledescription":this.strings.area2D,"aria-valuetext":d(this.strings.satValue,{n:Math.round(e)}),"aria-orientation":"horizontal",disabled:this.disabled,onFocus:()=>this.areaAxis="s",onInput:o=>this.previewHsv({s:+o.target.value}),onChange:()=>this.commit(a(this.hsv)),onKeyDown:this.handleAreaKeyDown}),r("input",{type:"range",min:"0",max:"100",step:"1",class:"co-color-picker__channel","data-channel":"v",value:Math.round(i),ref:o=>this.valEl=o,tabIndex:t?-1:0,"aria-hidden":t?"true":void 0,"aria-label":this.strings.brightness,"aria-roledescription":this.strings.area2D,"aria-valuetext":d(this.strings.briValue,{n:Math.round(i)}),"aria-orientation":"vertical",disabled:this.disabled,onFocus:()=>this.areaAxis="v",onInput:o=>this.previewHsv({v:+o.target.value}),onChange:()=>this.commit(a(this.hsv)),onKeyDown:this.handleAreaKeyDown}))}renderHue(){return r("input",{type:"range",min:"0",max:"360",step:"1",class:"co-color-picker__hue-input",value:Math.round(this.hsv.h),"aria-label":this.strings.hue,"aria-valuetext":d(this.strings.hueValue,{n:Math.round(this.hsv.h)}),disabled:this.disabled,onInput:o=>this.previewHsv({h:+o.target.value}),onChange:()=>this.commit(a(this.hsv)),onKeyDown:this.handleHueKeyDown})}renderSwatches(){return r("div",{class:"co-color-picker__grid",role:"listbox","aria-label":this.strings.swatches,ref:o=>this.gridEl=o,onKeyDown:this.handleGridKeyDown},this.presetGroups.map((o=>r("div",{class:"co-color-picker__grid-group",key:o.from,role:o.label?"group":"presentation","aria-label":o.label},o.items.map(((e,i)=>{const t=o.from+i,a=e.value.toUpperCase()===(this.value||"").toUpperCase();return r("div",{key:e.value,role:"option","aria-selected":a?"true":"false","aria-label":e.name,title:e.name,tabIndex:t===this.focusedIndex?0:-1,class:{"co-color-picker__grid-item":!0,"co-color-picker__grid-item--selected":a,"co-color-picker__grid-item--light":l(e.value)},style:{background:e.value},onFocus:()=>this.focusedIndex=t,onClick:()=>this.handleSwatchClick(e.value)},a&&r("co-icon",{name:"check",size:16,weight:"bold",class:"co-color-picker__grid-check"}))}))))))}get statusIcon(){return{error:"warning-circle",success:"check-circle",warning:"warning"}[this.status]||null}escapeHex(o){return(o||"").replace(/[^0-9a-f]/gi,"").substring(0,6).toUpperCase()}expandHex(o){const e=o.replace("#","");return`#${(3===e.length?e[0]+e[0]+e[1]+e[1]+e[2]+e[2]:e).toUpperCase()}`}resetHexDraft(){this.hexEditing=!1,this.syncHexDraft(this.value)}syncHexDraft(o){this.hexEditing||o&&!s(o)||(this.hexDraft=this.escapeHex(o))}finishHexEdit(){const o=this.hexEditing;if(this.hexEditing=!1,!this.disabled){if(o&&s(this.hexDraft)){const o=this.expandHex(this.hexDraft);return this.commit(o),void this.syncHexDraft(o)}this.revertToCommitted()}}revertToCommitted(){const o=this.committed;this.syncHexDraft(o),o||(this.hsv=x),(this.value||"").toUpperCase()!==(o||"").toUpperCase()&&(this.value=o,this.coInput.emit(o))}get hasEyeDropper(){return"undefined"!=typeof window&&"EyeDropper"in window}renderHexRow(){const o=!!this.value;return r("div",{class:"co-color-picker__hex-row"},r("span",{class:"co-color-picker__hex-prefix"},"#"),r("input",{type:"text",class:"co-color-picker__hex-input",value:this.hexDraft,spellcheck:!1,autocomplete:"off",maxLength:6,"aria-label":this.strings.hexField,disabled:this.disabled,onInput:this.handleHexInput,onBlur:this.handleHexBlur,onKeyDown:this.handleHexKeyDown,onPaste:this.handleHexPaste}),this.hasEyeDropper&&r("button",{type:"button",class:"co-color-picker__eyedropper",title:this.strings.eyedropper,"aria-label":this.strings.eyedropper,disabled:this.disabled,onClick:this.handleEyeDropper},r("co-icon",{name:"eyedropper",size:16})),r("button",{type:"button",class:"co-color-picker__copy-btn "+(this.copied?"co-color-picker__copy-btn--copied":""),title:this.strings.copy,"aria-label":this.strings.copy,disabled:this.disabled||!o,onClick:()=>this.handleCopy()},r("co-icon",{name:this.copied?"check":"copy",size:16})))}async handleCopy(){if(this.value)try{await navigator.clipboard.writeText(this.value),this.copied=!0,setTimeout((()=>{this.copied=!1}),1500)}catch(o){}}render(){const o=!!this.value;return r("div",{key:"5e4239ff9ef0dc3f15004898d2d891f8d231e95d",class:`co-color-picker co-color-picker--${this.size} ${"default"!==this.status?`co-color-picker--${this.status}`:""} ${this.isOpen?"co-color-picker--open":""} ${this.disabled?"co-color-picker--disabled":""}`},this.label&&r("label",{key:"003a893c3c840cd03d87c4291795499ac80b8b73",class:"co-color-picker__label"},this.label,r(t,{key:"4c14eaf668b0677b91b23a00f001ffaa4c21f5c5",required:this.required})),r("co-popover",{key:"f4a489f77c2d629ea1d9b69786cfad0f95d5422b",open:this.isOpen,placement:"bottom-start",offset:4,onCoOpen:this.handlePopoverOpen,onCoClose:this.handlePopoverClose},r("div",{key:"229e0095d6b6a723e77cf0d001d780cf51116851",slot:"trigger",class:"co-color-picker__trigger",role:"combobox","aria-expanded":this.isOpen?"true":"false","aria-haspopup":"dialog","aria-controls":this.isOpen?y.PANEL_ID:void 0,"aria-label":this.label||void 0,"aria-disabled":this.disabled?"true":void 0,tabIndex:this.disabled?-1:0,ref:o=>this.triggerEl=o,onKeyDown:this.handleTriggerKeyDown},r("span",{key:"9267f104b7f0542653038ef381fb81a7f7f0188e",class:"co-color-picker__swatch",style:{background:o?this.value:"transparent"}}),r("span",{key:"64efb900a60576022b3f487db56380973d2934c9",class:"co-color-picker__value "+(o?"":"co-color-picker__value--empty")},o?this.value:this.placeholder)),this.isOpen&&r("div",{key:"22abcb6c79531f41a6655fc48320e4c108a33049",class:"co-color-picker__panel",id:y.PANEL_ID,role:"dialog","aria-label":this.label||this.placeholder},this.renderArea(),this.renderHue(),this.renderSwatches(),this.renderHexRow())),this.helperText&&r("div",{key:"901b7094f7da8c09ea25cad568eda8d5fcaf2d6e",class:"co-color-picker__helper"},this.statusIcon&&r("co-icon",{key:"fb341f791466f133f6a6c4bd04a8dd71c519c7c0",name:this.statusIcon,size:14,weight:"fill",class:"co-color-picker__helper-icon"}),r("span",{key:"0ecfc7d46a07c741d42b59660979559fb78117df",class:"co-color-picker__helper-text"},this.helperText)))}get el(){return i(this)}static get watchers(){return{value:[{syncFromValue:0}]}}};y.PANEL_ID="co-color-picker-panel",y.AREA_KEYS={ArrowRight:{axis:"s",dir:1},ArrowLeft:{axis:"s",dir:-1},ArrowUp:{axis:"v",dir:1},ArrowDown:{axis:"v",dir:-1}},y.style=":host{display:block;font-family:var(--co-font-family-primary);font-size:var(--co-font-size-14);letter-spacing:var(--co-font-letter-spacing-body);line-height:1}.co-color-picker{display:flex;flex-direction:column;gap:var(--co-spacing-sm2)}.co-color-picker--disabled{opacity:0.5;pointer-events:none}.co-color-picker__label{font-size:var(--co-font-size-14);font-weight:400;color:var(--co-semantic-text-secondary);padding:0 var(--co-spacing-xs)}.co-field-required{margin-left:2px;color:var(--co-color-status-error)}.co-field-required__caption{margin-left:4px;color:var(--co-semantic-text-muted);font-size:var(--co-font-size-12);font-weight:400}.co-field-required__caption::before{content:var(--co-field-required-text, ' (required)')}.co-color-picker co-popover{display:block;width:100%}.co-color-picker__trigger{display:flex;align-items:center;gap:var(--co-spacing-sm2);padding:var(--co-spacing-sm2) var(--co-spacing-md);background:var(--co-semantic-surface-page);border:1px solid var(--co-semantic-border-field);border-radius:var(--co-border-radius-xs);min-height:40px;box-sizing:border-box;cursor:pointer;transition:border-color var(--co-motion-duration-fast) var(--co-motion-ease-out), box-shadow var(--co-motion-duration-fast) var(--co-motion-ease-out)}.co-color-picker--s .co-color-picker__trigger{min-height:28px;padding:var(--co-spacing-xxs) var(--co-spacing-sm);font-size:var(--co-font-size-12)}.co-color-picker--sm .co-color-picker__trigger{min-height:32px;padding:var(--co-spacing-xs) var(--co-spacing-sm);font-size:var(--co-font-size-14)}.co-color-picker--lg .co-color-picker__trigger{min-height:48px;padding:var(--co-spacing-sm) var(--co-spacing-lg);font-size:var(--co-font-size-16)}.co-color-picker--s .co-color-picker__swatch,.co-color-picker--sm .co-color-picker__swatch{width:18px;height:18px}.co-color-picker__trigger:hover{border-color:var(--co-semantic-border-default)}.co-color-picker--open .co-color-picker__trigger{border-color:var(--co-semantic-border-focus);box-shadow:0 0 0 2px color-mix(in srgb, var(--co-semantic-border-focus) 15%, transparent)}.co-color-picker__trigger:focus-visible{outline:none;border-color:var(--co-semantic-border-focus);box-shadow:0 0 0 2px color-mix(in srgb, var(--co-semantic-border-focus) 15%, transparent)}.co-color-picker--error .co-color-picker__trigger{border-color:var(--co-color-status-error)}.co-color-picker__swatch{width:22px;height:22px;box-sizing:border-box;border-radius:var(--co-border-radius-full);border:1px solid var(--co-semantic-border-subtle);flex-shrink:0}.co-color-picker__value{flex:1;font-size:inherit;font-family:inherit;color:var(--co-semantic-text-default);font-weight:500;text-transform:uppercase}.co-color-picker__value--empty{color:var(--co-semantic-text-muted);font-weight:400}.co-color-picker__panel{padding:var(--co-spacing-md);display:flex;flex-direction:column;gap:var(--co-spacing-md)}.co-color-picker__area{position:relative;height:132px;border-radius:var(--co-border-radius-xxs);cursor:crosshair;touch-action:none;background:linear-gradient(to top, black, transparent), linear-gradient(to right, white, transparent), hsl(var(--co-color-picker-hue, 0) 100% 50%)}.co-color-picker__area-thumb{position:absolute;width:14px;height:14px;margin:-7px 0 0 -7px;border-radius:var(--co-border-radius-full);border:2px solid var(--co-semantic-surface-page);box-shadow:0 0 0 1px var(--co-semantic-border-default);box-sizing:border-box;pointer-events:none}.co-color-picker__channel{position:absolute;inset:0;opacity:0;pointer-events:none;margin:0}.co-color-picker__area:focus-within{outline:2px solid var(--co-semantic-border-focus);outline-offset:2px}.co-color-picker__hue-input{width:100%;height:12px;margin:0;appearance:none;-webkit-appearance:none;border-radius:var(--co-border-radius-full);background:linear-gradient(to right, hsl(0 100% 50%), hsl(60 100% 50%), hsl(120 100% 50%), hsl(180 100% 50%), hsl(240 100% 50%), hsl(300 100% 50%), hsl(360 100% 50%));cursor:pointer}.co-color-picker__hue-input::-webkit-slider-thumb{appearance:none;-webkit-appearance:none;width:16px;height:16px;border-radius:var(--co-border-radius-full);background:var(--co-semantic-surface-page);box-shadow:0 0 0 1px var(--co-semantic-border-default);cursor:grab}.co-color-picker__hue-input::-moz-range-thumb{width:16px;height:16px;border:none;border-radius:var(--co-border-radius-full);background:var(--co-semantic-surface-page);box-shadow:0 0 0 1px var(--co-semantic-border-default)}.co-color-picker__hue-input:focus-visible{outline:2px solid var(--co-semantic-border-focus);outline-offset:2px}.co-color-picker__grid{display:flex;flex-direction:column;gap:var(--co-spacing-md)}.co-color-picker__grid-group{display:grid;grid-template-columns:repeat(6, 32px);gap:var(--co-spacing-sm2)}.co-color-picker__grid-item{width:32px;height:32px;display:flex;align-items:center;justify-content:center;border-radius:var(--co-border-radius-xxs);border:2px solid transparent;cursor:pointer;box-sizing:border-box;transition:transform var(--co-motion-duration-fast) var(--co-motion-ease-out), border-color var(--co-motion-duration-fast) var(--co-motion-ease-out)}.co-color-picker__grid-item:hover{transform:scale(1.1)}.co-color-picker__grid-item--selected{border-color:var(--co-semantic-border-focus);box-shadow:0 0 0 2px color-mix(in srgb, var(--co-semantic-border-focus) 25%, transparent)}.co-color-picker__grid-item--light{box-shadow:inset 0 0 0 1px var(--co-semantic-border-default)}.co-color-picker__grid-item--light.co-color-picker__grid-item--selected{box-shadow:inset 0 0 0 1px var(--co-semantic-border-default), 0 0 0 2px color-mix(in srgb, var(--co-semantic-border-focus) 25%, transparent)}.co-color-picker__grid-item:focus-visible{outline:none;box-shadow:0 0 0 2px var(--co-semantic-surface-page), 0 0 0 4px var(--co-semantic-border-focus)}.co-color-picker__grid-item--light:focus-visible{box-shadow:inset 0 0 0 1px var(--co-semantic-border-default), 0 0 0 2px var(--co-semantic-surface-page), 0 0 0 4px var(--co-semantic-border-focus)}.co-color-picker__grid-check{color:var(--co-semantic-surface-page)}.co-color-picker__grid-item--light .co-color-picker__grid-check{color:var(--co-semantic-text-default)}.co-color-picker__hex-row{display:flex;align-items:center;gap:var(--co-spacing-sm2);padding:var(--co-spacing-xs) var(--co-spacing-sm);background:var(--co-semantic-surface-secondary);border:1px solid var(--co-semantic-border-subtle);border-radius:var(--co-border-radius-xxs)}.co-color-picker__hex-prefix{color:var(--co-semantic-text-muted);font-size:var(--co-font-size-14);font-weight:500}.co-color-picker__hex-row:has(>.co-color-picker__hex-input:focus){border-color:var(--co-semantic-border-focus);box-shadow:0 0 0 2px var(--co-semantic-border-focus-ring)}.co-color-picker__hex-input{flex:1;min-width:0;box-sizing:border-box;border:none;background:transparent;padding:0;font-size:var(--co-font-size-14);font-family:var(--co-font-family-mono, monospace);color:var(--co-semantic-text-default);text-transform:uppercase}.co-color-picker__hex-input:focus,.co-color-picker__hex-input:focus-visible{outline:none}.co-color-picker__hex-input:disabled{color:var(--co-semantic-text-muted);cursor:not-allowed;opacity:1;-webkit-text-fill-color:var(--co-semantic-text-muted)}.co-color-picker__eyedropper{display:flex;align-items:center;justify-content:center;padding:var(--co-spacing-xs);border:none;background:transparent;cursor:pointer;color:var(--co-semantic-text-muted);border-radius:var(--co-border-radius-xxs);transition:color var(--co-motion-duration-fast) var(--co-motion-ease-out), background var(--co-motion-duration-fast) var(--co-motion-ease-out)}.co-color-picker__eyedropper:hover:not(:disabled){color:var(--co-semantic-text-default);background:var(--co-semantic-surface-hover)}.co-color-picker__eyedropper:focus-visible{outline:none;box-shadow:0 0 0 2px var(--co-semantic-border-focus-ring)}.co-color-picker__eyedropper:disabled{cursor:not-allowed;opacity:0.5}.co-color-picker__copy-btn{display:flex;align-items:center;justify-content:center;padding:var(--co-spacing-xs);border:none;background:transparent;cursor:pointer;color:var(--co-semantic-text-muted);border-radius:var(--co-border-radius-xxs);transition:color var(--co-motion-duration-fast) var(--co-motion-ease-out), background var(--co-motion-duration-fast) var(--co-motion-ease-out)}.co-color-picker__copy-btn:hover:not(:disabled){color:var(--co-semantic-text-default);background:var(--co-semantic-surface-hover)}.co-color-picker__copy-btn:focus-visible{outline:none;box-shadow:0 0 0 2px var(--co-semantic-border-focus-ring)}.co-color-picker__copy-btn:disabled{cursor:not-allowed;opacity:0.5}.co-color-picker__copy-btn--copied{color:var(--co-color-status-success)}.co-color-picker__helper{display:flex;align-items:center;gap:var(--co-spacing-xs);font-size:var(--co-font-size-14);color:var(--co-semantic-text-muted);padding:0 var(--co-spacing-xs)}.co-color-picker__helper-icon{flex-shrink:0;display:flex;align-items:center}.co-color-picker--error .co-color-picker__helper{color:var(--co-semantic-status-error)}:host([layout='horizontal']) .co-color-picker{display:grid;grid-template-columns:var(--co-field-label-width, max-content) 1fr;align-items:start;column-gap:var(--co-spacing-md);row-gap:var(--co-spacing-sm2)}:host([layout='horizontal']) .co-color-picker__label{grid-column:1;grid-row:1;padding-top:var(--co-spacing-sm2);min-width:0}:host([layout='horizontal']) .co-color-picker__label{white-space:normal}:host([layout='horizontal']) .co-color-picker>:not(.co-color-picker__label){grid-column:2;min-width:0}";export{y as co_color_picker}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as o,c as i,h as e,a}from"./p-DH5lfRNj.js";const c=class{constructor(e){o(this,e),this.coToggle=i(this,"coToggle",3),this.open=!0,this.heading="",this.subheading="",this.disabled=!1,this.hasSubheadingSlot=!1,this.handleToggle=()=>{this.disabled||(this.open=!this.open,this.coToggle.emit(this.open))}}componentWillLoad(){this.hasSubheadingSlot=!!this.el.querySelector('[slot="subheading"]')}componentWillRender(){this.hasSubheadingSlot=!!this.el.querySelector('[slot="subheading"]')}get showSubheading(){return!(!this.subheading||!this.subheading.trim())||this.hasSubheadingSlot}render(){return e("div",{key:"96b5b0f97642972b0505d038125f9e225ee1ab2d",class:{"co-accordion":!0,"co-accordion--open":this.open,"co-accordion--disabled":this.disabled},part:"accordion"},e("div",{key:"91f8d47d2f342a48b7d88fd6385fe532f969a636",class:"co-accordion__header",part:"header"},e("span",{key:"b55915f1078d0b7f46ff08b7f5d78383050a8df1",class:"co-accordion__heading-group"},e("span",{key:"99a08344b195983609dfd5d4054af8f96547ae1f",class:"co-accordion__heading",part:"heading"},e("slot",{key:"330134f4fdbb831253bcec63bfd43968171e7c44",name:"header"},this.heading)),this.showSubheading&&e("span",{key:"5b8fcb450d266843ff722cf9ec97d6e600cff12d",class:"co-accordion__subheading",part:"subheading"},e("slot",{key:"51a98c7f68bd7e4d6d0705c21feb288389af5d4e",name:"subheading"},this.subheading))),e("button",{key:"8eea6b6fdfc04dfaf5561527dcc8d40be1069da4",class:"co-accordion__caret",type:"button","aria-expanded":this.open?"true":"false","aria-label":this.heading||"Toggle section",disabled:this.disabled,onClick:this.handleToggle,part:"caret"},e("co-icon",{key:"a0343d006eafb7cb895584c05427d590e9c820a7",name:"caret-up",size:20}))),e("div",{key:"24edd828c5e12ebfcf5dce6eb99d0755e04ebe68",class:"co-accordion__body",part:"body"},e("div",{key:"29e4e7514802a8f7269e135d4e4112def33663fa",class:"co-accordion__body-inner",part:"body-inner"},e("slot",{key:"38e1e269578c9e949c8434c839b291e60612e538"}))))}get el(){return a(this)}};c.style=":host{display:block}.co-accordion{display:flex;flex-direction:column;width:100%}.co-accordion__header{display:flex;align-items:center;justify-content:space-between;gap:var(--co-spacing-sm, 6px);width:100%;font-family:var(--co-font-family-primary);color:var(--co-semantic-text-default);text-align:left}.co-accordion__heading-group{flex:1;min-width:0;display:flex;flex-direction:column;gap:var(--co-spacing-xxs, 2px)}.co-accordion__heading{font-size:var(--co-font-size-24);font-weight:500;line-height:1.25;letter-spacing:-0.03em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.co-accordion__subheading{font-size:var(--co-font-size-14);font-weight:400;line-height:1.3;letter-spacing:normal;color:var(--co-semantic-text-secondary);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.co-accordion__caret{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;padding:0;border:none;background:transparent;border-radius:var(--co-border-radius-full, 9999px);color:var(--co-semantic-text-default);cursor:pointer;transition:transform var(--co-motion-duration-base) var(--co-motion-ease-out), background-color var(--co-motion-duration-fast) var(--co-motion-ease-out);transform:rotate(180deg);}.co-accordion__caret:hover:not(:disabled){background:var(--co-color-opacity-negro-8, rgba(31, 28, 27, 0.08))}.co-accordion--open .co-accordion__caret{transform:rotate(0deg);}.co-accordion__body{display:grid;grid-template-rows:0fr;transition:grid-template-rows var(--co-motion-duration-slow) var(--co-motion-ease-out)}.co-accordion__body-inner{min-height:0;overflow:hidden;padding-top:var(--co-spacing-md);transition:padding-top var(--co-motion-duration-slow) var(--co-motion-ease-out)}.co-accordion:not(.co-accordion--open) .co-accordion__body-inner{padding-top:0}.co-accordion--open .co-accordion__body{grid-template-rows:1fr}.co-accordion:not(.co-accordion--open) .co-accordion__body-inner{visibility:hidden;transition:padding-top var(--co-motion-duration-slow) var(--co-motion-ease-out), visibility 0s linear var(--co-motion-duration-slow)}.co-accordion--open .co-accordion__body-inner{visibility:visible;transition:padding-top var(--co-motion-duration-slow) var(--co-motion-ease-out), visibility 0s linear 0s}.co-accordion__caret:focus-visible{outline:2px solid var(--co-color-primary-azul, #2563eb);outline-offset:2px}.co-accordion--disabled .co-accordion__header{opacity:0.5}.co-accordion--disabled .co-accordion__caret{cursor:not-allowed}";export{c as co_accordion}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as a,h as t}from"./p-DH5lfRNj.js";import{i as r}from"./p-BRbgGqLw.js";const i={xl:80,lg:64,md:56,sm:48,xs:32,xxs:24},o={xl:32,lg:28,md:24,sm:20,xs:16,xxs:12},e={xl:"var(--co-font-size-26)",lg:"var(--co-font-size-22)",md:"var(--co-font-size-18)",sm:"var(--co-font-size-16)",xs:"var(--co-font-size-12)",xxs:"var(--co-font-size-10)"},s=class{constructor(t){a(this,t),this.type="text",this.size="md",this.icon="user",this.iconWeight="regular",this.shape="circle",this.imgFailed=!1,this.handleImgError=()=>{this.imgFailed=!0}}render(){var a,s,c,n,l,v,L;const h=null!==(a=i[this.size])&&void 0!==a?a:56,d=null!==(s=o[this.size])&&void 0!==s?s:24,p=null!==(c=e[this.size])&&void 0!==c?c:"var(--co-font-size-18)",m="image"===this.type&&this.src&&!this.imgFailed,u="icon"===this.type||"image"===this.type&&!m&&!this.text,g="text"===this.type?this.text:"image"===this.type&&null!==(l=null!==(n=this.alt)&&void 0!==n?n:this.text)&&void 0!==l?l:this.icon,f=t("div",{class:{"co-avatar":!0,[`co-avatar--${this.size}`]:!0,[`co-avatar--${this.type}`]:!0,"co-avatar--square":"square"===this.shape,"co-avatar--light":!!this.color&&r(this.color)},style:Object.assign(Object.assign({width:`var(--co-avatar-size, ${h}px)`,height:`var(--co-avatar-size, ${h}px)`,fontSize:p},this.color?{background:this.color}:{}),this.ringColor?{"--co-avatar-border-color":this.ringColor,"--co-avatar-border-width":"2px"}:{}),part:"avatar",role:"img","aria-label":g},m?t("img",{class:"co-avatar__img",src:this.src,alt:null!==(L=null!==(v=this.alt)&&void 0!==v?v:this.text)&&void 0!==L?L:"",onError:this.handleImgError}):u?t("co-icon",{name:this.icon,weight:this.iconWeight,size:d}):t("span",{class:"co-avatar__text"},this.text));return this.name?t("co-tooltip",{content:this.name},f):f}};s.style=":host{display:inline-flex;--co-avatar-squircle:url(\"data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'><path d='M100 50L99.94 68.06L99.75 73.81L99.44 77.94L99.01 81.26L98.44 84.05L97.74 86.46L96.91 88.57L95.94 90.43L94.81 92.07L93.53 93.53L92.07 94.81L90.43 95.94L88.57 96.91L86.46 97.74L84.05 98.44L81.26 99.01L77.94 99.44L73.81 99.75L68.06 99.94L50 100L31.94 99.94L26.19 99.75L22.06 99.44L18.74 99.01L15.95 98.44L13.54 97.74L11.43 96.91L9.57 95.94L7.93 94.81L6.47 93.53L5.19 92.07L4.06 90.43L3.09 88.57L2.26 86.46L1.56 84.05L0.99 81.26L0.56 77.94L0.25 73.81L0.06 68.06L0 50L0.06 31.94L0.25 26.19L0.56 22.06L0.99 18.74L1.56 15.95L2.26 13.54L3.09 11.43L4.06 9.57L5.19 7.93L6.47 6.47L7.93 5.19L9.57 4.06L11.43 3.09L13.54 2.26L15.95 1.56L18.74 0.99L22.06 0.56L26.19 0.25L31.94 0.06L50 0L68.06 0.06L73.81 0.25L77.94 0.56L81.26 0.99L84.05 1.56L86.46 2.26L88.57 3.09L90.43 4.06L92.07 5.19L93.53 6.47L94.81 7.93L95.94 9.57L96.91 11.43L97.74 13.54L98.44 15.95L99.01 18.74L99.44 22.06L99.75 26.19L99.94 31.94Z' fill='%23fff'/></svg>\")}.co-avatar{position:relative;display:inline-flex;align-items:center;justify-content:center;border-radius:var(--co-border-radius-full);background:var(--co-semantic-surface-primary);color:var(--co-semantic-on-primary);font-family:var(--co-font-family-primary);font-weight:600;line-height:1;letter-spacing:var(--co-font-letter-spacing-body);overflow:hidden;flex-shrink:0;user-select:none;-webkit-font-smoothing:antialiased}.co-avatar::after{content:'';position:absolute;inset:0;pointer-events:none;border-radius:inherit;box-shadow:inset 0 0 0 var(--co-avatar-border-width, 1px) var(--co-avatar-border-color, transparent)}.co-avatar__text{text-transform:uppercase}.co-avatar__img{width:100%;height:100%;object-fit:cover;display:block}.co-avatar--square{border-radius:0;-webkit-mask:var(--co-avatar-squircle) center / 100% 100% no-repeat;mask:var(--co-avatar-squircle) center / 100% 100% no-repeat}.co-avatar--square::after{--co-avatar-bw:var(--co-avatar-border-width, 1px);box-shadow:none;background:var(--co-avatar-border-color, transparent);-webkit-mask:var(--co-avatar-squircle) center / 100% 100% no-repeat, var(--co-avatar-squircle) center / calc(100% - 2 * var(--co-avatar-bw)) calc(100% - 2 * var(--co-avatar-bw)) no-repeat;-webkit-mask-composite:xor;mask:var(--co-avatar-squircle) center / 100% 100% no-repeat, var(--co-avatar-squircle) center / calc(100% - 2 * var(--co-avatar-bw)) calc(100% - 2 * var(--co-avatar-bw)) no-repeat;mask-composite:exclude}.co-avatar--light{color:rgba(0, 0, 0, 0.87)}co-tooltip{display:inline-flex;align-items:center;line-height:0}";export{s as co_avatar}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,c as i,h as a}from"./p-DH5lfRNj.js";function s(t){if(!Number.isFinite(t)||t<0)return"--:--";const i=Math.floor(t);return`${Math.floor(i/60)}:${(i%60).toString().padStart(2,"0")}`}function e(t,i){const a=t.length;if(!a||i<=0)return[];const s=Math.max(1,Math.floor(a/i)),e=[];for(let o=0;o<i;o++){let i=0;const r=o*s;for(let e=r;e<r+s&&e<a;e++){const a=Math.abs(t[e]);a>i&&(i=a)}e.push(.12+.88*i)}return e}function o(t){if(t<=0)return[];const i=[];for(let a=0;a<t;a++){const s=.6*Math.sin(a/Math.max(1,t)*Math.PI)+.3,e=.75+.25*Math.abs(Math.sin(1.7*a));i.push(.12+s*e*.88)}return i}const r=class{constructor(a){t(this,a),this.coPlay=i(this,"coPlay",7),this.coPause=i(this,"coPause",7),this.coEnded=i(this,"coEnded",7),this.coError=i(this,"coError",7),this.coTimeUpdate=i(this,"coTimeUpdate",3),this.compact=!1,this.bars=64,this.barDensity=3,this.preload="metadata",this.downloadFilename="audio",this.noDownload=!1,this.isPlaying=!1,this.isLoading=!1,this.hasError=!1,this.currentTime=0,this.duration=NaN,this.peaks=[],this.containerWidth=0,this.playbackRate=1,this.rawChannelData=null,this.decodedDuration=NaN,this.loadToken=0,this.onMeta=()=>{this.syncDuration(),this.applyPendingSeek()},this.pendingSeek=null,this.onCanPlay=()=>{this.isLoading=!1,this.applyPendingSeek()},this.onWaiting=()=>{this.isLoading=!0},this.onTime=()=>{var t;this.currentTime=(null===(t=this.audio)||void 0===t?void 0:t.currentTime)||0,this.coTimeUpdate.emit({currentTime:this.currentTime,duration:this.knownDuration})},this.onEnded=()=>{this.isPlaying=!1,this.currentTime=0,this.coEnded.emit()},this.onErr=t=>{this.isLoading=!1,this.hasError=!0,this.coError.emit(t)},this.toggle=()=>{this.audio&&!this.hasError&&(this.isPlaying?(this.audio.pause(),this.isPlaying=!1,this.coPause.emit()):this.audio.play().then((()=>{this.isPlaying=!0,this.coPlay.emit()})).catch((()=>{})))},this.SPEEDS=[1,1.5,2,.5],this.cycleSpeed=()=>{const t=this.SPEEDS.indexOf(this.playbackRate);this.playbackRate=this.SPEEDS[(t+1)%this.SPEEDS.length],this.audio&&(this.audio.playbackRate=this.playbackRate)},this.seekAt=t=>{const i=this.knownDuration;if(!this.audio||!this.waveEl||!i)return;const a=function(t,i){return i.width?Math.max(0,Math.min(1,(t-i.left)/i.width)):0}(t,this.waveEl.getBoundingClientRect());this.audio.currentTime=a*i,this.currentTime=this.audio.currentTime},this.onWaveKey=t=>{if(" "===t.key||"Enter"===t.key)return t.preventDefault(),void this.toggle();if(!this.audio)return;const i=this.knownDuration,a=this.audio.currentTime;if("ArrowRight"===t.key)this.audio.currentTime=i?Math.min(i,a+5):a+5;else{if("ArrowLeft"!==t.key)return;this.audio.currentTime=Math.max(0,a-5)}this.currentTime=this.audio.currentTime}}get knownDuration(){return Number.isFinite(this.duration)&&this.duration>0?this.duration:0}get effectiveBars(){return this.containerWidth>0?Math.max(24,Math.floor(this.containerWidth/this.barDensity)):this.bars}componentWillLoad(){this.init()}componentDidLoad(){if("undefined"==typeof ResizeObserver||!this.waveEl)return;this.resizeObserver=new ResizeObserver((t=>{var i;for(const a of t){const t=(null===(i=a.contentRect)||void 0===i?void 0:i.width)||a.target.clientWidth||0;t>2&&Math.abs(t-this.containerWidth)>2&&(this.containerWidth=t,this.rebuildBars())}})),this.resizeObserver.observe(this.waveEl);const t=this.waveEl.clientWidth||0;t>2&&(this.containerWidth=t,this.rebuildBars())}disconnectedCallback(){var t;this.loadToken++,this.teardown(),null===(t=this.resizeObserver)||void 0===t||t.disconnect(),this.resizeObserver=void 0}onSrcChange(){this.init()}rebuildBars(){this.peaks=this.rawChannelData?e(this.rawChannelData,this.effectiveBars):o(this.effectiveBars)}init(){this.teardown();const t=++this.loadToken;if(this.rawChannelData=null,this.decodedDuration=NaN,this.peaks=o(this.effectiveBars),this.currentTime=0,this.duration=NaN,this.playbackRate=1,this.hasError=!1,!this.src)return;if(this.isLoading=!0,this.extractPeaks(this.src,t),"undefined"==typeof Audio)return;const i=new Audio;i.preload=this.preload,i.crossOrigin="anonymous",i.src=this.src,i.addEventListener("loadedmetadata",this.onMeta),i.addEventListener("timeupdate",this.onTime),i.addEventListener("ended",this.onEnded),i.addEventListener("error",this.onErr),i.addEventListener("canplay",this.onCanPlay),i.addEventListener("waiting",this.onWaiting),this.audio=i}teardown(){this.audio&&(this.audio.pause(),this.audio.removeEventListener("loadedmetadata",this.onMeta),this.audio.removeEventListener("timeupdate",this.onTime),this.audio.removeEventListener("ended",this.onEnded),this.audio.removeEventListener("error",this.onErr),this.audio.removeEventListener("canplay",this.onCanPlay),this.audio.removeEventListener("waiting",this.onWaiting),this.audio.src="",this.audio=void 0),this.isPlaying=!1}async extractPeaks(t,i){var a;let s;try{const a=window.OfflineAudioContext||window.webkitOfflineAudioContext,o=window.AudioContext||window.webkitAudioContext;if(!a&&!o||"undefined"==typeof fetch)return;s=a?new a(1,1,44100):new o;const r=await(await fetch(t)).arrayBuffer(),h=await s.decodeAudioData(r);if(i!==this.loadToken)return;this.rawChannelData=h.getChannelData(0),this.decodedDuration=h.duration,this.peaks=e(this.rawChannelData,this.effectiveBars)}catch(t){if(i!==this.loadToken)return;this.rawChannelData=null,this.decodedDuration=NaN,this.peaks=o(this.effectiveBars)}finally{try{await(null===(a=null==s?void 0:s.close)||void 0===a?void 0:a.call(s))}catch(t){}}i===this.loadToken&&this.syncDuration()}syncDuration(){var t,i;const a=(s=null!==(i=null===(t=this.audio)||void 0===t?void 0:t.duration)&&void 0!==i?i:NaN,e=this.decodedDuration,Number.isFinite(s)&&s>0?s:Number.isFinite(e)&&e>0?e:NaN);var s,e;Object.is(a,this.duration)||(this.duration=a)}applyPendingSeek(){if(null==this.pendingSeek||!this.audio)return;const t=this.pendingSeek;this.pendingSeek=null,this.audio.currentTime=t,this.currentTime=this.audio.currentTime,this.coTimeUpdate.emit({currentTime:this.currentTime,duration:this.knownDuration})}async seek(t){var i;if(!this.audio||!Number.isFinite(t))return;const a=this.knownDuration,s=a?Math.max(0,Math.min(a,t)):Math.max(0,t);this.audio.currentTime=s,Math.abs((null!==(i=this.audio.currentTime)&&void 0!==i?i:0)-s)>.05&&(this.pendingSeek=s),this.currentTime=s,this.coTimeUpdate.emit({currentTime:this.currentTime,duration:a})}async play(){if(this.audio&&!this.isPlaying&&!this.hasError)try{await this.audio.play(),this.isPlaying=!0,this.coPlay.emit()}catch(t){}}async download(){if(this.src&&"undefined"!=typeof fetch)try{const t=await(await fetch(this.src)).blob(),i=URL.createObjectURL(t),a=document.createElement("a");a.href=i,a.download=this.downloadFilename,document.body.appendChild(a),a.click(),a.remove(),URL.revokeObjectURL(i)}catch(t){}}render(){const t=Math.max(1,3*this.peaks.length),i=this.knownDuration,e=i?this.currentTime/i*100:0,o=i?Math.floor(i):void 0,r=(t,i,s=!1)=>a("rect",{key:"7cbeb92ef52ffc865077340d72bae11139ced551",x:3*i,y:20-40*t/2,width:1.8,height:Math.max(40*t,2),rx:.6,class:{"co-audio-player__bar":!0,"co-audio-player__bar--played":s}});return a("div",{key:"34078ed0540dc72c87644c3ae830b3a2ff43a99e",class:{"co-audio-player":!0,"co-audio-player--compact":this.compact,"co-audio-player--error":this.hasError,"co-audio-player--playing":this.isPlaying},part:"player"},a("button",{key:"7f692d951704a6e101f77512967d4b206f985e18",type:"button",class:"co-audio-player__play",part:"play","aria-label":this.hasError?"Audio no disponible":this.isPlaying?"Pausar":"Reproducir","aria-busy":this.isLoading?"true":"false",disabled:this.hasError||!this.src,onClick:this.toggle},a("co-icon",{key:"fdc0a0a0703189efe10bbc1b1182572d1120a347",name:this.hasError?"warning-circle":this.isPlaying?"pause":"play",weight:"fill",size:this.compact?12:14})),a("div",{key:"6842ce24993895bf70461a28eb837a0558d277d7",class:"co-audio-player__wave",part:"wave",role:"slider",tabindex:"0","aria-label":"Progreso de reproducción","aria-valuemin":0,"aria-valuemax":o,"aria-valuenow":Math.floor(this.currentTime),ref:t=>this.waveEl=t,onClick:t=>this.seekAt(t.clientX),onKeyDown:this.onWaveKey},a("svg",{key:"e75c5e1f78633194608758f43a47987bc28c2081",class:"co-audio-player__svg",viewBox:`0 0 ${t} 40`,preserveAspectRatio:"none","aria-hidden":"true"},this.peaks.map(((t,i)=>r(t,i))),a("clipPath",{key:"c4136dddad555e8b5ef09a81c38433cd2bf39d7c",id:"co-ap-clip"},a("rect",{key:"edb79083fbc7d225bd5668443fb6541fe77c8f9d",x:"0",y:"0",width:e/100*t,height:40})),a("g",{key:"c91b8b285f53b9dc4f6110f9cb73b7f3f892fad6","clip-path":"url(#co-ap-clip)"},this.peaks.map(((t,i)=>r(t,i,!0)))))),a("span",{key:"26af75ef91f36d432add06bb636c4d3194902b0a",class:"co-audio-player__time",part:"time"},s(this.currentTime)," / ",s(this.duration)),!this.compact&&a("button",{key:"a2093fc2d9c9a9c120e97e59f5e8b91467e1c20c",type:"button",class:"co-audio-player__speed",part:"speed","aria-label":`Velocidad de reproducción ${this.playbackRate}x`,onClick:this.cycleSpeed},this.playbackRate,"x"),!this.compact&&!this.noDownload&&a("button",{key:"327336de6ad09adac5f8cba6e048b58bbef0008e",type:"button",class:"co-audio-player__dl",part:"download","aria-label":"Descargar",onClick:()=>this.download()},a("co-icon",{key:"787738fea40ab74531c943f876e20acf6ceb54df",name:"download-simple",size:14})))}static get watchers(){return{src:[{onSrcChange:0}]}}};r.style=":host{display:block;font-family:var(--co-font-family-primary)}.co-audio-player{display:flex;align-items:center;gap:var(--co-spacing-md);padding:var(--co-spacing-sm) var(--co-spacing-md);border:1px solid var(--co-semantic-border-default);border-radius:var(--co-border-radius-xs);background:var(--co-semantic-surface-secondary);min-width:180px}.co-audio-player--compact{gap:var(--co-spacing-sm2);padding:var(--co-spacing-sm2) var(--co-spacing-sm);min-width:140px}.co-audio-player__play{flex:0 0 auto;width:28px;height:28px;border:none;border-radius:50%;cursor:pointer;background:var(--co-semantic-surface-primary);color:var(--co-semantic-text-inverse);display:inline-flex;align-items:center;justify-content:center}.co-audio-player--compact .co-audio-player__play{width:24px;height:24px}.co-audio-player__play:disabled{opacity:.5;cursor:not-allowed}.co-audio-player__play:focus-visible{outline:2px solid var(--co-semantic-border-focus);outline-offset:2px}.co-audio-player__wave{flex:1;height:40px;min-width:0;cursor:pointer;display:flex;align-items:center}.co-audio-player__wave:focus-visible{outline:2px solid var(--co-semantic-border-focus);outline-offset:2px;border-radius:var(--co-border-radius-xxs)}.co-audio-player__svg{width:100%;height:100%;display:block}.co-audio-player__bar{fill:var(--co-semantic-border-field);transition:fill var(--co-motion-duration-fast)}.co-audio-player__wave:hover .co-audio-player__bar{fill:var(--co-semantic-text-muted)}.co-audio-player__bar--played{fill:var(--co-semantic-surface-primary)}.co-audio-player__time{flex:0 0 auto;font-size:var(--co-font-size-12);color:var(--co-semantic-text-muted);font-variant-numeric:tabular-nums;min-width:62px;text-align:right}.co-audio-player__speed{flex:0 0 auto;border:none;background:transparent;cursor:pointer;padding:2px 4px;color:var(--co-semantic-text-muted);font-family:var(--co-font-family-primary);font-size:var(--co-font-size-12);font-variant-numeric:tabular-nums;min-width:34px;text-align:center}.co-audio-player__speed:hover{color:var(--co-semantic-text-default)}.co-audio-player__speed:focus-visible{outline:2px solid var(--co-semantic-border-focus);outline-offset:2px;border-radius:var(--co-border-radius-xxs)}.co-audio-player__dl{flex:0 0 auto;border:none;background:transparent;cursor:pointer;padding:2px;color:var(--co-semantic-text-muted);display:inline-flex}.co-audio-player__dl:hover{color:var(--co-semantic-text-default)}.co-audio-player__dl:focus-visible{outline:2px solid var(--co-semantic-border-focus);outline-offset:2px}.co-audio-player--error .co-audio-player__wave{opacity:.5}.co-audio-player--error .co-audio-player__play{background:var(--co-color-status-error);color:var(--co-semantic-text-inverse);opacity:1}";export{r as co_audio_player}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,h as a}from"./p-DH5lfRNj.js";const c=class{constructor(a){e(this,a)}render(){return a("div",{key:"0f064f7e659103d8f679f23242492a5e9a869a88",class:"co-page-header",part:"page-header"},a("div",{key:"4ccd5682d2d6872a5fa771b2779a8f7e0ab8b6f7",class:"co-page-header__left"},this.icon&&a("span",{key:"10bc9aa126f8b9932b1e4247d7c3c3c04d89c425",class:"co-page-header__icon"},a("co-icon",{key:"42f2cda7ec8ee4e0e4a51069606492647d13f690",name:this.icon,size:24})),a("span",{key:"368633ff1b213286d5f6bdf5716e3acb1cbe2f71",class:"co-page-header__title"},a("slot",{key:"c74f2dcde7cfc0c0384f6a10a9f069a9ff94f78d"},this.heading))),a("div",{key:"6666c103a2e6e826837091658ce1e4e4b1704215",class:"co-page-header__actions"},a("slot",{key:"7df47ea333491b960bc1faff7fd0b6431aba56e5",name:"actions"})))}};c.style=":host{display:block}.co-page-header{display:flex;align-items:center;justify-content:space-between;padding:var(--co-spacing-lg) var(--co-spacing-xl);font-family:var(--co-font-family-primary);border-bottom:1px solid var(--co-semantic-border-subtle);background:var(--co-semantic-surface-page);min-height:72px;box-sizing:border-box}.co-page-header__left{display:flex;align-items:center;gap:var(--co-spacing-md)}.co-page-header__icon{display:flex;color:var(--co-semantic-text-muted)}.co-page-header__title{font-size:var(--co-font-size-18);font-weight:600;color:var(--co-semantic-text-default)}.co-page-header__actions{display:flex;align-items:center;gap:var(--co-spacing-md)}.co-page-header__actions:empty{display:none}";export{c as co_page_header}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as a,h as o}from"./p-DH5lfRNj.js";const r=class{constructor(o){a(this,o),this.variant="default",this.size="md",this.rounded=!1}render(){return o("div",{key:"
|
|
1
|
+
import{r as a,h as o}from"./p-DH5lfRNj.js";const r=class{constructor(o){a(this,o),this.variant="default",this.size="md",this.rounded=!1}render(){return o("div",{key:"9899b395fdf793bf9b7e47509b81eb559aac0b56",class:{"co-navbar":!0,[`co-navbar--${this.variant}`]:!0,[`co-navbar--${this.size}`]:!0,"co-navbar--rounded":this.rounded},part:"navbar",role:"toolbar"},o("slot",{key:"c863bcf8dc9eddab771922a81e11c1966bfe8d2e"}))}};r.style=":host{display:block}.co-navbar{display:flex;align-items:center;justify-content:space-between;width:100%;font-family:var(--co-font-family-primary);box-sizing:border-box;background:var(--co-navbar-bg);color:var(--co-navbar-color)}.co-navbar--default{--co-navbar-bg:transparent}.co-navbar--filled{--co-navbar-bg:var(--co-semantic-surface-primary, #1f1c1b);--co-navbar-color:var(--co-semantic-on-primary, #fff)}.co-navbar--bordered{--co-navbar-bg:var(--co-semantic-surface-page, #fff);--co-navbar-color:inherit;border-bottom:1px solid var(--co-semantic-border-subtle, rgba(31,28,27,0.08))}.co-navbar--dark{--co-navbar-bg:var(--co-theme-navbar-bg, var(--co-color-base-negro, #1F1C1B));--co-navbar-color:var(--co-theme-on-navbar, #fff);--co-icon-button-bg:var(--co-theme-on-navbar-surface, var(--co-color-opacity-blanco-16, rgba(255,255,255,0.16)));--co-icon-button-color:var(--co-theme-on-navbar, #fff);--co-icon-button-border:transparent}.co-navbar--rounded{border-radius:var(--co-border-radius-sm, 12px);overflow:hidden}.co-navbar--sm{min-height:40px;padding:0 var(--co-navbar-padding-x, var(--co-spacing-md, 12px));gap:var(--co-spacing-sm2, 8px);font-size:var(--co-font-size-12, 12px)}.co-navbar--md{min-height:48px;padding:0 var(--co-navbar-padding-x, var(--co-spacing-lg, 16px));gap:var(--co-spacing-md, 12px);font-size:var(--co-font-size-14, 14px)}.co-navbar--lg{min-height:56px;padding:0 var(--co-navbar-padding-x-end, var(--co-spacing-2xl, 24px)) 0 var(--co-navbar-padding-x-start, var(--co-spacing-md, 12px));gap:var(--co-spacing-sm2, 8px);font-size:var(--co-font-size-14, 14px)}::slotted([slot-spacer]),::slotted(.co-spacer){flex:1}";export{r as co_navbar}
|
|
@@ -89,9 +89,9 @@
|
|
|
89
89
|
.co-accordion__body-inner {
|
|
90
90
|
min-height: 0;
|
|
91
91
|
overflow: hidden;
|
|
92
|
-
padding-top: var(--co-spacing-
|
|
92
|
+
padding-top: var(--co-spacing-md); /* 12px breathing under header */
|
|
93
93
|
/* El 0fr comprime el CONTENIDO pero NO el padding: sin colapsarlo aparte,
|
|
94
|
-
todo acordeón cerrado dejaba una franja fantasma de
|
|
94
|
+
todo acordeón cerrado dejaba una franja fantasma de 12px bajo el header.
|
|
95
95
|
Se transiciona junto con la altura para que respire al abrir/cerrar. */
|
|
96
96
|
transition: padding-top var(--co-motion-duration-slow) var(--co-motion-ease-out);
|
|
97
97
|
}
|