@globalpayments/vega 2.57.0 → 2.57.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.
Files changed (186) hide show
  1. package/dist/cjs/card-config-2ee5505e.js +65 -0
  2. package/dist/cjs/{string-input-formatter-slimmer-92ab034f.js → string-input-formatter-slimmer-dc1747ad.js} +20 -1
  3. package/dist/cjs/vega-date-picker_2.cjs.entry.js +1 -1
  4. package/dist/cjs/vega-env-manager-23b8b23c.js +2 -2
  5. package/dist/cjs/vega-input-credit-card.cjs.entry.js +20 -116
  6. package/dist/cjs/vega-input.cjs.entry.js +194 -2
  7. package/dist/collection/components/vega-input/slimmers/controllers/vega-input-mask-config-controller.js +25 -2
  8. package/dist/collection/components/vega-input/vega-input.js +1 -1
  9. package/dist/collection/components/vega-input-credit-card/vega-input-credit-card.js +13 -52
  10. package/dist/collection/components/vega-table/vega-table-head-cell/vega-table-head-cell.js +1 -1
  11. package/dist/collection/components/vega-table/vega-table.js +1 -1
  12. package/dist/collection/constants/card-config.js +4 -4
  13. package/dist/collection/helpers/formatter/string-formatter/credit-card-blur-mask-strategy.js +74 -0
  14. package/dist/collection/helpers/formatter/string-formatter/credit-card-input-mask-strategy.js +34 -0
  15. package/dist/collection/helpers/formatter/string-formatter/credit-card-mask-strategy.abstract.js +63 -0
  16. package/dist/collection/helpers/formatter/string-formatter/string-format-strategy.abstract.js +4 -1
  17. package/dist/collection/helpers/formatter/string-formatter/string-mask-strategy.js +8 -0
  18. package/dist/collection/helpers/slimmers/string-input-formatter-slimmer.js +8 -0
  19. package/dist/esm/{app-globals-366415b3.js → app-globals-ee6a1250.js} +3 -3
  20. package/dist/esm/card-config-d2ad484e.js +63 -0
  21. package/dist/esm/{code-block-73869a3c.js → code-block-7bd4cb87.js} +1 -1
  22. package/dist/esm/{component-value-history-controller-slimmer.abstract-dfe89c93.js → component-value-history-controller-slimmer.abstract-41c58caf.js} +2 -2
  23. package/dist/esm/{content-state-953906e8.js → content-state-a43e703e.js} +1 -1
  24. package/dist/esm/{design-token-28a0a2e6.js → design-token-23522f5c.js} +1 -1
  25. package/dist/esm/{element-appender-slimmer-7b9f4a8e.js → element-appender-slimmer-042df95a.js} +2 -2
  26. package/dist/esm/{form-field-controller-slimmer-707a6da2.js → form-field-controller-slimmer-f0982f11.js} +2 -2
  27. package/dist/esm/{image-annotation-action-5bfda07c.js → image-annotation-action-1e88f5a0.js} +1 -1
  28. package/dist/esm/{index-3e551cbe.js → index-fb3b74bd.js} +1 -1
  29. package/dist/esm/index.js +7 -7
  30. package/dist/esm/loader.js +5 -5
  31. package/dist/esm/{public-rules-c5d2c1e1.js → public-rules-287d4d77.js} +4 -4
  32. package/dist/esm/{responsive-format-facade-60731164.js → responsive-format-facade-d2632288.js} +1 -1
  33. package/dist/esm/{rich-text-editor-required-rule-4429066e.js → rich-text-editor-required-rule-69d5f035.js} +1 -1
  34. package/dist/esm/{string-input-formatter-slimmer-6ab5cad6.js → string-input-formatter-slimmer-09478e0d.js} +23 -4
  35. package/dist/esm/{style-formatter-57fc600a.js → style-formatter-f7951677.js} +1 -1
  36. package/dist/esm/{sub-state-notify-slimmer-1c4d1e78.js → sub-state-notify-slimmer-0a6c3cbb.js} +1 -1
  37. package/dist/esm/{sub-state-observer-slimmer-1e9af9ec.js → sub-state-observer-slimmer-53eec5fb.js} +1 -1
  38. package/dist/esm/vega-accordion.entry.js +5 -5
  39. package/dist/esm/vega-app-header-button.entry.js +5 -5
  40. package/dist/esm/vega-box.entry.js +6 -6
  41. package/dist/esm/vega-button-circle.entry.js +5 -5
  42. package/dist/esm/vega-button-group_2.entry.js +3 -3
  43. package/dist/esm/vega-button.entry.js +4 -4
  44. package/dist/esm/vega-calendar_3.entry.js +3 -3
  45. package/dist/esm/vega-card.entry.js +5 -5
  46. package/dist/esm/vega-carousel.entry.js +4 -4
  47. package/dist/esm/vega-checkbox_2.entry.js +3 -3
  48. package/dist/esm/vega-chip.entry.js +5 -5
  49. package/dist/esm/vega-code-block.entry.js +3 -3
  50. package/dist/esm/vega-color-picker.entry.js +3 -3
  51. package/dist/esm/vega-combo-box.entry.js +3 -3
  52. package/dist/esm/vega-date-picker_2.entry.js +9 -9
  53. package/dist/esm/vega-dialog_2.entry.js +5 -5
  54. package/dist/esm/vega-divider.entry.js +5 -5
  55. package/dist/esm/vega-dropdown_5.entry.js +7 -7
  56. package/dist/esm/vega-env-manager-8f8dc473.js +2 -2
  57. package/dist/esm/vega-file-uploader.entry.js +3 -3
  58. package/dist/esm/vega-flag-icon.entry.js +5 -5
  59. package/dist/esm/vega-flex.entry.js +6 -6
  60. package/dist/esm/vega-font.entry.js +5 -5
  61. package/dist/esm/vega-form.entry.js +4 -4
  62. package/dist/esm/vega-grid.entry.js +5 -5
  63. package/dist/esm/vega-icon.entry.js +5 -5
  64. package/dist/esm/vega-image-uploader.entry.js +6 -6
  65. package/dist/esm/vega-input-credit-card.entry.js +21 -117
  66. package/dist/esm/vega-input-numeric.entry.js +4 -4
  67. package/dist/esm/vega-input-phone-number.entry.js +5 -5
  68. package/dist/esm/vega-input-range.entry.js +3 -3
  69. package/dist/esm/vega-input-select.entry.js +6 -6
  70. package/dist/esm/vega-input.entry.js +198 -6
  71. package/dist/esm/{vega-internal-event-id-f0ea2bab.js → vega-internal-event-id-4072659b.js} +1 -1
  72. package/dist/esm/vega-left-nav_5.entry.js +7 -7
  73. package/dist/esm/vega-loader-wrapper_2.entry.js +4 -4
  74. package/dist/esm/vega-pagination-page-selector-mobile.entry.js +1 -1
  75. package/dist/esm/vega-pagination-page-size-selector-mobile.entry.js +1 -1
  76. package/dist/esm/vega-pagination.entry.js +4 -4
  77. package/dist/esm/vega-popover_2.entry.js +5 -5
  78. package/dist/esm/vega-radio_2.entry.js +3 -3
  79. package/dist/esm/vega-rich-text-content.entry.js +6 -6
  80. package/dist/esm/vega-rich-text-editor_4.entry.js +10 -10
  81. package/dist/esm/vega-selection-chip_2.entry.js +7 -7
  82. package/dist/esm/vega-selection-tile_2.entry.js +4 -4
  83. package/dist/esm/vega-sidenav_3.entry.js +6 -6
  84. package/dist/esm/vega-signature-capture.entry.js +7 -7
  85. package/dist/esm/vega-stepper.entry.js +3 -3
  86. package/dist/esm/vega-table_8.entry.js +6 -6
  87. package/dist/esm/vega-textarea.entry.js +3 -3
  88. package/dist/esm/vega-time-picker_2.entry.js +7 -7
  89. package/dist/esm/vega-toggle-switch.entry.js +3 -3
  90. package/dist/esm/vega-tooltip_2.entry.js +5 -5
  91. package/dist/esm/vega.js +5 -5
  92. package/dist/types/components/vega-input/slimmers/controllers/vega-input-mask-config-controller.d.ts +7 -0
  93. package/dist/types/components/vega-input/types.d.ts +10 -1
  94. package/dist/types/components/vega-input-credit-card/vega-input-credit-card.d.ts +1 -13
  95. package/dist/types/components/vega-table/interface.d.ts +18 -11
  96. package/dist/types/components/vega-table/vega-table-head-cell/vega-table-head-cell.d.ts +1 -1
  97. package/dist/types/components/vega-table/vega-table.d.ts +1 -1
  98. package/dist/types/components.d.ts +4 -4
  99. package/dist/types/helpers/formatter/string-formatter/credit-card-blur-mask-strategy.d.ts +28 -0
  100. package/dist/types/helpers/formatter/string-formatter/credit-card-input-mask-strategy.d.ts +21 -0
  101. package/dist/types/helpers/formatter/string-formatter/credit-card-mask-strategy.abstract.d.ts +36 -0
  102. package/dist/types/helpers/formatter/string-formatter/string-format-strategy.abstract.d.ts +1 -1
  103. package/dist/types/helpers/formatter/string-formatter/string-mask-strategy.d.ts +9 -3
  104. package/dist/types/helpers/slimmers/string-input-formatter-slimmer.d.ts +4 -0
  105. package/dist/types/types/public-api.d.ts +1 -0
  106. package/dist/vega/index.esm.js +1 -1
  107. package/dist/vega/{p-f8e0e4f0.entry.js → p-080db42b.entry.js} +1 -1
  108. package/dist/vega/{p-6acf0a51.entry.js → p-083af15f.entry.js} +1 -1
  109. package/dist/vega/{p-75ff12da.entry.js → p-091ab617.entry.js} +1 -1
  110. package/dist/vega/{p-47e89c0e.entry.js → p-0b5330e1.entry.js} +1 -1
  111. package/dist/vega/{p-f4a7acff.entry.js → p-1a4f77de.entry.js} +1 -1
  112. package/dist/vega/{p-21a7530c.entry.js → p-1a6dacc7.entry.js} +1 -1
  113. package/dist/vega/{p-2ebef70f.entry.js → p-1db2ba98.entry.js} +1 -1
  114. package/dist/vega/{p-e277ea73.entry.js → p-1f9a735a.entry.js} +1 -1
  115. package/dist/vega/{p-44880bdf.entry.js → p-24042f0c.entry.js} +1 -1
  116. package/dist/vega/{p-0496f1cb.entry.js → p-27ec0c07.entry.js} +1 -1
  117. package/dist/vega/{p-27dca371.entry.js → p-317920e6.entry.js} +1 -1
  118. package/dist/vega/{p-a2ef3429.entry.js → p-376b3ec7.entry.js} +1 -1
  119. package/dist/vega/{p-dc16e6ba.entry.js → p-394594e9.entry.js} +1 -1
  120. package/dist/vega/{p-07927476.entry.js → p-39906ad2.entry.js} +1 -1
  121. package/dist/vega/{p-8fb5bcb0.entry.js → p-42ec43ef.entry.js} +1 -1
  122. package/dist/vega/{p-6e1b5949.js → p-43263510.js} +1 -1
  123. package/dist/vega/{p-29f4cbed.entry.js → p-435451be.entry.js} +1 -1
  124. package/dist/vega/{p-9481c073.entry.js → p-45eb1e01.entry.js} +1 -1
  125. package/dist/vega/p-472108bd.entry.js +1 -0
  126. package/dist/vega/{p-6131f229.entry.js → p-48ae6f02.entry.js} +1 -1
  127. package/dist/vega/{p-1c4d05de.entry.js → p-48b24fd3.entry.js} +1 -1
  128. package/dist/vega/{p-fb8c99c5.js → p-4a237308.js} +1 -1
  129. package/dist/vega/{p-5dec9bd9.entry.js → p-4ab67150.entry.js} +1 -1
  130. package/dist/vega/{p-d82ceacf.entry.js → p-4c4ac1a5.entry.js} +1 -1
  131. package/dist/vega/p-4fb159d5.js +1 -0
  132. package/dist/vega/p-5bd3487e.js +1 -0
  133. package/dist/vega/p-5f377954.js +1 -1
  134. package/dist/vega/{p-39049341.entry.js → p-5fe47fe8.entry.js} +1 -1
  135. package/dist/vega/{p-d5ab867e.entry.js → p-61ea2d75.entry.js} +1 -1
  136. package/dist/vega/{p-e32efc2e.entry.js → p-63adca7b.entry.js} +1 -1
  137. package/dist/vega/{p-7c0004dc.entry.js → p-699032fc.entry.js} +1 -1
  138. package/dist/vega/{p-0b77c6c9.entry.js → p-710da484.entry.js} +1 -1
  139. package/dist/vega/{p-007bf7df.js → p-71c65f7e.js} +1 -1
  140. package/dist/vega/{p-a92a8172.entry.js → p-81279fea.entry.js} +1 -1
  141. package/dist/vega/{p-ecd032fc.js → p-8782abeb.js} +1 -1
  142. package/dist/vega/p-88e08a33.js +1 -0
  143. package/dist/vega/{p-4f5eb8d5.js → p-8c4f893b.js} +1 -1
  144. package/dist/vega/{p-2873b600.entry.js → p-8f8de5ab.entry.js} +1 -1
  145. package/dist/vega/p-92355996.entry.js +1 -0
  146. package/dist/vega/{p-ce14af16.js → p-9a956a00.js} +1 -1
  147. package/dist/vega/{p-fcb04960.js → p-9afdcf65.js} +1 -1
  148. package/dist/vega/p-9b08ed46.entry.js +1 -0
  149. package/dist/vega/{p-0604563a.entry.js → p-9ca7467d.entry.js} +1 -1
  150. package/dist/vega/{p-b44ebc84.entry.js → p-9ce0bd82.entry.js} +1 -1
  151. package/dist/vega/{p-f8f8e7d2.entry.js → p-a04491cc.entry.js} +1 -1
  152. package/dist/vega/{p-99c4559e.entry.js → p-a1056063.entry.js} +1 -1
  153. package/dist/vega/{p-b449fe9a.entry.js → p-a4a0fcfd.entry.js} +1 -1
  154. package/dist/vega/{p-f79c82c7.entry.js → p-a7042a5a.entry.js} +1 -1
  155. package/dist/vega/p-acf7667e.entry.js +1 -0
  156. package/dist/vega/{p-8ba8a7cc.entry.js → p-b21b128c.entry.js} +1 -1
  157. package/dist/vega/{p-766ed063.entry.js → p-b75a8edb.entry.js} +1 -1
  158. package/dist/vega/{p-1e3f4007.entry.js → p-c21295cf.entry.js} +1 -1
  159. package/dist/vega/{p-5130bb06.entry.js → p-c69a6547.entry.js} +1 -1
  160. package/dist/vega/{p-79c2282c.entry.js → p-c9740710.entry.js} +1 -1
  161. package/dist/vega/{p-f4546425.entry.js → p-ce5a3589.entry.js} +1 -1
  162. package/dist/vega/{p-cd3d468c.js → p-d1355307.js} +1 -1
  163. package/dist/vega/{p-8246f8ae.js → p-d7e0c57a.js} +1 -1
  164. package/dist/vega/p-e1ed78db.js +1 -0
  165. package/dist/vega/{p-34643550.entry.js → p-ef84dc90.entry.js} +1 -1
  166. package/dist/vega/{p-2458ad97.js → p-f229d6d1.js} +1 -1
  167. package/dist/vega/{p-fd2f699b.js → p-f25570f5.js} +1 -1
  168. package/dist/vega/{p-888dc143.entry.js → p-f27fcc7c.entry.js} +1 -1
  169. package/dist/vega/{p-e28fcf04.entry.js → p-f3ab00ad.entry.js} +1 -1
  170. package/dist/vega/{p-f3f7d059.entry.js → p-f543e911.entry.js} +1 -1
  171. package/dist/vega/{p-65d8c2bc.js → p-f5ac60f5.js} +1 -1
  172. package/dist/vega/{p-bdaf1143.entry.js → p-f7b5833d.entry.js} +1 -1
  173. package/dist/vega/p-fc02a67a.js +1 -0
  174. package/dist/vega/{p-a33c6652.entry.js → p-fcb5b40f.entry.js} +1 -1
  175. package/dist/vega/{p-aed3320d.js → p-fda6f8bc.js} +1 -1
  176. package/dist/vega/{p-e5196440.entry.js → p-fe1512f9.entry.js} +1 -1
  177. package/dist/vega/vega.esm.js +1 -1
  178. package/package.json +1 -1
  179. package/dist/vega/p-3a7e897b.entry.js +0 -1
  180. package/dist/vega/p-51297b96.js +0 -1
  181. package/dist/vega/p-51a4dc20.entry.js +0 -1
  182. package/dist/vega/p-53e9595f.js +0 -1
  183. package/dist/vega/p-6ec338b0.entry.js +0 -1
  184. package/dist/vega/p-76818196.entry.js +0 -1
  185. package/dist/vega/p-79a0a06c.js +0 -1
  186. package/dist/vega/p-b8d7d4a9.js +0 -1
