<commit_before>/**
 * @license
 * Copyright 2018 Google Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

goog.module('googlecodelabs.CodelabAnalytics');

const EventHandler = goog.require('goog.events.EventHandler');

/**
 * The general codelab action event fired for trackable interactions.
 * @const string
 */
const ACTION_EVENT = 'google-codelab-action';

/**
 * The general codelab pageview event fired for trackable pageviews.
 * @const string
 */
const PAGEVIEW_EVENT = 'google-codelab-pageview';

/**
 * The Google Analytics ID. Analytics CE will not complete initialization
 * without a valid Analytics ID value set for this.
 * @const {string}
 */
const GAID_ATTR = 'gaid';

/**
 * The GAID defined by the current codelab.
 * @const {string}
 */
const CODELAB_GAID_ATTR = 'codelab-gaid';

/** @const {string} */
const CODELAB_ENV_ATTR = 'environment';

/** @const {string} */
const CODELAB_CATEGORY_ATTR = 'category';

/** @const {string} */
const ANALYTICS_READY_ATTR = 'anayltics-ready';

/**
 * A list of selectors whose elements are waiting for this to be set up.
 * @const Array<string>
 */
const DEPENDENT_SELECTORS = ['google-codelab'];


/**
 * Event detail passed when firing ACTION_EVENT.
 *
 * @typedef {{
 *  category: string,
 *  action: string,
 *  label: (?string|undefined),
 *  value: (?number|undefined)<commit_msg>Fixing closure type declarations (#165)<commit_after>/**
 * @license
 * Copyright 2018 Google Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

goog.module('googlecodelabs.CodelabAnalytics');

const EventHandler = goog.require('goog.events.EventHandler');

/**
 * The general codelab action event fired for trackable interactions.
 * @const {string}
 */
const ACTION_EVENT = 'google-codelab-action';

/**
 * The general codelab pageview event fired for trackable pageviews.
 * @const {string}
 */
const PAGEVIEW_EVENT = 'google-codelab-pageview';

/**
 * The Google Analytics ID. Analytics CE will not complete initialization
 * without a valid Analytics ID value set for this.
 * @const {string}
 */
const GAID_ATTR = 'gaid';

/**
 * The GAID defined by the current codelab.
 * @const {string}
 */
const CODELAB_GAID_ATTR = 'codelab-gaid';

/** @const {string} */
const CODELAB_ENV_ATTR = 'environment';

/** @const {string} */
const CODELAB_CATEGORY_ATTR = 'category';

/** @const {string} */
const ANALYTICS_READY_ATTR = 'anayltics-ready';

/**
 * A list of selectors whose elements are waiting for this to be set up.
 * @const {Array<string>}
 */
const DEPENDENT_SELECTORS = ['google-codelab'];


/**
 * Event detail passed when firing ACTION_EVENT.
 *
 * @typedef {{
 *  category: string,
 *  action: string,
 *  label: (?string|undefined),
 *  value: (?number|undefined)
{'fraction_non_alphanumeric': 0.1146886641830761, 'fraction_numerical': 0.005055880787653007, 'mean_word_length': 4.045637583892617, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '2770328', 'n_tokens_mistral': 1132, 'n_tokens_neox': 1095, 'n_words': 405}