<commit_before><!DOCTYPE HTML>
<html>
	<head>
		<meta charset="UTF-8">
		<title><%= title %></title>
		<script src="/index.js"></script>
		<link rel="stylesheet" href="/style.css"></link>
		<link href='https://fonts.googleapis.com/css?family=Roboto:300' rel='stylesheet' type='text/css'>
	</head>
	<body>
		<input id="paste" hidden>
		<script>
			var main = Elm.Main.fullscreen({
				initialSize: [window.innerWidth, window.innerHeight],
				randomSeed: [Math.floor(Math.random()*0xFFFF), Math.floor(Math.random()*0xFFFF)],
				  // TODO: Decoding large integer causes an error. Replace with below when it is fixed.
					// [Math.floor(Math.random()*0xFFFFFFFF), Math.floor(Math.random()*0xFFFFFFFF)]
				visitDate: new Date().getTime(),
				apiRoot: '<%= apiRoot %>',
				accountServiceRoot: '<%= accountServiceRoot %>',
				title: '<%= title %>',
				authToken: localStorage.getItem('authToken') || ''
			});
			main.ports.removeToken.subscribe(function(token) {
				localStorage.removeItem('authToken', token);
			  main.ports.tokenRemoved.send();
			});
			main.ports.setSelectionStart.subscribe(function() {
				var input = document.getElementById('name-input');
				if(input) {
					input.blur();
					input.setSelectionRange(9999,9999);
					// input.value = input.value;
					input.focus();
					// var a = input.dispatchEvent(new KeyboardEvent('keydown', { calcelable: false, 'bubbles': false, key: "a" }));
					// console.log(a);
				}
			});
			window.addEventListener('keydown', function(e) {
			  if(e.ctrlKey && e.keyCode === 90) {
					// Ctrl+Z
					if(!document.querySelector(':focus')) {
						e.preventDefault();
						main.ports.undo.send();
					}
			  } else if(e.ctrlKey && e.keyCode === 89) {
					// Ctrl+Y
					if(!document.querySelector(':focus')) {
						e.preventDefault();
						main.ports.redo.send();
					}
			  }
			}, true);
			window.addEventListener('paste', function(e) {
				if(e.target.id === 'paste-from-spreadsheet') {
					e.preventDefault();
					main.ports.clipboard.send(e.clipboardData.getData('text/html') || e.clipboardData.getData('text'));
				}
			}, true);

			// var dragging = null;
			// window.addEventListener('mousedown', function(e) {
			// 	// if(e.target.id === 'canvas-view') {
			// 		console.log('mousedown');
			// 		dragging = [e.pageX, e.pageY];
			// 		e.preventDefault();
			// 	// }
			// }, true);
			// window.addEventListener('mouseup', function(e) {
			// 	// if(e.target.id === 'canvas-view') {<commit_msg>attempt to paste object -> failed<commit_after><!DOCTYPE HTML>
<html>
	<head>
		<meta charset="UTF-8">
		<title><%= title %></title>
		<script src="/index.js"></script>
		<link rel="stylesheet" href="/style.css"></link>
		<link href='https://fonts.googleapis.com/css?family=Roboto:300' rel='stylesheet' type='text/css'>
	</head>
	<body>
		<input id="paste" hidden>
		<script>
			var main = Elm.Main.fullscreen({
				initialSize: [window.innerWidth, window.innerHeight],
				randomSeed: [Math.floor(Math.random()*0xFFFF), Math.floor(Math.random()*0xFFFF)],
				  // TODO: Decoding large integer causes an error. Replace with below when it is fixed.
					// [Math.floor(Math.random()*0xFFFFFFFF), Math.floor(Math.random()*0xFFFFFFFF)]
				visitDate: new Date().getTime(),
				apiRoot: '<%= apiRoot %>',
				accountServiceRoot: '<%= accountServiceRoot %>',
				title: '<%= title %>',
				authToken: localStorage.getItem('authToken') || ''
			});
			main.ports.removeToken.subscribe(function(token) {
				localStorage.removeItem('authToken', token);
			  main.ports.tokenRemoved.send();
			});
			main.ports.setSelectionStart.subscribe(function() {
				var input = document.getElementById('name-input');
				if(input) {
					input.blur();
					input.setSelectionRange(9999,9999);
					// input.value = input.value;
					input.focus();
					// var a = input.dispatchEvent(new KeyboardEvent('keydown', { calcelable: false, 'bubbles': false, key: "a" }));
					// console.log(a);
				}
			});
			window.addEventListener('keydown', function(e) {
			  if(e.ctrlKey && e.keyCode === 90) {
					// Ctrl+Z
					if(!document.querySelector(':focus')) {
						e.preventDefault();
						main.ports.undo.send();
					}
			  } else if(e.ctrlKey && e.keyCode === 89) {
					// Ctrl+Y
					if(!document.querySelector(':focus')) {
						e.preventDefault();
						main.ports.redo.send();
					}
			  }
			}, true);
			window.addEventListener('paste', function(e) {
				if(e.target.id === 'paste-from-spreadsheet') {
					e.preventDefault();
					// var items = e.clipboardData.items;
				  // for (var i = 0 ; i < items.length ; i++) {
				  //   var item = items[i];
					// 	console.log(item.type);
				  //   if (item.type.indexOf("image") != -1) {
				  //     var file = item.getAsFile();
				  //     console.log(file);
				  //   }
				  // }
					// console.log(e.clipboardData.types);
					// console.log(e.clipboardData.files[0]);
					// console.log(e.clipboardData.items[0]);
					// console.log(e.clipboardData.getData('text/html'));
					// console.log(e.clipboardData.getData('text/rtf'));
					// console.log(e.clipboardData.getData('text/plain'));
					// console.log(e.clipboardData.getData('Files'));
					// console.log(e.clipboardData.getData('image/png'));
					main.ports.clipboard.send(e.clipboardData.getData('text/html') || e.clipboardData.getData('text'));
				}
			}, true);

			// var dragging = null;
			// window.addEventListener('mousedown', function(e) {
			// 	// if(e.target.id === 'canvas-view') {
			// 		console.log('mousedown');
			// 		dragging = [e.pageX, e.pageY];
			// 		e.preventDefault();
			// 	// }
			// }, true);
			// window.addEventListener('mouseup', function(e) {
			// 	// if(e.target.id === 'canvas-view') {
{'fraction_non_alphanumeric': 0.20125786163522014, 'fraction_numerical': 0.007686932215234102, 'mean_word_length': 3.0034965034965033, 'pattern_counts': {'":': 0, '<': 42, '<?xml version=': 0, '>': 42, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 4, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1849499', 'n_tokens_mistral': 2403, 'n_tokens_neox': 1915, 'n_words': 289}