<commit_before>(function () {

	var getOriginalComputedStyles, setStyle, augment, makeTransition, transform, transformsEnabled, inside, outside;

	getOriginalComputedStyles = function ( computedStyle, properties ) {
		var original = {}, i;

		i = properties.length;
		while ( i-- ) {
			original[ properties[i] ] = computedStyle[ properties[i] ];
		}

		return original;
	};

	setStyle = function ( el, properties, map, params ) {
		var i = properties.length, prop;

		while ( i-- ) {
			prop = properties[i];
			if ( map && map[ prop ] ) {
				if ( typeof map[ prop ] === 'function' ) {
					el.style[ prop ] = map[ prop ]( params );
				} else {
					el.style[ prop ] = map[ prop ];
				}
			}

			else {
				el.style[ prop ] = 0;
			}
		}
	};

	augment = function ( target, source ) {
		var key;

		if ( !source ) {
			return target;
		}

		for ( key in source ) {
			if ( source.hasOwnProperty( key ) ) {
				target[ key ] = source[ key ];
			}
		}

		return target;
	};

	makeTransition = function ( properties, defaults, outside, inside ) {
		if ( typeof properties === 'string' ) {
			properties = [ properties ];
		}

		return function ( el, complete, params, info, isIntro ) {
			var transitionEndHandler, transitionStyle, computedStyle, original, startTransition, originalStyle, originalOpacity, targetOpacity, duration, start, end, source, target, positionStyle;

			params = parseTransitionParams( params );

			duration = params.duration || defaults.duration;
			easing = hyphenate( params.easing || defaults.easing );

			start = ( isIntro ? outside : inside );
			end = ( isIntro ? inside : outside );

			computedStyle = window.getComputedStyle( el );

			// if this is an intro, we need to transition TO the original styles
			if ( isIntro ) {
				// hide, to avoid flashes
				positionStyle = el.style.position;
				el.style.position = 'absolute';
				el.style.visibility = 'hidden';

				// we need to wait a beat before we can actually get values from computedStyle.
				// Yeah, I know, WTF browsers
				setTimeout( function () {
					var i, prop;

					original = getOriginalComputedStyles( computedStyle, properties );

					start = outside;
					end = augment( original, inside );

					// starting style
					el.style.position = positionStyle;
					setStyle( el, properties, start, params );
					el.style.visibility = 'visible';

					setTimeout( startTransition, 0 );
				}, 0 );
			}

			// otherwise we need to transition FROM them
			else {
				setTimeout( function () {
					var i, prop;

					original = getOriginalComputedStyles( computedStyle, properties );

					start = augment( original, inside );
					end = outside;

					// ending style
					setStyle( el, properties, start, params );

					setTimeout( startTransition, 0 );
				}, 0 );
			}

			startTransition = function () {
				var i, prop;

				el.style[ transition + 'Duration' ] = ( duration / 1000 ) + 's';
				el.style[ transition + 'Properties' ] = properties.map( hyphenate ).join( ',' );
				el.style[ transition + 'TimingFunction' ] = easing;

				transitionEndHandler = function ( event ) {
					el.removeEventListener( transitionend, transitionEndHandler );

					if ( isIntro ) {
						setTimeout( function () {
							if ( originalStyle ) {
								el.setAttribute( 'style', originalStyle );
							} else {
								el.removeAttribute( 'style' );
							}
						}, 0 );
					}

					complete();
				};
				
				el.addEventListener( transitionend, transitionEndHandler );

				setStyle( el, properties, end, params );
			};
		};
	};

	transitions.slide = makeTransition([
		'height',
		'borderTopWidth',
		'borderBottomWidth',
		'paddingTop',<commit_msg>tweaked transitions<commit_after>(function () {

	var getOriginalComputedStyles, setStyle, augment, makeTransition, transform, transformsEnabled, inside, outside;

	getOriginalComputedStyles = function ( computedStyle, properties ) {
		var original = {}, i;

		i = properties.length;
		while ( i-- ) {
			original[ properties[i] ] = computedStyle[ properties[i] ];
		}

		return original;
	};

	setStyle = function ( node, properties, map, params ) {
		var i = properties.length, prop;

		while ( i-- ) {
			prop = properties[i];
			if ( map && map[ prop ] ) {
				if ( typeof map[ prop ] === 'function' ) {
					node.style[ prop ] = map[ prop ]( params );
				} else {
					node.style[ prop ] = map[ prop ];
				}
			}

			else {
				node.style[ prop ] = 0;
			}
		}
	};

	augment = function ( target, source ) {
		var key;

		if ( !source ) {
			return target;
		}

		for ( key in source ) {
			if ( source.hasOwnProperty( key ) ) {
				target[ key ] = source[ key ];
			}
		}

		return target;
	};

	makeTransition = function ( properties, defaults, outside, inside ) {
		if ( typeof properties === 'string' ) {
			properties = [ properties ];
		}

		return function ( node, complete, params, info, isIntro ) {
			var transitionEndHandler, transitionStyle, computedStyle, originalComputedStyles, startTransition, originalStyle, originalOpacity, targetOpacity, duration, delay, start, end, source, target, positionStyle, visibilityStyle, stylesToRemove;

			params = parseTransitionParams( params );

			duration = params.duration || defaults.duration;
			easing = hyphenate( params.easing || defaults.easing );
			delay = ( params.delay || defaults.delay || 0 ) + ( ( params.stagger || defaults.stagger || 0 ) * info.i );

			start = ( isIntro ? outside : inside );
			end = ( isIntro ? inside : outside );

			computedStyle = window.getComputedStyle( node );
			originalStyle = node.getAttribute( 'style' );

			// if this is an intro, we need to transition TO the original styles
			if ( isIntro ) {
				// hide, to avoid flashes
				positionStyle = node.style.position;
				visibilityStyle = node.style.visibility;
				node.style.position = 'absolute';
				node.style.visibility = 'hidden';

				// we need to wait a beat before we can actually get values from computedStyle.
				// Yeah, I know, WTF browsers
				setTimeout( function () {
					var i, prop;

					originalComputedStyles = getOriginalComputedStyles( computedStyle, properties );
					
					start = outside;
					end = augment( originalComputedStyles, inside );

					// starting style
					node.style.position = positionStyle;
					node.style.visibility = visibilityStyle;
					
					setStyle( node, properties, start, params );

					setTimeout( startTransition, 0 );
				}, delay );
			}

			// otherwise we need to transition FROM them
			else {
				setTimeout( function () {
					var i, prop;

					originalComputedStyles = getOriginalComputedStyles( computedStyle, properties );

					start = augment( originalComputedStyles, inside );
					end = outside;

					// ending style
					setStyle( node, properties, start, params );

					setTimeout( startTransition, 0 );
				}, delay );
			}

			startTransition = function () {
				var i, prop;

				node.style[ transition + 'Duration' ] = ( duration / 1000 ) + 's';
				node.style[ transition + 'Properties' ] = properties.map( hyphenate ).join( ',' );
				node.style[ transition + 'TimingFunction' ] = easing;

				transitionEndHandler = function ( event ) {
					node.removeEventListener( transitionend, transitionEndHandler );

					if ( isIntro ) {
						node.setAttribute( 'style', originalStyle );
					}

					complete();
				};
				
				node.addEventListener( transitionend, transitionEndHandler );

				setStyle( node, properties, end, params );
			};
		};
	};

	transitions.slide = makeTransition([
		'height',
		'borderTopWidth',
		'borderBottomWidth',
		'paddingTop',
{'fraction_non_alphanumeric': 0.1236118455843469, 'fraction_numerical': 0.002511898466419884, 'mean_word_length': 2.9035087719298245, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, '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': '5205729', 'n_tokens_mistral': 2769, 'n_tokens_neox': 2154, 'n_words': 618}