@nanoporetech-digital/components 2.15.0 → 2.16.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 (69) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/cjs/nano-datalist_3.cjs.entry.js +1 -1
  3. package/dist/cjs/nano-datalist_3.cjs.entry.js.map +1 -1
  4. package/dist/cjs/nano-global-nav.cjs.entry.js +1 -1
  5. package/dist/cjs/nano-global-nav.cjs.entry.js.map +1 -1
  6. package/dist/cjs/nano-input.cjs.entry.js +1 -1
  7. package/dist/cjs/nano-input.cjs.entry.js.map +1 -1
  8. package/dist/cjs/nano-nav-item_2.cjs.entry.js +1 -1
  9. package/dist/cjs/nano-nav-item_2.cjs.entry.js.map +1 -1
  10. package/dist/collection/components/datalist/datalist.js +1 -1
  11. package/dist/collection/components/datalist/datalist.js.map +1 -1
  12. package/dist/collection/components/global-nav/global-nav.css +3 -2
  13. package/dist/collection/components/input/input.css +3 -3
  14. package/dist/collection/components/select/select.css +1 -0
  15. package/dist/components/datalist.js +1 -1
  16. package/dist/components/datalist.js.map +1 -1
  17. package/dist/components/input.js +1 -1
  18. package/dist/components/input.js.map +1 -1
  19. package/dist/components/nano-global-nav.js +1 -1
  20. package/dist/components/nano-global-nav.js.map +1 -1
  21. package/dist/components/select.js +1 -1
  22. package/dist/components/select.js.map +1 -1
  23. package/dist/custom-elements/index.js +4 -4
  24. package/dist/custom-elements/index.js.map +1 -1
  25. package/dist/esm/nano-datalist_3.entry.js +1 -1
  26. package/dist/esm/nano-datalist_3.entry.js.map +1 -1
  27. package/dist/esm/nano-global-nav.entry.js +1 -1
  28. package/dist/esm/nano-global-nav.entry.js.map +1 -1
  29. package/dist/esm/nano-input.entry.js +1 -1
  30. package/dist/esm/nano-input.entry.js.map +1 -1
  31. package/dist/esm/nano-nav-item_2.entry.js +1 -1
  32. package/dist/esm/nano-nav-item_2.entry.js.map +1 -1
  33. package/dist/esm-es5/nano-datalist_3.entry.js +1 -1
  34. package/dist/esm-es5/nano-datalist_3.entry.js.map +1 -1
  35. package/dist/esm-es5/nano-global-nav.entry.js +1 -1
  36. package/dist/esm-es5/nano-global-nav.entry.js.map +1 -1
  37. package/dist/esm-es5/nano-input.entry.js +1 -1
  38. package/dist/esm-es5/nano-input.entry.js.map +1 -1
  39. package/dist/esm-es5/nano-nav-item_2.entry.js +1 -1
  40. package/dist/esm-es5/nano-nav-item_2.entry.js.map +1 -1
  41. package/dist/nano-components/nano-components.esm.js +1 -1
  42. package/dist/nano-components/p-1ef47604.entry.js +5 -0
  43. package/dist/nano-components/p-1ef47604.entry.js.map +1 -0
  44. package/dist/nano-components/{p-d187fa1e.entry.js → p-42a77642.entry.js} +2 -2
  45. package/dist/nano-components/{p-d187fa1e.entry.js.map → p-42a77642.entry.js.map} +1 -1
  46. package/dist/nano-components/p-495b3195.system.entry.js +5 -0
  47. package/dist/nano-components/p-495b3195.system.entry.js.map +1 -0
  48. package/dist/nano-components/{p-d74f4b9d.entry.js → p-65192b9b.entry.js} +2 -2
  49. package/dist/nano-components/p-65192b9b.entry.js.map +1 -0
  50. package/dist/nano-components/p-6b35560c.system.js +1 -1
  51. package/dist/nano-components/{p-ed44eb45.system.entry.js → p-80c6166e.system.entry.js} +2 -2
  52. package/dist/nano-components/{p-ed44eb45.system.entry.js.map → p-80c6166e.system.entry.js.map} +1 -1
  53. package/dist/nano-components/p-c8ff4172.entry.js +5 -0
  54. package/dist/nano-components/p-c8ff4172.entry.js.map +1 -0
  55. package/dist/nano-components/{p-5841bd7a.system.entry.js → p-db8aea7a.system.entry.js} +2 -2
  56. package/dist/nano-components/p-db8aea7a.system.entry.js.map +1 -0
  57. package/dist/nano-components/{p-1137929a.system.entry.js → p-de983c13.system.entry.js} +2 -2
  58. package/dist/nano-components/p-de983c13.system.entry.js.map +1 -0
  59. package/docs-json.json +1 -1
  60. package/package.json +2 -2
  61. package/dist/nano-components/p-1137929a.system.entry.js.map +0 -1
  62. package/dist/nano-components/p-3d9623ad.entry.js +0 -5
  63. package/dist/nano-components/p-3d9623ad.entry.js.map +0 -1
  64. package/dist/nano-components/p-5841bd7a.system.entry.js.map +0 -1
  65. package/dist/nano-components/p-70a54c01.entry.js +0 -5
  66. package/dist/nano-components/p-70a54c01.entry.js.map +0 -1
  67. package/dist/nano-components/p-7f5e58b5.system.entry.js +0 -5
  68. package/dist/nano-components/p-7f5e58b5.system.entry.js.map +0 -1
  69. package/dist/nano-components/p-d74f4b9d.entry.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["src/components/input/input.scss?tag=nano-input&encapsulation=scoped","src/components/input/input.tsx"],"names":["inputCss","inputIds","Input","exports","class_1","hostRef","_this","this","inputId","concat","didBlurAfterEdit","rtl","charCount","hasRendered","hasFocus","hasLabelSlot","hasHelperSlot","hasHelperEndSlot","errorMessage","datalist","_invalid","autocapitalise","autocomplete","autocorrect","autofocus","clearInput","debounce","disabled","validateOn","showInlineError","hideLabel","floatLabel","name","readonly","required","spellcheck","type","value","resize","rows","showCharCount","validate","ev","nativeInput","validity","valid","preventDefault","validationMessage","nanoValidate","emit","isValid","originalEvent","onInput","input","target","nanoInput","onBlur","focusChanged","nanoBlur","onFocus","nanoFocus","onKeydown","shouldClearOnEdit","hasValue","clearTextInput","stopPropagation","event","window","Event","dispatchEvent","handleBlur","bind","Object","defineProperty","prototype","_nativeInputWrap","ele","setDataListOpts","currDWConfig","dropDownConfig","assign","skidding","tetherTo","nativeInputWrap","shouldValidate","requestAnimationFrame","valueChanged","nanoChange","length","style","height","scrollHeight","debounceChanged","debounceEvent","reportValidity","validateFirst","Promise","resolve","setTimeout","setFocus","focus","click","select","getInputElement","showError","message","setCustomValidity","onReset","e","form","document","querySelector","el","closest","kev","raf","KeyboardEvent","key","activeElement","FocusEvent","closestElement","tagName","toLowerCase","_a","clearOnEdit","undefined","getValue","slotChangeObserver","mo","disconnect","MutationObserver","processSlottedContent","observe","childList","subtree","querySelectorAll","console","warn","connectedCallback","CustomEvent","detail","disconnectedCallback","componentDidLoad","_","componentWillLoad","render","labelId","moreId","helperEndId","ownerDocument","dir","compWrapOptions","label","placeholder","maxlength","wrapOptions","controlId","controlOptions","clearControl","h","Host","aria-disabled","class","createColorClasses","color","has-value","has-focus","is-invalid","FormControlWrap","FormControl","onClearText","control","ref","id","aria-labelledby","accept","autoCapitalize","autoComplete","autoCorrect","autoFocus","inputMode","inputmode","min","max","minLength","minlength","maxLength","multiple","pattern","readOnly","step","size","onChange","onKeyDown","onInvalid","input__native-ctrl","input__resizable"],"mappings":";;;2ZAAA,IAAMA,EAAW,u2iBCgCjB,IAAIC,EAAW,MAqBFC,EAAKC,EAAA,aAAA,WAqBhB,SAAAC,EAAAC,GAAA,IAAAC,EAAAC,oSAnBQA,KAAAC,QAAU,cAAAC,OAAcR,KACxBM,KAAAG,iBAAmB,MACnBH,KAAAI,IAAe,MAEfJ,KAAAK,UAAY,EACZL,KAAAM,YAAc,MAmBbN,KAAAO,SAAW,MACXP,KAAAQ,aAAe,MACfR,KAAAS,cAAgB,MAChBT,KAAAU,iBAAmB,MACnBV,KAAAW,aAAuB,GACvBX,KAAAY,SAAoC,KAuBpCZ,KAAAa,SAAW,MAwBZb,KAAAc,eACN,OAKMd,KAAAe,aAA6B,MAK7Bf,KAAAgB,YAA4B,MAK5BhB,KAAAiB,UAAY,MAKZjB,KAAAkB,WAAa,MAUblB,KAAAmB,SAAW,EAKMnB,KAAAoB,SAAW,MAoBXpB,KAAAqB,WACvB,kBAKuBrB,KAAAsB,gBAAkB,KAUnCtB,KAAAuB,UAAsB,MAKtBvB,KAAAwB,WAAsB,MA8BtBxB,KAAAyB,KAAezB,KAAKC,QAeHD,KAAA0B,SAAW,MAK5B1B,KAAA2B,SAAW,MAKX3B,KAAA4B,WAAa,MAgBI5B,KAAA6B,KAAuB,OAUvB7B,KAAA8B,MAAwB,GAKzC9B,KAAA+B,OAAoC,OAKpC/B,KAAAgC,KAAO,EAKPhC,KAAAiC,cAA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,KAAKqL,QACdnC,YAAalJ,KAAKkJ,YAClBoC,SAAUtL,KAAK0B,SACfC,SAAU3B,KAAK2B,SACfC,WAAY5B,KAAK4B,WACjB2J,KAAMvL,KAAKuL,KACXC,KAAMxL,KAAKwL,KACX3J,KAAM7B,KAAK6B,KACXC,MAAOA,EACPe,QAAS7C,KAAK6C,QACd4I,SAAUzL,KAAK6C,QACfO,QAASpD,KAAKoD,QACdH,OAAQjD,KAAK+D,WACb2H,UAAW1L,KAAKsD,UAChBqI,UAAW3L,KAAKkC,WAGnBlC,KAAK6B,OAAS,YACb2H,EAAA,WAAA,CACExH,KAAMhC,KAAKwB,WAAa,EAAIxB,KAAKgC,KACjCsI,GAAItK,KAAKC,QACT0J,MAAO,CACLiC,qBAAsB,KACtBC,iBAAkB7L,KAAK+B,SAAW,QAEpCsI,IAAK,SAACvH,GAAK,OAAM/C,EAAKqC,YAAcU,GAAMyH,kBACzB5B,EAAU,IAAMC,EAAS,IAAMC,EAChDzH,SAAUpB,KAAKoB,SACfqJ,eAAgBzK,KAAKc,eACrB6J,YAAa3K,KAAKgB,YAClB4J,UAAW5K,KAAKiB,UAChB4J,UAAW7K,KAAK8K,UAChBxE,KAAMtG,KAAKsG,KACX2E,UAAWjL,KAAKkL,UAChBC,UAAWnL,KAAKmJ,UAChB1H,KAAMzB,KAAKyB,KACXyH,YAAalJ,KAAKkJ,YAClBoC,SAAUtL,KAAK0B,SACfC,SAAU3B,KAAK2B,SACfC,WAAY5B,KAAK4B,WACjBE,MAAOA,EACPe,QAAS7C,KAAK6C,QACd4I,SAAUzL,KAAK6C,QACfO,QAASpD,KAAKoD,QACdsI,UAAW1L,KAAKsD,UAChBqI,UAAW3L,KAAKkC,SAChBe,OAAQjD,KAAK+D,cAInByF,EAAA,OAAA,oiBApsBQ","sourcesContent":["@import '../../global/style/utilities/globals';\n@import '../../global/style/nano-theme/form';\n@import '../form-control/form-control';\n@import '../form-control/form-control-vars';\n\n:host {\n @include formControlVars;\n\n position: relative;\n inline-size: 100%;\n padding: 0 !important;\n color: currentColor;\n display: block;\n}\n\n:host(.nano-color) {\n color: current-color(base);\n\n --input-border-style--focus: #{$input-border-style} var(--nano-color-tint, #{nano-color(primary, tint)});\n}\n\n.input__native-ctrl {\n @include text-inherit();\n\n padding-block: 0;\n padding-inline: var(--padding-start) var(--padding-end);\n border-radius: var(--input-border-radius);\n text-overflow: ellipsis;\n color: var(--input-text-color);\n display: inline-block;\n flex: 1;\n inline-size: 100%;\n max-inline-size: 100%;\n max-block-size: 100%;\n border: 0;\n outline: none;\n background: transparent;\n appearance: none;\n margin: 0;\n box-sizing: border-box;\n resize: none;\n overflow: hidden;\n line-height: 2.5em;\n min-height: 2.5em;\n\n .has-float-label & {\n line-height: 2.1em;\n min-height: 2.1em;\n padding-block-start: 1.4em;\n }\n\n &::placeholder {\n color: var(--placeholder-color);\n font-family: inherit;\n font-style: var(--placeholder-font-style);\n font-weight: var(--placeholder-font-weight);\n opacity: var(--placeholder-opacity);\n line-height: inherit;\n min-block-size: inherit;\n }\n\n &::-moz-placeholder {\n line-height: 2.8em;\n text-overflow: ellipsis;\n }\n\n &:-webkit-autofill {\n background-color: transparent;\n }\n\n &::-webkit-search-decoration,\n &::-webkit-search-cancel-button,\n &::-webkit-search-results-button,\n &::-webkit-search-results-decoration {\n appearance: none;\n }\n\n &:invalid {\n box-shadow: none;\n }\n\n &::-ms-clear,\n &::-ms-reveal {\n display: none;\n }\n\n &.input__resizable {\n resize: vertical;\n overflow: auto;\n }\n\n .form-ctrl__textarea & {\n line-height: 1.5em;\n padding-block: var(--padding-top) 0.25em;\n white-space: pre-wrap;\n\n &::placeholder {\n line-height: 1.5em;\n }\n\n .has-float-label & {\n padding-block-start: 1.75em;\n }\n }\n\n :host([readonly]:not([readonly='false'])) & {\n user-select: none;\n }\n}\n","import {\n Build,\n Component,\n ComponentInterface,\n Element,\n Event,\n EventEmitter,\n Host,\n Method,\n Prop,\n State,\n Watch,\n h,\n Listen,\n} from '@stencil/core';\n\nimport {\n Color,\n ControlValidity,\n ControlValidityEventDetail,\n InputChangeEventDetail,\n TextFieldTypes,\n} from '../../interface';\nimport {\n debounceEvent,\n closestElement,\n createColorClasses,\n raf,\n debounce,\n} from '../../utils';\nimport { FormControl, FormControlWrap } from '../form-control/form-control';\n\nlet inputIds = 0;\n\n/**\n * The input component is a wrapper to the HTML input element with custom styling and additional functionality. It accepts most of the same properties as the HTML [input](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input), but works great on desktop devices and integrates with the keyboard on mobile devices.\n\nIt is meant for text type inputs only, such as \"text\", \"password\", \"email\", \"number\", \"search\", \"tel\", and \"url\". It supports all standard text input events including keyup, keydown, keypress, and more.\nThe default styling reference comes from the [ONT styleguide](https://nanoporetech.zeroheight.com/styleguide/s/31282/p/230c74-text-input--textarea/b/942ee4)\n * @slot start - suitable for inline action buttons or icons that may add extra contextual information\n * @slot end - suitable for inline action buttons or icons that may add extra contextual information\n * @slot value-start - similar to 'start', however clicking elements using this slot will activate the input control. This would be suitable to show a secodary 'value' for context or to show a dropdown arrow if using a datalist\n * @slot value-end - similar to 'end', however clicking elements using this slot will activate the input control. This would be suitable to show a secodary 'value' for context or to show a dropdown arrow if using a datalist\n * @slot label - if you do not set a label attribute, you can use this slot for more complex markup\n * @slot helper - helper text to accompany the form field underneath.\n * @slot helper-end - helper text to accompany the form field on the side.\n * @slot - can be used with a `nano-datalist`. See the `nano-datalist` docs for more information\n */\n@Component({\n tag: 'nano-input',\n styleUrl: 'input.scss',\n scoped: true,\n})\nexport class Input implements ComponentInterface {\n private nativeInput?: HTMLInputElement | HTMLTextAreaElement;\n private inputId = `nano-input-${inputIds++}`;\n private didBlurAfterEdit = false;\n private rtl: boolean = false;\n private mo?: MutationObserver;\n private charCount = 0;\n private hasRendered = false;\n\n // we don't want these rendered eles decorated with @State\n // because that will cause re-renders. User get/set to set datalist options\n private _nativeInputWrap: HTMLElement;\n private get nativeInputWrap() {\n return this._nativeInputWrap;\n }\n private set nativeInputWrap(ele: HTMLElement) {\n if (this._nativeInputWrap === ele) return;\n this._nativeInputWrap = ele;\n this.setDataListOpts();\n }\n\n constructor() {\n this.validate = debounce(this.validate, 50);\n this.handleBlur = this.handleBlur.bind(this);\n }\n\n @State() hasFocus = false;\n @State() hasLabelSlot = false;\n @State() hasHelperSlot = false;\n @State() hasHelperEndSlot = false;\n @State() errorMessage: string = '';\n @State() datalist: HTMLNanoDatalistElement = null;\n\n @Watch('datalist')\n setDataListOpts() {\n if (!this.datalist) return;\n const currDWConfig = this.datalist.dropDownConfig || {};\n this.datalist.dropDownConfig = {\n ...currDWConfig,\n skidding: -1,\n tetherTo: this.nativeInputWrap,\n };\n }\n\n @Element() el!: HTMLNanoInputElement;\n\n /**\n * This will be true when the control is in an invalid state.\n * Validity is determined by the `required` prop. Or if custom validity message is set. @readonly\n */\n @Prop({ reflect: true })\n get invalid() {\n return this._invalid;\n }\n @State() _invalid = false;\n\n /**\n * Current validation message - if any. @readonly\n */\n @Prop()\n get validityMessage() {\n if (!this.nativeInput) return '';\n return this.nativeInput.validationMessage;\n }\n\n /**\n * The color to use from the application's color palette.\n */\n @Prop() color?: Color;\n\n /**\n * If the value of the type attribute is `\"file\"`, then this attribute will indicate the types of files that the server accepts, otherwise it will be ignored. The value must be a comma-separated list of unique content type specifiers.\n */\n @Prop() accept?: string;\n\n /**\n * Indicates whether and how the text value should be automatically capitalized as it is entered/edited by the user.\n */\n @Prop() autocapitalise: 'none' | 'sentences' | 'words' | 'characters' =\n 'none';\n\n /**\n * Indicates whether the value of the control can be automatically completed by the browser.\n */\n @Prop() autocomplete: 'on' | 'off' = 'off';\n\n /**\n * Whether auto correction should be enabled when the user is entering/editing the text value.\n */\n @Prop() autocorrect: 'on' | 'off' = 'off';\n\n /**\n * This Boolean attribute lets you specify that a form control should have input focus when the page loads.\n */\n @Prop() autofocus = false;\n\n /**\n * If `true`, a clear icon will appear in the input when there is a value. Clicking it clears the input.\n */\n @Prop() clearInput = false;\n\n /**\n * If `true`, the value will be cleared after focus upon edit. Defaults to `true` when `type` is `\"password\"`, `false` for all other types.\n */\n @Prop() clearOnEdit?: boolean;\n\n /**\n * Set the amount of time, in milliseconds, to wait to trigger the `nanoChange` event after each keystroke.\n */\n @Prop() debounce = 0;\n\n /**\n * If `true`, the user cannot interact with the input.\n */\n @Prop({ reflect: true }) disabled = false;\n\n /**\n * A hint to the browser for which keyboard to display.\n * Possible values: `\"none\"`, `\"text\"`, `\"tel\"`, `\"url\"`,\n * `\"email\"`, `\"numeric\"`, `\"decimal\"`, and `\"search\"`.\n */\n @Prop() inputmode?:\n | 'none'\n | 'text'\n | 'tel'\n | 'url'\n | 'email'\n | 'numeric'\n | 'decimal'\n | 'search';\n\n /**\n * When should the field perform validation\n */\n @Prop({ mutable: true }) validateOn: 'dirty' | 'submit' | 'submitThenDirty' =\n 'submitThenDirty';\n\n /**\n * Whether to show validation errors underneath input\n */\n @Prop({ reflect: true }) showInlineError = true;\n\n /**\n * String to place within a label element. Alternatively you may use a label slot.\n */\n @Prop() label!: string;\n\n /**\n * Visually hide the label - but make it accessible.\n */\n @Prop() hideLabel?: boolean = false;\n\n /**\n * Enable floating label behaviour. Will disable placeholder if set.\n */\n @Prop() floatLabel: boolean = false;\n\n /**\n * The maximum value, which must not be less than its minimum (min attribute) value.\n */\n @Prop() max?: string;\n\n /**\n * If the value of the type attribute is `text`, `email`, `search`, `password`, `tel`, or `url`, this attribute specifies the maximum number of characters that the user can enter.\n */\n @Prop() maxlength?: number;\n\n /**\n * The minimum value, which must not be greater than its maximum (max attribute) value.\n */\n @Prop() min?: string;\n\n /**\n * If the value of the type attribute is `text`, `email`, `search`, `password`, `tel`, or `url`, this attribute specifies the minimum number of characters that the user can enter.\n */\n @Prop() minlength?: number;\n\n /**\n * If `true`, the user can enter more than one value. This attribute applies when the type attribute is set to `\"email\"` or `\"file\"`, otherwise it is ignored.\n */\n @Prop() multiple?: boolean;\n\n /**\n * The name of the control, which is submitted with the form data.\n */\n @Prop() name: string = this.inputId;\n\n /**\n * A regular expression that the value is checked against. The pattern must match the entire value, not just some subset. Use the title attribute to describe the pattern to help the user. This attribute applies when the value of the type attribute is `\"text\"`, `\"search\"`, `\"tel\"`, `\"url\"`, `\"email\"`, or `\"password\"`, otherwise it is ignored.\n */\n @Prop() pattern?: string;\n\n /**\n * Instructional text that shows before the input has a value.\n */\n @Prop() placeholder?: string | null;\n\n /**\n * If `true`, the user cannot modify the value.\n */\n @Prop({ reflect: true }) readonly = false;\n\n /**\n * If `true`, the user must fill in a value before submitting a form.\n */\n @Prop() required = false;\n\n /**\n * If `true`, the element will have its spelling and grammar checked.\n */\n @Prop() spellcheck = false;\n\n /**\n * Works with the min and max attributes to limit the increments at which a value can be set.\n * Possible values are: `\"any\"` or a positive floating point number.\n */\n @Prop() step?: string;\n\n /**\n * The initial size of the control. This value is in pixels unless the value of the type attribute is `\"text\"` or `\"password\"`, in which case it is an integer number of characters. This attribute applies only when the `type` attribute is set to `\"text\"`, `\"search\"`, `\"tel\"`, `\"url\"`, `\"email\"`, or `\"password\"`, otherwise it is ignored.\n */\n @Prop() size?: number;\n\n /**\n * The type of control to display. The default type is text.\n */\n @Prop({ reflect: true }) type: TextFieldTypes = 'text';\n\n /**\n * The form element to associate the input with (its form owner). Must be the id of a form.\n */\n @Prop() form?: string | null;\n\n /**\n * The value of the input.\n */\n @Prop({ mutable: true }) value?: string | null = '';\n\n /**\n * relevant to type=\"textarea\". Vertical resizing - enable / disable or make automatic.\n */\n @Prop() resize: 'true' | 'false' | 'auto' = 'auto';\n\n /**\n * relevant to type=\"textarea\". Default number of rows to show\n */\n @Prop() rows = 2;\n\n /**\n * relevant to type=\"textarea\".\n */\n @Prop() showCharCount = false;\n\n @Watch('minlength')\n @Watch('maxlength')\n @Watch('min')\n @Watch('max')\n @Watch('required')\n @Watch('disabled')\n @Watch('readonly')\n @Watch('pattern')\n @Watch('inputmode')\n protected shouldValidate() {\n if (!this.hasRendered) return;\n requestAnimationFrame(() => {\n if (this.validateOn === 'dirty') this.validate();\n });\n }\n\n /**\n * Update the native input element when the value changes\n */\n @Watch('value')\n protected valueChanged() {\n this.nanoChange.emit({ value: this.value });\n this.charCount = this.value.length;\n\n if (this.type === 'textarea' && this.resize === 'auto') {\n this.nativeInput.style.height = 'auto';\n if (this.value.length)\n this.nativeInput.style.height = this.nativeInput.scrollHeight + 'px';\n }\n\n requestAnimationFrame(() => {\n if (this.validateOn === 'dirty') this.validate();\n });\n }\n\n @Watch('debounce')\n protected debounceChanged() {\n this.nanoChange = debounceEvent(this.nanoChange, this.debounce);\n }\n\n /**\n * Emitted when a keyboard input occurred.\n */\n @Event() nanoInput!: EventEmitter<InputEvent>;\n\n /**\n * Emitted when the value has changed.\n */\n @Event() nanoChange!: EventEmitter<InputChangeEventDetail>;\n\n /**\n * Emitted when the input loses focus.\n */\n @Event() nanoBlur!: EventEmitter<void>;\n\n /**\n * Emitted when the input has focus.\n */\n @Event() nanoFocus!: EventEmitter<void>;\n\n /**\n * Emitted when the input has been created.\n * @internal\n */\n @Event() nanoDidLoad!: EventEmitter<void>;\n\n /**\n * Emitted when the input has been removed.\n * @internal\n */\n @Event() nanoDidUnload!: EventEmitter<void>;\n\n /**\n * Called when validation is performed (which depends on `validateOn`).\n * @returns event.detail: `{ isValid: boolean, errorMessage: string, originalEvent: Event }`.\n */\n @Event() nanoValidate: EventEmitter<ControlValidityEventDetail>;\n\n /**\n * Get the current state of the control.\n * @param validateFirst - perform validation first before reporting\n * @returns `{ isValid: boolean, errorMessage: string }`\n */\n @Method()\n async reportValidity(validateFirst: boolean): Promise<ControlValidity> {\n return new Promise((resolve) => {\n if (validateFirst) this.validate();\n setTimeout(() => {\n resolve({\n isValid: !this._invalid,\n errorMessage: this.nativeInput.validationMessage,\n });\n }, 50);\n });\n }\n\n /**\n * Sets focus on the specified `nano-input`. Use this method instead of the global\n * `input.focus()`.\n */\n @Method()\n async setFocus() {\n if (this.nativeInput) {\n this.nativeInput.focus();\n this.nativeInput.click();\n }\n }\n\n /**\n * Sets focus and select the text on the specified `nano-input`. Use this method instead of the global\n * `input.select()`.\n */\n @Method()\n async select() {\n if (this.nativeInput) {\n this.nativeInput.select();\n }\n }\n\n /**\n * @returns the native `<input>` element used under the hood.\n */\n @Method()\n getInputElement(): Promise<HTMLInputElement | HTMLTextAreaElement> {\n return Promise.resolve(this.nativeInput);\n }\n\n /**\n * Invalidate the field and show a custom error message. To clear the error you will need to re-call this method with an empty string.\n */\n @Method()\n async showError(message: string) {\n if (this.nativeInput) {\n this.nativeInput.setCustomValidity(message);\n this.validate();\n }\n }\n\n @Listen('reset', { target: 'body' })\n onReset(e) {\n const form = this.form\n ? document.querySelector('#' + this.form)\n : this.el.closest('form');\n if (!form || e.target !== this.el.closest('form')) return;\n\n this.value = '';\n }\n\n @Listen('mousedown', { target: 'body' })\n @Listen('keydown')\n handleBlur(e: KeyboardEvent | MouseEvent | FocusEvent) {\n if (!this.hasFocus) return;\n\n const kev = e as KeyboardEvent;\n let target: Element;\n\n raf(() => {\n if (e instanceof KeyboardEvent && kev.key) {\n if (kev.key !== 'Tab') return;\n target = document.activeElement;\n } else if (e instanceof FocusEvent) {\n target = document.activeElement;\n } else target = e.target as Element;\n\n if (closestElement(this.el.tagName.toLowerCase(), target) !== this.el) {\n this.onBlur();\n }\n });\n }\n\n private shouldClearOnEdit() {\n const { type, clearOnEdit } = this;\n return clearOnEdit === undefined ? type === 'password' : clearOnEdit;\n }\n\n private getValue(): string {\n return this.value || '';\n }\n\n private validate = (ev?: Event) => {\n if (this.validateOn === 'submitThenDirty') this.validateOn = 'dirty';\n\n if (!this.nativeInput.validity.valid) {\n if (this.showInlineError) {\n if (ev) ev.preventDefault();\n this.errorMessage = this.nativeInput.validationMessage;\n }\n this._invalid = true;\n } else this._invalid = false;\n\n this.nanoValidate.emit({\n isValid: !this._invalid,\n errorMessage: this.nativeInput.validationMessage,\n originalEvent: ev,\n });\n };\n\n private onInput = (ev: InputEvent) => {\n const input = ev.target as HTMLInputElement | null;\n this.value = input?.value || '';\n this.nanoInput.emit(ev);\n };\n\n private onBlur = () => {\n this.hasFocus = false;\n this.focusChanged();\n if (this.validateOn === 'dirty') this.validate();\n this.nanoBlur.emit();\n };\n\n private onFocus = () => {\n this.hasFocus = true;\n this.focusChanged();\n this.nanoFocus.emit();\n };\n\n private onKeydown = () => {\n if (this.shouldClearOnEdit()) {\n // Did the input value change after it was blurred and edited?\n if (this.didBlurAfterEdit && this.hasValue()) {\n // Clear the input\n this.clearTextInput();\n }\n\n // Reset the flag\n this.didBlurAfterEdit = false;\n }\n };\n\n private clearTextInput = (ev?: Event) => {\n if (this.clearInput && !this.readonly && !this.disabled && ev) {\n ev.preventDefault();\n ev.stopPropagation();\n }\n\n this.value = '';\n this.nativeInput.value = '';\n const event = new window.Event('change');\n this.nativeInput.dispatchEvent(event);\n };\n\n private focusChanged() {\n // If clearOnEdit is enabled and the input blurred but has a value, set a flag\n if (!this.hasFocus && this.shouldClearOnEdit() && this.hasValue()) {\n this.didBlurAfterEdit = true;\n }\n }\n\n private hasValue(): boolean {\n return this.getValue().length > 0;\n }\n\n private slotChangeObserver() {\n if (!Build.isBrowser) return;\n\n if (this.mo) this.mo.disconnect();\n const mo = (this.mo = new MutationObserver(() =>\n this.processSlottedContent()\n ));\n mo.observe(this.el, { childList: true, subtree: true });\n }\n\n private processSlottedContent() {\n // see if we have label / button content\n this.hasLabelSlot = !!this.el.querySelectorAll('[slot=\"label\"]');\n this.hasHelperSlot = !!this.el.querySelector('[slot=\"helper\"]');\n this.hasHelperEndSlot = !!this.el.querySelector('[slot=\"helper-end\"]');\n this.datalist = this.el.querySelector('nano-datalist:not([slot])');\n\n // breaking change introduced in v2. Rm in v3\n if (!!this.el.querySelector('[slot=\"inline-button\"]')) {\n console.warn(\n 'The `inline-button` slot was renamed to `end` in v2 - please update your code',\n this.el\n );\n }\n }\n\n connectedCallback() {\n this.debounceChanged();\n if (Build.isBrowser) {\n this.el.dispatchEvent(\n new CustomEvent('nanoDidLoad', {\n detail: this.el,\n })\n );\n }\n }\n\n disconnectedCallback() {\n if (Build.isBrowser) {\n document.dispatchEvent(\n new CustomEvent('nanoDidUnload', {\n detail: this.el,\n })\n );\n }\n if (this.mo) this.mo.disconnect();\n }\n\n componentDidLoad() {\n this.slotChangeObserver();\n this.hasRendered = true;\n if (this.autofocus) setTimeout((_) => this.setFocus(), 300);\n }\n\n componentWillLoad() {\n this.processSlottedContent();\n }\n\n render() {\n const value = this.getValue();\n const labelId = this.inputId + '-lbl';\n const moreId =\n this.showInlineError || this.hasHelperSlot ? this.inputId + '-more' : '';\n const helperEndId = this.hasHelperEndSlot ? this.inputId + '-helper' : '';\n this.rtl = (this.el.ownerDocument as Document).dir === 'rtl';\n\n const compWrapOptions = (({\n el,\n floatLabel,\n label,\n errorMessage,\n type,\n showInlineError,\n hasHelperSlot,\n hasLabelSlot,\n hideLabel,\n placeholder,\n maxlength,\n charCount,\n showCharCount,\n rtl,\n hasHelperEndSlot,\n }) => ({\n el,\n floatLabel,\n label,\n errorMessage,\n type,\n showInlineError,\n hasHelperSlot,\n hasLabelSlot,\n hideLabel,\n placeholder,\n maxlength,\n charCount,\n showCharCount,\n rtl,\n hasHelperEndSlot,\n }))(this);\n const wrapOptions = {\n ...compWrapOptions,\n labelId,\n moreId,\n helperEndId,\n hasValue: this.hasValue(),\n controlId: this.inputId,\n };\n\n const controlOptions = (({ clearInput, readonly, disabled }) => ({\n clearInput,\n readonly,\n disabled,\n clearControl: this.clearInput,\n }))(this);\n\n return (\n <Host\n aria-disabled={this.disabled ? 'true' : null}\n dir={this.rtl ? 'rtl' : null}\n class={{\n ...createColorClasses(this.color),\n 'has-value': this.hasValue(),\n 'has-focus': this.hasFocus,\n 'is-invalid': this._invalid,\n }}\n >\n <FormControlWrap {...wrapOptions}>\n <FormControl\n {...controlOptions}\n onClearText={this.clearTextInput}\n control={this.el}\n ref={(el) => (this.nativeInputWrap = el)}\n >\n {this.type !== 'textarea' && (\n <input\n id={this.inputId}\n class=\"input__native-ctrl\"\n ref={(input) => (this.nativeInput = input)}\n aria-labelledby={labelId + ' ' + moreId + ' ' + helperEndId}\n disabled={this.disabled}\n accept={this.accept}\n autoCapitalize={this.autocapitalise}\n autoComplete={this.autocomplete}\n autoCorrect={this.autocorrect}\n autoFocus={this.autofocus}\n inputMode={this.inputmode}\n form={this.form}\n min={this.min}\n max={this.max}\n minLength={this.minlength}\n maxLength={this.maxlength}\n multiple={this.multiple}\n name={this.name}\n pattern={this.pattern}\n placeholder={this.placeholder}\n readOnly={this.readonly}\n required={this.required}\n spellcheck={this.spellcheck}\n step={this.step}\n size={this.size}\n type={this.type}\n value={value}\n onInput={this.onInput}\n onChange={this.onInput}\n onFocus={this.onFocus}\n onBlur={this.handleBlur}\n onKeyDown={this.onKeydown}\n onInvalid={this.validate}\n />\n )}\n {this.type === 'textarea' && (\n <textarea\n rows={this.floatLabel ? 1 : this.rows}\n id={this.inputId}\n class={{\n 'input__native-ctrl': true,\n input__resizable: this.resize === 'true',\n }}\n ref={(input) => (this.nativeInput = input)}\n aria-labelledby={labelId + ' ' + moreId + ' ' + helperEndId}\n disabled={this.disabled}\n autoCapitalize={this.autocapitalise}\n autoCorrect={this.autocorrect}\n autoFocus={this.autofocus}\n inputMode={this.inputmode}\n form={this.form}\n minLength={this.minlength}\n maxLength={this.maxlength}\n name={this.name}\n placeholder={this.placeholder}\n readOnly={this.readonly}\n required={this.required}\n spellcheck={this.spellcheck}\n value={value}\n onInput={this.onInput}\n onChange={this.onInput}\n onFocus={this.onFocus}\n onKeyDown={this.onKeydown}\n onInvalid={this.validate}\n onBlur={this.handleBlur}\n ></textarea>\n )}\n </FormControl>\n <slot />\n </FormControlWrap>\n </Host>\n );\n }\n}\n"]}
