@arbetsformedlingen/yrkesvaljaren 2.0.12 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +52 -21
- package/dist/cjs/{af-validation-message-Cy89nVEv.js → af-validation-message-BdR9X_qh.js} +1 -1
- package/dist/cjs/core-selector.cjs.entry.js +342 -23
- package/dist/cjs/digi-service-job-selector.cjs.entry.js +352 -61
- package/dist/cjs/{index-hZgOvC17.js → index-DMQDFAL7.js} +0 -22
- package/dist/cjs/index.cjs.js +4 -7
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/{esm/fuse-BPnhMTul.js → cjs/types-DdzCbiye.js} +965 -1
- package/dist/cjs/yrkesvaljaren.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +0 -1
- package/dist/collection/components/core-selector/core-selector.css +70 -49
- package/dist/collection/components/core-selector/core-selector.js +309 -14
- package/dist/collection/components/design-compat/af-icon.js +8 -7
- package/dist/collection/components/job-selector/job-selector-controller.js +13 -3
- package/dist/collection/components/job-selector/job-selector.css +188 -34
- package/dist/collection/components/job-selector/job-selector.js +199 -10
- package/dist/components/core-selector2.js +1 -1
- package/dist/components/digi-service-job-selector.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/types.js +1 -1
- package/dist/esm/{af-validation-message-BgoGzzBf.js → af-validation-message-DMoOu-0k.js} +1 -1
- package/dist/esm/core-selector.entry.js +342 -23
- package/dist/esm/digi-service-job-selector.entry.js +310 -19
- package/dist/esm/{index-HNd02eQb.js → index-vJ-tamti.js} +1 -22
- package/dist/esm/index.js +2 -4
- package/dist/esm/loader.js +3 -3
- package/dist/{cjs/fuse-BTLNKxuL.js → esm/types-DVos4HHS.js} +948 -2
- package/dist/esm/yrkesvaljaren.js +3 -3
- package/dist/types/components/core-selector/core-selector.d.ts +68 -0
- package/dist/types/components/job-selector/job-selector-controller.d.ts +5 -0
- package/dist/types/components/job-selector/job-selector.d.ts +21 -3
- package/dist/types/components/job-selector/types.d.ts +12 -0
- package/dist/types/components.d.ts +20 -99
- package/dist/types/index.d.ts +1 -1
- package/dist/vendor/taxonomy-core/af-data-layer.d.ts +16 -0
- package/dist/vendor/taxonomy-core/af-data-layer.js +24 -0
- package/dist/vendor/taxonomy-core/index.d.ts +1 -1
- package/dist/vendor/taxonomy-core/index.js +1 -1
- package/dist/vendor/taxonomy-core/pii-sanitizer.d.ts +25 -0
- package/dist/vendor/taxonomy-core/pii-sanitizer.js +137 -0
- package/dist/vendor/taxonomy-core/selector-navigation.d.ts +9 -1
- package/dist/vendor/taxonomy-core/selector-navigation.js +28 -1
- package/dist/vendor/taxonomy-core/selector-types.d.ts +12 -0
- package/dist/yrkesvaljaren/index.esm.js +1 -1
- package/dist/yrkesvaljaren/p-0f19a308.entry.js +1 -0
- package/dist/yrkesvaljaren/{p-BUviBbwX.js → p-DHK95AvZ.js} +1 -1
- package/dist/yrkesvaljaren/p-DVos4HHS.js +1 -0
- package/dist/yrkesvaljaren/p-b81496c8.entry.js +1 -0
- package/dist/yrkesvaljaren/p-vJ-tamti.js +3 -0
- package/dist/yrkesvaljaren/yrkesvaljaren.esm.js +1 -1
- package/package.json +12 -10
- package/dist/cjs/geo-valjaren.cjs.entry.js +0 -14910
- package/dist/cjs/job-selector-demo.cjs.entry.js +0 -690
- package/dist/cjs/neobrutal-search.cjs.entry.js +0 -171
- package/dist/cjs/search.engine-D4cpbVzd.js +0 -504
- package/dist/cjs/taxonomy-registry-Dzt0SPzT.js +0 -454
- package/dist/cjs/types-CtHBl6Ra.js +0 -14
- package/dist/collection/components/geovaljaren/geovaljaren.css +0 -21
- package/dist/collection/components/geovaljaren/geovaljaren.js +0 -304
- package/dist/collection/components/geovaljaren/logic/adapter.utils.js +0 -20
- package/dist/collection/components/geovaljaren/logic/data.utils.js +0 -12
- package/dist/collection/components/geovaljaren/logic/history-service.js +0 -25
- package/dist/collection/components/geovaljaren/logic/search.engine.js +0 -28
- package/dist/collection/verkstad/verkstad.js +0 -408
- package/dist/components/fuse.js +0 -1
- package/dist/components/geo-valjaren.d.ts +0 -11
- package/dist/components/geo-valjaren.js +0 -1
- package/dist/components/job-selector-demo.d.ts +0 -11
- package/dist/components/job-selector-demo.js +0 -1
- package/dist/components/job-selector.js +0 -1
- package/dist/components/neobrutal-search.d.ts +0 -11
- package/dist/components/neobrutal-search.js +0 -1
- package/dist/components/search.engine.js +0 -1
- package/dist/esm/geo-valjaren.entry.js +0 -14908
- package/dist/esm/job-selector-demo.entry.js +0 -688
- package/dist/esm/neobrutal-search.entry.js +0 -169
- package/dist/esm/search.engine-BaWUTc3r.js +0 -493
- package/dist/esm/taxonomy-registry-C-pSh51L.js +0 -449
- package/dist/esm/types-DHUftoZJ.js +0 -12
- package/dist/types/components/geovaljaren/geovaljaren.d.ts +0 -24
- package/dist/types/components/geovaljaren/logic/adapter.utils.d.ts +0 -7
- package/dist/types/components/geovaljaren/logic/data.utils.d.ts +0 -7
- package/dist/types/components/geovaljaren/logic/history-service.d.ts +0 -6
- package/dist/types/components/geovaljaren/logic/search.engine.d.ts +0 -7
- package/dist/types/components/job-selector-demo/job-selector-demo.d.ts +0 -65
- package/dist/types/components/neobrutal-search/neobrutal-search.d.ts +0 -18
- package/dist/types/verkstad/verkstad.d.ts +0 -1
- package/dist/types/vitest-globals.d.ts +0 -1
- package/dist/yrkesvaljaren/p-5c3a5308.entry.js +0 -1
- package/dist/yrkesvaljaren/p-9ecd5177.entry.js +0 -1
- package/dist/yrkesvaljaren/p-BPnhMTul.js +0 -1
- package/dist/yrkesvaljaren/p-C-pSh51L.js +0 -1
- package/dist/yrkesvaljaren/p-CjMoDiZD.js +0 -1
- package/dist/yrkesvaljaren/p-DHUftoZJ.js +0 -1
- package/dist/yrkesvaljaren/p-HNd02eQb.js +0 -3
- package/dist/yrkesvaljaren/p-b6130085.entry.js +0 -1
- package/dist/yrkesvaljaren/p-dbbea724.entry.js +0 -1
- package/dist/yrkesvaljaren/p-df3fa43b.entry.js +0 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { h, Fragment } from "@stencil/core";
|
|
2
|
+
import { containsPii, sanitizeSuggestionMotivation, sanitizeSuggestionTerm } from "../../../vendor/taxonomy-core/pii-sanitizer.js";
|
|
2
3
|
import { JobSelectorController } from "./job-selector-controller";
|
|
3
4
|
import { InvalidSelectionError, } from "./types";
|
|
4
5
|
import { getRegisteredTaxonomy, registerTaxonomy } from "./taxonomy-registry";
|
|
@@ -37,8 +38,15 @@ export class JobSelector {
|
|
|
37
38
|
labelDescription;
|
|
38
39
|
/** Om satt till `true` måste fältet ha ett värde för att vara giltigt. */
|
|
39
40
|
required = false;
|
|
40
|
-
/** Om satt till `true`
|
|
41
|
+
/** Om satt till `true` kan användaren ange ett yrke som fritext när det inte finns i listan. */
|
|
41
42
|
manualInput = false;
|
|
43
|
+
/** Om satt till `true` kan användaren föreslå ett saknat yrke med motivering. */
|
|
44
|
+
feedback = false;
|
|
45
|
+
/**
|
|
46
|
+
* Emitteras när användaren skickar in ett förslag på saknat yrke via förslagsformuläret (`af-feedback`).
|
|
47
|
+
*/
|
|
48
|
+
afOnSubmitJobSuggestion;
|
|
49
|
+
suggestionState = null;
|
|
42
50
|
/**
|
|
43
51
|
* Aktiverar historiken.
|
|
44
52
|
* Använder Local Storage för att spara valda yrken i webbläsaren.
|
|
@@ -58,8 +66,18 @@ export class JobSelector {
|
|
|
58
66
|
maxVisibleRows;
|
|
59
67
|
minLength = MIN_INPUT_LENGTH;
|
|
60
68
|
maxResults = 20;
|
|
69
|
+
shouldFocusSuggestionInput = false;
|
|
70
|
+
shouldFocusConfirmation = false;
|
|
71
|
+
timers = new Set();
|
|
72
|
+
schedule(callback, delay) {
|
|
73
|
+
const timer = setTimeout(() => {
|
|
74
|
+
this.timers.delete(timer);
|
|
75
|
+
callback();
|
|
76
|
+
}, delay);
|
|
77
|
+
this.timers.add(timer);
|
|
78
|
+
}
|
|
61
79
|
get requireSelection() {
|
|
62
|
-
return !this.manualInput;
|
|
80
|
+
return !(this.manualInput || this.feedback);
|
|
63
81
|
}
|
|
64
82
|
/**
|
|
65
83
|
* Storleken på inputfältet.
|
|
@@ -256,8 +274,14 @@ export class JobSelector {
|
|
|
256
274
|
watchRequired(newValue) {
|
|
257
275
|
this.controller.updateConfig({ required: newValue });
|
|
258
276
|
}
|
|
259
|
-
|
|
260
|
-
this.
|
|
277
|
+
watchManualInputOrFeedback() {
|
|
278
|
+
if (!this.feedback) {
|
|
279
|
+
this.suggestionState = null;
|
|
280
|
+
}
|
|
281
|
+
this.controller.updateConfig({
|
|
282
|
+
requireSelection: this.requireSelection,
|
|
283
|
+
manualInput: this.manualInput
|
|
284
|
+
});
|
|
261
285
|
}
|
|
262
286
|
watchHistory(newValue) {
|
|
263
287
|
this.controller.updateConfig({ history: newValue });
|
|
@@ -375,6 +399,7 @@ export class JobSelector {
|
|
|
375
399
|
enableMultiple: this.enableMultiple,
|
|
376
400
|
required: this.required,
|
|
377
401
|
requireSelection: this.requireSelection,
|
|
402
|
+
manualInput: this.manualInput,
|
|
378
403
|
history: this.history,
|
|
379
404
|
popular: this.popular,
|
|
380
405
|
maxHistoryItems: this.maxHistoryItems,
|
|
@@ -399,6 +424,19 @@ export class JobSelector {
|
|
|
399
424
|
componentDidLoad() {
|
|
400
425
|
this.handleHashFocus();
|
|
401
426
|
}
|
|
427
|
+
componentDidRender() {
|
|
428
|
+
if (this.shouldFocusSuggestionInput && this.suggestionState?.status === 'form') {
|
|
429
|
+
this.shouldFocusSuggestionInput = false;
|
|
430
|
+
const input = this.hostElement.shadowRoot?.querySelector(`#${this.componentId}-suggestion-motivation-input`);
|
|
431
|
+
if (input) {
|
|
432
|
+
this.schedule(() => input.focus(), 50);
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
if (this.shouldFocusConfirmation && this.suggestionState?.status === 'submitted') {
|
|
436
|
+
this.shouldFocusConfirmation = false;
|
|
437
|
+
this.hostElement.shadowRoot?.querySelector('.yv-suggestion-close-btn')?.focus();
|
|
438
|
+
}
|
|
439
|
+
}
|
|
402
440
|
disconnectedCallback() {
|
|
403
441
|
if (this.observer) {
|
|
404
442
|
this.observer.disconnect();
|
|
@@ -408,6 +446,8 @@ export class JobSelector {
|
|
|
408
446
|
}
|
|
409
447
|
clearTimeout(this.animationTimer);
|
|
410
448
|
this.animationTimer = undefined;
|
|
449
|
+
this.timers.forEach(t => clearTimeout(t));
|
|
450
|
+
this.timers.clear();
|
|
411
451
|
}
|
|
412
452
|
handleHashFocus() {
|
|
413
453
|
const hash = window.location.hash;
|
|
@@ -421,9 +461,48 @@ export class JobSelector {
|
|
|
421
461
|
history.replaceState(null, '', window.location.pathname + window.location.search);
|
|
422
462
|
}
|
|
423
463
|
}
|
|
464
|
+
/** Manuella val skickas tvättade, och inte alls om de innehåller personuppgifter. */
|
|
465
|
+
trackedSelectedJobs() {
|
|
466
|
+
return this.lastAcceptedSelection.flatMap((item) => {
|
|
467
|
+
if (item.type !== 'manual-input')
|
|
468
|
+
return [item];
|
|
469
|
+
return containsPii(item.preferred_label) ? [] : [{ ...item, preferred_label: sanitizeSuggestionTerm(item.preferred_label) }];
|
|
470
|
+
});
|
|
471
|
+
}
|
|
472
|
+
emitJobSuggestion(term, motivation) {
|
|
473
|
+
const payload = {
|
|
474
|
+
selectedJobs: this.trackedSelectedJobs(),
|
|
475
|
+
suggestionJob: sanitizeSuggestionTerm(term),
|
|
476
|
+
suggestionMotivation: sanitizeSuggestionMotivation(motivation),
|
|
477
|
+
};
|
|
478
|
+
this.afOnSubmitJobSuggestion.emit(payload);
|
|
479
|
+
}
|
|
480
|
+
/** Stänger förslagsrutan och lämnar tillbaka fokus till sökfältet. */
|
|
481
|
+
closeSuggestion() {
|
|
482
|
+
this.suggestionState = null;
|
|
483
|
+
this.shouldFocusSuggestionInput = false;
|
|
484
|
+
void this.setFocus();
|
|
485
|
+
}
|
|
486
|
+
submitSuggestion() {
|
|
487
|
+
if (!this.suggestionState || !this.feedback)
|
|
488
|
+
return;
|
|
489
|
+
const { term, motivation } = this.suggestionState;
|
|
490
|
+
if (containsPii(motivation || '')) {
|
|
491
|
+
this.suggestionState = { ...this.suggestionState, piiError: true };
|
|
492
|
+
this.shouldFocusSuggestionInput = true;
|
|
493
|
+
return;
|
|
494
|
+
}
|
|
495
|
+
this.emitJobSuggestion(term, motivation);
|
|
496
|
+
this.shouldFocusSuggestionInput = false;
|
|
497
|
+
this.shouldFocusConfirmation = true;
|
|
498
|
+
this.suggestionState = { status: 'submitted', term: (term || '').trim(), motivation: '' };
|
|
499
|
+
}
|
|
424
500
|
// --- ANVÄNDARINTERAKTIONER OCH LOGIK (Delegerat till Controller via CoreSelector events) ---
|
|
425
501
|
handleInput(event) {
|
|
426
502
|
this.afFocused = true;
|
|
503
|
+
if (this.suggestionState?.status === 'pii-blocked') {
|
|
504
|
+
this.suggestionState = null;
|
|
505
|
+
}
|
|
427
506
|
this.controller.handleInput(event.detail);
|
|
428
507
|
}
|
|
429
508
|
handleCsSelect(event) {
|
|
@@ -440,12 +519,37 @@ export class JobSelector {
|
|
|
440
519
|
// Hämta originalobjektet från metadata om det finns, annars bygg ett baserat på genericItem
|
|
441
520
|
const originalItem = genericItem.metadata?.original;
|
|
442
521
|
if (originalItem && 'displayLabel' in originalItem) {
|
|
522
|
+
if (this.suggestionState?.status === 'pii-blocked') {
|
|
523
|
+
this.suggestionState = null;
|
|
524
|
+
}
|
|
443
525
|
this.controller.selectItem(originalItem);
|
|
444
526
|
}
|
|
445
527
|
else {
|
|
446
528
|
// Fallback för manuell inmatning eller om metadata saknas
|
|
447
529
|
if (genericItem.metadata?.type === 'ManualInput') {
|
|
448
|
-
|
|
530
|
+
const term = genericItem.label;
|
|
531
|
+
if (this.feedback && containsPii(term)) {
|
|
532
|
+
// Behåll texten i fältet så att användaren kan rätta den.
|
|
533
|
+
this.suggestionState = { status: 'pii-blocked', term: '', motivation: '' };
|
|
534
|
+
return;
|
|
535
|
+
}
|
|
536
|
+
if (this.manualInput) {
|
|
537
|
+
this.controller.handleFreeTextSelection(term);
|
|
538
|
+
}
|
|
539
|
+
if (this.feedback) {
|
|
540
|
+
this.afFocused = false;
|
|
541
|
+
this.shouldFocusSuggestionInput = true;
|
|
542
|
+
this.suggestionState = {
|
|
543
|
+
status: 'form',
|
|
544
|
+
term,
|
|
545
|
+
motivation: '',
|
|
546
|
+
};
|
|
547
|
+
if (!this.manualInput) {
|
|
548
|
+
this.controller.resetSearch();
|
|
549
|
+
}
|
|
550
|
+
return;
|
|
551
|
+
}
|
|
552
|
+
return;
|
|
449
553
|
}
|
|
450
554
|
else {
|
|
451
555
|
// Detta borde inte hända med data från suggestions, men för säkerhets skull
|
|
@@ -463,6 +567,9 @@ export class JobSelector {
|
|
|
463
567
|
}
|
|
464
568
|
}
|
|
465
569
|
handleCsClear() {
|
|
570
|
+
if (this.suggestionState?.status === 'pii-blocked') {
|
|
571
|
+
this.suggestionState = null;
|
|
572
|
+
}
|
|
466
573
|
this.controller.resetSearch();
|
|
467
574
|
}
|
|
468
575
|
handleCsClearHistory() {
|
|
@@ -572,6 +679,7 @@ export class JobSelector {
|
|
|
572
679
|
let coreStatus = 'loading';
|
|
573
680
|
let inputValue = '';
|
|
574
681
|
let suggestions = [];
|
|
682
|
+
let hasMoreResults;
|
|
575
683
|
let selectedItem;
|
|
576
684
|
let selectedItems = [];
|
|
577
685
|
let validation = 'idle';
|
|
@@ -615,6 +723,7 @@ export class JobSelector {
|
|
|
615
723
|
coreStatus = 'searching';
|
|
616
724
|
inputValue = componentState.inputValue;
|
|
617
725
|
suggestions = componentState.suggestions.map(s => this._mapSearchResultToGenericItem(s));
|
|
726
|
+
hasMoreResults = this.controller?.hasMoreResults(componentState.suggestions);
|
|
618
727
|
break;
|
|
619
728
|
case 'showingHistory':
|
|
620
729
|
coreStatus = 'searching';
|
|
@@ -632,6 +741,7 @@ export class JobSelector {
|
|
|
632
741
|
inputValue = componentState.inputValue;
|
|
633
742
|
suggestions = componentState.suggestions.map(s => this._mapSearchResultToGenericItem(s));
|
|
634
743
|
selectedItems = componentState.selectedItems.map(s => this._mapSearchResultToGenericItem(s));
|
|
744
|
+
hasMoreResults = this.controller?.hasMoreResults(componentState.suggestions);
|
|
635
745
|
break;
|
|
636
746
|
case 'multiSelectShowingHistory':
|
|
637
747
|
coreStatus = 'multiSelect';
|
|
@@ -679,6 +789,11 @@ export class JobSelector {
|
|
|
679
789
|
listHeader = undefined;
|
|
680
790
|
showHistoryHeader = false;
|
|
681
791
|
}
|
|
792
|
+
// PII-spärren visas som valideringsfel i sökfältet, så att det kopplas med aria-describedby.
|
|
793
|
+
if (this.suggestionState?.status === 'pii-blocked') {
|
|
794
|
+
validation = 'error';
|
|
795
|
+
message = 'Texten verkar innehålla personuppgifter, till exempel personnummer, e-post eller telefonnummer. Skriv bara yrket du vill föreslå.';
|
|
796
|
+
}
|
|
682
797
|
return {
|
|
683
798
|
status: coreStatus,
|
|
684
799
|
inputValue,
|
|
@@ -690,7 +805,11 @@ export class JobSelector {
|
|
|
690
805
|
message,
|
|
691
806
|
listHeader,
|
|
692
807
|
showHistoryHeader,
|
|
693
|
-
isHistoryView
|
|
808
|
+
isHistoryView,
|
|
809
|
+
// Det spärrade förslaget erbjuds inte igen förrän texten har ändrats.
|
|
810
|
+
manualInputBlocked: this.suggestionState?.status === 'pii-blocked',
|
|
811
|
+
// Om det finns fler träffar än som visas ("Minst N förslag" för skärmläsare).
|
|
812
|
+
hasMoreResults,
|
|
694
813
|
};
|
|
695
814
|
}
|
|
696
815
|
render() {
|
|
@@ -711,11 +830,35 @@ export class JobSelector {
|
|
|
711
830
|
manualInputBehavior: 'select',
|
|
712
831
|
showHistoryHeader: this.history && !selectorState.listHeader, // Only show default if not override
|
|
713
832
|
listHeader: selectorState.listHeader,
|
|
714
|
-
enableInfiniteScroll: true
|
|
833
|
+
enableInfiniteScroll: true,
|
|
834
|
+
isFeedback: this.feedback,
|
|
835
|
+
manualInputMode: (this.manualInput && this.feedback)
|
|
836
|
+
? 'combined'
|
|
837
|
+
: this.feedback
|
|
838
|
+
? 'feedback'
|
|
839
|
+
: 'manual',
|
|
840
|
+
feedbackTargetName: 'yrke',
|
|
715
841
|
};
|
|
716
842
|
// Pass external error message if present and we are not in loading/error state
|
|
717
843
|
// (This logic is now moved to _mapStateToSelectorState to respect validation state)
|
|
718
|
-
return (h("div", { key: '
|
|
844
|
+
return (h("div", { key: '12dea63f349ce625d4ea7041533dd328391532c2', class: "job-selector-wrapper" }, this.state.status === 'error' ? (h("div", { class: "error-message" }, h(AfValidationMessage, { variant: "error", role: "alert" }, this.state.message || 'Ett fel uppstod.'))) : (h(Fragment, null, h("core-selector", { id: this.componentId, componentId: this.componentId, state: selectorState, config: config, label: this.label, labelDescription: this.labelDescription, size: this.size, afFocused: this.afFocused }), this.suggestionState && this.suggestionState.status !== 'pii-blocked' && (h("div", { key: "yv-suggestion-box", class: "yv-suggestion-box", role: "region", "aria-label": "F\u00F6resl\u00E5 saknat yrke" }, this.suggestionState.status === 'form' ? (h("div", { class: "yv-suggestion-form" }, h("div", { class: "yv-suggestion-title", id: `${this.componentId}-suggestion-title` }, "Motivera varf\u00F6r \"", h("strong", null, this.suggestionState.term), "\" b\u00F6r l\u00E4ggas till som yrke (frivilligt):"), h("div", { class: "yv-motivation-container" }, h("div", { class: "yv-motivation-field-wrapper" }, h("textarea", { id: `${this.componentId}-suggestion-motivation-input`, "aria-labelledby": `${this.componentId}-suggestion-title`, "aria-describedby": this.suggestionState.piiError
|
|
845
|
+
? `${this.componentId}-motivation-pii-error ${this.componentId}-motivation-counter`
|
|
846
|
+
: `${this.componentId}-motivation-counter`, "aria-invalid": this.suggestionState.piiError ? 'true' : 'false', class: "yv-motivation-input", value: this.suggestionState.motivation, maxLength: 160, rows: 2, ref: (el) => {
|
|
847
|
+
if (el) {
|
|
848
|
+
el.style.height = 'auto';
|
|
849
|
+
el.style.height = `${Math.max(el.scrollHeight, 44)}px`;
|
|
850
|
+
}
|
|
851
|
+
}, onInput: (e) => {
|
|
852
|
+
const target = e.target;
|
|
853
|
+
target.style.height = 'auto';
|
|
854
|
+
target.style.height = `${Math.max(target.scrollHeight, 44)}px`;
|
|
855
|
+
const val = target.value;
|
|
856
|
+
if (this.suggestionState) {
|
|
857
|
+
this.suggestionState = { ...this.suggestionState, motivation: val, piiError: false };
|
|
858
|
+
}
|
|
859
|
+
} }), h("div", { id: `${this.componentId}-motivation-counter`, class: "yv-motivation-counter" }, (this.suggestionState.motivation || '').length, "/160")), this.suggestionState.piiError && (h("div", { id: `${this.componentId}-motivation-pii-error`, class: "yv-suggestion-pii-error", role: "alert" }, "Motiveringen verkar inneh\u00E5lla personuppgifter, till exempel personnummer, e-post eller telefonnummer. Ta bort dem f\u00F6r att kunna skicka.")), h("div", { class: "yv-suggestion-actions" }, h("button", { type: "button", class: "yv-suggestion-submit-btn", "aria-label": `Skicka förslag för "${this.suggestionState.term}" till Arbetsförmedlingen`, onClick: () => this.submitSuggestion() }, "Skicka"), h("button", { type: "button", class: "yv-suggestion-cancel-btn", "aria-label": "Avbryt f\u00F6rslag", onClick: () => this.closeSuggestion() }, "Avbryt"))))) : this.suggestionState.status === 'submitted' ? (h("div", { class: "yv-suggestion-success" }, h("span", null, "F\u00F6rslaget \"", h("strong", null, this.suggestionState.term), "\" har skickats in till Arbetsf\u00F6rmedlingen."), h("button", { type: "button", class: "yv-suggestion-close-btn", "aria-label": "St\u00E4ng bekr\u00E4ftelse", onClick: () => this.closeSuggestion() }, "St\u00E4ng"))) : null)), h("div", { key: "yv-suggestion-live-region", class: "yv-sr-only", role: "status", "aria-live": "polite" }, this.suggestionState?.status === 'submitted'
|
|
860
|
+
? `Förslaget "${this.suggestionState.term}" har skickats in till Arbetsförmedlingen.`
|
|
861
|
+
: '')))));
|
|
719
862
|
}
|
|
720
863
|
static get is() { return "digi-service-job-selector"; }
|
|
721
864
|
static get encapsulation() { return "shadow"; }
|
|
@@ -942,7 +1085,7 @@ export class JobSelector {
|
|
|
942
1085
|
"optional": false,
|
|
943
1086
|
"docs": {
|
|
944
1087
|
"tags": [],
|
|
945
|
-
"text": "Om satt till `true`
|
|
1088
|
+
"text": "Om satt till `true` kan anv\u00E4ndaren ange ett yrke som fritext n\u00E4r det inte finns i listan."
|
|
946
1089
|
},
|
|
947
1090
|
"getter": false,
|
|
948
1091
|
"setter": false,
|
|
@@ -950,6 +1093,26 @@ export class JobSelector {
|
|
|
950
1093
|
"attribute": "af-manual-input",
|
|
951
1094
|
"defaultValue": "false"
|
|
952
1095
|
},
|
|
1096
|
+
"feedback": {
|
|
1097
|
+
"type": "boolean",
|
|
1098
|
+
"mutable": false,
|
|
1099
|
+
"complexType": {
|
|
1100
|
+
"original": "boolean",
|
|
1101
|
+
"resolved": "boolean",
|
|
1102
|
+
"references": {}
|
|
1103
|
+
},
|
|
1104
|
+
"required": false,
|
|
1105
|
+
"optional": false,
|
|
1106
|
+
"docs": {
|
|
1107
|
+
"tags": [],
|
|
1108
|
+
"text": "Om satt till `true` kan anv\u00E4ndaren f\u00F6resl\u00E5 ett saknat yrke med motivering."
|
|
1109
|
+
},
|
|
1110
|
+
"getter": false,
|
|
1111
|
+
"setter": false,
|
|
1112
|
+
"reflect": true,
|
|
1113
|
+
"attribute": "af-feedback",
|
|
1114
|
+
"defaultValue": "false"
|
|
1115
|
+
},
|
|
953
1116
|
"history": {
|
|
954
1117
|
"type": "boolean",
|
|
955
1118
|
"mutable": false,
|
|
@@ -1039,6 +1202,7 @@ export class JobSelector {
|
|
|
1039
1202
|
}
|
|
1040
1203
|
static get states() {
|
|
1041
1204
|
return {
|
|
1205
|
+
"suggestionState": {},
|
|
1042
1206
|
"afFocused": {},
|
|
1043
1207
|
"state": {},
|
|
1044
1208
|
"activeErrorType": {},
|
|
@@ -1047,6 +1211,28 @@ export class JobSelector {
|
|
|
1047
1211
|
}
|
|
1048
1212
|
static get events() {
|
|
1049
1213
|
return [{
|
|
1214
|
+
"method": "afOnSubmitJobSuggestion",
|
|
1215
|
+
"name": "afOnSubmitJobSuggestion",
|
|
1216
|
+
"bubbles": true,
|
|
1217
|
+
"cancelable": true,
|
|
1218
|
+
"composed": true,
|
|
1219
|
+
"docs": {
|
|
1220
|
+
"tags": [],
|
|
1221
|
+
"text": "Emitteras n\u00E4r anv\u00E4ndaren skickar in ett f\u00F6rslag p\u00E5 saknat yrke via f\u00F6rslagsformul\u00E4ret (`af-feedback`)."
|
|
1222
|
+
},
|
|
1223
|
+
"complexType": {
|
|
1224
|
+
"original": "JobSuggestionEvent",
|
|
1225
|
+
"resolved": "JobSuggestionEvent",
|
|
1226
|
+
"references": {
|
|
1227
|
+
"JobSuggestionEvent": {
|
|
1228
|
+
"location": "import",
|
|
1229
|
+
"path": "./types",
|
|
1230
|
+
"id": "src/components/job-selector/types.ts::JobSuggestionEvent",
|
|
1231
|
+
"referenceLocation": "JobSuggestionEvent"
|
|
1232
|
+
}
|
|
1233
|
+
}
|
|
1234
|
+
}
|
|
1235
|
+
}, {
|
|
1050
1236
|
"method": "afJobSelectedEmitter",
|
|
1051
1237
|
"name": "afJobSelected",
|
|
1052
1238
|
"bubbles": true,
|
|
@@ -1283,7 +1469,10 @@ export class JobSelector {
|
|
|
1283
1469
|
"methodName": "watchRequired"
|
|
1284
1470
|
}, {
|
|
1285
1471
|
"propName": "manualInput",
|
|
1286
|
-
"methodName": "
|
|
1472
|
+
"methodName": "watchManualInputOrFeedback"
|
|
1473
|
+
}, {
|
|
1474
|
+
"propName": "feedback",
|
|
1475
|
+
"methodName": "watchManualInputOrFeedback"
|
|
1287
1476
|
}, {
|
|
1288
1477
|
"propName": "history",
|
|
1289
1478
|
"methodName": "watchHistory"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as e,transformTag as t,proxyCustomElement as i,HTMLElement as s,createEvent as o}from"@stencil/core/internal/client";function a(e,t=!1){if(!e||t)return!1;const i=e.inputValue.trim();return""!==i&&!e.suggestions.some((e=>e.label.toLowerCase()===i.toLowerCase()))}function r(e,t,i){return i<=0?-1:"down"===e?t<i-1?t+1:t:t>0?t-1:-1}const n={search:'<svg width="26" height="26" viewBox="0 0 26 26" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" style="width:100%;height:100%"><path d="M25.645 22.437l-5.063-5.053a1.22 1.22 0 00-.864-.355h-.827a10.477 10.477 0 002.234-6.487C21.125 4.719 16.397 0 10.562 0 4.729 0 0 4.719 0 10.542c0 5.823 4.728 10.542 10.563 10.542 2.452 0 4.707-.831 6.5-2.23v.826c0 .324.126.633.355.862l5.063 5.053c.477.476 1.25.476 1.721 0l1.437-1.435a1.22 1.22 0 00.006-1.723zm-15.082-5.408c-3.59 0-6.5-2.899-6.5-6.487a6.49 6.49 0 016.5-6.487c3.59 0 6.5 2.899 6.5 6.487a6.49 6.49 0 01-6.5 6.487z" fill="currentColor" fill-rule="nonzero"/></svg>',check:'<svg width="23" height="18" viewBox="0 0 23 18" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" style="width:100%;height:100%"><path d="M20.547.18L7.315 13.627 2.453 8.686a.597.597 0 00-.853 0L.177 10.132a.62.62 0 000 .868l6.711 6.82c.236.24.618.24.854 0L22.823 2.493a.62.62 0 000-.867L21.4.18a.597.597 0 00-.853 0z" fill="currentColor"/></svg>',x:'<svg width="12" height="12" viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" style="width:100%;height:100%"><g stroke="currentColor" stroke-width="2" fill="none" fill-rule="evenodd" stroke-linecap="square"><path d="M2 2l7.986 7.986M9.986 2L2 9.986"/></g></svg>'},l=({name:t,class:i})=>e("span",{class:i,"aria-hidden":"true",innerHTML:n[t],style:{display:"flex",width:i?void 0:"12px",height:i?void 0:"12px",minHeight:"1.4em",alignItems:"center"}}),c=({label:t,forId:i,description:s,required:o=!1})=>e("div",{class:"af-form-label"},e("label",{class:"af-form-label__label",htmlFor:i},t,o?" *":""),s&&e("span",{class:"af-form-label__description"},s)),h=({text:t,breakWords:i=!1,onRemove:s})=>e("span",{class:"af-tag"},e("button",{type:"button",class:"af-tag__button","aria-label":`Ta bort ${t}`,onClick:e=>{e.preventDefault(),s()}},e("span",{class:{"af-tag__text":!0,"af-tag__text--break":i}},t),e(l,{name:"x",class:"af-tag__remove-icon"}))),d=(t,i)=>{const s=t.class||"";return e("div",{id:t.id,role:t.role,class:{[s]:!!s}},e("div",{class:{"af-validation-message":!0,[`af-validation-message--${t.variant}`]:!0}},e("span",{class:{"af-validation-message__icon":!0,[`af-validation-message__icon--${t.variant}`]:!0},"aria-hidden":"true"}),e("span",{class:"af-validation-message__text"},i)))},g=i(class t extends s{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.csInput=o(this,"csInput",7),this.csSelect=o(this,"csSelect",7),this.csClear=o(this,"csClear",7),this.csRemoveItem=o(this,"csRemoveItem",7),this.csBlur=o(this,"csBlur",7),this.csEditSelection=o(this,"csEditSelection",7),this.csFocus=o(this,"csFocus",7),this.csLoadMore=o(this,"csLoadMore",7),this.csClearHistory=o(this,"csClearHistory",7),this.csRequestHistory=o(this,"csRequestHistory",7)}historyRequestTimer;disconnectedCallback(){clearTimeout(this.historyRequestTimer),this.historyRequestTimer=void 0}static nextId=0;get hostElement(){return this}state;config={disabled:!1,placeholder:"Sök...",minLength:1,maxResults:20,enableMultiple:!1,showSearchIcon:!0,requireSelection:!0,size:"medium"};label="";labelDescription;componentId="cs-"+t.nextId++;size="medium";csInput;csSelect;csClear;csRemoveItem;csBlur;csEditSelection;csFocus;csLoadMore;csClearHistory;csRequestHistory;afFocused=!1;activeIndex=-1;isFocusedInternal=!1;isNavigatingWithKeyboard=!1;isKeyboardNavigationActive=!1;async setFocus(){if(this.inputRef){this.inputRef.focus();const e=this.inputRef.value.length;this.inputRef.setSelectionRange(e,e)}else this.shouldFocusAfterRender=!0}inputRef;listRef;shouldFocusAfterRender=!1;handleKeyDown=e=>{if(this.config.disabled)return void e.preventDefault();if(!this.state)return;if("BUTTON"===e.target?.tagName)return;if("ArrowUp"!==e.key&&"ArrowDown"!==e.key&&"Enter"!==e.key&&"Escape"!==e.key&&(this.isKeyboardNavigationActive=!1,this.isNavigatingWithKeyboard=!1),"itemSelected"===this.state.status&&"Tab"!==e.key&&"Shift"!==e.key&&!e.ctrlKey&&!e.metaKey)return void this.csEditSelection.emit();if("searching"!==this.state.status&&"multiSelect"!==this.state.status)return;const t=this.state.suggestions,i=a(this.state,this.config.requireSelection),s=t.length+(i?1:0);switch(e.key){case"ArrowDown":s>0?(e.preventDefault(),this.isKeyboardNavigationActive=!0,this.isNavigatingWithKeyboard=!0,this.activeIndex=r("down",this.activeIndex,s),this.scrollToActive(),this.activeIndex>=t.length-3&&this.csLoadMore.emit()):this.csFocus.emit();break;case"ArrowUp":s>0&&(e.preventDefault(),this.isKeyboardNavigationActive=!0,this.isNavigatingWithKeyboard=!0,this.activeIndex=r("up",this.activeIndex,s),this.activeIndex>=0?this.scrollToActive():(this.isKeyboardNavigationActive=!1,this.isNavigatingWithKeyboard=!1));break;case" ":case"Enter":if(" "===e.key&&-1===this.activeIndex)return;if(this.activeIndex>=0&&this.activeIndex<t.length){e.preventDefault();const i=t[this.activeIndex];this.shouldFocusAfterRender=!0,i.isSelected?this.csRemoveItem.emit(i):this.csSelect.emit(i)}else i&&this.activeIndex===t.length&&this.isNavigatingWithKeyboard?(e.preventDefault(),this.handleManualSelect()):"Enter"===e.key&&(i||t.length>0)&&(e.preventDefault(),this.isNavigatingWithKeyboard=!0);break;case"Escape":this.activeIndex=-1,this.csClear.emit()}};onWrapperFocusIn=()=>{this.config.disabled||this.state&&this.isFocusedInternal||this.state&&(this.isFocusedInternal=!0,this.activeIndex=-1,this.csFocus.emit(),""===this.state.inputValue.trim()&&this.csRequestHistory.emit())};onWrapperFocusOut=()=>{this.shouldFocusAfterRender||requestAnimationFrame((()=>{const e=this.hostElement.shadowRoot,t=e?.activeElement||document.activeElement;t&&this.hostElement.contains(t)||e&&e.contains(t)||(this.isFocusedInternal=!1,this.activeIndex=-1,this.csBlur.emit())}))};handleAfFocusedChange(e){this.isFocusedInternal=e,e&&(this.shouldFocusAfterRender=!0)}handleConfigChange(e){e.disabled&&(this.isFocusedInternal=!1,this.activeIndex=-1,this.shouldFocusAfterRender=!1)}handleStateChange(e,t){const i=function({activeIndex:e,newState:t,oldState:i,requireSelection:s=!1}){if(i&&t.inputValue!==i.inputValue)return{activeIndex:-1,shouldRestoreFocus:!1};let o=e;"multiSelect"===t.status&&"multiSelect"===i?.status&&t.selectedItems.length>i.selectedItems.length&&(o=0);const r=a(i,s),n=Boolean(i&&r&&e===i.suggestions.length),l=a(t,s),c=t.suggestions.length+(l?1:0);return n?o=l?t.suggestions.length:-1:0===c?o=-1:o>=c&&(o=c-1),{activeIndex:o,shouldRestoreFocus:"itemSelected"===t.status&&"itemSelected"!==i?.status}}({activeIndex:this.activeIndex,newState:e,oldState:t,requireSelection:this.config.requireSelection});this.activeIndex=i.activeIndex,i.shouldRestoreFocus&&(this.shouldFocusAfterRender=!0)}componentDidUpdate(){this.shouldFocusAfterRender&&this.performFocusRestoration()}performFocusRestoration(e=0){if(this.config.disabled)this.shouldFocusAfterRender=!1;else if(this.inputRef){this.isFocusedInternal=!0,this.inputRef.focus();const t=this.hostElement.shadowRoot?.activeElement;if(t===this.inputRef||e>20){const e=this.inputRef.value.length;this.inputRef.setSelectionRange(e,e),this.shouldFocusAfterRender=!1}else requestAnimationFrame((()=>this.performFocusRestoration(e+1)))}}handleScroll(e){if(!this.config.enableInfiniteScroll)return;const t=e.target;t.scrollHeight-(t.scrollTop+t.clientHeight)<50&&this.csLoadMore.emit()}handleMouseMove=e=>{0===e.movementX&&0===e.movementY||this.isKeyboardNavigationActive&&(this.isKeyboardNavigationActive=!1,this.isNavigatingWithKeyboard=!1)};handleMouseLeave=()=>{this.isKeyboardNavigationActive||(this.activeIndex=-1)};scrollToActive(){if(!this.listRef||!this.state)return;if(-1===this.activeIndex)return void(this.listRef.scrollTop=0);const e=this.listRef.querySelector("#"+(this.activeIndex===this.state.suggestions.length?`${this.componentId}-list-option-manual-input`:`${this.componentId}-list-option-${this.activeIndex}`));if(!e)return;const t=this.listRef.getBoundingClientRect(),i=e.getBoundingClientRect();i.bottom>t.bottom?this.listRef.scrollTop+=i.bottom-t.bottom:i.top<t.top&&(this.listRef.scrollTop-=t.top-i.top)}handleManualSelect(){const e={id:"",label:this.state.inputValue.trim(),metadata:{type:"ManualInput"}};this.shouldFocusAfterRender=!0,this.csSelect.emit(e),this.config.enableMultiple&&""===this.state?.inputValue?.trim()&&this.csRequestHistory.emit()}render(){if(!this.state)return null;const t="itemSelected"===this.state.status;return e("div",{class:{"core-selector-wrapper":!0,"is-disabled":!!this.config.disabled},"aria-disabled":this.config.disabled?"true":"false",onKeyDown:e=>this.handleKeyDown(e),onMouseMove:this.handleMouseMove,onFocusin:this.onWrapperFocusIn,onFocusout:this.onWrapperFocusOut},this.label&&e(c,{label:this.label,forId:`${this.componentId}-input`,description:this.labelDescription}),this.labelDescription&&e("div",{id:`${this.componentId}-description`,class:"visually-hidden"},this.labelDescription),this.state&&"loading"===this.state.status&&e("div",{class:"loading-indicator"},"Laddar..."),this.state&&"error"===this.state.status&&e("div",{class:"error-message"},this.state.message),this.state&&["searching","itemSelected","multiSelect"].includes(this.state.status)&&e("div",{class:"combobox-container"},this.renderSearchContainer(),this.isFocusedInternal&&!t&&this.renderSuggestionsList()),this.state&&"idle"!==this.state.validation&&"itemSelected"!==this.state.status&&e(d,{id:`${this.componentId}-validation-message`,variant:"error"===this.state.validation?"error":"success",role:"error"===this.state.validation?"alert":void 0,class:"selector-validation-message"},this.state.message))}renderSearchContainer(){const t="itemSelected"===this.state.status,i=t?this.state.selectedItem?.label||"":this.state.inputValue,s="multiSelect"===this.state.status,o=i.length>0,r=s&&this.state.selectedItems.length>0,n=this.state&&(this.state.suggestions.length>0||a(this.state,this.config.requireSelection)),c=this.activeIndex>=0&&this.isNavigatingWithKeyboard?this.activeIndex===this.state.suggestions.length?`${this.componentId}-list-option-manual-input`:`${this.componentId}-list-option-${this.activeIndex}`:void 0,d=`${this.componentId}-validation-message`,g=this.state&&"error"===this.state.validation&&this.state.message,p=[];!!this.labelDescription&&0===i.length&&p.push(`${this.componentId}-description`),g&&p.push(d);const u=p.length>0?p.join(" "):void 0;return e("div",{class:{"search-container":!0,"is-inactive-selected":t,"multi-search-container":s,"has-tags":r,"has-validation-error":"error"===this.state?.validation,"has-positive-validation":!t&&"success"===this.state?.validation},onClick:()=>{this.config.disabled||(t?this.csEditSelection.emit():""===this.state.inputValue.trim()&&this.csRequestHistory.emit())}},s&&this.state.selectedItems.length>0&&e("div",{class:"selected-tags-wrapper"},this.state.selectedItems.map((t=>e(h,{key:t.id,text:t.label,breakWords:!0,onRemove:()=>{this.shouldFocusAfterRender=!0,this.csRemoveItem.emit(t)}})))),e("div",{class:"input-controls-wrapper"},e(l,{name:"search",class:{"search-icon-container":!0,"selector-search-icon":!0,"is-hidden":!this.config.showSearchIcon||o||r}}),e("div",{class:{"input-area":!0,"has-value":!this.config.showSearchIcon||o||r}},t&&e("span",{class:"selected-text-in-box"},i),!t&&!o&&this.config.placeholder&&e("span",{class:"selector-placeholder-overlay","aria-hidden":"true"},this.config.placeholder),e("input",{class:{"selector-input-field":!0,"visually-hidden-selected":t},ref:e=>this.inputRef=e,id:`${this.componentId}-input`,type:"text",value:i,maxLength:120,onInput:e=>{this.config.disabled||(this.isKeyboardNavigationActive=!1,this.isNavigatingWithKeyboard=!1,this.csInput.emit(e.target.value))},autocomplete:"off",role:"combobox","aria-label":this.label,"aria-autocomplete":"list","aria-haspopup":"listbox","aria-expanded":!t&&n&&this.isNavigatingWithKeyboard?"true":"false","aria-controls":!t&&n&&this.isNavigatingWithKeyboard?`${this.componentId}-listbox`:void 0,"aria-activedescendant":c,"aria-invalid":g?"true":"false","aria-describedby":u,readOnly:t,disabled:!!this.config.disabled})),e("button",{type:"button",class:{"clear-button":!0,"is-visible":o||t},tabIndex:o||t?0:-1,disabled:!!this.config.disabled,"aria-label":"Rensa inmatad text",onMouseDown:e=>e.preventDefault(),onClick:()=>{this.config.disabled||(this.csInput.emit(""),this.shouldFocusAfterRender=!0,this.csClear.emit(),this.csRequestHistory.emit())}},e(l,{name:"x"}))))}renderSuggestionsList(){if("itemSelected"===this.state.status)return null;const t=Boolean(this.state.inputValue&&this.state.inputValue.trim().length>0),i=a(this.state,this.config.requireSelection),s=Boolean(this.state.suggestions&&this.state.suggestions.length>0),o=t&&!s&&!i;if(!s&&!i&&!o)return null;const r=this.state.listHeader||this.config.listHeader,n=this.state.showHistoryHeader||this.state.isHistoryView&&this.config.showHistoryHeader;return e("div",{class:"suggestions-box-container"},e("div",{class:{"suggestions-box":!0,"is-keyboard-nav":this.isNavigatingWithKeyboard},ref:e=>this.listRef=e,onScroll:e=>this.handleScroll(e),onMouseLeave:this.handleMouseLeave},(r||n)&&e("div",{class:"list-header-container"},e("slot",{name:"suggestions-overlay"}),r&&e("div",{class:"list-header"},e("span",null,r)),n&&e("div",{class:"list-header history-header"},e("span",null,"Din privata historik")," - ",e("button",{type:"button",class:"history-clear-link","aria-label":"Rensa historik",disabled:!!this.config.disabled,onMouseDown:e=>e.preventDefault(),onClick:()=>{this.config.disabled||this.csClearHistory.emit()}},"Rensa"))),!r&&!n&&e("slot",{name:"suggestions-overlay"}),e("div",{id:`${this.componentId}-listbox`,role:"listbox"},o&&e("div",{class:"suggestion-item no-results"},"Inga resultat matchade din sökning"),!o&&this.state.suggestions.map(((t,i)=>e("div",{key:t.id?`${t.id}|${t.label}`:i,role:"option",id:`${this.componentId}-list-option-${i}`,"aria-selected":!!t.isSelected,"aria-current":i===this.activeIndex?"true":"false",class:{"suggestion-item":!0,"active-suggestion":i===this.activeIndex,"is-selected":!!t.isSelected,"is-keyboard-focus":i===this.activeIndex&&this.isNavigatingWithKeyboard},onMouseDown:e=>{e.preventDefault(),this.config.disabled||(this.shouldFocusAfterRender=!0,t.isSelected?this.csRemoveItem.emit(t):this.csSelect.emit(t),this.config.enableMultiple&&(clearTimeout(this.historyRequestTimer),this.historyRequestTimer=setTimeout((()=>{this.csRequestHistory.emit(),this.historyRequestTimer=void 0}),50)))},onMouseMove:this.handleMouseMove,onMouseEnter:()=>{this.config.disabled||this.isKeyboardNavigationActive||(this.isNavigatingWithKeyboard=!1,t.isSelected||(this.activeIndex=i))}},e(l,{name:"check",class:"selection-indicator-icon"}),e("span",null,t.displaySegments?t.displaySegments.map(((t,i)=>e("span",{key:i,class:{"match-highlight":!!t.isMatch,"metadata-dimmed":!!t.isMetadata}},t.text))):t.label)))),!o&&a(this.state,this.config.requireSelection)&&e("div",{role:"option",id:`${this.componentId}-list-option-manual-input`,class:{"suggestion-item":!0,"active-suggestion":this.activeIndex===this.state.suggestions.length,"is-keyboard-focus":this.activeIndex===this.state.suggestions.length&&this.isNavigatingWithKeyboard},onMouseDown:e=>{e.preventDefault(),this.config.disabled||this.handleManualSelect()},onMouseMove:this.handleMouseMove,onMouseEnter:()=>{this.config.disabled||this.isKeyboardNavigationActive||(this.isNavigatingWithKeyboard=!1,this.activeIndex=this.state.suggestions.length)}},e("span",null,'Använd "',e("strong",null,this.state.inputValue.trim()),'"')))))}static get delegatesFocus(){return!0}static get watchers(){return{afFocused:[{handleAfFocusedChange:0}],config:[{handleConfigChange:0}],state:[{handleStateChange:0}]}}static get style(){return":host{--digi--grayscale-0:#ffffff;--digi--grayscale-50:#fbfbfb;--digi--grayscale-100:#f4f4f4;--digi--grayscale-200:#ededed;--digi--grayscale-300:#e4e4e4;--digi--grayscale-400:#dddddd;--digi--grayscale-500:#cacaca;--digi--grayscale-600:#acacac;--digi--grayscale-700:#757575;--digi--grayscale-800:#5c5c5c;--digi--grayscale-900:#333333;--digi--grayscale-1000:#000000;--digi--global--color--cta--link--base:#1616b2;--digi--global--color--function--danger--base:#da0000;--digi--global--color--function--success--base:#008a20;--digi--global--color--function--success--lightest-3:#d4edda;--digi--global--color--function--warning--base:#ffe200;--digi--color--text--primary:var(--digi--grayscale-900);--digi--color--text--secondary:var(--digi--grayscale-700);--digi--color--text--link:var(--digi--global--color--cta--link--base);--digi--color--icons--success:var(--digi--global--color--function--success--base);--digi--color--icons--warning:#8a7a00;--digi--color--icons--danger:var(--digi--global--color--function--danger--base);--digi--global--typography--font-family--default:\"Open Sans\", Arial, sans-serif;--digi--global--typography--font-size--base:1rem;--digi--global--typography--font-size--small:0.875rem;--digi--global--typography--font-weight--regular:400;--digi--global--typography--font-weight--semibold:600;--digi--global--typography--font-weight--bold:700;--digi--global--typography--line-height--base:1.5;--digi--typography--label--font-size--desktop:1rem;--digi--typography--label--font-weight--desktop:600;--digi--typography--label--line-height--desktop:1.5;--digi--typography--label-description--font-size--desktop:1rem;--digi--typography--label-description--line-height--desktop:1.5;--digi--typography--tag--font-size--desktop:0.875rem;--digi--gutter--icon:0.625rem;--digi--gutter--smaller:0.75rem;--digi--gutter--small:0.875rem;--digi--gutter--medium:1rem;--digi--border-width--primary:1px;--digi--border-style--primary:solid;--digi--border-radius--primary:0;--digi--border-radius--secondary:6px;--af-tag-color:#091d54;--af-tag-hover-background:#ddf1fc}.af-form-label{color:var(--digi--color--text--primary);display:flex;flex-direction:column;font-family:var(--digi--global--typography--font-family--default);font-size:var(--digi--typography--label--font-size--desktop);margin-bottom:0.5rem}.af-form-label__label{cursor:pointer;display:block;font-weight:var(--digi--typography--label--font-weight--desktop);line-height:var(--digi--typography--label--line-height--desktop)}.af-form-label__description{display:block;font-size:var(--digi--typography--label-description--font-size--desktop);line-height:var(--digi--typography--label-description--line-height--desktop);max-width:35rem}.af-validation-message{align-items:center;display:flex;flex-wrap:wrap}.af-validation-message__icon{flex:0 0 auto;height:1.25em;margin-inline-end:var(--digi--gutter--icon);width:1.25em}.af-validation-message__icon--success,.af-validation-message__icon--error{background-color:var(--af-validation-icon-color, currentColor);-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain}.af-validation-message__icon--success{--af-validation-icon-color:var(--digi--color--icons--success);-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 25 25'%3E%3Cpath d='M25 12.5C25 19.404 19.404 25 12.5 25S0 19.404 0 12.5 5.596 0 12.5 0 25 5.596 25 12.5zm-13.946 6.619l9.274-9.275a.806.806 0 000-1.14l-1.14-1.14a.806.806 0 00-1.14 0l-7.564 7.563-3.531-3.531a.807.807 0 00-1.14 0l-1.141 1.14a.806.806 0 000 1.14l5.242 5.243a.806.806 0 001.14 0z'/%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 25 25'%3E%3Cpath d='M25 12.5C25 19.404 19.404 25 12.5 25S0 19.404 0 12.5 5.596 0 12.5 0 25 5.596 25 12.5zm-13.946 6.619l9.274-9.275a.806.806 0 000-1.14l-1.14-1.14a.806.806 0 00-1.14 0l-7.564 7.563-3.531-3.531a.807.807 0 00-1.14 0l-1.141 1.14a.806.806 0 000 1.14l5.242 5.243a.806.806 0 001.14 0z'/%3E%3C/svg%3E\")}.af-validation-message__icon--error{--af-validation-icon-color:var(--digi--color--icons--danger);-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath d='M34.4328058,0 C35.5494848,0 36.5900526,0.609146757 37.1483921,1.58958113 L47.5812454,19.9104189 C48.1395849,20.8909496 48.1395849,22.1090504 47.5812454,23.0895811 L37.1483921,41.4104189 C36.5900526,42.3908532 35.5494848,43 34.4328058,43 L13.5671942,43 C12.4505152,43 11.4099474,42.3908532 10.8516079,41.4104189 L0.41875464,23.0895811 C-0.13958488,22.1090504 -0.13958488,20.8909496 0.41875464,19.9104189 L10.8516079,1.58958113 C11.4099474,0.609146757 12.4505152,0 13.5671942,0 Z M18.6736823,12.3728178 C18.2711762,11.964729 17.6203819,11.964729 17.2178757,12.3728178 L15.2825964,14.334939 C14.8800903,14.7430278 14.8800903,15.4028485 15.2825964,15.8109373 L20.6089616,21.2111779 L15.2825964,26.6114185 C14.8800903,27.0195074 14.8800903,27.6793281 15.2825964,28.0874169 L17.2178757,30.049538 C17.6203819,30.4576269 18.2711762,30.4576269 18.6736823,30.049538 L24.0000475,24.6492974 L29.3264127,30.049538 C29.7289188,30.4576269 30.3797132,30.4576269 30.7822193,30.049538 L32.7174986,28.0874169 C33.1200048,27.6793281 33.1200048,27.0195074 32.7174986,26.6114185 L27.3911334,21.2111779 L32.7174986,15.8109373 C33.1200048,15.4028485 33.1200048,14.7430278 32.7174986,14.334939 L30.7822193,12.3728178 C30.3797132,11.964729 29.7289188,11.964729 29.3264127,12.3728178 L24.0000475,17.7730584 Z'/%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath d='M34.4328058,0 C35.5494848,0 36.5900526,0.609146757 37.1483921,1.58958113 L47.5812454,19.9104189 C48.1395849,20.8909496 48.1395849,22.1090504 47.5812454,23.0895811 L37.1483921,41.4104189 C36.5900526,42.3908532 35.5494848,43 34.4328058,43 L13.5671942,43 C12.4505152,43 11.4099474,42.3908532 10.8516079,41.4104189 L0.41875464,23.0895811 C-0.13958488,22.1090504 -0.13958488,20.8909496 0.41875464,19.9104189 L10.8516079,1.58958113 C11.4099474,0.609146757 12.4505152,0 13.5671942,0 Z M18.6736823,12.3728178 C18.2711762,11.964729 17.6203819,11.964729 17.2178757,12.3728178 L15.2825964,14.334939 C14.8800903,14.7430278 14.8800903,15.4028485 15.2825964,15.8109373 L20.6089616,21.2111779 L15.2825964,26.6114185 C14.8800903,27.0195074 14.8800903,27.6793281 15.2825964,28.0874169 L17.2178757,30.049538 C17.6203819,30.4576269 18.2711762,30.4576269 18.6736823,30.049538 L24.0000475,24.6492974 L29.3264127,30.049538 C29.7289188,30.4576269 30.3797132,30.4576269 30.7822193,30.049538 L32.7174986,28.0874169 C33.1200048,27.6793281 33.1200048,27.0195074 32.7174986,26.6114185 L27.3911334,21.2111779 L32.7174986,15.8109373 C33.1200048,15.4028485 33.1200048,14.7430278 32.7174986,14.334939 L30.7822193,12.3728178 C30.3797132,11.964729 29.7289188,11.964729 29.3264127,12.3728178 L24.0000475,17.7730584 Z'/%3E%3C/svg%3E\")}.af-validation-message__icon--warning{background:center / contain no-repeat url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Ccircle cx='9' cy='9' r='6.75' fill='%23333'/%3E%3Cpath d='m18 9c0 4.9717-4.0298 9-9 9-4.9702 0-9-4.0283-9-9 0-4.9688 4.0298-9 9-9 4.9702 0 9 4.0312 9 9zm-9 1.8145c-0.92196 0-1.6694 0.7474-1.6694 1.6694 0 0.92196 0.7474 1.6694 1.6694 1.6694s1.6694-0.7474 1.6694-1.6694c0-0.92196-0.7474-1.6694-1.6694-1.6694zm-1.3157-1.065c0.012593 0.23095 0.20355 0.41175 0.43483 0.41175h1.7618c0.23128 0 0.42224-0.1808 0.43483-0.41175l0.2692-4.9355c0.013609-0.24946-0.18501-0.45922-0.43483-0.45922h-2.3002c-0.24982 0-0.4484 0.20976-0.43479 0.45922l0.2692 4.9355z' fill='%23FFE200'/%3E%3C/svg%3E\");position:relative;top:3px}.af-validation-message__text{color:var(--digi--color--text--primary);flex:1;font-family:var(--digi--global--typography--font-family--default);font-size:var(--digi--typography--tag--font-size--desktop);transform:translateY(1px)}.af-tag{display:block;max-width:100%;min-width:0}.af-tag__button{align-items:center;background:var(--digi--grayscale-0);border:var(--digi--border-width--primary) var(--digi--border-style--primary) var(--af-tag-color);border-radius:var(--digi--border-radius--secondary);color:var(--af-tag-color);cursor:pointer;display:inline-flex;font-family:var(--digi--global--typography--font-family--default);font-size:0.875rem;font-weight:var(--digi--global--typography--font-weight--semibold);gap:10px;height:auto;max-width:100%;min-height:unset;min-width:0;padding:6px 8px;text-align:left;white-space:normal}.af-tag__button:hover{background:var(--af-tag-hover-background)}.af-tag__button:focus-visible{background:var(--af-tag-hover-background);border-color:var(--af-tag-color);outline:2px solid var(--digi--grayscale-1000);outline-offset:2px;box-shadow:0 0 0 5px var(--digi--grayscale-0)}.af-tag__button:active{background:var(--af-tag-hover-background)}.af-tag__text{display:inline-block;max-width:100%;min-width:0;white-space:normal}.af-tag__text--break{overflow-wrap:anywhere;word-break:break-word}.af-tag__remove-icon{flex:0 0 auto;height:1em;min-height:0 !important;width:1em}:host{--selector-width:var(--cs-width, 100%);--selector-min-width:var(--cs-min-width, 200px);--selector-max-width:var(--cs-max-width, none);--selector-height:var(--cs-height, auto);--selector-min-height:var(--cs-min-height, auto);--selector-max-height:var(--cs-max-height, none);--selector-font-family:var(--global-font-family, 'Open Sans', sans-serif);--selector-font-size:var(--cs-font-size, 1rem);--selector-text-color:var(--cs-text-color, #212529);--selector-placeholder-color:var(--cs-placeholder-color, #6c757d);--selector-border-color:var(--cs-border-color, #d1d5db);--selector-focus-border-color:var(--cs-focus-border-color, #86b7fe);--selector-focus-shadow:var(--cs-focus-shadow, 0 0 0 0.25rem rgba(13, 110, 253, 0.25));--selector-background-color:var(--cs-background-color, #fff);--selector-icon-color:var(--cs-icon-color, #6c757d);--selector-clear-button-color:var(--cs-clear-button-color, #6c757d);--selector-clear-button-hover-color:var(--cs-clear-button-hover-color, #212529);--selector-suggestion-background-color:var(--cs-suggestion-background-color, #fff);--selector-suggestion-border-color:var(--cs-suggestion-border-color, #ced4da);--selector-suggestion-hover-background:var(--cs-suggestion-hover-background, #e9ecef);--selector-suggestion-active-background:var(--cs-suggestion-active-background, #dde4eb);--selector-suggestion-text-color:var(--cs-suggestion-text-color, #212529);--selector-suggestion-highlight-weight:var(--cs-suggestion-highlight-weight, bold);--selector-error-color:var(--cs-error-color, #dc3545);--selector-loading-color:var(--cs-loading-color, #6c757d);--selector-container-min-height:40px;--selector-padding-y:6px;--selector-padding-x:10px;--selector-icon-size:1.1em;--selector-gap:6px;--cs-row-height:32px;display:flex;flex-direction:column;width:var(--selector-width);min-width:var(--selector-min-width);max-width:var(--selector-max-width);height:var(--selector-height);min-height:var(--selector-min-height);max-height:var(--selector-max-height);font-family:var(--selector-font-family);font-size:var(--selector-font-size);color:var(--selector-text-color);position:relative}:host([cs-size=\"small\"]){--selector-container-min-height:32px;--selector-padding-y:2px;--selector-icon-size:1em;--selector-gap:4px;--cs-row-height:28px}:host([cs-size=\"medium\"]){--selector-container-min-height:40px;--selector-padding-y:6px;--cs-row-height:32px}:host([cs-size=\"large\"]){--selector-container-min-height:48px;--selector-padding-y:10px;--selector-icon-size:1.25em;--selector-gap:8px;--cs-row-height:40px}*{box-sizing:border-box}.core-selector-wrapper{display:flex;flex-direction:column;flex:1;min-height:inherit}.af-form-label{margin-bottom:0.5rem}.search-container{display:flex;align-items:center;flex-wrap:wrap;gap:6px;border:1px solid #757575;border-radius:0px;padding:var(--selector-padding-y) var(--selector-padding-x);flex:1;min-height:var(--selector-container-min-height);cursor:text;background-color:var(--selector-background-color);position:relative;overflow:hidden}.search-container:focus-within{outline:2px solid black;outline-offset:2px}.search-container.is-inactive-selected .selector-input-field{caret-color:transparent;cursor:default}.is-inactive-selected+.suggestions-box-container{display:none !important}.search-container.is-inactive-selected .search-icon-container{display:none}.search-container.is-inactive-selected .input-area{padding-left:0}.input-controls-wrapper{position:relative;width:100%;display:flex;align-items:center}.search-icon-container{position:absolute;left:0;top:50%;width:20px;height:20px;transform:translateY(-50%);z-index:1;pointer-events:none;display:flex;align-items:center;justify-content:center;transition:transform 0.2s ease-in-out, opacity 0.2s ease-in-out;opacity:1;max-height:100%}.search-icon-container.is-hidden{opacity:0;transform:translateY(-50%) scale(0.7)}.selector-search-icon{color:var(--digi--color--icon--primary, #333);display:block;flex:0 0 auto;width:20px;height:20px}.clear-button>span{color:var(--digi--color--icon--primary, #333)}.input-area{position:relative;flex:1;min-width:0;padding-left:27px;display:flex;align-items:center;transition:padding-left 0.2s ease-in-out}.input-area.has-value{padding-left:0}.selector-placeholder-overlay{position:absolute;left:27px;right:0;top:50%;transform:translateY(-50%);color:var(--selector-placeholder-color);font-family:inherit;font-size:var(--selector-font-size);line-height:normal;padding:1px 2px;pointer-events:none;user-select:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;transition:left 0.2s ease-in-out}.input-area.has-value .selector-placeholder-overlay{left:0}.selector-input-field{position:relative;z-index:1;width:100%;font-family:inherit;font-size:var(--selector-font-size);color:inherit;border:none;outline:none;background:transparent;transition:padding-right 0.2s ease-in-out}.search-container.has-input .selector-input-field{padding-right:0}.selector-input-field::placeholder{color:var(--selector-placeholder-color);opacity:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.clear-button{position:static;flex-shrink:0;opacity:0;pointer-events:none;z-index:2;background:none;border:none;padding:0;margin:0;height:20px;width:20px;cursor:pointer;color:var(--selector-clear-button-color);line-height:1;display:flex;align-items:center;transition:color 0.2s ease-in-out, opacity 0.2s ease-in-out}.clear-button.is-visible{opacity:1;pointer-events:auto}.clear-button:hover,.clear-button:focus{color:var(--selector-clear-button-hover-color);outline:none}.search-container.multi-search-container{display:flex;flex-direction:column;gap:0.5rem;align-items:stretch;padding-top:var(--selector-padding-y);padding-bottom:var(--selector-padding-y);width:100%;max-width:100%}.selected-tags-wrapper{display:flex;flex-wrap:wrap;gap:0.5rem;width:100%;max-width:100%;box-sizing:border-box}.selected-tags-wrapper .af-tag{display:block;max-width:100%;min-width:0}.selected-tags-wrapper .af-tag__button{white-space:normal !important;height:auto !important;text-align:left !important;word-break:break-word !important;overflow-wrap:anywhere !important;max-width:100% !important}.search-container.single-value-display{display:flex;align-items:center;flex-wrap:nowrap;gap:0.5rem;min-height:var(--selector-container-min-height);padding:var(--selector-padding-y) var(--selector-padding-x)}.selected-text-in-box{flex-grow:1;white-space:normal;word-break:break-word;min-width:0;line-height:inherit}.search-container.single-value-display .clear-button{position:static;transform:none;opacity:1;pointer-events:auto;flex-shrink:0}.combobox-container{position:relative;margin-top:0;display:flex;flex-direction:column;flex:1}.suggestions-box-container{position:absolute;top:100%;left:0;right:0;z-index:100}.suggestions-box-container.is-hidden-list{z-index:101;pointer-events:none}.suggestions-box{position:relative;background-color:white;border:1px solid var(--selector-suggestion-border-color);border-radius:4px;box-shadow:0 4px 12px rgba(0, 0, 0, 0.15);overflow-y:auto;margin:2px 0px;max-height:calc(var(--max-visible-rows, 10) * var(--cs-row-height) + 40px)}.suggestion-item{display:flex;align-items:center;min-height:var(--cs-row-height);height:auto;padding:6px 1rem;font-size:inherit;line-height:1.25;cursor:pointer;color:var(--selector-suggestion-text-color);list-style:none;transition:background-color 0.15s ease, color 0.15s ease;white-space:normal !important;word-break:break-word !important;overflow-wrap:anywhere !important;position:relative;z-index:1;box-sizing:border-box}.suggestion-item>span{transition:font-weight 0.2s ease, transform 0.2s ease;display:inline;vertical-align:middle;white-space:normal;word-break:break-word;overflow-wrap:anywhere}.suggestion-item:hover,.suggestion-item.active-suggestion{background-color:var(--selector-suggestion-active-background)}.suggestions-box.is-keyboard-nav .suggestion-item:hover:not(.active-suggestion){background-color:transparent}.suggestion-item.active-suggestion.is-keyboard-focus{outline:1px solid black;outline-offset:-1px}.suggestion-item.is-selected{color:var(--selector-suggestion-text-color) !important;cursor:default;background-color:#f2f2f2 !important}.suggestion-item.is-selected span{font-weight:600}.selection-indicator-icon{width:0;height:20px;opacity:0;transform:scale(0.5);margin-right:0;transition:width 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), margin-right 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);color:var(--digi--grayscale-800, #333);flex-shrink:0;display:flex;align-items:center;justify-content:center;overflow:hidden}.suggestion-item.is-selected .selection-indicator-icon{width:24px;opacity:1;transform:scale(1);margin-right:8px}.suggestion-item.is-selected.active-suggestion{background-color:#f2f2f2 !important}.suggestion-item .suggestion-text strong,.suggestion-item .match-highlight{font-weight:var(--selector-suggestion-highlight-weight);color:inherit;display:inline}.metadata-dimmed,.occupation-variant-label{font-size:1rem;color:var(--digi--grayscale-700, #757575);margin-left:0.25rem;display:inline;vertical-align:baseline;line-height:inherit;white-space:normal}.suggestion-item.no-results{color:var(--selector-placeholder-color);cursor:default;padding:0.5rem 1rem;font-style:italic;text-align:center;height:auto}.search-container.has-validation-error{border-color:var(--selector-error-color);border-width:2px;background-color:#fef3f2}.search-container.has-positive-validation{border-color:#155724;background-color:#d4edda}.status-message{margin-top:0.5rem}.selector-validation-message{margin-top:0.5rem;display:block}.visually-hidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}input::-webkit-search-decoration,input::-webkit-search-cancel-button,input::-webkit-search-results-button,input::-webkit-search-results-decoration{-webkit-appearance:none;display:none}input::-ms-clear{display:none;width:0;height:0}.list-header-container{position:sticky;top:0;z-index:10;background-color:#f8f9fa;border-bottom:1px solid var(--selector-suggestion-border-color);min-height:auto;display:flex;flex-direction:column}.list-header-container ::slotted([slot=\"suggestions-overlay\"]){position:absolute !important;top:0;left:0;width:100%;height:100%;z-index:20}.suggestions-box>::slotted([slot=\"suggestions-overlay\"]){position:sticky !important;top:0;left:0;width:100%;z-index:20}.list-header{display:flex;align-items:center;min-height:var(--cs-row-height);padding:6px 1rem;font-size:0.875rem;line-height:1.25;color:var(--digi--grayscale-700, #757575);border-bottom:1px solid var(--selector-suggestion-border-color, #ced4da)}.list-header span{font-size:0.875rem;font-weight:normal}.history-clear-link{color:var(--digi--grayscale-700, #757575);text-decoration:underline;cursor:pointer;margin-left:0.25rem;background:transparent;border:0;padding:0;font:inherit}.history-clear-link:hover{color:var(--digi--grayscale-900, #222)}@keyframes cs-shrink-fade{from{opacity:1}to{opacity:1}}@keyframes cs-collapse{from{height:auto}to{height:auto}}.cs-toast{position:absolute;top:0;left:0;width:100%;height:100%;z-index:20;display:flex;align-items:center;justify-content:center;gap:8px;background-color:#f8fdf0;animation:cs-toastSlideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;pointer-events:none;box-sizing:border-box}.cs-toast.is-closing{animation:cs-toastSlideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards}.cs-toast-text{margin:0;font-size:0.875rem;font-weight:500;color:#2e7d32}@keyframes cs-toastSlideDown{from{transform:translateY(-100%)}to{transform:translateY(0)}}@keyframes cs-toastSlideUp{from{transform:translateY(0)}to{transform:translateY(-100%)}}.selector-input-field.visually-hidden-selected{position:absolute;opacity:0;pointer-events:none;width:1px;height:1px;overflow:hidden}"}},[785,"core-selector",{state:[16],config:[16],label:[1],labelDescription:[1,"label-description"],componentId:[1,"component-id"],size:[513,"cs-size"],afFocused:[4,"af-focused"],activeIndex:[32],isFocusedInternal:[32],isNavigatingWithKeyboard:[32],setFocus:[64]},void 0,{afFocused:[{handleAfFocusedChange:0}],config:[{handleConfigChange:0}],state:[{handleStateChange:0}]}]);function p(){"undefined"!=typeof customElements&&["core-selector"].forEach((e=>{"core-selector"===e&&(customElements.get(t(e))||customElements.define(t(e),g))}))}p();export{d as A,g as C,p as d}
|
|
1
|
+
import{h as i,transformTag as t,proxyCustomElement as e,HTMLElement as s,createEvent as o}from"@stencil/core/internal/client";function a(i,t=!1){if(!i||t||i.manualInputBlocked)return!1;const e=i.inputValue.trim();return""!==e&&!i.suggestions.some((i=>i.label.toLowerCase()===e.toLowerCase()))}function r(i,t,e){return e<=0?-1:"down"===i?t<e-1?t+1:t:t>0?t-1:-1}const n={search:'<svg width="26" height="26" viewBox="0 0 26 26" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" style="width:100%;height:100%"><path d="M25.645 22.437l-5.063-5.053a1.22 1.22 0 00-.864-.355h-.827a10.477 10.477 0 002.234-6.487C21.125 4.719 16.397 0 10.562 0 4.729 0 0 4.719 0 10.542c0 5.823 4.728 10.542 10.563 10.542 2.452 0 4.707-.831 6.5-2.23v.826c0 .324.126.633.355.862l5.063 5.053c.477.476 1.25.476 1.721 0l1.437-1.435a1.22 1.22 0 00.006-1.723zm-15.082-5.408c-3.59 0-6.5-2.899-6.5-6.487a6.49 6.49 0 016.5-6.487c3.59 0 6.5 2.899 6.5 6.487a6.49 6.49 0 01-6.5 6.487z" fill="currentColor" fill-rule="nonzero"/></svg>',check:'<svg width="23" height="18" viewBox="0 0 23 18" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" style="width:100%;height:100%"><path d="M20.547.18L7.315 13.627 2.453 8.686a.597.597 0 00-.853 0L.177 10.132a.62.62 0 000 .868l6.711 6.82c.236.24.618.24.854 0L22.823 2.493a.62.62 0 000-.867L21.4.18a.597.597 0 00-.853 0z" fill="currentColor"/></svg>',x:'<svg width="12" height="12" viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" style="width:100%;height:100%"><g stroke="currentColor" stroke-width="2" fill="none" fill-rule="evenodd" stroke-linecap="square"><path d="M2 2l7.986 7.986M9.986 2L2 9.986"/></g></svg>'},l=({name:t,class:e})=>i("span",{class:{"af-icon":!0,"af-icon--default-size":!e,..."string"==typeof e?{[e]:!0}:e},"aria-hidden":"true",innerHTML:n[t]}),c=({label:t,forId:e,description:s,required:o=!1})=>i("div",{class:"af-form-label"},i("label",{class:"af-form-label__label",htmlFor:e},t,o?" *":""),s&&i("span",{class:"af-form-label__description"},s)),h=({text:t,breakWords:e=!1,onRemove:s})=>i("span",{class:"af-tag"},i("button",{type:"button",class:"af-tag__button","aria-label":`Ta bort ${t}`,onClick:i=>{i.preventDefault(),s()}},i("span",{class:{"af-tag__text":!0,"af-tag__text--break":e}},t),i(l,{name:"x",class:"af-tag__remove-icon"}))),d=(t,e)=>{const s=t.class||"";return i("div",{id:t.id,role:t.role,class:{[s]:!!s}},i("div",{class:{"af-validation-message":!0,[`af-validation-message--${t.variant}`]:!0}},i("span",{class:{"af-validation-message__icon":!0,[`af-validation-message__icon--${t.variant}`]:!0},"aria-hidden":"true"}),i("span",{class:"af-validation-message__text"},e)))},g=e(class t extends s{constructor(i){super(),!1!==i&&this.__registerHost(),this.__attachShadow(),this.csInput=o(this,"csInput",7),this.csSelect=o(this,"csSelect",7),this.csClear=o(this,"csClear",7),this.csRemoveItem=o(this,"csRemoveItem",7),this.csBlur=o(this,"csBlur",7),this.csEditSelection=o(this,"csEditSelection",7),this.csFocus=o(this,"csFocus",7),this.csLoadMore=o(this,"csLoadMore",7),this.csClearHistory=o(this,"csClearHistory",7),this.csRequestHistory=o(this,"csRequestHistory",7)}static RESULT_ANNOUNCEMENT_DELAY_MS=1200;static ERROR_AFTER_COLLAPSE_DELAY_MS=400;static ACTIVE_DESCENDANT_DELAY_MS=75;static LIVE_REGION_RESTORE_DELAY_MS=100;historyRequestTimer;resultAnnouncementTimer;resultRestoreTimer;validationRestoreTimer;validationRestoreDelayMs=0;activeDescendantTimer;disconnectedCallback(){clearTimeout(this.historyRequestTimer),this.historyRequestTimer=void 0,this.clearResultAnnouncement(),clearTimeout(this.validationRestoreTimer),this.validationRestoreTimer=void 0,this.validationRestoreDelayMs=0,this.isValidationMessageHidden=!1,this.clearDeferredActiveDescendant()}static nextId=0;get hostElement(){return this}state;config={disabled:!1,placeholder:"Sök...",minLength:1,maxResults:20,enableMultiple:!1,showSearchIcon:!0,requireSelection:!0,size:"medium"};label="";labelDescription;componentId="cs-"+t.nextId++;size="medium";csInput;csSelect;csClear;csRemoveItem;csBlur;csEditSelection;csFocus;csLoadMore;csClearHistory;csRequestHistory;afFocused=!1;activeIndex=-1;isFocusedInternal=!1;isNavigatingWithKeyboard=!1;resultAnnouncement="";isValidationMessageHidden=!1;isActiveDescendantDeferred=!1;hasTypedSinceFocus=!1;isKeyboardNavigationActive=!1;hasPendingResultAnnouncement=!1;renderedExpanded=!1;expandedAtManualSelect=!1;async setFocus(){if(this.inputRef){this.inputRef.focus();const i=this.inputRef.value.length;this.inputRef.setSelectionRange(i,i)}else this.shouldFocusAfterRender=!0}inputRef;listRef;shouldFocusAfterRender=!1;handleKeyDown=i=>{if(this.config.disabled)return void i.preventDefault();if(!this.state)return;if("Tab"===i.key&&(this.hasTypedSinceFocus=!1),"BUTTON"===i.target?.tagName)return;if("ArrowUp"!==i.key&&"ArrowDown"!==i.key&&"Enter"!==i.key&&"Escape"!==i.key&&(this.isKeyboardNavigationActive=!1,this.isNavigatingWithKeyboard=!1),"itemSelected"===this.state.status&&"Tab"!==i.key&&"Shift"!==i.key&&!i.ctrlKey&&!i.metaKey)return void this.csEditSelection.emit();if("searching"!==this.state.status&&"multiSelect"!==this.state.status)return;const t=this.state.suggestions,e=a(this.state,this.config.requireSelection),s=t.length+(e?1:0);switch(i.key){case"ArrowDown":if(s>0){i.preventDefault(),this.cancelPendingResultAnnouncement();const e=this.renderedExpanded;this.isFocusedInternal=!0,this.isKeyboardNavigationActive=!0,this.isNavigatingWithKeyboard=!0,this.activeIndex=r("down",this.activeIndex,s),e||this.deferActiveDescendant(),this.scrollToActive(),this.activeIndex>=t.length-3&&this.csLoadMore.emit()}else this.csFocus.emit();break;case"ArrowUp":if(s>0){i.preventDefault(),this.activeIndex>=0&&this.cancelPendingResultAnnouncement();const t=this.renderedExpanded,e=this.activeIndex,o=this.isNavigatingWithKeyboard;this.isKeyboardNavigationActive=!0,this.isNavigatingWithKeyboard=!0,this.activeIndex=r("up",this.activeIndex,s),this.activeIndex>=0?(t||this.deferActiveDescendant(),this.scrollToActive()):(this.isKeyboardNavigationActive=!1,this.isNavigatingWithKeyboard=!1,e>=0&&o&&this.announceReturnToInput())}break;case" ":case"Enter":if(" "===i.key&&-1===this.activeIndex)return;if("Enter"!==i.key||!this.state.manualInputBlocked||this.activeIndex>=0&&this.activeIndex<t.length)if(this.activeIndex>=0&&this.activeIndex<t.length){i.preventDefault();const e=t[this.activeIndex];this.shouldFocusAfterRender=!0,e.isSelected?this.csRemoveItem.emit(e):this.csSelect.emit(e)}else e&&this.activeIndex===t.length&&this.isNavigatingWithKeyboard?(i.preventDefault(),this.handleManualSelect()):"Enter"===i.key&&(e||t.length>0)&&(i.preventDefault(),this.isNavigatingWithKeyboard=!0);else i.preventDefault(),this.reannounceValidationMessage();break;case"Escape":this.activeIndex=-1,this.clearDeferredActiveDescendant(),this.clearResultAnnouncement(),this.csClear.emit()}};markResultAnnouncementPending(i){""!==i.trim()?(clearTimeout(this.resultAnnouncementTimer),this.resultAnnouncementTimer=void 0,clearTimeout(this.resultRestoreTimer),this.resultRestoreTimer=void 0,this.hasPendingResultAnnouncement=!0):this.clearResultAnnouncement()}scheduleResultAnnouncement(i,e){this.hasPendingResultAnnouncement&&i&&""!==i.inputValue.trim()&&(this.isNavigatingWithKeyboard||void 0!==i.resultsQuery&&i.resultsQuery!==i.inputValue||e&&!t.hasNewResult(e,i)||(clearTimeout(this.resultAnnouncementTimer),this.resultAnnouncementTimer=setTimeout((()=>{this.resultAnnouncementTimer=void 0,this.announceResultCount()}),t.RESULT_ANNOUNCEMENT_DELAY_MS)))}static hasNewResult(i,t){return i.inputValue!==t.inputValue||i.resultsQuery!==t.resultsQuery||i.hasMoreResults!==t.hasMoreResults||i.suggestions.length!==t.suggestions.length||t.suggestions.some(((t,e)=>{const s=i.suggestions[e];return t.id!==s.id||t.label!==s.label||!!t.isSelected!=!!s.isSelected}))}deferActiveDescendant(){clearTimeout(this.activeDescendantTimer),this.isActiveDescendantDeferred=!0,this.activeDescendantTimer=setTimeout((()=>{this.activeDescendantTimer=void 0,this.isActiveDescendantDeferred=!1}),t.ACTIVE_DESCENDANT_DELAY_MS)}clearDeferredActiveDescendant(){clearTimeout(this.activeDescendantTimer),this.activeDescendantTimer=void 0,this.isActiveDescendantDeferred=!1}announceReturnToInput(){this.clearDeferredActiveDescendant();const i=this.state.inputValue.trim(),t=[this.label,i].filter(Boolean).join(", ");t&&this.setResultAnnouncement(t)}cancelPendingResultAnnouncement(){clearTimeout(this.resultAnnouncementTimer),this.resultAnnouncementTimer=void 0,clearTimeout(this.resultRestoreTimer),this.resultRestoreTimer=void 0,this.hasPendingResultAnnouncement=!1}announceResultCount(){this.hasPendingResultAnnouncement=!1,this.state&&this.isFocusedInternal&&"itemSelected"!==this.state.status&&!this.isNavigatingWithKeyboard?this.setResultAnnouncement(function(i,t={}){if(!i||""===i.inputValue.trim())return"";const e=i.suggestions.filter((i=>!i.isSelected)).length;if(e>0)return`${i.hasMoreResults??(t.maxResults&&i.suggestions.length>=t.maxResults)?"Minst ":""}${e} förslag. Använd pil ned för att välja.`;if(!a(i,t.requireSelection))return"Inga förslag.";switch(t.manualInputMode){case"feedback":return"Inga förslag. Använd pil ned för att skicka in texten som förslag.";case"combined":return"Inga förslag. Använd pil ned för att använda texten och skicka in den som förslag.";default:return"Inga förslag. Använd pil ned för att använda texten."}}(this.state,this.config)):this.clearResultAnnouncement()}setResultAnnouncement(i){if(clearTimeout(this.resultRestoreTimer),this.resultRestoreTimer=void 0,""!==i&&i===this.resultAnnouncement)return this.resultAnnouncement="",void(this.resultRestoreTimer=setTimeout((()=>{this.resultRestoreTimer=void 0,this.resultAnnouncement=i}),t.LIVE_REGION_RESTORE_DELAY_MS));this.resultAnnouncement=i}clearResultAnnouncement(){clearTimeout(this.resultAnnouncementTimer),this.resultAnnouncementTimer=void 0,clearTimeout(this.resultRestoreTimer),this.resultRestoreTimer=void 0,this.hasPendingResultAnnouncement=!1,this.resultAnnouncement=""}reannounceValidationMessage(){"error"===this.state.validation&&this.state.message&&this.showValidationMessageAfter(t.LIVE_REGION_RESTORE_DELAY_MS)}showValidationMessageAfter(i){this.validationRestoreTimer&&i<=this.validationRestoreDelayMs||(clearTimeout(this.validationRestoreTimer),this.isValidationMessageHidden=!0,this.validationRestoreDelayMs=i,this.validationRestoreTimer=setTimeout((()=>{this.validationRestoreTimer=void 0,this.validationRestoreDelayMs=0,this.isValidationMessageHidden=!1}),i))}onWrapperFocusIn=()=>{this.config.disabled||this.state&&this.isFocusedInternal||this.state&&(this.isFocusedInternal=!0,this.activeIndex=-1,this.isNavigatingWithKeyboard=!1,this.isKeyboardNavigationActive=!1,this.hasTypedSinceFocus=!1,this.csFocus.emit(),""===this.state.inputValue.trim()&&this.csRequestHistory.emit())};onWrapperFocusOut=()=>{this.shouldFocusAfterRender||requestAnimationFrame((()=>{const i=this.hostElement.shadowRoot,t=i?.activeElement||document.activeElement;t&&this.hostElement.contains(t)||i&&i.contains(t)||(this.isFocusedInternal=!1,this.activeIndex=-1,this.clearResultAnnouncement(),this.clearDeferredActiveDescendant(),this.isNavigatingWithKeyboard=!1,this.isKeyboardNavigationActive=!1,this.hasTypedSinceFocus=!1,this.csBlur.emit())}))};handleAfFocusedChange(i){this.isFocusedInternal=i,i&&this.hostElement.shadowRoot?.activeElement!==this.inputRef&&(this.shouldFocusAfterRender=!0)}handleConfigChange(i){i.disabled&&(this.isFocusedInternal=!1,this.activeIndex=-1,this.shouldFocusAfterRender=!1,this.isNavigatingWithKeyboard=!1,this.isKeyboardNavigationActive=!1,this.hasTypedSinceFocus=!1)}handleStateChange(i,e){const s=function({activeIndex:i,newState:t,oldState:e,requireSelection:s=!1}){if(e&&t.inputValue!==e.inputValue)return{activeIndex:-1,shouldRestoreFocus:!1};let o=i;"multiSelect"===t.status&&"multiSelect"===e?.status&&t.selectedItems.length>e.selectedItems.length&&(o=0);const r=a(e,s),n=Boolean(e&&r&&i===e.suggestions.length),l=a(t,s),c=t.suggestions.length+(l?1:0);return n?o=l?t.suggestions.length:-1:0===c?o=-1:o>=c&&(o=c-1),{activeIndex:o,shouldRestoreFocus:"itemSelected"===t.status&&"itemSelected"!==e?.status}}({activeIndex:this.activeIndex,newState:i,oldState:e,requireSelection:this.config.requireSelection});if(this.activeIndex=s.activeIndex,s.shouldRestoreFocus&&(this.shouldFocusAfterRender=!0),this.scheduleResultAnnouncement(i,e),i?.manualInputBlocked&&!e?.manualInputBlocked&&"error"===i.validation){const i=this.renderedExpanded||this.expandedAtManualSelect;this.expandedAtManualSelect=!1,i&&!this.isComboboxExpanded()&&this.showValidationMessageAfter(t.ERROR_AFTER_COLLAPSE_DELAY_MS)}}componentDidUpdate(){this.shouldFocusAfterRender&&this.performFocusRestoration()}performFocusRestoration(i=0){if(this.config.disabled)this.shouldFocusAfterRender=!1;else if(this.inputRef){this.isFocusedInternal=!0,this.inputRef.focus();const t=this.hostElement.shadowRoot?.activeElement;if(t===this.inputRef||i>20){const i=this.inputRef.value.length;this.inputRef.setSelectionRange(i,i),this.shouldFocusAfterRender=!1}else requestAnimationFrame((()=>this.performFocusRestoration(i+1)))}}isComboboxExpanded(){if(!this.state||"itemSelected"===this.state.status)return!1;const i=this.state.suggestions.length>0||a(this.state,this.config.requireSelection),t=this.hasTypedSinceFocus&&this.state.inputValue.trim().length>0;return i&&this.isSuggestionsListRendered()&&(this.isNavigatingWithKeyboard||t)}isSuggestionsListRendered(){if(!this.state||!this.isFocusedInternal||"itemSelected"===this.state.status)return!1;const i=this.state.inputValue.trim().length>0;return this.state.suggestions.length>0||a(this.state,this.config.requireSelection)||i}handleScroll(i){if(!this.config.enableInfiniteScroll)return;const t=i.target;t.scrollHeight-(t.scrollTop+t.clientHeight)<50&&this.csLoadMore.emit()}handleMouseMove=i=>{0===i.movementX&&0===i.movementY||this.isKeyboardNavigationActive&&(this.isKeyboardNavigationActive=!1,this.isNavigatingWithKeyboard=!1)};handleMouseLeave=()=>{this.isKeyboardNavigationActive||(this.activeIndex=-1)};scrollToActive(){if(!this.listRef||!this.state)return;if(-1===this.activeIndex)return void(this.listRef.scrollTop=0);const i=this.listRef.querySelector("#"+(this.activeIndex===this.state.suggestions.length?`${this.componentId}-list-option-manual-input`:`${this.componentId}-list-option-${this.activeIndex}`));if(!i)return;const t=this.listRef.getBoundingClientRect(),e=i.getBoundingClientRect();e.bottom>t.bottom?this.listRef.scrollTop+=e.bottom-t.bottom:e.top<t.top&&(this.listRef.scrollTop-=t.top-e.top)}handleManualSelect(){const i={id:"",label:this.state.inputValue.trim(),metadata:{type:"ManualInput"}};this.expandedAtManualSelect=this.renderedExpanded,this.config.isFeedback?(this.isFocusedInternal=!1,this.shouldFocusAfterRender=!1,this.activeIndex=-1,this.isKeyboardNavigationActive=!1,this.isNavigatingWithKeyboard=!1):this.shouldFocusAfterRender=!0,this.csSelect.emit(i),this.config.enableMultiple&&""===this.state?.inputValue?.trim()&&this.csRequestHistory.emit()}render(){if(!this.state)return null;const t="itemSelected"===this.state.status;return i("div",{class:{"core-selector-wrapper":!0,"is-disabled":!!this.config.disabled},"aria-disabled":this.config.disabled?"true":"false",onKeyDown:i=>this.handleKeyDown(i),onMouseMove:this.handleMouseMove,onFocusin:this.onWrapperFocusIn,onFocusout:this.onWrapperFocusOut},this.label&&i(c,{label:this.label,forId:`${this.componentId}-input`,description:this.labelDescription}),this.labelDescription&&i("div",{id:`${this.componentId}-description`,class:"visually-hidden"},this.labelDescription),this.state&&"loading"===this.state.status&&i("div",{class:"loading-indicator"},"Laddar..."),this.state&&"error"===this.state.status&&i("div",{class:"error-message"},this.state.message),this.state&&["searching","itemSelected","multiSelect"].includes(this.state.status)&&i("div",{class:"combobox-container"},this.renderSearchContainer(),this.isFocusedInternal&&!t&&this.renderSuggestionsList()),i("div",{id:`${this.componentId}-validation-alert`,role:"alert"},this.state&&"error"===this.state.validation&&"itemSelected"!==this.state.status&&i(d,{id:`${this.componentId}-validation-message`,variant:"error",class:"selector-validation-message"},this.isValidationMessageHidden?i("span",{class:"af-validation-message__placeholder","aria-hidden":"true"},this.state.message):this.state.message)),this.state&&"success"===this.state.validation&&"itemSelected"!==this.state.status&&i(d,{id:`${this.componentId}-validation-message`,variant:"success",class:"selector-validation-message"},this.state.message),i("div",{id:`${this.componentId}-result-count`,class:"visually-hidden",role:"status","aria-live":"polite","aria-atomic":"true"},this.resultAnnouncement))}renderSearchContainer(){const t="itemSelected"===this.state.status,e=t?this.state.selectedItem?.label||"":this.state.inputValue,s="multiSelect"===this.state.status,o=e.length>0,a=s&&this.state.selectedItems.length>0,r=this.isComboboxExpanded();this.renderedExpanded=r;const n=r&&this.activeIndex>=0&&this.isNavigatingWithKeyboard&&!this.isActiveDescendantDeferred?this.activeIndex===this.state.suggestions.length?`${this.componentId}-list-option-manual-input`:`${this.componentId}-list-option-${this.activeIndex}`:void 0,c=`${this.componentId}-validation-message`,d=this.state&&"error"===this.state.validation&&this.state.message,g=[];!!this.labelDescription&&0===e.length&&g.push(`${this.componentId}-description`),d&&g.push(c);const p=g.length>0?g.join(" "):void 0;return i("div",{class:{"search-container":!0,"is-inactive-selected":t,"multi-search-container":s,"has-tags":a,"has-validation-error":"error"===this.state?.validation,"has-positive-validation":!t&&"success"===this.state?.validation},onClick:()=>{this.config.disabled||(t?this.csEditSelection.emit():""===this.state.inputValue.trim()&&this.csRequestHistory.emit())}},s&&this.state.selectedItems.length>0&&i("div",{class:"selected-tags-wrapper"},this.state.selectedItems.map((t=>i(h,{key:t.id,text:t.label,breakWords:!0,onRemove:()=>{this.shouldFocusAfterRender=!0,this.csRemoveItem.emit(t)}})))),i("div",{class:"input-controls-wrapper"},i(l,{name:"search",class:{"search-icon-container":!0,"selector-search-icon":!0,"is-hidden":!this.config.showSearchIcon||o||a}}),i("div",{class:{"input-area":!0,"has-value":!this.config.showSearchIcon||o||a}},t&&i("span",{class:"selected-text-in-box"},e),!t&&!o&&this.config.placeholder&&i("span",{class:"selector-placeholder-overlay","aria-hidden":"true"},this.config.placeholder),i("input",{class:{"selector-input-field":!0,"visually-hidden-selected":t},ref:i=>this.inputRef=i,id:`${this.componentId}-input`,type:"text",value:e,maxLength:120,onFocus:()=>{this.config.disabled||this.isFocusedInternal||(this.isFocusedInternal=!0,this.activeIndex=-1,this.isNavigatingWithKeyboard=!1,this.isKeyboardNavigationActive=!1,this.hasTypedSinceFocus=!1,this.csFocus.emit(),this.state&&""===this.state.inputValue.trim()&&this.csRequestHistory.emit())},onInput:i=>{if(this.config.disabled)return;this.isKeyboardNavigationActive=!1,this.isNavigatingWithKeyboard=!1,this.isFocusedInternal=!0;const t=i.target.value;this.hasTypedSinceFocus=!0,this.clearDeferredActiveDescendant(),this.markResultAnnouncementPending(t),this.csInput.emit(t)},autocomplete:"off",role:"combobox","aria-label":this.label,"aria-autocomplete":"list","aria-haspopup":"listbox","aria-expanded":r?"true":"false","aria-controls":r?`${this.componentId}-listbox`:void 0,"aria-activedescendant":n,"aria-invalid":d?"true":"false","aria-describedby":p,readOnly:t,disabled:!!this.config.disabled})),i("button",{type:"button",class:{"clear-button":!0,"is-visible":o||t},tabIndex:o||t?0:-1,disabled:!!this.config.disabled,"aria-label":"Rensa inmatad text",onMouseDown:i=>i.preventDefault(),onClick:i=>{i.stopPropagation(),this.config.disabled||(this.isFocusedInternal=!0,this.clearResultAnnouncement(),this.csInput.emit(""),this.shouldFocusAfterRender=!0,this.csClear.emit(),this.csRequestHistory.emit())}},i(l,{name:"x"}))))}renderSuggestionsList(){if("itemSelected"===this.state.status)return null;const t=Boolean(this.state.inputValue&&this.state.inputValue.trim().length>0),e=a(this.state,this.config.requireSelection),s=Boolean(this.state.suggestions&&this.state.suggestions.length>0),o=t&&!s&&!e;if(!s&&!e&&!o)return null;const r=this.state.listHeader||this.config.listHeader,n=this.state.showHistoryHeader||this.state.isHistoryView&&this.config.showHistoryHeader;return i("div",{class:"suggestions-box-container"},i("div",{class:{"suggestions-box":!0,"is-keyboard-nav":this.isNavigatingWithKeyboard},ref:i=>this.listRef=i,onScroll:i=>this.handleScroll(i),onMouseLeave:this.handleMouseLeave},(r||n)&&i("div",{class:"list-header-container"},i("slot",{name:"suggestions-overlay"}),r&&i("div",{class:"list-header"},i("span",null,r)),n&&i("div",{class:"list-header history-header"},i("span",null,"Din privata historik")," - ",i("button",{type:"button",class:"history-clear-link","aria-label":"Rensa historik",disabled:!!this.config.disabled,onMouseDown:i=>i.preventDefault(),onClick:()=>{this.config.disabled||this.csClearHistory.emit()}},"Rensa"))),!r&&!n&&i("slot",{name:"suggestions-overlay"}),i("div",{id:`${this.componentId}-listbox`,role:"listbox"},o&&i("div",{class:"suggestion-item no-results"},"Inga resultat matchade din sökning"),this.state.suggestions.map(((t,e)=>i("div",{key:t.id?`${t.id}|${t.label}`:e,role:"option",id:`${this.componentId}-list-option-${e}`,"aria-selected":!!t.isSelected,"aria-current":e===this.activeIndex?"true":"false",class:{"suggestion-item":!0,"active-suggestion":e===this.activeIndex,"is-selected":!!t.isSelected,"is-keyboard-focus":e===this.activeIndex&&this.isNavigatingWithKeyboard},onMouseDown:i=>{i.preventDefault(),this.config.disabled||(this.shouldFocusAfterRender=!0,t.isSelected?this.csRemoveItem.emit(t):this.csSelect.emit(t),this.config.enableMultiple&&(clearTimeout(this.historyRequestTimer),this.historyRequestTimer=setTimeout((()=>{this.csRequestHistory.emit(),this.historyRequestTimer=void 0}),50)))},onMouseMove:this.handleMouseMove,onMouseEnter:()=>{this.config.disabled||this.isKeyboardNavigationActive||(this.isNavigatingWithKeyboard=!1,t.isSelected||(this.activeIndex=e))}},i(l,{name:"check",class:"selection-indicator-icon"}),i("span",null,t.displaySegments?t.displaySegments.map(((t,e)=>i("span",{key:e,class:{"match-highlight":!!t.isMatch,"metadata-dimmed":!!t.isMetadata}},t.text))):t.label)))),a(this.state,this.config.requireSelection)&&i("div",{role:"option",id:`${this.componentId}-list-option-manual-input`,class:{"suggestion-item":!0,"active-suggestion":this.activeIndex===this.state.suggestions.length,"is-keyboard-focus":this.activeIndex===this.state.suggestions.length&&this.isNavigatingWithKeyboard},onMouseDown:i=>{i.preventDefault(),this.config.disabled||this.handleManualSelect()},onMouseMove:this.handleMouseMove,onMouseEnter:()=>{this.config.disabled||this.isKeyboardNavigationActive||(this.isNavigatingWithKeyboard=!1,this.activeIndex=this.state.suggestions.length)}},i("span",null,"feedback"===this.config.manualInputMode?i("span",null,'Skicka in "',i("strong",null,this.state.inputValue.trim()),'" som förslag på ',this.config.feedbackTargetName||"yrke"," som saknas."):i("span",null,'Använd "',i("strong",null,this.state.inputValue.trim()),"combined"===this.config.manualInputMode?'" och skicka in förslaget till Arbetsförmedlingen':'"'))))))}static get delegatesFocus(){return!0}static get watchers(){return{afFocused:[{handleAfFocusedChange:0}],config:[{handleConfigChange:0}],state:[{handleStateChange:0}]}}static get style(){return":host{--digi--grayscale-0:#ffffff;--digi--grayscale-50:#fbfbfb;--digi--grayscale-100:#f4f4f4;--digi--grayscale-200:#ededed;--digi--grayscale-300:#e4e4e4;--digi--grayscale-400:#dddddd;--digi--grayscale-500:#cacaca;--digi--grayscale-600:#acacac;--digi--grayscale-700:#757575;--digi--grayscale-800:#5c5c5c;--digi--grayscale-900:#333333;--digi--grayscale-1000:#000000;--digi--global--color--cta--link--base:#1616b2;--digi--global--color--function--danger--base:#da0000;--digi--global--color--function--success--base:#008a20;--digi--global--color--function--success--lightest-3:#d4edda;--digi--global--color--function--warning--base:#ffe200;--af-text-color:var(--digi--color--text--primary, var(--digi--grayscale-900));--digi--global--typography--font-family--default:\"Open Sans\", Arial, sans-serif;--digi--global--typography--font-size--base:1rem;--digi--global--typography--font-size--small:0.875rem;--digi--global--typography--font-weight--regular:400;--digi--global--typography--font-weight--semibold:600;--digi--global--typography--font-weight--bold:700;--digi--global--typography--line-height--base:1.5;--digi--typography--label--font-size--desktop:1rem;--digi--typography--label--font-weight--desktop:600;--digi--typography--label--line-height--desktop:1.5;--digi--typography--label-description--font-size--desktop:1rem;--digi--typography--label-description--line-height--desktop:1.5;--digi--typography--tag--font-size--desktop:0.875rem;--digi--gutter--icon:0.625rem;--digi--gutter--smaller:0.75rem;--digi--gutter--small:0.875rem;--digi--gutter--medium:1rem;--digi--border-width--primary:1px;--digi--border-style--primary:solid;--digi--border-radius--primary:0;--digi--border-radius--secondary:6px;--af-tag-color:var(--digi--color--text--interactive--brand-primary, #091d54);--af-tag-background:var(--digi--color--background--interactive--default--secondary, var(--digi--grayscale-0));--af-tag-hover-background:var(--digi--color--background--interactive--hover--secondary, #ddf1fc)}.af-form-label{color:var(--af-text-color);display:flex;flex-direction:column;font-family:var(--digi--global--typography--font-family--default);font-size:var(--digi--typography--label--font-size--desktop);margin-bottom:0.5rem}.af-form-label__label{cursor:pointer;display:block;font-weight:var(--digi--typography--label--font-weight--desktop);line-height:var(--digi--typography--label--line-height--desktop)}.af-form-label__description{display:block;font-size:var(--digi--typography--label-description--font-size--desktop);line-height:var(--digi--typography--label-description--line-height--desktop);max-width:35rem}.af-validation-message{align-items:center;display:flex;flex-wrap:wrap}.af-validation-message__icon{flex:0 0 auto;height:1.25em;margin-inline-end:var(--digi--gutter--icon);width:1.25em}.af-validation-message__icon--success,.af-validation-message__icon--error{background-color:var(--af-validation-icon-color, currentColor);-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain}.af-validation-message__icon--success{--af-validation-icon-color:var(--digi--color--icon--validation--success, var(--digi--global--color--function--success--base));-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 25 25'%3E%3Cpath d='M25 12.5C25 19.404 19.404 25 12.5 25S0 19.404 0 12.5 5.596 0 12.5 0 25 5.596 25 12.5zm-13.946 6.619l9.274-9.275a.806.806 0 000-1.14l-1.14-1.14a.806.806 0 00-1.14 0l-7.564 7.563-3.531-3.531a.807.807 0 00-1.14 0l-1.141 1.14a.806.806 0 000 1.14l5.242 5.243a.806.806 0 001.14 0z'/%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 25 25'%3E%3Cpath d='M25 12.5C25 19.404 19.404 25 12.5 25S0 19.404 0 12.5 5.596 0 12.5 0 25 5.596 25 12.5zm-13.946 6.619l9.274-9.275a.806.806 0 000-1.14l-1.14-1.14a.806.806 0 00-1.14 0l-7.564 7.563-3.531-3.531a.807.807 0 00-1.14 0l-1.141 1.14a.806.806 0 000 1.14l5.242 5.243a.806.806 0 001.14 0z'/%3E%3C/svg%3E\")}.af-validation-message__icon--error{--af-validation-icon-color:var(--digi--color--icon--validation--error, var(--digi--global--color--function--danger--base));-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath d='M34.4328058,0 C35.5494848,0 36.5900526,0.609146757 37.1483921,1.58958113 L47.5812454,19.9104189 C48.1395849,20.8909496 48.1395849,22.1090504 47.5812454,23.0895811 L37.1483921,41.4104189 C36.5900526,42.3908532 35.5494848,43 34.4328058,43 L13.5671942,43 C12.4505152,43 11.4099474,42.3908532 10.8516079,41.4104189 L0.41875464,23.0895811 C-0.13958488,22.1090504 -0.13958488,20.8909496 0.41875464,19.9104189 L10.8516079,1.58958113 C11.4099474,0.609146757 12.4505152,0 13.5671942,0 Z M18.6736823,12.3728178 C18.2711762,11.964729 17.6203819,11.964729 17.2178757,12.3728178 L15.2825964,14.334939 C14.8800903,14.7430278 14.8800903,15.4028485 15.2825964,15.8109373 L20.6089616,21.2111779 L15.2825964,26.6114185 C14.8800903,27.0195074 14.8800903,27.6793281 15.2825964,28.0874169 L17.2178757,30.049538 C17.6203819,30.4576269 18.2711762,30.4576269 18.6736823,30.049538 L24.0000475,24.6492974 L29.3264127,30.049538 C29.7289188,30.4576269 30.3797132,30.4576269 30.7822193,30.049538 L32.7174986,28.0874169 C33.1200048,27.6793281 33.1200048,27.0195074 32.7174986,26.6114185 L27.3911334,21.2111779 L32.7174986,15.8109373 C33.1200048,15.4028485 33.1200048,14.7430278 32.7174986,14.334939 L30.7822193,12.3728178 C30.3797132,11.964729 29.7289188,11.964729 29.3264127,12.3728178 L24.0000475,17.7730584 Z'/%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath d='M34.4328058,0 C35.5494848,0 36.5900526,0.609146757 37.1483921,1.58958113 L47.5812454,19.9104189 C48.1395849,20.8909496 48.1395849,22.1090504 47.5812454,23.0895811 L37.1483921,41.4104189 C36.5900526,42.3908532 35.5494848,43 34.4328058,43 L13.5671942,43 C12.4505152,43 11.4099474,42.3908532 10.8516079,41.4104189 L0.41875464,23.0895811 C-0.13958488,22.1090504 -0.13958488,20.8909496 0.41875464,19.9104189 L10.8516079,1.58958113 C11.4099474,0.609146757 12.4505152,0 13.5671942,0 Z M18.6736823,12.3728178 C18.2711762,11.964729 17.6203819,11.964729 17.2178757,12.3728178 L15.2825964,14.334939 C14.8800903,14.7430278 14.8800903,15.4028485 15.2825964,15.8109373 L20.6089616,21.2111779 L15.2825964,26.6114185 C14.8800903,27.0195074 14.8800903,27.6793281 15.2825964,28.0874169 L17.2178757,30.049538 C17.6203819,30.4576269 18.2711762,30.4576269 18.6736823,30.049538 L24.0000475,24.6492974 L29.3264127,30.049538 C29.7289188,30.4576269 30.3797132,30.4576269 30.7822193,30.049538 L32.7174986,28.0874169 C33.1200048,27.6793281 33.1200048,27.0195074 32.7174986,26.6114185 L27.3911334,21.2111779 L32.7174986,15.8109373 C33.1200048,15.4028485 33.1200048,14.7430278 32.7174986,14.334939 L30.7822193,12.3728178 C30.3797132,11.964729 29.7289188,11.964729 29.3264127,12.3728178 L24.0000475,17.7730584 Z'/%3E%3C/svg%3E\")}.af-validation-message__icon--warning{background:center / contain no-repeat url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Ccircle cx='9' cy='9' r='6.75' fill='%23333'/%3E%3Cpath d='m18 9c0 4.9717-4.0298 9-9 9-4.9702 0-9-4.0283-9-9 0-4.9688 4.0298-9 9-9 4.9702 0 9 4.0312 9 9zm-9 1.8145c-0.92196 0-1.6694 0.7474-1.6694 1.6694 0 0.92196 0.7474 1.6694 1.6694 1.6694s1.6694-0.7474 1.6694-1.6694c0-0.92196-0.7474-1.6694-1.6694-1.6694zm-1.3157-1.065c0.012593 0.23095 0.20355 0.41175 0.43483 0.41175h1.7618c0.23128 0 0.42224-0.1808 0.43483-0.41175l0.2692-4.9355c0.013609-0.24946-0.18501-0.45922-0.43483-0.45922h-2.3002c-0.24982 0-0.4484 0.20976-0.43479 0.45922l0.2692 4.9355z' fill='%23FFE200'/%3E%3C/svg%3E\");position:relative;top:3px}.af-validation-message__text{color:var(--af-text-color);flex:1;font-family:var(--digi--global--typography--font-family--default);font-size:var(--digi--typography--tag--font-size--desktop);transform:translateY(1px)}.af-validation-message__placeholder{visibility:hidden}.af-tag{display:block;max-width:100%;min-width:0}.af-tag__button{align-items:center;background:var(--af-tag-background);border:var(--digi--border-width--primary) var(--digi--border-style--primary) var(--af-tag-color);border-radius:var(--digi--border-radius--secondary);color:var(--af-tag-color);cursor:pointer;display:inline-flex;font-family:var(--digi--global--typography--font-family--default);font-size:0.875rem;font-weight:var(--digi--global--typography--font-weight--semibold);gap:10px;height:auto;max-width:100%;min-height:unset;min-width:0;padding:6px 8px;text-align:left;white-space:normal}.af-tag__button:hover{background:var(--af-tag-hover-background)}.af-tag__button:focus-visible{background:var(--af-tag-hover-background);border-color:var(--af-tag-color);outline:2px solid var(--digi--color--text--primary, var(--digi--grayscale-1000));outline-offset:2px;box-shadow:0 0 0 5px var(--digi--color--background--primary, var(--digi--grayscale-0))}.af-tag__button:active{background:var(--af-tag-hover-background)}.af-tag__text{display:inline-block;max-width:100%;min-width:0;white-space:normal}.af-tag__text--break{overflow-wrap:anywhere;word-break:break-word}.af-icon{display:flex !important;min-height:1.4em !important;align-items:center !important}.af-icon--default-size{width:12px !important;height:12px !important}.af-tag__remove-icon{flex:0 0 auto;height:1em;width:1em}.af-icon.af-tag__remove-icon{min-height:0 !important}:host{--selector-width:var(--cs-width, 100%);--selector-min-width:var(--cs-min-width, 200px);--selector-max-width:var(--cs-max-width, none);--selector-height:var(--cs-height, auto);--selector-min-height:var(--cs-min-height, auto);--selector-max-height:var(--cs-max-height, none);--selector-font-family:var(--global-font-family, 'Open Sans', sans-serif);--selector-font-size:var(--cs-font-size, 1rem);--selector-text-color:var(--cs-text-color, var(--digi--color--text--primary, #212529));--selector-placeholder-color:var(--cs-placeholder-color, var(--digi--color--text--description, #6c757d));--selector-border-color:var(--cs-border-color, var(--digi--color--border--interactive--default--on-input, #d1d5db));--selector-focus-border-color:var(--cs-focus-border-color, #86b7fe);--selector-focus-shadow:var(--cs-focus-shadow, 0 0 0 0.25rem rgba(13, 110, 253, 0.25));--selector-background-color:var(--cs-background-color, var(--digi--color--background--interactive--default--input-elements, #fff));--selector-icon-color:var(--cs-icon-color, var(--digi--color--icon--primary, #6c757d));--selector-clear-button-color:var(--cs-clear-button-color, var(--digi--color--icon--primary, #6c757d));--selector-clear-button-hover-color:var(--cs-clear-button-hover-color, var(--digi--color--icon--primary, #212529));--selector-suggestion-background-color:var(--cs-suggestion-background-color, var(--digi--color--background--dropdown, #fff));--selector-suggestion-border-color:var(--cs-suggestion-border-color, var(--digi--color--divider--primary, #ced4da));--selector-suggestion-hover-background:var(--cs-suggestion-hover-background, var(--digi--color--background--interactive--hover--quarternary, #e9ecef));--selector-suggestion-active-background:var(--cs-suggestion-active-background, var(--digi--color--background--interactive--hover--quarternary, #dde4eb));--selector-suggestion-text-color:var(--cs-suggestion-text-color, var(--digi--color--text--primary, #212529));--selector-suggestion-highlight-weight:var(--cs-suggestion-highlight-weight, bold);--selector-error-color:var(--cs-error-color, var(--digi--color--border--interactive--validation--error, #dc3545));--selector-loading-color:var(--cs-loading-color, var(--digi--color--text--description, #6c757d));--selector-container-min-height:40px;--selector-padding-y:6px;--selector-padding-x:10px;--selector-icon-size:1.1em;--selector-gap:6px;--cs-row-height:32px;display:flex;flex-direction:column;width:var(--selector-width);min-width:var(--selector-min-width);max-width:var(--selector-max-width);height:var(--selector-height);min-height:var(--selector-min-height);max-height:var(--selector-max-height);font-family:var(--selector-font-family);font-size:var(--selector-font-size);color:var(--selector-text-color);position:relative}:host([cs-size=\"small\"]){--selector-container-min-height:32px;--selector-padding-y:2px;--selector-icon-size:1em;--selector-gap:4px;--cs-row-height:28px}:host([cs-size=\"medium\"]){--selector-container-min-height:40px;--selector-padding-y:6px;--cs-row-height:32px}:host([cs-size=\"large\"]){--selector-container-min-height:48px;--selector-padding-y:10px;--selector-icon-size:1.25em;--selector-gap:8px;--cs-row-height:40px}*{box-sizing:border-box}.core-selector-wrapper{display:flex;flex-direction:column;flex:1;min-height:inherit}.af-form-label{margin-bottom:0.5rem}.search-container{display:flex;align-items:center;flex-wrap:wrap;gap:6px;border:1px solid var(--digi--color--border--interactive--default--on-input, #757575);border-radius:0px;padding:var(--selector-padding-y) var(--selector-padding-x);flex:1;min-height:var(--selector-container-min-height);cursor:text;background-color:var(--selector-background-color);position:relative;overflow:hidden}.search-container:focus-within{outline:2px solid var(--digi--color--text--primary, black);outline-offset:2px}.search-container.is-inactive-selected .selector-input-field{caret-color:transparent;cursor:default}.is-inactive-selected+.suggestions-box-container{display:none !important}.search-container.is-inactive-selected .search-icon-container{display:none}.search-container.is-inactive-selected .input-area{padding-left:0}.input-controls-wrapper{position:relative;width:100%;display:flex;align-items:center}.search-icon-container{position:absolute;left:0;top:50%;width:20px;height:20px;transform:translateY(-50%);z-index:1;pointer-events:none;display:flex;align-items:center;justify-content:center;transition:transform 0.2s ease-in-out, opacity 0.2s ease-in-out;opacity:1;max-height:100%}.search-icon-container.is-hidden{opacity:0;transform:translateY(-50%) scale(0.7)}.selector-search-icon{color:var(--digi--color--icon--primary, #333);display:block;flex:0 0 auto;width:20px;height:20px}.clear-button>span{color:var(--digi--color--icon--primary, #333)}.input-area{position:relative;flex:1;min-width:0;padding-left:27px;display:flex;align-items:center;transition:padding-left 0.2s ease-in-out}.input-area.has-value{padding-left:0}.selector-placeholder-overlay{position:absolute;left:27px;right:0;top:50%;transform:translateY(-50%);color:var(--selector-placeholder-color);font-family:inherit;font-size:var(--selector-font-size);line-height:normal;padding:1px 2px;pointer-events:none;user-select:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;transition:left 0.2s ease-in-out}.input-area.has-value .selector-placeholder-overlay{left:0}.selector-input-field{position:relative;z-index:1;width:100%;font-family:inherit;font-size:var(--selector-font-size);color:inherit;border:none;outline:none;background:transparent;transition:padding-right 0.2s ease-in-out}.search-container.has-input .selector-input-field{padding-right:0}.selector-input-field::placeholder{color:var(--selector-placeholder-color);opacity:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.clear-button{position:static;flex-shrink:0;opacity:0;pointer-events:none;z-index:2;background:none;border:none;padding:0;margin:0;height:20px;width:20px;cursor:pointer;color:var(--selector-clear-button-color);line-height:1;display:flex;align-items:center;transition:color 0.2s ease-in-out, opacity 0.2s ease-in-out}.clear-button.is-visible{opacity:1;pointer-events:auto}.clear-button:hover,.clear-button:focus{color:var(--selector-clear-button-hover-color);outline:none}.search-container.multi-search-container{display:flex;flex-direction:column;gap:0.5rem;align-items:stretch;padding-top:var(--selector-padding-y);padding-bottom:var(--selector-padding-y);width:100%;max-width:100%}.selected-tags-wrapper{display:flex;flex-wrap:wrap;gap:0.5rem;width:100%;max-width:100%;box-sizing:border-box}.selected-tags-wrapper .af-tag{display:block;max-width:100%;min-width:0}.selected-tags-wrapper .af-tag__button{white-space:normal !important;height:auto !important;text-align:left !important;word-break:break-word !important;overflow-wrap:anywhere !important;max-width:100% !important}.search-container.single-value-display{display:flex;align-items:center;flex-wrap:nowrap;gap:0.5rem;min-height:var(--selector-container-min-height);padding:var(--selector-padding-y) var(--selector-padding-x)}.selected-text-in-box{flex-grow:1;white-space:normal;word-break:break-word;min-width:0;line-height:inherit}.search-container.single-value-display .clear-button{position:static;transform:none;opacity:1;pointer-events:auto;flex-shrink:0}.combobox-container{position:relative;margin-top:0;display:flex;flex-direction:column;flex:1}.suggestions-box-container{position:absolute;top:100%;left:0;right:0;z-index:100}.suggestions-box-container.is-hidden-list{z-index:101;pointer-events:none}.suggestions-box{position:relative;background-color:var(--digi--color--background--dropdown, white);border:1px solid var(--selector-suggestion-border-color);border-radius:4px;box-shadow:0 2px 6px 0 var(--digi--color--misc--dropshadow, rgba(0, 0, 0, 0.15));overflow-y:auto;margin:2px 0px;max-height:calc(var(--max-visible-rows, 10) * var(--cs-row-height) + 40px)}.suggestion-item{display:flex;align-items:center;min-height:var(--cs-row-height);height:auto;padding:6px 1rem;font-size:inherit;line-height:1.25;cursor:pointer;color:var(--selector-suggestion-text-color);list-style:none;transition:background-color 0.15s ease, color 0.15s ease;white-space:normal !important;word-break:break-word !important;overflow-wrap:anywhere !important;position:relative;z-index:1;box-sizing:border-box}.suggestion-item>span{transition:font-weight 0.2s ease, transform 0.2s ease;display:inline;vertical-align:middle;white-space:normal;word-break:break-word;overflow-wrap:anywhere}.suggestion-item:hover,.suggestion-item.active-suggestion{background-color:var(--selector-suggestion-active-background)}.suggestions-box.is-keyboard-nav .suggestion-item:hover:not(.active-suggestion){background-color:transparent}.suggestion-item.active-suggestion.is-keyboard-focus{outline:1px solid var(--digi--color--text--primary, black);outline-offset:-1px}.suggestion-item.is-selected{color:var(--selector-suggestion-text-color) !important;cursor:default;background-color:var(--digi--color--background--interactive--selected--tertiary, #f2f2f2) !important}.suggestion-item.is-selected span{font-weight:600}.selection-indicator-icon{width:0;height:20px;opacity:0;transform:scale(0.5);margin-right:0;transition:width 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), margin-right 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);color:var(--digi--color--icon--primary, var(--digi--grayscale-800, #333));flex-shrink:0;display:flex;align-items:center;justify-content:center;overflow:hidden}.suggestion-item.is-selected .selection-indicator-icon{width:24px;opacity:1;transform:scale(1);margin-right:8px}.suggestion-item.is-selected.active-suggestion{background-color:var(--digi--color--background--interactive--selected--tertiary, #f2f2f2) !important}.suggestion-item .suggestion-text strong,.suggestion-item .match-highlight{font-weight:var(--selector-suggestion-highlight-weight);color:inherit;display:inline}.metadata-dimmed,.occupation-variant-label{font-size:1rem;color:var(--digi--color--text--description, var(--digi--grayscale-700, #757575));margin-left:0.25rem;display:inline;vertical-align:baseline;line-height:inherit;white-space:normal}.suggestion-item.no-results{color:var(--selector-placeholder-color);cursor:default;padding:0.5rem 1rem;font-style:italic;text-align:center;height:auto}.search-container.has-validation-error{border-color:var(--selector-error-color);border-width:2px;background-color:var(--digi--color--background--interactive--validation--error, #fef3f2)}.search-container.has-positive-validation{border-color:var(--digi--color--border--interactive--validation--success, #155724);background-color:var(--digi--color--background--interactive--validation--success, #d4edda)}.status-message{margin-top:0.5rem}.selector-validation-message{margin-top:0.5rem;display:block}.visually-hidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}input::-webkit-search-decoration,input::-webkit-search-cancel-button,input::-webkit-search-results-button,input::-webkit-search-results-decoration{-webkit-appearance:none;display:none}input::-ms-clear{display:none;width:0;height:0}.list-header-container{position:sticky;top:0;z-index:10;background-color:var(--digi--color--background--secondary-muted, #f8f9fa);border-bottom:1px solid var(--selector-suggestion-border-color);min-height:auto;display:flex;flex-direction:column}.list-header-container ::slotted([slot=\"suggestions-overlay\"]){position:absolute !important;top:0;left:0;width:100%;height:100%;z-index:20}.suggestions-box>::slotted([slot=\"suggestions-overlay\"]){position:sticky !important;top:0;left:0;width:100%;z-index:20}.list-header{display:flex;align-items:center;min-height:var(--cs-row-height);padding:6px 1rem;font-size:0.875rem;line-height:1.25;color:var(--digi--color--text--description, var(--digi--grayscale-700, #757575));border-bottom:1px solid var(--selector-suggestion-border-color, #ced4da)}.list-header span{font-size:0.875rem;font-weight:normal}.history-clear-link{color:var(--digi--color--text--interactive--tertiary, var(--digi--grayscale-900, #333333));text-decoration:underline;cursor:pointer;margin-left:0.25rem;background:transparent;border:0;padding:0;font:inherit}.history-clear-link:hover{color:var(--digi--color--text--primary, var(--digi--grayscale-900, #222))}@keyframes cs-shrink-fade{from{opacity:1}to{opacity:1}}@keyframes cs-collapse{from{height:auto}to{height:auto}}.cs-toast{position:absolute;top:0;left:0;width:100%;height:100%;z-index:20;display:flex;align-items:center;justify-content:center;gap:8px;background-color:var(--digi--color--background--pop-out, #f8fdf0);animation:cs-toastSlideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;pointer-events:none;box-sizing:border-box}.cs-toast.is-closing{animation:cs-toastSlideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards}.cs-toast-text{margin:0;font-size:0.875rem;font-weight:500;color:var(--digi--color--text--primary, #2e7d32)}@keyframes cs-toastSlideDown{from{transform:translateY(-100%)}to{transform:translateY(0)}}@keyframes cs-toastSlideUp{from{transform:translateY(0)}to{transform:translateY(-100%)}}.selector-input-field.visually-hidden-selected{position:absolute;opacity:0;pointer-events:none;width:1px;height:1px;overflow:hidden}"}},[785,"core-selector",{state:[16],config:[16],label:[1],labelDescription:[1,"label-description"],componentId:[1,"component-id"],size:[513,"cs-size"],afFocused:[4,"af-focused"],activeIndex:[32],isFocusedInternal:[32],isNavigatingWithKeyboard:[32],resultAnnouncement:[32],isValidationMessageHidden:[32],isActiveDescendantDeferred:[32],hasTypedSinceFocus:[32],setFocus:[64]},void 0,{afFocused:[{handleAfFocusedChange:0}],config:[{handleConfigChange:0}],state:[{handleStateChange:0}]}]);function p(){"undefined"!=typeof customElements&&["core-selector"].forEach((i=>{"core-selector"===i&&(customElements.get(t(i))||customElements.define(t(i),g))}))}p();export{d as A,g as C,p as d}
|