@nanoporetech-digital/components 5.1.3 → 5.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +26 -0
- package/dist/cjs/{component-store-74d25f63.js → component-store-f1dc1276.js} +2 -2
- package/dist/cjs/{component-store-74d25f63.js.map → component-store-f1dc1276.js.map} +1 -1
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/nano-algolia-filter.cjs.entry.js +2 -2
- package/dist/cjs/nano-algolia-input.cjs.entry.js +2 -2
- package/dist/cjs/nano-algolia.cjs.entry.js +2 -2
- package/dist/cjs/nano-checkbox-group.cjs.entry.js +1 -1
- package/dist/cjs/nano-components.cjs.js +1 -1
- package/dist/cjs/nano-datalist_3.cjs.entry.js +1 -1
- package/dist/cjs/nano-dialog.cjs.entry.js +2 -2
- package/dist/cjs/nano-global-nav-user-profile_3.cjs.entry.js +2 -2
- package/dist/cjs/nano-global-nav-user-profile_3.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-global-nav.cjs.entry.js +2 -2
- package/dist/cjs/nano-input.cjs.entry.js +1 -1
- package/dist/cjs/nano-overflow-nav.cjs.entry.js +1 -1
- package/dist/cjs/nano-range.cjs.entry.js +1 -1
- package/dist/cjs/nano-resize-observe_2.cjs.entry.js +3 -1
- package/dist/cjs/nano-resize-observe_2.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-sortable.cjs.entry.js +16 -8
- package/dist/cjs/nano-sortable.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-split-pane.cjs.entry.js +1 -1
- package/dist/cjs/nano-sticker.cjs.entry.js +4 -2
- package/dist/cjs/nano-sticker.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-tab-group.cjs.entry.js +2 -2
- package/dist/cjs/{nano-table-5a7a4d53.js → nano-table-10a40ab3.js} +557 -185
- package/dist/cjs/nano-table-10a40ab3.js.map +1 -0
- package/dist/cjs/nano-table.cjs.entry.js +2 -2
- package/dist/cjs/{table.worker-77e56070.js → table.worker-f04588c1.js} +4 -4
- package/dist/cjs/table.worker-f04588c1.js.map +1 -0
- package/dist/cjs/{table.worker-bd51e29f.js → table.worker-f258383d.js} +1 -1
- package/dist/cjs/{throttle-f55496c8.js → throttle-dfa64b9e.js} +17 -20
- package/dist/cjs/throttle-dfa64b9e.js.map +1 -0
- package/dist/collection/components/resize-observe/resize-observe.js +21 -1
- package/dist/collection/components/resize-observe/resize-observe.js.map +1 -1
- package/dist/collection/components/select/select.css +0 -1
- package/dist/collection/components/sortable/sortable.js +3 -7
- package/dist/collection/components/sortable/sortable.js.map +1 -1
- package/dist/collection/components/sticker/sticker.js +11 -5
- package/dist/collection/components/sticker/sticker.js.map +1 -1
- package/dist/collection/components/table/table-interface.js.map +1 -1
- package/dist/collection/components/table/table.cell.js +43 -10
- package/dist/collection/components/table/table.cell.js.map +1 -1
- package/dist/collection/components/table/table.css +38 -55
- package/dist/collection/components/table/table.header.js +4 -9
- package/dist/collection/components/table/table.header.js.map +1 -1
- package/dist/collection/components/table/table.js +101 -47
- package/dist/collection/components/table/table.js.map +1 -1
- package/dist/collection/components/table/table.pin-service.js +382 -0
- package/dist/collection/components/table/table.pin-service.js.map +1 -0
- package/dist/collection/components/table/table.row.js +39 -46
- package/dist/collection/components/table/table.row.js.map +1 -1
- package/dist/collection/components/table/table.utils.js +0 -124
- package/dist/collection/components/table/table.utils.js.map +1 -1
- package/dist/collection/components/table/table.worker.js +1 -0
- package/dist/collection/components/table/table.worker.js.map +1 -1
- package/dist/collection/utils/events.js +27 -0
- package/dist/collection/utils/events.js.map +1 -0
- package/dist/collection/utils/throttle.js +16 -19
- package/dist/collection/utils/throttle.js.map +1 -1
- package/dist/components/nano-sortable.js +15 -7
- package/dist/components/nano-sortable.js.map +1 -1
- package/dist/components/resize-observe.js +3 -1
- package/dist/components/resize-observe.js.map +1 -1
- package/dist/components/select.js +1 -1
- package/dist/components/select.js.map +1 -1
- package/dist/components/sticker.js +3 -1
- package/dist/components/sticker.js.map +1 -1
- package/dist/components/table.js +530 -187
- package/dist/components/table.js.map +1 -1
- package/dist/components/table.worker.js +1 -1
- package/dist/components/throttle.js +16 -19
- package/dist/components/throttle.js.map +1 -1
- package/dist/esm/{component-store-244a8431.js → component-store-c23ebc9c.js} +2 -2
- package/dist/esm/{component-store-244a8431.js.map → component-store-c23ebc9c.js.map} +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/nano-algolia-filter.entry.js +2 -2
- package/dist/esm/nano-algolia-input.entry.js +2 -2
- package/dist/esm/nano-algolia.entry.js +2 -2
- package/dist/esm/nano-checkbox-group.entry.js +1 -1
- package/dist/esm/nano-components.js +1 -1
- package/dist/esm/nano-datalist_3.entry.js +1 -1
- package/dist/esm/nano-dialog.entry.js +2 -2
- package/dist/esm/nano-global-nav-user-profile_3.entry.js +2 -2
- package/dist/esm/nano-global-nav-user-profile_3.entry.js.map +1 -1
- package/dist/esm/nano-global-nav.entry.js +2 -2
- package/dist/esm/nano-input.entry.js +1 -1
- package/dist/esm/nano-overflow-nav.entry.js +1 -1
- package/dist/esm/nano-range.entry.js +1 -1
- package/dist/esm/nano-resize-observe_2.entry.js +3 -1
- package/dist/esm/nano-resize-observe_2.entry.js.map +1 -1
- package/dist/esm/nano-sortable.entry.js +16 -8
- package/dist/esm/nano-sortable.entry.js.map +1 -1
- package/dist/esm/nano-split-pane.entry.js +1 -1
- package/dist/esm/nano-sticker.entry.js +4 -2
- package/dist/esm/nano-sticker.entry.js.map +1 -1
- package/dist/esm/nano-tab-group.entry.js +2 -2
- package/dist/esm/{nano-table-026a0d30.js → nano-table-2bbcaa8d.js} +558 -186
- package/dist/esm/nano-table-2bbcaa8d.js.map +1 -0
- package/dist/esm/nano-table.entry.js +2 -2
- package/dist/esm/{table.worker-c17a27ed.js → table.worker-7324ad73.js} +4 -4
- package/dist/esm/table.worker-7324ad73.js.map +1 -0
- package/dist/esm/{table.worker-bd51e29f.js → table.worker-f258383d.js} +1 -1
- package/dist/esm/{throttle-7836544e.js → throttle-ac4fcefa.js} +17 -20
- package/dist/esm/throttle-ac4fcefa.js.map +1 -0
- package/dist/nano-components/index.esm.js +1 -1
- package/dist/nano-components/nano-components.esm.js +1 -1
- package/dist/nano-components/nano-components.esm.js.map +1 -1
- package/dist/nano-components/{p-7d6065c6.entry.js → p-0697795a.entry.js} +2 -2
- package/dist/nano-components/p-0697795a.entry.js.map +1 -0
- package/dist/nano-components/{p-6975f110.entry.js → p-192902e0.entry.js} +2 -2
- package/dist/nano-components/{p-a6ff5ca6.js → p-1a0b5bc3.js} +2 -2
- package/dist/nano-components/{p-3a761d77.entry.js → p-1b791810.entry.js} +2 -2
- package/dist/nano-components/p-39aec880.entry.js +5 -0
- package/dist/nano-components/{p-3b4b7f40.entry.js → p-3eb6d833.entry.js} +2 -2
- package/dist/nano-components/{p-a1c0afb6.entry.js → p-4884b65a.entry.js} +2 -2
- package/dist/nano-components/p-52ae36ec.js +5 -0
- package/dist/nano-components/{p-34501eae.entry.js → p-565793a2.entry.js} +2 -2
- package/dist/nano-components/p-5aae2588.entry.js +5 -0
- package/dist/nano-components/p-5aae2588.entry.js.map +1 -0
- package/dist/nano-components/{p-935aef3d.entry.js → p-6920ad69.entry.js} +2 -2
- package/dist/nano-components/{p-1c6c94cb.entry.js → p-7baa9e14.entry.js} +2 -2
- package/dist/nano-components/p-7bff5224.js +5 -0
- package/dist/nano-components/p-7bff5224.js.map +1 -0
- package/dist/nano-components/{p-f60fe933.entry.js → p-898cbac7.entry.js} +2 -2
- package/dist/nano-components/p-9b533dc3.js +5 -0
- package/dist/nano-components/p-9b533dc3.js.map +1 -0
- package/dist/nano-components/{p-ace1ffc2.entry.js → p-a362bd23.entry.js} +2 -2
- package/dist/nano-components/{p-eb6c9191.entry.js → p-b72df1aa.entry.js} +2 -2
- package/dist/nano-components/{p-9c4efe14.entry.js → p-bf18e298.entry.js} +2 -2
- package/dist/nano-components/p-bf18e298.entry.js.map +1 -0
- package/dist/nano-components/p-ce5efc3f.entry.js +5 -0
- package/dist/nano-components/p-ce5efc3f.entry.js.map +1 -0
- package/dist/nano-components/{p-1b687f96.entry.js → p-d0eefd52.entry.js} +2 -2
- package/dist/nano-components/{p-1a9d9956.entry.js → p-d74e2642.entry.js} +2 -2
- package/dist/nano-components/{p-bd51e29f.js → p-f258383d.js} +1 -1
- package/dist/types/components/resize-observe/resize-observe.d.ts +2 -0
- package/dist/types/components/sortable/sortable.d.ts +0 -1
- package/dist/types/components/sticker/sticker.d.ts +2 -2
- package/dist/types/components/table/table-interface.d.ts +23 -11
- package/dist/types/components/table/table.cell.d.ts +0 -7
- package/dist/types/components/table/table.d.ts +10 -8
- package/dist/types/components/table/table.header.d.ts +0 -1
- package/dist/types/components/table/table.pin-service.d.ts +90 -0
- package/dist/types/components/table/table.row.d.ts +3 -2
- package/dist/types/components/table/table.utils.d.ts +0 -27
- package/dist/types/components.d.ts +29 -11
- package/dist/types/utils/events.d.ts +15 -0
- package/dist/types/utils/throttle.d.ts +1 -1
- package/docs-json.json +59 -24
- package/docs-vscode.json +2 -2
- package/hydrate/index.js +580 -194
- package/package.json +2 -2
- package/dist/cjs/nano-table-5a7a4d53.js.map +0 -1
- package/dist/cjs/table.worker-77e56070.js.map +0 -1
- package/dist/cjs/throttle-f55496c8.js.map +0 -1
- package/dist/esm/nano-table-026a0d30.js.map +0 -1
- package/dist/esm/table.worker-c17a27ed.js.map +0 -1
- package/dist/esm/throttle-7836544e.js.map +0 -1
- package/dist/nano-components/p-15217442.entry.js +0 -5
- package/dist/nano-components/p-15217442.entry.js.map +0 -1
- package/dist/nano-components/p-2e63676f.js +0 -5
- package/dist/nano-components/p-30cc21c2.entry.js +0 -5
- package/dist/nano-components/p-59eb9caa.js +0 -5
- package/dist/nano-components/p-59eb9caa.js.map +0 -1
- package/dist/nano-components/p-7759d185.entry.js +0 -5
- package/dist/nano-components/p-7759d185.entry.js.map +0 -1
- package/dist/nano-components/p-7d6065c6.entry.js.map +0 -1
- package/dist/nano-components/p-9746b0a5.js +0 -5
- package/dist/nano-components/p-9746b0a5.js.map +0 -1
- package/dist/nano-components/p-9c4efe14.entry.js.map +0 -1
- /package/dist/nano-components/{p-6975f110.entry.js.map → p-192902e0.entry.js.map} +0 -0
- /package/dist/nano-components/{p-a6ff5ca6.js.map → p-1a0b5bc3.js.map} +0 -0
- /package/dist/nano-components/{p-3a761d77.entry.js.map → p-1b791810.entry.js.map} +0 -0
- /package/dist/nano-components/{p-2e63676f.js.map → p-39aec880.entry.js.map} +0 -0
- /package/dist/nano-components/{p-3b4b7f40.entry.js.map → p-3eb6d833.entry.js.map} +0 -0
- /package/dist/nano-components/{p-a1c0afb6.entry.js.map → p-4884b65a.entry.js.map} +0 -0
- /package/dist/nano-components/{p-30cc21c2.entry.js.map → p-52ae36ec.js.map} +0 -0
- /package/dist/nano-components/{p-34501eae.entry.js.map → p-565793a2.entry.js.map} +0 -0
- /package/dist/nano-components/{p-935aef3d.entry.js.map → p-6920ad69.entry.js.map} +0 -0
- /package/dist/nano-components/{p-1c6c94cb.entry.js.map → p-7baa9e14.entry.js.map} +0 -0
- /package/dist/nano-components/{p-f60fe933.entry.js.map → p-898cbac7.entry.js.map} +0 -0
- /package/dist/nano-components/{p-ace1ffc2.entry.js.map → p-a362bd23.entry.js.map} +0 -0
- /package/dist/nano-components/{p-eb6c9191.entry.js.map → p-b72df1aa.entry.js.map} +0 -0
- /package/dist/nano-components/{p-1b687f96.entry.js.map → p-d0eefd52.entry.js.map} +0 -0
- /package/dist/nano-components/{p-1a9d9956.entry.js.map → p-d74e2642.entry.js.map} +0 -0
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
2
|
* Web Components for Nanopore digital Web Apps
|
3
3
|
*/
|
4
|
-
import{g as r}from"./p-f6a8467a.js";import{d as e}from"./p-9746b0a5.js";import{c as t,g as n}from"./p-69a3e911.js";var o=function r(){if(typeof Symbol!=="function"||typeof Object.getOwnPropertySymbols!=="function"){return false}if(typeof Symbol.iterator==="symbol"){return true}var e={};var t=Symbol("test");var n=Object(t);if(typeof t==="string"){return false}if(Object.prototype.toString.call(t)!=="[object Symbol]"){return false}if(Object.prototype.toString.call(n)!=="[object Symbol]"){return false}var o=42;e[t]=o;for(t in e){return false}if(typeof Object.keys==="function"&&Object.keys(e).length!==0){return false}if(typeof Object.getOwnPropertyNames==="function"&&Object.getOwnPropertyNames(e).length!==0){return false}var i=Object.getOwnPropertySymbols(e);if(i.length!==1||i[0]!==t){return false}if(!Object.prototype.propertyIsEnumerable.call(e,t)){return false}if(typeof Object.getOwnPropertyDescriptor==="function"){var a=Object.getOwnPropertyDescriptor(e,t);if(a.value!==o||a.enumerable!==true){return false}}return true};var i=typeof Symbol!=="undefined"&&Symbol;var a=function r(){if(typeof i!=="function"){return false}if(typeof Symbol!=="function"){return false}if(typeof i("foo")!=="symbol"){return false}if(typeof Symbol("bar")!=="symbol"){return false}return o()};var f="Function.prototype.bind called on incompatible ";var u=Array.prototype.slice;var c=Object.prototype.toString;var y="[object Function]";var p=function r(e){var t=this;if(typeof t!=="function"||c.call(t)!==y){throw new TypeError(f+t)}var n=u.call(arguments,1);var o;var i=function(){if(this instanceof o){var r=t.apply(this,n.concat(u.call(arguments)));if(Object(r)===r){return r}return this}else{return t.apply(e,n.concat(u.call(arguments)))}};var a=Math.max(0,t.length-n.length);var p=[];for(var s=0;s<a;s++){p.push("$"+s)}o=Function("binder","return function ("+p.join(",")+"){ return binder.apply(this,arguments); }")(i);if(t.prototype){var l=function r(){};l.prototype=t.prototype;o.prototype=new l;l.prototype=null}return o};var s=Function.prototype.bind||p;var l=s.call(Function.call,Object.prototype.hasOwnProperty);var v;var d=SyntaxError;var b=Function;var h=TypeError;var m=function(r){try{return b('"use strict"; return ('+r+").constructor;")()}catch(r){}};var g=Object.getOwnPropertyDescriptor;var S=function(){throw new h};var j=g?function(){try{return S}catch(r){try{return g(arguments,"callee").get}catch(r){return S}}}():S;var A=a();var w=Object.getPrototypeOf||function(r){return r.__proto__};var O={};var P=typeof Uint8Array==="undefined"?v:w(Uint8Array);var E={"%AggregateError%":typeof AggregateError==="undefined"?v:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer==="undefined"?v:ArrayBuffer,"%ArrayIteratorPrototype%":A?w([][Symbol.iterator]()):v,"%AsyncFromSyncIteratorPrototype%":v,"%AsyncFunction%":O,"%AsyncGenerator%":O,"%AsyncGeneratorFunction%":O,"%AsyncIteratorPrototype%":O,"%Atomics%":typeof Atomics==="undefined"?v:Atomics,"%BigInt%":typeof BigInt==="undefined"?v:BigInt,"%BigInt64Array%":typeof BigInt64Array==="undefined"?v:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array==="undefined"?v:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView==="undefined"?v:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array==="undefined"?v:Float32Array,"%Float64Array%":typeof Float64Array==="undefined"?v:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry==="undefined"?v:FinalizationRegistry,"%Function%":b,"%GeneratorFunction%":O,"%Int8Array%":typeof Int8Array==="undefined"?v:Int8Array,"%Int16Array%":typeof Int16Array==="undefined"?v:Int16Array,"%Int32Array%":typeof Int32Array==="undefined"?v:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":A?w(w([][Symbol.iterator]())):v,"%JSON%":typeof JSON==="object"?JSON:v,"%Map%":typeof Map==="undefined"?v:Map,"%MapIteratorPrototype%":typeof Map==="undefined"||!A?v:w((new Map)[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise==="undefined"?v:Promise,"%Proxy%":typeof Proxy==="undefined"?v:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect==="undefined"?v:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set==="undefined"?v:Set,"%SetIteratorPrototype%":typeof Set==="undefined"||!A?v:w((new Set)[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer==="undefined"?v:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":A?w(""[Symbol.iterator]()):v,"%Symbol%":A?Symbol:v,"%SyntaxError%":d,"%ThrowTypeError%":j,"%TypedArray%":P,"%TypeError%":h,"%Uint8Array%":typeof Uint8Array==="undefined"?v:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray==="undefined"?v:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array==="undefined"?v:Uint16Array,"%Uint32Array%":typeof Uint32Array==="undefined"?v:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap==="undefined"?v:WeakMap,"%WeakRef%":typeof WeakRef==="undefined"?v:WeakRef,"%WeakSet%":typeof WeakSet==="undefined"?v:WeakSet};var I=function r(e){var t;if(e==="%AsyncFunction%"){t=m("async function () {}")}else if(e==="%GeneratorFunction%"){t=m("function* () {}")}else if(e==="%AsyncGeneratorFunction%"){t=m("async function* () {}")}else if(e==="%AsyncGenerator%"){var n=r("%AsyncGeneratorFunction%");if(n){t=n.prototype}}else if(e==="%AsyncIteratorPrototype%"){var o=r("%AsyncGenerator%");if(o){t=w(o.prototype)}}E[e]=t;return t};var F={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]};var R=s.call(Function.call,Array.prototype.concat);var k=s.call(Function.apply,Array.prototype.splice);var M=s.call(Function.call,String.prototype.replace);var x=s.call(Function.call,String.prototype.slice);var U=s.call(Function.call,RegExp.prototype.exec);var N=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;var B=/\\(\\)?/g;var W=function r(e){var t=x(e,0,1);var n=x(e,-1);if(t==="%"&&n!=="%"){throw new d("invalid intrinsic syntax, expected closing `%`")}else if(n==="%"&&t!=="%"){throw new d("invalid intrinsic syntax, expected opening `%`")}var o=[];M(e,N,(function(r,e,t,n){o[o.length]=t?M(n,B,"$1"):e||r}));return o};var T=function r(e,t){var n=e;var o;if(l(F,n)){o=F[n];n="%"+o[0]+"%"}if(l(E,n)){var i=E[n];if(i===O){i=I(n)}if(typeof i==="undefined"&&!t){throw new h("intrinsic "+e+" exists, but is not available. Please file an issue!")}return{alias:o,name:n,value:i}}throw new d("intrinsic "+e+" does not exist!")};var D=function r(e,t){if(typeof e!=="string"||e.length===0){throw new h("intrinsic name must be a non-empty string")}if(arguments.length>1&&typeof t!=="boolean"){throw new h('"allowMissing" argument must be a boolean')}if(U(/^%?[^%]*%?$/,e)===null){throw new d("`%` may not be present anywhere but at the beginning and end of the intrinsic name")}var n=W(e);var o=n.length>0?n[0]:"";var i=T("%"+o+"%",t);var a=i.name;var f=i.value;var u=false;var c=i.alias;if(c){o=c[0];k(n,R([0,1],c))}for(var y=1,p=true;y<n.length;y+=1){var s=n[y];var b=x(s,0,1);var m=x(s,-1);if((b==='"'||b==="'"||b==="`"||(m==='"'||m==="'"||m==="`"))&&b!==m){throw new d("property names with quotes must have matching quotes")}if(s==="constructor"||!p){u=true}o+="."+s;a="%"+o+"%";if(l(E,a)){f=E[a]}else if(f!=null){if(!(s in f)){if(!t){throw new h("base intrinsic for "+e+" exists, but the property is not available.")}return void v}if(g&&y+1>=n.length){var S=g(f,s);p=!!S;if(p&&"get"in S&&!("originalValue"in S.get)){f=S.get}else{f=f[s]}}else{p=l(f,s);f=f[s]}if(p&&!u){E[a]=f}}}return f};var C=t((function(r){var e=D("%Function.prototype.apply%");var t=D("%Function.prototype.call%");var n=D("%Reflect.apply%",true)||s.call(t,e);var o=D("%Object.getOwnPropertyDescriptor%",true);var i=D("%Object.defineProperty%",true);var a=D("%Math.max%");if(i){try{i({},"a",{value:1})}catch(r){i=null}}r.exports=function r(e){var f=n(s,t,arguments);if(o&&i){var u=o(f,"length");if(u.configurable){i(f,"length",{value:1+a(0,e.length-(arguments.length-1))})}}return f};var f=function r(){return n(s,e,arguments)};if(i){i(r.exports,"apply",{value:f})}else{r.exports.apply=f}}));var _=C(D("String.prototype.indexOf"));var q=function r(e,t){var n=D(e,!!t);if(typeof n==="function"&&_(e,".prototype.")>-1){return C(n)}return n};const G={};const $=Object.freeze({__proto__:null,default:G});const J=n($);var V=typeof Map==="function"&&Map.prototype;var H=Object.getOwnPropertyDescriptor&&V?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null;var L=V&&H&&typeof H.get==="function"?H.get:null;var z=V&&Map.prototype.forEach;var Q=typeof Set==="function"&&Set.prototype;var Y=Object.getOwnPropertyDescriptor&&Q?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null;var K=Q&&Y&&typeof Y.get==="function"?Y.get:null;var X=Q&&Set.prototype.forEach;var Z=typeof WeakMap==="function"&&WeakMap.prototype;var rr=Z?WeakMap.prototype.has:null;var er=typeof WeakSet==="function"&&WeakSet.prototype;var tr=er?WeakSet.prototype.has:null;var nr=typeof WeakRef==="function"&&WeakRef.prototype;var or=nr?WeakRef.prototype.deref:null;var ir=Boolean.prototype.valueOf;var ar=Object.prototype.toString;var fr=Function.prototype.toString;var ur=String.prototype.match;var cr=String.prototype.slice;var yr=String.prototype.replace;var pr=String.prototype.toUpperCase;var sr=String.prototype.toLowerCase;var lr=RegExp.prototype.test;var vr=Array.prototype.concat;var dr=Array.prototype.join;var br=Array.prototype.slice;var hr=Math.floor;var mr=typeof BigInt==="function"?BigInt.prototype.valueOf:null;var gr=Object.getOwnPropertySymbols;var Sr=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?Symbol.prototype.toString:null;var jr=typeof Symbol==="function"&&typeof Symbol.iterator==="object";var Ar=typeof Symbol==="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===jr?"object":"symbol")?Symbol.toStringTag:null;var wr=Object.prototype.propertyIsEnumerable;var Or=(typeof Reflect==="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(r){return r.__proto__}:null);function Pr(r,e){if(r===Infinity||r===-Infinity||r!==r||r&&r>-1e3&&r<1e3||lr.call(/e/,e)){return e}var t=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof r==="number"){var n=r<0?-hr(-r):hr(r);if(n!==r){var o=String(n);var i=cr.call(e,o.length+1);return yr.call(o,t,"$&_")+"."+yr.call(yr.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return yr.call(e,t,"$&_")}var Er=J.custom;var Ir=Dr(Er)?Er:null;var Fr=function r(e,t,n,o){var i=t||{};if(qr(i,"quoteStyle")&&(i.quoteStyle!=="single"&&i.quoteStyle!=="double")){throw new TypeError('option "quoteStyle" must be "single" or "double"')}if(qr(i,"maxStringLength")&&(typeof i.maxStringLength==="number"?i.maxStringLength<0&&i.maxStringLength!==Infinity:i.maxStringLength!==null)){throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`')}var a=qr(i,"customInspect")?i.customInspect:true;if(typeof a!=="boolean"&&a!=="symbol"){throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`")}if(qr(i,"indent")&&i.indent!==null&&i.indent!=="\t"&&!(parseInt(i.indent,10)===i.indent&&i.indent>0)){throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`')}if(qr(i,"numericSeparator")&&typeof i.numericSeparator!=="boolean"){throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`')}var f=i.numericSeparator;if(typeof e==="undefined"){return"undefined"}if(e===null){return"null"}if(typeof e==="boolean"){return e?"true":"false"}if(typeof e==="string"){return Kr(e,i)}if(typeof e==="number"){if(e===0){return Infinity/e>0?"0":"-0"}var u=String(e);return f?Pr(e,u):u}if(typeof e==="bigint"){var c=String(e)+"n";return f?Pr(e,c):c}var y=typeof i.depth==="undefined"?5:i.depth;if(typeof n==="undefined"){n=0}if(n>=y&&y>0&&typeof e==="object"){return Mr(e)?"[Array]":"[Object]"}var p=ne(i,n);if(typeof o==="undefined"){o=[]}else if(Jr(o,e)>=0){return"[Circular]"}function s(e,t,a){if(t){o=br.call(o);o.push(t)}if(a){var f={depth:i.depth};if(qr(i,"quoteStyle")){f.quoteStyle=i.quoteStyle}return r(e,f,n+1,o)}return r(e,i,n+1,o)}if(typeof e==="function"&&!Ur(e)){var l=$r(e);var v=ie(e,s);return"[Function"+(l?": "+l:" (anonymous)")+"]"+(v.length>0?" { "+dr.call(v,", ")+" }":"")}if(Dr(e)){var d=jr?yr.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):Sr.call(e);return typeof e==="object"&&!jr?Zr(d):d}if(Yr(e)){var b="<"+sr.call(String(e.nodeName));var h=e.attributes||[];for(var m=0;m<h.length;m++){b+=" "+h[m].name+"="+Rr(kr(h[m].value),"double",i)}b+=">";if(e.childNodes&&e.childNodes.length){b+="..."}b+="</"+sr.call(String(e.nodeName))+">";return b}if(Mr(e)){if(e.length===0){return"[]"}var g=ie(e,s);if(p&&!te(g)){return"["+oe(g,p)+"]"}return"[ "+dr.call(g,", ")+" ]"}if(Nr(e)){var S=ie(e,s);if(!("cause"in Error.prototype)&&"cause"in e&&!wr.call(e,"cause")){return"{ ["+String(e)+"] "+dr.call(vr.call("[cause]: "+s(e.cause),S),", ")+" }"}if(S.length===0){return"["+String(e)+"]"}return"{ ["+String(e)+"] "+dr.call(S,", ")+" }"}if(typeof e==="object"&&a){if(Ir&&typeof e[Ir]==="function"&&J){return J(e,{depth:y-n})}else if(a!=="symbol"&&typeof e.inspect==="function"){return e.inspect()}}if(Vr(e)){var j=[];if(z){z.call(e,(function(r,t){j.push(s(t,e,true)+" => "+s(r,e))}))}return ee("Map",L.call(e),j,p)}if(zr(e)){var A=[];if(X){X.call(e,(function(r){A.push(s(r,e))}))}return ee("Set",K.call(e),A,p)}if(Hr(e)){return re("WeakMap")}if(Qr(e)){return re("WeakSet")}if(Lr(e)){return re("WeakRef")}if(Wr(e)){return Zr(s(Number(e)))}if(Cr(e)){return Zr(s(mr.call(e)))}if(Tr(e)){return Zr(ir.call(e))}if(Br(e)){return Zr(s(String(e)))}if(!xr(e)&&!Ur(e)){var w=ie(e,s);var O=Or?Or(e)===Object.prototype:e instanceof Object||e.constructor===Object;var P=e instanceof Object?"":"null prototype";var E=!O&&Ar&&Object(e)===e&&Ar in e?cr.call(Gr(e),8,-1):P?"Object":"";var I=O||typeof e.constructor!=="function"?"":e.constructor.name?e.constructor.name+" ":"";var F=I+(E||P?"["+dr.call(vr.call([],E||[],P||[]),": ")+"] ":"");if(w.length===0){return F+"{}"}if(p){return F+"{"+oe(w,p)+"}"}return F+"{ "+dr.call(w,", ")+" }"}return String(e)};function Rr(r,e,t){var n=(t.quoteStyle||e)==="double"?'"':"'";return n+r+n}function kr(r){return yr.call(String(r),/"/g,""")}function Mr(r){return Gr(r)==="[object Array]"&&(!Ar||!(typeof r==="object"&&Ar in r))}function xr(r){return Gr(r)==="[object Date]"&&(!Ar||!(typeof r==="object"&&Ar in r))}function Ur(r){return Gr(r)==="[object RegExp]"&&(!Ar||!(typeof r==="object"&&Ar in r))}function Nr(r){return Gr(r)==="[object Error]"&&(!Ar||!(typeof r==="object"&&Ar in r))}function Br(r){return Gr(r)==="[object String]"&&(!Ar||!(typeof r==="object"&&Ar in r))}function Wr(r){return Gr(r)==="[object Number]"&&(!Ar||!(typeof r==="object"&&Ar in r))}function Tr(r){return Gr(r)==="[object Boolean]"&&(!Ar||!(typeof r==="object"&&Ar in r))}function Dr(r){if(jr){return r&&typeof r==="object"&&r instanceof Symbol}if(typeof r==="symbol"){return true}if(!r||typeof r!=="object"||!Sr){return false}try{Sr.call(r);return true}catch(r){}return false}function Cr(r){if(!r||typeof r!=="object"||!mr){return false}try{mr.call(r);return true}catch(r){}return false}var _r=Object.prototype.hasOwnProperty||function(r){return r in this};function qr(r,e){return _r.call(r,e)}function Gr(r){return ar.call(r)}function $r(r){if(r.name){return r.name}var e=ur.call(fr.call(r),/^function\s*([\w$]+)/);if(e){return e[1]}return null}function Jr(r,e){if(r.indexOf){return r.indexOf(e)}for(var t=0,n=r.length;t<n;t++){if(r[t]===e){return t}}return-1}function Vr(r){if(!L||!r||typeof r!=="object"){return false}try{L.call(r);try{K.call(r)}catch(r){return true}return r instanceof Map}catch(r){}return false}function Hr(r){if(!rr||!r||typeof r!=="object"){return false}try{rr.call(r,rr);try{tr.call(r,tr)}catch(r){return true}return r instanceof WeakMap}catch(r){}return false}function Lr(r){if(!or||!r||typeof r!=="object"){return false}try{or.call(r);return true}catch(r){}return false}function zr(r){if(!K||!r||typeof r!=="object"){return false}try{K.call(r);try{L.call(r)}catch(r){return true}return r instanceof Set}catch(r){}return false}function Qr(r){if(!tr||!r||typeof r!=="object"){return false}try{tr.call(r,tr);try{rr.call(r,rr)}catch(r){return true}return r instanceof WeakSet}catch(r){}return false}function Yr(r){if(!r||typeof r!=="object"){return false}if(typeof HTMLElement!=="undefined"&&r instanceof HTMLElement){return true}return typeof r.nodeName==="string"&&typeof r.getAttribute==="function"}function Kr(r,e){if(r.length>e.maxStringLength){var t=r.length-e.maxStringLength;var n="... "+t+" more character"+(t>1?"s":"");return Kr(cr.call(r,0,e.maxStringLength),e)+n}var o=yr.call(yr.call(r,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,Xr);return Rr(o,"single",e)}function Xr(r){var e=r.charCodeAt(0);var t={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];if(t){return"\\"+t}return"\\x"+(e<16?"0":"")+pr.call(e.toString(16))}function Zr(r){return"Object("+r+")"}function re(r){return r+" { ? }"}function ee(r,e,t,n){var o=n?oe(t,n):dr.call(t,", ");return r+" ("+e+") {"+o+"}"}function te(r){for(var e=0;e<r.length;e++){if(Jr(r[e],"\n")>=0){return false}}return true}function ne(r,e){var t;if(r.indent==="\t"){t="\t"}else if(typeof r.indent==="number"&&r.indent>0){t=dr.call(Array(r.indent+1)," ")}else{return null}return{base:t,prev:dr.call(Array(e+1),t)}}function oe(r,e){if(r.length===0){return""}var t="\n"+e.prev+e.base;return t+dr.call(r,","+t)+"\n"+e.prev}function ie(r,e){var t=Mr(r);var n=[];if(t){n.length=r.length;for(var o=0;o<r.length;o++){n[o]=qr(r,o)?e(r[o],r):""}}var i=typeof gr==="function"?gr(r):[];var a;if(jr){a={};for(var f=0;f<i.length;f++){a["$"+i[f]]=i[f]}}for(var u in r){if(!qr(r,u)){continue}if(t&&String(Number(u))===u&&u<r.length){continue}if(jr&&a["$"+u]instanceof Symbol){continue}else if(lr.call(/[^\w$]/,u)){n.push(e(u,r)+": "+e(r[u],r))}else{n.push(u+": "+e(r[u],r))}}if(typeof gr==="function"){for(var c=0;c<i.length;c++){if(wr.call(r,i[c])){n.push("["+e(i[c])+"]: "+e(r[i[c]],r))}}}return n}var ae=D("%TypeError%");var fe=D("%WeakMap%",true);var ue=D("%Map%",true);var ce=q("WeakMap.prototype.get",true);var ye=q("WeakMap.prototype.set",true);var pe=q("WeakMap.prototype.has",true);var se=q("Map.prototype.get",true);var le=q("Map.prototype.set",true);var ve=q("Map.prototype.has",true);var de=function(r,e){for(var t=r,n;(n=t.next)!==null;t=n){if(n.key===e){t.next=n.next;n.next=r.next;r.next=n;return n}}};var be=function(r,e){var t=de(r,e);return t&&t.value};var he=function(r,e,t){var n=de(r,e);if(n){n.value=t}else{r.next={key:e,next:r.next,value:t}}};var me=function(r,e){return!!de(r,e)};var ge=function r(){var e;var t;var n;var o={assert:function(r){if(!o.has(r)){throw new ae("Side channel does not contain "+Fr(r))}},get:function(r){if(fe&&r&&(typeof r==="object"||typeof r==="function")){if(e){return ce(e,r)}}else if(ue){if(t){return se(t,r)}}else{if(n){return be(n,r)}}},has:function(r){if(fe&&r&&(typeof r==="object"||typeof r==="function")){if(e){return pe(e,r)}}else if(ue){if(t){return ve(t,r)}}else{if(n){return me(n,r)}}return false},set:function(r,o){if(fe&&r&&(typeof r==="object"||typeof r==="function")){if(!e){e=new fe}ye(e,r,o)}else if(ue){if(!t){t=new ue}le(t,r,o)}else{if(!n){n={key:{},next:null}}he(n,r,o)}}};return o};var Se=String.prototype.replace;var je=/%20/g;var Ae={RFC1738:"RFC1738",RFC3986:"RFC3986"};var we={default:Ae.RFC3986,formatters:{RFC1738:function(r){return Se.call(r,je,"+")},RFC3986:function(r){return String(r)}},RFC1738:Ae.RFC1738,RFC3986:Ae.RFC3986};var Oe=Object.prototype.hasOwnProperty;var Pe=Array.isArray;var Ee=function(){var r=[];for(var e=0;e<256;++e){r.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase())}return r}();var Ie=function r(e){while(e.length>1){var t=e.pop();var n=t.obj[t.prop];if(Pe(n)){var o=[];for(var i=0;i<n.length;++i){if(typeof n[i]!=="undefined"){o.push(n[i])}}t.obj[t.prop]=o}}};var Fe=function r(e,t){var n=t&&t.plainObjects?Object.create(null):{};for(var o=0;o<e.length;++o){if(typeof e[o]!=="undefined"){n[o]=e[o]}}return n};var Re=function r(e,t,n){if(!t){return e}if(typeof t!=="object"){if(Pe(e)){e.push(t)}else if(e&&typeof e==="object"){if(n&&(n.plainObjects||n.allowPrototypes)||!Oe.call(Object.prototype,t)){e[t]=true}}else{return[e,t]}return e}if(!e||typeof e!=="object"){return[e].concat(t)}var o=e;if(Pe(e)&&!Pe(t)){o=Fe(e,n)}if(Pe(e)&&Pe(t)){t.forEach((function(t,o){if(Oe.call(e,o)){var i=e[o];if(i&&typeof i==="object"&&t&&typeof t==="object"){e[o]=r(i,t,n)}else{e.push(t)}}else{e[o]=t}}));return e}return Object.keys(t).reduce((function(e,o){var i=t[o];if(Oe.call(e,o)){e[o]=r(e[o],i,n)}else{e[o]=i}return e}),o)};var ke=function r(e,t){return Object.keys(t).reduce((function(r,e){r[e]=t[e];return r}),e)};var Me=function(r,e,t){var n=r.replace(/\+/g," ");if(t==="iso-8859-1"){return n.replace(/%[0-9a-f]{2}/gi,unescape)}try{return decodeURIComponent(n)}catch(r){return n}};var xe=function r(e,t,n,o,i){if(e.length===0){return e}var a=e;if(typeof e==="symbol"){a=Symbol.prototype.toString.call(e)}else if(typeof e!=="string"){a=String(e)}if(n==="iso-8859-1"){return escape(a).replace(/%u[0-9a-f]{4}/gi,(function(r){return"%26%23"+parseInt(r.slice(2),16)+"%3B"}))}var f="";for(var u=0;u<a.length;++u){var c=a.charCodeAt(u);if(c===45||c===46||c===95||c===126||c>=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122||i===we.RFC1738&&(c===40||c===41)){f+=a.charAt(u);continue}if(c<128){f=f+Ee[c];continue}if(c<2048){f=f+(Ee[192|c>>6]+Ee[128|c&63]);continue}if(c<55296||c>=57344){f=f+(Ee[224|c>>12]+Ee[128|c>>6&63]+Ee[128|c&63]);continue}u+=1;c=65536+((c&1023)<<10|a.charCodeAt(u)&1023);f+=Ee[240|c>>18]+Ee[128|c>>12&63]+Ee[128|c>>6&63]+Ee[128|c&63]}return f};var Ue=function r(e){var t=[{obj:{o:e},prop:"o"}];var n=[];for(var o=0;o<t.length;++o){var i=t[o];var a=i.obj[i.prop];var f=Object.keys(a);for(var u=0;u<f.length;++u){var c=f[u];var y=a[c];if(typeof y==="object"&&y!==null&&n.indexOf(y)===-1){t.push({obj:a,prop:c});n.push(y)}}}Ie(t);return e};var Ne=function r(e){return Object.prototype.toString.call(e)==="[object RegExp]"};var Be=function r(e){if(!e||typeof e!=="object"){return false}return!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))};var We=function r(e,t){return[].concat(e,t)};var Te=function r(e,t){if(Pe(e)){var n=[];for(var o=0;o<e.length;o+=1){n.push(t(e[o]))}return n}return t(e)};var De={arrayToObject:Fe,assign:ke,combine:We,compact:Ue,decode:Me,encode:xe,isBuffer:Be,isRegExp:Ne,maybeMap:Te,merge:Re};var Ce=Object.prototype.hasOwnProperty;var _e={brackets:function r(e){return e+"[]"},comma:"comma",indices:function r(e,t){return e+"["+t+"]"},repeat:function r(e){return e}};var qe=Array.isArray;var Ge=String.prototype.split;var $e=Array.prototype.push;var Je=function(r,e){$e.apply(r,qe(e)?e:[e])};var Ve=Date.prototype.toISOString;var He=we["default"];var Le={addQueryPrefix:false,allowDots:false,charset:"utf-8",charsetSentinel:false,delimiter:"&",encode:true,encoder:De.encode,encodeValuesOnly:false,format:He,formatter:we.formatters[He],indices:false,serializeDate:function r(e){return Ve.call(e)},skipNulls:false,strictNullHandling:false};var ze=function r(e){return typeof e==="string"||typeof e==="number"||typeof e==="boolean"||typeof e==="symbol"||typeof e==="bigint"};var Qe={};var Ye=function r(e,t,n,o,i,a,f,u,c,y,p,s,l,v,d,b){var h=e;var m=b;var g=0;var S=false;while((m=m.get(Qe))!==void undefined&&!S){var j=m.get(e);g+=1;if(typeof j!=="undefined"){if(j===g){throw new RangeError("Cyclic object value")}else{S=true}}if(typeof m.get(Qe)==="undefined"){g=0}}if(typeof u==="function"){h=u(t,h)}else if(h instanceof Date){h=p(h)}else if(n==="comma"&&qe(h)){h=De.maybeMap(h,(function(r){if(r instanceof Date){return p(r)}return r}))}if(h===null){if(i){return f&&!v?f(t,Le.encoder,d,"key",s):t}h=""}if(ze(h)||De.isBuffer(h)){if(f){var A=v?t:f(t,Le.encoder,d,"key",s);if(n==="comma"&&v){var w=Ge.call(String(h),",");var O="";for(var P=0;P<w.length;++P){O+=(P===0?"":",")+l(f(w[P],Le.encoder,d,"value",s))}return[l(A)+(o&&qe(h)&&w.length===1?"[]":"")+"="+O]}return[l(A)+"="+l(f(h,Le.encoder,d,"value",s))]}return[l(t)+"="+l(String(h))]}var E=[];if(typeof h==="undefined"){return E}var I;if(n==="comma"&&qe(h)){I=[{value:h.length>0?h.join(",")||null:void undefined}]}else if(qe(u)){I=u}else{var F=Object.keys(h);I=c?F.sort(c):F}var R=o&&qe(h)&&h.length===1?t+"[]":t;for(var k=0;k<I.length;++k){var M=I[k];var x=typeof M==="object"&&typeof M.value!=="undefined"?M.value:h[M];if(a&&x===null){continue}var U=qe(h)?typeof n==="function"?n(R,M):R:R+(y?"."+M:"["+M+"]");b.set(e,g);var N=ge();N.set(Qe,b);Je(E,r(x,U,n,o,i,a,f,u,c,y,p,s,l,v,d,N))}return E};var Ke=function r(e){if(!e){return Le}if(e.encoder!==null&&typeof e.encoder!=="undefined"&&typeof e.encoder!=="function"){throw new TypeError("Encoder has to be a function.")}var t=e.charset||Le.charset;if(typeof e.charset!=="undefined"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1"){throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined")}var n=we["default"];if(typeof e.format!=="undefined"){if(!Ce.call(we.formatters,e.format)){throw new TypeError("Unknown format option provided.")}n=e.format}var o=we.formatters[n];var i=Le.filter;if(typeof e.filter==="function"||qe(e.filter)){i=e.filter}return{addQueryPrefix:typeof e.addQueryPrefix==="boolean"?e.addQueryPrefix:Le.addQueryPrefix,allowDots:typeof e.allowDots==="undefined"?Le.allowDots:!!e.allowDots,charset:t,charsetSentinel:typeof e.charsetSentinel==="boolean"?e.charsetSentinel:Le.charsetSentinel,delimiter:typeof e.delimiter==="undefined"?Le.delimiter:e.delimiter,encode:typeof e.encode==="boolean"?e.encode:Le.encode,encoder:typeof e.encoder==="function"?e.encoder:Le.encoder,encodeValuesOnly:typeof e.encodeValuesOnly==="boolean"?e.encodeValuesOnly:Le.encodeValuesOnly,filter:i,format:n,formatter:o,serializeDate:typeof e.serializeDate==="function"?e.serializeDate:Le.serializeDate,skipNulls:typeof e.skipNulls==="boolean"?e.skipNulls:Le.skipNulls,sort:typeof e.sort==="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling==="boolean"?e.strictNullHandling:Le.strictNullHandling}};var Xe=function(r,e){var t=r;var n=Ke(e);var o;var i;if(typeof n.filter==="function"){i=n.filter;t=i("",t)}else if(qe(n.filter)){i=n.filter;o=i}var a=[];if(typeof t!=="object"||t===null){return""}var f;if(e&&e.arrayFormat in _e){f=e.arrayFormat}else if(e&&"indices"in e){f=e.indices?"indices":"repeat"}else{f="indices"}var u=_e[f];if(e&&"commaRoundTrip"in e&&typeof e.commaRoundTrip!=="boolean"){throw new TypeError("`commaRoundTrip` must be a boolean, or absent")}var c=u==="comma"&&e&&e.commaRoundTrip;if(!o){o=Object.keys(t)}if(n.sort){o.sort(n.sort)}var y=ge();for(var p=0;p<o.length;++p){var s=o[p];if(n.skipNulls&&t[s]===null){continue}Je(a,Ye(t[s],s,u,c,n.strictNullHandling,n.skipNulls,n.encode?n.encoder:null,n.filter,n.sort,n.allowDots,n.serializeDate,n.format,n.formatter,n.encodeValuesOnly,n.charset,y))}var l=a.join(n.delimiter);var v=n.addQueryPrefix===true?"?":"";if(n.charsetSentinel){if(n.charset==="iso-8859-1"){v+="utf8=%26%2310003%3B&"}else{v+="utf8=%E2%9C%93&"}}return l.length>0?v+l:""};var Ze=Object.prototype.hasOwnProperty;var rt=Array.isArray;var et={allowDots:false,allowPrototypes:false,allowSparse:false,arrayLimit:20,charset:"utf-8",charsetSentinel:false,comma:false,decoder:De.decode,delimiter:"&",depth:5,ignoreQueryPrefix:false,interpretNumericEntities:false,parameterLimit:1e3,parseArrays:true,plainObjects:false,strictNullHandling:false};var tt=function(r){return r.replace(/&#(\d+);/g,(function(r,e){return String.fromCharCode(parseInt(e,10))}))};var nt=function(r,e){if(r&&typeof r==="string"&&e.comma&&r.indexOf(",")>-1){return r.split(",")}return r};var ot="utf8=%26%2310003%3B";var it="utf8=%E2%9C%93";var at=function r(e,t){var n={};var o=t.ignoreQueryPrefix?e.replace(/^\?/,""):e;var i=t.parameterLimit===Infinity?undefined:t.parameterLimit;var a=o.split(t.delimiter,i);var f=-1;var u;var c=t.charset;if(t.charsetSentinel){for(u=0;u<a.length;++u){if(a[u].indexOf("utf8=")===0){if(a[u]===it){c="utf-8"}else if(a[u]===ot){c="iso-8859-1"}f=u;u=a.length}}}for(u=0;u<a.length;++u){if(u===f){continue}var y=a[u];var p=y.indexOf("]=");var s=p===-1?y.indexOf("="):p+1;var l,v;if(s===-1){l=t.decoder(y,et.decoder,c,"key");v=t.strictNullHandling?null:""}else{l=t.decoder(y.slice(0,s),et.decoder,c,"key");v=De.maybeMap(nt(y.slice(s+1),t),(function(r){return t.decoder(r,et.decoder,c,"value")}))}if(v&&t.interpretNumericEntities&&c==="iso-8859-1"){v=tt(v)}if(y.indexOf("[]=")>-1){v=rt(v)?[v]:v}if(Ze.call(n,l)){n[l]=De.combine(n[l],v)}else{n[l]=v}}return n};var ft=function(r,e,t,n){var o=n?e:nt(e,t);for(var i=r.length-1;i>=0;--i){var a;var f=r[i];if(f==="[]"&&t.parseArrays){a=[].concat(o)}else{a=t.plainObjects?Object.create(null):{};var u=f.charAt(0)==="["&&f.charAt(f.length-1)==="]"?f.slice(1,-1):f;var c=parseInt(u,10);if(!t.parseArrays&&u===""){a={0:o}}else if(!isNaN(c)&&f!==u&&String(c)===u&&c>=0&&(t.parseArrays&&c<=t.arrayLimit)){a=[];a[c]=o}else if(u!=="__proto__"){a[u]=o}}o=a}return o};var ut=function r(e,t,n,o){if(!e){return}var i=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e;var a=/(\[[^[\]]*])/;var f=/(\[[^[\]]*])/g;var u=n.depth>0&&a.exec(i);var c=u?i.slice(0,u.index):i;var y=[];if(c){if(!n.plainObjects&&Ze.call(Object.prototype,c)){if(!n.allowPrototypes){return}}y.push(c)}var p=0;while(n.depth>0&&(u=f.exec(i))!==null&&p<n.depth){p+=1;if(!n.plainObjects&&Ze.call(Object.prototype,u[1].slice(1,-1))){if(!n.allowPrototypes){return}}y.push(u[1])}if(u){y.push("["+i.slice(u.index)+"]")}return ft(y,t,n,o)};var ct=function r(e){if(!e){return et}if(e.decoder!==null&&e.decoder!==undefined&&typeof e.decoder!=="function"){throw new TypeError("Decoder has to be a function.")}if(typeof e.charset!=="undefined"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1"){throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined")}var t=typeof e.charset==="undefined"?et.charset:e.charset;return{allowDots:typeof e.allowDots==="undefined"?et.allowDots:!!e.allowDots,allowPrototypes:typeof e.allowPrototypes==="boolean"?e.allowPrototypes:et.allowPrototypes,allowSparse:typeof e.allowSparse==="boolean"?e.allowSparse:et.allowSparse,arrayLimit:typeof e.arrayLimit==="number"?e.arrayLimit:et.arrayLimit,charset:t,charsetSentinel:typeof e.charsetSentinel==="boolean"?e.charsetSentinel:et.charsetSentinel,comma:typeof e.comma==="boolean"?e.comma:et.comma,decoder:typeof e.decoder==="function"?e.decoder:et.decoder,delimiter:typeof e.delimiter==="string"||De.isRegExp(e.delimiter)?e.delimiter:et.delimiter,depth:typeof e.depth==="number"||e.depth===false?+e.depth:et.depth,ignoreQueryPrefix:e.ignoreQueryPrefix===true,interpretNumericEntities:typeof e.interpretNumericEntities==="boolean"?e.interpretNumericEntities:et.interpretNumericEntities,parameterLimit:typeof e.parameterLimit==="number"?e.parameterLimit:et.parameterLimit,parseArrays:e.parseArrays!==false,plainObjects:typeof e.plainObjects==="boolean"?e.plainObjects:et.plainObjects,strictNullHandling:typeof e.strictNullHandling==="boolean"?e.strictNullHandling:et.strictNullHandling}};var yt=function(r,e){var t=ct(e);if(r===""||r===null||typeof r==="undefined"){return t.plainObjects?Object.create(null):{}}var n=typeof r==="string"?at(r,t):r;var o=t.plainObjects?Object.create(null):{};var i=Object.keys(n);for(var a=0;a<i.length;++a){var f=i[a];var u=ut(f,n[f],t,typeof r==="string");o=De.merge(o,u,t)}if(t.allowSparse===true){return o}return De.compact(o)};var pt={formats:we,parse:yt,stringify:Xe};const st="nano-component-store:";const lt=(r="hash",e=window)=>{if(!e||!e.location)return{};if(r==="hash"&&e.location.hash)return pt.parse(e.location.hash.replace(/^\#/,""),{strictNullHandling:true});else if(r==="query"&&e.location.search)return pt.parse(e.location.search,{ignoreQueryPrefix:true});return{}};const vt=(r,e="hash",t=window,n="replace")=>{if(!t||!t.history)return;const o=e==="query"?t.location.search:t.location.hash;const i=e==="query"?t.location.pathname:t.location.pathname+t.location.search;let a=pt.stringify(r,{strictNullHandling:true,addQueryPrefix:false,encodeValuesOnly:true});if(!a||!a.length){if(!o||!o.length)return;if(n==="replace")t.history.replaceState(null,null,i);else t.history.pushState(null,null,i);return}if(e==="hash"&&t.location.hash==="#"+a){try{document.querySelector("#"+a).focus()}catch(r){}return}a=(e==="hash"?"#":"?")+a;if(a===o)return;if(n==="replace")t.history.replaceState(null,null,i+a);else t.history.pushState(null,null,i+a)};const dt=(r,e,t="hash",n=window,o="replace")=>{r=Object.keys(pt.parse(r))[0];const i={};i[r]=e;let a=lt(t,n);a=Object.assign(Object.assign({},a),i);vt(a,t,n,o)};const bt=(r,e="hash",t=window)=>{r=Object.keys(pt.parse(r))[0];const n=lt(e,t);return n[r]||null};const ht=(r,e,t=window)=>{try{if(!e){t.sessionStorage.removeItem(st+r);return}t.sessionStorage.setItem(st+r,JSON.stringify(e))}catch(r){throw r}};const mt=(r,e=window)=>{try{const t=e.sessionStorage.getItem(st+r);return t!==null?JSON.parse(t):null}catch(r){throw r}};const gt=(r,e,t=window)=>{try{if(!e){t.localStorage.removeItem(st+r);return}t.localStorage.setItem(st+r,JSON.stringify(e))}catch(r){throw r}};const St=(r,e=window)=>{try{const t=e.localStorage.getItem(st+r);return t!==null?JSON.parse(t):null}catch(r){throw r}};const jt=new Map;const At={init(e,t,n,o){const i=o||e.storeId||r(e).id;if(!i){console.error("No id set. You can only instantiate a new component store with an id. ");return}if(jt.get(i)){console.error("Duplicate store id usage. A store ID must be unique!",i);return}const a=t.reduce(((r,t)=>{if(typeof e[t]!==undefined)r[t]=e[t];return r}),{});jt.set(i,new wt(i,e,t,a,n));const f=jt.get(i);f.dispatchToProps();const u=e.connectedCallback;e.connectedCallback=function(){jt.set(i,new wt(i,e,t,a,n));const r=jt.get(i);if(u){u.call(e)}if(r)r.dispatchToProps()};const c=e.componentDidRender;e.componentDidRender=function(){const r=jt.get(i);if(c){c.call(e)}if(r)r.savePropsToStore()};const y=e.disconnectedCallback;e.disconnectedCallback=function(){const r=jt.get(i);if(r)r.delete();jt.delete(i);if(y){y.call(e)}}}};class wt{constructor(r,t,n,o,i){this.method="session";this.initialState={};this.updateStore=true;this.onUrlChange=()=>{this.dispatchToProps(false)};this.savePropsToStore=()=>{if(this.updateStore){this.save(this.getData)}else if(!this.updateStore)this.updateStore=true};this.dispatchToProps=(r=true)=>{const e=this.retrieve();if(!e&&r)return;this.updateStore=r;this.keys.forEach((r=>{this.component[r]=e?e[r]:undefined}))};this.delete=()=>{if(this.method==="url-hash-push"||this.method==="url-query-push"){window.removeEventListener("popstate",this.onUrlChange)}};if(!r)throw new Error("No id set. You can only instantiate a new component store with an id");this.id=r;this.keys=n;this.component=t;if(o)this.initialState=o;if(i)this.method=i;this.savePropsToStore=e(this.savePropsToStore,500);if(this.method==="url-hash-push"||this.method==="url-query-push"){window.addEventListener("popstate",this.onUrlChange)}}equality(r,e){if(typeof r!==typeof e)return false;if(typeof r!=="object")return r===e;return JSON.stringify(r)===JSON.stringify(e)}get getData(){const r=this.keys.reduce(((r,e)=>{const t=this.equality(this.component[e],this.initialState[e]);if(typeof this.component[e]!=="undefined"&&!t){r[e]=this.component[e]}else if(t)delete r[e];return r}),{});return Object.keys(r).length?r:undefined}retrieve(){switch(this.method){case"url-hash":case"url-hash-push":return bt(this.id,"hash");case"url-query":case"url-query-push":return bt(this.id,"query");case"local":return St(this.id);default:return mt(this.id)}}save(r){switch(this.method){case"url-hash":return dt(this.id,r,"hash");case"url-query":return dt(this.id,r,"query");case"url-hash-push":return dt(this.id,r,"hash",window,"push");case"url-query-push":return dt(this.id,r,"query",window,"push");case"local":return gt(this.id,r);default:return ht(this.id,r)}}}export{At as C};
|
5
|
-
//# sourceMappingURL=p-
|
4
|
+
import{g as r}from"./p-f6a8467a.js";import{d as e}from"./p-7bff5224.js";import{c as t,g as n}from"./p-69a3e911.js";var o=function r(){if(typeof Symbol!=="function"||typeof Object.getOwnPropertySymbols!=="function"){return false}if(typeof Symbol.iterator==="symbol"){return true}var e={};var t=Symbol("test");var n=Object(t);if(typeof t==="string"){return false}if(Object.prototype.toString.call(t)!=="[object Symbol]"){return false}if(Object.prototype.toString.call(n)!=="[object Symbol]"){return false}var o=42;e[t]=o;for(t in e){return false}if(typeof Object.keys==="function"&&Object.keys(e).length!==0){return false}if(typeof Object.getOwnPropertyNames==="function"&&Object.getOwnPropertyNames(e).length!==0){return false}var i=Object.getOwnPropertySymbols(e);if(i.length!==1||i[0]!==t){return false}if(!Object.prototype.propertyIsEnumerable.call(e,t)){return false}if(typeof Object.getOwnPropertyDescriptor==="function"){var a=Object.getOwnPropertyDescriptor(e,t);if(a.value!==o||a.enumerable!==true){return false}}return true};var i=typeof Symbol!=="undefined"&&Symbol;var a=function r(){if(typeof i!=="function"){return false}if(typeof Symbol!=="function"){return false}if(typeof i("foo")!=="symbol"){return false}if(typeof Symbol("bar")!=="symbol"){return false}return o()};var f="Function.prototype.bind called on incompatible ";var u=Array.prototype.slice;var c=Object.prototype.toString;var y="[object Function]";var p=function r(e){var t=this;if(typeof t!=="function"||c.call(t)!==y){throw new TypeError(f+t)}var n=u.call(arguments,1);var o;var i=function(){if(this instanceof o){var r=t.apply(this,n.concat(u.call(arguments)));if(Object(r)===r){return r}return this}else{return t.apply(e,n.concat(u.call(arguments)))}};var a=Math.max(0,t.length-n.length);var p=[];for(var s=0;s<a;s++){p.push("$"+s)}o=Function("binder","return function ("+p.join(",")+"){ return binder.apply(this,arguments); }")(i);if(t.prototype){var l=function r(){};l.prototype=t.prototype;o.prototype=new l;l.prototype=null}return o};var s=Function.prototype.bind||p;var l=s.call(Function.call,Object.prototype.hasOwnProperty);var v;var d=SyntaxError;var b=Function;var h=TypeError;var m=function(r){try{return b('"use strict"; return ('+r+").constructor;")()}catch(r){}};var g=Object.getOwnPropertyDescriptor;var S=function(){throw new h};var j=g?function(){try{return S}catch(r){try{return g(arguments,"callee").get}catch(r){return S}}}():S;var A=a();var w=Object.getPrototypeOf||function(r){return r.__proto__};var O={};var P=typeof Uint8Array==="undefined"?v:w(Uint8Array);var E={"%AggregateError%":typeof AggregateError==="undefined"?v:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer==="undefined"?v:ArrayBuffer,"%ArrayIteratorPrototype%":A?w([][Symbol.iterator]()):v,"%AsyncFromSyncIteratorPrototype%":v,"%AsyncFunction%":O,"%AsyncGenerator%":O,"%AsyncGeneratorFunction%":O,"%AsyncIteratorPrototype%":O,"%Atomics%":typeof Atomics==="undefined"?v:Atomics,"%BigInt%":typeof BigInt==="undefined"?v:BigInt,"%BigInt64Array%":typeof BigInt64Array==="undefined"?v:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array==="undefined"?v:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView==="undefined"?v:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array==="undefined"?v:Float32Array,"%Float64Array%":typeof Float64Array==="undefined"?v:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry==="undefined"?v:FinalizationRegistry,"%Function%":b,"%GeneratorFunction%":O,"%Int8Array%":typeof Int8Array==="undefined"?v:Int8Array,"%Int16Array%":typeof Int16Array==="undefined"?v:Int16Array,"%Int32Array%":typeof Int32Array==="undefined"?v:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":A?w(w([][Symbol.iterator]())):v,"%JSON%":typeof JSON==="object"?JSON:v,"%Map%":typeof Map==="undefined"?v:Map,"%MapIteratorPrototype%":typeof Map==="undefined"||!A?v:w((new Map)[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise==="undefined"?v:Promise,"%Proxy%":typeof Proxy==="undefined"?v:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect==="undefined"?v:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set==="undefined"?v:Set,"%SetIteratorPrototype%":typeof Set==="undefined"||!A?v:w((new Set)[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer==="undefined"?v:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":A?w(""[Symbol.iterator]()):v,"%Symbol%":A?Symbol:v,"%SyntaxError%":d,"%ThrowTypeError%":j,"%TypedArray%":P,"%TypeError%":h,"%Uint8Array%":typeof Uint8Array==="undefined"?v:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray==="undefined"?v:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array==="undefined"?v:Uint16Array,"%Uint32Array%":typeof Uint32Array==="undefined"?v:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap==="undefined"?v:WeakMap,"%WeakRef%":typeof WeakRef==="undefined"?v:WeakRef,"%WeakSet%":typeof WeakSet==="undefined"?v:WeakSet};var I=function r(e){var t;if(e==="%AsyncFunction%"){t=m("async function () {}")}else if(e==="%GeneratorFunction%"){t=m("function* () {}")}else if(e==="%AsyncGeneratorFunction%"){t=m("async function* () {}")}else if(e==="%AsyncGenerator%"){var n=r("%AsyncGeneratorFunction%");if(n){t=n.prototype}}else if(e==="%AsyncIteratorPrototype%"){var o=r("%AsyncGenerator%");if(o){t=w(o.prototype)}}E[e]=t;return t};var F={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]};var R=s.call(Function.call,Array.prototype.concat);var k=s.call(Function.apply,Array.prototype.splice);var M=s.call(Function.call,String.prototype.replace);var x=s.call(Function.call,String.prototype.slice);var U=s.call(Function.call,RegExp.prototype.exec);var N=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;var B=/\\(\\)?/g;var W=function r(e){var t=x(e,0,1);var n=x(e,-1);if(t==="%"&&n!=="%"){throw new d("invalid intrinsic syntax, expected closing `%`")}else if(n==="%"&&t!=="%"){throw new d("invalid intrinsic syntax, expected opening `%`")}var o=[];M(e,N,(function(r,e,t,n){o[o.length]=t?M(n,B,"$1"):e||r}));return o};var T=function r(e,t){var n=e;var o;if(l(F,n)){o=F[n];n="%"+o[0]+"%"}if(l(E,n)){var i=E[n];if(i===O){i=I(n)}if(typeof i==="undefined"&&!t){throw new h("intrinsic "+e+" exists, but is not available. Please file an issue!")}return{alias:o,name:n,value:i}}throw new d("intrinsic "+e+" does not exist!")};var D=function r(e,t){if(typeof e!=="string"||e.length===0){throw new h("intrinsic name must be a non-empty string")}if(arguments.length>1&&typeof t!=="boolean"){throw new h('"allowMissing" argument must be a boolean')}if(U(/^%?[^%]*%?$/,e)===null){throw new d("`%` may not be present anywhere but at the beginning and end of the intrinsic name")}var n=W(e);var o=n.length>0?n[0]:"";var i=T("%"+o+"%",t);var a=i.name;var f=i.value;var u=false;var c=i.alias;if(c){o=c[0];k(n,R([0,1],c))}for(var y=1,p=true;y<n.length;y+=1){var s=n[y];var b=x(s,0,1);var m=x(s,-1);if((b==='"'||b==="'"||b==="`"||(m==='"'||m==="'"||m==="`"))&&b!==m){throw new d("property names with quotes must have matching quotes")}if(s==="constructor"||!p){u=true}o+="."+s;a="%"+o+"%";if(l(E,a)){f=E[a]}else if(f!=null){if(!(s in f)){if(!t){throw new h("base intrinsic for "+e+" exists, but the property is not available.")}return void v}if(g&&y+1>=n.length){var S=g(f,s);p=!!S;if(p&&"get"in S&&!("originalValue"in S.get)){f=S.get}else{f=f[s]}}else{p=l(f,s);f=f[s]}if(p&&!u){E[a]=f}}}return f};var C=t((function(r){var e=D("%Function.prototype.apply%");var t=D("%Function.prototype.call%");var n=D("%Reflect.apply%",true)||s.call(t,e);var o=D("%Object.getOwnPropertyDescriptor%",true);var i=D("%Object.defineProperty%",true);var a=D("%Math.max%");if(i){try{i({},"a",{value:1})}catch(r){i=null}}r.exports=function r(e){var f=n(s,t,arguments);if(o&&i){var u=o(f,"length");if(u.configurable){i(f,"length",{value:1+a(0,e.length-(arguments.length-1))})}}return f};var f=function r(){return n(s,e,arguments)};if(i){i(r.exports,"apply",{value:f})}else{r.exports.apply=f}}));var _=C(D("String.prototype.indexOf"));var q=function r(e,t){var n=D(e,!!t);if(typeof n==="function"&&_(e,".prototype.")>-1){return C(n)}return n};const G={};const $=Object.freeze({__proto__:null,default:G});const J=n($);var V=typeof Map==="function"&&Map.prototype;var H=Object.getOwnPropertyDescriptor&&V?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null;var L=V&&H&&typeof H.get==="function"?H.get:null;var z=V&&Map.prototype.forEach;var Q=typeof Set==="function"&&Set.prototype;var Y=Object.getOwnPropertyDescriptor&&Q?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null;var K=Q&&Y&&typeof Y.get==="function"?Y.get:null;var X=Q&&Set.prototype.forEach;var Z=typeof WeakMap==="function"&&WeakMap.prototype;var rr=Z?WeakMap.prototype.has:null;var er=typeof WeakSet==="function"&&WeakSet.prototype;var tr=er?WeakSet.prototype.has:null;var nr=typeof WeakRef==="function"&&WeakRef.prototype;var or=nr?WeakRef.prototype.deref:null;var ir=Boolean.prototype.valueOf;var ar=Object.prototype.toString;var fr=Function.prototype.toString;var ur=String.prototype.match;var cr=String.prototype.slice;var yr=String.prototype.replace;var pr=String.prototype.toUpperCase;var sr=String.prototype.toLowerCase;var lr=RegExp.prototype.test;var vr=Array.prototype.concat;var dr=Array.prototype.join;var br=Array.prototype.slice;var hr=Math.floor;var mr=typeof BigInt==="function"?BigInt.prototype.valueOf:null;var gr=Object.getOwnPropertySymbols;var Sr=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?Symbol.prototype.toString:null;var jr=typeof Symbol==="function"&&typeof Symbol.iterator==="object";var Ar=typeof Symbol==="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===jr?"object":"symbol")?Symbol.toStringTag:null;var wr=Object.prototype.propertyIsEnumerable;var Or=(typeof Reflect==="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(r){return r.__proto__}:null);function Pr(r,e){if(r===Infinity||r===-Infinity||r!==r||r&&r>-1e3&&r<1e3||lr.call(/e/,e)){return e}var t=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof r==="number"){var n=r<0?-hr(-r):hr(r);if(n!==r){var o=String(n);var i=cr.call(e,o.length+1);return yr.call(o,t,"$&_")+"."+yr.call(yr.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return yr.call(e,t,"$&_")}var Er=J.custom;var Ir=Dr(Er)?Er:null;var Fr=function r(e,t,n,o){var i=t||{};if(qr(i,"quoteStyle")&&(i.quoteStyle!=="single"&&i.quoteStyle!=="double")){throw new TypeError('option "quoteStyle" must be "single" or "double"')}if(qr(i,"maxStringLength")&&(typeof i.maxStringLength==="number"?i.maxStringLength<0&&i.maxStringLength!==Infinity:i.maxStringLength!==null)){throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`')}var a=qr(i,"customInspect")?i.customInspect:true;if(typeof a!=="boolean"&&a!=="symbol"){throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`")}if(qr(i,"indent")&&i.indent!==null&&i.indent!=="\t"&&!(parseInt(i.indent,10)===i.indent&&i.indent>0)){throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`')}if(qr(i,"numericSeparator")&&typeof i.numericSeparator!=="boolean"){throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`')}var f=i.numericSeparator;if(typeof e==="undefined"){return"undefined"}if(e===null){return"null"}if(typeof e==="boolean"){return e?"true":"false"}if(typeof e==="string"){return Kr(e,i)}if(typeof e==="number"){if(e===0){return Infinity/e>0?"0":"-0"}var u=String(e);return f?Pr(e,u):u}if(typeof e==="bigint"){var c=String(e)+"n";return f?Pr(e,c):c}var y=typeof i.depth==="undefined"?5:i.depth;if(typeof n==="undefined"){n=0}if(n>=y&&y>0&&typeof e==="object"){return Mr(e)?"[Array]":"[Object]"}var p=ne(i,n);if(typeof o==="undefined"){o=[]}else if(Jr(o,e)>=0){return"[Circular]"}function s(e,t,a){if(t){o=br.call(o);o.push(t)}if(a){var f={depth:i.depth};if(qr(i,"quoteStyle")){f.quoteStyle=i.quoteStyle}return r(e,f,n+1,o)}return r(e,i,n+1,o)}if(typeof e==="function"&&!Ur(e)){var l=$r(e);var v=ie(e,s);return"[Function"+(l?": "+l:" (anonymous)")+"]"+(v.length>0?" { "+dr.call(v,", ")+" }":"")}if(Dr(e)){var d=jr?yr.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):Sr.call(e);return typeof e==="object"&&!jr?Zr(d):d}if(Yr(e)){var b="<"+sr.call(String(e.nodeName));var h=e.attributes||[];for(var m=0;m<h.length;m++){b+=" "+h[m].name+"="+Rr(kr(h[m].value),"double",i)}b+=">";if(e.childNodes&&e.childNodes.length){b+="..."}b+="</"+sr.call(String(e.nodeName))+">";return b}if(Mr(e)){if(e.length===0){return"[]"}var g=ie(e,s);if(p&&!te(g)){return"["+oe(g,p)+"]"}return"[ "+dr.call(g,", ")+" ]"}if(Nr(e)){var S=ie(e,s);if(!("cause"in Error.prototype)&&"cause"in e&&!wr.call(e,"cause")){return"{ ["+String(e)+"] "+dr.call(vr.call("[cause]: "+s(e.cause),S),", ")+" }"}if(S.length===0){return"["+String(e)+"]"}return"{ ["+String(e)+"] "+dr.call(S,", ")+" }"}if(typeof e==="object"&&a){if(Ir&&typeof e[Ir]==="function"&&J){return J(e,{depth:y-n})}else if(a!=="symbol"&&typeof e.inspect==="function"){return e.inspect()}}if(Vr(e)){var j=[];if(z){z.call(e,(function(r,t){j.push(s(t,e,true)+" => "+s(r,e))}))}return ee("Map",L.call(e),j,p)}if(zr(e)){var A=[];if(X){X.call(e,(function(r){A.push(s(r,e))}))}return ee("Set",K.call(e),A,p)}if(Hr(e)){return re("WeakMap")}if(Qr(e)){return re("WeakSet")}if(Lr(e)){return re("WeakRef")}if(Wr(e)){return Zr(s(Number(e)))}if(Cr(e)){return Zr(s(mr.call(e)))}if(Tr(e)){return Zr(ir.call(e))}if(Br(e)){return Zr(s(String(e)))}if(!xr(e)&&!Ur(e)){var w=ie(e,s);var O=Or?Or(e)===Object.prototype:e instanceof Object||e.constructor===Object;var P=e instanceof Object?"":"null prototype";var E=!O&&Ar&&Object(e)===e&&Ar in e?cr.call(Gr(e),8,-1):P?"Object":"";var I=O||typeof e.constructor!=="function"?"":e.constructor.name?e.constructor.name+" ":"";var F=I+(E||P?"["+dr.call(vr.call([],E||[],P||[]),": ")+"] ":"");if(w.length===0){return F+"{}"}if(p){return F+"{"+oe(w,p)+"}"}return F+"{ "+dr.call(w,", ")+" }"}return String(e)};function Rr(r,e,t){var n=(t.quoteStyle||e)==="double"?'"':"'";return n+r+n}function kr(r){return yr.call(String(r),/"/g,""")}function Mr(r){return Gr(r)==="[object Array]"&&(!Ar||!(typeof r==="object"&&Ar in r))}function xr(r){return Gr(r)==="[object Date]"&&(!Ar||!(typeof r==="object"&&Ar in r))}function Ur(r){return Gr(r)==="[object RegExp]"&&(!Ar||!(typeof r==="object"&&Ar in r))}function Nr(r){return Gr(r)==="[object Error]"&&(!Ar||!(typeof r==="object"&&Ar in r))}function Br(r){return Gr(r)==="[object String]"&&(!Ar||!(typeof r==="object"&&Ar in r))}function Wr(r){return Gr(r)==="[object Number]"&&(!Ar||!(typeof r==="object"&&Ar in r))}function Tr(r){return Gr(r)==="[object Boolean]"&&(!Ar||!(typeof r==="object"&&Ar in r))}function Dr(r){if(jr){return r&&typeof r==="object"&&r instanceof Symbol}if(typeof r==="symbol"){return true}if(!r||typeof r!=="object"||!Sr){return false}try{Sr.call(r);return true}catch(r){}return false}function Cr(r){if(!r||typeof r!=="object"||!mr){return false}try{mr.call(r);return true}catch(r){}return false}var _r=Object.prototype.hasOwnProperty||function(r){return r in this};function qr(r,e){return _r.call(r,e)}function Gr(r){return ar.call(r)}function $r(r){if(r.name){return r.name}var e=ur.call(fr.call(r),/^function\s*([\w$]+)/);if(e){return e[1]}return null}function Jr(r,e){if(r.indexOf){return r.indexOf(e)}for(var t=0,n=r.length;t<n;t++){if(r[t]===e){return t}}return-1}function Vr(r){if(!L||!r||typeof r!=="object"){return false}try{L.call(r);try{K.call(r)}catch(r){return true}return r instanceof Map}catch(r){}return false}function Hr(r){if(!rr||!r||typeof r!=="object"){return false}try{rr.call(r,rr);try{tr.call(r,tr)}catch(r){return true}return r instanceof WeakMap}catch(r){}return false}function Lr(r){if(!or||!r||typeof r!=="object"){return false}try{or.call(r);return true}catch(r){}return false}function zr(r){if(!K||!r||typeof r!=="object"){return false}try{K.call(r);try{L.call(r)}catch(r){return true}return r instanceof Set}catch(r){}return false}function Qr(r){if(!tr||!r||typeof r!=="object"){return false}try{tr.call(r,tr);try{rr.call(r,rr)}catch(r){return true}return r instanceof WeakSet}catch(r){}return false}function Yr(r){if(!r||typeof r!=="object"){return false}if(typeof HTMLElement!=="undefined"&&r instanceof HTMLElement){return true}return typeof r.nodeName==="string"&&typeof r.getAttribute==="function"}function Kr(r,e){if(r.length>e.maxStringLength){var t=r.length-e.maxStringLength;var n="... "+t+" more character"+(t>1?"s":"");return Kr(cr.call(r,0,e.maxStringLength),e)+n}var o=yr.call(yr.call(r,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,Xr);return Rr(o,"single",e)}function Xr(r){var e=r.charCodeAt(0);var t={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];if(t){return"\\"+t}return"\\x"+(e<16?"0":"")+pr.call(e.toString(16))}function Zr(r){return"Object("+r+")"}function re(r){return r+" { ? }"}function ee(r,e,t,n){var o=n?oe(t,n):dr.call(t,", ");return r+" ("+e+") {"+o+"}"}function te(r){for(var e=0;e<r.length;e++){if(Jr(r[e],"\n")>=0){return false}}return true}function ne(r,e){var t;if(r.indent==="\t"){t="\t"}else if(typeof r.indent==="number"&&r.indent>0){t=dr.call(Array(r.indent+1)," ")}else{return null}return{base:t,prev:dr.call(Array(e+1),t)}}function oe(r,e){if(r.length===0){return""}var t="\n"+e.prev+e.base;return t+dr.call(r,","+t)+"\n"+e.prev}function ie(r,e){var t=Mr(r);var n=[];if(t){n.length=r.length;for(var o=0;o<r.length;o++){n[o]=qr(r,o)?e(r[o],r):""}}var i=typeof gr==="function"?gr(r):[];var a;if(jr){a={};for(var f=0;f<i.length;f++){a["$"+i[f]]=i[f]}}for(var u in r){if(!qr(r,u)){continue}if(t&&String(Number(u))===u&&u<r.length){continue}if(jr&&a["$"+u]instanceof Symbol){continue}else if(lr.call(/[^\w$]/,u)){n.push(e(u,r)+": "+e(r[u],r))}else{n.push(u+": "+e(r[u],r))}}if(typeof gr==="function"){for(var c=0;c<i.length;c++){if(wr.call(r,i[c])){n.push("["+e(i[c])+"]: "+e(r[i[c]],r))}}}return n}var ae=D("%TypeError%");var fe=D("%WeakMap%",true);var ue=D("%Map%",true);var ce=q("WeakMap.prototype.get",true);var ye=q("WeakMap.prototype.set",true);var pe=q("WeakMap.prototype.has",true);var se=q("Map.prototype.get",true);var le=q("Map.prototype.set",true);var ve=q("Map.prototype.has",true);var de=function(r,e){for(var t=r,n;(n=t.next)!==null;t=n){if(n.key===e){t.next=n.next;n.next=r.next;r.next=n;return n}}};var be=function(r,e){var t=de(r,e);return t&&t.value};var he=function(r,e,t){var n=de(r,e);if(n){n.value=t}else{r.next={key:e,next:r.next,value:t}}};var me=function(r,e){return!!de(r,e)};var ge=function r(){var e;var t;var n;var o={assert:function(r){if(!o.has(r)){throw new ae("Side channel does not contain "+Fr(r))}},get:function(r){if(fe&&r&&(typeof r==="object"||typeof r==="function")){if(e){return ce(e,r)}}else if(ue){if(t){return se(t,r)}}else{if(n){return be(n,r)}}},has:function(r){if(fe&&r&&(typeof r==="object"||typeof r==="function")){if(e){return pe(e,r)}}else if(ue){if(t){return ve(t,r)}}else{if(n){return me(n,r)}}return false},set:function(r,o){if(fe&&r&&(typeof r==="object"||typeof r==="function")){if(!e){e=new fe}ye(e,r,o)}else if(ue){if(!t){t=new ue}le(t,r,o)}else{if(!n){n={key:{},next:null}}he(n,r,o)}}};return o};var Se=String.prototype.replace;var je=/%20/g;var Ae={RFC1738:"RFC1738",RFC3986:"RFC3986"};var we={default:Ae.RFC3986,formatters:{RFC1738:function(r){return Se.call(r,je,"+")},RFC3986:function(r){return String(r)}},RFC1738:Ae.RFC1738,RFC3986:Ae.RFC3986};var Oe=Object.prototype.hasOwnProperty;var Pe=Array.isArray;var Ee=function(){var r=[];for(var e=0;e<256;++e){r.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase())}return r}();var Ie=function r(e){while(e.length>1){var t=e.pop();var n=t.obj[t.prop];if(Pe(n)){var o=[];for(var i=0;i<n.length;++i){if(typeof n[i]!=="undefined"){o.push(n[i])}}t.obj[t.prop]=o}}};var Fe=function r(e,t){var n=t&&t.plainObjects?Object.create(null):{};for(var o=0;o<e.length;++o){if(typeof e[o]!=="undefined"){n[o]=e[o]}}return n};var Re=function r(e,t,n){if(!t){return e}if(typeof t!=="object"){if(Pe(e)){e.push(t)}else if(e&&typeof e==="object"){if(n&&(n.plainObjects||n.allowPrototypes)||!Oe.call(Object.prototype,t)){e[t]=true}}else{return[e,t]}return e}if(!e||typeof e!=="object"){return[e].concat(t)}var o=e;if(Pe(e)&&!Pe(t)){o=Fe(e,n)}if(Pe(e)&&Pe(t)){t.forEach((function(t,o){if(Oe.call(e,o)){var i=e[o];if(i&&typeof i==="object"&&t&&typeof t==="object"){e[o]=r(i,t,n)}else{e.push(t)}}else{e[o]=t}}));return e}return Object.keys(t).reduce((function(e,o){var i=t[o];if(Oe.call(e,o)){e[o]=r(e[o],i,n)}else{e[o]=i}return e}),o)};var ke=function r(e,t){return Object.keys(t).reduce((function(r,e){r[e]=t[e];return r}),e)};var Me=function(r,e,t){var n=r.replace(/\+/g," ");if(t==="iso-8859-1"){return n.replace(/%[0-9a-f]{2}/gi,unescape)}try{return decodeURIComponent(n)}catch(r){return n}};var xe=function r(e,t,n,o,i){if(e.length===0){return e}var a=e;if(typeof e==="symbol"){a=Symbol.prototype.toString.call(e)}else if(typeof e!=="string"){a=String(e)}if(n==="iso-8859-1"){return escape(a).replace(/%u[0-9a-f]{4}/gi,(function(r){return"%26%23"+parseInt(r.slice(2),16)+"%3B"}))}var f="";for(var u=0;u<a.length;++u){var c=a.charCodeAt(u);if(c===45||c===46||c===95||c===126||c>=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122||i===we.RFC1738&&(c===40||c===41)){f+=a.charAt(u);continue}if(c<128){f=f+Ee[c];continue}if(c<2048){f=f+(Ee[192|c>>6]+Ee[128|c&63]);continue}if(c<55296||c>=57344){f=f+(Ee[224|c>>12]+Ee[128|c>>6&63]+Ee[128|c&63]);continue}u+=1;c=65536+((c&1023)<<10|a.charCodeAt(u)&1023);f+=Ee[240|c>>18]+Ee[128|c>>12&63]+Ee[128|c>>6&63]+Ee[128|c&63]}return f};var Ue=function r(e){var t=[{obj:{o:e},prop:"o"}];var n=[];for(var o=0;o<t.length;++o){var i=t[o];var a=i.obj[i.prop];var f=Object.keys(a);for(var u=0;u<f.length;++u){var c=f[u];var y=a[c];if(typeof y==="object"&&y!==null&&n.indexOf(y)===-1){t.push({obj:a,prop:c});n.push(y)}}}Ie(t);return e};var Ne=function r(e){return Object.prototype.toString.call(e)==="[object RegExp]"};var Be=function r(e){if(!e||typeof e!=="object"){return false}return!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))};var We=function r(e,t){return[].concat(e,t)};var Te=function r(e,t){if(Pe(e)){var n=[];for(var o=0;o<e.length;o+=1){n.push(t(e[o]))}return n}return t(e)};var De={arrayToObject:Fe,assign:ke,combine:We,compact:Ue,decode:Me,encode:xe,isBuffer:Be,isRegExp:Ne,maybeMap:Te,merge:Re};var Ce=Object.prototype.hasOwnProperty;var _e={brackets:function r(e){return e+"[]"},comma:"comma",indices:function r(e,t){return e+"["+t+"]"},repeat:function r(e){return e}};var qe=Array.isArray;var Ge=String.prototype.split;var $e=Array.prototype.push;var Je=function(r,e){$e.apply(r,qe(e)?e:[e])};var Ve=Date.prototype.toISOString;var He=we["default"];var Le={addQueryPrefix:false,allowDots:false,charset:"utf-8",charsetSentinel:false,delimiter:"&",encode:true,encoder:De.encode,encodeValuesOnly:false,format:He,formatter:we.formatters[He],indices:false,serializeDate:function r(e){return Ve.call(e)},skipNulls:false,strictNullHandling:false};var ze=function r(e){return typeof e==="string"||typeof e==="number"||typeof e==="boolean"||typeof e==="symbol"||typeof e==="bigint"};var Qe={};var Ye=function r(e,t,n,o,i,a,f,u,c,y,p,s,l,v,d,b){var h=e;var m=b;var g=0;var S=false;while((m=m.get(Qe))!==void undefined&&!S){var j=m.get(e);g+=1;if(typeof j!=="undefined"){if(j===g){throw new RangeError("Cyclic object value")}else{S=true}}if(typeof m.get(Qe)==="undefined"){g=0}}if(typeof u==="function"){h=u(t,h)}else if(h instanceof Date){h=p(h)}else if(n==="comma"&&qe(h)){h=De.maybeMap(h,(function(r){if(r instanceof Date){return p(r)}return r}))}if(h===null){if(i){return f&&!v?f(t,Le.encoder,d,"key",s):t}h=""}if(ze(h)||De.isBuffer(h)){if(f){var A=v?t:f(t,Le.encoder,d,"key",s);if(n==="comma"&&v){var w=Ge.call(String(h),",");var O="";for(var P=0;P<w.length;++P){O+=(P===0?"":",")+l(f(w[P],Le.encoder,d,"value",s))}return[l(A)+(o&&qe(h)&&w.length===1?"[]":"")+"="+O]}return[l(A)+"="+l(f(h,Le.encoder,d,"value",s))]}return[l(t)+"="+l(String(h))]}var E=[];if(typeof h==="undefined"){return E}var I;if(n==="comma"&&qe(h)){I=[{value:h.length>0?h.join(",")||null:void undefined}]}else if(qe(u)){I=u}else{var F=Object.keys(h);I=c?F.sort(c):F}var R=o&&qe(h)&&h.length===1?t+"[]":t;for(var k=0;k<I.length;++k){var M=I[k];var x=typeof M==="object"&&typeof M.value!=="undefined"?M.value:h[M];if(a&&x===null){continue}var U=qe(h)?typeof n==="function"?n(R,M):R:R+(y?"."+M:"["+M+"]");b.set(e,g);var N=ge();N.set(Qe,b);Je(E,r(x,U,n,o,i,a,f,u,c,y,p,s,l,v,d,N))}return E};var Ke=function r(e){if(!e){return Le}if(e.encoder!==null&&typeof e.encoder!=="undefined"&&typeof e.encoder!=="function"){throw new TypeError("Encoder has to be a function.")}var t=e.charset||Le.charset;if(typeof e.charset!=="undefined"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1"){throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined")}var n=we["default"];if(typeof e.format!=="undefined"){if(!Ce.call(we.formatters,e.format)){throw new TypeError("Unknown format option provided.")}n=e.format}var o=we.formatters[n];var i=Le.filter;if(typeof e.filter==="function"||qe(e.filter)){i=e.filter}return{addQueryPrefix:typeof e.addQueryPrefix==="boolean"?e.addQueryPrefix:Le.addQueryPrefix,allowDots:typeof e.allowDots==="undefined"?Le.allowDots:!!e.allowDots,charset:t,charsetSentinel:typeof e.charsetSentinel==="boolean"?e.charsetSentinel:Le.charsetSentinel,delimiter:typeof e.delimiter==="undefined"?Le.delimiter:e.delimiter,encode:typeof e.encode==="boolean"?e.encode:Le.encode,encoder:typeof e.encoder==="function"?e.encoder:Le.encoder,encodeValuesOnly:typeof e.encodeValuesOnly==="boolean"?e.encodeValuesOnly:Le.encodeValuesOnly,filter:i,format:n,formatter:o,serializeDate:typeof e.serializeDate==="function"?e.serializeDate:Le.serializeDate,skipNulls:typeof e.skipNulls==="boolean"?e.skipNulls:Le.skipNulls,sort:typeof e.sort==="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling==="boolean"?e.strictNullHandling:Le.strictNullHandling}};var Xe=function(r,e){var t=r;var n=Ke(e);var o;var i;if(typeof n.filter==="function"){i=n.filter;t=i("",t)}else if(qe(n.filter)){i=n.filter;o=i}var a=[];if(typeof t!=="object"||t===null){return""}var f;if(e&&e.arrayFormat in _e){f=e.arrayFormat}else if(e&&"indices"in e){f=e.indices?"indices":"repeat"}else{f="indices"}var u=_e[f];if(e&&"commaRoundTrip"in e&&typeof e.commaRoundTrip!=="boolean"){throw new TypeError("`commaRoundTrip` must be a boolean, or absent")}var c=u==="comma"&&e&&e.commaRoundTrip;if(!o){o=Object.keys(t)}if(n.sort){o.sort(n.sort)}var y=ge();for(var p=0;p<o.length;++p){var s=o[p];if(n.skipNulls&&t[s]===null){continue}Je(a,Ye(t[s],s,u,c,n.strictNullHandling,n.skipNulls,n.encode?n.encoder:null,n.filter,n.sort,n.allowDots,n.serializeDate,n.format,n.formatter,n.encodeValuesOnly,n.charset,y))}var l=a.join(n.delimiter);var v=n.addQueryPrefix===true?"?":"";if(n.charsetSentinel){if(n.charset==="iso-8859-1"){v+="utf8=%26%2310003%3B&"}else{v+="utf8=%E2%9C%93&"}}return l.length>0?v+l:""};var Ze=Object.prototype.hasOwnProperty;var rt=Array.isArray;var et={allowDots:false,allowPrototypes:false,allowSparse:false,arrayLimit:20,charset:"utf-8",charsetSentinel:false,comma:false,decoder:De.decode,delimiter:"&",depth:5,ignoreQueryPrefix:false,interpretNumericEntities:false,parameterLimit:1e3,parseArrays:true,plainObjects:false,strictNullHandling:false};var tt=function(r){return r.replace(/&#(\d+);/g,(function(r,e){return String.fromCharCode(parseInt(e,10))}))};var nt=function(r,e){if(r&&typeof r==="string"&&e.comma&&r.indexOf(",")>-1){return r.split(",")}return r};var ot="utf8=%26%2310003%3B";var it="utf8=%E2%9C%93";var at=function r(e,t){var n={};var o=t.ignoreQueryPrefix?e.replace(/^\?/,""):e;var i=t.parameterLimit===Infinity?undefined:t.parameterLimit;var a=o.split(t.delimiter,i);var f=-1;var u;var c=t.charset;if(t.charsetSentinel){for(u=0;u<a.length;++u){if(a[u].indexOf("utf8=")===0){if(a[u]===it){c="utf-8"}else if(a[u]===ot){c="iso-8859-1"}f=u;u=a.length}}}for(u=0;u<a.length;++u){if(u===f){continue}var y=a[u];var p=y.indexOf("]=");var s=p===-1?y.indexOf("="):p+1;var l,v;if(s===-1){l=t.decoder(y,et.decoder,c,"key");v=t.strictNullHandling?null:""}else{l=t.decoder(y.slice(0,s),et.decoder,c,"key");v=De.maybeMap(nt(y.slice(s+1),t),(function(r){return t.decoder(r,et.decoder,c,"value")}))}if(v&&t.interpretNumericEntities&&c==="iso-8859-1"){v=tt(v)}if(y.indexOf("[]=")>-1){v=rt(v)?[v]:v}if(Ze.call(n,l)){n[l]=De.combine(n[l],v)}else{n[l]=v}}return n};var ft=function(r,e,t,n){var o=n?e:nt(e,t);for(var i=r.length-1;i>=0;--i){var a;var f=r[i];if(f==="[]"&&t.parseArrays){a=[].concat(o)}else{a=t.plainObjects?Object.create(null):{};var u=f.charAt(0)==="["&&f.charAt(f.length-1)==="]"?f.slice(1,-1):f;var c=parseInt(u,10);if(!t.parseArrays&&u===""){a={0:o}}else if(!isNaN(c)&&f!==u&&String(c)===u&&c>=0&&(t.parseArrays&&c<=t.arrayLimit)){a=[];a[c]=o}else if(u!=="__proto__"){a[u]=o}}o=a}return o};var ut=function r(e,t,n,o){if(!e){return}var i=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e;var a=/(\[[^[\]]*])/;var f=/(\[[^[\]]*])/g;var u=n.depth>0&&a.exec(i);var c=u?i.slice(0,u.index):i;var y=[];if(c){if(!n.plainObjects&&Ze.call(Object.prototype,c)){if(!n.allowPrototypes){return}}y.push(c)}var p=0;while(n.depth>0&&(u=f.exec(i))!==null&&p<n.depth){p+=1;if(!n.plainObjects&&Ze.call(Object.prototype,u[1].slice(1,-1))){if(!n.allowPrototypes){return}}y.push(u[1])}if(u){y.push("["+i.slice(u.index)+"]")}return ft(y,t,n,o)};var ct=function r(e){if(!e){return et}if(e.decoder!==null&&e.decoder!==undefined&&typeof e.decoder!=="function"){throw new TypeError("Decoder has to be a function.")}if(typeof e.charset!=="undefined"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1"){throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined")}var t=typeof e.charset==="undefined"?et.charset:e.charset;return{allowDots:typeof e.allowDots==="undefined"?et.allowDots:!!e.allowDots,allowPrototypes:typeof e.allowPrototypes==="boolean"?e.allowPrototypes:et.allowPrototypes,allowSparse:typeof e.allowSparse==="boolean"?e.allowSparse:et.allowSparse,arrayLimit:typeof e.arrayLimit==="number"?e.arrayLimit:et.arrayLimit,charset:t,charsetSentinel:typeof e.charsetSentinel==="boolean"?e.charsetSentinel:et.charsetSentinel,comma:typeof e.comma==="boolean"?e.comma:et.comma,decoder:typeof e.decoder==="function"?e.decoder:et.decoder,delimiter:typeof e.delimiter==="string"||De.isRegExp(e.delimiter)?e.delimiter:et.delimiter,depth:typeof e.depth==="number"||e.depth===false?+e.depth:et.depth,ignoreQueryPrefix:e.ignoreQueryPrefix===true,interpretNumericEntities:typeof e.interpretNumericEntities==="boolean"?e.interpretNumericEntities:et.interpretNumericEntities,parameterLimit:typeof e.parameterLimit==="number"?e.parameterLimit:et.parameterLimit,parseArrays:e.parseArrays!==false,plainObjects:typeof e.plainObjects==="boolean"?e.plainObjects:et.plainObjects,strictNullHandling:typeof e.strictNullHandling==="boolean"?e.strictNullHandling:et.strictNullHandling}};var yt=function(r,e){var t=ct(e);if(r===""||r===null||typeof r==="undefined"){return t.plainObjects?Object.create(null):{}}var n=typeof r==="string"?at(r,t):r;var o=t.plainObjects?Object.create(null):{};var i=Object.keys(n);for(var a=0;a<i.length;++a){var f=i[a];var u=ut(f,n[f],t,typeof r==="string");o=De.merge(o,u,t)}if(t.allowSparse===true){return o}return De.compact(o)};var pt={formats:we,parse:yt,stringify:Xe};const st="nano-component-store:";const lt=(r="hash",e=window)=>{if(!e||!e.location)return{};if(r==="hash"&&e.location.hash)return pt.parse(e.location.hash.replace(/^\#/,""),{strictNullHandling:true});else if(r==="query"&&e.location.search)return pt.parse(e.location.search,{ignoreQueryPrefix:true});return{}};const vt=(r,e="hash",t=window,n="replace")=>{if(!t||!t.history)return;const o=e==="query"?t.location.search:t.location.hash;const i=e==="query"?t.location.pathname:t.location.pathname+t.location.search;let a=pt.stringify(r,{strictNullHandling:true,addQueryPrefix:false,encodeValuesOnly:true});if(!a||!a.length){if(!o||!o.length)return;if(n==="replace")t.history.replaceState(null,null,i);else t.history.pushState(null,null,i);return}if(e==="hash"&&t.location.hash==="#"+a){try{document.querySelector("#"+a).focus()}catch(r){}return}a=(e==="hash"?"#":"?")+a;if(a===o)return;if(n==="replace")t.history.replaceState(null,null,i+a);else t.history.pushState(null,null,i+a)};const dt=(r,e,t="hash",n=window,o="replace")=>{r=Object.keys(pt.parse(r))[0];const i={};i[r]=e;let a=lt(t,n);a=Object.assign(Object.assign({},a),i);vt(a,t,n,o)};const bt=(r,e="hash",t=window)=>{r=Object.keys(pt.parse(r))[0];const n=lt(e,t);return n[r]||null};const ht=(r,e,t=window)=>{try{if(!e){t.sessionStorage.removeItem(st+r);return}t.sessionStorage.setItem(st+r,JSON.stringify(e))}catch(r){throw r}};const mt=(r,e=window)=>{try{const t=e.sessionStorage.getItem(st+r);return t!==null?JSON.parse(t):null}catch(r){throw r}};const gt=(r,e,t=window)=>{try{if(!e){t.localStorage.removeItem(st+r);return}t.localStorage.setItem(st+r,JSON.stringify(e))}catch(r){throw r}};const St=(r,e=window)=>{try{const t=e.localStorage.getItem(st+r);return t!==null?JSON.parse(t):null}catch(r){throw r}};const jt=new Map;const At={init(e,t,n,o){const i=o||e.storeId||r(e).id;if(!i){console.error("No id set. You can only instantiate a new component store with an id. ");return}if(jt.get(i)){console.error("Duplicate store id usage. A store ID must be unique!",i);return}const a=t.reduce(((r,t)=>{if(typeof e[t]!==undefined)r[t]=e[t];return r}),{});jt.set(i,new wt(i,e,t,a,n));const f=jt.get(i);f.dispatchToProps();const u=e.connectedCallback;e.connectedCallback=function(){jt.set(i,new wt(i,e,t,a,n));const r=jt.get(i);if(u){u.call(e)}if(r)r.dispatchToProps()};const c=e.componentDidRender;e.componentDidRender=function(){const r=jt.get(i);if(c){c.call(e)}if(r)r.savePropsToStore()};const y=e.disconnectedCallback;e.disconnectedCallback=function(){const r=jt.get(i);if(r)r.delete();jt.delete(i);if(y){y.call(e)}}}};class wt{constructor(r,t,n,o,i){this.method="session";this.initialState={};this.updateStore=true;this.onUrlChange=()=>{this.dispatchToProps(false)};this.savePropsToStore=()=>{if(this.updateStore){this.save(this.getData)}else if(!this.updateStore)this.updateStore=true};this.dispatchToProps=(r=true)=>{const e=this.retrieve();if(!e&&r)return;this.updateStore=r;this.keys.forEach((r=>{this.component[r]=e?e[r]:undefined}))};this.delete=()=>{if(this.method==="url-hash-push"||this.method==="url-query-push"){window.removeEventListener("popstate",this.onUrlChange)}};if(!r)throw new Error("No id set. You can only instantiate a new component store with an id");this.id=r;this.keys=n;this.component=t;if(o)this.initialState=o;if(i)this.method=i;this.savePropsToStore=e(this.savePropsToStore,500);if(this.method==="url-hash-push"||this.method==="url-query-push"){window.addEventListener("popstate",this.onUrlChange)}}equality(r,e){if(typeof r!==typeof e)return false;if(typeof r!=="object")return r===e;return JSON.stringify(r)===JSON.stringify(e)}get getData(){const r=this.keys.reduce(((r,e)=>{const t=this.equality(this.component[e],this.initialState[e]);if(typeof this.component[e]!=="undefined"&&!t){r[e]=this.component[e]}else if(t)delete r[e];return r}),{});return Object.keys(r).length?r:undefined}retrieve(){switch(this.method){case"url-hash":case"url-hash-push":return bt(this.id,"hash");case"url-query":case"url-query-push":return bt(this.id,"query");case"local":return St(this.id);default:return mt(this.id)}}save(r){switch(this.method){case"url-hash":return dt(this.id,r,"hash");case"url-query":return dt(this.id,r,"query");case"url-hash-push":return dt(this.id,r,"hash",window,"push");case"url-query-push":return dt(this.id,r,"query",window,"push");case"local":return gt(this.id,r);default:return ht(this.id,r)}}}export{At as C};
|
5
|
+
//# sourceMappingURL=p-1a0b5bc3.js.map
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
2
|
* Web Components for Nanopore digital Web Apps
|
3
3
|
*/
|
4
|
-
import{r as t,h as i,a,g as s}from"./p-f6a8467a.js";import{g as e,a as o}from"./p-257432ff.js";import{d as r}from"./p-9746b0a5.js";const n=':host{box-sizing:border-box}*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}:host{--indicator-transition:var(--nano-transition-fast, 0.3s);--indicator-color:#90c6e7;--indicator-size:0;--indicator-track-color:#e4e6e8;--indicator-track-size:var(--indicator-size);--scroll-btn-color:"currentColor";--fade-size:1.75rem;--fade-transparency:0;--padding:var(--fade-size);position:relative;z-index:var(--nano-layer-index-raised, 5)}:host([orientation=horizontal]){display:block}:host([orientation=vertical]){display:flex}.onav--no-transitions *{transition-duration:0s !important}.onav__scroller{scrollbar-width:none;-ms-overflow-style:none;display:flex;transition:var(--nano-transition-medium, 0.5s) ease;background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=");-webkit-mask-size:calc(100% + var(--fade-size) * 4);mask-size:calc(100% + var(--fade-size) * 4);-webkit-mask-position:calc(var(--fade-size) * -2);mask-position:calc(var(--fade-size) * -2)}.onav__scroller::-webkit-scrollbar{inline-size:0;block-size:0}.onav__scroller::after{content:" ";line-height:1;flex:0 0 auto;display:block}.onav--has-scroll-controls-start .onav__scroller{-webkit-mask-position:0;mask-position:0;-webkit-mask-size:calc(100% + var(--fade-size) * 2);mask-size:calc(100% + var(--fade-size) * 2)}.onav--has-scroll-controls-end .onav__scroller{-webkit-mask-position:calc(var(--fade-size) * -1);mask-position:calc(var(--fade-size) * -1);-webkit-mask-size:calc(100% + var(--fade-size));mask-size:calc(100% + var(--fade-size))}.onav--has-scroll-controls-start.onav--has-scroll-controls-end .onav__scroller{-webkit-mask-size:100%;mask-size:100%;-webkit-mask-position:0;mask-position:0}.onav__items{flex:1 1 auto;position:relative;width:auto;flex-wrap:nowrap;display:flex}.onav__items::before{content:"";background:var(--indicator-track-color);display:block;position:absolute;z-index:1}.onav__active-indicator{position:absolute;z-index:10;transition:var(--indicator-transition) transform ease, var(--indicator-transition) width ease, var(--indicator-transition) height ease}.onav nano-icon-button.onav__scroll-button{--nano-color-base:var(--scroll-btn-color);display:flex;align-items:center;justify-content:center;position:absolute;border:unset;z-index:2;transition:var(--nano-transition-fast, 0.3s) ease opacity;opacity:0;color:var(--scroll-btn-color);pointer-events:none}.onav nano-icon-button.onav__scroll-button:focus{outline:none}.onav nano-icon-button.onav__scroll-button.is-shown{opacity:1;pointer-events:all}.onav nano-icon-button.onav__scroll-button:focus-visible{box-shadow:var(--nano-control-focus-shadow, 0 0 0 0.1875rem var(--nano-control-focus-color, rgba(144, 198, 231, 0.8))) inset}.onav--horizontal .onav__scroller{overflow-x:auto;overflow-y:hidden;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;padding-inline:var(--padding);-webkit-mask-image:linear-gradient(to left, rgb(0 0 0/var(--fade-transparency)) 0, rgb(0 0 0/var(--fade-transparency)) var(--fade-size), black calc(var(--fade-size) * 2), black calc(100% - var(--fade-size) * 2), rgb(0 0 0/var(--fade-transparency)) calc(100% - var(--fade-size)), rgb(0 0 0/var(--fade-transparency)));mask-image:linear-gradient(to left, rgb(0 0 0/var(--fade-transparency)) 0, rgb(0 0 0/var(--fade-transparency)) var(--fade-size), black calc(var(--fade-size) * 2), black calc(100% - var(--fade-size) * 2), rgb(0 0 0/var(--fade-transparency)) calc(100% - var(--fade-size)), rgb(0 0 0/var(--fade-transparency)))}.onav--horizontal .onav__scroller::after{padding-inline:0 var(--fade-size);padding-block:0 0}.onav--horizontal.onav--has-scroll-controls .onav__scroller{padding-inline:var(--fade-size) 0;-webkit-padding-before:0;padding-block-start:0;-webkit-padding-after:0;padding-block-end:0}.onav--horizontal .onav__items{flex-direction:row}.onav--horizontal .onav__items::before{content:"";width:100%;height:var(--indicator-track-size);inset-block-end:0}.onav--horizontal .onav__active-indicator{inset-block-end:0;-webkit-border-after:solid var(--indicator-size) var(--indicator-color);border-block-end:solid var(--indicator-size) var(--indicator-color)}.onav--horizontal .onav__scroll-button{inset-block:0}.onav--horizontal .onav__scroll-button--start{inset-inline-start:0}.onav--horizontal .onav__scroll-button--end{inset-inline-end:0}.onav--vertical{width:100%}.onav--vertical .onav__nav{max-height:100%;display:flex}.onav--vertical .onav__scroller{width:100%;overflow-y:auto;overflow-x:hidden;flex-direction:column;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;padding-block:var(--padding);-webkit-mask-image:linear-gradient(to top, rgb(0 0 0/var(--fade-transparency)) 0, rgb(0 0 0/var(--fade-transparency)) var(--fade-size), black calc(var(--fade-size) * 2), black calc(100% - var(--fade-size) * 2), rgb(0 0 0/var(--fade-transparency)) calc(100% - var(--fade-size)), rgb(0 0 0/var(--fade-transparency)));mask-image:linear-gradient(to top, rgb(0 0 0/var(--fade-transparency)) 0, rgb(0 0 0/var(--fade-transparency)) var(--fade-size), black calc(var(--fade-size) * 2), black calc(100% - var(--fade-size) * 2), rgb(0 0 0/var(--fade-transparency)) calc(100% - var(--fade-size)), rgb(0 0 0/var(--fade-transparency)));padding-inline:0 0;-webkit-padding-before:calc(var(--fade-size) + 12px);padding-block-start:calc(var(--fade-size) + 12px);-webkit-padding-after:var(--fade-size);padding-block-end:var(--fade-size)}.onav--vertical .onav__scroller::after{padding-inline:0 0;padding-block:0 var(--fade-size)}.onav--vertical .onav__items{flex-direction:column;width:-moz-fit-content;width:fit-content}.onav--vertical .onav__items::before{content:"";height:100%;width:var(--indicator-track-size);inset-inline-start:0}.onav--vertical .onav__active-indicator{inset-inline-start:0;-webkit-border-start:solid var(--indicator-size) var(--indicator-color);border-inline-start:solid var(--indicator-size) var(--indicator-color)}.onav--vertical .onav__scroll-button{inset-inline:0}.onav--vertical .onav__scroll-button--start{inset-block-start:0}.onav--vertical .onav__scroll-button--end{inset-block-end:0}';const l=class{watchIsActiveHandler(){this.instantReCalc=true;this.activeItem=this.allActiveItems.find(((t,i)=>this.isActiveHandler(t,i)));setTimeout((()=>this.instantReCalc=false),300)}async syncActiveItem(){this.activeItem=this.allActiveItems.find(((t,i)=>this.isActiveHandler(t,i)))}constructor(i){t(this,i);this.mutationObservers=new WeakMap;this.updateScrollControls=()=>{if(!this.nav)return;this.hasScrollControls=this.nav[this.scrollProp]>this.nav[this.clientDimProp]&&this.nav[this.scrollProp]>this.itemContainer[this.clientDimProp];this.handleScroll()};this.handleScroll=()=>{if(!this.hasScrollControls){this.hideControlStart=this.hideControlEnd=true;return}const t=this.isRtl?this.nav[this.scrollOffset]===0:Math.abs(this.nav[this.clientDimProp]-(this.nav[this.scrollProp]-this.nav[this.scrollOffset]))<2;const i=this.isRtl?Math.abs(this.nav[this.scrollProp]+this.nav[this.scrollOffset]-this.nav[this.clientDimProp])<2:this.nav[this.scrollOffset]===0;if(i){this.hideControlStart=true;this.hideControlEnd=false}else if(t){this.hideControlStart=false;this.hideControlEnd=true}else{this.hideControlEnd=false;this.hideControlStart=false}};this.handleBtnClick=(t=false)=>{const i=this.navDim;let a;if(t)a=this.nav[this.scrollOffset]+i-20;else a=this.nav[this.scrollOffset]-i+20;try{this.nav.scroll({left:this.orientation==="horizontal"?a:0,top:this.orientation==="vertical"?a:0,behavior:"smooth"})}catch(t){this.nav[this.scrollOffset]=a}};this.slotChangeHandler=()=>{if(this.allActiveItems.length<2)return;const t=this.allActiveItems.find(((t,i)=>this.isActiveHandler(t,i)));if(t)this.activeItem=t;this.recalculatePositions();this.allActiveItems.forEach((t=>{if(this.mutationObservers.get(t))return;const i=new MutationObserver((()=>this.syncActiveItemIndicator()));i.observe(t,{characterData:true,childList:true,subtree:true});this.mutationObservers.set(t,i)}))};this.handleClick=t=>{if(this.allActiveItems.length<2)return;const i=t.composedPath().find((t=>this.allActiveItems.includes(t)));if(i)this.activeItem=i};this.handleKeyDown=t=>{if(["Enter"," "].includes(t.key)){const i=t.composedPath().find((t=>this.allActiveItems.includes(t)));if(i)this.activeItem=i}};this.recalculatePositions=()=>{this.updateScrollControls();this.syncActiveItemIndicator();this.scrollToActiveItem()};this.scrollControls=true;this.orientation="horizontal";this.activeHandler=(t,i)=>t.classList.add("active");this.inActiveHandler=(t,i)=>t.classList.remove("active");this.isActiveHandler=(t,i)=>t.classList.contains("active");this.instantReCalc=false;this.hasScrollControls=false;this.hideControlEnd=true;this.hideControlStart=true;this.recalculatePositions=r(this.recalculatePositions.bind(this),80)}get scrollProp(){return this.orientation==="horizontal"?"scrollWidth":"scrollHeight"}get clientDimProp(){return this.orientation==="horizontal"?"clientWidth":"clientHeight"}get scrollOffset(){return this.orientation==="horizontal"?"scrollLeft":"scrollTop"}watchScrollControls(){if(this.hasScrollControls)this.handleScroll();else this.hideControlStart=this.hideControlEnd=true}hideEndBtn(){if(!this.endBtn)return;this.activateBtn(this.endBtn,!this.hideControlEnd)}hideStartBtn(){if(!this.startBtn)return;this.activateBtn(this.startBtn,!this.hideControlStart)}activateBtn(t,i=true){if(!i){t.tabIndex=-1;t.disabled=true;t.classList.remove("is-shown");return}t.tabIndex=0;t.disabled=false;t.classList.add("is-shown")}get allActiveItems(){return this.allItems.filter((t=>!t.disabled||t.classList.contains("disabled")))}get allItems(){return e(this.host,"*",true)}get activeItem(){return this._activeItem}set activeItem(t){if(!t||t===this.activeItem||t.disabled||!this.allActiveItems.includes(t)){return}this._activeItem=t;this.allActiveItems.forEach(((t,i)=>{if(t===this._activeItem)this.activeHandler(t,i);else this.inActiveHandler(t,i)}));this.recalculatePositions()}get navDim(){if(!this.nav)return 0;const t=getComputedStyle(this.nav);let i=this.nav[this.clientDimProp];if(this.orientation==="horizontal"){return i-=parseFloat(t.paddingLeft)+parseFloat(t.paddingRight)}else{return i-=parseFloat(t.paddingTop)+parseFloat(t.paddingBottom)}}scrollToActiveItem(){if(!this.nav||!this.activeItem)return;setTimeout((()=>{this.activeItem.scrollIntoView({behavior:this.instantReCalc?"auto":"smooth",block:"center",inline:"center"})}),100)}syncActiveItemIndicator(){if(!this.activeItem)return;const t=this.activeItem;const i=t.clientWidth||0;const a=t.clientHeight+2||0;const s=o(t,this.itemContainer);if(!this.activeIndicator)return;const e=s.top;const r=s.left;if(this.instantReCalc)this.activeIndicator.style.transition="none";switch(this.orientation){case"horizontal":this.activeIndicator.style.width=`${i}px`;this.activeIndicator.style.height=null;this.activeIndicator.style.transform=`translateX(${r}px)`;break;case"vertical":this.activeIndicator.style.width=null;this.activeIndicator.style.height=`${a}px`;this.activeIndicator.style.transform=`translateY(${e}px)`;break}setTimeout((()=>this.activeIndicator.style.transition=null),400)}connectedCallback(){this.instantReCalc=true;this.isRtl=this.orientation==="horizontal"&&!!this.host.closest('[dir="rtl"]');if(window["MutationObserver"])this.slotChangeHandler();if(!window["ResizeObserver"])return;if(this.ro){this.ro.disconnect();this.ro=undefined}const t=this.ro=new ResizeObserver(this.recalculatePositions);t.observe(this.host)}componentDidLoad(){this.activeItem=this.allActiveItems.find(((t,i)=>this.isActiveHandler(t,i)));this.instantReCalc=false}disconnectedCallback(){if(this.ro){this.ro.disconnect();this.ro=undefined}}render(){return i(a,{dir:this.isRtl?"rtl":null},i("div",{part:"base",class:{onav:true,[`onav--${this.orientation}`]:true,"onav--has-scroll-controls":this.hasScrollControls,"onav--has-scroll-controls-start":!this.hideControlStart,"onav--has-scroll-controls-end":!this.hideControlEnd,"onav--no-transitions":this.instantReCalc},onClick:this.handleClick,onKeyDown:this.handleKeyDown},i("div",{class:"onav__nav"},this.scrollControls&&i("nano-icon-button",{part:"scroll-button scroll-button-prev",class:{"onav__scroll-button":true,"onav__scroll-button--start":true},ref:t=>this.startBtn=t,onClick:()=>this.handleBtnClick(false),label:"Click to scroll",iconName:this.orientation==="horizontal"?"light/chevron-left":"light/chevron-up"}),i("div",{part:"scroller",ref:t=>this.nav=t,class:"onav__scroller",onScroll:this.handleScroll},i("div",{part:"items",ref:t=>this.itemContainer=t,class:"onav__items"},i("div",{part:"indicator",ref:t=>this.activeIndicator=t,class:"onav__active-indicator"}),i("slot",{onSlotchange:this.slotChangeHandler}))),this.scrollControls&&i("nano-icon-button",{part:"scroll-button scroll-button-next",class:{"onav__scroll-button":true,"onav__scroll-button--end":true},ref:t=>this.endBtn=t,onClick:()=>this.handleBtnClick(true),label:"Click to scroll",iconName:this.orientation==="horizontal"?"light/chevron-right":"light/chevron-down"}))))}get host(){return s(this)}static get watchers(){return{isActiveHandler:["watchIsActiveHandler"],hasScrollControls:["watchScrollControls"],hideControlEnd:["hideEndBtn"],hideControlStart:["hideStartBtn"]}}};l.style=n;export{l as nano_overflow_nav};
|
5
|
-
//# sourceMappingURL=p-
|
4
|
+
import{r as t,h as i,a,g as s}from"./p-f6a8467a.js";import{g as e,a as o}from"./p-257432ff.js";import{d as r}from"./p-7bff5224.js";const n=':host{box-sizing:border-box}*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}:host{--indicator-transition:var(--nano-transition-fast, 0.3s);--indicator-color:#90c6e7;--indicator-size:0;--indicator-track-color:#e4e6e8;--indicator-track-size:var(--indicator-size);--scroll-btn-color:"currentColor";--fade-size:1.75rem;--fade-transparency:0;--padding:var(--fade-size);position:relative;z-index:var(--nano-layer-index-raised, 5)}:host([orientation=horizontal]){display:block}:host([orientation=vertical]){display:flex}.onav--no-transitions *{transition-duration:0s !important}.onav__scroller{scrollbar-width:none;-ms-overflow-style:none;display:flex;transition:var(--nano-transition-medium, 0.5s) ease;background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=");-webkit-mask-size:calc(100% + var(--fade-size) * 4);mask-size:calc(100% + var(--fade-size) * 4);-webkit-mask-position:calc(var(--fade-size) * -2);mask-position:calc(var(--fade-size) * -2)}.onav__scroller::-webkit-scrollbar{inline-size:0;block-size:0}.onav__scroller::after{content:" ";line-height:1;flex:0 0 auto;display:block}.onav--has-scroll-controls-start .onav__scroller{-webkit-mask-position:0;mask-position:0;-webkit-mask-size:calc(100% + var(--fade-size) * 2);mask-size:calc(100% + var(--fade-size) * 2)}.onav--has-scroll-controls-end .onav__scroller{-webkit-mask-position:calc(var(--fade-size) * -1);mask-position:calc(var(--fade-size) * -1);-webkit-mask-size:calc(100% + var(--fade-size));mask-size:calc(100% + var(--fade-size))}.onav--has-scroll-controls-start.onav--has-scroll-controls-end .onav__scroller{-webkit-mask-size:100%;mask-size:100%;-webkit-mask-position:0;mask-position:0}.onav__items{flex:1 1 auto;position:relative;width:auto;flex-wrap:nowrap;display:flex}.onav__items::before{content:"";background:var(--indicator-track-color);display:block;position:absolute;z-index:1}.onav__active-indicator{position:absolute;z-index:10;transition:var(--indicator-transition) transform ease, var(--indicator-transition) width ease, var(--indicator-transition) height ease}.onav nano-icon-button.onav__scroll-button{--nano-color-base:var(--scroll-btn-color);display:flex;align-items:center;justify-content:center;position:absolute;border:unset;z-index:2;transition:var(--nano-transition-fast, 0.3s) ease opacity;opacity:0;color:var(--scroll-btn-color);pointer-events:none}.onav nano-icon-button.onav__scroll-button:focus{outline:none}.onav nano-icon-button.onav__scroll-button.is-shown{opacity:1;pointer-events:all}.onav nano-icon-button.onav__scroll-button:focus-visible{box-shadow:var(--nano-control-focus-shadow, 0 0 0 0.1875rem var(--nano-control-focus-color, rgba(144, 198, 231, 0.8))) inset}.onav--horizontal .onav__scroller{overflow-x:auto;overflow-y:hidden;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;padding-inline:var(--padding);-webkit-mask-image:linear-gradient(to left, rgb(0 0 0/var(--fade-transparency)) 0, rgb(0 0 0/var(--fade-transparency)) var(--fade-size), black calc(var(--fade-size) * 2), black calc(100% - var(--fade-size) * 2), rgb(0 0 0/var(--fade-transparency)) calc(100% - var(--fade-size)), rgb(0 0 0/var(--fade-transparency)));mask-image:linear-gradient(to left, rgb(0 0 0/var(--fade-transparency)) 0, rgb(0 0 0/var(--fade-transparency)) var(--fade-size), black calc(var(--fade-size) * 2), black calc(100% - var(--fade-size) * 2), rgb(0 0 0/var(--fade-transparency)) calc(100% - var(--fade-size)), rgb(0 0 0/var(--fade-transparency)))}.onav--horizontal .onav__scroller::after{padding-inline:0 var(--fade-size);padding-block:0 0}.onav--horizontal.onav--has-scroll-controls .onav__scroller{padding-inline:var(--fade-size) 0;-webkit-padding-before:0;padding-block-start:0;-webkit-padding-after:0;padding-block-end:0}.onav--horizontal .onav__items{flex-direction:row}.onav--horizontal .onav__items::before{content:"";width:100%;height:var(--indicator-track-size);inset-block-end:0}.onav--horizontal .onav__active-indicator{inset-block-end:0;-webkit-border-after:solid var(--indicator-size) var(--indicator-color);border-block-end:solid var(--indicator-size) var(--indicator-color)}.onav--horizontal .onav__scroll-button{inset-block:0}.onav--horizontal .onav__scroll-button--start{inset-inline-start:0}.onav--horizontal .onav__scroll-button--end{inset-inline-end:0}.onav--vertical{width:100%}.onav--vertical .onav__nav{max-height:100%;display:flex}.onav--vertical .onav__scroller{width:100%;overflow-y:auto;overflow-x:hidden;flex-direction:column;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;padding-block:var(--padding);-webkit-mask-image:linear-gradient(to top, rgb(0 0 0/var(--fade-transparency)) 0, rgb(0 0 0/var(--fade-transparency)) var(--fade-size), black calc(var(--fade-size) * 2), black calc(100% - var(--fade-size) * 2), rgb(0 0 0/var(--fade-transparency)) calc(100% - var(--fade-size)), rgb(0 0 0/var(--fade-transparency)));mask-image:linear-gradient(to top, rgb(0 0 0/var(--fade-transparency)) 0, rgb(0 0 0/var(--fade-transparency)) var(--fade-size), black calc(var(--fade-size) * 2), black calc(100% - var(--fade-size) * 2), rgb(0 0 0/var(--fade-transparency)) calc(100% - var(--fade-size)), rgb(0 0 0/var(--fade-transparency)));padding-inline:0 0;-webkit-padding-before:calc(var(--fade-size) + 12px);padding-block-start:calc(var(--fade-size) + 12px);-webkit-padding-after:var(--fade-size);padding-block-end:var(--fade-size)}.onav--vertical .onav__scroller::after{padding-inline:0 0;padding-block:0 var(--fade-size)}.onav--vertical .onav__items{flex-direction:column;width:-moz-fit-content;width:fit-content}.onav--vertical .onav__items::before{content:"";height:100%;width:var(--indicator-track-size);inset-inline-start:0}.onav--vertical .onav__active-indicator{inset-inline-start:0;-webkit-border-start:solid var(--indicator-size) var(--indicator-color);border-inline-start:solid var(--indicator-size) var(--indicator-color)}.onav--vertical .onav__scroll-button{inset-inline:0}.onav--vertical .onav__scroll-button--start{inset-block-start:0}.onav--vertical .onav__scroll-button--end{inset-block-end:0}';const l=class{watchIsActiveHandler(){this.instantReCalc=true;this.activeItem=this.allActiveItems.find(((t,i)=>this.isActiveHandler(t,i)));setTimeout((()=>this.instantReCalc=false),300)}async syncActiveItem(){this.activeItem=this.allActiveItems.find(((t,i)=>this.isActiveHandler(t,i)))}constructor(i){t(this,i);this.mutationObservers=new WeakMap;this.updateScrollControls=()=>{if(!this.nav)return;this.hasScrollControls=this.nav[this.scrollProp]>this.nav[this.clientDimProp]&&this.nav[this.scrollProp]>this.itemContainer[this.clientDimProp];this.handleScroll()};this.handleScroll=()=>{if(!this.hasScrollControls){this.hideControlStart=this.hideControlEnd=true;return}const t=this.isRtl?this.nav[this.scrollOffset]===0:Math.abs(this.nav[this.clientDimProp]-(this.nav[this.scrollProp]-this.nav[this.scrollOffset]))<2;const i=this.isRtl?Math.abs(this.nav[this.scrollProp]+this.nav[this.scrollOffset]-this.nav[this.clientDimProp])<2:this.nav[this.scrollOffset]===0;if(i){this.hideControlStart=true;this.hideControlEnd=false}else if(t){this.hideControlStart=false;this.hideControlEnd=true}else{this.hideControlEnd=false;this.hideControlStart=false}};this.handleBtnClick=(t=false)=>{const i=this.navDim;let a;if(t)a=this.nav[this.scrollOffset]+i-20;else a=this.nav[this.scrollOffset]-i+20;try{this.nav.scroll({left:this.orientation==="horizontal"?a:0,top:this.orientation==="vertical"?a:0,behavior:"smooth"})}catch(t){this.nav[this.scrollOffset]=a}};this.slotChangeHandler=()=>{if(this.allActiveItems.length<2)return;const t=this.allActiveItems.find(((t,i)=>this.isActiveHandler(t,i)));if(t)this.activeItem=t;this.recalculatePositions();this.allActiveItems.forEach((t=>{if(this.mutationObservers.get(t))return;const i=new MutationObserver((()=>this.syncActiveItemIndicator()));i.observe(t,{characterData:true,childList:true,subtree:true});this.mutationObservers.set(t,i)}))};this.handleClick=t=>{if(this.allActiveItems.length<2)return;const i=t.composedPath().find((t=>this.allActiveItems.includes(t)));if(i)this.activeItem=i};this.handleKeyDown=t=>{if(["Enter"," "].includes(t.key)){const i=t.composedPath().find((t=>this.allActiveItems.includes(t)));if(i)this.activeItem=i}};this.recalculatePositions=()=>{this.updateScrollControls();this.syncActiveItemIndicator();this.scrollToActiveItem()};this.scrollControls=true;this.orientation="horizontal";this.activeHandler=(t,i)=>t.classList.add("active");this.inActiveHandler=(t,i)=>t.classList.remove("active");this.isActiveHandler=(t,i)=>t.classList.contains("active");this.instantReCalc=false;this.hasScrollControls=false;this.hideControlEnd=true;this.hideControlStart=true;this.recalculatePositions=r(this.recalculatePositions.bind(this),80)}get scrollProp(){return this.orientation==="horizontal"?"scrollWidth":"scrollHeight"}get clientDimProp(){return this.orientation==="horizontal"?"clientWidth":"clientHeight"}get scrollOffset(){return this.orientation==="horizontal"?"scrollLeft":"scrollTop"}watchScrollControls(){if(this.hasScrollControls)this.handleScroll();else this.hideControlStart=this.hideControlEnd=true}hideEndBtn(){if(!this.endBtn)return;this.activateBtn(this.endBtn,!this.hideControlEnd)}hideStartBtn(){if(!this.startBtn)return;this.activateBtn(this.startBtn,!this.hideControlStart)}activateBtn(t,i=true){if(!i){t.tabIndex=-1;t.disabled=true;t.classList.remove("is-shown");return}t.tabIndex=0;t.disabled=false;t.classList.add("is-shown")}get allActiveItems(){return this.allItems.filter((t=>!t.disabled||t.classList.contains("disabled")))}get allItems(){return e(this.host,"*",true)}get activeItem(){return this._activeItem}set activeItem(t){if(!t||t===this.activeItem||t.disabled||!this.allActiveItems.includes(t)){return}this._activeItem=t;this.allActiveItems.forEach(((t,i)=>{if(t===this._activeItem)this.activeHandler(t,i);else this.inActiveHandler(t,i)}));this.recalculatePositions()}get navDim(){if(!this.nav)return 0;const t=getComputedStyle(this.nav);let i=this.nav[this.clientDimProp];if(this.orientation==="horizontal"){return i-=parseFloat(t.paddingLeft)+parseFloat(t.paddingRight)}else{return i-=parseFloat(t.paddingTop)+parseFloat(t.paddingBottom)}}scrollToActiveItem(){if(!this.nav||!this.activeItem)return;setTimeout((()=>{this.activeItem.scrollIntoView({behavior:this.instantReCalc?"auto":"smooth",block:"center",inline:"center"})}),100)}syncActiveItemIndicator(){if(!this.activeItem)return;const t=this.activeItem;const i=t.clientWidth||0;const a=t.clientHeight+2||0;const s=o(t,this.itemContainer);if(!this.activeIndicator)return;const e=s.top;const r=s.left;if(this.instantReCalc)this.activeIndicator.style.transition="none";switch(this.orientation){case"horizontal":this.activeIndicator.style.width=`${i}px`;this.activeIndicator.style.height=null;this.activeIndicator.style.transform=`translateX(${r}px)`;break;case"vertical":this.activeIndicator.style.width=null;this.activeIndicator.style.height=`${a}px`;this.activeIndicator.style.transform=`translateY(${e}px)`;break}setTimeout((()=>this.activeIndicator.style.transition=null),400)}connectedCallback(){this.instantReCalc=true;this.isRtl=this.orientation==="horizontal"&&!!this.host.closest('[dir="rtl"]');if(window["MutationObserver"])this.slotChangeHandler();if(!window["ResizeObserver"])return;if(this.ro){this.ro.disconnect();this.ro=undefined}const t=this.ro=new ResizeObserver(this.recalculatePositions);t.observe(this.host)}componentDidLoad(){this.activeItem=this.allActiveItems.find(((t,i)=>this.isActiveHandler(t,i)));this.instantReCalc=false}disconnectedCallback(){if(this.ro){this.ro.disconnect();this.ro=undefined}}render(){return i(a,{dir:this.isRtl?"rtl":null},i("div",{part:"base",class:{onav:true,[`onav--${this.orientation}`]:true,"onav--has-scroll-controls":this.hasScrollControls,"onav--has-scroll-controls-start":!this.hideControlStart,"onav--has-scroll-controls-end":!this.hideControlEnd,"onav--no-transitions":this.instantReCalc},onClick:this.handleClick,onKeyDown:this.handleKeyDown},i("div",{class:"onav__nav"},this.scrollControls&&i("nano-icon-button",{part:"scroll-button scroll-button-prev",class:{"onav__scroll-button":true,"onav__scroll-button--start":true},ref:t=>this.startBtn=t,onClick:()=>this.handleBtnClick(false),label:"Click to scroll",iconName:this.orientation==="horizontal"?"light/chevron-left":"light/chevron-up"}),i("div",{part:"scroller",ref:t=>this.nav=t,class:"onav__scroller",onScroll:this.handleScroll},i("div",{part:"items",ref:t=>this.itemContainer=t,class:"onav__items"},i("div",{part:"indicator",ref:t=>this.activeIndicator=t,class:"onav__active-indicator"}),i("slot",{onSlotchange:this.slotChangeHandler}))),this.scrollControls&&i("nano-icon-button",{part:"scroll-button scroll-button-next",class:{"onav__scroll-button":true,"onav__scroll-button--end":true},ref:t=>this.endBtn=t,onClick:()=>this.handleBtnClick(true),label:"Click to scroll",iconName:this.orientation==="horizontal"?"light/chevron-right":"light/chevron-down"}))))}get host(){return s(this)}static get watchers(){return{isActiveHandler:["watchIsActiveHandler"],hasScrollControls:["watchScrollControls"],hideControlEnd:["hideEndBtn"],hideControlStart:["hideStartBtn"]}}};l.style=n;export{l as nano_overflow_nav};
|
5
|
+
//# sourceMappingURL=p-1b791810.entry.js.map
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
2
|
* Web Components for Nanopore digital Web Apps
|
3
3
|
*/
|
4
|
-
import{r as t,c as i,w as s,h as e,a as n,g as o}from"./p-f6a8467a.js";import{g as a}from"./p-74a7fc4f.js";import{d as h}from"./p-9746b0a5.js";import{g as r}from"./p-257432ff.js";import{g as l}from"./p-58cf5446.js";const c=":host{box-sizing:border-box}*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}:host{--padding-top:var(--nano-spacing-small, 8px);--padding-bottom:var(--nano-spacing-small, 8px);--padding-start:var(--nano-spacing-xlarge, 24px);--padding-end:var(--nano-spacing-xlarge, 24px);--font-size:0.8em;--color:#b5aea7;color:var(--color)}.dlist--isfiltered ::slotted(*:not(nano-option):not([slot=no-result]):not([slot=list-top]):not([slot=list-bottom])){display:none !important}.dlist__dropdown{--min-width:100%;--overflow:auto}.dlist__status{clip:rect(1px, 1px, 1px, 1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);block-size:1px;inline-size:1px;margin:-1px;overflow:hidden;padding:0;position:absolute}.dlist__menu{--padding-top:inherit;--padding-bottom:inherit;--padding-start:inherit;--padding-end:inherit;--font-size:inherit}";function d(t){let i;if(t.id){i=document.querySelector(`label[for='${t.id}']`)}if(!i){i=t.closest("label")}return i}let p=0;const u=class{get allOptEles(){return this._allOptEles}set allOptEles(t){var i;this._allOptEles=t;if((i=this.connectedInput)===null||i===void 0?void 0:i.value)return;t.forEach((t=>{if(t.selected&&!this.selected.includes(t.value)){this.changeInputValue(t)}}))}constructor(s){t(this,s);this.nanoSelect=i(this,"nanoSelect",7);this.nanoDeselect=i(this,"nanoDeselect",7);this.nanoOptionsUpdated=i(this,"nanoOptionsUpdated",7);this.isNanoInput=false;this.typeToSelect="";this.listId=`nano-datalist-${p++}`;this.isFiltered=false;this.shouldFocus=false;this._allOptEles=[];this._dropDownConfig={skidding:-1};this.optSelected=t=>{t.stopPropagation();this.changeInputValue(t.detail);requestAnimationFrame((()=>this.inputChange()));if(this.type!=="selctMulti")this.shouldOpen=false};this.handleShow=async()=>{if(this.shouldFocus){this.shouldFocus=false;this.listBox.setFocus()}else if(this.type==="select")this.listBox.showActiveElement()};this.handleHide=()=>{this.open=false;const t=a();if(t.closest(this.host.tagName.toLowerCase())){this.connectedInput.select()}};this.inputClick=()=>{this.shouldOpen=true;this.manageDropdownDisplay()};this.inputKeydown=t=>{const i=["Shift","ArrowRight","ArrowLeft","Escape","Enter","Tab"];if(i.includes(t.key)){if(t.key==="Tab")this.shouldOpen=false;return}if(this.type==="select"&&!["ArrowDown","ArrowUp"].includes(t.key)&&(t.key!==" "||this.typeToSelectTimeout)){if(t.key===" "||/^[a-z0-9]+$/i.test(t.key)){clearTimeout(this.typeToSelectTimeout);this.typeToSelectTimeout=window.setTimeout((()=>{this.typeToSelect="";this.typeToSelectTimeout=0}),750);this.typeToSelect+=t.key;this.setOptStartsWith()}return}this.shouldOpen=true;this.manageDropdownDisplay();if(["ArrowDown","ArrowUp"].includes(t.key)){t.preventDefault();this.shouldFocus=true}};this.optionKeyDown=t=>{const i=["Shift","ArrowUp","ArrowDown","Escape","Enter","Tab","Space","PageUp","PageDown","Home","End"," "];if(i.includes(t.key)){if(t.key==="Escape")this.connectedInput.focus();return}const s=["Delete","Backspace"];if(this.type!=="select"&&(!this.exactMatch||s.includes(t.key))){this.connectedInput.focus()}};this.actvOptEles=[];this.connectedInput=undefined;this.inputLabel=undefined;this.hasNoResult=undefined;this.shouldOpen=undefined;this.canOpen=true;this.optionIds=[];this.selected=[];this.options=[];this.input=undefined;this.type="input";this.open=false;this.disableFilter=false;this.disabled=false;this.inputChange=h(this.inputChange.bind(this),50)}get dropDownConfig(){return this._dropDownConfig}set dropDownConfig(t){this._dropDownConfig=Object.assign(Object.assign({},this._dropDownConfig),t)}get activeOptions(){return this.allOptEles}openWatcher(){s((()=>{this.nanoDropdown.open=this.open;if(this.connectedInput)this.connectedInput.setAttribute("aria-expanded",this.open.toString())}))}async watchInputChange(){let t;if(t=this.host.closest("nano-input")){this.isNanoInput=true;this.connectedInput=await t.getInputElement()}else if(this.input&&typeof this.input==="string"&&(t=document.querySelector(this.input))){this.isNanoInput=false;this.connectedInput=t}else if(typeof this.input==="object"){this.connectedInput=this.input}}manageSlotChangeListener(){var t;if(!this.host)return;if((!this.options||!this.options.length)&&!this.mo){{const t=this.mo=new MutationObserver((()=>this.processSlottedContent()));t.observe(this.host,{childList:true,subtree:true})}this.processSlottedContent();return}if((t=this.options)===null||t===void 0?void 0:t.length){if(!!this.mo){this.mo.disconnect();this.mo=undefined}const t=this.host.querySelectorAll('[slot="internal-opts"]');s((()=>{var i;if(t===null||t===void 0?void 0:t.length)t.forEach((t=>t.remove()));this.allOptEles=this.options.flatMap(((t,i)=>{if(t.value||t.label){const s=Object.assign(document.createElement("nano-option"),{label:t.label,value:t.value,ariaPosinset:i,ariaSetsize:this.options.length,selected:t.selected,id:this.listId+"-option-"+i,textContent:t.label?t.label:t.value,slot:"internal-opts"});this.host.append(s);return s}}));if(((i=this.connectedInput)===null||i===void 0?void 0:i.value.length)&&this.type!=="select"){this.inputChange()}else{this.actvOptEles=[...this.allOptEles]}}))}}watchTypeChange(){if(!this.connectedInput)return;let t={closeOnSelect:false};let i="both";let s=false;switch(this.type){case"input":t={closeOnSelect:true};break;case"select":i="list";s=true;t={closeOnSelect:true,placement:"center"};break}if(!this.isNanoInput){t.tetherTo=this.connectedInput}this.dropDownConfig=Object.assign(Object.assign({},this.dropDownConfig),t);this.connectedInput.setAttribute("aria-autocomplete",i);this.connectedInput.readOnly=s}manageInputEvents(t,i){var e;if(!!i){const t=i.closest("nano-input");if(t){t.removeEventListener("nanoChange",this.inputChange)}this.removeEventListeners(i);this.inputLabel=null;s((()=>{i.removeAttribute("role");i.removeAttribute("aria-expanded");i.removeAttribute("aria-controls");i.removeAttribute("aria-owns");i.removeAttribute("aria-haspopup");i.removeAttribute("aria-autocomplete");i.removeAttribute("autocomplete")}))}if(!!t){const i=t.closest("nano-input");if(i){i.addEventListener("nanoChange",this.inputChange)}t.addEventListener("change",this.inputChange);t.addEventListener("click",this.inputClick);t.addEventListener("keydown",this.inputKeydown);t.addEventListener("input",this.inputChange);this.listId=this.host.id||this.listId;this.inputLabel=((e=t===null||t===void 0?void 0:t.labels)===null||e===void 0?void 0:e.item(0))||d(t);s((()=>{this.host.id=this.listId;t.setAttribute("role","combobox");t.setAttribute("aria-expanded","false");t.setAttribute("aria-controls",this.listId);t.setAttribute("aria-owns",this.listId);t.setAttribute("aria-haspopup","listbox");t.setAttribute("autocomplete","off")}))}}watchActvOptChange(){var t;let i=0;const e=((t=this.connectedInput)===null||t===void 0?void 0:t.value)||"";const n=[];s((()=>{this.allOptEles.forEach(((t,s)=>{if(this.actvOptEles.includes(t)){i++;t.setAttribute("aria-posinset",i+"");t.setAttribute("aria-setsize",this.actvOptEles.length+"");t.hidden=false;this.isSelected(t,e)}else{t.removeAttribute("aria-posinset");t.removeAttribute("aria-setsize");t.hidden=true;t.selected=false}t.id=this.listId+"-option-"+s;n.push(t.id)}));this.optionIds=n}))}manageCanOpen(){if(this.actvOptEles.length||this.hasNoResult)this.canOpen=true;else this.canOpen=false}manageDropdownDisplay(){if(this.shouldOpen&&this.canOpen&&!this.disabled)this.open=true;if(!this.shouldOpen||!this.canOpen)this.open=false;this.openWatcher()}fireActiveOptsEvent(){this.nanoOptionsUpdated.emit(this.actvOptEles)}isSelected(t,i){if(i===t.value||this.selected.includes(t.value)){t.selected=true}else t.selected=false}get dropwdownOpen(){if(!this.nanoDropdown||!this.open)return false;return true}get exactMatch(){return this.allOptEles.find((t=>this.connectedInput.value===t.value))}changeInputValue(t){var i;let s;if(this.selected.includes(t.value)){this.selected=this.selected.filter((i=>i!==t.value));s=this.nanoDeselect.emit(t)}else{this.selected=[...this.selected];s=this.nanoSelect.emit(t)}if(!s.defaultPrevented){if(this.connectedInput)this.connectedInput.value=t.value;const s=new window.Event("change");(i=this.connectedInput)===null||i===void 0?void 0:i.dispatchEvent(s)}}setOptStartsWith(){const t=t=>t.toLowerCase().substring(0,this.typeToSelect.length)===this.typeToSelect;const i=this.allOptEles.find((i=>i.value.trim().length>0&&!i.disabled&&(t(i.textContent)||t(i.value)||t(i.label)||t(i.filterMeta))));if(i)this.changeInputValue(i)}removeEventListeners(t){const i=t.closest("nano-input");if(i){i.removeEventListener("nanoChange",this.inputChange)}t.removeEventListener("change",this.inputChange);t.removeEventListener("click",this.inputClick);t.removeEventListener("keydown",this.inputKeydown);t.removeEventListener("input",this.inputChange)}processSlottedContent(){requestAnimationFrame((()=>{var t;this.allOptEles=Array.from(this.host.querySelectorAll("nano-option"));this.hasNoResult=!!this.host.querySelector('[slot="no-result"]');if(((t=this.connectedInput)===null||t===void 0?void 0:t.value.length)&&this.type!=="select"){this.inputChange()}else this.actvOptEles=this.allOptEles}))}inputChange(){if(this.disableFilter){this.actvOptEles=this.allOptEles;return}const t=this.connectedInput.value;const i=t.trim().toLowerCase();let s=false;const e=[];const n=t=>t.toLowerCase().indexOf(i)>-1;this.allOptEles.forEach((i=>{if((t===i.value||t===i.label)&&this.type!=="selctMulti"){i.selected=true;s=true}else this.isSelected(i,t)}));this.allOptEles.forEach((t=>{if(!i.length||s){e.push(t)}else if(t.value.trim().length>0&&!t.disabled&&(n(t.textContent)||n(t.value)||n(t.label)||n(t.filterMeta))){e.push(t)}}));this.isFiltered=i.length&&!s;this.actvOptEles=e}connectedCallback(){this.watchInputChange()}componentDidLoad(){this.manageSlotChangeListener();this.openWatcher()}componentDidRender(){setTimeout((()=>{if(!this.connectedInput)console.warn("no `nano-input` found. `nano-datalist` should be nested within an `nano-input` or linked via `input` prop",this.host)}),500)}disconnectedCallback(){if(!!this.mo){this.mo.disconnect();this.mo=undefined}if(this.connectedInput)this.removeEventListeners(this.connectedInput)}render(){return e(n,{role:this.actvOptEles.length?"listbox":undefined,"aria-owns":this.optionIds.length?this.optionIds.join(" "):undefined,"aria-label":this.optionIds.length?"Select options from the list below":undefined},e("nano-dropdown",Object.assign({},this.dropDownConfig,{ref:t=>this.nanoDropdown=t,dialogTitle:"Select options from the list below",class:{dlist__dropdown:true,"dlist--isfiltered":this.isFiltered},onNanoAfterShow:this.handleShow,onNanoAfterHide:this.handleHide,role:"group"}),e("nano-menu",{hidden:!this.actvOptEles.length,type:"listbox",label:this.inputLabel?this.inputLabel.textContent:undefined,class:{dlist__menu:true,"dlist__menu--open":this.dropwdownOpen},tabIndex:-1,onNanoSelect:this.optSelected,onKeyDown:this.optionKeyDown,ref:t=>this.listBox=t,role:"list"},e("slot",{name:"list-top"}),!this.options.length&&e("slot",null),!!this.options.length&&e("slot",{name:"internal-opts"}),e("slot",{name:"list-bottom"})),e("nano-menu",{type:"listbox",label:"No results found",hidden:!!this.actvOptEles.length,class:{dlist__menu:true,"dlist__menu--open":this.dropwdownOpen}},e("slot",{name:"no-result"})),!!this.actvOptEles&&e("div",{class:"dlist__status"},this.actvOptEles.length," result",this.actvOptEles.length>1?"s":""," available.")))}get host(){return o(this)}static get watchers(){return{open:["openWatcher"],input:["watchInputChange"],options:["manageSlotChangeListener"],type:["watchTypeChange"],connectedInput:["watchTypeChange","manageInputEvents"],selected:["watchActvOptChange"],actvOptEles:["watchActvOptChange","manageCanOpen","fireActiveOptsEvent"],hasNoResult:["manageCanOpen"],shouldOpen:["manageDropdownDisplay"],canOpen:["manageDropdownDisplay"]}}};u.style=c;const f=":host{box-sizing:border-box}*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}:host{--padding-start:var(--nano-spacing-medium, 16px);--padding-end:var(--nano-spacing-medium, 16px);--padding-top:var(--nano-spacing-small, 8px);--padding-bottom:var(--nano-spacing-small, 8px);--secondary-padding-top:0;--secondary-padding-bottom:0;--bg-color-hover:#f2f7f9;--bg-color-focus:#f2f7f9;--bg-color-selected:#f2f7f9;--color-hover:#007495;--color-selected:#007495;--color-focus:#007495;--focus-outline:none;--font-size:0.9em;display:block}.menu{font-size:var(--font-size, 0.9em);overscroll-behavior:none;min-width:var(--width);position:relative}.menu:focus{outline:none}::slotted(*:not(nano-nav-item):not(nano-option):not(hr):not(slot)){padding-inline:var(--padding-start) var(--padding-end);padding-block:var(--padding-top) var(--padding-bottom);display:block}";const g=class{constructor(s){t(this,s);this.nanoFocus=i(this,"nanoFocus",7);this.nanoBlur=i(this,"nanoBlur",7);this.nanoSelect=i(this,"nanoSelect",7);this.ignoreMouseEvents=false;this.typeToSelect="";this._hasFocus=false;this.handleFocus=()=>{this.setActiveFocusItem(this.selectedItem||this.getItems[0]);this._hasFocus=true;this.nanoFocus.emit()};this.handleClick=t=>{const i=t.target;const s=i.closest("nano-nav-item");if(s&&!s.disabled){this.nanoSelect.emit(s)}};this.handleKeyDown=t=>{clearTimeout(this.ignoreMouseTimeout);this.ignoreMouseTimeout=setTimeout((()=>this.ignoreMouseEvents=false),500);this.ignoreMouseEvents=true;switch(t.key){case" ":if(this.activeItem)this.activeItem.click();break;case"ArrowDown":case"ArrowUp":case"PageDown":case"PageUp":case"Home":case"End":const i=this.getItems;const s=this.activeItem;let e=i.indexOf(s);if(i.length){t.preventDefault();if(t.key==="ArrowDown"){e++}else if(t.key==="ArrowUp"){e--}else if(t.key==="Home"||t.key==="PageUp"){e=0}else if(t.key==="End"||t.key==="PageDown"){e=i.length-1}if(e<0)e=i.length-1;if(e>i.length-1)e=0;this.setActiveFocusItem(i[e]);if(i[e])i[e].scrollIntoView({block:"nearest"});return}break}if(t.key===" "||/^[a-z0-9]+$/i.test(t.key)){clearTimeout(this.typeToSelectTimeout);this.typeToSelectTimeout=setTimeout((()=>this.typeToSelect=""),750);this.typeToSelect+=t.key;const i=this.getItems;for(const t of i){const i=t.shadowRoot.querySelector("slot:not([name])");const s=l(i).toLowerCase().trim();if(s.substring(0,this.typeToSelect.length)===this.typeToSelect){this.setActiveFocusItem(t);break}}}};this.handleMouseOver=t=>{const i=t.target;const s=i.closest("nano-nav-item")||i.closest("nano-option");if(s&&!this.ignoreMouseEvents){this.setActiveFocusItem(s)}};this.type="menu";this.label=undefined}get hasFocus(){return this._hasFocus}async setFocus(){var t;if((t=this.menu)===null||t===void 0?void 0:t.focus)this.menu.focus({preventScroll:true})}async removeFocus(){var t;if((t=this.menu)===null||t===void 0?void 0:t.blur)this.menu.blur()}async showActiveElement(){if(this.selectedItem)this.selectedItem.scrollIntoView({block:"nearest"})}async resetActiveItem(){this.getItems.filter((t=>t.tagName.toLowerCase()==="nano-option")).map((t=>t.setAttribute("tabindex","-1")))}get getItems(){let t;const i=this.el.querySelectorAll("nano-nav-item.secondary-open");if(i.length){const s=i[i.length-1];t=Array.from(s.querySelectorAll("nano-nav-item, nano-option"))}else{t=r(this.el,"nano-nav-item, nano-option","slot")}return t.filter((t=>!t.disabled&&!t.hidden))}get activeItem(){const t=a();return this.getItems.find((i=>i.getAttribute("tabindex")==="0"||i===t||i.classList.contains("has-focus")))}get selectedItem(){return this.getItems.find((t=>t.selected))}async setActiveFocusItem(t,i=true){const s=this.getItems;const e=!t||t.disabled?s.find((t=>t.selected))||s[0]:t;s.filter((t=>t.tagName.toLowerCase()==="nano-option")).map((t=>t.setAttribute("tabindex",t===e?"0":"-1")));if(!i)return;if(e){e.setFocus?e.setFocus():e.focus()}else this.menu.focus()}handleBlur(t){if(!this.hasFocus)return;const i=t;let s;if(i.key){if(i.key!=="Tab")return;s=a()&&a().closest(this.el.tagName.toLowerCase())===this.el}else s=!!t.composedPath().find((t=>t===this.el));if(!s){this.resetActiveItem();this._hasFocus=false;this.nanoBlur.emit()}}componentDidLoad(){{r(this.el,":not(nano-nav-item):not(nano-option):not([role])",true).forEach((t=>t.setAttribute("role","none")))}}render(){return e(n,{role:this.type==="menu"?"menu":"group"},e("div",{onClick:this.handleClick,onKeyDown:this.handleKeyDown,onMouseOver:this.handleMouseOver,onFocus:this.handleFocus,"aria-label":this.label?this.label:undefined,ref:t=>this.menu=t,part:"base",class:{menu:true,["menu--"+this.type]:true,"menu--has-focus":this.hasFocus},tabIndex:-1,role:"group"},e("slot",null)))}get el(){return o(this)}};g.style=f;const m=":host{box-sizing:border-box}*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}:host{--bg:none;--bg-selected:var(--nano-select-opt-bg, #f2f7f9);--bg-focus:var(--nano-color-base, var(--nano-color-primary-tint, #2689a5));--bg-disabled:none;--color:var(--input-text-color, var(--nano-input-text-color, #4a4a4a));--color-selected:var(--nano-color-base, var(--nano-color-primary, #007495));--color-focus:var(--nano-color-contrast, var(--nano-color-primary-contrast, #fff));--color-disabled:#b5aea7;--opt-icon-size:1.6em;display:block;color:var(--color);overflow:hidden;font-size:14px;font-size:clamp(12px, .9em, 16px)}:host(:focus){outline:none}.option{position:relative;-webkit-user-select:none;user-select:none;cursor:pointer;display:flex;align-items:stretch;width:100%;background:var(--bg);padding-inline:var(--padding-start) var(--padding-end);padding-block:var(--padding-top) var(--padding-bottom)}:host(:focus) .option:not(.option--disabled),:host .option.option--selected{outline:none;background:var(--bg-selected);color:var(--color-selected)}:host(:focus) .option:not(.option--disabled){background:var(--bg-focus);color:var(--color-focus)}.option.option--disabled{outline:none;color:var(--color-disabled);cursor:not-allowed;background:var(--bg-disabled)}.option.option--novalue{font-style:italic;opacity:0.7}.option__label{flex:1 1 auto;display:flex;align-items:center}.option__start{flex:0 0 auto;display:flex;align-items:center}.option__start ::slotted(nano-icon){font-size:var(--opt-icon-size)}.option__start ::slotted(:last-child){-webkit-margin-end:0.5em;margin-inline-end:0.5em}.option__end{flex:0 0 auto;display:flex;align-items:center}.option__end ::slotted(nano-icon){font-size:var(--opt-icon-size)}.option__end ::slotted(:first-child){-webkit-margin-start:0.5em;margin-inline-start:0.5em}.option__check{visibility:hidden;display:flex;position:absolute;inset-inline-start:0.6em;inset-block-start:calc(50% - 0.6em);align-items:center;font-size:0.9em}.option--selected:not(.option--novalue) .option__check{visibility:visible}";let b=0;const v=class{constructor(s){t(this,s);this.nanoSelect=i(this,"nanoSelect",7);this.optId=`nano-option-${b++}`;this.hasFocus=false;this.value="";this.label="";this.selected=false;this.disabled=false;this.filterMeta="";this.handleClick=h(this.handleClick.bind(this),5)}valueChanged(){if(!this.value||!this.value.length)this.value=this.labelContent}labelChanged(){if(!this.label||!this.label.length)this.label=this.labelContent.length?this.labelContent:this.value}handleKeyDown(t){if(t.key!==" "&&t.key!=="Enter")return;t.preventDefault();this.nanoSelect.emit(this.host)}handleClick(){if(this.disabled)return;this.nanoSelect.emit(this.host)}get labelContent(){return r(this.host,"*:not([slot])",false).map((t=>t.textContent)).join(" ").trim()}componentWillLoad(){this.valueChanged();this.labelChanged()}render(){return e(n,{role:"option","aria-selected":this.selected?"true":"false","aria-disabled":this.disabled?"true":"false"},e("div",{onMouseDown:this.handleClick,id:this.optId,class:{option:true,"option--selected":this.selected,"option--disabled":this.disabled,"option--novalue":!this.value}},e("div",{part:"check-icon",class:"option__check"},e("slot",{name:"check-icon"},e("nano-icon",{name:"light/check","aria-hidden":"true"}))),e("div",{part:"start",class:"option__start"},e("slot",{name:"start"})),e("div",{part:"label",class:"option__label"},e("slot",null,this.label||this.value)),e("div",{part:"end",class:"option__end"},e("slot",{name:"end"}))))}get host(){return o(this)}static get watchers(){return{value:["valueChanged"],label:["labelChanged"]}}};v.style=m;export{u as nano_datalist,g as nano_menu,v as nano_option};
|
5
|
-
//# sourceMappingURL=p-
|
4
|
+
import{r as t,c as i,w as s,h as e,a as n,g as o}from"./p-f6a8467a.js";import{g as a}from"./p-74a7fc4f.js";import{d as h}from"./p-7bff5224.js";import{g as r}from"./p-257432ff.js";import{g as l}from"./p-58cf5446.js";const c=":host{box-sizing:border-box}*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}:host{--padding-top:var(--nano-spacing-small, 8px);--padding-bottom:var(--nano-spacing-small, 8px);--padding-start:var(--nano-spacing-xlarge, 24px);--padding-end:var(--nano-spacing-xlarge, 24px);--font-size:0.8em;--color:#b5aea7;color:var(--color)}.dlist--isfiltered ::slotted(*:not(nano-option):not([slot=no-result]):not([slot=list-top]):not([slot=list-bottom])){display:none !important}.dlist__dropdown{--min-width:100%;--overflow:auto}.dlist__status{clip:rect(1px, 1px, 1px, 1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);block-size:1px;inline-size:1px;margin:-1px;overflow:hidden;padding:0;position:absolute}.dlist__menu{--padding-top:inherit;--padding-bottom:inherit;--padding-start:inherit;--padding-end:inherit;--font-size:inherit}";function d(t){let i;if(t.id){i=document.querySelector(`label[for='${t.id}']`)}if(!i){i=t.closest("label")}return i}let p=0;const u=class{get allOptEles(){return this._allOptEles}set allOptEles(t){var i;this._allOptEles=t;if((i=this.connectedInput)===null||i===void 0?void 0:i.value)return;t.forEach((t=>{if(t.selected&&!this.selected.includes(t.value)){this.changeInputValue(t)}}))}constructor(s){t(this,s);this.nanoSelect=i(this,"nanoSelect",7);this.nanoDeselect=i(this,"nanoDeselect",7);this.nanoOptionsUpdated=i(this,"nanoOptionsUpdated",7);this.isNanoInput=false;this.typeToSelect="";this.listId=`nano-datalist-${p++}`;this.isFiltered=false;this.shouldFocus=false;this._allOptEles=[];this._dropDownConfig={skidding:-1};this.optSelected=t=>{t.stopPropagation();this.changeInputValue(t.detail);requestAnimationFrame((()=>this.inputChange()));if(this.type!=="selctMulti")this.shouldOpen=false};this.handleShow=async()=>{if(this.shouldFocus){this.shouldFocus=false;this.listBox.setFocus()}else if(this.type==="select")this.listBox.showActiveElement()};this.handleHide=()=>{this.open=false;const t=a();if(t.closest(this.host.tagName.toLowerCase())){this.connectedInput.select()}};this.inputClick=()=>{this.shouldOpen=true;this.manageDropdownDisplay()};this.inputKeydown=t=>{const i=["Shift","ArrowRight","ArrowLeft","Escape","Enter","Tab"];if(i.includes(t.key)){if(t.key==="Tab")this.shouldOpen=false;return}if(this.type==="select"&&!["ArrowDown","ArrowUp"].includes(t.key)&&(t.key!==" "||this.typeToSelectTimeout)){if(t.key===" "||/^[a-z0-9]+$/i.test(t.key)){clearTimeout(this.typeToSelectTimeout);this.typeToSelectTimeout=window.setTimeout((()=>{this.typeToSelect="";this.typeToSelectTimeout=0}),750);this.typeToSelect+=t.key;this.setOptStartsWith()}return}this.shouldOpen=true;this.manageDropdownDisplay();if(["ArrowDown","ArrowUp"].includes(t.key)){t.preventDefault();this.shouldFocus=true}};this.optionKeyDown=t=>{const i=["Shift","ArrowUp","ArrowDown","Escape","Enter","Tab","Space","PageUp","PageDown","Home","End"," "];if(i.includes(t.key)){if(t.key==="Escape")this.connectedInput.focus();return}const s=["Delete","Backspace"];if(this.type!=="select"&&(!this.exactMatch||s.includes(t.key))){this.connectedInput.focus()}};this.actvOptEles=[];this.connectedInput=undefined;this.inputLabel=undefined;this.hasNoResult=undefined;this.shouldOpen=undefined;this.canOpen=true;this.optionIds=[];this.selected=[];this.options=[];this.input=undefined;this.type="input";this.open=false;this.disableFilter=false;this.disabled=false;this.inputChange=h(this.inputChange.bind(this),50)}get dropDownConfig(){return this._dropDownConfig}set dropDownConfig(t){this._dropDownConfig=Object.assign(Object.assign({},this._dropDownConfig),t)}get activeOptions(){return this.allOptEles}openWatcher(){s((()=>{this.nanoDropdown.open=this.open;if(this.connectedInput)this.connectedInput.setAttribute("aria-expanded",this.open.toString())}))}async watchInputChange(){let t;if(t=this.host.closest("nano-input")){this.isNanoInput=true;this.connectedInput=await t.getInputElement()}else if(this.input&&typeof this.input==="string"&&(t=document.querySelector(this.input))){this.isNanoInput=false;this.connectedInput=t}else if(typeof this.input==="object"){this.connectedInput=this.input}}manageSlotChangeListener(){var t;if(!this.host)return;if((!this.options||!this.options.length)&&!this.mo){{const t=this.mo=new MutationObserver((()=>this.processSlottedContent()));t.observe(this.host,{childList:true,subtree:true})}this.processSlottedContent();return}if((t=this.options)===null||t===void 0?void 0:t.length){if(!!this.mo){this.mo.disconnect();this.mo=undefined}const t=this.host.querySelectorAll('[slot="internal-opts"]');s((()=>{var i;if(t===null||t===void 0?void 0:t.length)t.forEach((t=>t.remove()));this.allOptEles=this.options.flatMap(((t,i)=>{if(t.value||t.label){const s=Object.assign(document.createElement("nano-option"),{label:t.label,value:t.value,ariaPosinset:i,ariaSetsize:this.options.length,selected:t.selected,id:this.listId+"-option-"+i,textContent:t.label?t.label:t.value,slot:"internal-opts"});this.host.append(s);return s}}));if(((i=this.connectedInput)===null||i===void 0?void 0:i.value.length)&&this.type!=="select"){this.inputChange()}else{this.actvOptEles=[...this.allOptEles]}}))}}watchTypeChange(){if(!this.connectedInput)return;let t={closeOnSelect:false};let i="both";let s=false;switch(this.type){case"input":t={closeOnSelect:true};break;case"select":i="list";s=true;t={closeOnSelect:true,placement:"center"};break}if(!this.isNanoInput){t.tetherTo=this.connectedInput}this.dropDownConfig=Object.assign(Object.assign({},this.dropDownConfig),t);this.connectedInput.setAttribute("aria-autocomplete",i);this.connectedInput.readOnly=s}manageInputEvents(t,i){var e;if(!!i){const t=i.closest("nano-input");if(t){t.removeEventListener("nanoChange",this.inputChange)}this.removeEventListeners(i);this.inputLabel=null;s((()=>{i.removeAttribute("role");i.removeAttribute("aria-expanded");i.removeAttribute("aria-controls");i.removeAttribute("aria-owns");i.removeAttribute("aria-haspopup");i.removeAttribute("aria-autocomplete");i.removeAttribute("autocomplete")}))}if(!!t){const i=t.closest("nano-input");if(i){i.addEventListener("nanoChange",this.inputChange)}t.addEventListener("change",this.inputChange);t.addEventListener("click",this.inputClick);t.addEventListener("keydown",this.inputKeydown);t.addEventListener("input",this.inputChange);this.listId=this.host.id||this.listId;this.inputLabel=((e=t===null||t===void 0?void 0:t.labels)===null||e===void 0?void 0:e.item(0))||d(t);s((()=>{this.host.id=this.listId;t.setAttribute("role","combobox");t.setAttribute("aria-expanded","false");t.setAttribute("aria-controls",this.listId);t.setAttribute("aria-owns",this.listId);t.setAttribute("aria-haspopup","listbox");t.setAttribute("autocomplete","off")}))}}watchActvOptChange(){var t;let i=0;const e=((t=this.connectedInput)===null||t===void 0?void 0:t.value)||"";const n=[];s((()=>{this.allOptEles.forEach(((t,s)=>{if(this.actvOptEles.includes(t)){i++;t.setAttribute("aria-posinset",i+"");t.setAttribute("aria-setsize",this.actvOptEles.length+"");t.hidden=false;this.isSelected(t,e)}else{t.removeAttribute("aria-posinset");t.removeAttribute("aria-setsize");t.hidden=true;t.selected=false}t.id=this.listId+"-option-"+s;n.push(t.id)}));this.optionIds=n}))}manageCanOpen(){if(this.actvOptEles.length||this.hasNoResult)this.canOpen=true;else this.canOpen=false}manageDropdownDisplay(){if(this.shouldOpen&&this.canOpen&&!this.disabled)this.open=true;if(!this.shouldOpen||!this.canOpen)this.open=false;this.openWatcher()}fireActiveOptsEvent(){this.nanoOptionsUpdated.emit(this.actvOptEles)}isSelected(t,i){if(i===t.value||this.selected.includes(t.value)){t.selected=true}else t.selected=false}get dropwdownOpen(){if(!this.nanoDropdown||!this.open)return false;return true}get exactMatch(){return this.allOptEles.find((t=>this.connectedInput.value===t.value))}changeInputValue(t){var i;let s;if(this.selected.includes(t.value)){this.selected=this.selected.filter((i=>i!==t.value));s=this.nanoDeselect.emit(t)}else{this.selected=[...this.selected];s=this.nanoSelect.emit(t)}if(!s.defaultPrevented){if(this.connectedInput)this.connectedInput.value=t.value;const s=new window.Event("change");(i=this.connectedInput)===null||i===void 0?void 0:i.dispatchEvent(s)}}setOptStartsWith(){const t=t=>t.toLowerCase().substring(0,this.typeToSelect.length)===this.typeToSelect;const i=this.allOptEles.find((i=>i.value.trim().length>0&&!i.disabled&&(t(i.textContent)||t(i.value)||t(i.label)||t(i.filterMeta))));if(i)this.changeInputValue(i)}removeEventListeners(t){const i=t.closest("nano-input");if(i){i.removeEventListener("nanoChange",this.inputChange)}t.removeEventListener("change",this.inputChange);t.removeEventListener("click",this.inputClick);t.removeEventListener("keydown",this.inputKeydown);t.removeEventListener("input",this.inputChange)}processSlottedContent(){requestAnimationFrame((()=>{var t;this.allOptEles=Array.from(this.host.querySelectorAll("nano-option"));this.hasNoResult=!!this.host.querySelector('[slot="no-result"]');if(((t=this.connectedInput)===null||t===void 0?void 0:t.value.length)&&this.type!=="select"){this.inputChange()}else this.actvOptEles=this.allOptEles}))}inputChange(){if(this.disableFilter){this.actvOptEles=this.allOptEles;return}const t=this.connectedInput.value;const i=t.trim().toLowerCase();let s=false;const e=[];const n=t=>t.toLowerCase().indexOf(i)>-1;this.allOptEles.forEach((i=>{if((t===i.value||t===i.label)&&this.type!=="selctMulti"){i.selected=true;s=true}else this.isSelected(i,t)}));this.allOptEles.forEach((t=>{if(!i.length||s){e.push(t)}else if(t.value.trim().length>0&&!t.disabled&&(n(t.textContent)||n(t.value)||n(t.label)||n(t.filterMeta))){e.push(t)}}));this.isFiltered=i.length&&!s;this.actvOptEles=e}connectedCallback(){this.watchInputChange()}componentDidLoad(){this.manageSlotChangeListener();this.openWatcher()}componentDidRender(){setTimeout((()=>{if(!this.connectedInput)console.warn("no `nano-input` found. `nano-datalist` should be nested within an `nano-input` or linked via `input` prop",this.host)}),500)}disconnectedCallback(){if(!!this.mo){this.mo.disconnect();this.mo=undefined}if(this.connectedInput)this.removeEventListeners(this.connectedInput)}render(){return e(n,{role:this.actvOptEles.length?"listbox":undefined,"aria-owns":this.optionIds.length?this.optionIds.join(" "):undefined,"aria-label":this.optionIds.length?"Select options from the list below":undefined},e("nano-dropdown",Object.assign({},this.dropDownConfig,{ref:t=>this.nanoDropdown=t,dialogTitle:"Select options from the list below",class:{dlist__dropdown:true,"dlist--isfiltered":this.isFiltered},onNanoAfterShow:this.handleShow,onNanoAfterHide:this.handleHide,role:"group"}),e("nano-menu",{hidden:!this.actvOptEles.length,type:"listbox",label:this.inputLabel?this.inputLabel.textContent:undefined,class:{dlist__menu:true,"dlist__menu--open":this.dropwdownOpen},tabIndex:-1,onNanoSelect:this.optSelected,onKeyDown:this.optionKeyDown,ref:t=>this.listBox=t,role:"list"},e("slot",{name:"list-top"}),!this.options.length&&e("slot",null),!!this.options.length&&e("slot",{name:"internal-opts"}),e("slot",{name:"list-bottom"})),e("nano-menu",{type:"listbox",label:"No results found",hidden:!!this.actvOptEles.length,class:{dlist__menu:true,"dlist__menu--open":this.dropwdownOpen}},e("slot",{name:"no-result"})),!!this.actvOptEles&&e("div",{class:"dlist__status"},this.actvOptEles.length," result",this.actvOptEles.length>1?"s":""," available.")))}get host(){return o(this)}static get watchers(){return{open:["openWatcher"],input:["watchInputChange"],options:["manageSlotChangeListener"],type:["watchTypeChange"],connectedInput:["watchTypeChange","manageInputEvents"],selected:["watchActvOptChange"],actvOptEles:["watchActvOptChange","manageCanOpen","fireActiveOptsEvent"],hasNoResult:["manageCanOpen"],shouldOpen:["manageDropdownDisplay"],canOpen:["manageDropdownDisplay"]}}};u.style=c;const f=":host{box-sizing:border-box}*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}:host{--padding-start:var(--nano-spacing-medium, 16px);--padding-end:var(--nano-spacing-medium, 16px);--padding-top:var(--nano-spacing-small, 8px);--padding-bottom:var(--nano-spacing-small, 8px);--secondary-padding-top:0;--secondary-padding-bottom:0;--bg-color-hover:#f2f7f9;--bg-color-focus:#f2f7f9;--bg-color-selected:#f2f7f9;--color-hover:#007495;--color-selected:#007495;--color-focus:#007495;--focus-outline:none;--font-size:0.9em;display:block}.menu{font-size:var(--font-size, 0.9em);overscroll-behavior:none;min-width:var(--width);position:relative}.menu:focus{outline:none}::slotted(*:not(nano-nav-item):not(nano-option):not(hr):not(slot)){padding-inline:var(--padding-start) var(--padding-end);padding-block:var(--padding-top) var(--padding-bottom);display:block}";const g=class{constructor(s){t(this,s);this.nanoFocus=i(this,"nanoFocus",7);this.nanoBlur=i(this,"nanoBlur",7);this.nanoSelect=i(this,"nanoSelect",7);this.ignoreMouseEvents=false;this.typeToSelect="";this._hasFocus=false;this.handleFocus=()=>{this.setActiveFocusItem(this.selectedItem||this.getItems[0]);this._hasFocus=true;this.nanoFocus.emit()};this.handleClick=t=>{const i=t.target;const s=i.closest("nano-nav-item");if(s&&!s.disabled){this.nanoSelect.emit(s)}};this.handleKeyDown=t=>{clearTimeout(this.ignoreMouseTimeout);this.ignoreMouseTimeout=setTimeout((()=>this.ignoreMouseEvents=false),500);this.ignoreMouseEvents=true;switch(t.key){case" ":if(this.activeItem)this.activeItem.click();break;case"ArrowDown":case"ArrowUp":case"PageDown":case"PageUp":case"Home":case"End":const i=this.getItems;const s=this.activeItem;let e=i.indexOf(s);if(i.length){t.preventDefault();if(t.key==="ArrowDown"){e++}else if(t.key==="ArrowUp"){e--}else if(t.key==="Home"||t.key==="PageUp"){e=0}else if(t.key==="End"||t.key==="PageDown"){e=i.length-1}if(e<0)e=i.length-1;if(e>i.length-1)e=0;this.setActiveFocusItem(i[e]);if(i[e])i[e].scrollIntoView({block:"nearest"});return}break}if(t.key===" "||/^[a-z0-9]+$/i.test(t.key)){clearTimeout(this.typeToSelectTimeout);this.typeToSelectTimeout=setTimeout((()=>this.typeToSelect=""),750);this.typeToSelect+=t.key;const i=this.getItems;for(const t of i){const i=t.shadowRoot.querySelector("slot:not([name])");const s=l(i).toLowerCase().trim();if(s.substring(0,this.typeToSelect.length)===this.typeToSelect){this.setActiveFocusItem(t);break}}}};this.handleMouseOver=t=>{const i=t.target;const s=i.closest("nano-nav-item")||i.closest("nano-option");if(s&&!this.ignoreMouseEvents){this.setActiveFocusItem(s)}};this.type="menu";this.label=undefined}get hasFocus(){return this._hasFocus}async setFocus(){var t;if((t=this.menu)===null||t===void 0?void 0:t.focus)this.menu.focus({preventScroll:true})}async removeFocus(){var t;if((t=this.menu)===null||t===void 0?void 0:t.blur)this.menu.blur()}async showActiveElement(){if(this.selectedItem)this.selectedItem.scrollIntoView({block:"nearest"})}async resetActiveItem(){this.getItems.filter((t=>t.tagName.toLowerCase()==="nano-option")).map((t=>t.setAttribute("tabindex","-1")))}get getItems(){let t;const i=this.el.querySelectorAll("nano-nav-item.secondary-open");if(i.length){const s=i[i.length-1];t=Array.from(s.querySelectorAll("nano-nav-item, nano-option"))}else{t=r(this.el,"nano-nav-item, nano-option","slot")}return t.filter((t=>!t.disabled&&!t.hidden))}get activeItem(){const t=a();return this.getItems.find((i=>i.getAttribute("tabindex")==="0"||i===t||i.classList.contains("has-focus")))}get selectedItem(){return this.getItems.find((t=>t.selected))}async setActiveFocusItem(t,i=true){const s=this.getItems;const e=!t||t.disabled?s.find((t=>t.selected))||s[0]:t;s.filter((t=>t.tagName.toLowerCase()==="nano-option")).map((t=>t.setAttribute("tabindex",t===e?"0":"-1")));if(!i)return;if(e){e.setFocus?e.setFocus():e.focus()}else this.menu.focus()}handleBlur(t){if(!this.hasFocus)return;const i=t;let s;if(i.key){if(i.key!=="Tab")return;s=a()&&a().closest(this.el.tagName.toLowerCase())===this.el}else s=!!t.composedPath().find((t=>t===this.el));if(!s){this.resetActiveItem();this._hasFocus=false;this.nanoBlur.emit()}}componentDidLoad(){{r(this.el,":not(nano-nav-item):not(nano-option):not([role])",true).forEach((t=>t.setAttribute("role","none")))}}render(){return e(n,{role:this.type==="menu"?"menu":"group"},e("div",{onClick:this.handleClick,onKeyDown:this.handleKeyDown,onMouseOver:this.handleMouseOver,onFocus:this.handleFocus,"aria-label":this.label?this.label:undefined,ref:t=>this.menu=t,part:"base",class:{menu:true,["menu--"+this.type]:true,"menu--has-focus":this.hasFocus},tabIndex:-1,role:"group"},e("slot",null)))}get el(){return o(this)}};g.style=f;const m=":host{box-sizing:border-box}*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}:host{--bg:none;--bg-selected:var(--nano-select-opt-bg, #f2f7f9);--bg-focus:var(--nano-color-base, var(--nano-color-primary-tint, #2689a5));--bg-disabled:none;--color:var(--input-text-color, var(--nano-input-text-color, #4a4a4a));--color-selected:var(--nano-color-base, var(--nano-color-primary, #007495));--color-focus:var(--nano-color-contrast, var(--nano-color-primary-contrast, #fff));--color-disabled:#b5aea7;--opt-icon-size:1.6em;display:block;color:var(--color);overflow:hidden;font-size:14px;font-size:clamp(12px, .9em, 16px)}:host(:focus){outline:none}.option{position:relative;-webkit-user-select:none;user-select:none;cursor:pointer;display:flex;align-items:stretch;width:100%;background:var(--bg);padding-inline:var(--padding-start) var(--padding-end);padding-block:var(--padding-top) var(--padding-bottom)}:host(:focus) .option:not(.option--disabled),:host .option.option--selected{outline:none;background:var(--bg-selected);color:var(--color-selected)}:host(:focus) .option:not(.option--disabled){background:var(--bg-focus);color:var(--color-focus)}.option.option--disabled{outline:none;color:var(--color-disabled);cursor:not-allowed;background:var(--bg-disabled)}.option.option--novalue{font-style:italic;opacity:0.7}.option__label{flex:1 1 auto;display:flex;align-items:center}.option__start{flex:0 0 auto;display:flex;align-items:center}.option__start ::slotted(nano-icon){font-size:var(--opt-icon-size)}.option__start ::slotted(:last-child){-webkit-margin-end:0.5em;margin-inline-end:0.5em}.option__end{flex:0 0 auto;display:flex;align-items:center}.option__end ::slotted(nano-icon){font-size:var(--opt-icon-size)}.option__end ::slotted(:first-child){-webkit-margin-start:0.5em;margin-inline-start:0.5em}.option__check{visibility:hidden;display:flex;position:absolute;inset-inline-start:0.6em;inset-block-start:calc(50% - 0.6em);align-items:center;font-size:0.9em}.option--selected:not(.option--novalue) .option__check{visibility:visible}";let b=0;const v=class{constructor(s){t(this,s);this.nanoSelect=i(this,"nanoSelect",7);this.optId=`nano-option-${b++}`;this.hasFocus=false;this.value="";this.label="";this.selected=false;this.disabled=false;this.filterMeta="";this.handleClick=h(this.handleClick.bind(this),5)}valueChanged(){if(!this.value||!this.value.length)this.value=this.labelContent}labelChanged(){if(!this.label||!this.label.length)this.label=this.labelContent.length?this.labelContent:this.value}handleKeyDown(t){if(t.key!==" "&&t.key!=="Enter")return;t.preventDefault();this.nanoSelect.emit(this.host)}handleClick(){if(this.disabled)return;this.nanoSelect.emit(this.host)}get labelContent(){return r(this.host,"*:not([slot])",false).map((t=>t.textContent)).join(" ").trim()}componentWillLoad(){this.valueChanged();this.labelChanged()}render(){return e(n,{role:"option","aria-selected":this.selected?"true":"false","aria-disabled":this.disabled?"true":"false"},e("div",{onMouseDown:this.handleClick,id:this.optId,class:{option:true,"option--selected":this.selected,"option--disabled":this.disabled,"option--novalue":!this.value}},e("div",{part:"check-icon",class:"option__check"},e("slot",{name:"check-icon"},e("nano-icon",{name:"light/check","aria-hidden":"true"}))),e("div",{part:"start",class:"option__start"},e("slot",{name:"start"})),e("div",{part:"label",class:"option__label"},e("slot",null,this.label||this.value)),e("div",{part:"end",class:"option__end"},e("slot",{name:"end"}))))}get host(){return o(this)}static get watchers(){return{value:["valueChanged"],label:["labelChanged"]}}};v.style=m;export{u as nano_datalist,g as nano_menu,v as nano_option};
|
5
|
+
//# sourceMappingURL=p-3eb6d833.entry.js.map
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
2
|
* Web Components for Nanopore digital Web Apps
|
3
3
|
*/
|
4
|
-
import{g as t,e as i,r as e,c as s,w as n,d as r,h as a,a as h}from"./p-f6a8467a.js";import{a as o}from"./p-ed6adde2.js";import{g as l}from"./p-257432ff.js";import{C as u}from"./p-a6ff5ca6.js";import{b as f,c,a as d}from"./p-69a3e911.js";import{d as p}from"./p-9746b0a5.js";import{S as v}from"./p-60a8c896.js";var m=new Map;var g=function(t,i){var e=t.fields,s=t.updater;e.forEach((function(t){s(t,i[t])}))};var y={create:function(i,e){var s=t(i);var n=new Map;var r={wormholes:n,state:e};m.set(i,r);var a=i.connectedCallback;i.connectedCallback=function(){m.set(i,r);if(a){a.call(i)}};var h=i.disconnectedCallback;i.disconnectedCallback=function(){m.delete(i);if(h){h.call(i)}};s.addEventListener("openWormhole",(function(t){t.stopPropagation();var i=t.detail,e=i.consumer,s=i.onOpen;if(n.has(e))return;if(typeof e!=="symbol"){var a=e.connectedCallback,h=e.disconnectedCallback;e.connectedCallback=function(){n.set(e,t.detail);if(a){a.call(e)}};e.disconnectedCallback=function(){n.delete(e);if(h){h.call(e)}}}n.set(e,t.detail);g(t.detail,r.state);s===null||s===void 0?void 0:s.resolve((function(){n.delete(e)}))}));s.addEventListener("closeWormhole",(function(t){var i=t.detail;n.delete(i)}))},Provider:function(t,e){var s=t.state;var n=i();if(m.has(n)){var r=m.get(n);r.state=s;r.wormholes.forEach((function(t){g(t,s)}))}return e}};class w{constructor(){this.queue=[];this.workingOnPromise=false;this.stop=false;this.limit=null}enqueue(t){return new Promise(((i,e)=>{this.queue.push({promise:t,resolve:i,reject:e});this.dequeue()}))}dequeue(){if(this.workingOnPromise){return false}if(this.stop){this.queue=[];this.stop=false;return}const t=this.queue.shift();if(!t){return false}try{this.workingOnPromise=true;t.promise().then((i=>{this.workingOnPromise=false;t.resolve(i);this.dequeue()})).catch((i=>{this.workingOnPromise=false;t.reject(i);this.dequeue()}))}catch(i){this.workingOnPromise=false;t.reject(i);this.dequeue()}return true}}w.pendingPromise=false;var b=c((function(t,i){!function(t,e){e(i)}(d,(function(t){function i(t){var e,s,n=new Error(t);return e=n,s=i.prototype,Object.setPrototypeOf?Object.setPrototypeOf(e,s):e.__proto__=s,n}function e(t,e,s){var n=e.slice(0,s).split(/\n/),r=n.length,a=n[r-1].length+1;throw i(t+=" at line "+r+" col "+a+":\n\n "+e.split(/\n/)[r-1]+"\n "+Array(a).join(" ")+"^")}i.prototype=Object.create(Error.prototype,{name:{value:"Squirrelly Error",enumerable:!1}});var s=new Function("return this")().Promise,n=!1;try{n=new Function("return (async function(){}).constructor")()}catch(t){if(!(t instanceof SyntaxError))throw t}function r(t,i){return Object.prototype.hasOwnProperty.call(t,i)}function a(t,i,e){for(var s in i)r(i,s)&&(null==i[s]||"object"!=typeof i[s]||"storage"!==s&&"prefixes"!==s||e?t[s]=i[s]:t[s]=a({},i[s]));return t}var h=/^async +/,o=/`(?:\\[\s\S]|\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})*}|(?!\${)[^\\`])*`/g,l=/'(?:\\[\s\w"'\\`]|[^\n\r'\\])*?'/g,u=/"(?:\\[\s\w"'\\`]|[^\n\r"\\])*?"/g,f=/[.*+\-?^${}()|[\]\\]/g;function c(t){return f.test(t)?t.replace(f,"\\$&"):t}function d(t,s){s.rmWhitespace&&(t=t.replace(/[\r\n]+/g,"\n").replace(/^\s+|\s+$/gm,"")),o.lastIndex=0,l.lastIndex=0,u.lastIndex=0;var n=s.prefixes,r=[n.h,n.b,n.i,n.r,n.c,n.e].reduce((function(t,i){return t&&i?t+"|"+c(i):i?c(i):t}),""),a=new RegExp("([|()]|=>)|('|\"|`|\\/\\*)|\\s*((\\/)?(-|_)?"+c(s.tags[1])+")","g"),f=new RegExp("([^]*?)"+c(s.tags[0])+"(-|_)?\\s*("+r+")?\\s*","g"),d=0,p=!1;function v(i,n){var r,c={f:[]},v=0,m="c";function g(i){var n=t.slice(d,i),r=n.trim();if("f"===m)"safe"===r?c.raw=!0:s.async&&h.test(r)?(r=r.replace(h,""),c.f.push([r,"",!0])):c.f.push([r,""]);else if("fp"===m)c.f[c.f.length-1][1]+=r;else if("err"===m){if(r){var a=n.search(/\S/);e("invalid syntax",t,d+a)}}else c[m]=r;d=i+1}for("h"===n||"b"===n||"c"===n?m="n":"r"===n&&(c.raw=!0,n="i"),a.lastIndex=d;null!==(r=a.exec(t));){var y=r[1],w=r[2],b=r[3],x=r[4],F=r[5],C=r.index;if(y)"("===y?(0===v&&("n"===m?(g(C),m="p"):"f"===m&&(g(C),m="fp")),v++):")"===y?0===--v&&"c"!==m&&(g(C),m="err"):0===v&&"|"===y?(g(C),m="f"):"=>"===y&&(g(C),d+=1,m="res");else if(w){if("/*"===w){var j=t.indexOf("*/",a.lastIndex);-1===j&&e("unclosed comment",t,r.index),a.lastIndex=j+2}else if("'"===w){l.lastIndex=r.index,l.exec(t)?a.lastIndex=l.lastIndex:e("unclosed string",t,r.index)}else if('"'===w){u.lastIndex=r.index,u.exec(t)?a.lastIndex=u.lastIndex:e("unclosed string",t,r.index)}else if("`"===w){o.lastIndex=r.index,o.exec(t)?a.lastIndex=o.lastIndex:e("unclosed string",t,r.index)}}else if(b)return g(C),d=C+r[0].length,f.lastIndex=d,p=F,x&&"h"===n&&(n="s"),c.t=n,c}return e("unclosed tag",t,i),c}var m=function r(a,o){a.b=[],a.d=[];var l,u=!1,c=[];function m(t,i){t&&(t=function(t,i,e,s){var n,r;return"string"==typeof i.autoTrim?n=r=i.autoTrim:Array.isArray(i.autoTrim)&&(n=i.autoTrim[1],r=i.autoTrim[0]),(e||!1===e)&&(n=e),(s||!1===s)&&(r=s),"slurp"===n&&"slurp"===r?t.trim():("_"===n||"slurp"===n?t=String.prototype.trimLeft?t.trimLeft():t.replace(/^[\s\uFEFF\xA0]+/,""):"-"!==n&&"nl"!==n||(t=t.replace(/^(?:\n|\r|\r\n)/,"")),"_"===r||"slurp"===r?t=String.prototype.trimRight?t.trimRight():t.replace(/[\s\uFEFF\xA0]+$/,""):"-"!==r&&"nl"!==r||(t=t.replace(/(?:\n|\r|\r\n)$/,"")),t)}(t,s,p,i))&&(t=t.replace(/\\|'/g,"\\$&").replace(/\r\n|\n|\r/g,"\\n"),c.push(t))}for(;null!==(l=f.exec(t));){var g,y=l[1],w=l[2],b=l[3]||"";for(var x in n)if(n[x]===b){g=x;break}m(y,w),d=l.index+l[0].length,g||e("unrecognized tag type: "+b,t,d);var F=v(l.index,g),C=F.t;if("h"===C){var j=F.n||"";s.async&&h.test(j)&&(F.a=!0,F.n=j.replace(h,"")),F=r(F),c.push(F)}else if("c"===C){if(a.n===F.n)return u?(u.d=c,a.b.push(u)):a.d=c,a;e("Helper start and end don't match",t,l.index+l[0].length)}else if("b"===C){u?(u.d=c,a.b.push(u)):a.d=c;var I=F.n||"";s.async&&h.test(I)&&(F.a=!0,F.n=I.replace(h,"")),u=F,c=[]}else if("s"===C){var S=F.n||"";s.async&&h.test(S)&&(F.a=!0,F.n=S.replace(h,"")),c.push(F)}else c.push(F)}if(!o)throw i('unclosed helper "'+a.n+'"');return m(t.slice(d,t.length),!1),a.d=c,a}({f:[]},!0);if(s.plugins)for(var g=0;g<s.plugins.length;g++){var y=s.plugins[g];y.processAST&&(m.d=y.processAST(m.d,s))}return m.d}function p(t,i){var e=d(t,i),s="var tR='';"+(i.useWith?"with("+i.varName+"||{}){":"")+w(e,i)+"if(cb){cb(null,tR)} return tR"+(i.useWith?"}":"");if(i.plugins)for(var n=0;n<i.plugins.length;n++){var r=i.plugins[n];r.processFnString&&(s=r.processFnString(s,i))}return s}function v(t,i){for(var e=0;e<i.length;e++){var s=i[e][0],n=i[e][1];t=(i[e][2]?"await ":"")+"c.l('F','"+s+"')("+t,n&&(t+=","+n),t+=")"}return t}function m(t,i,e,s,n,r){var a="{exec:"+(n?"async ":"")+y(e,i,t)+",params:["+s+"]";return r&&(a+=",name:'"+r+"'"),n&&(a+=",async:true"),a+="}"}function g(t,i){for(var e="[",s=0;s<t.length;s++){var n=t[s];e+=m(i,n.res||"",n.d,n.p||"",n.a,n.n),s<t.length&&(e+=",")}return e+="]"}function y(t,i,e){return"function("+i+"){var tR='';"+w(t,e)+"return tR}"}function w(t,i){for(var e=0,s=t.length,n="";e<s;e++){var r=t[e];if("string"==typeof r){n+="tR+='"+r+"';"}else{var a=r.t,h=r.c||"",o=r.f,l=r.n||"",u=r.p||"",f=r.res||"",c=r.b,d=!!r.a;if("i"===a){i.defaultFilter&&(h="c.l('F','"+i.defaultFilter+"')("+h+")");var p=v(h,o);!r.raw&&i.autoEscape&&(p="c.l('F','e')("+p+")"),n+="tR+="+p+";"}else if("h"===a)if(i.storage.nativeHelpers.get(l))n+=i.storage.nativeHelpers.get(l)(r,i);else{var y=(d?"await ":"")+"c.l('H','"+l+"')("+m(i,f,r.d,u,d);y+=c?","+g(c,i):",[]",n+="tR+="+v(y+=",c)",o)+";"}else"s"===a?n+="tR+="+v((d?"await ":"")+"c.l('H','"+l+"')({params:["+u+"]},[],c)",o)+";":"e"===a&&(n+=h+"\n")}}return n}var b=function(){function t(t){this.cache=t}return t.prototype.define=function(t,i){this.cache[t]=i},t.prototype.get=function(t){return this.cache[t]},t.prototype.remove=function(t){delete this.cache[t]},t.prototype.reset=function(){this.cache={}},t.prototype.load=function(t){a(this.cache,t,!0)},t}();function x(t,e,s,n){if(e&&e.length>0)throw i((n?"Native":"")+"Helper '"+t+"' doesn't accept blocks");if(s&&s.length>0)throw i((n?"Native":"")+"Helper '"+t+"' doesn't accept filters")}var F={"&":"&","<":"<",">":">",'"':""","'":"'"};function C(t){return F[t]}var j=new b({}),I=new b({each:function(t,i){var e="",s=t.params[0];if(x("each",i,!1),t.async)return new Promise((function(i){!function t(i,e,s,n,r){s(i[e],e).then((function(a){n+=a,e===i.length-1?r(n):t(i,e+1,s,n,r)}))}(s,0,t.exec,e,i)}));for(var n=0;n<s.length;n++)e+=t.exec(s[n],n);return e},foreach:function(t,i){var e=t.params[0];if(x("foreach",i,!1),t.async)return new Promise((function(i){!function t(i,e,s,n,r,a){n(e[s],i[e[s]]).then((function(h){r+=h,s===e.length-1?a(r):t(i,e,s+1,n,r,a)}))}(e,Object.keys(e),0,t.exec,"",i)}));var s="";for(var n in e)r(e,n)&&(s+=t.exec(n,e[n]));return s},include:function(t,e,s){x("include",e,!1);var n=s.storage.templates.get(t.params[0]);if(!n)throw i('Could not fetch template "'+t.params[0]+'"');return n(t.params[1],s)},extends:function(t,e,s){var n=t.params[1]||{};n.content=t.exec();for(var r=0;r<e.length;r++){var a=e[r];n[a.name]=a.exec()}var h=s.storage.templates.get(t.params[0]);if(!h)throw i('Could not fetch template "'+t.params[0]+'"');return h(n,s)},useScope:function(t,i){return x("useScope",i,!1),t.exec(t.params[0])}}),S=new b({if:function(t,i){x("if",!1,t.f,!0);var e="if("+t.p+"){"+w(t.d,i)+"}";if(t.b)for(var s=0;s<t.b.length;s++){var n=t.b[s];"else"===n.n?e+="else{"+w(n.d,i)+"}":"elif"===n.n&&(e+="else if("+n.p+"){"+w(n.d,i)+"}")}return e},try:function(t,e){if(x("try",!1,t.f,!0),!t.b||1!==t.b.length||"catch"!==t.b[0].n)throw i("native helper 'try' only accepts 1 block, 'catch'");var s="try{"+w(t.d,e)+"}",n=t.b[0];return s+="catch"+(n.res?"("+n.res+")":"")+"{"+w(n.d,e)+"}"},block:function(t,i){return x("block",t.b,t.f,!0),"if(!"+i.varName+"["+t.p+"]){tR+=("+y(t.d,"",i)+")()}else{tR+="+i.varName+"["+t.p+"]}"}}),z=new b({e:function(t){var i=String(t);return/[&<>"']/.test(i)?i.replace(/[&<>"']/g,C):i}}),O={varName:"it",autoTrim:[!1,"nl"],autoEscape:!0,defaultFilter:!1,tags:["{{","}}"],l:function(t,e){if("H"===t){var s=this.storage.helpers.get(e);if(s)return s;throw i("Can't find helper '"+e+"'")}if("F"===t){var n=this.storage.filters.get(e);if(n)return n;throw i("Can't find filter '"+e+"'")}},async:!1,storage:{helpers:I,nativeHelpers:S,filters:z,templates:j},prefixes:{h:"@",b:"#",i:"",r:"*",c:"/",e:"!"},cache:!1,plugins:[],useWith:!1};function R(t,i){var e={};return a(e,O),i&&a(e,i),t&&a(e,t),e.l.bind(e),e}function A(t,e){var s=R(e||{}),r=Function;if(s.async){if(!n)throw i("This environment doesn't support async/await");r=n}try{return new r(s.varName,"c","cb",p(t,s))}catch(e){throw e instanceof SyntaxError?i("Bad template syntax\n\n"+e.message+"\n"+Array(e.message.length+1).join("=")+"\n"+p(t,s)):e}}function k(t,i){var e;return i.cache&&i.name&&i.storage.templates.get(i.name)?i.storage.templates.get(i.name):(e="function"==typeof t?t:A(t,i),i.cache&&i.name&&i.storage.templates.define(i.name,e),e)}O.l.bind(O),t.compile=A,t.compileScope=w,t.compileScopeIntoFunction=y,t.compileToString=p,t.defaultConfig=O,t.filters=z,t.getConfig=R,t.helpers=I,t.nativeHelpers=S,t.parse=d,t.render=function(t,e,n,r){var a=R(n||{});if(!a.async)return k(t,a)(e,a);if(!r){if("function"==typeof s)return new s((function(i,s){try{i(k(t,a)(e,a))}catch(t){s(t)}}));throw i("Please provide a callback function, this env doesn't support Promises")}try{k(t,a)(e,a,r)}catch(t){return r(t)}},t.templates=j,Object.defineProperty(t,"__esModule",{value:!0})}))}));const x=f(b);const F=Object.freeze(Object.assign(Object.create(null),b,{default:x}));const C=F;C.filters.define("date_long",((t,i={year:"numeric",month:"long",day:"numeric"})=>{if(!t)return;const e=new Date(parseInt(t)*1e3);t=e.toLocaleDateString("en-GB",i);return t}));C.filters.define("date_short",((t,i="d/m/y")=>{if(!t)return;const e=new Date(parseInt(t)*1e3);t=i.replace(/(d)/,e.getDate().toString());t=t.replace(/(m)/,(e.getMonth()+1).toString());t=t.replace(/(y)/,e.getFullYear().toString());return t}));C.filters.define("public_name",(t=>{if(!t)return;t=t.split("_").map((t=>t.length<3?t.toUpperCase():t)).join(" ");return t.charAt(0).toUpperCase()+t.slice(1)}));C.filters.define("trim_to",((t,i=100)=>{if(!t)return;if(t.length<=i)return t;return t.substr(0,i)+"..."}));C.filters.define("classname",(t=>{if(!t)return;return t.replace(/[\W]+/g,"")}));C.filters.define("abs_url",((t,i=null,e)=>{if(!i)return t;if(!t)return;let s=undefined;if(i.domains&&e&&e.origin){const t=i.domains.find((t=>t.origin===e.origin));s=t?t.domain:""}else if(i.domain)s=i.domain;if(!s)return t;return t.match(/^http/)?t:location.protocol+"//"+s+t}));C.filters.define("replace",((t,i,e)=>t.replace(i,e)));C.filters.define("remove_spaces",(t=>t.replace(/ /g,"_")));C.filters.define("add_spaces",(t=>t=t.replace(/[_\-]/g," ")));C.filters.define("capitalise",(t=>t=t.charAt(0).toUpperCase()+t.slice(1)));C.filters.define("lowercase",(t=>t=t.toLowerCase()));const j=C;const I=":host{box-sizing:border-box}*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}:host{position:relative;display:block}:host ::slotted([slot=search-template]){display:none !important}.loader{opacity:0;position:fixed;block-size:100%;inline-size:100%;min-block-size:100%;max-block-size:100vh !important;max-inline-size:100vw !important;inset-inline-start:0;inset-block-start:0;z-index:-10;font-size:60px;display:flex;align-items:center;justify-content:center;transition:opacity 0.2s ease, z-index 0.01s ease 0.2s}.loader.loading{opacity:1;z-index:10;transition:z-index 0.01s ease, opacity 0.2s ease 0.01s}.default{block-size:100%}.default:focus{outline:none}.results{opacity:0;outline:none;overflow:auto;transition:transform 0.3s ease, opacity 0.3s ease, visibility 0.01s ease 0.3s, z-index 0.01s ease 0.3s;transform:translate(0, 100px);visibility:hidden;z-index:-1;position:absolute;inset-block-start:0;inset-inline-start:0;display:none}.results-container{position:relative}.results.show{transition:z-index 0.01s ease, visibility 0.01s ease, transform 0.3s ease 0.01s, opacity 0.3s ease 0.01s, overflow 0.01s ease 0.31s;transform:translate(0, 0);visibility:visible;opacity:1;z-index:10;overflow:hidden}.results.shown{block-size:auto !important;inline-size:auto !important;display:block;position:static;transform:none;z-index:auto;visibility:inherit;opacity:initial;overflow:visible}";const S=class{constructor(t){e(this,t);this.nanoDidLoad=s(this,"nanoDidLoad",7);this.nanoResultsShown=s(this,"nanoResultsShown",3);this.nanoBeforeQuery=s(this,"nanoBeforeQuery",7);this.nanoAfterQuery=s(this,"nanoAfterQuery",7);this.nanoNewResults=s(this,"nanoNewResults",7);this.staticFacetFilters={};this.dynFacetFilters={};this.hasLoadSlot=false;this.placedAlgoliaEles=[];this.promiseQueue=new w;this.searchChange=async()=>{if(!this.algoliaIndex)return;if(!this.query||this.query.length<this.minChars){if(!this.browseIndex){if(!this.query||this.query.length===0){this.handleSearchReset();return}else return}else if(this.query!=="*"){this.query="*";return}}this.isLoading=true;setTimeout((async()=>{this.resetPage();await this.algoliaSearch(v.Init);await this.updateContent();setTimeout((t=>this.isLoading=false),800);this.showResults=true;this.nanoResultsShown.emit(this.indexResults)}),200)};this.makeAppliedFilters=()=>{const t=[];const i=i=>{Object.values(i).forEach((i=>{if(i.value&&i.value.length){const e=t.find((t=>t.name===i.facetName));if(!e)t.push({name:i.facetName,values:[...i.value]});else e.values=[...e.values,...i.value]}}))};i(this.dynFacetFilters);i(this.staticFacetFilters);if(t.length)return t;return null};this.algoliaSearch=async t=>this.promiseQueue.enqueue((()=>this.queueSearch(t)));this.queueSearch=async t=>{if(!this.algoliaIndex||!this.query||!this.searchIndex||!this.searchIndex.index)return;this.nanoBeforeQuery.emit(this.indexResults);if(v.Init===t)this.clearAllFacetFilters();const i={filters:this.algoliaFilterStr(),page:this.indexResults?this.indexResults.currentPage:0};if(this.searchIndex.filters)i.facets=this.searchIndex.filters;if(this.searchIndex.hitsPerPage)i.hitsPerPage=this.searchIndex.hitsPerPage;let e=await this.algoliaIndex.search(this.query,i);e=this.fixDomain(e);this.changeEvent=t;if(t===v.Init||!this.indexResults){this.indexResults={currentPage:0,totalHits:e.nbHits,hitsPerPage:null,origFilters:e.facets,query:this.query,domain:this.searchIndex.domain||null,totalHitsWithFilters:0,results:[],totalPages:0,appliedFilters:this.makeAppliedFilters(),indexName:this.searchIndex.name||null,index:this.searchIndex.index}}this.indexResults.dynFilters=e.facets;this.indexResults.results=e.hits;this.indexResults.totalHitsWithFilters=e.nbHits;this.indexResults.currentPage=e.page;this.indexResults.totalPages=e.nbPages;this.indexResults.hitsPerPage=e.hitsPerPage;this.indexResults.query=e.query;if(this.changeEvent!==v.Page&&this.changeEvent!==v.Replica){this.facets=e.facets}this.nanoAfterQuery.emit(this.indexResults);return new Promise((t=>{setTimeout((()=>t("tpl updated")),20)})).then((t=>{this.currentHits=this.indexResults.results;this.resultsPage=this.indexResults.currentPage}))};this.handleSearchReset=()=>{this.showResults=false;this.indexResults=null};this.onResultDisplay=()=>{n((()=>{this.resultsDiv.removeEventListener("transitionend",this.onResultDisplay);if(!this.showResults)this.resultsDiv.style.display="none";else{this.defaultDiv.style.display="none";this.resultsDiv.classList.add("shown");this.resultsDiv.style.minHeight="";this.resultsDiv.style.width=""}}))};this._dynFacetFilters={};this.inputField=undefined;this.algoliaIndex=undefined;this.indeces=[];this.resultsEmitterEle=undefined;this.indexResults=undefined;this.filterChanged="";this.currentHits=undefined;this.changeEvent=v.Init;this.isLoading=false;this.wormholeState=this;this.showResults=false;this.resultsPage=0;this.appId=undefined;this.apiKey=undefined;this.searchIndex={};this.searchIndexName="";this.listenTo=null;this.query="";this.operator="and";this.filters=[];this.tplEngine=j;this.tplRenderFn=j.render;this.replicaIndex="";this.browseIndex=false;this.minChars=2;this.storeId=undefined;this.storeMethod="session"}async removeFilters(t,i){if(!t&&!i)this.clearAllFacetFilters();else{Object.keys(this._dynFacetFilters).forEach((e=>{if(t&&this._dynFacetFilters[e].facetName===t){if(!i)this._dynFacetFilters[e].element.value="";else{this._dynFacetFilters[e].element.value=this._dynFacetFilters[e].value.filter((t=>t!==i))}}}))}}onAllTplUpdate(t){t.stopPropagation();if(t.target.tagName==="NANO-ALGOLIA-RESULTS"){requestAnimationFrame((()=>{this.nanoNewResults.emit(this.indexResults)}))}}async onPageChange(t){if(!this.indexResults)return;let i=this.resultsPage;if(t){t.stopPropagation();i=t.detail.page}i=Math.min(this.indexResults.totalPages-1,i);i=Math.max(i,0);if(this.indexResults.currentPage===i)return;this.indexResults.currentPage=i;await this.algoliaSearch(v.Page)}async onFilterChange(t){t.stopPropagation();const i={};const e=t.detail;e.element=t.target;if(this.indexResults){if(this.staticFacetFilters[e.filterId])this.staticFacetFilters[e.filterId]=e;else{i[e.filterId]=e;this._dynFacetFilters=Object.assign(Object.assign({},this._dynFacetFilters),i)}this.indexResults.appliedFilters=this.makeAppliedFilters()}else this.staticFacetFilters[e.filterId]=e;this.filterChanged=e.value&&e.value.length?e.filterId:"all";this.resetPage();this.algoliaSearch(v.Filter)}dynFacetFiltersChange(){Object.values(this._dynFacetFilters).forEach((t=>{if(this.host.ownerDocument===t.element.ownerDocument)this.dynFacetFilters[t.filterId]=t;else delete this.dynFacetFilters[t.filterId]}))}browseIndexChange(){if(this.browseIndex&&(!this.query||this.query.length<this.minChars)){this.query="*"}}inputFieldSet(){if(!this.inputField)return;if(this.query!=="*"&&this.inputField&&this.inputField.value!==this.query)this.inputField.value=this.query}queryChange(){this.searchChange()}async internalIndexSwitch(){if(!this.replicaIndex||!this.indexResults||this.indexResults.index===this.replicaIndex)return;this.indexResults.index=this.replicaIndex;this.algoliaIndex=this.algoliaClient.initIndex(this.indexResults.index);this.resetPage();this.algoliaSearch(v.Replica)}pageChange(){this.onPageChange()}searchIndexNameChange(){if(!this.searchIndexName||!this.searchIndexName.length||this.searchIndex&&this.searchIndex.index===this.searchIndexName)return;this.searchIndex={index:this.searchIndexName}}initAlgoliaClient(){if(!this.appId||!this.apiKey)return;this.algoliaClient=o(this.appId,this.apiKey)}initAlgoliaIndex(){if(!this.algoliaClient||!this.searchIndex)return;if(this.searchIndex.index){if(this.replicaIndex)this.searchIndex.index=this.replicaIndex;this.searchIndexName=this.searchIndex.index;this.algoliaIndex=this.algoliaClient.initIndex(this.searchIndex.index);this.searchChange()}}showResultsChange(){if(!this.resultsDiv||!this.defaultDiv)return;if(this.showResults){this.resultsDiv.style.width=this.host.scrollWidth+"px";this.resultsDiv.style.minHeight=this.host.scrollHeight+"px";n((()=>{this.resultsDiv.addEventListener("transitionend",this.onResultDisplay);this.resultsDiv.style.display="block";setTimeout((()=>this.resultsDiv.classList.add("show")),50)}))}else{n((()=>{this.resultsDiv.classList.remove("shown");this.defaultDiv.style.display="block";setTimeout((()=>{this.resultsDiv.addEventListener("transitionend",this.onResultDisplay);this.resultsDiv.classList.remove("show");if(!!this.slottedInput)this.slottedInput.focus({preventScroll:true});else this.defaultDiv.focus({preventScroll:true})}),50)}))}}handleFilterpropChange(){this.algoliaSearch(v.Init)}fixDomain(t){if(!this.searchIndex||!this.searchIndex.domain)return t;t.hits.map((t=>{if(t.url&&!t.url.match(/^http/))t.url=location.protocol+"//"+this.searchIndex.domain+t.url}));return t}resetPage(){if(!this.indexResults)return;this.indexResults.currentPage=0}clearAllFacetFilters(){Object.values(this._dynFacetFilters).forEach((t=>{t.element.value=""}));this._dynFacetFilters={}}algoliaFilterStr(){const t={};const i=i=>{let e;let s;Object.keys(i).forEach((n=>{e=i[n];t[n]=t[n]||{name:e.facetName,or:[],and:[],not:[]};s=t[n][e.operator];if(e.value&&e.value.length){t[n][e.operator]=[...s,...e.value]}}))};i(this.dynFacetFilters);i(this.staticFacetFilters);const e=(t,i)=>{if(i.indexOf(" ")>-1)return t+':"'+i+'"';else return t+":"+i};let s=[];let n;let r;Object.values(t).forEach((function(t){Object.keys(t).filter((t=>t.match(/(or|and|not)/))).forEach((i=>{n=t;r=t.name;if(i==="or"||i==="and"){if(n[i].length){s.push("( "+n[i].map((t=>{if(t.length)return e(r,t)})).join(" "+i.toLocaleUpperCase()+" ")+" )")}}else{if(n.not.length){s.push("( "+n[i].map((t=>{if(t.length)return"NOT "+e(r,t)})).join(" AND ")+" )")}}}))}));s=[...this.filters,...s];return s.join(" "+this.operator.toLocaleUpperCase()+" ")}handleInputChange(t){if(t.target!==this.inputField)return;this.query=this.inputField.value}async updateContent(){return this.promiseQueue.enqueue((()=>this.updateContentQueue()))}async updateContentQueue(){const t=this.outputSlot||this.resultsDiv;if(!t||!this.tpl)return"no tpl";const i=document.createElement("div");i.innerHTML=this.tpl;const e=[];this.placedAlgoliaEles=[];Array.from(i.querySelectorAll("nano-algolia, nano-algolia-filter, nano-algolia-results")).forEach(((t,i)=>{const s=document.createElement("div");s.dataset.placeholderId=i.toString();s.classList.add("nano-ele-placeholder");e.push(t);t.parentNode.replaceChild(s,t)}));t.innerHTML=this.tplRenderFn(i.innerHTML.replace(/>/gm,">").replace(/</gm,"<").replace(/&/gm,"&"),this.indexResults);Array.from(t.querySelectorAll("div.nano-ele-placeholder")).forEach((t=>{t.parentNode.replaceChild(e[parseInt(t.dataset.placeholderId)],t);this.placedAlgoliaEles.push(e[parseInt(t.dataset.placeholderId)])}));if(!this.placedAlgoliaEles.length)return Promise.resolve("algolia setup");return new Promise((i=>{const e=s=>{this.placedAlgoliaEles=this.placedAlgoliaEles.filter((t=>t!==s.detail));if(!this.placedAlgoliaEles.length){setTimeout((()=>i("tpl updated")),500);t.removeEventListener("nanoTplUpdated",e)}};t.addEventListener("nanoTplUpdated",e)}))}componentWillLoad(){r((t=>{this.tplSlot=l(this.host,'[slot="template"]')[0];this.outputSlot=l(this.host,'[slot="output"]')[0];this.slottedInput=l(this.host,'[slot="search-input"]')[0];this.hasLoadSlot=!!l(this.host,'[slot="loader"]')[0];if(!!this.tplSlot)this.tpl=this.tplSlot.innerHTML||this.tplSlot.innerText;if(this.slottedInput&&(this.slottedInput.tagName.toLocaleLowerCase()==="nano-input"||this.slottedInput instanceof HTMLInputElement)){this.inputField=this.slottedInput}else if(this.slottedInput){this.inputField=this.slottedInput.querySelector('nano-input, input:not([type="radio"]):not([type="checkbox"])')}n((t=>{if(this.showResults&&this.tpl)this.searchChange()}))}));this.searchIndexNameChange();this.initAlgoliaClient();this.initAlgoliaIndex();y.create(this,this.wormholeState);if(this.storeId){u.init(this,["query","replicaIndex"],this.storeMethod,this.storeId);u.init(this,["apiKey","appId","searchIndex"],"session",this.storeId+"_api")}this.internalIndexSwitch()}connectedCallback(){this.searchChange=p(this.searchChange,300);this.browseIndexChange();this.host.dispatchEvent(new CustomEvent("nanoDidLoad",{detail:this.host}))}render(){const t={indexResults:this.indexResults,results:this.currentHits,filterChanged:this.filterChanged,tplRenderFn:this.tplRenderFn,resultsPage:this.resultsPage,changeEvent:this.changeEvent,facets:this.facets,algoliaIndex:this.algoliaIndex,searchIndex:this.searchIndex,globalStoreMethod:this.storeMethod,isLoading:this.isLoading};return a(h,{class:{"show-results":this.showResults,"is-loading":this.isLoading},"aria-busy":this.isLoading},this.hasLoadSlot&&a("div",{hidden:!this.isLoading},a("slot",{name:"loader"})),!this.hasLoadSlot&&a("div",{class:{loader:true,loading:this.isLoading}},a("nano-spinner",{overlay:true,type:"circle"})),a(y.Provider,{state:t},a("slot",{name:"search-input"}),a("div",{class:"results-container","aria-live":"polite"},a("div",{ref:t=>this.resultsDiv=t,class:"results"},a("slot",{name:"output"})))),a("div",{ref:t=>this.defaultDiv=t,class:"default",tabindex:"-1"},a("slot",null)))}get host(){return t(this)}static get watchers(){return{_dynFacetFilters:["dynFacetFiltersChange"],browseIndex:["browseIndexChange"],inputField:["inputFieldSet"],query:["queryChange"],replicaIndex:["internalIndexSwitch"],resultsPage:["pageChange"],searchIndexName:["searchIndexNameChange"],apiKey:["initAlgoliaClient"],appId:["initAlgoliaClient"],searchIndex:["initAlgoliaIndex"],showResults:["showResultsChange"],filters:["handleFilterpropChange"]}}};S.style=I;export{S as nano_algolia};
|
5
|
-
//# sourceMappingURL=p-
|
4
|
+
import{g as t,e as i,r as e,c as s,w as n,d as r,h as a,a as h}from"./p-f6a8467a.js";import{a as o}from"./p-ed6adde2.js";import{g as l}from"./p-257432ff.js";import{C as u}from"./p-1a0b5bc3.js";import{b as f,c,a as d}from"./p-69a3e911.js";import{d as p}from"./p-7bff5224.js";import{S as v}from"./p-60a8c896.js";var m=new Map;var g=function(t,i){var e=t.fields,s=t.updater;e.forEach((function(t){s(t,i[t])}))};var y={create:function(i,e){var s=t(i);var n=new Map;var r={wormholes:n,state:e};m.set(i,r);var a=i.connectedCallback;i.connectedCallback=function(){m.set(i,r);if(a){a.call(i)}};var h=i.disconnectedCallback;i.disconnectedCallback=function(){m.delete(i);if(h){h.call(i)}};s.addEventListener("openWormhole",(function(t){t.stopPropagation();var i=t.detail,e=i.consumer,s=i.onOpen;if(n.has(e))return;if(typeof e!=="symbol"){var a=e.connectedCallback,h=e.disconnectedCallback;e.connectedCallback=function(){n.set(e,t.detail);if(a){a.call(e)}};e.disconnectedCallback=function(){n.delete(e);if(h){h.call(e)}}}n.set(e,t.detail);g(t.detail,r.state);s===null||s===void 0?void 0:s.resolve((function(){n.delete(e)}))}));s.addEventListener("closeWormhole",(function(t){var i=t.detail;n.delete(i)}))},Provider:function(t,e){var s=t.state;var n=i();if(m.has(n)){var r=m.get(n);r.state=s;r.wormholes.forEach((function(t){g(t,s)}))}return e}};class b{constructor(){this.queue=[];this.workingOnPromise=false;this.stop=false;this.limit=null}enqueue(t){return new Promise(((i,e)=>{this.queue.push({promise:t,resolve:i,reject:e});this.dequeue()}))}dequeue(){if(this.workingOnPromise){return false}if(this.stop){this.queue=[];this.stop=false;return}const t=this.queue.shift();if(!t){return false}try{this.workingOnPromise=true;t.promise().then((i=>{this.workingOnPromise=false;t.resolve(i);this.dequeue()})).catch((i=>{this.workingOnPromise=false;t.reject(i);this.dequeue()}))}catch(i){this.workingOnPromise=false;t.reject(i);this.dequeue()}return true}}b.pendingPromise=false;var w=c((function(t,i){!function(t,e){e(i)}(d,(function(t){function i(t){var e,s,n=new Error(t);return e=n,s=i.prototype,Object.setPrototypeOf?Object.setPrototypeOf(e,s):e.__proto__=s,n}function e(t,e,s){var n=e.slice(0,s).split(/\n/),r=n.length,a=n[r-1].length+1;throw i(t+=" at line "+r+" col "+a+":\n\n "+e.split(/\n/)[r-1]+"\n "+Array(a).join(" ")+"^")}i.prototype=Object.create(Error.prototype,{name:{value:"Squirrelly Error",enumerable:!1}});var s=new Function("return this")().Promise,n=!1;try{n=new Function("return (async function(){}).constructor")()}catch(t){if(!(t instanceof SyntaxError))throw t}function r(t,i){return Object.prototype.hasOwnProperty.call(t,i)}function a(t,i,e){for(var s in i)r(i,s)&&(null==i[s]||"object"!=typeof i[s]||"storage"!==s&&"prefixes"!==s||e?t[s]=i[s]:t[s]=a({},i[s]));return t}var h=/^async +/,o=/`(?:\\[\s\S]|\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})*}|(?!\${)[^\\`])*`/g,l=/'(?:\\[\s\w"'\\`]|[^\n\r'\\])*?'/g,u=/"(?:\\[\s\w"'\\`]|[^\n\r"\\])*?"/g,f=/[.*+\-?^${}()|[\]\\]/g;function c(t){return f.test(t)?t.replace(f,"\\$&"):t}function d(t,s){s.rmWhitespace&&(t=t.replace(/[\r\n]+/g,"\n").replace(/^\s+|\s+$/gm,"")),o.lastIndex=0,l.lastIndex=0,u.lastIndex=0;var n=s.prefixes,r=[n.h,n.b,n.i,n.r,n.c,n.e].reduce((function(t,i){return t&&i?t+"|"+c(i):i?c(i):t}),""),a=new RegExp("([|()]|=>)|('|\"|`|\\/\\*)|\\s*((\\/)?(-|_)?"+c(s.tags[1])+")","g"),f=new RegExp("([^]*?)"+c(s.tags[0])+"(-|_)?\\s*("+r+")?\\s*","g"),d=0,p=!1;function v(i,n){var r,c={f:[]},v=0,m="c";function g(i){var n=t.slice(d,i),r=n.trim();if("f"===m)"safe"===r?c.raw=!0:s.async&&h.test(r)?(r=r.replace(h,""),c.f.push([r,"",!0])):c.f.push([r,""]);else if("fp"===m)c.f[c.f.length-1][1]+=r;else if("err"===m){if(r){var a=n.search(/\S/);e("invalid syntax",t,d+a)}}else c[m]=r;d=i+1}for("h"===n||"b"===n||"c"===n?m="n":"r"===n&&(c.raw=!0,n="i"),a.lastIndex=d;null!==(r=a.exec(t));){var y=r[1],b=r[2],w=r[3],x=r[4],F=r[5],C=r.index;if(y)"("===y?(0===v&&("n"===m?(g(C),m="p"):"f"===m&&(g(C),m="fp")),v++):")"===y?0===--v&&"c"!==m&&(g(C),m="err"):0===v&&"|"===y?(g(C),m="f"):"=>"===y&&(g(C),d+=1,m="res");else if(b){if("/*"===b){var j=t.indexOf("*/",a.lastIndex);-1===j&&e("unclosed comment",t,r.index),a.lastIndex=j+2}else if("'"===b){l.lastIndex=r.index,l.exec(t)?a.lastIndex=l.lastIndex:e("unclosed string",t,r.index)}else if('"'===b){u.lastIndex=r.index,u.exec(t)?a.lastIndex=u.lastIndex:e("unclosed string",t,r.index)}else if("`"===b){o.lastIndex=r.index,o.exec(t)?a.lastIndex=o.lastIndex:e("unclosed string",t,r.index)}}else if(w)return g(C),d=C+r[0].length,f.lastIndex=d,p=F,x&&"h"===n&&(n="s"),c.t=n,c}return e("unclosed tag",t,i),c}var m=function r(a,o){a.b=[],a.d=[];var l,u=!1,c=[];function m(t,i){t&&(t=function(t,i,e,s){var n,r;return"string"==typeof i.autoTrim?n=r=i.autoTrim:Array.isArray(i.autoTrim)&&(n=i.autoTrim[1],r=i.autoTrim[0]),(e||!1===e)&&(n=e),(s||!1===s)&&(r=s),"slurp"===n&&"slurp"===r?t.trim():("_"===n||"slurp"===n?t=String.prototype.trimLeft?t.trimLeft():t.replace(/^[\s\uFEFF\xA0]+/,""):"-"!==n&&"nl"!==n||(t=t.replace(/^(?:\n|\r|\r\n)/,"")),"_"===r||"slurp"===r?t=String.prototype.trimRight?t.trimRight():t.replace(/[\s\uFEFF\xA0]+$/,""):"-"!==r&&"nl"!==r||(t=t.replace(/(?:\n|\r|\r\n)$/,"")),t)}(t,s,p,i))&&(t=t.replace(/\\|'/g,"\\$&").replace(/\r\n|\n|\r/g,"\\n"),c.push(t))}for(;null!==(l=f.exec(t));){var g,y=l[1],b=l[2],w=l[3]||"";for(var x in n)if(n[x]===w){g=x;break}m(y,b),d=l.index+l[0].length,g||e("unrecognized tag type: "+w,t,d);var F=v(l.index,g),C=F.t;if("h"===C){var j=F.n||"";s.async&&h.test(j)&&(F.a=!0,F.n=j.replace(h,"")),F=r(F),c.push(F)}else if("c"===C){if(a.n===F.n)return u?(u.d=c,a.b.push(u)):a.d=c,a;e("Helper start and end don't match",t,l.index+l[0].length)}else if("b"===C){u?(u.d=c,a.b.push(u)):a.d=c;var I=F.n||"";s.async&&h.test(I)&&(F.a=!0,F.n=I.replace(h,"")),u=F,c=[]}else if("s"===C){var S=F.n||"";s.async&&h.test(S)&&(F.a=!0,F.n=S.replace(h,"")),c.push(F)}else c.push(F)}if(!o)throw i('unclosed helper "'+a.n+'"');return m(t.slice(d,t.length),!1),a.d=c,a}({f:[]},!0);if(s.plugins)for(var g=0;g<s.plugins.length;g++){var y=s.plugins[g];y.processAST&&(m.d=y.processAST(m.d,s))}return m.d}function p(t,i){var e=d(t,i),s="var tR='';"+(i.useWith?"with("+i.varName+"||{}){":"")+b(e,i)+"if(cb){cb(null,tR)} return tR"+(i.useWith?"}":"");if(i.plugins)for(var n=0;n<i.plugins.length;n++){var r=i.plugins[n];r.processFnString&&(s=r.processFnString(s,i))}return s}function v(t,i){for(var e=0;e<i.length;e++){var s=i[e][0],n=i[e][1];t=(i[e][2]?"await ":"")+"c.l('F','"+s+"')("+t,n&&(t+=","+n),t+=")"}return t}function m(t,i,e,s,n,r){var a="{exec:"+(n?"async ":"")+y(e,i,t)+",params:["+s+"]";return r&&(a+=",name:'"+r+"'"),n&&(a+=",async:true"),a+="}"}function g(t,i){for(var e="[",s=0;s<t.length;s++){var n=t[s];e+=m(i,n.res||"",n.d,n.p||"",n.a,n.n),s<t.length&&(e+=",")}return e+="]"}function y(t,i,e){return"function("+i+"){var tR='';"+b(t,e)+"return tR}"}function b(t,i){for(var e=0,s=t.length,n="";e<s;e++){var r=t[e];if("string"==typeof r){n+="tR+='"+r+"';"}else{var a=r.t,h=r.c||"",o=r.f,l=r.n||"",u=r.p||"",f=r.res||"",c=r.b,d=!!r.a;if("i"===a){i.defaultFilter&&(h="c.l('F','"+i.defaultFilter+"')("+h+")");var p=v(h,o);!r.raw&&i.autoEscape&&(p="c.l('F','e')("+p+")"),n+="tR+="+p+";"}else if("h"===a)if(i.storage.nativeHelpers.get(l))n+=i.storage.nativeHelpers.get(l)(r,i);else{var y=(d?"await ":"")+"c.l('H','"+l+"')("+m(i,f,r.d,u,d);y+=c?","+g(c,i):",[]",n+="tR+="+v(y+=",c)",o)+";"}else"s"===a?n+="tR+="+v((d?"await ":"")+"c.l('H','"+l+"')({params:["+u+"]},[],c)",o)+";":"e"===a&&(n+=h+"\n")}}return n}var w=function(){function t(t){this.cache=t}return t.prototype.define=function(t,i){this.cache[t]=i},t.prototype.get=function(t){return this.cache[t]},t.prototype.remove=function(t){delete this.cache[t]},t.prototype.reset=function(){this.cache={}},t.prototype.load=function(t){a(this.cache,t,!0)},t}();function x(t,e,s,n){if(e&&e.length>0)throw i((n?"Native":"")+"Helper '"+t+"' doesn't accept blocks");if(s&&s.length>0)throw i((n?"Native":"")+"Helper '"+t+"' doesn't accept filters")}var F={"&":"&","<":"<",">":">",'"':""","'":"'"};function C(t){return F[t]}var j=new w({}),I=new w({each:function(t,i){var e="",s=t.params[0];if(x("each",i,!1),t.async)return new Promise((function(i){!function t(i,e,s,n,r){s(i[e],e).then((function(a){n+=a,e===i.length-1?r(n):t(i,e+1,s,n,r)}))}(s,0,t.exec,e,i)}));for(var n=0;n<s.length;n++)e+=t.exec(s[n],n);return e},foreach:function(t,i){var e=t.params[0];if(x("foreach",i,!1),t.async)return new Promise((function(i){!function t(i,e,s,n,r,a){n(e[s],i[e[s]]).then((function(h){r+=h,s===e.length-1?a(r):t(i,e,s+1,n,r,a)}))}(e,Object.keys(e),0,t.exec,"",i)}));var s="";for(var n in e)r(e,n)&&(s+=t.exec(n,e[n]));return s},include:function(t,e,s){x("include",e,!1);var n=s.storage.templates.get(t.params[0]);if(!n)throw i('Could not fetch template "'+t.params[0]+'"');return n(t.params[1],s)},extends:function(t,e,s){var n=t.params[1]||{};n.content=t.exec();for(var r=0;r<e.length;r++){var a=e[r];n[a.name]=a.exec()}var h=s.storage.templates.get(t.params[0]);if(!h)throw i('Could not fetch template "'+t.params[0]+'"');return h(n,s)},useScope:function(t,i){return x("useScope",i,!1),t.exec(t.params[0])}}),S=new w({if:function(t,i){x("if",!1,t.f,!0);var e="if("+t.p+"){"+b(t.d,i)+"}";if(t.b)for(var s=0;s<t.b.length;s++){var n=t.b[s];"else"===n.n?e+="else{"+b(n.d,i)+"}":"elif"===n.n&&(e+="else if("+n.p+"){"+b(n.d,i)+"}")}return e},try:function(t,e){if(x("try",!1,t.f,!0),!t.b||1!==t.b.length||"catch"!==t.b[0].n)throw i("native helper 'try' only accepts 1 block, 'catch'");var s="try{"+b(t.d,e)+"}",n=t.b[0];return s+="catch"+(n.res?"("+n.res+")":"")+"{"+b(n.d,e)+"}"},block:function(t,i){return x("block",t.b,t.f,!0),"if(!"+i.varName+"["+t.p+"]){tR+=("+y(t.d,"",i)+")()}else{tR+="+i.varName+"["+t.p+"]}"}}),z=new w({e:function(t){var i=String(t);return/[&<>"']/.test(i)?i.replace(/[&<>"']/g,C):i}}),O={varName:"it",autoTrim:[!1,"nl"],autoEscape:!0,defaultFilter:!1,tags:["{{","}}"],l:function(t,e){if("H"===t){var s=this.storage.helpers.get(e);if(s)return s;throw i("Can't find helper '"+e+"'")}if("F"===t){var n=this.storage.filters.get(e);if(n)return n;throw i("Can't find filter '"+e+"'")}},async:!1,storage:{helpers:I,nativeHelpers:S,filters:z,templates:j},prefixes:{h:"@",b:"#",i:"",r:"*",c:"/",e:"!"},cache:!1,plugins:[],useWith:!1};function R(t,i){var e={};return a(e,O),i&&a(e,i),t&&a(e,t),e.l.bind(e),e}function A(t,e){var s=R(e||{}),r=Function;if(s.async){if(!n)throw i("This environment doesn't support async/await");r=n}try{return new r(s.varName,"c","cb",p(t,s))}catch(e){throw e instanceof SyntaxError?i("Bad template syntax\n\n"+e.message+"\n"+Array(e.message.length+1).join("=")+"\n"+p(t,s)):e}}function k(t,i){var e;return i.cache&&i.name&&i.storage.templates.get(i.name)?i.storage.templates.get(i.name):(e="function"==typeof t?t:A(t,i),i.cache&&i.name&&i.storage.templates.define(i.name,e),e)}O.l.bind(O),t.compile=A,t.compileScope=b,t.compileScopeIntoFunction=y,t.compileToString=p,t.defaultConfig=O,t.filters=z,t.getConfig=R,t.helpers=I,t.nativeHelpers=S,t.parse=d,t.render=function(t,e,n,r){var a=R(n||{});if(!a.async)return k(t,a)(e,a);if(!r){if("function"==typeof s)return new s((function(i,s){try{i(k(t,a)(e,a))}catch(t){s(t)}}));throw i("Please provide a callback function, this env doesn't support Promises")}try{k(t,a)(e,a,r)}catch(t){return r(t)}},t.templates=j,Object.defineProperty(t,"__esModule",{value:!0})}))}));const x=f(w);const F=Object.freeze(Object.assign(Object.create(null),w,{default:x}));const C=F;C.filters.define("date_long",((t,i={year:"numeric",month:"long",day:"numeric"})=>{if(!t)return;const e=new Date(parseInt(t)*1e3);t=e.toLocaleDateString("en-GB",i);return t}));C.filters.define("date_short",((t,i="d/m/y")=>{if(!t)return;const e=new Date(parseInt(t)*1e3);t=i.replace(/(d)/,e.getDate().toString());t=t.replace(/(m)/,(e.getMonth()+1).toString());t=t.replace(/(y)/,e.getFullYear().toString());return t}));C.filters.define("public_name",(t=>{if(!t)return;t=t.split("_").map((t=>t.length<3?t.toUpperCase():t)).join(" ");return t.charAt(0).toUpperCase()+t.slice(1)}));C.filters.define("trim_to",((t,i=100)=>{if(!t)return;if(t.length<=i)return t;return t.substr(0,i)+"..."}));C.filters.define("classname",(t=>{if(!t)return;return t.replace(/[\W]+/g,"")}));C.filters.define("abs_url",((t,i=null,e)=>{if(!i)return t;if(!t)return;let s=undefined;if(i.domains&&e&&e.origin){const t=i.domains.find((t=>t.origin===e.origin));s=t?t.domain:""}else if(i.domain)s=i.domain;if(!s)return t;return t.match(/^http/)?t:location.protocol+"//"+s+t}));C.filters.define("replace",((t,i,e)=>t.replace(i,e)));C.filters.define("remove_spaces",(t=>t.replace(/ /g,"_")));C.filters.define("add_spaces",(t=>t=t.replace(/[_\-]/g," ")));C.filters.define("capitalise",(t=>t=t.charAt(0).toUpperCase()+t.slice(1)));C.filters.define("lowercase",(t=>t=t.toLowerCase()));const j=C;const I=":host{box-sizing:border-box}*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}:host{position:relative;display:block}:host ::slotted([slot=search-template]){display:none !important}.loader{opacity:0;position:fixed;block-size:100%;inline-size:100%;min-block-size:100%;max-block-size:100vh !important;max-inline-size:100vw !important;inset-inline-start:0;inset-block-start:0;z-index:-10;font-size:60px;display:flex;align-items:center;justify-content:center;transition:opacity 0.2s ease, z-index 0.01s ease 0.2s}.loader.loading{opacity:1;z-index:10;transition:z-index 0.01s ease, opacity 0.2s ease 0.01s}.default{block-size:100%}.default:focus{outline:none}.results{opacity:0;outline:none;overflow:auto;transition:transform 0.3s ease, opacity 0.3s ease, visibility 0.01s ease 0.3s, z-index 0.01s ease 0.3s;transform:translate(0, 100px);visibility:hidden;z-index:-1;position:absolute;inset-block-start:0;inset-inline-start:0;display:none}.results-container{position:relative}.results.show{transition:z-index 0.01s ease, visibility 0.01s ease, transform 0.3s ease 0.01s, opacity 0.3s ease 0.01s, overflow 0.01s ease 0.31s;transform:translate(0, 0);visibility:visible;opacity:1;z-index:10;overflow:hidden}.results.shown{block-size:auto !important;inline-size:auto !important;display:block;position:static;transform:none;z-index:auto;visibility:inherit;opacity:initial;overflow:visible}";const S=class{constructor(t){e(this,t);this.nanoDidLoad=s(this,"nanoDidLoad",7);this.nanoResultsShown=s(this,"nanoResultsShown",3);this.nanoBeforeQuery=s(this,"nanoBeforeQuery",7);this.nanoAfterQuery=s(this,"nanoAfterQuery",7);this.nanoNewResults=s(this,"nanoNewResults",7);this.staticFacetFilters={};this.dynFacetFilters={};this.hasLoadSlot=false;this.placedAlgoliaEles=[];this.promiseQueue=new b;this.searchChange=async()=>{if(!this.algoliaIndex)return;if(!this.query||this.query.length<this.minChars){if(!this.browseIndex){if(!this.query||this.query.length===0){this.handleSearchReset();return}else return}else if(this.query!=="*"){this.query="*";return}}this.isLoading=true;setTimeout((async()=>{this.resetPage();await this.algoliaSearch(v.Init);await this.updateContent();setTimeout((t=>this.isLoading=false),800);this.showResults=true;this.nanoResultsShown.emit(this.indexResults)}),200)};this.makeAppliedFilters=()=>{const t=[];const i=i=>{Object.values(i).forEach((i=>{if(i.value&&i.value.length){const e=t.find((t=>t.name===i.facetName));if(!e)t.push({name:i.facetName,values:[...i.value]});else e.values=[...e.values,...i.value]}}))};i(this.dynFacetFilters);i(this.staticFacetFilters);if(t.length)return t;return null};this.algoliaSearch=async t=>this.promiseQueue.enqueue((()=>this.queueSearch(t)));this.queueSearch=async t=>{if(!this.algoliaIndex||!this.query||!this.searchIndex||!this.searchIndex.index)return;this.nanoBeforeQuery.emit(this.indexResults);if(v.Init===t)this.clearAllFacetFilters();const i={filters:this.algoliaFilterStr(),page:this.indexResults?this.indexResults.currentPage:0};if(this.searchIndex.filters)i.facets=this.searchIndex.filters;if(this.searchIndex.hitsPerPage)i.hitsPerPage=this.searchIndex.hitsPerPage;let e=await this.algoliaIndex.search(this.query,i);e=this.fixDomain(e);this.changeEvent=t;if(t===v.Init||!this.indexResults){this.indexResults={currentPage:0,totalHits:e.nbHits,hitsPerPage:null,origFilters:e.facets,query:this.query,domain:this.searchIndex.domain||null,totalHitsWithFilters:0,results:[],totalPages:0,appliedFilters:this.makeAppliedFilters(),indexName:this.searchIndex.name||null,index:this.searchIndex.index}}this.indexResults.dynFilters=e.facets;this.indexResults.results=e.hits;this.indexResults.totalHitsWithFilters=e.nbHits;this.indexResults.currentPage=e.page;this.indexResults.totalPages=e.nbPages;this.indexResults.hitsPerPage=e.hitsPerPage;this.indexResults.query=e.query;if(this.changeEvent!==v.Page&&this.changeEvent!==v.Replica){this.facets=e.facets}this.nanoAfterQuery.emit(this.indexResults);return new Promise((t=>{setTimeout((()=>t("tpl updated")),20)})).then((t=>{this.currentHits=this.indexResults.results;this.resultsPage=this.indexResults.currentPage}))};this.handleSearchReset=()=>{this.showResults=false;this.indexResults=null};this.onResultDisplay=()=>{n((()=>{this.resultsDiv.removeEventListener("transitionend",this.onResultDisplay);if(!this.showResults)this.resultsDiv.style.display="none";else{this.defaultDiv.style.display="none";this.resultsDiv.classList.add("shown");this.resultsDiv.style.minHeight="";this.resultsDiv.style.width=""}}))};this._dynFacetFilters={};this.inputField=undefined;this.algoliaIndex=undefined;this.indeces=[];this.resultsEmitterEle=undefined;this.indexResults=undefined;this.filterChanged="";this.currentHits=undefined;this.changeEvent=v.Init;this.isLoading=false;this.wormholeState=this;this.showResults=false;this.resultsPage=0;this.appId=undefined;this.apiKey=undefined;this.searchIndex={};this.searchIndexName="";this.listenTo=null;this.query="";this.operator="and";this.filters=[];this.tplEngine=j;this.tplRenderFn=j.render;this.replicaIndex="";this.browseIndex=false;this.minChars=2;this.storeId=undefined;this.storeMethod="session"}async removeFilters(t,i){if(!t&&!i)this.clearAllFacetFilters();else{Object.keys(this._dynFacetFilters).forEach((e=>{if(t&&this._dynFacetFilters[e].facetName===t){if(!i)this._dynFacetFilters[e].element.value="";else{this._dynFacetFilters[e].element.value=this._dynFacetFilters[e].value.filter((t=>t!==i))}}}))}}onAllTplUpdate(t){t.stopPropagation();if(t.target.tagName==="NANO-ALGOLIA-RESULTS"){requestAnimationFrame((()=>{this.nanoNewResults.emit(this.indexResults)}))}}async onPageChange(t){if(!this.indexResults)return;let i=this.resultsPage;if(t){t.stopPropagation();i=t.detail.page}i=Math.min(this.indexResults.totalPages-1,i);i=Math.max(i,0);if(this.indexResults.currentPage===i)return;this.indexResults.currentPage=i;await this.algoliaSearch(v.Page)}async onFilterChange(t){t.stopPropagation();const i={};const e=t.detail;e.element=t.target;if(this.indexResults){if(this.staticFacetFilters[e.filterId])this.staticFacetFilters[e.filterId]=e;else{i[e.filterId]=e;this._dynFacetFilters=Object.assign(Object.assign({},this._dynFacetFilters),i)}this.indexResults.appliedFilters=this.makeAppliedFilters()}else this.staticFacetFilters[e.filterId]=e;this.filterChanged=e.value&&e.value.length?e.filterId:"all";this.resetPage();this.algoliaSearch(v.Filter)}dynFacetFiltersChange(){Object.values(this._dynFacetFilters).forEach((t=>{if(this.host.ownerDocument===t.element.ownerDocument)this.dynFacetFilters[t.filterId]=t;else delete this.dynFacetFilters[t.filterId]}))}browseIndexChange(){if(this.browseIndex&&(!this.query||this.query.length<this.minChars)){this.query="*"}}inputFieldSet(){if(!this.inputField)return;if(this.query!=="*"&&this.inputField&&this.inputField.value!==this.query)this.inputField.value=this.query}queryChange(){this.searchChange()}async internalIndexSwitch(){if(!this.replicaIndex||!this.indexResults||this.indexResults.index===this.replicaIndex)return;this.indexResults.index=this.replicaIndex;this.algoliaIndex=this.algoliaClient.initIndex(this.indexResults.index);this.resetPage();this.algoliaSearch(v.Replica)}pageChange(){this.onPageChange()}searchIndexNameChange(){if(!this.searchIndexName||!this.searchIndexName.length||this.searchIndex&&this.searchIndex.index===this.searchIndexName)return;this.searchIndex={index:this.searchIndexName}}initAlgoliaClient(){if(!this.appId||!this.apiKey)return;this.algoliaClient=o(this.appId,this.apiKey)}initAlgoliaIndex(){if(!this.algoliaClient||!this.searchIndex)return;if(this.searchIndex.index){if(this.replicaIndex)this.searchIndex.index=this.replicaIndex;this.searchIndexName=this.searchIndex.index;this.algoliaIndex=this.algoliaClient.initIndex(this.searchIndex.index);this.searchChange()}}showResultsChange(){if(!this.resultsDiv||!this.defaultDiv)return;if(this.showResults){this.resultsDiv.style.width=this.host.scrollWidth+"px";this.resultsDiv.style.minHeight=this.host.scrollHeight+"px";n((()=>{this.resultsDiv.addEventListener("transitionend",this.onResultDisplay);this.resultsDiv.style.display="block";setTimeout((()=>this.resultsDiv.classList.add("show")),50)}))}else{n((()=>{this.resultsDiv.classList.remove("shown");this.defaultDiv.style.display="block";setTimeout((()=>{this.resultsDiv.addEventListener("transitionend",this.onResultDisplay);this.resultsDiv.classList.remove("show");if(!!this.slottedInput)this.slottedInput.focus({preventScroll:true});else this.defaultDiv.focus({preventScroll:true})}),50)}))}}handleFilterpropChange(){this.algoliaSearch(v.Init)}fixDomain(t){if(!this.searchIndex||!this.searchIndex.domain)return t;t.hits.map((t=>{if(t.url&&!t.url.match(/^http/))t.url=location.protocol+"//"+this.searchIndex.domain+t.url}));return t}resetPage(){if(!this.indexResults)return;this.indexResults.currentPage=0}clearAllFacetFilters(){Object.values(this._dynFacetFilters).forEach((t=>{t.element.value=""}));this._dynFacetFilters={}}algoliaFilterStr(){const t={};const i=i=>{let e;let s;Object.keys(i).forEach((n=>{e=i[n];t[n]=t[n]||{name:e.facetName,or:[],and:[],not:[]};s=t[n][e.operator];if(e.value&&e.value.length){t[n][e.operator]=[...s,...e.value]}}))};i(this.dynFacetFilters);i(this.staticFacetFilters);const e=(t,i)=>{if(i.indexOf(" ")>-1)return t+':"'+i+'"';else return t+":"+i};let s=[];let n;let r;Object.values(t).forEach((function(t){Object.keys(t).filter((t=>t.match(/(or|and|not)/))).forEach((i=>{n=t;r=t.name;if(i==="or"||i==="and"){if(n[i].length){s.push("( "+n[i].map((t=>{if(t.length)return e(r,t)})).join(" "+i.toLocaleUpperCase()+" ")+" )")}}else{if(n.not.length){s.push("( "+n[i].map((t=>{if(t.length)return"NOT "+e(r,t)})).join(" AND ")+" )")}}}))}));s=[...this.filters,...s];return s.join(" "+this.operator.toLocaleUpperCase()+" ")}handleInputChange(t){if(t.target!==this.inputField)return;this.query=this.inputField.value}async updateContent(){return this.promiseQueue.enqueue((()=>this.updateContentQueue()))}async updateContentQueue(){const t=this.outputSlot||this.resultsDiv;if(!t||!this.tpl)return"no tpl";const i=document.createElement("div");i.innerHTML=this.tpl;const e=[];this.placedAlgoliaEles=[];Array.from(i.querySelectorAll("nano-algolia, nano-algolia-filter, nano-algolia-results")).forEach(((t,i)=>{const s=document.createElement("div");s.dataset.placeholderId=i.toString();s.classList.add("nano-ele-placeholder");e.push(t);t.parentNode.replaceChild(s,t)}));t.innerHTML=this.tplRenderFn(i.innerHTML.replace(/>/gm,">").replace(/</gm,"<").replace(/&/gm,"&"),this.indexResults);Array.from(t.querySelectorAll("div.nano-ele-placeholder")).forEach((t=>{t.parentNode.replaceChild(e[parseInt(t.dataset.placeholderId)],t);this.placedAlgoliaEles.push(e[parseInt(t.dataset.placeholderId)])}));if(!this.placedAlgoliaEles.length)return Promise.resolve("algolia setup");return new Promise((i=>{const e=s=>{this.placedAlgoliaEles=this.placedAlgoliaEles.filter((t=>t!==s.detail));if(!this.placedAlgoliaEles.length){setTimeout((()=>i("tpl updated")),500);t.removeEventListener("nanoTplUpdated",e)}};t.addEventListener("nanoTplUpdated",e)}))}componentWillLoad(){r((t=>{this.tplSlot=l(this.host,'[slot="template"]')[0];this.outputSlot=l(this.host,'[slot="output"]')[0];this.slottedInput=l(this.host,'[slot="search-input"]')[0];this.hasLoadSlot=!!l(this.host,'[slot="loader"]')[0];if(!!this.tplSlot)this.tpl=this.tplSlot.innerHTML||this.tplSlot.innerText;if(this.slottedInput&&(this.slottedInput.tagName.toLocaleLowerCase()==="nano-input"||this.slottedInput instanceof HTMLInputElement)){this.inputField=this.slottedInput}else if(this.slottedInput){this.inputField=this.slottedInput.querySelector('nano-input, input:not([type="radio"]):not([type="checkbox"])')}n((t=>{if(this.showResults&&this.tpl)this.searchChange()}))}));this.searchIndexNameChange();this.initAlgoliaClient();this.initAlgoliaIndex();y.create(this,this.wormholeState);if(this.storeId){u.init(this,["query","replicaIndex"],this.storeMethod,this.storeId);u.init(this,["apiKey","appId","searchIndex"],"session",this.storeId+"_api")}this.internalIndexSwitch()}connectedCallback(){this.searchChange=p(this.searchChange,300);this.browseIndexChange();this.host.dispatchEvent(new CustomEvent("nanoDidLoad",{detail:this.host}))}render(){const t={indexResults:this.indexResults,results:this.currentHits,filterChanged:this.filterChanged,tplRenderFn:this.tplRenderFn,resultsPage:this.resultsPage,changeEvent:this.changeEvent,facets:this.facets,algoliaIndex:this.algoliaIndex,searchIndex:this.searchIndex,globalStoreMethod:this.storeMethod,isLoading:this.isLoading};return a(h,{class:{"show-results":this.showResults,"is-loading":this.isLoading},"aria-busy":this.isLoading},this.hasLoadSlot&&a("div",{hidden:!this.isLoading},a("slot",{name:"loader"})),!this.hasLoadSlot&&a("div",{class:{loader:true,loading:this.isLoading}},a("nano-spinner",{overlay:true,type:"circle"})),a(y.Provider,{state:t},a("slot",{name:"search-input"}),a("div",{class:"results-container","aria-live":"polite"},a("div",{ref:t=>this.resultsDiv=t,class:"results"},a("slot",{name:"output"})))),a("div",{ref:t=>this.defaultDiv=t,class:"default",tabindex:"-1"},a("slot",null)))}get host(){return t(this)}static get watchers(){return{_dynFacetFilters:["dynFacetFiltersChange"],browseIndex:["browseIndexChange"],inputField:["inputFieldSet"],query:["queryChange"],replicaIndex:["internalIndexSwitch"],resultsPage:["pageChange"],searchIndexName:["searchIndexNameChange"],apiKey:["initAlgoliaClient"],appId:["initAlgoliaClient"],searchIndex:["initAlgoliaIndex"],showResults:["showResultsChange"],filters:["handleFilterpropChange"]}}};S.style=I;export{S as nano_algolia};
|
5
|
+
//# sourceMappingURL=p-4884b65a.entry.js.map
|
@@ -0,0 +1,5 @@
|
|
1
|
+
/*!
|
2
|
+
* Web Components for Nanopore digital Web Apps
|
3
|
+
*/
|
4
|
+
import{c as t}from"./p-9b533dc3.js";import"./p-f6a8467a.js";import"./p-ee045579.js";import"./p-7bff5224.js";import"./p-9ebbb814.js";const o="table.worker";const p="stencil.table.worker";const s=new URL("p-f258383d.js",import.meta.url).href;const r=new Blob(['importScripts("'+s+'")'],{type:"text/javascript"});const e=URL.createObjectURL(r);const c=t(e,o,p);URL.revokeObjectURL(e);export{c as worker,p as workerMsgId,o as workerName,s as workerPath};
|
5
|
+
//# sourceMappingURL=p-52ae36ec.js.map
|