text: import '/assessment-quality-dashboard.js';
  import { fqLoadingWorker, worker as instantWorker, parseHash, waitingWorker } from '/test/server.js';
  import { html, LitElement } from 'lit-element';
  import { ifDefined } from 'lit-html/directives/if-defined';
  import { redirect } from '@brightspace-ui-labs/lit-router';
  
  class AqdDemoView extends LitElement {
  
  	connectedCallback() {
  		super.connectedCallback();
  
  		// code related to visual diff tests
  		const hashMap = parseHash(window.location.hash);
  
  		const worker = hashMap.has('FQloading') ? fqLoadingWorker : (hashMap.has('delay') ? waitingWorker : instantWorker);
  		worker.start();
  
  		if (hashMap.has('lang')) {
  			document.documentElement.setAttribute('lang', hashMap.get('lang'));
  		}
  
  		if (hashMap.has('dir')) {
  			document.documentElement.setAttribute('dir', hashMap.get('dir'));
  		}
  
  		if (hashMap.has('quiz')) {
  			redirect('/quiz/1');
  		}
  
  		if (hashMap.has('question')) {
  			redirect('/quiz/1/question/1?from=quiz,Quiz 1');
  		}
  
  		if (hashMap.has('settings')) {
  			if (hashMap.get('settings') === 'quiz') {
  				redirect('/settings?from=quiz,1,DummyQuiz');
  			} else {
  				redirect('/settings?from=main');
  			}
  		}
  	}
  
  	render() {
  		const hashMap = parseHash(window.location.hash);
  
  		let userSettings = {
  			showAverageScoreCol: true,
  			averageScoreFlagThreshold: 0.6,
  			showAverageScoreCard: true,
  			showFlaggedQuestionCard: true,
  			showQuizReliabilityCol: true,
  			showQuizReliabilityCard: true,
  			quizReliabilityFlagThreshold: 0.7,
  			quizReliabilityHighThreshold: 0.8,
  			showQuestionMeanCol: true,
  			showQuestionMeanCard: true,
  			showTopLureCol: true,
  			showCorrelationCol: true,
  			showCorrelationCard: true,
  			correlationFlagThreshold: 0.4,
  			showStdDevCol: true,
  			showStdDevCard: true,
  			showDiscIndexCol: true,
  			showDiscIndexCard: true,
  			showUpperLower27Col: true,
  			questionMeanFlagThreshold: 0.4,
  			topLureFlagThreshold: null,
  			stdDevFlagThreshold: null,
  			discIndexFlagThreshold: null,
  			upperLower27FlagThreshold: null
  		};
  
  		if (hashMap.has('user-settings')) {
  
  			if (hashMap.get('user-settings') === 'null') {
  				userSettings = null;
  			}
  			if (hashMap.get('user-settings') === 'undefined') {
  				userSettings = undefined;
  			}
  		}
  
  		return html`
  			<d2l-insights-assessment-quality-dashboard
  				demo
  				org-unit-id="6606"
  				metron-endpoint="https://example.com/api/metron/"
  				telemetry-endpoint="https://example.com/api/events/"
  				telemetry-id="80ee8ebc-6b5a-47cd-ba18-895c4614a601"
  
  				user-settings="${ifDefined(userSettings ? JSON.stringify(userSettings) : userSettings)}"
  
  			></d2l-insights-assessment-quality-dashboard>
  		`;
  	}
  }
  customElements.define('d2l-insights-aqd-demo-view', AqdDemoView);
  