@@ -1 +0,0 @@
1
- import{r as t,c as i,h as e,H as h,g as s}from"./p-21d26bb4.js";import{F as a}from"./p-e77a83e4.js";import{V as r,M as l,A as o,D as c}from"./p-3a0a4d15.js";import{R as p}from"./p-280cbcdb.js";import{V as d}from"./p-6f90d444.js";import{s as n}from"./p-519a7d55.js";import{I as v}from"./p-6e1ab235.js";import{V as m,I as f}from"./p-d849e0f5.js";import{F as u}from"./p-6e1b5949.js";import{b as g}from"./p-5773a9a3.js";import{C as _}from"./p-2d0d575f.js";import{c as A}from"./p-012cbd8f.js";import{C as M}from"./p-d789b291.js";import{D as E}from"./p-e7b00bf0.js";import{f as w,B as Z,A as b}from"./p-6e01f0a2.js";import{V as j}from"./p-f08a4adf.js";import{h as I}from"./p-65d8c2bc.js";import"./p-db8cdba6.js";import"./p-112455b1.js";import"./p-abd7aeaa.js";import"./p-262ec334.js";import"./p-0bb29d98.js";import"./p-331a62d5.js";import"./p-d5776087.js";import"./p-a4670e23.js";import"./p-6a334573.js";import"./p-9d6003ef.js";import"./p-7d9cd9c8.js";import"./p-74168615.js";import"./p-ed45b3b6.js";import"./p-b75ee3ba.js";import"./p-78a57a17.js";import"./p-52b8f2d2.js";import"./p-d27ae9ff.js";import"./p-ecd032fc.js";import"./p-613ee009.js";import"./p-5f377954.js";import"./p-8c46e116.js";const D=[{type:"visa",iconName:"visa",pattern:r,maskConfig:{type:"custom",options:{mask:"9999 9999 9999 9999 999",slot:"9",accept:/\d/,triggerAtInit:a.isEnabled("VEGA_INPUT_CREDIT_CARD.ENABLE_HIDE_NUMBER_MASK_ON_FIRST_LOAD")}}},{type:"mastercard",iconName:"mastercard",pattern:l,maskConfig:{type:"custom",options:{mask:"9999 9999 9999 9999",slot:"9",accept:/\d/,triggerAtInit:a.isEnabled("VEGA_INPUT_CREDIT_CARD.ENABLE_HIDE_NUMBER_MASK_ON_FIRST_LOAD")}}},{type:"amex",iconName:"amex",pattern:o,maskConfig:{type:"custom",options:{mask:"9999 999999 99999",slot:"9",accept:/\d/,triggerAtInit:a.isEnabled("VEGA_INPUT_CREDIT_CARD.ENABLE_HIDE_NUMBER_MASK_ON_FIRST_LOAD")}}},{type:"discover",iconName:"discover",pattern:c,maskConfig:{type:"custom",options:{mask:"9999 9999 9999 9999",slot:"9",accept:/\d/,triggerAtInit:a.isEnabled("VEGA_INPUT_CREDIT_CARD.ENABLE_HIDE_NUMBER_MASK_ON_FIRST_LOAD")}}}],R=[{payloadKey:"AUTO_VALIDATION_IS_TRUE",payloadDescription:"Determines whether the user's input in the credit card field should be automatically validated",payloadValue:t=>!0===t.autoValidation},{payloadKey:"AUTO_VALIDATION_IS_FALSE",payloadDescription:"Determines whether the user's input in the credit card field should be automatically validated",payloadValue:t=>!1===t.autoValidation}];var y=function(t,i,e,h){var s,a=arguments.length,r=a<3?i:null===h?h=Object.getOwnPropertyDescriptor(i,e):h;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,i,e,h);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(r=(a<3?s(r):a>3?s(i,e,r):s(i,e))||r);return a>3&&r&&Object.defineProperty(i,e,r),r};const N=class{constructor(h){t(this,h),this.vegaChange=i(this,"vegaChange",7),this.change=i(this,"change",7),this.vegaBlur=i(this,"vegaBlur",7),this.blur=i(this,"blur",7),this.vegaFocus=i(this,"vegaFocus",7),this.focus=i(this,"focus",7),this.globalSlimmers={},this.formFieldController=new u({propertyRules:[{propertyName:"required",ruleFactory:t=>t?new p:null},{propertyName:"",ruleFactory:()=>new d}],validationRulesName:"validationRules",defaultValue:"",attributeGetter:t=>this[t],inputContainerGetter:()=>this.inputContainerGetter(),touchableAreaGetter:()=>this.touchableAreaGetter()}),this.changeEventEmitter=A(N,w),this.blurEventEmitter=A(N,Z),this.focusEventEmitter=A(N,b),this.inputCreditCardEventPrevent=new M([w,b,Z],(()=>this.host),!0),this.vegaComponentUsageRuntimeMetricsSlimmer=new m(R),this.maskConfig={type:"custom",options:{mask:"",slot:"9",accept:/[\d\s]/,insertMode:!1,triggerAtInit:a.isEnabled("VEGA_INPUT_CREDIT_CARD.ENABLE_HIDE_NUMBER_MASK_ON_FIRST_LOAD")},trigger:"blur"},this.required=!1,this.disabled=!1,this.label="",this.hint="",this.size="default",this.placeholder="",this.hideCardNumberOnBlur=!0,this.autoValidation=!0,this.validationRules=[],this.isValid=null,this.value="",this.renderInputContainer=()=>{var t;const i=(null===(t=this.getCreditCardType(this.value))||void 0===t?void 0:t.iconName)||"regular-credit-card";return e("vega-input",{label:this.label,type:"number",prefixIcon:j.getIconKey(i),maskConfig:this.getMaskConfig(this.value),placeholder:this.placeholder,disabled:this.disabled,size:this.size,value:this.value,hint:this.hint,required:this.required,showClearIcon:!1,ref:t=>{this.inputRef=t,E.addUniqueObserverToNode(t,w,(t=>{this.handleVegaChange(t)})),E.addUniqueObserverToNode(t,Z,(()=>{this.handleVegaBlur()})),E.addUniqueObserverToNode(t,b,(()=>{this.handleVegaFocus()})),E.addUniqueObserverToNode(t,I,(t=>{const i=t.clipboardData.getData("text");this.inputRef.maskConfig=this.getMaskConfig(i)}))}})},this.handleVegaChange=t=>{this.value=t.detail},this.handleVegaBlur=()=>{this.blurEventEmitter.emit()},this.handleVegaFocus=()=>{this.focusEventEmitter.emit()},this.inputContainerGetter=()=>this.inputRef.shadowRoot.querySelector(".vega-input-container"),this.touchableAreaGetter=()=>Array.from(this.inputRef.shadowRoot.querySelectorAll("input"))}watchValidationRules(){}watchValue(t){this.changeEventEmitter.emit(t),_.notify(g,{host:this.host,detail:t})}componentDidLoad(){a.isEnabled("VEGA_INPUT_CREDIT_CARD.ENABLE_HIDE_NUMBER_MASK_ON_FIRST_LOAD")&&this.hideCardNumberOnBlur&&this.inputRef.value&&this.value!==this.inputRef.value&&(this.value=this.inputRef.value)}render(){return n(e(h,null,this.renderInputContainer()),this.host)}getCreditCardType(t){return D.filter((i=>i.pattern.test(t)))[0]}getMaskConfig(t){const i=[],e=this.getCreditCardType(t);return e&&(i.push(e.maskConfig),this.hideCardNumberOnBlur&&t.trim().includes(" ")&&(this.maskConfig.options.mask=this.generateDynamicMask(),i.push(this.maskConfig))),i}generateDynamicMask(){const t=this.value.trim().split(" ");return this.maskCardNumber(t).join(" ")}maskCardNumber(t){return t.map(((i,e)=>(e===t.length-1?"9":"X").repeat(i.length)))}get host(){return s(this)}static get watchers(){return{validationRules:["watchValidationRules"],value:["watchValue"]}}};j.register({visa:{icon:'<svg xmlns="http://www.w3.org/2000/svg" width="36" height="24" fill="none"><rect width="36" height="24" fill="#00579F" rx="2"/><path fill="#fff" d="M15.474 15.792h-1.979l1.238-7.653h1.979l-1.238 7.653ZM22.647 8.326A4.877 4.877 0 0 0 20.872 8c-1.954 0-3.33 1.042-3.339 2.532-.016 1.1.986 1.71 1.735 2.076.765.375 1.026.62 1.026.953-.008.513-.619.75-1.189.75-.79 0-1.213-.123-1.857-.408l-.26-.122-.277 1.718c.464.211 1.32.4 2.207.407 2.076 0 3.428-1.026 3.444-2.613.008-.872-.52-1.54-1.66-2.085-.693-.35-1.117-.586-1.117-.944.008-.326.359-.66 1.14-.66a3.362 3.362 0 0 1 1.474.293l.18.082.268-1.653ZM25.279 13.08l.79-2.14c-.008.016.162-.448.26-.733l.138.66s.375 1.831.457 2.214h-1.645ZM27.72 8.14h-1.53c-.472 0-.831.138-1.035.635l-2.94 7.018h2.077l.416-1.148h2.54c.057.269.237 1.148.237 1.148h1.832L27.72 8.14ZM11.842 8.139l-1.938 5.219-.212-1.059c-.358-1.221-1.482-2.548-2.736-3.208l1.775 6.693h2.093l3.11-7.645h-2.092Z"/><path fill="#FAA61A" d="M8.104 8.139H4.92l-.032.154c2.483.635 4.128 2.166 4.804 4.007L9 8.782c-.114-.489-.464-.627-.896-.643Z"/></svg>',autoSize:!0},mastercard:{icon:'<svg xmlns="http://www.w3.org/2000/svg" width="36" height="24" fill="none"><rect width="36" height="24" fill="#000" rx="2"/><path fill="#ED0006" fill-rule="evenodd" d="M18.25 17.157a6.75 6.75 0 0 1-4.426 1.649c-3.769 0-6.824-3.09-6.824-6.903C7 8.091 10.055 5 13.824 5a6.75 6.75 0 0 1 4.426 1.649A6.75 6.75 0 0 1 22.676 5c3.769 0 6.824 3.09 6.824 6.903 0 3.812-3.055 6.903-6.824 6.903a6.75 6.75 0 0 1-4.426-1.65Z" clip-rule="evenodd"/><path fill="#F9A000" fill-rule="evenodd" d="M18.25 17.157a6.92 6.92 0 0 0 2.398-5.254 6.92 6.92 0 0 0-2.398-5.254A6.75 6.75 0 0 1 22.676 5c3.769 0 6.824 3.09 6.824 6.903 0 3.812-3.055 6.903-6.824 6.903a6.75 6.75 0 0 1-4.426-1.65Z" clip-rule="evenodd"/><path fill="#FF5E00" fill-rule="evenodd" d="M18.25 6.65a6.92 6.92 0 0 1 2.398 5.253 6.92 6.92 0 0 1-2.398 5.254 6.92 6.92 0 0 1-2.398-5.254A6.92 6.92 0 0 1 18.25 6.65Z" clip-rule="evenodd"/></svg>',autoSize:!0},amex:{icon:'<svg xmlns="http://www.w3.org/2000/svg" width="36" height="24" fill="none"><g clip-path="url(#a)"><rect width="36" height="24" fill="#016FD0" rx="2"/><path fill="#fff" d="M6.99 18.549v-5.654h5.986l.643.838.663-.838h21.729v5.264s-.569.384-1.226.39H22.754l-.724-.891v.891h-2.373v-1.521s-.325.212-1.025.212h-.808v1.309h-3.593l-.641-.855-.651.855H6.99ZM0 8.634l1.35-3.147h2.334l.767 1.763V5.487h2.902l.456 1.274.442-1.274h13.027v.64s.685-.64 1.81-.64l4.227.015.753 1.74V5.487h2.428l.669 1v-1h2.45v5.654h-2.45l-.64-1.003v1.003h-3.569l-.359-.892h-.959l-.353.892h-2.42c-.968 0-1.587-.628-1.587-.628v.628H17.63l-.725-.892v.892H3.34l-.359-.892h-.956l-.356.892H0V8.634Z"/><path fill="#016FD0" d="M1.827 6.184.006 10.417h1.185l.336-.847H3.48l.335.847h1.211L3.207 6.184h-1.38Zm.673.985.596 1.482H1.903L2.5 7.169ZM5.151 10.416V6.183l1.685.006.98 2.73.956-2.736h1.671v4.233H9.385v-3.12l-1.122 3.12h-.928L6.21 7.296v3.12H5.15ZM11.168 10.416V6.183h3.454v.947h-2.384v.724h2.328v.891h-2.328v.752h2.384v.92h-3.454ZM15.233 6.184v4.233h1.059V8.913h.445l1.27 1.504H19.3l-1.393-1.56a1.29 1.29 0 0 0 1.161-1.3c0-.89-.7-1.373-1.48-1.373h-2.355Zm1.059.947h1.21c.29 0 .5.227.5.446 0 .28-.273.445-.485.445h-1.225v-.891ZM20.582 10.416h-1.08V6.183h1.08v4.233ZM23.144 10.416h-.233c-1.129 0-1.814-.889-1.814-2.1 0-1.24.678-2.133 2.103-2.133h1.17v1.003h-1.213c-.578 0-.988.451-.988 1.141 0 .82.468 1.165 1.142 1.165h.279l-.446.924ZM25.448 6.184l-1.82 4.233h1.185l.336-.847h1.953l.334.847h1.211l-1.819-4.233h-1.38Zm.674.985.595 1.482h-1.192l.597-1.482ZM28.77 10.416V6.183h1.345l1.718 2.66v-2.66h1.059v4.233H31.59l-1.762-2.73v2.73H28.77ZM7.715 17.825v-4.233h3.453v.947H8.784v.724h2.329v.89H8.784v.753h2.384v.919H7.715ZM24.636 17.825v-4.233h3.454v.947h-2.384v.724h2.317v.89h-2.317v.753h2.384v.919h-3.454ZM11.303 17.825l1.681-2.09-1.721-2.143h1.333l1.025 1.324 1.029-1.324h1.281l-1.699 2.116 1.685 2.117h-1.333l-.996-1.304-.971 1.304h-1.314ZM16.041 13.592v4.233h1.086v-1.337h1.114c.943 0 1.658-.5 1.658-1.472 0-.806-.56-1.424-1.52-1.424H16.04Zm1.086.957h1.174c.304 0 .522.187.522.488 0 .282-.217.487-.526.487h-1.17v-.975ZM20.359 13.592v4.233h1.058V16.32h.446l1.269 1.504h1.293l-1.393-1.56a1.29 1.29 0 0 0 1.162-1.3c0-.89-.7-1.373-1.48-1.373h-2.355Zm1.058.947h1.21c.29 0 .501.226.501.445 0 .281-.273.446-.486.446h-1.225v-.891ZM28.58 17.825v-.92H30.7c.313 0 .449-.169.449-.354 0-.178-.136-.358-.45-.358h-.957c-.831 0-1.295-.507-1.295-1.268 0-.679.424-1.333 1.66-1.333h2.062l-.446.952H29.94c-.341 0-.446.179-.446.35 0 .175.13.369.39.369h1.003c.927 0 1.33.526 1.33 1.215 0 .74-.449 1.347-1.38 1.347H28.58ZM32.464 17.825v-.92h2.118c.313 0 .45-.169.45-.354 0-.178-.136-.358-.45-.358h-.957c-.832 0-1.295-.507-1.295-1.268 0-.679.424-1.333 1.66-1.333h2.02l-.404.952h-1.783c-.34 0-.446.179-.446.35 0 .175.13.369.39.369h1.003c.927 0 1.33.526 1.33 1.215 0 .74-.449 1.347-1.38 1.347h-2.256Z"/></g><defs><clipPath id="a"><rect width="36" height="24" fill="#fff" rx="2"/></clipPath></defs></svg>',autoSize:!0},discover:{icon:'<svg xmlns="http://www.w3.org/2000/svg" width="36" height="24" fill="none"><rect width="36" height="24" fill="#232342" rx="2"/><path fill="#fff" fill-rule="evenodd" d="M30.686 9.61c1.086 0 1.684.484 1.684 1.398a1.307 1.307 0 0 1-1.087 1.397l1.467 1.988h-1.14l-1.25-1.935h-.109v1.935h-.924V9.61h1.359Zm-.435 2.204h.272c.597 0 .869-.269.869-.752 0-.43-.272-.699-.87-.699h-.27v1.45Zm-4.129 2.579h2.608v-.806h-1.684v-1.29h1.63v-.806h-1.63v-1.074h1.684V9.61h-2.608v4.781Zm-2.716-1.559-1.25-3.223h-.978l2.01 4.889h.49l2.01-4.89h-.978l-1.304 3.225Zm-11.029-.805c0 1.343 1.087 2.471 2.445 2.471.435 0 .815-.107 1.195-.269v-1.074c-.271.322-.652.537-1.086.537-.87 0-1.576-.645-1.576-1.504v-.108c-.054-.86.652-1.612 1.521-1.665.435 0 .87.215 1.141.537V9.879c-.326-.214-.76-.268-1.14-.268-1.413-.108-2.5 1.02-2.5 2.418Zm-1.684-.591c-.543-.215-.706-.323-.706-.591.054-.323.326-.591.652-.538.271 0 .543.162.76.376l.49-.644c-.381-.323-.87-.538-1.359-.538-.76-.053-1.412.538-1.467 1.29v.054c0 .644.272 1.02 1.141 1.289.217.054.435.161.652.269a.563.563 0 0 1 .272.483c0 .376-.326.699-.652.699h-.055c-.434 0-.814-.269-.977-.645l-.598.59c.326.592.978.914 1.63.914.869.054 1.575-.59 1.63-1.45v-.162c-.055-.644-.326-.967-1.413-1.396Zm-3.15 2.954h.923V9.611h-.924v4.781ZM3.25 9.611H4.88c1.304.054 2.336 1.128 2.282 2.418 0 .698-.326 1.343-.87 1.826-.488.376-1.086.591-1.684.538H3.25V9.61Zm1.195 3.976c.435.053.924-.108 1.25-.376.326-.323.489-.753.489-1.236 0-.43-.163-.86-.49-1.182-.325-.269-.814-.43-1.249-.376h-.271v3.17h.271Z" clip-rule="evenodd"/><path fill="#FD6020" fill-rule="evenodd" d="M18.788 9.5c-1.358 0-2.499 1.075-2.499 2.471 0 1.344 1.087 2.472 2.5 2.526 1.412.053 2.498-1.075 2.553-2.472C21.287 10.628 20.2 9.5 18.788 9.5Z" clip-rule="evenodd"/></svg>',autoSize:!0},"regular-credit-card":{icon:'<svg xmlns="http://www.w3.org/2000/svg" width="36" height="24" fill="none"><rect width="36" height="24" rx="2" style=\'fill: rgba(var(--v-regular-credit-card-bg, 205, 209, 211, 1))\'/><g clip-path="url(#a)"><path style="fill: rgba(var(--v-regular-credit-card-top, 252, 252, 252, 1))" d="M11 5c-1.103 0-2 .897-2 2v1h18V7c0-1.103-.897-2-2-2H11Zm16 6H9v6c0 1.103.897 2 2 2h14c1.103 0 2-.897 2-2v-6Zm-14.5 4h2c.275 0 .5.225.5.5s-.225.5-.5.5h-2a.501.501 0 0 1-.5-.5c0-.275.225-.5.5-.5Zm3.5.5c0-.275.225-.5.5-.5h4c.275 0 .5.225.5.5s-.225.5-.5.5h-4a.501.501 0 0 1-.5-.5Z"/></g><defs><clipPath id="a"><path d="M9 4h18v16H9z" style=\'fill: rgba(var(--v-regular-credit-card-bottom, 255, 255, 255, 1))\'/></clipPath></defs></svg>',autoSize:!0}}),y([f()],N.prototype,"globalSlimmers",void 0),y([v()],N.prototype,"formFieldController",void 0),y([v()],N.prototype,"changeEventEmitter",void 0),y([v()],N.prototype,"blurEventEmitter",void 0),y([v()],N.prototype,"focusEventEmitter",void 0),y([v()],N.prototype,"inputCreditCardEventPrevent",void 0),y([v()],N.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),N.style=":host{display:inline-block;width:100%;text-align:left;line-height:normal}";export{N as vega_input_credit_card}
@@ -1 +0,0 @@
1
- import{W as s}from"./p-5d676a94.js";import{O as o}from"./p-331a62d5.js";import{C as a}from"./p-2d0d575f.js";import{d as r}from"./p-6e01f0a2.js";import{V as m}from"./p-65d8c2bc.js";const p=async()=>s.handle(),n=async s=>new Promise((p=>{const n=new o(t.bind(null),(()=>{a.unregister(r.getSubject(s,m),n),p(null)}));a.register(r.getSubject(s,m),n)})),t=()=>!0;export{n as a,p as w}
@@ -1 +0,0 @@
1
- import{h as e,H as t,r as i,c as o,g as r}from"./p-21d26bb4.js";import{s}from"./p-519a7d55.js";import{c as a,M as l,V as n,I as d,L as c}from"./p-6e1ab235.js";import{V as h,I as p}from"./p-d849e0f5.js";import{R as v}from"./p-fb8c99c5.js";import{c as g}from"./p-86194314.js";import{S as b}from"./p-ecd032fc.js";import{O as f}from"./p-331a62d5.js";import{d as m,f as u}from"./p-6e01f0a2.js";import{c as x}from"./p-65d8c2bc.js";import{f as w}from"./p-d5776087.js";import{C as j}from"./p-2d0d575f.js";import{P as y,g as k}from"./p-7d9cd9c8.js";import{c as C}from"./p-012cbd8f.js";import{b as R}from"./p-5773a9a3.js";import{M as z}from"./p-78a57a17.js";import{a as S}from"./p-52b8f2d2.js";import{i as O}from"./p-d27ae9ff.js";import{c as E}from"./p-4f5eb8d5.js";import{C as T}from"./p-d789b291.js";import{F as I}from"./p-6e1b5949.js";import{R as V}from"./p-280cbcdb.js";import"./p-5e2c9e69.js";import"./p-ed45b3b6.js";import"./p-74168615.js";import"./p-3a0a4d15.js";import"./p-d884c644.js";import"./p-262ec334.js";import"./p-0c667d6a.js";import"./p-5f377954.js";import"./p-bcdb235d.js";import"./p-a4670e23.js";import"./p-6a334573.js";import"./p-0c8bd757.js";import"./p-112455b1.js";import"./p-613ee009.js";import"./p-e77a83e4.js";import"./p-db8cdba6.js";import"./p-8c46e116.js";import"./p-5d676a94.js";import"./p-9d6003ef.js";import"./p-53e9595f.js";import"./p-8246f8ae.js";import"./p-b75ee3ba.js";import"./p-e7b00bf0.js";import"./p-0bb29d98.js";import"./p-abd7aeaa.js";var N=function(e,t,i,o){var r,s=arguments.length,a=s<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(r=e[l])&&(a=(s<3?r(a):s>3?r(t,i,a):r(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};class L extends n{componentWillRender(){this.currentSize=v.formatCustom(this.size)}render(){return e(t,{class:{block:this.block}},this.renderTooltip())}renderTooltip(){return e("vega-tooltip",Object.assign({trigger:this.disabled&&this.disabledTooltip?"hover":"none",alignment:"center"},this.disabledTooltip),this.renderSelectionChip())}renderSelectionChip(){return e("vega-box",{corners:"rounded-full",class:{"vega-selection-chip":!0,[`size-${this.currentSize}`]:!0,[`variant-${this.variant||"text"}`]:!0,checked:this.checked,error:this.showError,disabled:this.disabled},"aria-label":this.label||"No label defined",onClick:()=>{"radio"===this.selectType&&this.checked||this.checkedController.onCheck(!this.checked)},onKeyDown:g(),tabIndex:this.disabled?-1:0},this.renderContent())}renderContent(){return e("vega-flex",{gap:L.gapSizeMap[this.currentSize],"align-items":"center","justify-content":"text"===this.variant?"center":"start"},"swatch"===this.variant&&this.renderSwatch(),this.renderLabel())}renderLabel(){return e("vega-font",{color:"text-primary",class:"label vega-flex-grow",variant:L.labelFontMap[this.currentSize]},this.label)}renderSwatch(){return e("vega-box",{"background-color":"bg-primary",corners:"rounded-full",class:"swatch vega-flex-shrink-0"},e("vega-box",{"background-color":this.swatchColor,corners:"rounded-full"}))}}L.gapSizeMap={"extra-small":"size-4",small:"size-4",medium:"size-8",large:"size-8"},L.labelFontMap={"extra-small":"font-field-label-xs",small:"font-field-label-sm",medium:"font-field-label",large:"font-field-label-lg"},N([a()],L.prototype,"host",void 0),N([a()],L.prototype,"label",void 0),N([a()],L.prototype,"block",void 0),N([a()],L.prototype,"size",void 0),N([a()],L.prototype,"variant",void 0),N([a()],L.prototype,"swatchColor",void 0),N([a()],L.prototype,"disabledTooltip",void 0),N([a()],L.prototype,"disabled",void 0),N([a()],L.prototype,"selectType",void 0),N([a()],L.prototype,"checked",void 0),N([a()],L.prototype,"checkedController",void 0),N([a()],L.prototype,"showError",void 0),N([l("componentWillRender")],L.prototype,"componentWillRender",null);var A=function(e,t,i,o){var r,s=arguments.length,a=s<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(r=e[l])&&(a=(s<3?r(a):s>3?r(t,i,a):r(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};class F extends n{setChecked(e){this.checked=e}onCheck(e){const t=e?this.value:"";this.setChecked(e),this.changeEventEmitter.emit(t)}}A([a()],F.prototype,"host",void 0),A([a({writable:!0})],F.prototype,"checked",void 0),A([a()],F.prototype,"changeEventEmitter",void 0),A([a()],F.prototype,"value",void 0);var D=function(e,t,i,o){var r,s=arguments.length,a=s<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(r=e[l])&&(a=(s<3?r(a):s>3?r(t,i,a):r(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};class G extends b{constructor(){super({parent:"vega-selection-chip-group",subStates:[{subStateName:"disabled",parentStateName:"disabled",callback:e=>{"boolean"==typeof e&&(this.disabled=e)}},{subStateName:"selectType",parentStateName:"selectType",callback:e=>{this.selectType="checkbox"===e?"checkbox":"radio"}},{subStateName:"checked",parentStateName:"value",callback:e=>{this.checkedController.setChecked(Array.isArray(e)?e.includes(this.value):e===this.value)}}]})}}D([a()],G.prototype,"host",void 0),D([a({writable:!0})],G.prototype,"disabled",void 0),D([a({writable:!0})],G.prototype,"selectType",void 0),D([a()],G.prototype,"value",void 0),D([a()],G.prototype,"checkedController",void 0);var W=function(e,t,i,o){var r,s=arguments.length,a=s<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(r=e[l])&&(a=(s<3?r(a):s>3?r(t,i,a):r(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};class M extends n{connectedCallback(){this.selectionChipGroup=w(this.host,"vega-selection-chip-group"),this.selectionChipGroup&&(this.fieldErrorObserver=new f(this.canAcceptFieldErrorObserver.bind(this),this.fieldErrorObserverListener.bind(this)),j.register(m.getSubject(this.selectionChipGroup,x),this.fieldErrorObserver))}disconnectedCallback(){this.selectionChipGroup&&j.unregister(m.getSubject(this.selectionChipGroup,x),this.fieldErrorObserver)}canAcceptFieldErrorObserver(){return!0}fieldErrorObserverListener(e){this.showError=e.showError}}W([a({writable:!0})],M.prototype,"showError",void 0),W([a()],M.prototype,"host",void 0),W([l("connectedCallback")],M.prototype,"connectedCallback",null),W([l("disconnectedCallback")],M.prototype,"disconnectedCallback",null);var _=function(e,t,i,o){var r,s=arguments.length,a=s<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(r=e[l])&&(a=(s<3?r(a):s>3?r(t,i,a):r(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};const H=class{constructor(e){i(this,e),this.vegaChange=o(this,"vegaChange",7),this.change=o(this,"change",7),this.globalSlimmers={},this.renderer=new L,this.checkedController=new F,this.stateController=new G,this.showErrorController=new M,this.pageResizeObserverSlimmer=new y,this.vegaComponentUsageRuntimeMetricsSlimmer=new h,this.changeEventEmitter=C(H,u),this.showError=!1,this.currentBreakpoint=k(),this.label="",this.size="medium",this.variant="text",this.disabled=!1,this.block=!1,this.swatchColor="bg-status-info"}watchSize(){}componentWillRender(){}render(){return s(this.renderer.render(),this.host)}get host(){return r(this)}static get watchers(){return{size:["watchSize"]}}};_([p()],H.prototype,"globalSlimmers",void 0),_([d()],H.prototype,"renderer",void 0),_([d()],H.prototype,"checkedController",void 0),_([d()],H.prototype,"stateController",void 0),_([d()],H.prototype,"showErrorController",void 0),_([d()],H.prototype,"pageResizeObserverSlimmer",void 0),_([d()],H.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),_([d()],H.prototype,"changeEventEmitter",void 0),H.style=":host(.block){display:block}:host(.block) vega-tooltip{display:block}:host{max-width:100%;display:inline-block;vertical-align:middle;line-height:0}:host vega-tooltip{max-width:100%}:host .swatch{margin:2px;padding:1px;box-sizing:border-box}:host .swatch vega-box{width:100%;height:100%}:host .label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host .vega-selection-chip{background-color:rgba(var(--v-bg-tile, 252, 252, 252, 1));cursor:pointer;margin:1px}:host .variant-text .label{text-align:center}:host .size-extra-small.variant-swatch.vega-selection-chip{padding-top:2px;padding-bottom:2px;padding-left:2px;padding-right:12px}:host .size-extra-small.variant-text.vega-selection-chip{padding-left:12px;padding-right:12px;padding-top:2px;padding-bottom:2px}:host .size-extra-small vega-flex{height:16px}:host .size-extra-small .swatch{width:12px;height:12px}:host .size-small.variant-swatch.vega-selection-chip{padding-top:4px;padding-bottom:4px;padding-left:4px;padding-right:12px}:host .size-small.variant-text.vega-selection-chip{padding-left:12px;padding-right:12px;padding-top:4px;padding-bottom:4px}:host .size-small vega-flex{height:24px}:host .size-small .swatch{width:20px;height:20px}:host .size-medium.variant-swatch.vega-selection-chip{padding-top:4px;padding-bottom:4px;padding-left:4px;padding-right:16px}:host .size-medium.variant-text.vega-selection-chip{padding-left:16px;padding-right:16px;padding-top:4px;padding-bottom:4px}:host .size-medium vega-flex{height:32px}:host .size-medium .swatch{width:28px;height:28px}:host .size-large.variant-swatch.vega-selection-chip{padding-top:4px;padding-bottom:4px;padding-left:4px;padding-right:20px}:host .size-large.variant-text.vega-selection-chip{padding-left:20px;padding-right:20px;padding-top:4px;padding-bottom:4px}:host .size-large vega-flex{height:40px}:host .size-large .swatch{width:36px;height:36px}:host .vega-selection-chip:not(.disabled){background-color:rgba(var(--v-bg-tile, 252, 252, 252, 1));border:1px solid rgba(var(--v-border-tile, 171, 198, 216, 1))}:host .vega-selection-chip:not(.disabled):hover{background-color:rgba(var(--v-bg-tile-hover, 245, 247, 247, 1));border:1px solid rgba(var(--v-border-tile-hover, 115, 160, 190, 1))}:host .vega-selection-chip:not(.disabled):focus-visible{background-color:rgba(var(--v-bg-tile, 252, 252, 252, 1));outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:2px;border:1px solid rgba(var(--v-border-tile-focus, 19, 98, 226, 1))}:host .vega-selection-chip:not(.disabled).checked{background-color:rgba(var(--v-bg-tile-selected, 242, 247, 255, 1));border:2px solid rgba(var(--v-border-tile-selected, 19, 98, 226, 1));margin:0px}:host .vega-selection-chip:not(.disabled).checked:hover{background-color:rgba(var(--v-bg-tile-selected-hover, 229, 239, 255, 1));border:2px solid rgba(var(--v-border-tile-selected-hover, 4, 112, 236, 1))}:host .vega-selection-chip:not(.disabled).checked:focus-visible{background-color:rgba(var(--v-bg-tile-selected, 242, 247, 255, 1));border:2px solid rgba(var(--v-border-tile-selected-focus, 19, 98, 226, 1))}:host .vega-selection-chip:not(.disabled).error{background-color:rgba(var(--v-bg-tile, 252, 252, 252, 1));border:1px solid rgba(var(--v-border-input-field-danger, 230, 50, 87, 1))}:host .vega-selection-chip:not(.disabled).error:hover{background-color:rgba(var(--v-bg-tile-hover, 245, 247, 247, 1));border:1px solid rgba(var(--v-border-input-field-danger-hover, 255, 87, 114, 1))}:host .vega-selection-chip:not(.disabled).error:focus-visible{background-color:rgba(var(--v-bg-tile, 252, 252, 252, 1));outline:2px solid rgba(var(--v-border-color-danger, 230, 50, 87, 1));outline-offset:2px;border:1px solid rgba(var(--v-border-input-field-danger-focus, 233, 71, 104, 1))}:host .vega-selection-chip.disabled{background-color:rgba(var(--v-bg-tile, 252, 252, 252, 1));border:1px solid rgba(var(--v-border-input-field-disabled, 222, 225, 227, 1));pointer-events:none;color:rgba(var(--v-text-disabled, 176, 180, 181, 1))}:host .vega-selection-chip.disabled:focus-visible{outline:none}:host .vega-selection-chip.disabled vega-font{color:rgba(var(--v-text-disabled, 176, 180, 181, 1))}:host .vega-selection-chip.disabled .swatch{opacity:0.5}";var P=function(e,t,i,o){var r,s=arguments.length,a=s<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(r=e[l])&&(a=(s<3?r(a):s>3?r(t,i,a):r(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};class $ extends n{getGroupContainerRef(){return this.groupContainerRef}render(){return e("div",null,this.renderLabel(),this.renderContainer(),this.renderHint())}renderLabel(){return e("vega-field-label",{"is-field-required":this.required,disabled:this.disabled,label:this.label})}renderContainer(){return e("div",{class:"container",ref:e=>this.groupContainerRef=e},e("slot",null))}renderHint(){return this.hint&&e("div",{class:"vega-hint"},e("label",null,this.hint))}}P([a()],$.prototype,"host",void 0),P([a()],$.prototype,"label",void 0),P([a()],$.prototype,"required",void 0),P([a()],$.prototype,"hint",void 0),P([a()],$.prototype,"disabled",void 0);var q=function(e,t,i,o){var r,s=arguments.length,a=s<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(r=e[l])&&(a=(s<3?r(a):s>3?r(t,i,a):r(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};class U extends n{watchValue(){this.changeEventEmitter.emit(this.value),j.notify(R,{host:this.host,detail:this.value})}setValue(e){this.valueGuard(e)&&(this.value=e)}valueGuard(e){switch(this.selectType){case"radio":return"string"==typeof e;case"checkbox":return Array.isArray(e)&&e.every((e=>"string"==typeof e));default:return c.warn(`Invalid selection chip group value ${e} for ${this.selectType} mode`),!1}}}q([a()],U.prototype,"host",void 0),q([a({writable:!0})],U.prototype,"value",void 0),q([a()],U.prototype,"changeEventEmitter",void 0),q([a()],U.prototype,"selectType",void 0),q([l("watchValue")],U.prototype,"watchValue",null);var K=function(e,t,i,o){var r,s=arguments.length,a=s<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(r=e[l])&&(a=(s<3?r(a):s>3?r(t,i,a):r(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};class B extends n{constructor(){super(...arguments),this.mutationObserver=new z({target:()=>this.host,options:{childList:!0,subtree:!0,attributes:!0,attributeFilter:["checked"]},mutationFilter:S("VEGA-SELECTION-CHIP"),callback:this.syncChipArrayAndValue.bind(this)}),this.selectionChipArray=[]}disconnectedCallback(){}componentWillLoad(){this.value&&0!==this.value.length||this.syncChipArrayAndValue()}componentDidLoad(){}watchSelectType(){this.syncChipArrayAndValue()}getSelectionChipArray(){return this.selectionChipArray}syncChipArrayAndValue(e){this.selectionChipArray=Array.from(this.host.querySelectorAll("vega-selection-chip")),"checkbox"===this.selectType?this.setValueFromCheckboxItems():this.setValueFromRadioItems(e)}setValueFromCheckboxItems(){const e=this.selectionChipArray.filter((e=>e.checked)).map((e=>e.value));O(this.value,e,!0)||this.valueController.setValue(e)}setValueFromRadioItems(e){const t=this.findAttributeMutation(e);if(t){const e=this.getCurrentChip(t);e&&e.checked&&this.valueController.setValue(e.value)}else{const e=this.getFirstCheckedChip();this.valueController.setValue(e?e.value:"")}}findAttributeMutation(e){return e&&e.find((e=>e.attributeName))}getCurrentChip(e){if(e&&"VEGA-SELECTION-CHIP"===e.target.tagName&&"checked"===e.attributeName)return e.target}getFirstCheckedChip(){return this.selectionChipArray.find((e=>e.checked))}}K([a()],B.prototype,"host",void 0),K([a()],B.prototype,"selectType",void 0),K([a()],B.prototype,"valueController",void 0),K([a()],B.prototype,"value",void 0),K([d()],B.prototype,"mutationObserver",void 0),K([l("disconnectedCallback")],B.prototype,"disconnectedCallback",null),K([l("componentWillLoad")],B.prototype,"componentWillLoad",null),K([l("componentDidLoad")],B.prototype,"componentDidLoad",null),K([l("watchSelectType")],B.prototype,"watchSelectType",null);var J=function(e,t,i,o){var r,s=arguments.length,a=s<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(r=e[l])&&(a=(s<3?r(a):s>3?r(t,i,a):r(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};const Q=class{constructor(e){i(this,e),this.vegaChange=o(this,"vegaChange",7),this.change=o(this,"change",7),this.globalSlimmers={},this.renderer=new $,this.itemsController=new B,this.valueController=new U,this.formFieldController=new I({propertyRules:[{propertyName:"required",ruleFactory:e=>e?new V:null}],validationRulesName:"validationRules",inputContainerGetter:()=>this.renderer.getGroupContainerRef(),touchableAreaGetter:()=>this.itemsController.getSelectionChipArray(),defaultValue:e=>"checkbox"===e.selectType?[]:"",attributeGetter:e=>this[e]}),this.vegaComponentUsageRuntimeMetricsSlimmer=new h,this.changeEventEmitter=C(Q,u),this.valueNotifySlimmer=E(Q,"value","watchValue"),this.disabledNotifySlimmer=E(Q,"disabled","watchDisabled"),this.selectTypeNotifySlimmer=E(Q,"selectType","watchSelectType"),this.changeEventPrevent=new T([u],(()=>this.host),!0),this.label="",this.selectType="radio",this.value="checkbox"===this.selectType?[]:"",this.validationRules=[],this.isValid=null}watchSelectType(){}watchValue(){}watchDisabled(){}watchValidationRules(){}render(){return s(e(t,null,this.renderer.render()),this.host)}get host(){return r(this)}static get watchers(){return{selectType:["watchSelectType"],value:["watchValue"],disabled:["watchDisabled"],validationRules:["watchValidationRules"]}}};J([p()],Q.prototype,"globalSlimmers",void 0),J([d()],Q.prototype,"renderer",void 0),J([d()],Q.prototype,"itemsController",void 0),J([d()],Q.prototype,"valueController",void 0),J([d()],Q.prototype,"formFieldController",void 0),J([d()],Q.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),J([d()],Q.prototype,"changeEventEmitter",void 0),J([d()],Q.prototype,"valueNotifySlimmer",void 0),J([d()],Q.prototype,"disabledNotifySlimmer",void 0),J([d()],Q.prototype,"selectTypeNotifySlimmer",void 0),J([d()],Q.prototype,"changeEventPrevent",void 0),Q.style=':host{display:block}:host vega-field-label{margin-bottom:8px}:host .vega-hint{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px;color:rgba(var(--v-text-secondary, 107, 116, 125, 1));padding-top:4px;padding-left:8px;padding-right:8px}@media screen and (min-width: 768px) and (max-width: 1023px){:host .vega-hint{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .vega-hint{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .vega-hint{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}:host .vega-error{display:block;margin-top:12px;margin-left:8px;margin-right:8px;font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px;color:rgba(var(--v-text-error, 189, 41, 71, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){:host .vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}:host .vega-hidden{display:none}';export{H as vega_selection_chip,Q as vega_selection_chip_group}
@@ -1 +0,0 @@
1
- import{B as e,R as t,a as n,A as s,b as i,I as r,c,d as o,e as a,S as h,M as l,f as w,g as d,h as u,i as p,j as f,k as x,l as m,m as g,n as A,o as N,p as b,N as y,q as k,r as B,s as O,t as j,u as I}from"./p-8246f8ae.js";import{i as S}from"./p-5e2c9e69.js";import{g as v}from"./p-a4670e23.js";class L extends l{constructor(e,t){super(),this.type=w.BREAK_SINGLE_BLOCK,this.startContainerNode=e,this.startOffset=t}}class E extends p{constructor(e){super(e),this.type="image",this.children=[]}static from(e){const t=new E(e.id),{annotations:s}=e;return t.children=e.nodes.map((e=>n.from(e,t))),s&&Object.entries(s).forEach((([e,n])=>{const s=this.createAnnotationEntity(e,n);S(s)&&t.annotationMap.set(...s)})),t}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{type:"image",nodes:this.children.map((e=>e.toJSON()))})}isNotEmpty(){return this.children.length>0&&this.children.some((e=>e.url.length>0))}getLastNode(){return this.children[this.children.length-1]}createNewImageBlock(){return new E(v())}clone(){const e=new E(this.id);return e.children=this.children.map((t=>{const n=t.clone();return n.parent=e,n})),e.annotationMap=super.cloneAnnotations(),e.parent=this.parent,e}}f.register(w.DELETE_BLOCK_CONTENT,E.name,new class extends e{handleAction(e,t){this.deleteNodeContent(e,t)}deleteNodeContent(e,s){const i=e.startContainerNode,r=e.startOffset;let c=this.getPreviousNode(i),o=null;if(1===r){const e=s;this.isContentFirstNode(i)&&(o=this.getNextNode(i)),1===e.children.length?e.parent.apply(new t(e)):e.apply(new t(i))}else{const s=c;s&&s instanceof n&&(c=this.getPreviousNode(s),s.parent.apply(new t(s)),c||(e.nextNode=i))}c?e.previousNode=c:o&&(e.nextNode=o)}}),f.register(w.MERGE_TWO_BLOCKS_NODES,E.name,new x),f.register(w.DELETE_CHILD,E.name,new m),f.register(w.APPEND_CHILD_NODES,E.name,new g),f.register(w.REPLACE_CHILD_NODES,E.name,new A),f.register(w.SPLIT_BLOCK_WITH_NODE,E.name,new class extends s{handleAction(e,t){e.newBlock=this.splitImageNodes(e.splitPointNode,e.startOffsetOfNode,t)}splitImageNodes(e,t,n){const s=n.children.indexOf(e);if(s>-1){const e=n.children.slice(0,s+t),c=n.children.slice(s+t);n.apply(new i(e));const o=this.cloneWithNodes(c,n);return n.parent.apply(new r(n,o)),o}}cloneWithNodes(e,t){const n=t.createNewImageBlock();return n.children=[],n.apply(new c(e)),n}}),f.register(w.BREAK_SINGLE_BLOCK,E.name,new class extends s{handleAction(e,t){e.newBlock=this.breakSingleBlock(e.startContainerNode,e.startOffset,t)}breakSingleBlock(e,t,n){const s=o.from({id:v(),type:"paragraph",nodes:[{id:v(),type:"text",text:""}]});if(this.isCaretPositionAtImageBlockEnd(n,e,t))n.parent.apply(new r(n,s));else{if(!this.isCaretPositionAtImageBlockStart(n,e,t)){const s=new h(e,t);return n.apply(s),s.newBlock}n.parent.apply(new a(n,s))}return s}}),f.register(w.LINE_BREAK_SINGLE_BLOCK,E.name,new class extends s{handleAction(e,t){const n=new L(e.startContainerNode,e.startOffset);t.apply(n);const s=n.newBlock;s&&(e.lineBreakNode=s.children[0])}}),f.register(w.LINE_BREAK_MULTIPLE_BLOCKS,E.name,new class extends s{handleAction(e,t){e.lineBreakNode=this.lineBreakMultipleBlocks(e.selectedBlocks,t)}lineBreakMultipleBlocks(e,t){const n=o.from({id:v(),type:"paragraph",nodes:[{id:v(),type:"text",text:"\n"}]});t.parent.apply(new r(t,n));const s=this.concatBlocksNodes(e.slice(1));return(0===s.length||s[0]&&""===s[0].text)&&s.push(new d(v(),"\n",n)),n.apply(new c(s)),n.children[0]}concatBlocksNodes(e){const n=[];return e.map((e=>{"image"!==e.type&&(n.push(...e.children),e.parent.apply(new t(e)))})),n}}),f.register(w.INSERT_IMAGE_TO_BLOCK,E.name,new class extends s{handleAction(e,t){const n=e.splitPointNode,s=e.startOffsetOfNode,i=e.imageBlockToBeInserted;t.children.length<1?t.apply(new c(i.children)):this.isCaretPositionAtImageBlockEnd(t,n,s)?t.parent.apply(new r(t,i)):this.isCaretPositionAtImageBlockStart(t,n,s)?t.parent.apply(new a(t,i)):(t.apply(new h(n,s)),t.parent.apply(new r(t,i)))}}),f.register(w.INSERT_NODES_BEFORE,E.name,new N),f.register(w.INSERT_NODES_AFTER,E.name,new class extends u{handleAction(e,t){const n=e.referNode,s=[n,...e.nodesToBeInserted];this.replaceNodeWithNodes(t,n,s)}});class J extends o{constructor(e,t){super(e,"list-item"),this.nestList=[],this.nestList=t}static from(e){const t=new J(e.id);t.children=e.nodes.map((e=>d.from(e,t))),e.children&&(t.nestList=e.children.map((e=>{const n=V.from(e);return n.parent=t,n})));const{annotations:n}=e;return n&&Object.entries(n).forEach((([e,n])=>{const s=this.createAnnotationEntity(e,n);S(s)&&t.annotationMap.set(...s)})),t}toJSON(){var e;return Object.assign(Object.assign({},super.toJSON()),{type:"list-item",children:null===(e=this.nestList)||void 0===e?void 0:e.map((e=>e.toJSON()))})}cloneWithNodes(e){const t=new J(v());return t.children=[],t.apply(new c(e)),t}getLastNode(){return this.nestList&&this.nestList.length>0?this.nestList[this.nestList.length-1].getLastNode():super.getLastNode()}createNewListItem(){return new J(v())}clone(){var e;const t=new J(this.id);return t.children=this.children.map((e=>{const n=e.clone();return n.parent=t,n})),t.annotationMap=super.cloneAnnotations(),t.nestList=null===(e=this.nestList)||void 0===e?void 0:e.map((e=>{const n=e.clone();return n.parent=t,n})),t.parent=this.parent,t}}f.register(w.DELETE_BLOCK_CONTENT,J.name,new class extends b{handleAction(e,n){const s=n.parent;this.deleteNodeContent(e,n),0===s.children.length&&s.parent.apply(new t(s))}}),f.register(w.LINE_BREAK_SINGLE_BLOCK,J.name,new k),f.register(w.LINE_BREAK_MULTIPLE_BLOCKS,J.name,new B),f.register(w.DELETE_CHILD,J.name,new class extends s{handleAction(e,n){n.children=n.children.filter((t=>t!==e.entityToBeRemoved)),0!==n.children.length||n.nestList&&n.nestList.length||n.parent.apply(new t(n))}}),f.register(w.DELETE_NEST_LIST,J.name,new class extends s{handleAction(e,t){t.nestList&&(t.nestList=t.nestList.length>1?t.nestList.filter((t=>t!==e.nestListBlockToBeRemoved)):void 0)}}),f.register(w.APPEND_CHILD_NODES,J.name,new g),f.register(w.SPLIT_BLOCK_WITH_NODE,J.name,new O),f.register(w.REPLACE_CHILD_NODES,J.name,new A),f.register(w.REPLACE_NEST_LIST,J.name,new class extends s{handleAction(e,t){e.newList.forEach((e=>{e.parent=t})),t.nestList=e.newList}}),f.register(w.MERGE_TWO_BLOCKS_NODES,J.name,new x),f.register(w.BREAK_SINGLE_BLOCK,J.name,new class extends s{handleAction(e,t){e.newBlock=this.breakSingleListItemBlock(e.startContainerNode,e.startOffset,t)}breakSingleListItemBlock(e,t,n){const s=n.createNewListItem(),i=this.copyInlineStyleToNewNode(e);if(s.apply(new c([i])),this.isCaretPositionAtTextBlockEnd(n,e,t))return this.breakListItemAtEnd(s,n);if(!this.isCaretPositionAtTextBlockStart(n,e,t)){const s=new h(e,t);return n.apply(s),s.newBlock}return n.parent.apply(new a(n,s)),s}breakListItemAtEnd(e,n){const s=n.parent.children[n.parent.children.length-1],i=1===n.children.length&&n.children[0].isEmpty();if(n===s&&i){const s=n.parent.parent;if("list-item"!==s.type){const i=o.from({id:v(),type:"paragraph",nodes:[]});return i.apply(new c(e.children)),s.apply(new r(n.parent,i)),n.parent.apply(new t(n)),i}s.parent.apply(new r(s,e)),n.parent.apply(new t(n))}else n.parent.apply(new r(n,e));return e}copyInlineStyleToNewNode(e){const t=e.cloneWithText("");return t.annotationMap.delete(y.LINK),t}}),f.register(w.INSERT_IMAGE_TO_BLOCK,J.name,new class extends s{handleAction(e,t){t.parent.apply(e)}}),f.register(w.INSERT_NODES_BEFORE,J.name,new N);class C extends s{handleAction(e,t){this.replaceBlockWithBlocks(t,e.referBlock,[...e.blocksToBeInserted,e.referBlock])}replaceBlockWithBlocks(e,t,n){e.children&&(n.forEach((t=>{t.parent=e})),e.children=e.children.flatMap((e=>e===t?n:e)))}}class W extends C{handleAction(e,t){this.replaceBlockWithBlocks(t,e.referBlock,[e.referBlock,...e.blocksToBeInserted])}}class M extends s{handleAction(e,t){const n=e.entityToBeAppended;t.children&&(n.forEach((e=>{e.parent=t})),t.children=t.children.concat(n))}}class R extends l{constructor(e){super(),this.type=w.DELETE_NEST_LIST,this.nestListBlockToBeRemoved=e}}class T extends s{handleAction(e,t){const n=e.entityToBeRemoved;t.children&&(t.children=t.children.filter((e=>e!==n)))}}class V extends p{constructor(e,t){super(e),this.type="bullet-list",this.children=[],this.type=t}static from(e){const t=new V(e.id,e.type);return t.children=e.blocks.map((e=>{const n=J.from(e);return n.parent=t,n})),t}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{id:this.id,type:this.type,blocks:this.children.map((e=>e.toJSON()))})}isNotEmpty(){return this.children.length>0}getLastNode(){return this.children[this.children.length-1].getLastNode()}clone(){const e=new V(this.id,this.type);return e.children=this.children.map((t=>{const n=t.clone();return n.parent=e,n})),e.annotationMap=super.cloneAnnotations(),e.parent=this.parent,e}}f.register(w.DELETE_CHILD,V.name,new class extends T{handleAction(e,n){super.handleAction(e,n);const s=n.parent;0===n.children.length&&s&&s.apply("list-item"===s.type?new R(n):new t(n))}}),f.register(w.INSERT_BLOCKS_BEFORE,V.name,new C),f.register(w.INSERT_BLOCKS_AFTER,V.name,new W),f.register(w.APPEND_CHILD_NODES,V.name,new M),f.register(w.TRANSFORM_LIST_BLOCK,V.name,new class extends s{handleAction(e,n){const s=e.selectedBlocks,i=n.parent.createList(e.listType);if(s.every((e=>e.parent===n)))i.apply(new c(n.children)),n.parent.apply(new r(n,i)),n.parent.apply(new t(n)),s.forEach((e=>e.children.map((e=>e.apply(new j)))));else{const s=e.selectedBlocks.map((e=>n.parent.toListItem(e)));i.apply(new c(s)),n.parent.apply(new r(n,i)),e.selectedBlocks.forEach((e=>{e.parent.apply(new t(e))})),0===n.children.length&&n.parent.apply(new t(n))}}}),f.register(w.TRANSFORM_PARAGRAPH_BLOCK,V.name,new class extends s{handleAction(e,n){let s=!1,i=!1;const o=e.selectedBlocks,h=o.map((e=>(e.children.map((e=>e.apply(new j))),e===n.children[0]&&(s=!0),e===n.children[n.children.length-1]&&(i=!0),this.toParagraph(e))));if(s)n.parent.apply(new a(n,...h));else if(i)n.parent.apply(new r(n,...h));else{const e=n.children.indexOf(o[0]),s=n.children.indexOf(o[o.length-1]),i=n.parent.createList(n.type);i.apply(new c(n.children.slice(0,e)));const r=n.parent.createList(n.type);r.apply(new c(n.children.slice(s+1))),n.parent.apply(new a(n,i,...h,r)),n.parent.apply(new t(n))}o.map((e=>{n.apply(new t(e))})),0===n.children.length&&n.parent.apply(new t(n))}toParagraph(e){const t=new o(v(),"paragraph");return t.apply(new c(e.children)),t.annotationMap=e.annotationMap,t}}),f.register(w.INSERT_IMAGE_TO_BLOCK,V.name,new class extends s{handleAction(e,t){t.parent.apply("list-item"!==t.parent.type?new r(t,e.imageBlockToBeInserted):e)}});class q{constructor(e){e.forEach((e=>{e.parent=this})),this.children=e}static fromJSON(e){const t=e.map((e=>{switch(e.type){case"paragraph":case"title":case"subtitle":case"heading-1":case"heading-2":case"heading-3":return o.from(e);case"image":return E.from(e);case"bullet-list":case"number-list":return V.from(e);case"code-block":return I.from(e);default:throw new Error(`[Vega] Unknown block type: ${e.type}`)}}));return new q(t)}static createEmptyContent(){return q.fromJSON([{id:v(),type:"paragraph",nodes:[{id:v(),type:"text",text:""}]}])}clone(e=!1){return new q(e?this.children.map((e=>e.clone())):[...this.children])}toJSON(){return this.children.map((e=>e.toJSON()))}apply(e){f.executeTheStrategy(e,this)}toListItem(e){e.children.map((e=>e.apply(new j)));const t=new J(v());return t.apply(new c(e.children)),t.annotationMap=e.annotationMap,t}createList(e){return new V(v(),e)}findNodeById(e){return this.findNodeInBlocksById(e,this.children)}findNodeInBlocksById(e,t){for(const n of t){if("children"in n)for(const t of n.children)if(t.id===e)return t;if(n instanceof J&&n.nestList)for(const t of n.nestList){const n=this.findNodeInBlocksById(e,t.children);if(n)return n}if(n instanceof V&&n.children){const t=this.findNodeInBlocksById(e,n.children);if(t)return t}}return null}}f.register(w.DELETE_CHILD,q.name,new T),f.register(w.APPEND_CHILD_NODES,q.name,new M),f.register(w.INSERT_BLOCKS_BEFORE,q.name,new C),f.register(w.INSERT_BLOCKS_AFTER,q.name,new W),f.register(w.TRANSFORM_TO_CODE_BLOCK,q.name,new class extends s{handleAction(e,t){const n=e.selectedBlocks,s=new I(v(),this.getCodeContent(n),"plainText");t.apply(new a(n[0],s)),e.newCodeBlock=s,this.removeSelectBlocks(n,t)}getCodeContent(e){return e.filter((e=>"image"!==e.type&&"list-item"!==e.type)).map((e=>e.children.map((e=>e.text)).join(""))).join("\n")}removeSelectBlocks(e,n){for(let s=0;s<e.length;s++)n.apply(new t(e[s]))}});export{L as B,E as R,q as V,J as a,V as b}
@@ -1 +0,0 @@
1
- import{r as t,h as o,H as e,g as i}from"./p-21d26bb4.js";import{s}from"./p-519a7d55.js";import{j as r,f as d,k as l}from"./p-aed3320d.js";import{a as n}from"./p-d5776087.js";import{c as a,M as h,V as c,I as p}from"./p-6e1ab235.js";import{V as b,I as m}from"./p-d849e0f5.js";import{R as v}from"./p-fb8c99c5.js";import{P as g}from"./p-7d9cd9c8.js";import{f}from"./p-79a0a06c.js";import"./p-5e2c9e69.js";import"./p-ed45b3b6.js";import"./p-74168615.js";import"./p-3a0a4d15.js";import"./p-d884c644.js";import"./p-49fd1009.js";import"./p-262ec334.js";import"./p-0c667d6a.js";import"./p-d27ae9ff.js";import"./p-5f377954.js";import"./p-bcdb235d.js";import"./p-a4670e23.js";import"./p-6a334573.js";import"./p-0c8bd757.js";import"./p-5773a9a3.js";import"./p-2d0d575f.js";import"./p-331a62d5.js";import"./p-112455b1.js";import"./p-613ee009.js";import"./p-6e01f0a2.js";import"./p-e77a83e4.js";import"./p-db8cdba6.js";import"./p-8c46e116.js";import"./p-5d676a94.js";import"./p-9d6003ef.js";import"./p-53e9595f.js";import"./p-8246f8ae.js";import"./p-65d8c2bc.js";import"./p-b75ee3ba.js";var y=function(t,o,e,i){var s,r=arguments.length,d=r<3?o:null===i?i=Object.getOwnPropertyDescriptor(o,e):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)d=Reflect.decorate(t,o,e,i);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(d=(r<3?s(d):r>3?s(o,e,d):s(o,e))||d);return r>3&&d&&Object.defineProperty(o,e,d),d};class w extends c{componentWillLoad(){this.appendAllStateStyles()}watchBorder(){this.appendStateStyles(this.border,"border"),this.makeBorderColorAfterBorder()}watchShadow(){this.appendStateStyles(this.shadow,"shadow")}watchBorderColor(){this.appendStateStyles(this.borderColor,"borderColor"),this.makeBorderColorAfterBorder()}watchBackgroundColor(){this.appendStateStyles(this.backgroundColor,"backgroundColor")}appendStateStyles(t,o){var e;if(null===(e=this.host.shadowRoot.querySelector(`style#state-styles-${o}`))||void 0===e||e.remove(),r(t,o)){const e=document.createElement("style");e.setAttribute("id",`state-styles-${o}`),e.innerHTML=r(t,o),this.host.shadowRoot.append(e)}}makeBorderColorAfterBorder(){const t=this.host.shadowRoot.querySelector("style#state-styles-borderColor"),o=this.host.shadowRoot.querySelector("style#state-styles-border");t&&o&&o.after(t)}appendAllStateStyles(){this.appendStateStyles(this.backgroundColor,"backgroundColor"),this.appendStateStyles(this.border,"border"),this.appendStateStyles(this.borderColor,"borderColor"),this.appendStateStyles(this.shadow,"shadow")}}y([a()],w.prototype,"host",void 0),y([a()],w.prototype,"backgroundColor",void 0),y([a()],w.prototype,"borderColor",void 0),y([a()],w.prototype,"border",void 0),y([a()],w.prototype,"shadow",void 0),y([h("componentWillLoad")],w.prototype,"componentWillLoad",null),y([h("watchBorder")],w.prototype,"watchBorder",null),y([h("watchShadow")],w.prototype,"watchShadow",null),y([h("watchBorderColor")],w.prototype,"watchBorderColor",null),y([h("watchBackgroundColor")],w.prototype,"watchBackgroundColor",null);var j=function(t,o,e,i){var s,r=arguments.length,d=r<3?o:null===i?i=Object.getOwnPropertyDescriptor(o,e):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)d=Reflect.decorate(t,o,e,i);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(d=(r<3?s(d):r>3?s(o,e,d):s(o,e))||d);return r>3&&d&&Object.defineProperty(o,e,d),d};class u extends c{constructor(){super(...arguments),this.paddingStyleRef=null,this.marginStyleRef=null,this.cornersStyleRef=null}setDefaultStyle(){this.generatePaddingStyle(),this.generateMarginStyle(),this.generateCornersStyle()}generatePaddingStyle(){const t=d(this.padding,"paddingStyle");this.attachStyle("padding",t)}generateMarginStyle(){const t=d(this.margin,"marginStyle");this.attachStyle("margin",t)}generateCornersStyle(){const t=d(this.corners,"cornersStyle");this.attachStyle("corners",t)}attachStyle(t,o){if(o){const e=`${t}StyleRef`,i=this.host.shadowRoot;this[e]||(this[e]=document.createElement("style"),i.appendChild(this[e])),this[e].innerHTML=o}}}j([a()],u.prototype,"host",void 0),j([a()],u.prototype,"padding",void 0),j([a()],u.prototype,"margin",void 0),j([a()],u.prototype,"corners",void 0),j([h("componentWillLoad")],u.prototype,"setDefaultStyle",null),j([h("watchPaddingChange")],u.prototype,"generatePaddingStyle",null),j([h("watchMarginChange")],u.prototype,"generateMarginStyle",null),j([h("watchCornersChange")],u.prototype,"generateCornersStyle",null);var k=function(t,o,e,i){var s,r=arguments.length,d=r<3?o:null===i?i=Object.getOwnPropertyDescriptor(o,e):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)d=Reflect.decorate(t,o,e,i);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(d=(r<3?s(d):r>3?s(o,e,d):s(o,e))||d);return r>3&&d&&Object.defineProperty(o,e,d),d};const C=class{constructor(o){t(this,o),this.globalSlimmers={},this.pageResizeSlimmer=new g,this.stateStyleController=new w,this.vegaComponentUsageRuntimeMetricsSlimmer=new b,this.responsiveStyleController=new u}watchPaddingChange(){}watchMarginChange(){}watchBorder(){}watchShadow(){}watchBorderColor(){}watchBackgroundColor(){}watchCornersChange(){}render(){const t=[d(this.padding,"padding"),d(this.margin,"margin"),d(this.display,"boxDisplay"),d(this.corners,"corners"),l(this.borderStyle),v.formatCustom(this.responsiveClass)],i=Object.assign({width:d(this.width,"widthAndHeight"),height:d(this.height,"widthAndHeight"),minHeight:d(this.minHeight,"widthAndHeight"),maxHeight:d(this.maxHeight,"widthAndHeight"),order:this.order&&`${v.formatCustom(this.order)}`,alignSelf:this.alignSelf&&`${v.formatCustom(this.alignSelf)}`,justifySelf:this.justifySelf&&`${v.formatCustom(this.justifySelf)}`},f(this.flex,this.flexGrow,this.flexShrink,this.flexBasis));return this.gridArea?i.gridArea=`${v.formatCustom(this.gridArea)}`:(i.gridColumn=this.gridColumn&&`${v.formatCustom(this.gridColumn)}`,i.gridRow=this.gridRow&&`${v.formatCustom(this.gridRow)}`),s(o(e,{style:i,class:n(t)},o("slot",null)),this.host)}get host(){return i(this)}static get watchers(){return{padding:["watchPaddingChange"],margin:["watchMarginChange"],border:["watchBorder"],shadow:["watchShadow"],borderColor:["watchBorderColor"],backgroundColor:["watchBackgroundColor"],corners:["watchCornersChange"]}}};k([m()],C.prototype,"globalSlimmers",void 0),k([p()],C.prototype,"pageResizeSlimmer",void 0),k([p()],C.prototype,"stateStyleController",void 0),k([p()],C.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),k([p()],C.prototype,"responsiveStyleController",void 0),C.style=":host(.v-block),.v-block{display:block}:host(.v-inline-block),.v-inline-block{display:inline-block}:host(.v-hidden),.v-hidden{display:none}@media (min-width: 320px){:host(.S\\:v-block),.S\\:v-block{display:block}:host(.S\\:v-inline-block),.S\\:v-inline-block{display:inline-block}:host(.S\\:v-hidden),.S\\:v-hidden{display:none}}@media (min-width: 768px){:host(.M\\:v-block),.M\\:v-block{display:block}:host(.M\\:v-inline-block),.M\\:v-inline-block{display:inline-block}:host(.M\\:v-hidden),.M\\:v-hidden{display:none}}@media (min-width: 1024px){:host(.L\\:v-block),.L\\:v-block{display:block}:host(.L\\:v-inline-block),.L\\:v-inline-block{display:inline-block}:host(.L\\:v-hidden),.L\\:v-hidden{display:none}}@media (min-width: 1440px){:host(.XL\\:v-block),.XL\\:v-block{display:block}:host(.XL\\:v-inline-block),.XL\\:v-inline-block{display:inline-block}:host(.XL\\:v-hidden),.XL\\:v-hidden{display:none}}:host(.v-border-solid),.v-border-solid{border-style:solid}:host(.v-border-dashed),.v-border-dashed{border-style:dashed}:host(.v-border-dotted),.v-border-dotted{border-style:dotted}:host(.v-border-double),.v-border-double{border-style:double}:host(.v-border-none),.v-border-none{border-style:none}:host{display:block}";export{C as vega_box}
@@ -1 +0,0 @@
1
- import{h as t,r as e,c as i,H as n,g as a}from"./p-21d26bb4.js";import{I as r}from"./p-abd7aeaa.js";import{M as s,a as o}from"./p-4e68dfd9.js";import{M as p,a as l}from"./p-cdbbdcc2.js";import{R as h}from"./p-280cbcdb.js";import{s as d}from"./p-519a7d55.js";import{c as u}from"./p-86194314.js";import{C as c}from"./p-75b58efe.js";import{c as f,V as x,M as g,I as m}from"./p-6e1ab235.js";import{s as v}from"./p-6bd5c49b.js";import{V as b,I as w}from"./p-d849e0f5.js";import{F as y}from"./p-6e1b5949.js";import{c as j}from"./p-012cbd8f.js";import{f as I,A as C,B as z,s as k}from"./p-6e01f0a2.js";import{b as S}from"./p-5773a9a3.js";import{C as R}from"./p-2d0d575f.js";import{S as N,a as T,b as E}from"./p-b8d7d4a9.js";import{i as A}from"./p-5e2c9e69.js";import{D as O}from"./p-e7b00bf0.js";import{P as D}from"./p-7d9cd9c8.js";import{S as F}from"./p-ecd032fc.js";import{i as V}from"./p-d27ae9ff.js";import{d as $}from"./p-47a4c625.js";import"./p-262ec334.js";import"./p-0bb29d98.js";import"./p-331a62d5.js";import"./p-d5776087.js";import"./p-a4670e23.js";import"./p-6a334573.js";import"./p-65d8c2bc.js";import"./p-9d6003ef.js";import"./p-78a57a17.js";import"./p-52b8f2d2.js";import"./p-613ee009.js";import"./p-b75ee3ba.js";import"./p-51297b96.js";import"./p-5d676a94.js";import"./p-ed45b3b6.js";import"./p-74168615.js";import"./p-3a0a4d15.js";import"./p-d884c644.js";const L=/^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)])$/;class M extends r{evaluate(t){if(!this.isAcceptedInputType(t))throw new Error(`Unexpected type of input: ${typeof t}: ${t}`);const e=L.test(t.toLowerCase());return{isValid:e,message:e?"":"Please enter the correct email format."}}canEvaluate(t,e){return e?this.isAcceptedInputType(t)&&!e.disabled&&e.visible:this.isAcceptedInputType(t)}shouldShowError(t){return!t.disabled&&t.visible&&(t.touched||t.modified)}isAcceptedInputType(t){return"string"==typeof t&&t.length>0}}class P extends x{getCopyPasteProps(){return this.disableCopyPaste?{onCopy:this.preventDefault,onCut:this.preventDefault,onPaste:this.preventDefault}:{}}preventDefault(t){t.preventDefault()}}!function(t,e,i,n){var a,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(s=(r<3?a(s):r>3?a(e,i,s):a(e,i))||s);r>3&&s&&Object.defineProperty(e,i,s)}([f()],P.prototype,"disableCopyPaste",void 0);var _=function(t,e,i,n){var a,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(s=(r<3?a(s):r>3?a(e,i,s):a(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};class B extends x{render(){const e=this.hasPrefixSlot();if(this.prefixIcon||e)return t("div",{class:{"vega-input-prefix":!0,"vega-input-prefix-slot":e},part:"prefix-icon-container"},this.prefixIcon&&!e?t("vega-icon",{icon:this.prefixIcon,size:"size-16"}):null,t("slot",{name:"prefix-icon"}))}hasPrefixSlot(){return!!this.host.querySelector('[slot="prefix-icon"]')}}_([f()],B.prototype,"host",void 0),_([f()],B.prototype,"prefixIcon",void 0);class U extends N{format(t){if(!t.length)return t;const e=Number(t.replace(/,/g,""));return!isNaN(e)&&e<=Number.MAX_SAFE_INTEGER?e.toLocaleString("en-US"):t}calculateCaretPosition(t,e){const i=this.format(t),n=t.substring(0,e),a=i.substring(0,e),r=(n.match(/,/g)||[]).length;return e+((a.match(/,/g)||[]).length-r)}}class W extends N{constructor(t){super(),this.maskConfig={allowNegative:!0},this.skipFormat=t=>this.maskConfig.allowNegative&&"-"===t||null!=this.maskConfig.precision&&this.maskConfig.precision>0&&t.split(".").length-1==1&&t.endsWith(".")&&!t.startsWith("."),this.maskConfig=Object.assign(Object.assign({},this.maskConfig),t),this.mask=new RegExp(this.getRegExp())}format(t){const e=this.redressAbnormalNumber(t);if(this.skipFormat(e))return e;const i=[...e];for(let t=e.length-1;t>=0;t--){const t=i.join("");this.inputNeedFormat(t)&&i.pop()}return i.join("")}calculateCaretPosition(t,e){if(A(e)){const i=this.redressAbnormalNumber(t);return e-(t.length-i.length)}}inputNeedFormat(t){return!this.mask.test(t)}redressAbnormalNumber(t){let e=t.replace(/^0+(?!$)/,"");return e.startsWith(".")&&(e=`0${e}`),e}getRegExp(){const t=this.maskConfig.allowNegative?"(\\-)?":"";let e;return e=0===this.maskConfig.precision?`^${t}(0|[1-9][0-9]*)$`:this.maskConfig.precision&&this.maskConfig.precision>0?`^${t}(0|0\\.\\d{1,${this.maskConfig.precision}}|[1-9][0-9]*(\\.\\d{1,${this.maskConfig.precision}})?)$`:`^${t}(0|0\\.\\d*|[1-9][0-9]*(\\.\\d*)?)$`,e}}class K extends N{constructor(t,e=!1){super(),this.resetCaretPositionFlag=!1,this.formatter=t,this.resetCaretPositionFlag=e}format(t){return this.formatter(t)}calculateCaretPosition(t,e){if(!0===this.resetCaretPositionFlag)return this.format(t).length;if(A(e)){const i=t.substring(0,e);return e+(this.format(i).length-i.length)}}shouldTriggerAtInit(){return!0}}class q extends W{constructor(t){super(t)}format(t){const e=this.redressAbnormalNumber(t);if(this.skipFormat(e))return e;const i=[...e];for(let t=e.length-1;t>=0;t--){const t=i.join("");this.inputNeedFormat(t.replace(/,/g,""))&&i.pop()}return this.thousandCommaFormat(i.join(""))}calculateCaretPosition(t,e){const i=this.redressAbnormalNumber(t),n=this.format(t),a=t.substring(0,e),r=n.substring(0,e),s=(a.match(/,/g)||[]).length;return e+((r.match(/,/g)||[]).length-s)-(t.length-i.length)}thousandCommaFormat(t){if(!t.length)return t;const e=t.replace(/[^\d.-]/g,""),i=e.indexOf("."),n=e.length>1&&i>=1?e.slice(i):"",a=Number(e.split(".")[0]);return!isNaN(a)&&a<=Number.MAX_SAFE_INTEGER?a.toLocaleString("en-US")+n:e}}var G=function(t,e,i,n){var a,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(s=(r<3?a(s):r>3?a(e,i,s):a(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};class H extends T{constructor(){super(...arguments),this.getInputElementRef=()=>this.inputRef,this.getInputModeStrategy=()=>this.generateMaskStrategy("input"),this.getBlurModeStrategy=()=>this.generateMaskStrategy("blur")}setupStringFormatter(t){this.inputRef=t,this.setup()}generateMaskStrategy(t){let e=null;Array.isArray(this.maskConfig)?e=this.maskConfig.find((e=>"blur"===t?this.isBlurModeMaskConfig(e):!this.isBlurModeMaskConfig(e))):this.maskConfig&&("blur"===t&&this.isBlurModeMaskConfig(this.maskConfig)?e=this.maskConfig:"input"!==t||this.isBlurModeMaskConfig(this.maskConfig)||(e=this.maskConfig));let i=null;switch(null==e?void 0:e.type){case"phone":i=E.PHONE_MASK;break;case"taxId":i=E.TAX_ID_MASK;break;case"zipcode":i=E.ZIPCODE_MASK;break;case"thousand-comma":i=new U;break;case"number":i=this.getNumberTypeMaskStrategy(e.options);break;case"custom":i=new E(e.options);break;case"custom-formatter":i=new K(e.formatter,e.resetCaretPosition)}return"number"!==this.type||"input"!==t||e||(i=new W),i}getNumberTypeMaskStrategy(t){return t&&t.thousandComma?new q(t):new W(t)}isBlurModeMaskConfig(t){return"custom"===t.type&&"blur"===t.trigger}}G([f()],H.prototype,"maskConfig",void 0),G([f()],H.prototype,"disableCopyPaste",void 0),G([f()],H.prototype,"type",void 0);const J=[{payloadKey:"AUTO_VALIDATION_IS_TRUE",payloadDescription:"Determines whether the input field should undergo automatic validation during the user's input",payloadValue:t=>!0===t.autoValidation},{payloadKey:"AUTO_VALIDATION_IS_FALSE",payloadDescription:"Determines whether the input field should undergo automatic validation during the user's input",payloadValue:t=>!1===t.autoValidation},{payloadKey:"EMAIL_IS_TRUE",payloadDescription:"@deprecated Enforces proper email format validation for the input field.",payloadValue:t=>!0===t.email},{payloadKey:"EMAIL_IS_FALSE",payloadDescription:"@deprecated Enforces proper email format validation for the input field.",payloadValue:t=>!1===t.email}];var Q=function(t,e,i,n){var a,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(s=(r<3?a(s):r>3?a(e,i,s):a(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};class X extends x{componentDidLoad(){this.setInputAutoWidth()}watchValue(){this.setInputAutoWidth()}watchSuffixText(){this.setInputAutoWidth()}setInputAutoWidth(){const t=this.host.shadowRoot.querySelector(".vega-input-container"),e=null==t?void 0:t.querySelector(".vega-input-input"),i=null==e?void 0:e.querySelector("input");if(i&&(t.classList.remove("auto-width"),i.style.removeProperty("width"),this.isCompactInputWidth&&this.suffixText)){const n=this.getActualInputWidth();e.getBoundingClientRect().width>n&&(i.style.width=`${n}px`,t.classList.add("auto-width"))}}getActualInputWidth(){const t=this.getCalculateTextWidthContainer();t.style.display="inline-block",t.textContent=`${this.value||this.placeholder||""}`;const e=t.getBoundingClientRect().width;return t.style.display="none",e}getCalculateTextWidthContainer(){if(!this.calculateTextWidthContainer){const t=document.createElement("div");t.classList.add("v-font-field-value"),t.style.visibility="hidden",t.style.display="none",this.host.shadowRoot.append(t),this.calculateTextWidthContainer=t}return this.calculateTextWidthContainer}}Q([f()],X.prototype,"host",void 0),Q([f()],X.prototype,"value",void 0),Q([f()],X.prototype,"placeholder",void 0),Q([f()],X.prototype,"isCompactInputWidth",void 0),Q([f()],X.prototype,"suffixText",void 0),Q([g("componentDidLoad")],X.prototype,"componentDidLoad",null),Q([g("watchValue")],X.prototype,"watchValue",null),Q([g("watchSuffixText")],X.prototype,"watchSuffixText",null);var Y=function(t,e,i,n){var a,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(s=(r<3?a(s):r>3?a(e,i,s):a(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};class Z extends F{constructor(){super({parent:"vega-input-numeric",subStates:[{subStateName:"prefixText",parentStateName:"prefixText"},{subStateName:"suffixText",parentStateName:"suffixText"},{subStateName:"isCompactInputWidth",parentStateName:"isCompactInputWidth"}]})}}Y([f()],Z.prototype,"host",void 0),Y([f({writable:!0})],Z.prototype,"prefixText",void 0),Y([f({writable:!0})],Z.prototype,"suffixText",void 0),Y([f({writable:!0})],Z.prototype,"isCompactInputWidth",void 0);var tt=function(t,e,i,n){var a,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(s=(r<3?a(s):r>3?a(e,i,s):a(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};const et=class{constructor(n){e(this,n),this.vegaChange=i(this,"vegaChange",7),this.change=i(this,"change",7),this.vegaBlur=i(this,"vegaBlur",7),this.blur=i(this,"blur",7),this.vegaFocus=i(this,"vegaFocus",7),this.focus=i(this,"focus",7),this.vegaLabelButtonClick=i(this,"vegaLabelButtonClick",7),this.labelButtonClick=i(this,"labelButtonClick",7),this.globalSlimmers={},this.formFieldController=new y({propertyRules:[{propertyName:"required",ruleFactory:t=>t?new h:null},{propertyName:"min",ruleFactory:t=>"number"==typeof t?new s({minValue:t}):null},{propertyName:"max",ruleFactory:t=>"number"==typeof t?new o({maxValue:t}):null},{propertyName:"minLength",ruleFactory:t=>t?new p({minStrLength:t}):null},{propertyName:"maxLength",ruleFactory:t=>t?new l({maxStrLength:t}):null},{propertyName:"email",ruleFactory:t=>t?new M:null},{propertyName:"type",ruleFactory:t=>"email"===t?new M:null}],validationRulesName:"validationRules",defaultValue:"",attributeGetter:t=>this[t],inputContainerGetter:()=>this.inputContainerRef,touchableAreaGetter:()=>[this.inputRef]}),this.pageResizeObserverSlimmer=new D({callback:()=>this.compactWidthController.setInputAutoWidth()}),this.copyPasteController=new P,this.compactWidthController=new X,this.stateController=new Z,this.maskConfigController=new H,this.prefixSlotRenderer=new B,this.changeEventEmitter=j(et,I),this.focusEventEmitter=j(et,C),this.blurEventEmitter=j(et,z),this.labelButtonClickEventEmitter=j(et,k),this.vegaComponentUsageRuntimeMetricsSlimmer=new b(J),this.label="",this.labelSuffixButtonProps=null,this.value="",this.valueUpdateTrigger="input",this.type="text",this.name="",this.autocomplete="off",this.email=!1,this.required=!1,this.min=null,this.max=null,this.minLength=null,this.maxLength=null,this.showClearIcon=!0,this.isValid=null,this.autoValidation=!0,this.validationRules=[],this.size="default",this.disabled=!1,this.hint="",this.disableCopyPaste=!1,this.focusInput=()=>{this.inputRef.focus()},this.setInputRef=t=>{t&&this.inputRef!==t&&(this.inputRef=t,this.maskConfigController.setupStringFormatter(t))},this.renderPrefixText=()=>this.prefixText&&t("div",{class:"prefix-text"},this.prefixText),this.renderSuffixText=()=>this.suffixText&&t("div",{class:"suffix-text"},this.suffixText),this.handleInputFocus=t=>{this.focusEventEmitter.emit(void 0,t)},this.handleInputBlur=t=>{this.blurEventEmitter.emit(void 0,t)},this.onClickClearIcon=()=>{this.value=""},this.isClearIconVisible=()=>!this.disabled&&Boolean(this.value),this.onClearInputFocus=()=>{this.inputContainerRef.classList.add("no-focus")},this.onClearInputBlur=()=>{this.inputContainerRef.classList.remove("no-focus")},this.onInputHandler=t=>{"change"!==this.valueUpdateTrigger&&(this.value=t.target.value)},this.inputChangeHandler=t=>{"change"===this.valueUpdateTrigger&&(this.value=t.target.value)},this.handleLabelButtonClick=()=>{this.labelButtonClickEventEmitter.emit()}}watchSuffixText(){}watchValue(t){this.changeEventEmitter.emit(t),this.inputRef.value!==this.value&&(this.inputRef.value=this.value),R.notify(S,{host:this.host,detail:this.value})}watchTypeChange(t,e){"number"!==t&&"number"!==e||this.maskConfigController.setupStringFormatter(this.inputRef)}watchValidationRules(){}watchMaskChange(t,e){this.areMaskConfigsEqual(t,e)||this.maskConfigController.setupStringFormatter(this.inputRef)}async doFocus(){this.focusInput()}async doBlur(){this.inputRef.blur()}render(){return v(t("slot",null)),d(t(n,{class:"hidden"===this.type?"vega-input-hidden":"vega-input-inline-block"},this.groupDom()),this.host)}containerDom(){return t("div",{class:"vega-input-input"},t("input",Object.assign({part:"input",name:this.name,type:"number"===this.type?"text":this.type,autoComplete:this.autocomplete,value:this.value,ref:this.setInputRef,placeholder:this.placeholder,disabled:this.disabled,"aria-label":this.label||"No label defined",minLength:this.minLength,maxLength:this.maxLength,onBlur:t=>this.handleInputBlur(t),onFocus:t=>this.handleInputFocus(t),onChange:this.inputChangeHandler,onInput:this.onInputHandler},this.copyPasteController.getCopyPasteProps())))}groupDom(){let e="vega-input-container";return this.value&&(e+=" with-value"),e+="small"===this.size?" vega-input-size-small":" vega-input-size-default",e+=this.disabled?" vega-input-disabled":"",this.isCompactInputWidth&&(e+=" compact-input-width"),t("div",{class:"vega-input",part:"container-wrapper"},this.renderLabelDom(),t("div",{ref:t=>this.inputContainerRef=t,part:"input-container",class:e,onClick:this.focusInput,"aria-label":"input container","aria-disabled":`${this.disabled}`,role:"textbox",tabIndex:this.disabled?null:-1,onKeyDown:u()},this.prefixSlotRenderer.render(),this.renderPrefixText(),this.containerDom(),this.renderSuffixText(),this.showClearIcon&&this.renderClearIcon()),this.renderHintDom())}renderLabelDom(){return t("vega-field-label",{onClick:this.focusInput,"is-field-required":this.required,disabled:this.disabled,label:this.label,suffixButtonProps:this.labelSuffixButtonProps,ref:t=>{O.addUniqueObserverToNode(t,k,this.handleLabelButtonClick)}})}renderClearIcon(){return t("div",{class:{"vega-input-clear-icon":!0,invisible:!this.isClearIconVisible()},tabIndex:this.disabled?-1:0,"aria-label":"clear input",role:"button",onClick:this.onClickClearIcon,onKeyDown:u(),onFocusin:this.onClearInputFocus,onFocusout:this.onClearInputBlur},t("vega-icon",{icon:"close"}))}renderHintDom(){return""!==this.hint?t("div",{class:"vega-hint"},t("label",null,this.hint)):null}areMaskConfigsEqual(t,e){const i=Array.isArray(t)?t:[t],n=Array.isArray(e)?e:[e];return V(i,n,!0,((t,e)=>$(t,e)?0:-1))}get host(){return a(this)}static get watchers(){return{suffixText:["watchSuffixText"],value:["watchValue"],type:["watchTypeChange"],validationRules:["watchValidationRules"],maskConfig:["watchMaskChange"]}}};tt([w()],et.prototype,"globalSlimmers",void 0),tt([m()],et.prototype,"formFieldController",void 0),tt([m()],et.prototype,"pageResizeObserverSlimmer",void 0),tt([m()],et.prototype,"copyPasteController",void 0),tt([m()],et.prototype,"compactWidthController",void 0),tt([m()],et.prototype,"stateController",void 0),tt([m()],et.prototype,"maskConfigController",void 0),tt([m()],et.prototype,"prefixSlotRenderer",void 0),tt([m()],et.prototype,"changeEventEmitter",void 0),tt([m()],et.prototype,"focusEventEmitter",void 0),tt([m()],et.prototype,"blurEventEmitter",void 0),tt([m()],et.prototype,"labelButtonClickEventEmitter",void 0),tt([m()],et.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),tt([c()],et.prototype,"watchMaskChange",null),et.style=':host{cursor:text;display:block;text-align:left;line-height:normal}:host(.vega-input-inline-block){display:inline-block;width:100%}:host(.vega-input-hidden){display:none}vega-field-label{margin-bottom:8px}.vega-input-container{display:flex;align-items:center;border-radius:8px;gap:8px;background-color:rgba(var(--v-bg-primary, 252, 252, 252, 1));border:1px solid rgba(var(--v-border-input-field, 171, 198, 216, 1))}.vega-input-container:hover{border:1px solid rgba(var(--v-border-input-field-hover, 115, 160, 190, 1))}.vega-input-container.vega-input-disabled{background-color:rgba(var(--v-bg-secondary, 245, 247, 247, 1));border:1px solid rgba(var(--v-border-input-field-disabled, 222, 225, 227, 1))}.vega-input-container.vega-input-disabled:hover{border:1px solid rgba(var(--v-border-input-field-disabled, 222, 225, 227, 1))}.vega-input-container.vega-input-disabled input{color:rgba(var(--v-text-input-disabled, 107, 116, 125, 1))}.vega-input-container.with-value{border-width:1px;border-style:solid;border-radius:8px}.vega-input-container:not(.no-focus):focus-within{outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:3px;border:1px solid rgba(var(--v-border-color-input-field-focus, 19, 98, 226, 1))}.vega-input-container.error{border:1px solid rgba(var(--v-border-input-field-danger, 230, 50, 87, 1))}.vega-input-container.error:hover{border:1px solid rgba(var(--v-border-input-field-danger-hover, 255, 87, 114, 1))}.vega-input-container.error:not(.no-focus):focus-within{outline:2px solid rgba(var(--v-border-color-danger, 230, 50, 87, 1));outline-offset:3px;border:1px solid rgba(var(--v-border-color-input-field-danger-focus, 233, 71, 104, 1))}.vega-input-container.error .vega-input-clear-icon:focus-within{outline:2px solid rgba(var(--v-border-color-danger, 230, 50, 87, 1));outline-offset:2px}.vega-input-prefix{text-align:center;color:rgba(var(--v-text-secondary, 107, 116, 125, 1));font-size:0px}.vega-input-prefix.vega-input-prefix-slot{height:24px;overflow:hidden}.vega-input-input{flex:1 1 0%;position:relative}.vega-input-input input{width:100%;outline:2px solid transparent;outline-offset:2px;border-style:none;height:24px;box-sizing:border-box;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px;color:rgba(var(--v-text-primary, 32, 54, 69, 1));background-color:rgba(var(--v-bg-primary, 252, 252, 252, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){.vega-input-input input{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.vega-input-input input{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.vega-input-input input{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}.vega-input-input input::placeholder{color:rgba(var(--v-text-input-placeholder, 176, 180, 181, 1))}.vega-input-size-small{padding-top:8px;padding-right:12px;padding-bottom:8px;padding-left:12px}.vega-input-size-default{padding-top:12px;padding-right:16px;padding-bottom:12px;padding-left:16px}.vega-input-input input:disabled{background-color:rgba(var(--v-bg-secondary, 245, 247, 247, 1))}.vega-hint{padding-top:12px;padding-right:8px;padding-left:8px}.vega-hint>label{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px;color:rgba(var(--v-text-secondary, 107, 116, 125, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){.vega-hint>label{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.vega-hint>label{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.vega-hint>label{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}.vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px;color:rgba(var(--v-text-error, 189, 41, 71, 1));display:block;padding-top:12px;padding-right:8px;padding-left:8px}@media screen and (min-width: 768px) and (max-width: 1023px){.vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}.vega-hidden{display:none}.vega-input-clear-icon{width:16px;height:16px;cursor:pointer;color:rgba(var(--v-text-secondary, 107, 116, 125, 1))}.vega-input-clear-icon:focus-within{outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:2px;border-radius:4px;padding:2px}.vega-input-clear-icon.invisible{visibility:hidden}.vega-input-clear-icon vega-icon{min-width:-webkit-min-content;min-width:-moz-min-content;min-width:min-content;flex-shrink:0}input[type=number]::-webkit-outer-spin-button,input[type=number]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}input[type=number]{-moz-appearance:textfield}.vega-input-container.compact-input-width{gap:0px}.vega-input-container.compact-input-width .vega-input-prefix{margin-right:8px}.vega-input-container.compact-input-width .prefix-text,.vega-input-container.compact-input-width .suffix-text{margin-right:2px}.vega-input-container.compact-input-width .vega-input-clear-icon{margin-left:2px}.vega-input-container.compact-input-width .vega-input-input input{padding:0px;min-width:1px}.vega-input-container.compact-input-width.auto-width .vega-input-input{flex-grow:0}.vega-input-container.compact-input-width.auto-width .suffix-text{flex-grow:1}.vega-input-container .prefix-text,.vega-input-container .suffix-text{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px;color:rgba(var(--v-text-secondary, 107, 116, 125, 1));min-width:-webkit-min-content;min-width:-moz-min-content;min-width:min-content;flex-shrink:0;flex-grow:0}@media screen and (min-width: 768px) and (max-width: 1023px){.vega-input-container .prefix-text,.vega-input-container .suffix-text{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.vega-input-container .prefix-text,.vega-input-container .suffix-text{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.vega-input-container .prefix-text,.vega-input-container .suffix-text{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}.v-font-field-value{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}@media screen and (min-width: 768px) and (max-width: 1023px){.v-font-field-value{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.v-font-field-value{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.v-font-field-value{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}';export{et as vega_input}
@@ -1 +0,0 @@
1
- import{i as o}from"./p-5e2c9e69.js";import{R as f}from"./p-fb8c99c5.js";function i(i,r,e,s){return o(i)?{flex:`${f.formatCustom(i)}`}:{flexGrow:o(r)?`${f.formatCustom(r)}`:void 0,flexShrink:o(e)?`${f.formatCustom(e)}`:void 0,flexBasis:o(s)?`${f.formatCustom(s)}`:void 0}}export{i as f}
@@ -1 +0,0 @@
1
- import{i as t}from"./p-5e2c9e69.js";import{c as i,M as s,V as e}from"./p-6e1ab235.js";import{C as n}from"./p-2d0d575f.js";import{d as r}from"./p-6e01f0a2.js";import{h,V as o}from"./p-65d8c2bc.js";import{a as u}from"./p-51297b96.js";class a{canFormat(i,s,e){if("init"===i){if("component"===s&&t(null==e?void 0:e.isBlurred))return!1;if(this.shouldTriggerAtInit())return!0}if("input"===i&&"native-input"===s)return!0;if("blur"===i&&(null==e?void 0:e.isBlurred)){if("component"===s&&this.shouldOverrideComponentValueAfterBlur())return!0;if("native-input"===s)return!0}return!1}shouldOverrideComponentValueAfterBlur(){return!1}shouldTriggerAtInit(){return!1}}class c extends a{constructor(t){super(),this.insertMode=!0,this.maskConfig=t,this.slotRegex=new RegExp(t.slot),this.acceptRegex=new RegExp(t.accept,"g"),this.insertMode=!1!==t.insertMode}format(i,s){const e=null==s?void 0:s.caretPosition;if(i.length>this.getLengthLimit()&&t(e)){const t=[...i],s=i.length-this.getLengthLimit();return t.splice(e-s,s),t.join("")}return this.replaceMaskWithMatchedInputSlots(i,this.getMatchedInputSlotValue(i))}calculateCaretPosition(i,s){if(!t(s))return null;if(i.length>this.getLengthLimit())return s-(i.length-this.getLengthLimit());const e=i.substring(0,s);return s+(this.format(e).length-e.length)}shouldOverrideComponentValueAfterBlur(){return!(!this.maskConfig||!0!==this.maskConfig.overrideValue)}shouldTriggerAtInit(){return!(!this.maskConfig||!0!==this.maskConfig.triggerAtInit)}getLengthLimit(){return this.maskConfig.mask.length}getMatchedInputSlotValue(t){return t.match(this.acceptRegex)||[]}replaceMaskWithMatchedInputSlots(t,i){const s=[];let e=-1;for(let n=0;n<this.maskConfig.mask.length;n++){const r=this.maskConfig.mask.charAt(n);if(this.slotRegex.test(r)&&i.length){const t=i.shift();t&&(s.push(t),e=n)}else this.insertMode||i.shift(),t.charAt(n)===r&&(e=n),s.push(r)}const n=this.insertMode?e+1:t.length;return s.join("").slice(0,n)}}c.PHONE_MASK=new c({mask:"(999) 999-9999",slot:"9",accept:/\d/g}),c.ZIPCODE_MASK=new c({mask:"99999",slot:"9",accept:/\d/g}),c.TAX_ID_MASK=new c({mask:"99-9999999",slot:"9",accept:/\d/g});var p=function(t,i,s,e){var n,r=arguments.length,h=r<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,s):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,i,s,e);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(h=(r<3?n(h):r>3?n(i,s,h):n(i,s))||h);return r>3&&h&&Object.defineProperty(i,s,h),h};class l extends e{constructor(){super(...arguments),this.onFocus=t=>{if(this.host&&this.host.value){const i=this.host.value;t.target.value!==i&&(this.inputElement.value=i)}},this.onBlur=t=>{this.blurFormatStrategy&&this.formatValue(t.target.value,"blur")},this.onKeyDown=t=>{const i=t.target,s=i.value,e=i.selectionStart;this.inputFormatStrategy&&(this.formatValue(s,"input",{caretPosition:"insertFromPaste"===t.inputType?void 0:e}),this.updateInputCaretPosition(s,e))},this.onPaste=t=>{this.disableCopyPaste?t.preventDefault():n.notify(r.getSubject(this.host,h),t)}}componentDidRender(){n.notify(r.getSubject(this.host,o),{})}setup(){this.destroy();const t=this.getInputElementRef();t&&(this.inputElement=t,this.inputFormatStrategy=this.getInputModeStrategy(),this.blurFormatStrategy=this.getBlurModeStrategy(),this.formatValueAfterSetup(),this.inputFormatStrategy&&(this.inputElement.addEventListener("input",this.onKeyDown,{capture:!0}),this.inputElement.addEventListener("paste",this.onPaste,{capture:!0})),this.blurFormatStrategy&&(this.inputElement.addEventListener("blur",this.onBlur,{capture:!0}),this.inputElement.addEventListener("focus",this.onFocus,{capture:!0})))}destroy(){this.inputElement&&(this.inputFormatStrategy&&(this.inputElement.removeEventListener("input",this.onKeyDown,{capture:!0}),this.inputElement.removeEventListener("paste",this.onPaste,{capture:!0})),this.blurFormatStrategy&&(this.inputElement.removeEventListener("blur",this.onBlur,{capture:!0}),this.inputElement.removeEventListener("focus",this.onFocus,{capture:!0})))}formatValueAfterSetup(){u(this.host).then((()=>{this.formatValue(this.inputElement.value,"init")}))}isOnFocus(){return this.inputElement.matches(":focus")}updateNativeInputValue(t,i){i!==t&&(this.inputElement.value=i)}updateComponentValue(t,i){i!==t&&(this.host.value=i)}updateInputCaretPosition(i,s){var e,n,r;const h=null!==(r=null===(n=(e=this.inputFormatStrategy).calculateCaretPosition)||void 0===n?void 0:n.call(e,i,s))&&void 0!==r?r:s;t(h)&&this.inputElement.setSelectionRange(h,h)}formatValue(t,i,s){const e=!this.isOnFocus(),n=null==s?void 0:s.caretPosition;if(this.inputFormatStrategy){if(this.inputFormatStrategy.canFormat(i,"component")){const i=this.inputFormatStrategy.format(t);this.updateComponentValue(t,i)}if(this.inputFormatStrategy.canFormat(i,"native-input")){const i=this.inputFormatStrategy.format(t,{caretPosition:n});this.updateNativeInputValue(t,i)}}if(this.blurFormatStrategy&&e){if(this.blurFormatStrategy.canFormat(i,"component",{isBlurred:e})){const i=this.blurFormatStrategy.format(t);this.updateComponentValue(t,i)}if(this.blurFormatStrategy.canFormat(i,"native-input",{isBlurred:e})){const i=this.blurFormatStrategy.format(t);this.updateNativeInputValue(t,i)}}}}p([i()],l.prototype,"host",void 0),p([s("componentDidRender")],l.prototype,"componentDidRender",null);export{a as S,l as a,c as b}