package/docs-json.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "timestamp": "2022-10-04T16:28:16",
2
+ "timestamp": "2022-10-10T15:39:08",
3
3
  "compiler": {
4
4
  "name": "@stencil/core",
5
5
  "version": "2.17.4",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nanoporetech-digital/components",
3
- "version": "2.15.0",
3
+ "version": "2.16.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://git.oxfordnanolabs.local/Digital/nano-components"
@@ -121,5 +121,5 @@
121
121
  "nanopore",
122
122
  "digital"
123
123
  ],
124
- "gitHead": "f58daf77f531897cc515d4ac3192f455bfdf95ce"
124
+ "gitHead": "0a8ce1192405c74e796f724166585a7758c01c24"
125
125
  }
@@ -1 +0,0 @@
1
- {"version":3,"sources":["src/components/input/input.scss?tag=nano-input&encapsulation=scoped","src/components/input/input.tsx"],"names":["inputCss","inputIds","Input","exports","class_1","hostRef","_this","this","inputId","concat","didBlurAfterEdit","rtl","charCount","hasRendered","hasFocus","hasLabelSlot","hasHelperSlot","hasHelperEndSlot","errorMessage","datalist","_invalid","autocapitalise","autocomplete","autocorrect","autofocus","clearInput","debounce","disabled","validateOn","showInlineError","hideLabel","floatLabel","name","readonly","required","spellcheck","type","value","resize","rows","showCharCount","validate","ev","nativeInput","validity","valid","preventDefault","validationMessage","nanoValidate","emit","isValid","originalEvent","onInput","input","target","nanoInput","onBlur","focusChanged","nanoBlur","onFocus","nanoFocus","onKeydown","shouldClearOnEdit","hasValue","clearTextInput","stopPropagation","event","window","Event","dispatchEvent","handleBlur","bind","Object","defineProperty","prototype","_nativeInputWrap","ele","setDataListOpts","currDWConfig","dropDownConfig","assign","skidding","tetherTo","nativeInputWrap","shouldValidate","requestAnimationFrame","valueChanged","nanoChange","length","style","height","scrollHeight","debounceChanged","debounceEvent","reportValidity","validateFirst","Promise","resolve","setTimeout","setFocus","focus","click","select","getInputElement","showError","message","setCustomValidity","onReset","e","form","document","querySelector","el","closest","kev","raf","KeyboardEvent","key","activeElement","FocusEvent","closestElement","tagName","toLowerCase","_a","clearOnEdit","undefined","getValue","slotChangeObserver","mo","disconnect","MutationObserver","processSlottedContent","observe","childList","subtree","querySelectorAll","console","warn","connectedCallback","CustomEvent","detail","disconnectedCallback","componentDidLoad","_","componentWillLoad","render","labelId","moreId","helperEndId","ownerDocument","dir","compWrapOptions","label","placeholder","maxlength","wrapOptions","controlId","controlOptions","clearControl","h","Host","aria-disabled","class","createColorClasses","color","has-value","has-focus","is-invalid","FormControlWrap","FormControl","onClearText","control","ref","id","aria-labelledby","accept","autoCapitalize","autoComplete","autoCorrect","autoFocus","inputMode","inputmode","min","max","minLength","minlength","maxLength","multiple","pattern","readOnly","step","size","onChange","onKeyDown","onInvalid","input__native-ctrl","input__resizable"],"mappings":";;;2ZAAA,IAAMA,EAAW,23iBCgCjB,IAAIC,EAAW,MAqBFC,EAAKC,EAAA,aAAA,WAqBhB,SAAAC,EAAAC,GAAA,IAAAC,EAAAC,oSAnBQA,KAAAC,QAAU,cAAAC,OAAcR,KACxBM,KAAAG,iBAAmB,MACnBH,KAAAI,IAAe,MAEfJ,KAAAK,UAAY,EACZL,KAAAM,YAAc,MAmBbN,KAAAO,SAAW,MACXP,KAAAQ,aAAe,MACfR,KAAAS,cAAgB,MAChBT,KAAAU,iBAAmB,MACnBV,KAAAW,aAAuB,GACvBX,KAAAY,SAAoC,KAuBpCZ,KAAAa,SAAW,MAwBZb,KAAAc,eACN,OAKMd,KAAAe,aAA6B,MAK7Bf,KAAAgB,YAA4B,MAK5BhB,KAAAiB,UAAY,MAKZjB,KAAAkB,WAAa,MAUblB,KAAAmB,SAAW,EAKMnB,KAAAoB,SAAW,MAoBXpB,KAAAqB,WACvB,kBAKuBrB,KAAAsB,gBAAkB,KAUnCtB,KAAAuB,UAAsB,MAKtBvB,KAAAwB,WAAsB,MA8BtBxB,KAAAyB,KAAezB,KAAKC,QAeHD,KAAA0B,SAAW,MAK5B1B,KAAA2B,SAAW,MAKX3B,KAAA4B,WAAa,MAgBI5B,KAAA6B,KAAuB,OAUvB7B,KAAA8B,MAAwB,GAKzC9B,KAAA+B,OAAoC,OAKpC/B,KAAAgC,KAAO,EAKPhC,KAAAiC,cAAgB,MAq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L,QACdnC,YAAalJ,KAAKkJ,YAClBoC,SAAUtL,KAAK0B,SACfC,SAAU3B,KAAK2B,SACfC,WAAY5B,KAAK4B,WACjB2J,KAAMvL,KAAKuL,KACXC,KAAMxL,KAAKwL,KACX3J,KAAM7B,KAAK6B,KACXC,MAAOA,EACPe,QAAS7C,KAAK6C,QACd4I,SAAUzL,KAAK6C,QACfO,QAASpD,KAAKoD,QACdH,OAAQjD,KAAK+D,WACb2H,UAAW1L,KAAKsD,UAChBqI,UAAW3L,KAAKkC,WAGnBlC,KAAK6B,OAAS,YACb2H,EAAA,WAAA,CACExH,KAAMhC,KAAKwB,WAAa,EAAIxB,KAAKgC,KACjCsI,GAAItK,KAAKC,QACT0J,MAAO,CACLiC,qBAAsB,KACtBC,iBAAkB7L,KAAK+B,SAAW,QAEpCsI,IAAK,SAACvH,GAAK,OAAM/C,EAAKqC,YAAcU,GAAMyH,kBACzB5B,EAAU,IAAMC,EAAS,IAAMC,EAChDzH,SAAUpB,KAAKoB,SACfqJ,eAAgBzK,KAAKc,eACrB6J,YAAa3K,KAAKgB,YAClB4J,UAAW5K,KAAKiB,UAChB4J,UAAW7K,KAAK8K,UAChBxE,KAAMtG,KAAKsG,KACX2E,UAAWjL,KAAKkL,UAChBC,UAAWnL,KAAKmJ,UAChB1H,KAAMzB,KAAKyB,KACXyH,YAAalJ,KAAKkJ,YAClBoC,SAAUtL,KAAK0B,SACfC,SAAU3B,KAAK2B,SACfC,WAAY5B,KAAK4B,WACjBE,MAAOA,EACPe,QAAS7C,KAAK6C,QACd4I,SAAUzL,KAAK6C,QACfO,QAASpD,KAAKoD,QACdsI,UAAW1L,KAAKsD,UAChBqI,UAAW3L,KAAKkC,SAChBe,OAAQjD,KAAK+D,cAInByF,EAAA,OAAA,oiBApsBQ","sourcesContent":["@import '../../global/style/utilities/globals';\n@import '../../global/style/nano-theme/form';\n@import '../form-control/form-control';\n@import '../form-control/form-control-vars';\n\n:host {\n @include formControlVars;\n\n position: relative;\n inline-size: 100%;\n padding: 0 !important;\n color: currentColor;\n display: block;\n}\n\n:host(.nano-color) {\n color: current-color(base);\n\n --input-border-style--focus: #{$input-border-style} var(--nano-color-tint, #{nano-color(primary, tint)});\n}\n\n.input__native-ctrl {\n @include text-inherit();\n\n padding-block: logical unset;\n padding-inline: var(--padding-start) var(--padding-end);\n border-radius: var(--input-border-radius);\n text-overflow: ellipsis;\n color: var(--input-text-color);\n display: inline-block;\n flex: 1;\n inline-size: 100%;\n max-inline-size: 100%;\n max-block-size: 100%;\n border: 0;\n outline: none;\n background: transparent;\n appearance: none;\n margin: 0;\n box-sizing: border-box;\n resize: none;\n overflow: hidden;\n line-height: 2.5em;\n min-block-size: 2.5em;\n\n .has-float-label & {\n line-height: 2.1em;\n min-block-size: 2.1em;\n padding-block-start: 1.4em;\n }\n\n &::placeholder {\n color: var(--placeholder-color);\n font-family: inherit;\n font-style: var(--placeholder-font-style);\n font-weight: var(--placeholder-font-weight);\n opacity: var(--placeholder-opacity);\n line-height: inherit;\n min-block-size: inherit;\n }\n\n &::-moz-placeholder {\n line-height: 2.8em;\n text-overflow: ellipsis;\n }\n\n &:-webkit-autofill {\n background-color: transparent;\n }\n\n &::-webkit-search-decoration,\n &::-webkit-search-cancel-button,\n &::-webkit-search-results-button,\n &::-webkit-search-results-decoration {\n appearance: none;\n }\n\n &:invalid {\n box-shadow: none;\n }\n\n &::-ms-clear,\n &::-ms-reveal {\n display: none;\n }\n\n &.input__resizable {\n resize: vertical;\n overflow: auto;\n }\n\n .form-ctrl__textarea & {\n line-height: 1.5em;\n padding-block: var(--padding-top) 0.25em;\n white-space: pre-wrap;\n\n &::placeholder {\n line-height: 1.5em;\n }\n\n .has-float-label & {\n padding-block-start: 1.75em;\n }\n }\n\n :host([readonly]:not([readonly='false'])) & {\n user-select: none;\n }\n}\n","import {\n Build,\n Component,\n ComponentInterface,\n Element,\n Event,\n EventEmitter,\n Host,\n Method,\n Prop,\n State,\n Watch,\n h,\n Listen,\n} from '@stencil/core';\n\nimport {\n Color,\n ControlValidity,\n ControlValidityEventDetail,\n InputChangeEventDetail,\n TextFieldTypes,\n} from '../../interface';\nimport {\n debounceEvent,\n closestElement,\n createColorClasses,\n raf,\n debounce,\n} from '../../utils';\nimport { FormControl, FormControlWrap } from '../form-control/form-control';\n\nlet inputIds = 0;\n\n/**\n * The input component is a wrapper to the HTML input element with custom styling and additional functionality. It accepts most of the same properties as the HTML [input](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input), but works great on desktop devices and integrates with the keyboard on mobile devices.\n\nIt is meant for text type inputs only, such as \"text\", \"password\", \"email\", \"number\", \"search\", \"tel\", and \"url\". It supports all standard text input events including keyup, keydown, keypress, and more.\nThe default styling reference comes from the [ONT styleguide](https://nanoporetech.zeroheight.com/styleguide/s/31282/p/230c74-text-input--textarea/b/942ee4)\n * @slot start - suitable for inline action buttons or icons that may add extra contextual information\n * @slot end - suitable for inline action buttons or icons that may add extra contextual information\n * @slot value-start - similar to 'start', however clicking elements using this slot will activate the input control. This would be suitable to show a secodary 'value' for context or to show a dropdown arrow if using a datalist\n * @slot value-end - similar to 'end', however clicking elements using this slot will activate the input control. This would be suitable to show a secodary 'value' for context or to show a dropdown arrow if using a datalist\n * @slot label - if you do not set a label attribute, you can use this slot for more complex markup\n * @slot helper - helper text to accompany the form field underneath.\n * @slot helper-end - helper text to accompany the form field on the side.\n * @slot - can be used with a `nano-datalist`. See the `nano-datalist` docs for more information\n */\n@Component({\n tag: 'nano-input',\n styleUrl: 'input.scss',\n scoped: true,\n})\nexport class Input implements ComponentInterface {\n private nativeInput?: HTMLInputElement | HTMLTextAreaElement;\n private inputId = `nano-input-${inputIds++}`;\n private didBlurAfterEdit = false;\n private rtl: boolean = false;\n private mo?: MutationObserver;\n private charCount = 0;\n private hasRendered = false;\n\n // we don't want these rendered eles decorated with @State\n // because that will cause re-renders. User get/set to set datalist options\n private _nativeInputWrap: HTMLElement;\n private get nativeInputWrap() {\n return this._nativeInputWrap;\n }\n private set nativeInputWrap(ele: HTMLElement) {\n if (this._nativeInputWrap === ele) return;\n this._nativeInputWrap = ele;\n this.setDataListOpts();\n }\n\n constructor() {\n this.validate = debounce(this.validate, 50);\n this.handleBlur = this.handleBlur.bind(this);\n }\n\n @State() hasFocus = false;\n @State() hasLabelSlot = false;\n @State() hasHelperSlot = false;\n @State() hasHelperEndSlot = false;\n @State() errorMessage: string = '';\n @State() datalist: HTMLNanoDatalistElement = null;\n\n @Watch('datalist')\n setDataListOpts() {\n if (!this.datalist) return;\n const currDWConfig = this.datalist.dropDownConfig || {};\n this.datalist.dropDownConfig = {\n ...currDWConfig,\n skidding: -1,\n tetherTo: this.nativeInputWrap,\n };\n }\n\n @Element() el!: HTMLNanoInputElement;\n\n /**\n * This will be true when the control is in an invalid state.\n * Validity is determined by the `required` prop. Or if custom validity message is set. @readonly\n */\n @Prop({ reflect: true })\n get invalid() {\n return this._invalid;\n }\n @State() _invalid = false;\n\n /**\n * Current validation message - if any. @readonly\n */\n @Prop()\n get validityMessage() {\n if (!this.nativeInput) return '';\n return this.nativeInput.validationMessage;\n }\n\n /**\n * The color to use from the application's color palette.\n */\n @Prop() color?: Color;\n\n /**\n * If the value of the type attribute is `\"file\"`, then this attribute will indicate the types of files that the server accepts, otherwise it will be ignored. The value must be a comma-separated list of unique content type specifiers.\n */\n @Prop() accept?: string;\n\n /**\n * Indicates whether and how the text value should be automatically capitalized as it is entered/edited by the user.\n */\n @Prop() autocapitalise: 'none' | 'sentences' | 'words' | 'characters' =\n 'none';\n\n /**\n * Indicates whether the value of the control can be automatically completed by the browser.\n */\n @Prop() autocomplete: 'on' | 'off' = 'off';\n\n /**\n * Whether auto correction should be enabled when the user is entering/editing the text value.\n */\n @Prop() autocorrect: 'on' | 'off' = 'off';\n\n /**\n * This Boolean attribute lets you specify that a form control should have input focus when the page loads.\n */\n @Prop() autofocus = false;\n\n /**\n * If `true`, a clear icon will appear in the input when there is a value. Clicking it clears the input.\n */\n @Prop() clearInput = false;\n\n /**\n * If `true`, the value will be cleared after focus upon edit. Defaults to `true` when `type` is `\"password\"`, `false` for all other types.\n */\n @Prop() clearOnEdit?: boolean;\n\n /**\n * Set the amount of time, in milliseconds, to wait to trigger the `nanoChange` event after each keystroke.\n */\n @Prop() debounce = 0;\n\n /**\n * If `true`, the user cannot interact with the input.\n */\n @Prop({ reflect: true }) disabled = false;\n\n /**\n * A hint to the browser for which keyboard to display.\n * Possible values: `\"none\"`, `\"text\"`, `\"tel\"`, `\"url\"`,\n * `\"email\"`, `\"numeric\"`, `\"decimal\"`, and `\"search\"`.\n */\n @Prop() inputmode?:\n | 'none'\n | 'text'\n | 'tel'\n | 'url'\n | 'email'\n | 'numeric'\n | 'decimal'\n | 'search';\n\n /**\n * When should the field perform validation\n */\n @Prop({ mutable: true }) validateOn: 'dirty' | 'submit' | 'submitThenDirty' =\n 'submitThenDirty';\n\n /**\n * Whether to show validation errors underneath input\n */\n @Prop({ reflect: true }) showInlineError = true;\n\n /**\n * String to place within a label element. Alternatively you may use a label slot.\n */\n @Prop() label!: string;\n\n /**\n * Visually hide the label - but make it accessible.\n */\n @Prop() hideLabel?: boolean = false;\n\n /**\n * Enable floating label behaviour. Will disable placeholder if set.\n */\n @Prop() floatLabel: boolean = false;\n\n /**\n * The maximum value, which must not be less than its minimum (min attribute) value.\n */\n @Prop() max?: string;\n\n /**\n * If the value of the type attribute is `text`, `email`, `search`, `password`, `tel`, or `url`, this attribute specifies the maximum number of characters that the user can enter.\n */\n @Prop() maxlength?: number;\n\n /**\n * The minimum value, which must not be greater than its maximum (max attribute) value.\n */\n @Prop() min?: string;\n\n /**\n * If the value of the type attribute is `text`, `email`, `search`, `password`, `tel`, or `url`, this attribute specifies the minimum number of characters that the user can enter.\n */\n @Prop() minlength?: number;\n\n /**\n * If `true`, the user can enter more than one value. This attribute applies when the type attribute is set to `\"email\"` or `\"file\"`, otherwise it is ignored.\n */\n @Prop() multiple?: boolean;\n\n /**\n * The name of the control, which is submitted with the form data.\n */\n @Prop() name: string = this.inputId;\n\n /**\n * A regular expression that the value is checked against. The pattern must match the entire value, not just some subset. Use the title attribute to describe the pattern to help the user. This attribute applies when the value of the type attribute is `\"text\"`, `\"search\"`, `\"tel\"`, `\"url\"`, `\"email\"`, or `\"password\"`, otherwise it is ignored.\n */\n @Prop() pattern?: string;\n\n /**\n * Instructional text that shows before the input has a value.\n */\n @Prop() placeholder?: string | null;\n\n /**\n * If `true`, the user cannot modify the value.\n */\n @Prop({ reflect: true }) readonly = false;\n\n /**\n * If `true`, the user must fill in a value before submitting a form.\n */\n @Prop() required = false;\n\n /**\n * If `true`, the element will have its spelling and grammar checked.\n */\n @Prop() spellcheck = false;\n\n /**\n * Works with the min and max attributes to limit the increments at which a value can be set.\n * Possible values are: `\"any\"` or a positive floating point number.\n */\n @Prop() step?: string;\n\n /**\n * The initial size of the control. This value is in pixels unless the value of the type attribute is `\"text\"` or `\"password\"`, in which case it is an integer number of characters. This attribute applies only when the `type` attribute is set to `\"text\"`, `\"search\"`, `\"tel\"`, `\"url\"`, `\"email\"`, or `\"password\"`, otherwise it is ignored.\n */\n @Prop() size?: number;\n\n /**\n * The type of control to display. The default type is text.\n */\n @Prop({ reflect: true }) type: TextFieldTypes = 'text';\n\n /**\n * The form element to associate the input with (its form owner). Must be the id of a form.\n */\n @Prop() form?: string | null;\n\n /**\n * The value of the input.\n */\n @Prop({ mutable: true }) value?: string | null = '';\n\n /**\n * relevant to type=\"textarea\". Vertical resizing - enable / disable or make automatic.\n */\n @Prop() resize: 'true' | 'false' | 'auto' = 'auto';\n\n /**\n * relevant to type=\"textarea\". Default number of rows to show\n */\n @Prop() rows = 2;\n\n /**\n * relevant to type=\"textarea\".\n */\n @Prop() showCharCount = false;\n\n @Watch('minlength')\n @Watch('maxlength')\n @Watch('min')\n @Watch('max')\n @Watch('required')\n @Watch('disabled')\n @Watch('readonly')\n @Watch('pattern')\n @Watch('inputmode')\n protected shouldValidate() {\n if (!this.hasRendered) return;\n requestAnimationFrame(() => {\n if (this.validateOn === 'dirty') this.validate();\n });\n }\n\n /**\n * Update the native input element when the value changes\n */\n @Watch('value')\n protected valueChanged() {\n this.nanoChange.emit({ value: this.value });\n this.charCount = this.value.length;\n\n if (this.type === 'textarea' && this.resize === 'auto') {\n this.nativeInput.style.height = 'auto';\n if (this.value.length)\n this.nativeInput.style.height = this.nativeInput.scrollHeight + 'px';\n }\n\n requestAnimationFrame(() => {\n if (this.validateOn === 'dirty') this.validate();\n });\n }\n\n @Watch('debounce')\n protected debounceChanged() {\n this.nanoChange = debounceEvent(this.nanoChange, this.debounce);\n }\n\n /**\n * Emitted when a keyboard input occurred.\n */\n @Event() nanoInput!: EventEmitter<InputEvent>;\n\n /**\n * Emitted when the value has changed.\n */\n @Event() nanoChange!: EventEmitter<InputChangeEventDetail>;\n\n /**\n * Emitted when the input loses focus.\n */\n @Event() nanoBlur!: EventEmitter<void>;\n\n /**\n * Emitted when the input has focus.\n */\n @Event() nanoFocus!: EventEmitter<void>;\n\n /**\n * Emitted when the input has been created.\n * @internal\n */\n @Event() nanoDidLoad!: EventEmitter<void>;\n\n /**\n * Emitted when the input has been removed.\n * @internal\n */\n @Event() nanoDidUnload!: EventEmitter<void>;\n\n /**\n * Called when validation is performed (which depends on `validateOn`).\n * @returns event.detail: `{ isValid: boolean, errorMessage: string, originalEvent: Event }`.\n */\n @Event() nanoValidate: EventEmitter<ControlValidityEventDetail>;\n\n /**\n * Get the current state of the control.\n * @param validateFirst - perform validation first before reporting\n * @returns `{ isValid: boolean, errorMessage: string }`\n */\n @Method()\n async reportValidity(validateFirst: boolean): Promise<ControlValidity> {\n return new Promise((resolve) => {\n if (validateFirst) this.validate();\n setTimeout(() => {\n resolve({\n isValid: !this._invalid,\n errorMessage: this.nativeInput.validationMessage,\n });\n }, 50);\n });\n }\n\n /**\n * Sets focus on the specified `nano-input`. Use this method instead of the global\n * `input.focus()`.\n */\n @Method()\n async setFocus() {\n if (this.nativeInput) {\n this.nativeInput.focus();\n this.nativeInput.click();\n }\n }\n\n /**\n * Sets focus and select the text on the specified `nano-input`. Use this method instead of the global\n * `input.select()`.\n */\n @Method()\n async select() {\n if (this.nativeInput) {\n this.nativeInput.select();\n }\n }\n\n /**\n * @returns the native `<input>` element used under the hood.\n */\n @Method()\n getInputElement(): Promise<HTMLInputElement | HTMLTextAreaElement> {\n return Promise.resolve(this.nativeInput);\n }\n\n /**\n * Invalidate the field and show a custom error message. To clear the error you will need to re-call this method with an empty string.\n */\n @Method()\n async showError(message: string) {\n if (this.nativeInput) {\n this.nativeInput.setCustomValidity(message);\n this.validate();\n }\n }\n\n @Listen('reset', { target: 'body' })\n onReset(e) {\n const form = this.form\n ? document.querySelector('#' + this.form)\n : this.el.closest('form');\n if (!form || e.target !== this.el.closest('form')) return;\n\n this.value = '';\n }\n\n @Listen('mousedown', { target: 'body' })\n @Listen('keydown')\n handleBlur(e: KeyboardEvent | MouseEvent | FocusEvent) {\n if (!this.hasFocus) return;\n\n const kev = e as KeyboardEvent;\n let target: Element;\n\n raf(() => {\n if (e instanceof KeyboardEvent && kev.key) {\n if (kev.key !== 'Tab') return;\n target = document.activeElement;\n } else if (e instanceof FocusEvent) {\n target = document.activeElement;\n } else target = e.target as Element;\n\n if (closestElement(this.el.tagName.toLowerCase(), target) !== this.el) {\n this.onBlur();\n }\n });\n }\n\n private shouldClearOnEdit() {\n const { type, clearOnEdit } = this;\n return clearOnEdit === undefined ? type === 'password' : clearOnEdit;\n }\n\n private getValue(): string {\n return this.value || '';\n }\n\n private validate = (ev?: Event) => {\n if (this.validateOn === 'submitThenDirty') this.validateOn = 'dirty';\n\n if (!this.nativeInput.validity.valid) {\n if (this.showInlineError) {\n if (ev) ev.preventDefault();\n this.errorMessage = this.nativeInput.validationMessage;\n }\n this._invalid = true;\n } else this._invalid = false;\n\n this.nanoValidate.emit({\n isValid: !this._invalid,\n errorMessage: this.nativeInput.validationMessage,\n originalEvent: ev,\n });\n };\n\n private onInput = (ev: InputEvent) => {\n const input = ev.target as HTMLInputElement | null;\n this.value = input?.value || '';\n this.nanoInput.emit(ev);\n };\n\n private onBlur = () => {\n this.hasFocus = false;\n this.focusChanged();\n if (this.validateOn === 'dirty') this.validate();\n this.nanoBlur.emit();\n };\n\n private onFocus = () => {\n this.hasFocus = true;\n this.focusChanged();\n this.nanoFocus.emit();\n };\n\n private onKeydown = () => {\n if (this.shouldClearOnEdit()) {\n // Did the input value change after it was blurred and edited?\n if (this.didBlurAfterEdit && this.hasValue()) {\n // Clear the input\n this.clearTextInput();\n }\n\n // Reset the flag\n this.didBlurAfterEdit = false;\n }\n };\n\n private clearTextInput = (ev?: Event) => {\n if (this.clearInput && !this.readonly && !this.disabled && ev) {\n ev.preventDefault();\n ev.stopPropagation();\n }\n\n this.value = '';\n this.nativeInput.value = '';\n const event = new window.Event('change');\n this.nativeInput.dispatchEvent(event);\n };\n\n private focusChanged() {\n // If clearOnEdit is enabled and the input blurred but has a value, set a flag\n if (!this.hasFocus && this.shouldClearOnEdit() && this.hasValue()) {\n this.didBlurAfterEdit = true;\n }\n }\n\n private hasValue(): boolean {\n return this.getValue().length > 0;\n }\n\n private slotChangeObserver() {\n if (!Build.isBrowser) return;\n\n if (this.mo) this.mo.disconnect();\n const mo = (this.mo = new MutationObserver(() =>\n this.processSlottedContent()\n ));\n mo.observe(this.el, { childList: true, subtree: true });\n }\n\n private processSlottedContent() {\n // see if we have label / button content\n this.hasLabelSlot = !!this.el.querySelectorAll('[slot=\"label\"]');\n this.hasHelperSlot = !!this.el.querySelector('[slot=\"helper\"]');\n this.hasHelperEndSlot = !!this.el.querySelector('[slot=\"helper-end\"]');\n this.datalist = this.el.querySelector('nano-datalist:not([slot])');\n\n // breaking change introduced in v2. Rm in v3\n if (!!this.el.querySelector('[slot=\"inline-button\"]')) {\n console.warn(\n 'The `inline-button` slot was renamed to `end` in v2 - please update your code',\n this.el\n );\n }\n }\n\n connectedCallback() {\n this.debounceChanged();\n if (Build.isBrowser) {\n this.el.dispatchEvent(\n new CustomEvent('nanoDidLoad', {\n detail: this.el,\n })\n );\n }\n }\n\n disconnectedCallback() {\n if (Build.isBrowser) {\n document.dispatchEvent(\n new CustomEvent('nanoDidUnload', {\n detail: this.el,\n })\n );\n }\n if (this.mo) this.mo.disconnect();\n }\n\n componentDidLoad() {\n this.slotChangeObserver();\n this.hasRendered = true;\n if (this.autofocus) setTimeout((_) => this.setFocus(), 300);\n }\n\n componentWillLoad() {\n this.processSlottedContent();\n }\n\n render() {\n const value = this.getValue();\n const labelId = this.inputId + '-lbl';\n const moreId =\n this.showInlineError || this.hasHelperSlot ? this.inputId + '-more' : '';\n const helperEndId = this.hasHelperEndSlot ? this.inputId + '-helper' : '';\n this.rtl = (this.el.ownerDocument as Document).dir === 'rtl';\n\n const compWrapOptions = (({\n el,\n floatLabel,\n label,\n errorMessage,\n type,\n showInlineError,\n hasHelperSlot,\n hasLabelSlot,\n hideLabel,\n placeholder,\n maxlength,\n charCount,\n showCharCount,\n rtl,\n hasHelperEndSlot,\n }) => ({\n el,\n floatLabel,\n label,\n errorMessage,\n type,\n showInlineError,\n hasHelperSlot,\n hasLabelSlot,\n hideLabel,\n placeholder,\n maxlength,\n charCount,\n showCharCount,\n rtl,\n hasHelperEndSlot,\n }))(this);\n const wrapOptions = {\n ...compWrapOptions,\n labelId,\n moreId,\n helperEndId,\n hasValue: this.hasValue(),\n controlId: this.inputId,\n };\n\n const controlOptions = (({ clearInput, readonly, disabled }) => ({\n clearInput,\n readonly,\n disabled,\n clearControl: this.clearInput,\n }))(this);\n\n return (\n <Host\n aria-disabled={this.disabled ? 'true' : null}\n dir={this.rtl ? 'rtl' : null}\n class={{\n ...createColorClasses(this.color),\n 'has-value': this.hasValue(),\n 'has-focus': this.hasFocus,\n 'is-invalid': this._invalid,\n }}\n >\n <FormControlWrap {...wrapOptions}>\n <FormControl\n {...controlOptions}\n onClearText={this.clearTextInput}\n control={this.el}\n ref={(el) => (this.nativeInputWrap = el)}\n >\n {this.type !== 'textarea' && (\n <input\n id={this.inputId}\n class=\"input__native-ctrl\"\n ref={(input) => (this.nativeInput = input)}\n aria-labelledby={labelId + ' ' + moreId + ' ' + helperEndId}\n disabled={this.disabled}\n accept={this.accept}\n autoCapitalize={this.autocapitalise}\n autoComplete={this.autocomplete}\n autoCorrect={this.autocorrect}\n autoFocus={this.autofocus}\n inputMode={this.inputmode}\n form={this.form}\n min={this.min}\n max={this.max}\n minLength={this.minlength}\n maxLength={this.maxlength}\n multiple={this.multiple}\n name={this.name}\n pattern={this.pattern}\n placeholder={this.placeholder}\n readOnly={this.readonly}\n required={this.required}\n spellcheck={this.spellcheck}\n step={this.step}\n size={this.size}\n type={this.type}\n value={value}\n onInput={this.onInput}\n onChange={this.onInput}\n onFocus={this.onFocus}\n onBlur={this.handleBlur}\n onKeyDown={this.onKeydown}\n onInvalid={this.validate}\n />\n )}\n {this.type === 'textarea' && (\n <textarea\n rows={this.floatLabel ? 1 : this.rows}\n id={this.inputId}\n class={{\n 'input__native-ctrl': true,\n input__resizable: this.resize === 'true',\n }}\n ref={(input) => (this.nativeInput = input)}\n aria-labelledby={labelId + ' ' + moreId + ' ' + helperEndId}\n disabled={this.disabled}\n autoCapitalize={this.autocapitalise}\n autoCorrect={this.autocorrect}\n autoFocus={this.autofocus}\n inputMode={this.inputmode}\n form={this.form}\n minLength={this.minlength}\n maxLength={this.maxlength}\n name={this.name}\n placeholder={this.placeholder}\n readOnly={this.readonly}\n required={this.required}\n spellcheck={this.spellcheck}\n value={value}\n onInput={this.onInput}\n onChange={this.onInput}\n onFocus={this.onFocus}\n onKeyDown={this.onKeydown}\n onInvalid={this.validate}\n onBlur={this.handleBlur}\n ></textarea>\n )}\n </FormControl>\n <slot />\n </FormControlWrap>\n </Host>\n );\n }\n}\n"]}
@@ -1,5 +0,0 @@
1
- /*!
2
- * Web Components for Nanopore digital Web Apps
3
- */
4
- import{r as t,c as i,i as e,f as s,h as n,l as a,e as o,g as r}from"./p-47982da0.js";import{a as l}from"./p-a0b93616.js";import{d as h}from"./p-33798b5f.js";import{C as c}from"./p-2c301b34.js";import{d}from"./p-9746b0a5.js";import{c as b}from"./p-845ae77e.js";import"./p-69a3e911.js";var p=undefined&&undefined.__rest||function(t,i){var e={};for(var s in t)if(Object.prototype.hasOwnProperty.call(t,s)&&i.indexOf(s)<0)e[s]=t[s];if(t!=null&&typeof Object.getOwnPropertySymbols==="function")for(var n=0,s=Object.getOwnPropertySymbols(t);n<s.length;n++){if(i.indexOf(s[n])<0&&Object.prototype.propertyIsEnumerable.call(t,s[n]))e[s[n]]=t[s[n]]}return e};async function u(t,i={}){var{body:e}=i,s=p(i,["body"]);const n={Accept:"application/json, text/plain, */*","Access-Control-Allow-Origin":"*","Content-Type":"application/json",Cache:"no-cache"};const a=Object.assign(Object.assign({method:e?"POST":"GET",credentials:"include",keepalive:true,mode:"cors"},s),{headers:Object.assign(Object.assign({},n),s.headers)});if(e){a.body=JSON.stringify(e)}let o=setTimeout((()=>{}),0);if(window.AbortController){const t=new AbortController;const{timeout:i=500}=s;o=setTimeout((()=>t.abort()),i);a.signal=t.signal}const r=await fetch(t,a);clearTimeout(o);if(r.ok){return await r.json()}else{const t=await r.text();return new Error(t)}}const m=':host{-webkit-box-sizing:border-box;box-sizing:border-box}*,*::before,*::after{-webkit-box-sizing:border-box;box-sizing:border-box}[hidden]{display:none !important}:host{--padding:12px;--padding-top:var(--padding);--padding-end:var(--padding);--padding-bottom:var(--padding);--padding-start:var(--padding);--bar-background:#005c75;--bar-text-color:white;--bar-color-shade:rgb(19, 89, 111);--bar-color-tint:rgb(19, 89, 111);--bar-color-focus:#90c6e7;--menu-background:#001a21;--menu-text-color:white;--menu-dropdown-bg:#196c82;--menu-dropdown-color:white;display:block;position:relative;line-height:1.5;height:100%}:host *{-webkit-box-sizing:inherit;box-sizing:inherit}.global-nav{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;font-size:0.88em;z-index:var(--nano-layer-index-menubar, 10)}.global-nav button{background:none;color:inherit;border:none;padding:0}.global-nav .icon-btn{position:relative;background:none;color:inherit;border:none;-ms-flex-item-align:normal;-ms-grid-row-align:normal;align-self:normal;padding:9px 7px;cursor:pointer;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.global-nav .icon-btn nano-icon{width:18px;height:18px}.global-nav ::slotted(nano-nav-item[slot=icon]){--padding-top:9px;--padding-bottom:9px;--padding-start:7px;--padding-end:7px;--display:flex;font-size:18px}.global-nav a{color:inherit;text-decoration:none;white-space:nowrap}.global-nav .nav-links_title{margin:8px 0 3px}.global-nav .nav-links ul{margin:0;padding:0}.global-nav .nav-links li{list-style:none}.global-nav .login-btn{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;font-size:0.94em}.global-nav .menu-btn{padding:9px var(--padding) 9px var(--padding)}.gn-menu{position:fixed;inset-block-start:0;inset-inline-start:0;z-index:-1;display:none;-webkit-transition:z-index 0.01s ease 0.2s;transition:z-index 0.01s ease 0.2s;height:100vh;width:100vw;overflow-y:auto}:host(.threshold-4) .gn-menu{position:absolute;width:calc(100vw - 20px)}.gn-menu.menu-full-screen{width:100vw !important}.gn-menu_wrap{max-width:92vw;width:335px;background:var(--menu-background);color:var(--menu-text-color);padding:var(--padding) 0;-webkit-box-shadow:0 0 36px 0 rgba(0, 0, 0, 0.8);box-shadow:0 0 36px 0 rgba(0, 0, 0, 0.8);position:relative;pointer-events:all;-webkit-margin-after:36px;margin-block-end:36px;opacity:0;outline:none;-webkit-transition:opacity 0.2s ease, -webkit-transform 0.2s ease;transition:opacity 0.2s ease, -webkit-transform 0.2s ease;transition:transform 0.2s ease, opacity 0.2s ease;transition:transform 0.2s ease, opacity 0.2s ease, -webkit-transform 0.2s ease}.gn-menu_wrap.has-promotion{padding:var(--padding) 0 0}.gn-menu.open{z-index:var(--nano-layer-index-dropdown, 300);-webkit-transition:z-index 0.01s ease;transition:z-index 0.01s ease}.gn-menu.open .gn-menu_wrap{opacity:1;-webkit-transform:translate3d(0, 0, 0) !important;transform:translate3d(0, 0, 0) !important;-webkit-transition:opacity 0.2s ease 0.01s, -webkit-transform 0.2s ease 0.01s;transition:opacity 0.2s ease 0.01s, -webkit-transform 0.2s ease 0.01s;transition:transform 0.2s ease 0.01s, opacity 0.2s ease 0.01s;transition:transform 0.2s ease 0.01s, opacity 0.2s ease 0.01s, -webkit-transform 0.2s ease 0.01s}.gn-menu_actions{-webkit-padding-end:calc(var(--padding) / 2);padding-inline-end:calc(var(--padding) / 2);display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.gn-menu_actions-counter{background:#d0021b;color:#fff;position:absolute;inset-block-end:4px;inset-inline:auto 0;font-size:9px;height:14px;line-height:14px;width:auto;min-width:14px;border-radius:50%;-webkit-box-sizing:border-box;box-sizing:border-box;text-align:center;text-indent:0}.gn-menu .content-wrap{position:relative;overflow:hidden;-webkit-transition:0.2s ease min-height;transition:0.2s ease min-height;min-height:190px}.gn-menu .content--sub{padding:var(--padding) 0 var(--padding) 7px}.gn-menu .menu-btn{-webkit-margin-end:auto;margin-inline-end:auto}.gn-menu .nav-links{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap}.gn-menu .nav-links ::slotted(nano-nav-item),.gn-menu .nav-links nano-nav-item{--icon-size:14px;--display:inline-block;--secondary-bg-color:#001a21;--padding-top:10px;--padding-bottom:10px;--padding-end:calc(var(--padding) * 2);--padding-start:calc(var(--padding) + 3px);--color:white;--color-hover:#90c6e7;--bg-color-hover:transparent;--bg-color-focus:#002530;--focus-outline:none;font-size:0.99em;width:100%}.gn-menu .nav-links .user-nav{--bg-color:#193037;--padding-top:9px;--padding-bottom:9px;font-weight:bold;margin:5px 0 0}.gn-menu .nav-links .user-nav ::slotted(nano-nav-item),.gn-menu .nav-links .user-nav nano-nav-item{font-weight:500;--bg-color:transparent}.gn-menu .nav-links_title{margin:0 var(--padding) 4px;-webkit-border-after:1px solid #33484d;border-block-end:1px solid #33484d;-webkit-padding-after:8px;padding-block-end:8px;font-size:0.86em;text-transform:uppercase;color:#90c6e7;letter-spacing:1px;font-weight:700}.gn-menu .nav-links-wrap{margin:18px 0}.gn-menu .nav-links-wrap:last-child{-webkit-margin-after:0;margin-block-end:0}.gn-menu .nav-links .back-btn{-webkit-border-before:1px solid #33484d;border-block-start:1px solid #33484d;-webkit-border-after:1px solid #33484d;border-block-end:1px solid #33484d;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding:10px 11px 10px 0;width:100%;font-size:12px;text-transform:uppercase;color:#90c6e7;letter-spacing:1px;font-weight:700}.gn-menu .nav-links .back-btn nano-icon{-webkit-margin-end:10px;margin-inline-end:10px;font-size:12px;color:white}.gn-menu .nav-links--sub{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap}.gn-menu .nav-links--sub ::slotted(nano-nav-item),.gn-menu .nav-links--sub nano-nav-item{--border-bottom:none;--padding-end:var(--padding);--padding-start:var(--padding);--padding-top:8px;--padding-bottom:8px;margin:0;width:50%;line-height:1.8}.gn-menu .nav-links .content{padding:8px var(--padding)}.gn-menu .login-btn{padding-inline:7px var(--padding);padding-block:9px}.gn-menu .login-btn nano-icon{-webkit-margin-start:10px;margin-inline-start:10px}.gn-menu .logout-btn{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end}.gn-menu .logout-btn a{padding:0 5px}.sticker-trigger{background:var(--bar-background);width:100%;z-index:calc(var(--nano-layer-index-menubar, 10) + 1)}.bars{color:var(--bar-text-color);z-index:var(--nano-layer-index-menubar, 10);position:relative;max-width:100%;min-width:100%;-webkit-box-shadow:none;box-shadow:none;-webkit-transition:0.2s ease box-shadow;transition:0.2s ease box-shadow}[stuck] .bars{-webkit-box-shadow:0 1px 25px 0 rgba(0, 0, 0, 0.15);box-shadow:0 1px 25px 0 rgba(0, 0, 0, 0.15)}.bars::before{content:"";width:100%;height:100%;z-index:-1;background:var(--bar-background);position:absolute}.bars .search-widget{-webkit-margin-start:11px;margin-inline-start:11px;-webkit-margin-end:auto;margin-inline-end:auto;position:relative;-webkit-box-flex:1;-ms-flex:1 1 auto;flex:1 1 auto;max-width:45vw;min-width:269px;max-height:36px}.bars .search-inputs{display:-webkit-box;display:-ms-flexbox;display:flex;margin:0}.bars .search-inputs input[type=submit]{display:none}.bars .search-autocomplete{position:absolute;inset-block-start:calc(100% - 2px);width:100%;inset-inline-start:0;background:white;border:2px solid var(--bar-color-tint);border-radius:0 0 5px 5px;color:#4a4a4a;font-size:0.85em;-webkit-padding-before:calc(var(--padding) / 2);padding-block-start:calc(var(--padding) / 2);-webkit-padding-end:0;padding-inline-end:0;-webkit-padding-after:1px;padding-block-end:1px;-webkit-padding-start:0;padding-inline-start:0;z-index:1}.bars .search-autocomplete-hit{-webkit-padding-before:calc(var(--padding) / 4);padding-block-start:calc(var(--padding) / 4);-webkit-padding-after:calc(var(--padding) / 4);padding-block-end:calc(var(--padding) / 4);-webkit-padding-start:var(--padding);padding-inline-start:var(--padding);-webkit-padding-end:var(--padding);padding-inline-end:var(--padding);width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block;text-align:start;line-height:1.5;cursor:pointer}.bars .search-autocomplete-hit-scope{font-size:0.76em;color:#a7b0b3;font-weight:600}.bars .search-autocomplete-hit:hover,.bars .search-autocomplete-hit:focus{background-color:#e4e6e8}.bars .search-autocomplete-hit .search__highlight,.bars .search-autocomplete-hit em{font-weight:bold;font-style:normal}.bars .search-autocomplete-hit--no-result:hover,.bars .search-autocomplete-hit--no-result:focus{background:none !important}.bars .search-autocomplete-foot{margin:7px 0 0}.bars .search-autocomplete-submit{background:none;border:none;-ms-flex-item-align:normal;-ms-grid-row-align:normal;align-self:normal;padding:9px var(--padding);cursor:pointer;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;color:#007495;-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;width:100%;text-decoration:underline;-webkit-border-before:1px solid #e8eaea;border-block-start:1px solid #e8eaea}.bars .search-autocomplete-submit:hover,.bars .search-autocomplete-submit:focus{background-color:#e4e6e8}.bars .search-input{--input-border-style:solid 1px rgb(85, 140, 157);--input-border-style--focus:solid 1px var(--bar-color-focus, #90c6e7);--input-border-width:1px;font-size:0.9em}.bars nano-select.search-input{--input-bg-color:var(--bar-color-tint, rgb(88, 140, 161));--input-text-color:inherit;--input-border-radius:5px 0 0 5px;-webkit-box-flex:0;-ms-flex:0 1 auto;flex:0 1 auto;width:auto;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;position:relative;inset-inline-start:1px}:host([dir=rtl]) .bars nano-select.search-input{--input-border-radius:0 5px 5px 0}:host(:not(.ready)) .bars nano-select.search-input{overflow:hidden;max-height:1em}.bars nano-select.search-input .down-arrow{font-size:0.65em}.bars nano-input.search-input{--input-text-color:inherit;--input-bg-color:var(--bar-color-shade, rgb(40, 110, 133));--clear-btn-color:#4a4a4a;--input-border-radius:0 5px 5px 0;--placeholder-color:white;width:206px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-flex:1;-ms-flex:1;flex:1}:host([dir=rtl]) .bars nano-input.search-input{--input-border-radius:5px 0 0 5px}:host(:not(.ready)) .bars nano-input.search-input{overflow:hidden;max-height:1em}.bars nano-input.search-input.has-value{--input-bg-color:#fff;--input-text-color:#4a4a4a}.bars nano-input.search-input.has-value .search-icon{color:#4a4a4a}.bars nano-input.search-input .search-icon{background:none;color:white;padding:0 8px;display:none}.bars nano-input.search-input .search-icon--show{display:-webkit-box;display:-ms-flexbox;display:flex}.bars nano-input.search-input .search-icon--loader{-webkit-animation:spin 1s linear infinite;animation:spin 1s linear infinite}@-webkit-keyframes spin{100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes spin{100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.bars nano-input.search-input .search-icon nano-icon{height:1.4em}.main-bar{width:100%;padding-inline:0 var(--padding);padding-block:var(--padding);display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;overflow-x:hidden}.main-bar:focus{outline:none}:host(.ready) .main-bar{overflow-x:visible}.main-bar>*,.main-bar ::slotted(*){-webkit-transition:opacity 0.2s ease;transition:opacity 0.2s ease}:host(:not(.ready)) .main-bar>*,:host(:not(.ready)) .main-bar ::slotted(*){opacity:0 !important}:host(.ready) .main-bar>*,:host(.ready) .main-bar ::slotted(*){opacity:1}:host(.resizing) .main-bar>*,:host(.resizing) .main-bar ::slotted(*){opacity:0 !important}.main-bar>*{-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto}.main-bar>* ::slotted(nano-nav-item[slot=icon]){-webkit-margin-start:11px;margin-inline-start:11px}.main-bar>* ::slotted(nano-nav-item),.main-bar>* nano-nav-item{--color-hover:#e4e6e8;--secondary-bg-color:var(--menu-dropdown-bg);--secondary-color:var(--menu-dropdown-color);--bg-color-open:var(--bar-background);text-decoration:none !important}.main-bar .icon-btn{-webkit-margin-before:0;margin-block-start:0;-webkit-margin-after:0;margin-block-end:0;-webkit-margin-start:6px;margin-inline-start:6px}:host(.threshold-2) .main-bar .icon-btn{-webkit-margin-before:0;margin-block-start:0;-webkit-margin-after:0;margin-block-end:0;-webkit-margin-start:11px;margin-inline-start:11px}.main-bar .menu-btn.icon-btn{margin:0 !important;-webkit-border-end:1.5px solid var(--bar-color-shade);border-inline-end:1.5px solid var(--bar-color-shade)}.main-bar .user-links{position:relative}.main-bar .user-links .icon-btn{-webkit-padding-end:0;padding-inline-end:0;font-size:0.93em;font-weight:500}.main-bar .user-links .icon-btn nano-icon{-webkit-margin-start:5px;margin-inline-start:5px;width:16px;height:16px;-webkit-transform-origin:center;transform-origin:center;-webkit-transition:color 0.2s ease, -webkit-transform 0.2s ease;transition:color 0.2s ease, -webkit-transform 0.2s ease;transition:transform 0.2s ease, color 0.2s ease;transition:transform 0.2s ease, color 0.2s ease, -webkit-transform 0.2s ease}.main-bar .user-links .icon-btn.open nano-icon{-webkit-transform:rotate(180deg);transform:rotate(180deg);color:#007495}.main-bar .user-links-panel{display:none;position:absolute;border-radius:4px 0 4px 4px;-webkit-box-shadow:0 1px 5px 0 rgba(0, 0, 0, 0.4);box-shadow:0 1px 5px 0 rgba(0, 0, 0, 0.4);background-color:#568c9d;opacity:0;-webkit-transform:translate3d(0, 24px, 0);transform:translate3d(0, 24px, 0);-webkit-transition:opacity 0.2s ease, -webkit-transform 0.2s ease;transition:opacity 0.2s ease, -webkit-transform 0.2s ease;transition:transform 0.2s ease, opacity 0.2s ease;transition:transform 0.2s ease, opacity 0.2s ease, -webkit-transform 0.2s ease;inset-inline-end:0;font-size:0.85em;min-width:250px;z-index:1}.main-bar .user-links-panel:focus{outline:none}.main-bar .user-links-panel.show{opacity:1;-webkit-transform:translate3d(0, 4px, 0);transform:translate3d(0, 4px, 0)}.main-bar .user-links-panel-content{padding:0 18px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.main-bar .user-links-panel-content a{padding:11px 0;-webkit-border-after:#669dac 1px solid;border-block-end:#669dac 1px solid}.main-bar .user-links-panel-content a:hover,.main-bar .user-links-panel-content a:focus{color:#455556}.main-bar .user-links-panel-content a:last-child{-webkit-border-after:none;border-block-end:none}.main-bar .user-links-panel-foot{background-color:#aac5cd;border-radius:0 0 4px 4px;padding:var(--padding);color:#455556;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;font-weight:500;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.main-bar .user-links-panel-foot a:hover{text-decoration:underline}.main-bar .logo{height:34px;width:auto;min-width:196px}:host(:not(.threshold-1)) .main-bar .logo{height:30px}.main-bar .logo-link{-webkit-margin-end:auto;margin-inline-end:auto;-webkit-margin-start:0;margin-inline-start:0;padding-inline:11px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;border:none}.main-bar .nav-links{font-size:0.75rem;-webkit-box-flex:1;-ms-flex:1 0 auto;flex:1 0 auto;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-pack:distribute;justify-content:space-around}.main-bar .nav-links ul{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-pack:distribute;justify-content:space-around}.main-bar .nav-links ::slotted(nano-nav-item),.main-bar .nav-links nano-nav-item{--padding-top:7px;--padding-bottom:7px;--padding-end:2px;--padding-start:2px;--margin:0 8px}.main-bar .nav-links--main{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;letter-spacing:0.33px;font-weight:600;font-stretch:expanded;font-size:0.8125rem}.main-bar .nav-links--main ::slotted(nano-nav-item){--color:#fff;--padding-end:3px;--padding-start:0}.main-bar .nav-links--sub{--color:#e2e2e2;-webkit-margin-start:6px;margin-inline-start:6px;-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end}.main-bar .login-btn{display:inline-block;border-radius:4px;background-color:#17bb75;color:#fff;padding:3px 10px;position:relative;inset-inline-start:auto;inset-block-end:auto;margin-inline:11px 0}.main-bar .measure-ele{min-width:1px;display:block;margin:0;padding:0}.search-bar{height:0;overflow:hidden;-webkit-transition:0.2s ease height;transition:0.2s ease height;padding:0 var(--padding);outline:none;max-width:45em;-webkit-margin-start:auto;margin-inline-start:auto}.search-bar .search-widget{margin:0;overflow:inherit;max-width:none;max-height:none;padding:0 0 var(--padding)}.search-bar .search-inputs{padding:0 0;margin:0 0}.search-bar .search-autocomplete{inset-block-start:calc(100% - (var(--padding) + 1px))}.site-content{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-transition:min-height 0.2s ease;transition:min-height 0.2s ease;min-height:calc(100% - 61px);position:relative;z-index:auto;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch}.mask{opacity:0;background:rgba(0, 0, 0, 0.3);position:fixed;inset-inline:0;inset-block-start:0;height:100vh;z-index:-1;-webkit-transition:opacity 0.2s ease, visibility 0.01s ease 0.2s, z-index 0.01s ease 0.2s, -webkit-transform 0.2s ease;transition:opacity 0.2s ease, visibility 0.01s ease 0.2s, z-index 0.01s ease 0.2s, -webkit-transform 0.2s ease;transition:transform 0.2s ease, opacity 0.2s ease, visibility 0.01s ease 0.2s, z-index 0.01s ease 0.2s;transition:transform 0.2s ease, opacity 0.2s ease, visibility 0.01s ease 0.2s, z-index 0.01s ease 0.2s, -webkit-transform 0.2s ease;visibility:hidden}.mask.open{opacity:1;-webkit-transition:z-index 0.01s ease, visibility 0.01s ease, opacity 0.2s ease 0.01s, -webkit-transform 0.2s ease 0.01s;transition:z-index 0.01s ease, visibility 0.01s ease, opacity 0.2s ease 0.01s, -webkit-transform 0.2s ease 0.01s;transition:z-index 0.01s ease, visibility 0.01s ease, transform 0.2s ease 0.01s, opacity 0.2s ease 0.01s;transition:z-index 0.01s ease, visibility 0.01s ease, transform 0.2s ease 0.01s, opacity 0.2s ease 0.01s, -webkit-transform 0.2s ease 0.01s;z-index:3;visibility:visible}';const g={search:0,about:1,main:2,login:3,icon:4};const f=class{constructor(e){t(this,e);this.nanoIsReady=i(this,"nanoIsReady",7);this.nanoSearchResult=i(this,"nanoSearchResult",7);this.nanoSearchError=i(this,"nanoSearchError",7);this.nanoSearchReset=i(this,"nanoSearchReset",7);this.currSize=0;this.thresholdsGoingUp=false;this.THRESHOLDLIMIT=Object.keys(g).length;this.autocompleteEles=[];this.currAIndex=-1;this.isLoggedIn=false;this.myAccData=null;this.aboutNavItms=[];this.siteNavItms=[];this.loggedInNavItms=[];this.hasLoggedinSlot=false;this.hasSiteSlot=false;this.hasPromotionSlot=false;this.aboutSlotLen=0;this.iconSlotLen=0;this.mainSlotLen=0;this.overflowSlotLen=0;this.searchSlotLen=0;this.internalSearchIndeces=[];this.thresholdReady=false;this.remoteDataReady=false;this.ready=false;this.isResizing=false;this.threshold=this.THRESHOLDLIMIT;this.modalOpen=false;this.modalIsOpen=false;this.searchBarShown=false;this.scrollingUp=true;this.searchLoading=false;this.showAutocomplete=false;this.secondaryMenuOpen=false;this.userMenuOpen=false;this.menuFullScreen=false;this.searchValInternal="";this.env="prod";this.ssoRedirect=encodeURIComponent(window.location.href);this.getMyAccountData=true;this.activeMyAccountSections=null;this.showSearch=true;this.showLogo=true;this.logoUrl=location.protocol+"//"+location.host;this.searchIndeces=[];this.myAccountUser=null;this.searchValue="";this.searchIndex="all_prod_en";this.cartCount=0;this.msgCount=0;this.cartUrl=null;this.msgUrl=null;this.setResizingState=(t=false)=>{if(typeof this.debounceSetResizingState==="undefined"){this.debounceSetResizingState=d(this.setResizingState,600)}if(t){this.isResizing=true;this.debounceSetResizingState()}else{this.isResizing=false;this.thresholdsGoingUp=false}};this.onMenuBtnKeyDown=t=>{switch(t.key){case"Enter":case" ":this.modalOpen?this.menuClose(t,true):this.menuOpen();break}};this.onMenuBtnClick=t=>{this.menuClose(t,true)};this.menuOpen=t=>{if(t)t.preventDefault();this.menuDiv.style.display="block";this.modalOpen=true;this.modalIsOpen=true;this.menuWrapDiv.addEventListener("focusout",this.menuClose);this.menuWrapDiv.focus({preventScroll:true});if(this.threshold<2||this.menuWrapDiv.scrollHeight>window.innerHeight){document.body.style.overflow="hidden";this.menuFullScreen=true}else document.body.style.overflowX="hidden"};this.onMenuHidden=()=>{this.menuDiv.removeEventListener("transitionend",this.onMenuHidden);this.menuWrapDiv.removeEventListener("focusout",this.menuClose);document.body.style.overflow="";this.menuDiv.style.display="none";this.modalIsOpen=false;this.menuFullScreen=false;setTimeout((()=>{if(document.activeElement===document.body&&this.menuBtn)this.mainBarDiv.focus({preventScroll:true})}),50)};this.menuClose=(t,i=false)=>{if(!i){const i=t;if(i&&i.relatedTarget&&b("#global-nav-menu",i.relatedTarget))return;if(i&&i.relatedTarget&&i.relatedTarget.closest("#global-nav-menu"))return;if(i&&i.relatedTarget&&i.relatedTarget.closest('[slot="promotion"]'))return;if(this.secondaryMenuOpen)return}this.modalOpen=false;this.menuDiv.addEventListener("transitionend",this.onMenuHidden)};this.subMenuClose=t=>{t.preventDefault();t.target.closest("nano-nav-item").open=false};this.onUserBtnClick=t=>{t.preventDefault();this.userMenuOpen=!this.userMenuOpen};this.onUserBtnKeyDown=t=>{switch(t.key){case"Enter":case" ":this.userMenuOpen=!this.userMenuOpen;break}};this.onUserMenuBlur=t=>{if(!t.relatedTarget){this.userMenuOpen=false;return}if(!!t.relatedTarget.closest(".user-links-panel"))return false;this.userMenuOpen=false};this.onSearchBtnClick=t=>{t.preventDefault();if(!this.searchBarShown)this.searchbarShow();else this.searchbarHide()};this.onSearchBtnKeyDown=t=>{switch(t.key){case"Enter":case" ":this.searchBarShown?this.searchbarHide():this.searchbarShow();break}};this.onSearchBarShown=()=>{this.searchBarEl.removeEventListener("transitionend",this.onSearchBarShown);if(this.searchInput)this.searchInput.setFocus();this.searchBarEl.style.overflow="visible"};this.searchbarHide=t=>{if(t&&t.relatedTarget&&t.relatedTarget.closest("#global-nav-search-bar"))return;this.showAutocomplete=false;if(this.searchValInternal.length&&t)return;this.searchBarEl.addEventListener("transitionend",this.onSearchBarHidden);this.searchBarEl.style.overflow="hidden";this.searchBarEl.style.height="0px"};this.onSearchBarHidden=()=>{this.searchBarEl.removeEventListener("transitionend",this.onSearchBarHidden);this.searchBarEl.style.display="none";this.searchBarShown=false};this.onSearchInput=t=>{this.searchValInternal=this.searchInput.value;if(!this.isSearchValSet()){this.searchLoading=false;return}if(t.detail.type==="input"){this.showAutocomplete=false;this.searchLoading=true}};this.onSearchChange=async t=>{this.searchValInternal=this.searchValue=t?t.detail.value:this.searchValInternal;this.showAutocomplete=false;this.autocompleteResults=null;if(!this.isSearchValSet()){if(!this.searchValInternal.length){this.nanoSearchReset.emit()}this.searchLoading=false;return}if(!this.currentIndex)this.currentSelectedIndex();try{this.autocompleteResults=this.processSearchResults(await this.currentIndex.alogliaIndex.search(this.searchValInternal,{attributesToSnippet:["body:5","title:8"],hitsPerPage:5,filters:"created > "+Math.floor((Date.now()-631152e5)/1e3)}))}catch(i){console.error(i)}this.scopeSearch=null;this.scopeSearch=await this.onSearchSubmit(null,false);this.searchLoading=false;this.showAutocompleteResults()};this.onSearchSubmit=async(t,i=true)=>{if(t)t.preventDefault();if(!this.isSearchValSet())return;this.searchLoading=true;this.algoliaSearchResults=null;if(!this.currentIndex)this.currentSelectedIndex();const e=this.internalSearchIndeces.map((t=>({indexName:t.index,query:this.searchValInternal,facets:t.filters,hitsPerPage:10,filters:"created > "+Math.floor((Date.now()-631152e5)/1e3)})));try{this.algoliaSearchResults=this.processSearchResults(await this.algoliaClient.multipleQueries(e))}catch(s){this.nanoSearchError.emit(s)}this.searchLoading=false;if(!this.algoliaSearchResults)return;this.algoliaSearchResults.results.map(((t,i)=>{t.indexName=this.internalSearchIndeces[i].name;t.selected=this.currentIndex.name===this.internalSearchIndeces[i].name;t.domain=this.currentIndex.domain||null;t.domains=this.myAccData.domains||null;t.allGroup=!!this.internalSearchIndeces[i].allGroup;t.filters=this.internalSearchIndeces[i].filters}));if(i){this.nanoSearchResult.emit({results:this.algoliaSearchResults.results,client:{apiKey:this.searchApiKey,appId:this.searchAppId}});this.showAutocomplete=false}return this.algoliaSearchResults};this.onSearchIndexChange=async t=>{const i=t;let e=t;if(!this.currentIndex)this.currentSelectedIndex();if(i.detail&&i.detail.value.length)e=i.detail.value;if(!e||!e.length)return;if(this.currentIndex.index===e)return;const s=this.internalSearchIndeces.find((t=>t.index===e));if(!s||!s.alogliaIndex)return;this.searchIndex=s.index;if(this.isSearchValSet())await this.onSearchChange()};this.switchIndexSubmit=async t=>{if(this.isSearchValSet()){await this.onSearchIndexChange(t);this.onSearchSubmit()}else this.onSearchIndexChange(t)};this.onAutocompleteBlur=t=>{if(!this.showAutocomplete||!this.autocompleteResults)return;if(t&&t.target&&t.target.closest(".search-widget"))return;this.showAutocomplete=false};this.showAutocompleteResults=()=>{if(!this.autocompleteResults||!this.autocompleteResults.hits)return;this.showAutocomplete=true};this.onAutocompleteInteract=t=>{if(!this.showAutocomplete||!this.autocompleteResults)return;let i=this.currAIndex;switch(t.key){case"Tab":setTimeout((()=>{if(!this.el.shadowRoot.activeElement||!this.el.shadowRoot.activeElement.closest(".search-widget")){this.showAutocomplete=false;return}else{const t=this.autocompleteEles.find(((t,i)=>{if(t===this.el.shadowRoot.activeElement){this.currAIndex=i;return true}}));if(t)this.setActiveElement(t);else this.currAIndex=-1}}));break;case"ArrowDown":case"ArrowUp":if(t.key==="ArrowDown")i++;else if(t.key==="ArrowUp")i--;const e=this.autocompleteEles[i];if(e||i<0||i>this.autocompleteEles.length-1)t.preventDefault();if(e){this.setActiveElement(e);this.currAIndex=i}else if(i<0){this.searchInput.setFocus();this.currAIndex=-1}break;case"Enter":case" ":if(this.autocompleteEles[this.currAIndex]){this.autocompleteEles[this.currAIndex].click()}break}}}async submitSearch(){this.onSearchSubmit();this.showAutocomplete=false;return}async getMyAccData(){if(!this.getMyAccountData||this.myAccData){this.remoteDataReady=true;return}let t=this.ssoDataUrl;if(!t){switch(this.env){case"dev":t="https://myaccount-dev.nanoporetech.com/";break;case"test":t="https://myaccount-test.nanoporetech.com/";break;default:t="https://myaccount.nanoporetech.com/";break}}const i={timeout:5e3};try{if(this.env==="local"){this.myAccData=await __sc_import_nano_components("./p-41d26683.js")}else{this.myAccData=await u(t+"nav_bar_data.json",i)}if(this.myAccData.user.id){this.isLoggedIn=true;this.myAccountUser=this.myAccData.user}this.processMyAccLinks();this.processMyAccData();setTimeout((()=>this.remoteDataReady=true),300)}catch(e){console.error(e);this.remoteDataReady=true}}currentSelectedIndex(){if(!this.internalSearchIndeces.length){return}const t=this.internalSearchIndeces.find((t=>t.index===this.searchIndex));if(!t){this.currentIndex=this.internalSearchIndeces[0];console.error("index not found");return}this.currentIndex=t;return t}changeInternalSearchVal(){if(this.searchValInternal!==this.searchValue)this.searchValue=this.searchValInternal}initAlgoliaClient(){if(!this.searchAppId||!this.searchApiKey)return;this.algoliaClient=l(this.searchAppId,this.searchApiKey);this.addAlgoliaIndeces()}addIndeces(){this.internalSearchIndeces=[...this.internalSearchIndeces,...this.searchIndeces]}addAlgoliaIndeces(){if(!this.algoliaClient||!this.internalSearchIndeces.length)return;this.internalSearchIndeces.forEach((t=>{t.alogliaIndex=this.algoliaClient.initIndex(t.index)}));if(!this.searchIndex)this.searchIndex=this.internalSearchIndeces[0].index}thresholdChange(t,i){if(t>i){this.thresholdsGoingUp=true;this.setResizingState(true)}}ratioChange(){if(this.intersectRatio<1&&this.threshold>0){if(this.thresholdsGoingUp)this.setResizingState(true);this.threshold--;setTimeout((()=>this.ratioChange()),500)}else{this.thresholdReady=true;this.siteContent.style.minHeight=`calc(100% - ${this.barsDiv.clientHeight+1}px)`;let t,i;e((()=>{t=[...Array.from(this.el.querySelectorAll('nano-nav-item[slot="site"]')),...Array.from(this.el.querySelectorAll('nano-nav-item[slot="overflow"]'))];i=[];if(this.threshold<this.THRESHOLDLIMIT-g.icon)t.push(...Array.from(this.el.querySelectorAll('nano-nav-item[slot="icon"]')));else i.push(...Array.from(this.el.querySelectorAll('nano-nav-item[slot="icon"]')));if(this.threshold<this.THRESHOLDLIMIT-g.login)t.push(...Array.from(this.el.querySelectorAll('nano-nav-item[slot="loggedin"]')));else i.push(...Array.from(this.el.querySelectorAll('nano-nav-item[slot="loggedin"]')));if(this.threshold<this.THRESHOLDLIMIT-g.main)t.push(...Array.from(this.el.querySelectorAll('nano-nav-item[slot="main"]')));else i.push(...Array.from(this.el.querySelectorAll('nano-nav-item[slot="main"]')));if(this.threshold<this.THRESHOLDLIMIT-g.about)t.push(...Array.from(this.el.querySelectorAll('nano-nav-item[slot="about"]')));else i.push(...Array.from(this.el.querySelectorAll('nano-nav-item[slot="about"]')))}));s((()=>{t.forEach((t=>{t.classList.add("nano-global-nav-menu");t.classList.remove("nano-global-nav-bar")}));i.forEach((t=>{t.classList.remove("nano-global-nav-menu");t.classList.add("nano-global-nav-bar")}))}))}}assessReady(){if(this.thresholdReady&&this.remoteDataReady){this.ready=true}}remoteReady(){this.attachIO()}isReady(){this.nanoIsReady.emit()}setupAutocompleteBlur(){if(this.showAutocomplete){this.el.shadowRoot.addEventListener("click",this.onAutocompleteBlur)}else{this.el.shadowRoot.removeEventListener("click",this.onAutocompleteBlur)}}slotChange(){this.threshold=this.THRESHOLDLIMIT}thresholdClasses(){const t=[];let i=0;for(i;i<this.threshold;i++)t.push("threshold-"+(i+1));return t}onWindowResize(){if(this.threshold<this.THRESHOLDLIMIT&&window.innerWidth>this.currSize){this.threshold=this.THRESHOLDLIMIT}this.currSize=window.innerWidth;this.searchBarShown=false}secondaryOpen(t){if(!t.detail.secondaryMenu)return;t.stopPropagation();this.secondaryMenuOpen=true;this.menuContentDiv.style.minHeight=t.detail.secondaryMenu.scrollHeight+"px"}secondaryClose(t){if(!t.detail.secondaryMenu)return;t.stopPropagation();this.secondaryMenuOpen=false;this.menuContentDiv.style.minHeight=""}async handleUserMenu(){await h(this.userLinkPanel,"show",this.userMenuOpen);if(this.userMenuOpen){this.userLinkPanel.focus();this.userLinkPanel.addEventListener("focusout",this.onUserMenuBlur)}else{this.userLinkPanel.removeEventListener("focusout",this.onUserMenuBlur);this.el.focus()}}searchbarShow(){this.searchBarShown=true;this.searchBarEl.addEventListener("transitionend",this.onSearchBarShown);this.searchBarEl.style.display="block";setTimeout((()=>{this.searchBarEl.style.height=this.searchBarEl.querySelector(".search-widget").scrollHeight+"px"}),50)}autocompleteSnippet(t){const i=["title"];if(t._snippetResult){const e=i.find((i=>t._snippetResult[i]&&t._snippetResult[i].matchLevel!=="none"));if(e){if(e!=="title")return(t.title.length>15?t.title.substring(0,15)+" ...":t.title)+" "+t._snippetResult[e].value;else return t._snippetResult["title"].value}}return t.title}isSearchValSet(){if(this.searchValInternal.length<3)return false;return true}resetHitFocus(){this.currAIndex=-1}setActiveElement(t){this.autocompleteEles.map((t=>t.setAttribute("aria-selected","false")));t.focus({preventScroll:true});t.setAttribute("aria-selected","true")}assessSlottedContent(){e((()=>{this.hasSiteSlot=!!this.el.querySelectorAll('[slot="site"]').length;this.hasLoggedinSlot=!!this.el.querySelectorAll('[slot="loggedin"]').length;this.hasPromotionSlot=!!this.el.querySelectorAll('[slot="promotion"]').length;this.aboutSlotLen=this.el.querySelectorAll('[slot="about"]').length;this.iconSlotLen=this.el.querySelectorAll('[slot="icon"]').length;this.mainSlotLen=this.el.querySelectorAll('[slot="main"]').length;this.overflowSlotLen=this.el.querySelectorAll('[slot="overflow"]').length;this.searchSlotLen=this.el.querySelectorAll('[slot="search"]').length}))}attachIO(){if(this.io)return;const t=this.el.shadowRoot.querySelector(".global-nav .main-bar");if(typeof window!=="undefined"&&window.IntersectionObserver&&!!t){const i=this.io=new window.IntersectionObserver((t=>{this.intersectRatio=t.slice(-1)[0].intersectionRatio}),{root:t,threshold:1});i.observe(t.querySelector(".measure-ele"))}}componentDidLoad(){{this.debounceResize=d(this.onWindowResize.bind(this),300);window.addEventListener("resize",this.debounceResize);this.currSize=window.innerWidth}this.initAlgoliaClient();this.addAlgoliaIndeces();if(this.remoteDataReady)this.attachIO()}componentWillLoad(){c.init(this,["searchIndex","searchValue"],"url-hash","gns");if(typeof window!=="undefined"&&window.MutationObserver){const t=this.mo=new MutationObserver((()=>{this.assessSlottedContent()}));t.observe(this.el,{childList:true,subtree:false})}this.assessSlottedContent()}disconnectedCallback(){if(this.io){this.io.disconnect();this.io=undefined}if(this.mo){this.mo.disconnect();this.mo=undefined}window.removeEventListener("resize",this.debounceResize)}async connectedCallback(){this.getMyAccData()}autocompleteList(){let t;if(this.showAutocomplete&&this.scrollingUp){let i=0;let e=0;const s=(t,i)=>i.index!==this.currentIndex.index?t+i.hits.length:t;const a=(t,i)=>i.index===this.currentIndex.index?t+i.hits.length:t;if(this.scopeSearch){e=this.scopeSearch.results.reduce(s,0);i=this.scopeSearch.results.reduce(a,0)}if(this.autocompleteResults&&this.autocompleteResults.hits.length||e&&!i){let e=0;t=n("div",null,!i&&n("div",{class:"search-autocomplete-hit search-autocomplete-hit--no-result"},"No results matching '",this.searchValInternal,"' were found in"," ",n("strong",null,this.currentIndex.name),". Try another phrase."),this.autocompleteResults&&[this.autocompleteResults.hits.map(((t,i)=>n("a",{role:"option",ref:t=>this.autocompleteEles.push(t),tabindex:"-1",id:"autocomplete-hit-"+i,href:t.url,class:"search-autocomplete-hit",innerHTML:this.autocompleteSnippet(t)})))],(!i||this.currentIndex.allGroup)&&this.scopeSearch&&this.scopeSearch.results&&[this.scopeSearch.results.map(((t,i)=>{if(!t.hits.length||t.index===this.currentIndex.index||e>1)return;e++;return n("button",{role:"option",ref:t=>this.autocompleteEles.push(t),tabindex:"-1",id:"autocomplete-scope-"+i,class:"search-autocomplete-hit",onClick:()=>this.switchIndexSubmit(t.index),onMouseDown:()=>this.switchIndexSubmit(t.index)},'"',this.searchValInternal,'"'," ",n("div",{class:"search-autocomplete-hit-scope"},"in ",t.indexName))}))],!!i&&n("div",{class:"search-autocomplete-foot"},n("button",{role:"option",class:"search-autocomplete-submit",ref:t=>this.autocompleteEles.push(t),id:"autocomplete-foot",onClick:this.onSearchSubmit,onMouseDown:this.onSearchSubmit},"View all results")))}else if(!i){t=n("div",{class:"search-autocomplete-hit search-autocomplete-hit--no-result"},"No results matching '",this.searchValInternal,"' were found. Try another phrase.")}}return n("div",{class:"search-autocomplete",role:"listbox",id:"autocomplete-results","aria-expanded":this.showAutocomplete?"true":"false",hidden:!this.showAutocomplete,onKeyDown:this.onAutocompleteInteract},t)}searchWidget(){return[n("form",{class:"search-inputs",onSubmit:this.onSearchSubmit,id:"global-nav-search"},n("nano-select",{class:"search-input",label:"Which area of content would you like to search?",hideLabel:true,showInlineError:false,value:this.searchIndex,onNanoChange:this.onSearchIndexChange,mask:true},this.internalSearchIndeces.map((t=>n("nano-option",{selected:t.index===this.searchIndex,value:t.index},t.name||t.index))),n("nano-icon",{name:"solid/caret-down",class:"down-arrow",slot:"down-arrow"})),n("nano-input",{class:"search-input",label:"What would you like to search for?","aria-label":"What would you like to search for?",hideLabel:true,showInlineError:false,"clear-input":true,placeholder:"Search...",type:"text",ref:t=>this.searchInput=t,onNanoChange:this.onSearchChange,onNanoInput:this.onSearchInput,onKeyDown:this.onAutocompleteInteract,debounce:500,"aria-autocomplete":"list","aria-activedescendant":this.autocompleteEles[this.currAIndex]?this.autocompleteEles[this.currAIndex].id:false,"aria-controls":"autocomplete-results",onNanoFocus:this.showAutocompleteResults,value:this.searchValue,role:"textbox"},n("button",{class:{"search-icon":true,"search-icon--search":true,"search-icon--show":!this.searchValInternal.length},slot:"end",onMouseDown:t=>{this.searchValInternal=this.searchInput.value;this.onSearchSubmit(t,true)}},n("nano-icon",{name:"light/search"})),n("span",{class:{"search-icon":true,"search-icon--loader":true,"search-icon--show":this.searchLoading},slot:"end"},n("nano-icon",{name:"light/spinner-third"}))),n("input",{type:"submit"}))]}render(){this.autocompleteEles=[];const t=this.el.ownerDocument.dir==="rtl";const i=this.searchWidget();i.push(this.autocompleteList());return n(o,{class:{[this.thresholdClasses().join(" ")]:true,ready:this.ready,"search-bar-shown":this.searchBarShown&&this.scrollingUp,"search-auto-complete-shown":this.showAutocomplete&&this.scrollingUp,"modal-open":this.modalIsOpen,resizing:this.isResizing},dir:t?"rtl":null},n("div",{class:{"global-nav":true,"scrolling-down":!this.scrollingUp}},n("nav",{id:"global-nav-menu",class:{"gn-menu":true,open:this.modalOpen,"has-promotion":this.hasPromotionSlot,"menu-full-screen":this.menuFullScreen,"secondary-open":this.secondaryMenuOpen},"aria-expanded":this.modalOpen?"true":"false",ref:t=>this.menuDiv=t},n("div",{class:"gn-menu_wrap",ref:t=>this.menuWrapDiv=t,tabindex:"-1"},n("div",{class:"gn-menu_actions"},n("button",{class:"menu-btn icon-btn icon-btn",onMouseDown:this.onMenuBtnClick,onKeyDown:this.onMenuBtnKeyDown},this.threshold<this.THRESHOLDLIMIT-3&&n("nano-icon",{name:"light/times","aria-label":"close menu"}),this.threshold>=this.THRESHOLDLIMIT-3&&n("nano-icon",{name:"light/bars","aria-label":"close menu"})),this.threshold<this.THRESHOLDLIMIT-g.icon&&[!!this.iconSlotLen&&n("slot",{name:"icon"}),this.myAccData&&(!this.activeMyAccountSections||this.activeMyAccountSections.includes("icons"))&&[this.msgUrl&&n("a",{href:this.msgUrl,class:"icon-btn"},n("nano-icon",{name:"light/bell"}),this.msgCount>0&&n("span",{class:"gn-menu_actions-counter"},this.msgCount)),this.cartUrl&&n("a",{href:this.cartUrl,class:"icon-btn"},n("nano-icon",{name:"light/shopping-cart"}),this.cartCount>0&&n("span",{class:"gn-menu_actions-counter"},this.cartCount))]],this.myAccData&&this.myAccData.urls.login&&n("a",{href:this.myAccData.urls.login+this.ssoRedirect,class:"login-btn"},"Login / Register"," ",n("nano-icon",{name:"solid/chevron-right"}))),n("div",{class:"content-wrap",ref:t=>this.menuContentDiv=t},n("div",{class:"content"},n("nav",{class:"nav-links nav-links--main"},n("slot",{name:"overflow"}),this.threshold<this.THRESHOLDLIMIT-g.main&&!!this.mainSlotLen&&n("slot",{name:"main"})),((!!this.aboutSlotLen||!!this.aboutNavItms.length)&&this.threshold<this.THRESHOLDLIMIT-g.about||this.hasSiteSlot||!!this.siteNavItms.length)&&n("div",null,(!!this.aboutSlotLen||!!this.aboutNavItms.length)&&this.threshold<this.THRESHOLDLIMIT-g.about&&[(this.threshold>=this.THRESHOLDLIMIT-(g.about+1)||this.mainSlotLen<2)&&this.overflowSlotLen<2&&n("div",{class:"nav-links-wrap"},!!this.aboutNavItms.length&&n("h4",{class:"nav-links_title"},"About"),n("nav",{class:"nav-links nav-links--sub","aria-label":"About the company links"},n("slot",{name:"about"}),this.aboutNavItms.map((t=>n("nano-nav-item",{class:"nano-global-nav nano-global-nav-menu"},n("a",{href:t.address,target:t.target},t.title)))))),(this.threshold<this.THRESHOLDLIMIT-(g.about+1)&&this.mainSlotLen>=2||this.overflowSlotLen>=2)&&n("nav",{class:"nav-links","aria-label":"About the company links"},!this.aboutNavItms.length&&n("slot",{name:"about"}),!!this.aboutNavItms.length&&n("nano-nav-item",{class:"nano-global-nav nano-global-nav-menu"},"Company",n("nano-icon",{slot:"icon-end",name:"solid/chevron-right"}),n("div",{slot:"secondary"},n("div",{class:"content"},n("button",{class:"back-btn",onClick:this.subMenuClose},n("nano-icon",{slot:"icon-end",name:"solid/chevron-left","aria-label":"go back"}),"Company"),n("slot",{name:"about"}),n("div",{class:"content--sub"},this.aboutNavItms.map((t=>n("nano-nav-item",{class:"nano-global-nav nano-global-nav-menu"},n("a",{href:t.address,target:t.target},t.title)))))))))],(this.hasSiteSlot||!!this.siteNavItms.length)&&[(this.threshold>=this.THRESHOLDLIMIT-2||this.mainSlotLen<2)&&this.overflowSlotLen<2&&n("div",{class:"nav-links-wrap"},n("h4",{class:"nav-links_title"},"Sites"),n("nav",{class:"nav-links nav-links--sub","aria-label":"Different company site links"},n("slot",{name:"site"}),this.siteNavItms.map((t=>n("nano-nav-item",{class:"nano-global-nav nano-global-nav-menu"},n("a",{href:t.address,target:t.target},t.title)))))),(this.threshold<this.THRESHOLDLIMIT-2&&this.mainSlotLen>=2||this.overflowSlotLen>=2)&&n("nav",{class:"nav-links","aria-label":"Different company site links"},n("nano-nav-item",{class:"nano-global-nav nano-global-nav-menu"},"Sites",n("nano-icon",{slot:"icon-end",name:"solid/chevron-right"}),n("div",{slot:"secondary"},n("div",{class:"content"},n("button",{class:"back-btn",onClick:this.subMenuClose},n("nano-icon",{slot:"icon-end",name:"solid/chevron-left","aria-label":"go back"}),"Sites"),n("div",{class:"content--sub"},n("slot",{name:"site"}),this.siteNavItms.map((t=>n("nano-nav-item",{class:"nano-global-nav nano-global-nav-menu"},n("a",{href:t.address,target:t.target},t.title)))))))))])),this.isLoggedIn&&this.threshold<this.THRESHOLDLIMIT-g.login&&(this.loggedInNavItms.length||this.hasLoggedinSlot)&&n("nav",{class:"nav-links","aria-label":"Your user account links"},n("nano-nav-item",{class:"nano-global-nav user-nav nano-global-nav-menu"},this.myAccountUser.name,n("nano-icon",{slot:"icon-end",name:"solid/chevron-right"}),n("div",{slot:"secondary"},n("div",{class:"content"},n("button",{class:"back-btn",onClick:this.subMenuClose},n("nano-icon",{slot:"icon-end",name:"solid/chevron-left","aria-label":"go back"}),this.myAccountUser.name),n("div",{class:"content--sub"},n("slot",{name:"loggedin"}),this.loggedInNavItms.map((t=>n("nano-nav-item",{class:"nano-global-nav nano-global-nav-menu"},n("a",{href:t.address,target:t.target},t.title)))),n("nano-nav-item",{class:"nano-global-nav nano-global-nav-menu"},n("a",{href:this.myAccData.urls.forgot_password+this.ssoRedirect},"Change Password"))))))),n("slot",{name:"promotion"}),this.myAccData&&this.myAccData.urls.logout&&n("div",{class:"login-btn logout-btn"},n("a",{href:this.myAccData.urls.logout+this.ssoRedirect},"Logout"))))),n("nano-sticker",{"auto-resize":"false","break-point-max":"800",quietMode:{h:600,w:800}},n("div",{class:"bars",ref:t=>this.barsDiv=t},n("nav",{class:"main-bar","aria-label":"Main site navigation",tabindex:"-1",ref:t=>this.mainBarDiv=t},(this.hasPromotionSlot||!!this.overflowSlotLen||(this.myAccData||!!this.iconSlotLen)&&this.threshold<this.THRESHOLDLIMIT-g.icon||this.isLoggedIn&&(!!this.loggedInNavItms.length||this.hasLoggedinSlot)&&this.threshold<this.THRESHOLDLIMIT-g.login||!!this.mainSlotLen&&this.threshold<this.THRESHOLDLIMIT-g.main||(!!this.aboutSlotLen||!!this.aboutNavItms.length)&&this.threshold<this.THRESHOLDLIMIT-g.about||this.hasSiteSlot||!!this.siteNavItms.length)&&n("button",{class:"menu-btn icon-btn",onMouseDown:this.menuOpen,onKeyDown:this.onMenuBtnKeyDown,"aria-expanded":this.modalOpen?"true":"false","aria-controls":"global-nav-menu",ref:t=>this.menuBtn=t},n("nano-icon",{name:"light/bars","aria-label":"open menu"})),this.showLogo&&n("a",{href:this.logoUrl,class:"logo-link"},n("img",{src:a(`./assets/ont-logo.svg`),alt:"Oxford Nanopore Technologies Logo",class:"logo"})),!this.showLogo&&n("div",{class:"logo-link"},n("slot",{name:"logo"})),n("div",{class:"nav-links nav-links--main"},n("slot",{name:"main"})),this.threshold>=this.THRESHOLDLIMIT-g.search&&[this.showSearch&&!!this.internalSearchIndeces.length&&n("div",{class:"search-widget",role:"combobox","aria-owns":"autocomplete-results","aria-expanded":this.showAutocomplete&&this.autocompleteResults?"true":"false"},i),(!this.showSearch||!this.myAccData)&&!!this.searchSlotLen&&n("slot",{name:"search"})],(!!this.aboutSlotLen||!!this.aboutNavItms.length)&&this.threshold>=this.THRESHOLDLIMIT-g.about&&n("nav",{class:"nav-links nav-links--sub","aria-label":"About the company. Links"},n("slot",{name:"about"}),this.aboutNavItms.map((t=>n("nano-nav-item",{class:"nano-global-nav nano-global-nav-bar"},n("a",{href:t.address,target:t.target},t.title))))),this.threshold<this.THRESHOLDLIMIT-g.search&&(this.showSearch&&!!this.internalSearchIndeces.length||!!this.searchSlotLen)&&n("button",{class:"icon-btn","aria-controls":"global-nav-search-bar","aria-expanded":this.searchBarShown?"true":"false",onMouseDown:this.onSearchBtnClick,onKeyDown:this.onSearchBtnKeyDown},n("nano-icon",{name:"light/search"})),this.threshold>=this.THRESHOLDLIMIT-g.icon&&[!!this.iconSlotLen&&n("slot",{name:"icon"}),this.myAccData&&(!this.activeMyAccountSections||this.activeMyAccountSections.includes("icons"))&&[this.msgUrl&&n("a",{href:this.msgUrl,class:"icon-btn"},n("nano-icon",{name:"light/bell"}),this.msgCount>0&&n("span",{class:"gn-menu_actions-counter"},this.msgCount)),this.cartUrl&&n("a",{href:this.cartUrl,class:"icon-btn"},n("nano-icon",{name:"light/shopping-cart"}),this.cartCount>0&&n("span",{class:"gn-menu_actions-counter"},this.cartCount))]],this.myAccData&&(!this.activeMyAccountSections||this.activeMyAccountSections.includes("loggedin"))&&this.threshold>=this.THRESHOLDLIMIT-g.login&&[this.myAccData.urls.login&&n("a",{href:this.myAccData.urls.login+this.ssoRedirect,class:"login-btn"},"Login / Register"),this.myAccountUser&&n("div",{class:"user-links"},n("button",{class:{"icon-btn":true,"user-links-btn":true,open:this.userMenuOpen},onMouseDown:this.onUserBtnClick,onKeyDown:this.onUserBtnKeyDown}," ",this.myAccountUser.name,n("nano-icon",{name:"solid/caret-down"})),n("div",{class:"user-links-panel",tabindex:"-1",ref:t=>this.userLinkPanel=t},n("div",{class:"user-links-panel-content"},this.loggedInNavItms.map((t=>n("a",{href:t.address,target:t.target},t.title)))),n("div",{class:"user-links-panel-foot"},n("a",{href:this.myAccData.urls.forgot_password+this.ssoRedirect},"Change Password"),n("a",{href:this.myAccData.urls.logout+this.ssoRedirect},"Logout"))))],n("span",{class:"measure-ele"})),this.threshold<this.THRESHOLDLIMIT-g.search&&n("div",{id:"global-nav-search-bar",class:{"search-bar":true,show:this.searchBarShown},"aria-expanded":this.searchBarShown?"true":"false",role:"region",tabindex:"-1",ref:t=>this.searchBarEl=t},n("div",{class:"search-widget"},this.showSearch&&!!this.internalSearchIndeces.length&&n("div",null,i),(!this.showSearch||!this.myAccData)&&!!this.searchSlotLen&&n("slot",{name:"search"}))))),(this.threshold<this.THRESHOLDLIMIT-3||this.menuFullScreen)&&n("div",{class:{mask:true,open:this.modalOpen},onClick:this.menuClose,onTouchEnd:this.menuClose})),n("div",{class:"site-content",ref:t=>this.siteContent=t},n("slot",null)))}domainFor(t){if(!this.myAccData)return"";const i=this.myAccData.domains.find((i=>i.origin===t));return i?i.domain:""}processSearchResults(t){const i=t;const e=t;if(i.results){i.results.forEach(((t,e)=>{i.results[e]=this.processSearchResults(t)}));return i}else{e.hits.map((t=>{if(t.url&&!t.url.match(/^http/))t.url=location.protocol+"//"+this.domainFor(t.origin)+t.url}));return e}}processMyAccData(){if(!this.myAccData||!this.myAccData.search.indeces.length)return;if(this.myAccData.search.api_key)this.searchApiKey=this.myAccData.search.api_key;if(this.myAccData.search.app_id)this.searchAppId=this.myAccData.search.app_id;if(this.myAccData.cart.count)this.cartCount=this.myAccData.cart.count;if(this.myAccData.notifications.count)this.msgCount=this.myAccData.notifications.count;if(!this.searchAppId||!this.searchApiKey)return;this.internalSearchIndeces=[...this.myAccData.search.indeces,...this.searchIndeces];if(this.myAccData.urls.cart&&!this.cartUrl)this.cartUrl=this.myAccData.urls.cart;if(this.myAccData.urls.messages&&!this.msgUrl)this.msgUrl=this.myAccData.urls.messages}processMyAccLinks(){if(!this.myAccData.links||!this.myAccData.links.length)return;this.myAccData.links.forEach((t=>{switch(t.area){case"left-side-logged-in":case"left-side-logged-out":if(this.activeMyAccountSections&&!this.activeMyAccountSections.includes("sites"))break;if(this.isLoggedIn&&t.area==="left-side-logged-in")this.siteNavItms.push(t);else if(!this.isLoggedIn&&t.area==="left-side-logged-out")this.siteNavItms.push(t);break;case"right-side-logged-in":case"right-side-logged-out":if(this.activeMyAccountSections&&!this.activeMyAccountSections.includes("about"))break;if(this.isLoggedIn&&t.area==="right-side-logged-in")this.aboutNavItms.push(t);else if(!this.isLoggedIn&&t.area==="right-side-logged-out")this.aboutNavItms.push(t);break;case"profile-panel-list":if(this.activeMyAccountSections&&!this.activeMyAccountSections.includes("loggedin"))break;this.loggedInNavItms.push(t);break}}))}static get assetsDirs(){return["assets"]}get el(){return r(this)}static get watchers(){return{env:["getMyAccData"],ssoDataUrl:["getMyAccData"],searchIndex:["currentSelectedIndex"],searchValInternal:["changeInternalSearchVal"],searchApiKey:["initAlgoliaClient"],searchAppId:["initAlgoliaClient"],searchIndeces:["addIndeces"],internalSearchIndeces:["addAlgoliaIndeces"],threshold:["thresholdChange"],intersectRatio:["ratioChange"],thresholdReady:["assessReady"],remoteDataReady:["assessReady","remoteReady"],ready:["isReady"],showAutocomplete:["setupAutocompleteBlur","resetHitFocus"],aboutSlotLen:["slotChange"],iconSlotLen:["slotChange"],mainSlotLen:["slotChange"],overflowSlotLen:["slotChange"],searchSlotLen:["slotChange"],userMenuOpen:["handleUserMenu"]}}};f.style=m;export{f as nano_global_nav};
5
- //# sourceMappingURL=p-3d9623ad.entry.js.map