@ni/nimble-components 27.2.3 → 28.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/dist/all-components-bundle.js +809 -806
  2. package/dist/all-components-bundle.js.map +1 -1
  3. package/dist/all-components-bundle.min.js +93 -93
  4. package/dist/all-components-bundle.min.js.map +1 -1
  5. package/dist/esm/all-components.d.ts +1 -1
  6. package/dist/esm/all-components.js +1 -1
  7. package/dist/esm/all-components.js.map +1 -1
  8. package/dist/esm/mapping/icon/index.d.ts +1 -1
  9. package/dist/esm/mapping/icon/index.js +1 -1
  10. package/dist/esm/mapping/icon/index.js.map +1 -1
  11. package/dist/esm/mapping/spinner/index.d.ts +1 -1
  12. package/dist/esm/mapping/spinner/index.js +1 -1
  13. package/dist/esm/mapping/spinner/index.js.map +1 -1
  14. package/dist/esm/mapping/text/index.d.ts +1 -1
  15. package/dist/esm/mapping/text/index.js +1 -1
  16. package/dist/esm/mapping/text/index.js.map +1 -1
  17. package/dist/esm/table/testing/table.pageobject.d.ts +2 -2
  18. package/dist/esm/table/testing/table.pageobject.js +3 -3
  19. package/dist/esm/table/testing/table.pageobject.js.map +1 -1
  20. package/dist/esm/table-column/enum-base/types.d.ts +1 -1
  21. package/dist/esm/table-column/enum-base/types.js +1 -1
  22. package/dist/esm/table-column/enum-base/types.js.map +1 -1
  23. package/dist/esm/table-column/{icon → mapping}/cell-view/index.d.ts +4 -4
  24. package/dist/esm/table-column/{icon → mapping}/cell-view/index.js +11 -11
  25. package/dist/esm/table-column/mapping/cell-view/index.js.map +1 -0
  26. package/dist/esm/table-column/mapping/cell-view/styles.js.map +1 -0
  27. package/dist/esm/table-column/mapping/cell-view/template.d.ts +2 -0
  28. package/dist/esm/table-column/mapping/cell-view/template.js.map +1 -0
  29. package/dist/esm/table-column/{icon → mapping}/group-header-view/index.d.ts +4 -4
  30. package/dist/esm/table-column/{icon → mapping}/group-header-view/index.js +10 -8
  31. package/dist/esm/table-column/mapping/group-header-view/index.js.map +1 -0
  32. package/dist/esm/table-column/mapping/group-header-view/styles.js.map +1 -0
  33. package/dist/esm/table-column/mapping/group-header-view/template.d.ts +2 -0
  34. package/dist/esm/table-column/mapping/group-header-view/template.js.map +1 -0
  35. package/dist/esm/table-column/{icon → mapping}/index.d.ts +9 -8
  36. package/dist/esm/table-column/{icon → mapping}/index.js +14 -13
  37. package/dist/esm/table-column/mapping/index.js.map +1 -0
  38. package/dist/esm/table-column/{icon/models/table-column-icon-validator.d.ts → mapping/models/table-column-mapping-validator.d.ts} +3 -3
  39. package/dist/esm/table-column/{icon/models/table-column-icon-validator.js → mapping/models/table-column-mapping-validator.js} +9 -9
  40. package/dist/esm/table-column/mapping/models/table-column-mapping-validator.js.map +1 -0
  41. package/dist/esm/table-column/{icon/testing/table-column-icon.pageobject.d.ts → mapping/testing/table-column-mapping.pageobject.d.ts} +2 -2
  42. package/dist/esm/table-column/{icon/testing/table-column-icon.pageobject.js → mapping/testing/table-column-mapping.pageobject.js} +3 -3
  43. package/dist/esm/table-column/mapping/testing/table-column-mapping.pageobject.js.map +1 -0
  44. package/dist/esm/table-column/{icon → mapping}/types.d.ts +1 -1
  45. package/dist/esm/table-column/{icon → mapping}/types.js +1 -1
  46. package/dist/esm/table-column/mapping/types.js.map +1 -0
  47. package/package.json +1 -1
  48. package/dist/esm/table-column/icon/cell-view/index.js.map +0 -1
  49. package/dist/esm/table-column/icon/cell-view/styles.js.map +0 -1
  50. package/dist/esm/table-column/icon/cell-view/template.d.ts +0 -2
  51. package/dist/esm/table-column/icon/cell-view/template.js.map +0 -1
  52. package/dist/esm/table-column/icon/group-header-view/index.js.map +0 -1
  53. package/dist/esm/table-column/icon/group-header-view/styles.js.map +0 -1
  54. package/dist/esm/table-column/icon/group-header-view/template.d.ts +0 -2
  55. package/dist/esm/table-column/icon/group-header-view/template.js.map +0 -1
  56. package/dist/esm/table-column/icon/index.js.map +0 -1
  57. package/dist/esm/table-column/icon/models/table-column-icon-validator.js.map +0 -1
  58. package/dist/esm/table-column/icon/testing/table-column-icon.pageobject.js.map +0 -1
  59. package/dist/esm/table-column/icon/types.js.map +0 -1
  60. /package/dist/esm/table-column/{icon → mapping}/cell-view/styles.d.ts +0 -0
  61. /package/dist/esm/table-column/{icon → mapping}/cell-view/styles.js +0 -0
  62. /package/dist/esm/table-column/{icon → mapping}/cell-view/template.js +0 -0
  63. /package/dist/esm/table-column/{icon → mapping}/group-header-view/styles.d.ts +0 -0
  64. /package/dist/esm/table-column/{icon → mapping}/group-header-view/styles.js +0 -0
  65. /package/dist/esm/table-column/{icon → mapping}/group-header-view/template.js +0 -0
@@ -11227,83 +11227,32 @@ wi.getOrCreate().withPrefix("nimble").register(CF())
11227
11227
  class kF extends(rF(oF)){constructor(){super(...arguments),this.langSubscriber={handleChange:()=>{this.updateColumnConfig()}}}connectedCallback(){super.connectedCallback(),_a.subscribe(this.langSubscriber,this),this.updateColumnConfig()}disconnectedCallback(){super.disconnectedCallback(),_a.unsubscribe(this.langSubscriber,this)}placeholderChanged(){this.updateColumnConfig()}getColumnInternalsOptions(){return{cellRecordFieldNames:["value"],cellViewTag:"nimble-table-column-duration-text-cell-view",groupHeaderViewTag:"nimble-table-column-duration-text-group-header-view",delegatedEvents:[],sortOperation:_O,validator:new zR([])}}updateColumnConfig(){const e={formatter:new xF(_a.getValueFor(this)),placeholder:this.placeholder}
11228
11228
  this.columnInternals.columnConfig=e}}const SF=kF.compose({baseName:"table-column-duration-text",template:qR,styles:BR})
11229
11229
  wi.getOrCreate().withPrefix("nimble").register(SF())
11230
- const $F=Z`<span
11231
- ${Zm("hasOverflow")}
11232
- class="header-content"
11233
- title=${e=>e.hasOverflow&&e.headerTextContent?e.headerTextContent:null}
11234
- >
11235
- <slot ${Ne("contentSlot")}></slot>
11236
- <slot ${Ye({property:"unitElements",filter:Ge()})} name="unit"></slot>
11237
- </span>`
11238
- const MF=class extends YR{updateText(){this.text=this.columnConfig?.formatter?.format(this.groupHeaderValue)??""}}.compose({baseName:"table-column-number-text-group-header-view",template:JR,styles:QR})
11239
- wi.getOrCreate().withPrefix("nimble").register(MF())
11240
- const EF=class extends uF{columnConfigChanged(){super.columnConfigChanged(),this.alignment=this.columnConfig?.alignment??lF}updateText(){this.text=this.columnConfig?.formatter?.format(this.cellRecord?.value)??""}}.compose({baseName:"table-column-number-text-cell-view",template:dF,styles:hF})
11241
- wi.getOrCreate().withPrefix("nimble").register(EF())
11242
- const _F={default:void 0,decimal:"decimal"},IF="left",DF="right"
11243
- class AF{format(e){if("number"!=typeof e)return""
11244
- try{return this.tryFormat(e)}catch{return""}}}class TF{constructor(e){this.locale=e.locale,this.intlNumberFormatOptions=e.intlNumberFormatOptions}}class OF extends TF{constructor(e,t){super(e),this.formatter=new Intl.NumberFormat(this.locale,{...t,...this.intlNumberFormatOptions})}static createFactory(e){return t=>new OF(t,e)}format(e){return this.formatter.format(e)}}class RF{constructor(e,t){this.scaleFactor=e,this.scaledUnitFormatFactory=t}isBase(){return 1===this.scaleFactor}}class FF{constructor(e){this.supportedScaledUnits=e
11245
- const t=e.every(((e,t,n)=>0===t||n[t-1].scaleFactor<e.scaleFactor))
11246
- if(!t)throw new Error("Supported scaled units must have unique and ordered scale factors")
11247
- const n=e.find((e=>e.isBase()))
11248
- if(!n)throw new Error("Supported scaled units must include a base scaled unit (scale factor=1)")
11249
- this.supportedScaledUnits=e,this.baseScaledUnit=n}scaleNumber(e){const t=Math.abs(e)
11250
- if(1===this.supportedScaledUnits.length||0===t||t===1/0||Number.isNaN(t))return{scaledValue:e,scaledUnit:this.baseScaledUnit}
11251
- for(let n=this.supportedScaledUnits.length-1;n>=0;n-=1){const i=this.supportedScaledUnits[n]
11252
- if(t/i.scaleFactor>=1)return{scaledValue:e/i.scaleFactor,scaledUnit:i}}const n=this.supportedScaledUnits[0]
11253
- return{scaledValue:e/n.scaleFactor,scaledUnit:n}}}const PF=new class extends FF{constructor(){super([new RF(1,OF.createFactory({}))])}},NF="negative"
11254
- class LF extends AF{constructor(e,{unitScale:t=PF}={unitScale:PF}){super(),this.defaultIntlNumberFormatOptions={maximumSignificantDigits:LF.maximumDigits,maximumFractionDigits:LF.maximumDigits-1,roundingPriority:"lessPrecision",signDisplay:NF},this.defaultScaledUnitFormatters=new Map,this.exponentialIntlNumberFormatOptions={maximumSignificantDigits:LF.maximumDigits,notation:"scientific",signDisplay:NF}
11255
- for(const n of t.supportedScaledUnits)this.defaultScaledUnitFormatters.set(n.scaleFactor,n.scaledUnitFormatFactory({locale:e,intlNumberFormatOptions:this.defaultIntlNumberFormatOptions}))
11256
- this.exponentialScaledUnitFormatter=t.baseScaledUnit.scaledUnitFormatFactory({locale:e,intlNumberFormatOptions:this.exponentialIntlNumberFormatOptions}),this.unitScale=t}resolvedOptions(){return{unitScale:this.unitScale}}tryFormat(e){const{scaledValue:t,scaledUnit:n}=this.unitScale.scaleNumber(e),i=Math.abs(t)
11257
- return 0!==i&&(i>=LF.exponentialUpperBound||i<LF.exponentialLowerBound)?this.exponentialScaledUnitFormatter.format(e):this.defaultScaledUnitFormatters.get(n.scaleFactor).format(t)}}LF.maximumDigits=6,LF.exponentialLowerBound=995e-6,LF.exponentialUpperBound=999999.5
11258
- class zF extends AF{constructor(e,{minimumFractionDigits:t=0,maximumFractionDigits:n=Math.max(3,t),unitScale:i=PF}={minimumFractionDigits:0,maximumFractionDigits:3,unitScale:PF}){super(),this.scaledUnitFormatters=new Map
11259
- const o={maximumFractionDigits:n,minimumFractionDigits:t,signDisplay:"negative"}
11260
- for(const t of i.supportedScaledUnits)this.scaledUnitFormatters.set(t.scaleFactor,t.scaledUnitFormatFactory({locale:e,intlNumberFormatOptions:o}))
11261
- this.unitScale=i,this.minimumFractionDigits=t,this.maximumFractionDigits=n}resolvedOptions(){return{unitScale:this.unitScale,maximumFractionDigits:this.maximumFractionDigits,minimumFractionDigits:this.minimumFractionDigits}}tryFormat(e){const{scaledValue:t,scaledUnit:n}=this.unitScale.scaleNumber(e)
11262
- return this.scaledUnitFormatters.get(n.scaleFactor).format(t)}}class VF extends AF{constructor(e,t){super(),this._resolvedOptions=this.resolveOptions(t),this.resolvedUnitFormat=this.resolveUnitFormat(e,this._resolvedOptions)}resolvedOptions(){return{...this._resolvedOptions}}optionsMatch(e){const t=this.resolveOptions(e)
11263
- return this._resolvedOptions.decimalDigits===t.decimalDigits&&this._resolvedOptions.decimalMaximumDigits===t.decimalMaximumDigits&&this._resolvedOptions.numberTextFormat===t.numberTextFormat&&this._resolvedOptions.unitScale===t.unitScale}tryFormat(e){return this.resolvedUnitFormat.format(e)}resolveUnitFormat(e,t){const{numberTextFormat:n,decimalMaximumDigits:i,decimalDigits:o,unitScale:r}=t
11264
- return n===_F.default?new LF(e,{unitScale:r}):new zF(e,"number"==typeof o?{minimumFractionDigits:o,maximumFractionDigits:o,unitScale:r}:{minimumFractionDigits:0,maximumFractionDigits:i,unitScale:r})}resolveOptions(e){if(!e||e.numberTextFormat===_F.default)return{numberTextFormat:_F.default,decimalDigits:void 0,decimalMaximumDigits:void 0,unitScale:e?.unitScale??PF}
11265
- const t="number"==typeof e.decimalDigits,n="number"==typeof e.decimalMaximumDigits
11266
- if(t&&n)throw new Error("decimalDigits and decimalMaximumDigits are mutually exclusive. Do not specify both.")
11267
- return t||n?{numberTextFormat:_F.decimal,decimalDigits:e.decimalDigits,decimalMaximumDigits:e.decimalMaximumDigits,unitScale:e.unitScale??PF}:{numberTextFormat:_F.decimal,decimalDigits:VF.defaultDecimalDigits,decimalMaximumDigits:void 0,unitScale:e.unitScale??PF}}}VF.defaultDecimalDigits=2
11268
- const HF=["invalidDecimalDigits","invalidDecimalMaximumDigits","decimalDigitsMutuallyExclusiveWithDecimalMaximumDigits","moreThanOneUnitSpecified"]
11269
- class BF extends zR{constructor(){super(HF)}validateDecimalDigits(e,t){const n=!!(e===_F.decimal&&"number"==typeof t)&&this.isInvalidDecimalDigitsValue(t)
11270
- this.setConditionValue("invalidDecimalDigits",n)}validateDecimalMaximumDigits(e,t){const n=!!(e===_F.decimal&&"number"==typeof t)&&this.isInvalidDecimalDigitsValue(t)
11271
- this.setConditionValue("invalidDecimalMaximumDigits",n)}validateNoMutuallyExclusiveProperties(e,t,n){const i=!!(e===_F.decimal)&&("number"==typeof t&&"number"==typeof n)
11272
- this.setConditionValue("decimalDigitsMutuallyExclusiveWithDecimalMaximumDigits",i)}validateAtMostOneUnit(e){const t=e.length>1
11273
- this.setConditionValue("moreThanOneUnitSpecified",t)}isInvalidDecimalDigitsValue(e){return e<0||e>20}}class qF extends Vt{}e([g],qF.prototype,"resolvedUnitScale",void 0)
11274
- class UF extends(rF(oF)){constructor(){super(...arguments),this.langSubscriber={handleChange:()=>{this.updateColumnConfig()}},this.unitSubscriber={handleChange:()=>{this.updateColumnConfig()}}}connectedCallback(){super.connectedCallback(),_a.subscribe(this.langSubscriber,this),this.updateColumnConfig()}disconnectedCallback(){super.disconnectedCallback(),_a.unsubscribe(this.langSubscriber,this)}placeholderChanged(){this.updateColumnConfig()}getColumnInternalsOptions(){return{cellRecordFieldNames:["value"],cellViewTag:"nimble-table-column-number-text-cell-view",groupHeaderViewTag:"nimble-table-column-number-text-group-header-view",delegatedEvents:[],sortOperation:_O,validator:new BF}}updateUnitNotifier(){if(this.unitNotifier&&(this.unitNotifier.unsubscribe(this.unitSubscriber),this.unitNotifier=void 0),this.unit){const e=m.getNotifier(this.unit)
11275
- e.subscribe(this.unitSubscriber,"resolvedUnitScale"),this.unitNotifier=e}}formatChanged(){this.updateColumnConfig()}alignmentChanged(){this.updateColumnConfig()}decimalDigitsChanged(){this.updateColumnConfig()}decimalMaximumDigitsChanged(){this.updateColumnConfig()}unitElementsChanged(){this.updateUnit()}async updateUnit(){this.unit=void 0,this.unitElements&&(await Y_(this.unitElements),this.unit=this.unitElements.find((e=>e instanceof qF))),this.updateUnitNotifier()}unitChanged(){this.updateColumnConfig()}updateColumnConfig(){const e=this.columnInternals.validator
11276
- if(e.validateDecimalDigits(this.format,this.decimalDigits),e.validateDecimalMaximumDigits(this.format,this.decimalMaximumDigits),e.validateNoMutuallyExclusiveProperties(this.format,this.decimalDigits,this.decimalMaximumDigits),e.validateAtMostOneUnit(this.unitElements??[]),e.isValid()){const e={formatter:this.createFormatter(),alignment:this.determineCellContentAlignment(),placeholder:this.placeholder}
11277
- this.columnInternals.columnConfig=e}else this.columnInternals.columnConfig=void 0}createFormatter(){const e=this.unit?.resolvedUnitScale
11278
- return new VF(_a.getValueFor(this),{numberTextFormat:this.format??void 0,decimalDigits:this.decimalDigits??void 0,decimalMaximumDigits:this.decimalMaximumDigits??void 0,unitScale:e})}determineCellContentAlignment(){return this.alignment===IF?lF:this.alignment===DF?cF:this.format!==_F.decimal||"number"==typeof this.decimalMaximumDigits||this.unit?lF:cF}}e([le],UF.prototype,"format",void 0),e([le],UF.prototype,"alignment",void 0),e([le({attribute:"decimal-digits",converter:se})],UF.prototype,"decimalDigits",void 0),e([le({attribute:"decimal-maximum-digits",converter:se})],UF.prototype,"decimalMaximumDigits",void 0),e([g],UF.prototype,"unitElements",void 0),e([g],UF.prototype,"unit",void 0)
11279
- const jF=UF.compose({baseName:"table-column-number-text",template:$F,styles:BR})
11280
- wi.getOrCreate().withPrefix("nimble").register(jF())
11281
- const WF=(e,t)=>{if("number"===t){const t=se.fromView(e)
11230
+ const $F=(e,t)=>{if("number"===t){const t=se.fromView(e)
11282
11231
  return null===t?void 0:t}return"boolean"===t?!1!==e&&"false"!==e&&(!0===e||"true"===e||void 0):e?.toString()??void 0}
11283
- class ZF extends LO{constructor(){super(...arguments),this.mappingNotifiers=[],this.mappings=[],this.keyType="string"}handleChange(e,t){e instanceof dv&&"string"==typeof t&&this.updateColumnConfig()}updateColumnConfig(){this.columnInternals.validator.validate(this.mappings,this.keyType),this.columnInternals.columnConfig=this.checkValidity()?this.createColumnConfig(this.getMappingConfigs()):void 0}getMappingConfigs(){const e=new Map
11284
- return this.mappings.forEach((t=>{const n=WF(t.key,this.keyType)
11232
+ class MF extends LO{constructor(){super(...arguments),this.mappingNotifiers=[],this.mappings=[],this.keyType="string"}handleChange(e,t){e instanceof dv&&"string"==typeof t&&this.updateColumnConfig()}updateColumnConfig(){this.columnInternals.validator.validate(this.mappings,this.keyType),this.columnInternals.columnConfig=this.checkValidity()?this.createColumnConfig(this.getMappingConfigs()):void 0}getMappingConfigs(){const e=new Map
11233
+ return this.mappings.forEach((t=>{const n=$F(t.key,this.keyType)
11285
11234
  if(void 0===n)throw Error("Key was invalid for type. Validation should have prevented this.")
11286
11235
  const i=this.createMappingConfig(t)
11287
11236
  e.set(n,i)})),e}fieldNameChanged(){this.columnInternals.dataRecordFieldNames=[this.fieldName],this.columnInternals.operandDataRecordFieldName=this.fieldName}mappingsChanged(){this.updateColumnConfig(),this.observeMappings()}keyTypeChanged(){this.updateColumnConfig()}removeMappingObservers(){this.mappingNotifiers.forEach((e=>{e.unsubscribe(this)})),this.mappingNotifiers=[]}observeMappings(){this.removeMappingObservers()
11288
11237
  for(const e of this.mappings){const t=m.getNotifier(e)
11289
- t.subscribe(this),this.mappingNotifiers.push(t)}}}e([g],ZF.prototype,"mappings",void 0),e([le({attribute:"field-name"})],ZF.prototype,"fieldName",void 0),e([le({attribute:"key-type"})],ZF.prototype,"keyType",void 0)
11290
- const GF=xe`
11238
+ t.subscribe(this),this.mappingNotifiers.push(t)}}}e([g],MF.prototype,"mappings",void 0),e([le({attribute:"field-name"})],MF.prototype,"fieldName",void 0),e([le({attribute:"key-type"})],MF.prototype,"keyType",void 0)
11239
+ const EF=xe`
11291
11240
  ${BR}
11292
11241
 
11293
11242
  slot[name='mapping'] {
11294
11243
  display: none;
11295
11244
  }
11296
- `,KF=Z`${qR}<slot ${Ye("mappings")} name="mapping"></slot>`
11297
- class XF extends zR{constructor(e){super(e)}validate(e,t){this.untrackAll()
11245
+ `,_F=Z`${qR}<slot ${Ye("mappings")} name="mapping"></slot>`
11246
+ class IF extends zR{constructor(e){super(e)}validate(e,t){this.untrackAll()
11298
11247
  const n=e.map((e=>e.key))
11299
- this.validateKeyValuesForType(n,t),this.validateUniqueKeys(n,t),this.validateNoMissingKeys(e)}validateKeyValuesForType(e,t){const n=e.some((e=>void 0!==e&&void 0===WF(e,t)))
11300
- this.setConditionValue("invalidMappingKeyValueForType",n)}validateUniqueKeys(e,t){const n=e.map((e=>WF(e,t))),i=new Set(n).size!==n.length
11248
+ this.validateKeyValuesForType(n,t),this.validateUniqueKeys(n,t),this.validateNoMissingKeys(e)}validateKeyValuesForType(e,t){const n=e.some((e=>void 0!==e&&void 0===$F(e,t)))
11249
+ this.setConditionValue("invalidMappingKeyValueForType",n)}validateUniqueKeys(e,t){const n=e.map((e=>$F(e,t))),i=new Set(n).size!==n.length
11301
11250
  this.setConditionValue("duplicateMappingKey",i)}validateNoMissingKeys(e){const t=e.some((e=>void 0===e.key))
11302
- this.setConditionValue("missingKeyValue",t)}}const YF=["invalidMappingKeyValueForType","duplicateMappingKey","missingKeyValue","unsupportedMappingType","invalidIconName","missingTextValue"]
11303
- class JF extends XF{constructor(){super(YF)}static isIconMappingElement(e){return e instanceof mv}static isSupportedMappingElement(e){return e instanceof mv||e instanceof vv||e instanceof uv}static hasUnresolvedIcon(e){return"string"==typeof e.icon&&void 0===e.resolvedIcon}validate(e,t){super.validate(e,t),this.validateMappingTypes(e),this.validateIconNames(e),this.validateNoMissingText(e)}validateIconNames(e){const t=e.filter(JF.isIconMappingElement).some(JF.hasUnresolvedIcon)
11304
- this.setConditionValue("invalidIconName",t)}validateNoMissingText(e){const t=e.filter(JF.isSupportedMappingElement).some((e=>void 0===e.text))
11305
- this.setConditionValue("missingTextValue",t)}validateMappingTypes(e){const t=e.every(JF.isSupportedMappingElement)
11306
- this.setConditionValue("unsupportedMappingType",!t)}}const QF=xe`
11251
+ this.setConditionValue("missingKeyValue",t)}}const DF=["invalidMappingKeyValueForType","duplicateMappingKey","missingKeyValue","unsupportedMappingType","invalidIconName","missingTextValue"]
11252
+ class AF extends IF{constructor(){super(DF)}static isIconMappingElement(e){return e instanceof mv}static isSupportedMappingElement(e){return e instanceof mv||e instanceof vv||e instanceof uv}static hasUnresolvedIcon(e){return"string"==typeof e.icon&&void 0===e.resolvedIcon}validate(e,t){super.validate(e,t),this.validateMappingTypes(e),this.validateIconNames(e),this.validateNoMissingText(e)}validateIconNames(e){const t=e.filter(AF.isIconMappingElement).some(AF.hasUnresolvedIcon)
11253
+ this.setConditionValue("invalidIconName",t)}validateNoMissingText(e){const t=e.filter(AF.isSupportedMappingElement).some((e=>void 0===e.text))
11254
+ this.setConditionValue("missingTextValue",t)}validateMappingTypes(e){const t=e.every(AF.isSupportedMappingElement)
11255
+ this.setConditionValue("unsupportedMappingType",!t)}}const TF=xe`
11307
11256
  ${Oo("inline-flex")}
11308
11257
 
11309
11258
  :host {
@@ -11325,7 +11274,7 @@ this.setConditionValue("unsupportedMappingType",!t)}}const QF=xe`
11325
11274
  overflow: hidden;
11326
11275
  text-overflow: ellipsis;
11327
11276
  }
11328
- `,eP=Z`
11277
+ `,OF=Z`
11329
11278
  ${He((e=>e.visualizationTemplate),Z`
11330
11279
  <span class="reserve-icon-size">
11331
11280
  ${e=>e.visualizationTemplate}
@@ -11336,10 +11285,10 @@ this.setConditionValue("unsupportedMappingType",!t)}}const QF=xe`
11336
11285
  title="${e=>e.hasOverflow&&e.text?e.text:null}"
11337
11286
  class="text"
11338
11287
  >${e=>e.text}</span>
11339
- `,tP={default:void 0,error:"error",warning:"warning",success:"success",information:"information"}
11340
- class nP{constructor(e){this.text=e}}const iP=Z` `
11341
- class oP extends nP{constructor(e,t,n,i){var o
11342
- super(n),this.severity=t,this.textHidden=i,this.iconTemplate=void 0===(o=e)?iP:Z`
11288
+ `,RF={default:void 0,error:"error",warning:"warning",success:"success",information:"information"}
11289
+ class FF{constructor(e){this.text=e}}const PF=Z` `
11290
+ class NF extends FF{constructor(e,t,n,i){var o
11291
+ super(n),this.severity=t,this.textHidden=i,this.iconTemplate=void 0===(o=e)?PF:Z`
11343
11292
  <${o}
11344
11293
  title="${e=>e.textHidden?e.text:""}"
11345
11294
  role="img"
@@ -11348,7 +11297,7 @@ super(n),this.severity=t,this.textHidden=i,this.iconTemplate=void 0===(o=e)?iP:Z
11348
11297
  severity="${e=>e.severity}"
11349
11298
  >
11350
11299
  </${o}>
11351
- `}}const rP=Z`
11300
+ `}}const LF=Z`
11352
11301
  <${uT}
11353
11302
  title="${e=>e.textHidden?e.text:""}"
11354
11303
  aria-label="${e=>e.text}"
@@ -11356,12 +11305,12 @@ super(n),this.severity=t,this.textHidden=i,this.iconTemplate=void 0===(o=e)?iP:Z
11356
11305
  >
11357
11306
  </${uT}>
11358
11307
  `
11359
- class sP extends nP{constructor(e,t){super(e),this.textHidden=t,this.spinnerTemplate=rP}}class aP extends nP{}class lP extends YR{constructor(){super(...arguments),this.textHidden=!1}updateText(){if(this.resetState(),!this.columnConfig)return
11308
+ class zF extends FF{constructor(e,t){super(e),this.textHidden=t,this.spinnerTemplate=LF}}class VF extends FF{}class HF extends YR{constructor(){super(...arguments),this.textHidden=!1}updateText(){if(this.resetState(),!this.columnConfig)return
11360
11309
  const e=this.groupHeaderValue,t=this.columnConfig.mappingConfigs.get(e)
11361
- t instanceof oP?(this.severity=t.severity,this.text=t.text??"",this.visualizationTemplate=t.iconTemplate):t instanceof sP?(this.text=t.text??"",this.visualizationTemplate=t.spinnerTemplate):t instanceof aP&&(this.text=t.text??"")}resetState(){this.text="",this.visualizationTemplate=void 0,this.severity=tP.default}}e([g],lP.prototype,"severity",void 0),e([g],lP.prototype,"visualizationTemplate",void 0)
11362
- const cP=lP.compose({baseName:"table-column-icon-group-header-view",template:eP,styles:QF})
11363
- wi.getOrCreate().withPrefix("nimble").register(cP())
11364
- const dP=xe`
11310
+ t instanceof NF?(this.severity=t.severity,this.text=t.text??"",this.visualizationTemplate=t.iconTemplate):t instanceof zF?(this.text=t.text??"",this.visualizationTemplate=t.spinnerTemplate):t instanceof VF&&(this.text=t.text??"")}resetState(){this.text="",this.visualizationTemplate=void 0,this.severity=RF.default}}e([g],HF.prototype,"severity",void 0),e([g],HF.prototype,"visualizationTemplate",void 0)
11311
+ const BF=HF.compose({baseName:"table-column-mapping-group-header-view",template:OF,styles:TF})
11312
+ wi.getOrCreate().withPrefix("nimble").register(BF())
11313
+ const qF=xe`
11365
11314
  ${Oo("inline-flex")}
11366
11315
 
11367
11316
  :host {
@@ -11383,7 +11332,7 @@ const dP=xe`
11383
11332
  overflow: hidden;
11384
11333
  text-overflow: ellipsis;
11385
11334
  }
11386
- `,hP=Z`
11335
+ `,UF=Z`
11387
11336
  ${He((e=>e.visualizationTemplate),Z`
11388
11337
  <span class="reserve-icon-size">
11389
11338
  ${e=>e.visualizationTemplate}
@@ -11399,19 +11348,70 @@ const dP=xe`
11399
11348
  </span>
11400
11349
  `)}
11401
11350
  `
11402
- class uP extends RO{constructor(){super(...arguments),this.textHidden=!1,this.hasOverflow=!1}columnConfigChanged(){this.updateState()}cellRecordChanged(){this.updateState()}updateState(){if(this.resetState(),!this.columnConfig||!this.cellRecord)return
11351
+ class jF extends RO{constructor(){super(...arguments),this.textHidden=!1,this.hasOverflow=!1}columnConfigChanged(){this.updateState()}cellRecordChanged(){this.updateState()}updateState(){if(this.resetState(),!this.columnConfig||!this.cellRecord)return
11403
11352
  const e=this.cellRecord.value
11404
11353
  if(null==e)return
11405
11354
  const t=this.columnConfig.mappingConfigs.get(e)
11406
- t instanceof oP?(this.severity=t.severity,this.text=t.text,this.visualizationTemplate=t.iconTemplate,this.textHidden=t.textHidden):t instanceof sP?(this.text=t.text,this.visualizationTemplate=t.spinnerTemplate,this.textHidden=t.textHidden):t instanceof aP&&(this.text=t.text,this.textHidden=!1)}resetState(){this.text=void 0,this.textHidden=!1,this.visualizationTemplate=void 0,this.severity=tP.default}}e([g],uP.prototype,"severity",void 0),e([g],uP.prototype,"text",void 0),e([g],uP.prototype,"visualizationTemplate",void 0),e([g],uP.prototype,"textHidden",void 0),e([g],uP.prototype,"hasOverflow",void 0)
11407
- const pP=uP.compose({baseName:"table-column-icon-cell-view",template:hP,styles:dP})
11408
- wi.getOrCreate().withPrefix("nimble").register(pP())
11409
- const fP="icon-size"
11410
- class mP extends(jR(UR(ZF))){minPixelWidthChanged(){this.widthMode!==fP&&(this.columnInternals.minPixelWidth=this.getConfiguredMinPixelWidth())}getColumnInternalsOptions(){return{cellRecordFieldNames:["value"],cellViewTag:"nimble-table-column-icon-cell-view",groupHeaderViewTag:"nimble-table-column-icon-group-header-view",delegatedEvents:[],sortOperation:_O,validator:new JF}}createColumnConfig(e){return{mappingConfigs:e}}createMappingConfig(e){if(e instanceof mv)return new oP(e.resolvedIcon,e.severity,e.text,e.textHidden)
11411
- if(e instanceof vv)return new sP(e.text,e.textHidden)
11412
- if(e instanceof uv)return new aP(e.text)
11413
- throw new Error("Unsupported mapping")}widthModeChanged(){this.widthMode===fP?(this.columnInternals.resizingDisabled=!0,this.columnInternals.hideHeaderIndicators=!0,this.columnInternals.pixelWidth=32,this.columnInternals.minPixelWidth=32):(this.columnInternals.resizingDisabled=!1,this.columnInternals.hideHeaderIndicators=!1,this.columnInternals.pixelWidth=void 0,this.columnInternals.minPixelWidth=this.getConfiguredMinPixelWidth())}getConfiguredMinPixelWidth(){return"number"==typeof this.minPixelWidth?this.minPixelWidth:DO}}e([le({attribute:"width-mode"})],mP.prototype,"widthMode",void 0)
11414
- const gP=mP.compose({baseName:"table-column-icon",template:KF,styles:GF})
11355
+ t instanceof NF?(this.severity=t.severity,this.text=t.text,this.visualizationTemplate=t.iconTemplate,this.textHidden=t.textHidden):t instanceof zF?(this.text=t.text,this.visualizationTemplate=t.spinnerTemplate,this.textHidden=t.textHidden):t instanceof VF&&(this.text=t.text,this.textHidden=!1)}resetState(){this.text=void 0,this.textHidden=!1,this.visualizationTemplate=void 0,this.severity=RF.default}}e([g],jF.prototype,"severity",void 0),e([g],jF.prototype,"text",void 0),e([g],jF.prototype,"visualizationTemplate",void 0),e([g],jF.prototype,"textHidden",void 0),e([g],jF.prototype,"hasOverflow",void 0)
11356
+ const WF=jF.compose({baseName:"table-column-mapping-cell-view",template:UF,styles:qF})
11357
+ wi.getOrCreate().withPrefix("nimble").register(WF())
11358
+ const ZF="icon-size"
11359
+ class GF extends(jR(UR(MF))){minPixelWidthChanged(){this.widthMode!==ZF&&(this.columnInternals.minPixelWidth=this.getConfiguredMinPixelWidth())}getColumnInternalsOptions(){return{cellRecordFieldNames:["value"],cellViewTag:"nimble-table-column-mapping-cell-view",groupHeaderViewTag:"nimble-table-column-mapping-group-header-view",delegatedEvents:[],sortOperation:_O,validator:new AF}}createColumnConfig(e){return{mappingConfigs:e}}createMappingConfig(e){if(e instanceof mv)return new NF(e.resolvedIcon,e.severity,e.text,e.textHidden)
11360
+ if(e instanceof vv)return new zF(e.text,e.textHidden)
11361
+ if(e instanceof uv)return new VF(e.text)
11362
+ throw new Error("Unsupported mapping")}widthModeChanged(){this.widthMode===ZF?(this.columnInternals.resizingDisabled=!0,this.columnInternals.hideHeaderIndicators=!0,this.columnInternals.pixelWidth=32,this.columnInternals.minPixelWidth=32):(this.columnInternals.resizingDisabled=!1,this.columnInternals.hideHeaderIndicators=!1,this.columnInternals.pixelWidth=void 0,this.columnInternals.minPixelWidth=this.getConfiguredMinPixelWidth())}getConfiguredMinPixelWidth(){return"number"==typeof this.minPixelWidth?this.minPixelWidth:DO}}e([le({attribute:"width-mode"})],GF.prototype,"widthMode",void 0)
11363
+ const KF=GF.compose({baseName:"table-column-mapping",template:_F,styles:EF})
11364
+ wi.getOrCreate().withPrefix("nimble").register(KF())
11365
+ const XF=Z`<span
11366
+ ${Zm("hasOverflow")}
11367
+ class="header-content"
11368
+ title=${e=>e.hasOverflow&&e.headerTextContent?e.headerTextContent:null}
11369
+ >
11370
+ <slot ${Ne("contentSlot")}></slot>
11371
+ <slot ${Ye({property:"unitElements",filter:Ge()})} name="unit"></slot>
11372
+ </span>`
11373
+ const YF=class extends YR{updateText(){this.text=this.columnConfig?.formatter?.format(this.groupHeaderValue)??""}}.compose({baseName:"table-column-number-text-group-header-view",template:JR,styles:QR})
11374
+ wi.getOrCreate().withPrefix("nimble").register(YF())
11375
+ const JF=class extends uF{columnConfigChanged(){super.columnConfigChanged(),this.alignment=this.columnConfig?.alignment??lF}updateText(){this.text=this.columnConfig?.formatter?.format(this.cellRecord?.value)??""}}.compose({baseName:"table-column-number-text-cell-view",template:dF,styles:hF})
11376
+ wi.getOrCreate().withPrefix("nimble").register(JF())
11377
+ const QF={default:void 0,decimal:"decimal"},eP="left",tP="right"
11378
+ class nP{format(e){if("number"!=typeof e)return""
11379
+ try{return this.tryFormat(e)}catch{return""}}}class iP{constructor(e){this.locale=e.locale,this.intlNumberFormatOptions=e.intlNumberFormatOptions}}class oP extends iP{constructor(e,t){super(e),this.formatter=new Intl.NumberFormat(this.locale,{...t,...this.intlNumberFormatOptions})}static createFactory(e){return t=>new oP(t,e)}format(e){return this.formatter.format(e)}}class rP{constructor(e,t){this.scaleFactor=e,this.scaledUnitFormatFactory=t}isBase(){return 1===this.scaleFactor}}class sP{constructor(e){this.supportedScaledUnits=e
11380
+ const t=e.every(((e,t,n)=>0===t||n[t-1].scaleFactor<e.scaleFactor))
11381
+ if(!t)throw new Error("Supported scaled units must have unique and ordered scale factors")
11382
+ const n=e.find((e=>e.isBase()))
11383
+ if(!n)throw new Error("Supported scaled units must include a base scaled unit (scale factor=1)")
11384
+ this.supportedScaledUnits=e,this.baseScaledUnit=n}scaleNumber(e){const t=Math.abs(e)
11385
+ if(1===this.supportedScaledUnits.length||0===t||t===1/0||Number.isNaN(t))return{scaledValue:e,scaledUnit:this.baseScaledUnit}
11386
+ for(let n=this.supportedScaledUnits.length-1;n>=0;n-=1){const i=this.supportedScaledUnits[n]
11387
+ if(t/i.scaleFactor>=1)return{scaledValue:e/i.scaleFactor,scaledUnit:i}}const n=this.supportedScaledUnits[0]
11388
+ return{scaledValue:e/n.scaleFactor,scaledUnit:n}}}const aP=new class extends sP{constructor(){super([new rP(1,oP.createFactory({}))])}},lP="negative"
11389
+ class cP extends nP{constructor(e,{unitScale:t=aP}={unitScale:aP}){super(),this.defaultIntlNumberFormatOptions={maximumSignificantDigits:cP.maximumDigits,maximumFractionDigits:cP.maximumDigits-1,roundingPriority:"lessPrecision",signDisplay:lP},this.defaultScaledUnitFormatters=new Map,this.exponentialIntlNumberFormatOptions={maximumSignificantDigits:cP.maximumDigits,notation:"scientific",signDisplay:lP}
11390
+ for(const n of t.supportedScaledUnits)this.defaultScaledUnitFormatters.set(n.scaleFactor,n.scaledUnitFormatFactory({locale:e,intlNumberFormatOptions:this.defaultIntlNumberFormatOptions}))
11391
+ this.exponentialScaledUnitFormatter=t.baseScaledUnit.scaledUnitFormatFactory({locale:e,intlNumberFormatOptions:this.exponentialIntlNumberFormatOptions}),this.unitScale=t}resolvedOptions(){return{unitScale:this.unitScale}}tryFormat(e){const{scaledValue:t,scaledUnit:n}=this.unitScale.scaleNumber(e),i=Math.abs(t)
11392
+ return 0!==i&&(i>=cP.exponentialUpperBound||i<cP.exponentialLowerBound)?this.exponentialScaledUnitFormatter.format(e):this.defaultScaledUnitFormatters.get(n.scaleFactor).format(t)}}cP.maximumDigits=6,cP.exponentialLowerBound=995e-6,cP.exponentialUpperBound=999999.5
11393
+ class dP extends nP{constructor(e,{minimumFractionDigits:t=0,maximumFractionDigits:n=Math.max(3,t),unitScale:i=aP}={minimumFractionDigits:0,maximumFractionDigits:3,unitScale:aP}){super(),this.scaledUnitFormatters=new Map
11394
+ const o={maximumFractionDigits:n,minimumFractionDigits:t,signDisplay:"negative"}
11395
+ for(const t of i.supportedScaledUnits)this.scaledUnitFormatters.set(t.scaleFactor,t.scaledUnitFormatFactory({locale:e,intlNumberFormatOptions:o}))
11396
+ this.unitScale=i,this.minimumFractionDigits=t,this.maximumFractionDigits=n}resolvedOptions(){return{unitScale:this.unitScale,maximumFractionDigits:this.maximumFractionDigits,minimumFractionDigits:this.minimumFractionDigits}}tryFormat(e){const{scaledValue:t,scaledUnit:n}=this.unitScale.scaleNumber(e)
11397
+ return this.scaledUnitFormatters.get(n.scaleFactor).format(t)}}class hP extends nP{constructor(e,t){super(),this._resolvedOptions=this.resolveOptions(t),this.resolvedUnitFormat=this.resolveUnitFormat(e,this._resolvedOptions)}resolvedOptions(){return{...this._resolvedOptions}}optionsMatch(e){const t=this.resolveOptions(e)
11398
+ return this._resolvedOptions.decimalDigits===t.decimalDigits&&this._resolvedOptions.decimalMaximumDigits===t.decimalMaximumDigits&&this._resolvedOptions.numberTextFormat===t.numberTextFormat&&this._resolvedOptions.unitScale===t.unitScale}tryFormat(e){return this.resolvedUnitFormat.format(e)}resolveUnitFormat(e,t){const{numberTextFormat:n,decimalMaximumDigits:i,decimalDigits:o,unitScale:r}=t
11399
+ return n===QF.default?new cP(e,{unitScale:r}):new dP(e,"number"==typeof o?{minimumFractionDigits:o,maximumFractionDigits:o,unitScale:r}:{minimumFractionDigits:0,maximumFractionDigits:i,unitScale:r})}resolveOptions(e){if(!e||e.numberTextFormat===QF.default)return{numberTextFormat:QF.default,decimalDigits:void 0,decimalMaximumDigits:void 0,unitScale:e?.unitScale??aP}
11400
+ const t="number"==typeof e.decimalDigits,n="number"==typeof e.decimalMaximumDigits
11401
+ if(t&&n)throw new Error("decimalDigits and decimalMaximumDigits are mutually exclusive. Do not specify both.")
11402
+ return t||n?{numberTextFormat:QF.decimal,decimalDigits:e.decimalDigits,decimalMaximumDigits:e.decimalMaximumDigits,unitScale:e.unitScale??aP}:{numberTextFormat:QF.decimal,decimalDigits:hP.defaultDecimalDigits,decimalMaximumDigits:void 0,unitScale:e.unitScale??aP}}}hP.defaultDecimalDigits=2
11403
+ const uP=["invalidDecimalDigits","invalidDecimalMaximumDigits","decimalDigitsMutuallyExclusiveWithDecimalMaximumDigits","moreThanOneUnitSpecified"]
11404
+ class pP extends zR{constructor(){super(uP)}validateDecimalDigits(e,t){const n=!!(e===QF.decimal&&"number"==typeof t)&&this.isInvalidDecimalDigitsValue(t)
11405
+ this.setConditionValue("invalidDecimalDigits",n)}validateDecimalMaximumDigits(e,t){const n=!!(e===QF.decimal&&"number"==typeof t)&&this.isInvalidDecimalDigitsValue(t)
11406
+ this.setConditionValue("invalidDecimalMaximumDigits",n)}validateNoMutuallyExclusiveProperties(e,t,n){const i=!!(e===QF.decimal)&&("number"==typeof t&&"number"==typeof n)
11407
+ this.setConditionValue("decimalDigitsMutuallyExclusiveWithDecimalMaximumDigits",i)}validateAtMostOneUnit(e){const t=e.length>1
11408
+ this.setConditionValue("moreThanOneUnitSpecified",t)}isInvalidDecimalDigitsValue(e){return e<0||e>20}}class fP extends Vt{}e([g],fP.prototype,"resolvedUnitScale",void 0)
11409
+ class mP extends(rF(oF)){constructor(){super(...arguments),this.langSubscriber={handleChange:()=>{this.updateColumnConfig()}},this.unitSubscriber={handleChange:()=>{this.updateColumnConfig()}}}connectedCallback(){super.connectedCallback(),_a.subscribe(this.langSubscriber,this),this.updateColumnConfig()}disconnectedCallback(){super.disconnectedCallback(),_a.unsubscribe(this.langSubscriber,this)}placeholderChanged(){this.updateColumnConfig()}getColumnInternalsOptions(){return{cellRecordFieldNames:["value"],cellViewTag:"nimble-table-column-number-text-cell-view",groupHeaderViewTag:"nimble-table-column-number-text-group-header-view",delegatedEvents:[],sortOperation:_O,validator:new pP}}updateUnitNotifier(){if(this.unitNotifier&&(this.unitNotifier.unsubscribe(this.unitSubscriber),this.unitNotifier=void 0),this.unit){const e=m.getNotifier(this.unit)
11410
+ e.subscribe(this.unitSubscriber,"resolvedUnitScale"),this.unitNotifier=e}}formatChanged(){this.updateColumnConfig()}alignmentChanged(){this.updateColumnConfig()}decimalDigitsChanged(){this.updateColumnConfig()}decimalMaximumDigitsChanged(){this.updateColumnConfig()}unitElementsChanged(){this.updateUnit()}async updateUnit(){this.unit=void 0,this.unitElements&&(await Y_(this.unitElements),this.unit=this.unitElements.find((e=>e instanceof fP))),this.updateUnitNotifier()}unitChanged(){this.updateColumnConfig()}updateColumnConfig(){const e=this.columnInternals.validator
11411
+ if(e.validateDecimalDigits(this.format,this.decimalDigits),e.validateDecimalMaximumDigits(this.format,this.decimalMaximumDigits),e.validateNoMutuallyExclusiveProperties(this.format,this.decimalDigits,this.decimalMaximumDigits),e.validateAtMostOneUnit(this.unitElements??[]),e.isValid()){const e={formatter:this.createFormatter(),alignment:this.determineCellContentAlignment(),placeholder:this.placeholder}
11412
+ this.columnInternals.columnConfig=e}else this.columnInternals.columnConfig=void 0}createFormatter(){const e=this.unit?.resolvedUnitScale
11413
+ return new hP(_a.getValueFor(this),{numberTextFormat:this.format??void 0,decimalDigits:this.decimalDigits??void 0,decimalMaximumDigits:this.decimalMaximumDigits??void 0,unitScale:e})}determineCellContentAlignment(){return this.alignment===eP?lF:this.alignment===tP?cF:this.format!==QF.decimal||"number"==typeof this.decimalMaximumDigits||this.unit?lF:cF}}e([le],mP.prototype,"format",void 0),e([le],mP.prototype,"alignment",void 0),e([le({attribute:"decimal-digits",converter:se})],mP.prototype,"decimalDigits",void 0),e([le({attribute:"decimal-maximum-digits",converter:se})],mP.prototype,"decimalMaximumDigits",void 0),e([g],mP.prototype,"unitElements",void 0),e([g],mP.prototype,"unit",void 0)
11414
+ const gP=mP.compose({baseName:"table-column-number-text",template:XF,styles:BR})
11415
11415
  wi.getOrCreate().withPrefix("nimble").register(gP())
11416
11416
  const vP=class extends uF{updateText(){this.text="string"==typeof this.cellRecord?.value?this.cellRecord.value:""}}.compose({baseName:"table-column-text-cell-view",template:dF,styles:hF})
11417
11417
  wi.getOrCreate().withPrefix("nimble").register(vP())
@@ -12399,19 +12399,19 @@ e instanceof ZP&&(e.groupSelected=!0)}}}e([le({attribute:"selection-mode"})],YP.
12399
12399
  const JP=YP.compose({baseName:"tree-view",baseClass:To,template:XP,styles:KP})
12400
12400
  wi.getOrCreate().withPrefix("nimble").register(JP())
12401
12401
  const QP=Z`<template slot="unit"></template>`
12402
- class eN{constructor(e,t,n){this.singular=e,this.plural=t,this.symbol=n}}class tN extends TF{constructor(e,{unitTranslations:t,scaledPrefixText:n}){if(super(e),!t.get("en"))throw new Error('English translations must exist with locale string "en"')
12402
+ class eN{constructor(e,t,n){this.singular=e,this.plural=t,this.symbol=n}}class tN extends iP{constructor(e,{unitTranslations:t,scaledPrefixText:n}){if(super(e),!t.get("en"))throw new Error('English translations must exist with locale string "en"')
12403
12403
  this.pluralRules=new Intl.PluralRules(this.locale),this.formatter=new Intl.NumberFormat(this.locale,this.intlNumberFormatOptions),this.unitTranslation=this.getTranslationToUse(t,this.locale),this.scaledPrefixText=n}static createFactory(e){return t=>new tN(t,e)}format(e){const t=this.formatter.format(e)
12404
12404
  if(""!==this.scaledPrefixText)return`${t} ${this.scaledPrefixText}${this.unitTranslation.symbol}`
12405
12405
  return`${t} ${"one"===this.pluralRules.select(e)?this.unitTranslation.singular:this.unitTranslation.plural}`}getTranslationToUse(e,t){const n=new Intl.Locale(t??"en"),i=n.language,o=n.region
12406
12406
  return(o?e.get(`${i}-${o}`):void 0)??e.get(i)??e.get("en")}}const nN=new Map([["en",new eN("byte","bytes","B")],["fr",new eN("octet","octets","o")],["de",new eN("Byte","Byte","B")],["ja",new eN("バイト","バイト","B")],["zh",new eN("字节","字节","B")]]),iN=[[1,""],[1024,"Ki"],[1048576,"Mi"],[1024**3,"Gi"],[1024**4,"Ti"],[1024**5,"Pi"]]
12407
- const oN=new class extends FF{constructor(){super(iN.map((([e,t])=>new RF(e,tN.createFactory({unitTranslations:nN,scaledPrefixText:t})))))}},rN=[[1,"byte","long"],[1e3,"kilobyte","short"],[1e6,"megabyte","short"],[1e3**3,"gigabyte","short"],[1e3**4,"terabyte","short"],[1e3**5,"petabyte","short"]]
12408
- const sN=new class extends FF{constructor(){super(rN.map((([e,t,n])=>new RF(e,OF.createFactory({style:"unit",unit:t,unitDisplay:n})))))}}
12409
- class aN extends qF{constructor(){super(),this.binary=!1,this.resolvedUnitScale=sN}binaryChanged(){this.resolvedUnitScale=this.binary?oN:sN}}e([le({mode:"boolean"})],aN.prototype,"binary",void 0)
12407
+ const oN=new class extends sP{constructor(){super(iN.map((([e,t])=>new rP(e,tN.createFactory({unitTranslations:nN,scaledPrefixText:t})))))}},rN=[[1,"byte","long"],[1e3,"kilobyte","short"],[1e6,"megabyte","short"],[1e3**3,"gigabyte","short"],[1e3**4,"terabyte","short"],[1e3**5,"petabyte","short"]]
12408
+ const sN=new class extends sP{constructor(){super(rN.map((([e,t,n])=>new rP(e,oP.createFactory({style:"unit",unit:t,unitDisplay:n})))))}}
12409
+ class aN extends fP{constructor(){super(),this.binary=!1,this.resolvedUnitScale=sN}binaryChanged(){this.resolvedUnitScale=this.binary?oN:sN}}e([le({mode:"boolean"})],aN.prototype,"binary",void 0)
12410
12410
  const lN=aN.compose({baseName:"unit-byte",template:QP})
12411
12411
  wi.getOrCreate().withPrefix("nimble").register(lN())
12412
12412
  const cN=[[1e-15,"f"],[1e-12,"p"],[1e-9,"n"],[10**-6,"μ"],[.001,"m"],[.01,"c"],[.1,"d"],[1,""],[1e3,"k"],[10**6,"M"],[10**9,"G"],[10**12,"T"],[10**15,"P"],[10**18,"E"]],dN=new Map([["en",new eN("volt","volts","V")],["fr",new eN("volt","volts","V")],["de",new eN("Volt","Volt","V")],["ja",new eN("ボルト","ボルト","V")],["zh",new eN("伏特","伏特","V")]])
12413
- const hN=new class extends FF{constructor(){super(cN.map((([e,t])=>new RF(e,tN.createFactory({unitTranslations:dN,scaledPrefixText:t})))))}}
12414
- const uN=class extends qF{constructor(){super(),this.resolvedUnitScale=hN}}.compose({baseName:"unit-volt",template:QP})
12413
+ const hN=new class extends sP{constructor(){super(cN.map((([e,t])=>new rP(e,tN.createFactory({unitTranslations:dN,scaledPrefixText:t})))))}}
12414
+ const uN=class extends fP{constructor(){super(),this.resolvedUnitScale=hN}}.compose({baseName:"unit-volt",template:QP})
12415
12415
  wi.getOrCreate().withPrefix("nimble").register(uN())
12416
12416
  var pN={value:()=>{}}
12417
12417
  function fN(){for(var e,t=0,n=arguments.length,i={};t<n;++t){if(!(e=arguments[t]+"")||e in i||/[\s.]/.test(e))throw new Error("illegal type: "+e)