1!function(e){function n(r){if(t[r])return t[r].exports;var i=t[r]={exports:{},id:r,loaded:!1};return e[r].call(i.exports,i,i.exports,n),i.loaded=!0,i.exports}var t={};return n.m=e,n.c=t,n.p="",n(0)}([function(module,exports,__webpack_require__){eval("'use strict';\n\nvar _Validation = __webpack_require__(1);\n\nvar _Validation2 = _interopRequireDefault(_Validation);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar validation = new _Validation2.default('area_form', false, false, false);\n\n//////////////////\n// WEBPACK FOOTER\n// ./workspace/js/request.js\n// module id = 0\n// module chunks = 1\n//# sourceURL=webpack:///./workspace/js/request.js?")},function(module,exports,__webpack_require__){eval("'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _Store = __webpack_require__(2);\n\nvar _Store2 = _interopRequireDefault(_Store);\n\nvar _FormListener = __webpack_require__(28);\n\nvar _FormListener2 = _interopRequireDefault(_FormListener);\n\nvar _FormTypes = __webpack_require__(31);\n\nvar _FormTypes2 = _interopRequireDefault(_FormTypes);\n\nvar _CheckInputItems = __webpack_require__(26);\n\nvar _CheckInputItems2 = _interopRequireDefault(_CheckInputItems);\n\nvar _ErrorMessageElement = __webpack_require__(30);\n\nvar _Animation = __webpack_require__(33);\n\nvar _BeforeUnloader = __webpack_require__(35);\n\nvar _BeforeUnloader2 = _interopRequireDefault(_BeforeUnloader);\n\nvar _Analyze = __webpack_require__(36);\n\nvar _Analyze2 = _interopRequireDefault(_Analyze);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\r\n * validaitonã®å¤§æ¬ã管çããcore\r\n * @param\r\n * formId str <form>ã®id\r\n * beforeunloadflag bool é¢è±ããã¨ãã«ã¢ã©ã¼ããã ãã\r\n * isAnalyze bool ããªãã¼ã·ã§ã³ã®å¤ãè¨æ¸¬ãã¼ã«ã«éãã\r\n * changeSubmitValue submitãã¿ã³ã®ããã¹ãã夿´ããã\r\n */\n\nvar Validation = function () {\n function Validation(formId, beforeUnloadFlag) {\n var isAnalyze = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n var changeSubmitValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;\n\n _classCallCheck(this, Validation);\n\n this.submitBtn = document.getElementById('js_btn_submit');\n this.form = document.getElementById(formId); //<form>\n this.beforeUnloadFlag = beforeUnloadFlag;\n this.beforeUnloader = '';\n this.isAnalyze = isAnalyze;\n this.changeSubmitValue = changeSubmitValue;\n this._setBeforeUnload();\n this._main();\n this._setSubmitState();\n if (this.isAnalyze) {\n _Analyze2.default.sendTimer(60000, 15 * 60 * 1000);\n }\n }\n\n _createClass(Validation, [{\n key: '_setBeforeUnload',\n value: function _setBeforeUnload() {\n var _this = this;\n\n if (!this.beforeUnloadFlag) return;\n this.beforeUnloader = new _BeforeUnloader2.default('å
¥åããããã©ã¼ã ãªããªãã¾ãã', this.isAnalyze);\n this.beforeUnloader.setUnload();\n //æ¥è
æ
å ±ã¯ãªãã¯ããã¨ã\n var gyoshaDetailBtn = document.getElementsByClassName('lnk_detail');\n for (var i = 0; i < gyoshaDetailBtn.length; i++) {\n gyoshaDetailBtn[i].addEventListener('click', function () {\n _this.beforeUnloader.removeUnload();\n }, true);\n }\n }\n }, {\n key: '_main',\n value: function _main() {\n for (var i = 0; i < _CheckInputItems2.default.length;
1 i++) {\n var type = _CheckInputItems2.default[i].dataset.formType;\n if (typeof type == 'undefined') {\n console.error('data-form-type屿§ãæå®ãã¦ãã ããã');\n } else {\n var inputType = this._getInputType(type);\n switch (inputType) {\n case 'input':\n _FormListener2.default.input(_CheckInputItems2.default[i]);\n break;\n case 'check':\n _FormListener2.default.check(_CheckInputItems2.default[i]);\n break;\n case 'select':\n _FormListener2.default.select(_CheckInputItems2.default[i]);\n break;\n default:\n console.error('typeãã¿ã¤ããã¾ãã');\n break;\n }\n }\n }\n //æåã®ãã§ãã¯\n this._triggerAllCheck('firstcheck');\n }\n }, {\n key: '_getInputType',\n value: function _getInputType(type) {\n for (var typeName in _FormTypes2.default) {\n if (_FormTypes2.default.hasOwnProperty(typeName)) {\n if (_FormTypes2.default[typeName].indexOf(type) >= 0) {\n return typeName;\n }\n }\n }\n }\n\n /**\r\n * submitãã¿ã³ã®è¨å®(ã¤ãã³ããªã¹ãã¼, ãµãã¹ã¯ã©ã¤ãã¼ãªã©)\r\n */\n\n }, {\n key: '_setSubmitState',\n value: function _setSubmitState() {\n var _this2 = this;\n\n this._setSubmitError();\n //subscriber\n var unsubscribe = _Store2.default.subscribe(function () {\n _this2._setSubmitError();\n });\n\n this._clickSubmitBtn();\n }\n\n /**\r\n * submitã«ã¨ã©ã¼ã®åæ°ããã¹ãã¨ã¯ã©ã¹ãè¨ç½®\r\n */\n\n }, {\n key: '_setSubmitError',\n value: function _setSubmitError(submitBtn) {\n var errorNum = this._getErrors().num;\n if (0 !== errorNum) {\n this.submitBtn.classList.add('disabled');\n if (this.changeSubmitValue) this.submitBtn.value = 'æ®ã' + errorNum + 'åã®è¨å
¥ãå¿
è¦ã§ã';\n } else {\n this.submitBtn.classList.remove('disabled');\n if (this.changeSubmitValue) this.submitBtn.value = 'ç³ãè¾¼ã¿ç¢ºèªã¸';\n }\n }\n\n /**\r\n * clickSubmitBtn\r\n */\n\n }, {\n key: '_clickSubmitBtn',\n value: function _clickSubmitBtn() {\n var _this3 = this;\n\n this.submitBtn.addEventListener('click', function (e) {\n e.preventDefault();\n e.stopPropagation();\n _this3._triggerAllCheck('submitEvent');\n var errors = _this3._getErrors();\n if (errors.num !== 0) {\n //ã¨ã©ã¼ãããå ´å\n //ä¸ããè¦ç´ ãè¦ã¤ããããã«åãã\n for (var i = 0; i < _CheckInputItems2.default.length; i++) {\n var name = _CheckInputItems2.default[i].dataset.formName;\n if (typeof name !== 'undefined') {\n if (errors.names.indexOf(name) >= 0) {\n (0, _Animation.scrollTo)(_ErrorMessageElement.errorMessageElementList[name], 300);\n return;\n }\n }\n }\n } else {\n //submit!!\n if (_this3.beforeUnloader !== '') _this3.beforeUnloader.removeUnload();\n if (_this3.isAnalyze) {\n _Analyze2.default.send('confirm', function () {\n _this3.form.submit();\n });\n } else {\n _this3.form.submit();\n }\n }\n }, false);\n }\n\n /**\r\n * errorã®æ
å ±ãåå¾\r\n */\n\n }, {\n key: '_getErrors',\n value: function _getErrors() {\n var validationState = _Store2.default.getState().validation;\n var errors = {\n num: 0,\n names: []\n };\n for (var name in validationState) {\n if (validationState.hasOwnProperty(name)) {\n if (validationState[name].flag === false) {\n errors.num += 1;\n errors.names.push(name);\n }\n }\n }\n return errors;\n }\n\n /**\r\n * ãã¹ã¦ã®è¦ç´ ã«ç¬èªã¤ãã³ããçºç«ã䏿¬ã§ããªãã¼ã·ã§ã³ãããã¨ã(submitããããã¨ãã«ä½¿ã)\r\n * @param\r\n * eventName str\r\n */\n\n }, {\n key: '_triggerAllCheck',\n value: function _triggerAllCheck(eventName) {\n var event = void 0;\n if (window.CustomEvent) {\n event = new CustomEvent(eventName);\n } else {\n event = document.createEvent('CustomEvent');\n event.initCustomEvent(eventName, true, true);\n }
1\n var validaitonElements = document.getElementsByClassName('js_validation_submit_checker');\n for (var i = 0; i < validaitonElements.length; i++) {\n validaitonElements[i].dispatchEvent(event);\n }\n }\n }]);\n\n return Validation;\n}();\n\nexports.default = Validation;\n\n//////////////////\n// WEBPACK FOOTER\n// ./workspace/js/Validation.js\n// module id = 1\n// module chunks = 0 1\n//# sourceURL=webpack:///./workspace/js/Validation.js?")},function(module,exports,__webpack_require__){eval("'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _redux = __webpack_require__(3);\n\nvar _Recucer = __webpack_require__(24);\n\nvar _Recucer2 = _interopRequireDefault(_Recucer);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar store = (0, _redux.createStore)(_Recucer2.default);\n\nexports.default = store;\n\n//////////////////\n// WEBPACK FOOTER\n// ./workspace/js/Stroe/Store.js\n// module id = 2\n// module chunks = 0 1\n//# sourceURL=webpack:///./workspace/js/Stroe/Store.js?")},function(module,exports,__webpack_require__){eval("'use strict';\n\nexports.__esModule = true;\nexports.compose = exports.applyMiddleware = exports.bindActionCreators = exports.combineReducers = exports.createStore = undefined;\n\nvar _createStore = __webpack_require__(4);\n\nvar _createStore2 = _interopRequireDefault(_createStore);\n\nvar _combineReducers = __webpack_require__(19);\n\nvar _combineReducers2 = _interopRequireDefault(_combineReducers);\n\nvar _bindActionCreators = __webpack_require__(21);\n\nvar _bindActionCreators2 = _interopRequireDefault(_bindActionCreators);\n\nvar _applyMiddleware = __webpack_require__(22);\n\nvar _applyMiddleware2 = _interopRequireDefault(_applyMiddleware);\n\nvar _compose = __webpack_require__(23);\n\nvar _compose2 = _interopRequireDefault(_compose);\n\nvar _warning = __webpack_require__(20);\n\nvar _warning2 = _interopRequireDefault(_warning);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\n/*\n* This is a dummy function to check if the function name has been altered by minification.\n* If the function has been minified and NODE_ENV !== 'production', warn the user.\n*/\nfunction isCrushed() {}\n\nif (false) {\n (0, _warning2['default'])('You are currently using minified code outside of NODE_ENV === \\'production\\'. ' + 'This means that you are running a slower development build of Redux. ' + 'You can use loose-envify (https://github.com/zertosh/loose-envify) for browserify ' + 'or DefinePlugin for webpack (http://stackoverflow.com/questions/30030031) ' + 'to ensure you have the correct code for your production build.');\n}\n\nexports.createStore = _createStore2['default'];\nexports.combineReducers = _combineReducers2['default'];\nexports.bindActionCreators = _bindActionCreators2['default'];\nexports.applyMiddleware = _applyMiddleware2['default'];\nexports.compose = _compose2['default'];\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/redux/lib/index.js\n// module id = 3\n// module chunks = 0 1\n//# sourceURL=webpack:///./~/redux/lib/index.js?")},function(module,exports,__webpack_require__){eval("'use strict';\n\nexports.__esModule = true;\nexports.ActionTypes = undefined;\nexports['default'] = createStore;\n\nvar _isPlainObject = __webpack_require__(5);\n\nvar _isPlainObject2 = _interopRequireDefault(_isPlainObject);\n\nvar _symbolObservable = __webpack_require__(15);\n\nvar _symbolObservable2 = _interopRequireDefault(_symbolObservable);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\n/**\n * These are private action types reserved by Redux.\n * For any unknown actions, you must return the current state.\n * If the current state is undefined, you must return the initial state.\n * Do not reference these action types directly in your code.\n */\nvar ActionTypes = exports.ActionTypes = {\n INIT: '@@redux/INIT'\n};\n\n/**\n * Creates a Redux store that holds the state tree.\n * The only way to change the data in the store is to call `dispatch()` on it.\n *\n * There should only be a single store in y
1our app. To specify how different\n * parts of the state tree respond to actions, you may combine several reducers\n * into a single reducer function by using `combineReducers`.\n *\n * @param {Function} reducer A function that returns the next state tree, given\n * the current state tree and the action to handle.\n *\n * @param {any} [preloadedState] The initial state. You may optionally specify it\n * to hydrate the state from the server in universal apps, or to restore a\n * previously serialized user session.\n * If you use `combineReducers` to produce the root reducer function, this must be\n * an object with the same shape as `combineReducers` keys.\n *\n * @param {Function} enhancer The store enhancer. You may optionally specify it\n * to enhance the store with third-party capabilities such as middleware,\n * time travel, persistence, etc. The only store enhancer that ships with Redux\n * is `applyMiddleware()`.\n *\n * @returns {Store} A Redux store that lets you read the state, dispatch actions\n * and subscribe to changes.\n */\nfunction createStore(reducer, preloadedState, enhancer) {\n var _ref2;\n\n if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') {\n enhancer = preloadedState;\n preloadedState = undefined;\n }\n\n if (typeof enhancer !== 'undefined') {\n if (typeof enhancer !== 'function') {\n throw new Error('Expected the enhancer to be a function.');\n }\n\n return enhancer(createStore)(reducer, preloadedState);\n }\n\n if (typeof reducer !== 'function') {\n throw new Error('Expected the reducer to be a function.');\n }\n\n var currentReducer = reducer;\n var currentState = preloadedState;\n var currentListeners = [];\n var nextListeners = currentListeners;\n var isDispatching = false;\n\n function ensureCanMutateNextListeners() {\n if (nextListeners === currentListeners) {\n nextListeners = currentListeners.slice();\n }\n }\n\n /**\n * Reads the state tree managed by the store.\n *\n * @returns {any} The current state tree of your application.\n */\n function getState() {\n return currentState;\n }\n\n /**\n * Adds a change listener. It will be called any time an action is dispatched,\n * and some part of the state tree may potentially have changed. You may then\n * call `getState()` to read the current state tree inside the callback.\n *\n * You may call `dispatch()` from a change listener, with the following\n * caveats:\n *\n * 1. The subscriptions are snapshotted just before every `dispatch()` call.\n * If you subscribe or unsubscribe while the listeners are being invoked, this\n * will not have any effect on the `dispatch()` that is currently in progress.\n * However, the next `dispatch()` call, whether nested or not, will use a more\n * recent snapshot of the subscription list.\n *\n * 2. The listener should not expect to see all state changes, as the state\n * might have been updated multiple times during a nested `dispatch()` before\n * the listener is called. It is, however, guaranteed that all subscribers\n * registered before the `dispatch()` started will be called with the latest\n * state by the time it exits.\n *\n * @param {Function} listener A callback to be invoked on every dispatch.\n * @returns {Function} A function to remove this change listener.\n */\n function subscribe(listener) {\n if (typeof listener !== 'function') {\n throw new Error('Expected listener to be a function.');\n }\n\n var isSubscribed = true;\n\n ensureCanMutateNextListeners();\n nextListeners.push(listener);\n\n return function unsubscribe() {\n if (!isSubscribed) {\n return;\n }\n\n isSubscribed = false;\n\n ensureCanMutateNextListeners();\n var index = nextListeners.indexOf(listener);\n nextListeners.splice(index, 1);\n };\n }\n\n /**\n * Dispatches an action. It is the only way to trigger a state change.\n *\n * The `reducer` function, used to create the store, will be called with the\n * current state tree and the given `action`. Its return value will\n * be considered the **next** state of the tree, and the change listeners\n * will be notified.\n *\n * The base implementation only supports plain object actions. If you want to\n * dispatch a Promise, an Observable, a thunk, or something else, you need to\n * wrap your store creating function into the corresponding middleware. For\n * example, see the documentation for the `redux-thunk` package. Even the\n * middleware will eventually dispatch plain object actions using this method.\n *\n * @param {Object} action A plain object representing âwhat changedâ. It is\n * a good idea to keep actions serializable so you can record and replay user\n * sessions, or use the time travelling `redux-devtools`. An action must have\n * a `type` property which may not be `undefined`. It is a good idea to use\n * string constants for action types.\n *\n * @returns {Object} For convenience, the same action object you dispatched.\n *\n * Note that, if you use a custom middleware, it may wrap `dispatch()` to\n * return something else (for example, a Promise you can await).\n */\n function dispatch(action) {\n if (!(0, _isPlainObject2['default'])(action)) {\n throw new Error('Actions must be plain objects. ' + 'Use custom middleware for async actions.');\n }\n\n if (typeof action.type === 'undefined') {\n throw new Error('Actions may not have an undefined \"type\" property. ' + 'Have you misspelled a constant?');\n }\n\n if (isDispatching) {\n throw new Error('Reducers may not dispatch actions.');\n }\n\n try {\n isDispatching = true;\n currentState = currentReducer(currentState, action);\n } finally {\n isDispatching = false;\n }\n\n var listeners = currentListeners = nextListeners;\n for (var i = 0; i < listeners.length;
1 i++) {\n listeners[i]();\n }\n\n return action;\n }\n\n /**\n * Replaces the reducer currently used by the store to calculate the state.\n *\n * You might need this if your app implements code splitting and you want to\n * load some of the reducers dynamically. You might also need this if you\n * implement a hot reloading mechanism for Redux.\n *\n * @param {Function} nextReducer The reducer for the store to use instead.\n * @returns {void}\n */\n function replaceReducer(nextReducer) {\n if (typeof nextReducer !== 'function') {\n throw new Error('Expected the nextReducer to be a function.');\n }\n\n currentReducer = nextReducer;\n dispatch({ type: ActionTypes.INIT });\n }\n\n /**\n * Interoperability point for observable/reactive libraries.\n * @returns {observable} A minimal observable of state changes.\n * For more information, see the observable proposal:\n * https://github.com/zenparsing/es-observable\n */\n function observable() {\n var _ref;\n\n var outerSubscribe = subscribe;\n return _ref = {\n /**\n * The minimal observable subscription method.\n * @param {Object} observer Any object that can be used as an observer.\n * The observer object should have a `next` method.\n * @returns {subscription} An object with an `unsubscribe` method that can\n * be used to unsubscribe the observable from the store, and prevent further\n * emission of values from the observable.\n */\n subscribe: function subscribe(observer) {\n if (typeof observer !== 'object') {\n throw new TypeError('Expected the observer to be an object.');\n }\n\n function observeState() {\n if (observer.next) {\n observer.next(getState());\n }\n }\n\n observeState();\n var unsubscribe = outerSubscribe(observeState);\n return { unsubscribe: unsubscribe };\n }\n }, _ref[_symbolObservable2['default']] = function () {\n return this;\n }, _ref;\n }\n\n // When a store is created, an \"INIT\" action is dispatched so that every\n // reducer returns their initial state. This effectively populates\n // the initial state tree.\n dispatch({ type: ActionTypes.INIT });\n\n return _ref2 = {\n dispatch: dispatch,\n subscribe: subscribe,\n getState: getState,\n replaceReducer: replaceReducer\n }, _ref2[_symbolObservable2['default']] = observable, _ref2;\n}\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/redux/lib/createStore.js\n// module id = 4\n// module chunks = 0 1\n//# sourceURL=webpack:///./~/redux/lib/createStore.js?")},function(module,exports,__webpack_require__){eval("var baseGetTag = __webpack_require__(6),\n getPrototype = __webpack_require__(12),\n isObjectLike = __webpack_require__(14);\n\n/** `Object#toString` result references. */\nvar objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to infer the `Object` constructor. */\nvar objectCtorString = funcToString.call(Object);\n\n/**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @static\n * @memberOf _\n * @since 0.8.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\nfunction isPlainObject(value) {\n if (!isObjectLike(value) || baseGetTag(value) != objectTag) {\n return false;\n }\n var proto = getPrototype(value);\n if (proto === null) {\n return true;\n }\n var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor == 'function' && Ctor instanceof Ctor &&\n funcToString.call(Ctor) == objectCtorStr
1ing;\n}\n\nmodule.exports = isPlainObject;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/redux/~/lodash/isPlainObject.js\n// module id = 5\n// module chunks = 0 1\n//# sourceURL=webpack:///./~/redux/~/lodash/isPlainObject.js?")},function(module,exports,__webpack_require__){eval("var Symbol = __webpack_require__(7),\n getRawTag = __webpack_require__(10),\n objectToString = __webpack_require__(11);\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n value = Object(value);\n return (symToStringTag && symToStringTag in value)\n ? getRawTag(value)\n : objectToString(value);\n}\n\nmodule.exports = baseGetTag;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/redux/~/lodash/_baseGetTag.js\n// module id = 6\n// module chunks = 0 1\n//# sourceURL=webpack:///./~/redux/~/lodash/_baseGetTag.js?")},function(module,exports,__webpack_require__){eval("var root = __webpack_require__(8);\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nmodule.exports = Symbol;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/redux/~/lodash/_Symbol.js\n// module id = 7\n// module chunks = 0 1\n//# sourceURL=webpack:///./~/redux/~/lodash/_Symbol.js?")},function(module,exports,__webpack_require__){eval("var freeGlobal = __webpack_require__(9);\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nmodule.exports = root;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/redux/~/lodash/_root.js\n// module id = 8\n// module chunks = 0 1\n//# sourceURL=webpack:///./~/redux/~/lodash/_root.js?")},function(module,exports){eval("/* WEBPACK VAR INJECTION */(function(global) {/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nmodule.exports = freeGlobal;\n\n/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/redux/~/lodash/_freeGlobal.js\n// module id = 9\n// module chunks = 0 1\n//# sourceURL=webpack:///./~/redux/~/lodash/_freeGlobal.js?")},function(module,exports,__webpack_require__){eval("var Symbol = __webpack_require__(7);\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nmodule.exports = getRawTag;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/redux/~/lodash/_getRawTag.js\n// module id = 10\n// module chunks = 0 1\n//# sourceURL=webpack:///./~/redux/~/lodash/_getRawTag.js?")},function(module,exports){eval("/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\
1n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nmodule.exports = objectToString;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/redux/~/lodash/_objectToString.js\n// module id = 11\n// module chunks = 0 1\n//# sourceURL=webpack:///./~/redux/~/lodash/_objectToString.js?")},function(module,exports,__webpack_require__){eval("var overArg = __webpack_require__(13);\n\n/** Built-in value references. */\nvar getPrototype = overArg(Object.getPrototypeOf, Object);\n\nmodule.exports = getPrototype;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/redux/~/lodash/_getPrototype.js\n// module id = 12\n// module chunks = 0 1\n//# sourceURL=webpack:///./~/redux/~/lodash/_getPrototype.js?")},function(module,exports){eval("/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\nmodule.exports = overArg;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/redux/~/lodash/_overArg.js\n// module id = 13\n// module chunks = 0 1\n//# sourceURL=webpack:///./~/redux/~/lodash/_overArg.js?")},function(module,exports){eval("/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nmodule.exports = isObjectLike;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/redux/~/lodash/isObjectLike.js\n// module id = 14\n// module chunks = 0 1\n//# sourceURL=webpack:///./~/redux/~/lodash/isObjectLike.js?")},function(module,exports,__webpack_require__){eval("module.exports = __webpack_require__(16);\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/redux/~/symbol-observable/index.js\n// module id = 15\n// module chunks = 0 1\n//# sourceURL=webpack:///./~/redux/~/symbol-observable/index.js?")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(global, module) {'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _ponyfill = __webpack_require__(18);\n\nvar _ponyfill2 = _interopRequireDefault(_ponyfill);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\nvar root; /* global window */\n\n\nif (typeof self !== 'undefined') {\n root = self;\n} else if (typeof window !== 'undefined') {\n root = window;\n} else if (typeof global !== 'undefined') {\n root = global;\n} else if (true) {\n root = module;\n} else {\n root = Function('return this')();\n}\n\nvar result = (0, _ponyfill2['default'])(root);\nexports['default'] = result;\n/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()), __webpack_require__(17)(module)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/redux/~/symbol-observable/lib/index.js\n// module id = 16\n// module chunks = 0 1\n//# sourceURL=webpack:///./~/redux/~/symbol-observable/lib/index.js?")},function(module,exports){eval("module.exports = function(module) {\r\n\tif(!module.webpackPolyfill) {\r\n\t\tmodule.deprecate = function() {};\r\n\t\tmodule.paths = [];\r\n\t\t// module.parent = undefined by default\r\n\t\tmodule.children = [];\r\n\t\tmodule.webpackPolyfill = 1;\r\n\t}\r\n\treturn module;\r\n}\r\n\n\n//////////////////\n// WEBPACK FOOTER\n// (webpack)/buildin/module.js\n// module id = 17\n// module chunks = 0 1\n//# sourceURL=webpack:///(webpack)/buildin/module.js?")},function(module,exports){eval("'use strict';
1\n\nObject.defineProperty(exports, \"__esModule\", {\n\tvalue: true\n});\nexports['default'] = symbolObservablePonyfill;\nfunction symbolObservablePonyfill(root) {\n\tvar result;\n\tvar _Symbol = root.Symbol;\n\n\tif (typeof _Symbol === 'function') {\n\t\tif (_Symbol.observable) {\n\t\t\tresult = _Symbol.observable;\n\t\t} else {\n\t\t\tresult = _Symbol('observable');\n\t\t\t_Symbol.observable = result;\n\t\t}\n\t} else {\n\t\tresult = '@@observable';\n\t}\n\n\treturn result;\n};\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/redux/~/symbol-observable/lib/ponyfill.js\n// module id = 18\n// module chunks = 0 1\n//# sourceURL=webpack:///./~/redux/~/symbol-observable/lib/ponyfill.js?"); 2},function(module,exports,__webpack_require__){eval("'use strict';\n\nexports.__esModule = true;\nexports['default'] = combineReducers;\n\nvar _createStore = __webpack_require__(4);\n\nvar _isPlainObject = __webpack_require__(5);\n\nvar _isPlainObject2 = _interopRequireDefault(_isPlainObject);\n\nvar _warning = __webpack_require__(20);\n\nvar _warning2 = _interopRequireDefault(_warning);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\nfunction getUndefinedStateErrorMessage(key, action) {\n var actionType = action && action.type;\n var actionName = actionType && '\"' + actionType.toString() + '\"' || 'an action';\n\n return 'Given action ' + actionName + ', reducer \"' + key + '\" returned undefined. ' + 'To ignore an action, you must explicitly return the previous state.';\n}\n\nfunction getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unex
2pectedKeyCache) {\n var reducerKeys = Object.keys(reducers);\n var argumentName = action && action.type === _createStore.ActionTypes.INIT ? 'preloadedState argument passed to createStore' : 'previous state received by the reducer';\n\n if (reducerKeys.length === 0) {\n return 'Store does not have a valid reducer. Make sure the argument passed ' + 'to combineReducers is an object whose values are reducers.';\n }\n\n if (!(0, _isPlainObject2['default'])(inputState)) {\n return 'The ' + argumentName + ' has unexpected type of \"' + {}.toString.call(inputState).match(/\\s([a-z|A-Z]+)/)[1] + '\". Expected argument to be an object with the following ' + ('keys: \"' + reducerKeys.join('\", \"') + '\"');\n }\n\n var unexpectedKeys = Object.keys(inputState).filter(function (key) {\n return !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key];\n });\n\n unexpectedKeys.forEach(function (key) {\n unexpectedKeyCache[key] = true;\n });\n\n if (unexpectedKeys.length > 0) {\n return 'Unexpected ' + (unexpectedKeys.length > 1 ? 'keys' : 'key') + ' ' + ('\"' + unexpectedKeys.join('\", \"') + '\" found in ' + argumentName + '. ') + 'Expected to find one of the known reducer keys instead: ' + ('\"' + reducerKeys.join('\", \"') + '\". Unexpected keys will be ignored.');\n }\n}\n\nfunction assertReducerSanity(reducers) {\n Object.keys(reducers).forEach(function (key) {\n var reducer = reducers[key];\n var initialState = reducer(undefined, { type: _createStore.ActionTypes.INIT });\n\n if (typeof initialState === 'undefined') {\n throw new Error('Reducer \"' + key + '\" returned undefined during initialization. ' + 'If the state passed to the reducer is undefined, you must ' + 'explicitly return the initial state. The initial state may ' + 'not be undefined.');\n }\n\n var type = '@@redux/PROBE_UNKNOWN_ACTION_' + Math.random().toString(36).substring(7).split('').join('.');\n if (typeof reducer(undefined, { type: type }) === 'undefined') {\n throw new Error('Reducer \"' + key + '\" returned undefined when probed with a random type. ' + ('Don\\'t try to handle ' + _createStore.ActionTypes.INIT + ' or other actions in \"redux/*\" ') + 'namespace. They are considered private. Instead, you must return the ' + 'current state for any unknown actions, unless it is undefined, ' + 'in which case you must return the initial state, regardless of the ' + 'action type. The initial state may not be undefined.');\n }\n });\n}\n\n/**\n * Turns an object whose values are different reducer functions, into a single\n * reducer function. It will call every child reducer, and gather their results\n * into a single state object, whose keys correspond to the keys of the passed\n * reducer functions.\n *\n * @param {Object} reducers An object whose values correspond to different\n * reducer functions that need to be combined into one. One handy way to obtain\n * it is to use ES6 `import * as reducers` syntax. The reducers may never return\n * undefined for any action. Instead, they should return their initial state\n * if the state passed to them was undefined, and the current state for any\n * unrecognized action.\n *\n * @returns {Function} A reducer function that invokes every reducer inside the\n * passed object, and builds a state object with the same shape.\n */\nfunction combineReducers(reducers) {\n var reducerKeys = Object.keys(reducers);\n var finalReducers = {};\n for (var i = 0; i < reducerKeys.length; i++) {\n var key = reducerKeys[i];\n\n if (false) {\n if (typeof reducers[key] === 'undefined') {\n (0, _warning2['default'])('No reducer provided for key \"' + key + '\"');\n }\n }\n\n if (typeof reducers[key] === 'function') {\n finalReducers[key] = reducers[key];\n }\n }\n var finalReducerKeys = Object.keys(finalReducers);\n\n if (false) {\n var unexpectedKeyCache = {};\n }\n\n var sanityError;\n try {\n assertReducerSanity(finalReducers);\n } catch (e) {\n sanityError = e;\n }\n\n return function combination() {\n var state = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n var action = arguments[1];\n\n if (sanityError) {\n throw sanityError;\n }\n\n if (false) {\n var warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unex
2pectedKeyCache);\n if (warningMessage) {\n (0, _warning2['default'])(warningMessage);\n }\n }\n\n var hasChanged = false;\n var nextState = {};\n for (var i = 0; i < finalReducerKeys.length; i++) {\n var key = finalReducerKeys[i];\n var reducer = finalReducers[key];\n var previousStateForKey = state[key];\n var nextStateForKey = reducer(previousStateForKey, action);\n if (typeof nextStateForKey === 'undefined') {\n var errorMessage = getUndefinedStateErrorMessage(key, action);\n throw new Error(errorMessage);\n }\n nextState[key] = nextStateForKey;\n hasChanged = hasChanged || nextStateForKey !== previousStateForKey;\n }\n return hasChanged ? nextState : state;\n };\n}\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/redux/lib/combineReducers.js\n// module id = 19\n// module chunks = 0 1\n//# sourceURL=webpack:///./~/redux/lib/combineReducers.js?")},function(module,exports){eval("'use strict';\n\nexports.__esModule = true;\nexports['default'] = warning;\n/**\n * Prints a warning in the console if it exists.\n *\n * @param {String} message The warning message.\n * @returns {void}\n */\nfunction warning(message) {\n /* eslint-disable no-console */\n if (typeof console !== 'undefined' && typeof console.error === 'function') {\n console.error(message);\n }\n /* eslint-enable no-console */\n try {\n // This error was thrown as a convenience so that if you enable\n // \"break on all exceptions\" in your console,\n // it would pause the execution at this line.\n throw new Error(message);\n /* eslint-disable no-empty */\n } catch (e) {}\n /* eslint-enable no-empty */\n}\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/redux/lib/utils/warning.js\n// module id = 20\n// module chunks = 0 1\n//# sourceURL=webpack:///./~/redux/lib/utils/warning.js?")},function(module,exports){eval("'use strict';\n\nexports.__esModule = true;\nexports['default'] = bindActionCreators;\nfunction bindActionCreator(actionCreator, dispatch) {\n return function () {\n return dispatch(actionCreator.apply(undefined, arguments));\n };\n}\n\n/**\n * Turns an object whose values are action creators, into an object with the\n * same keys, but with every function wrapped into a `dispatch` call so they\n * may be invoked directly. This is just a convenience method, as you can call\n * `store.dispatch(MyActionCreators.doSomething())` yourself just fine.\n *\n * For convenience, you can also pass a single function as the first argument,\n * and get a function in return.\n *\n * @param {Function|Object} actionCreators An object whose values are action\n * creator functions. One handy way to obtain it is to use ES6 `import * as`\n * syntax. You may also pass a single function.\n *\n * @param {Function} dispatch The `dispatch` function available on your Redux\n * store.\n *\n * @returns {Function|Object} The object mimicking the original object, but with\n * every action creator wrapped into the `dispatch` call. If you passed a\n * function as `actionCreators`, the return value will also be a single\n * function.\n */\nfunction bindActionCreators(actionCreators, dispatch) {\n if (typeof actionCreators === 'function') {\n return bindActionCreator(actionCreators, dispatch);\n }\n\n if (typeof actionCreators !== 'object' || actionCreators === null) {\n throw new Error('bindActionCreators expected an object or a function, instead received ' + (actionCreators === null ? 'null' : typeof actionCreators) + '. ' + 'Did you write \"import ActionCreators from\" instead of \"import * as ActionCreators from\"?');\n }\n\n var keys = Object.keys(actionCreators);\n var boundActionCreators = {};\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n var actionCreator = actionCreators[key];\n if (typeof actionCreator === 'function') {\n boundActionCreators[key] = bindActionCreator(actionCreator, dispatch);\n }\n }\n return boundActionCreators;\n}\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/redux/lib/bindActionCreators.js\n// module id = 21\n// module chunks = 0 1\n//# sourceURL=webpack:///./~/redux/lib/bindActionCreators.js?")},function(module,exports,__webpack_require__){eval("'use strict';
2\n\nexports.__esModule = true;\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nexports['default'] = applyMiddleware;\n\nvar _compose = __webpack_require__(23);\n\nvar _compose2 = _interopRequireDefault(_compose);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\n/**\n * Creates a store enhancer that applies middleware to the dispatch method\n * of the Redux store. This is handy for a variety of tasks, such as expressing\n * asynchronous actions in a concise manner, or logging every action payload.\n *\n * See `redux-thunk` package as an example of the Redux middleware.\n *\n * Because middleware is potentially asynchronous, this should be the first\n * store enhancer in the composition chain.\n *\n * Note that each middleware will be given the `dispatch` and `getState` functions\n * as named arguments.\n *\n * @param {...Function} middlewares The middleware chain to be applied.\n * @returns {Function} A store enhancer applying the middleware.\n */\nfunction applyMiddleware() {\n for (var _len = arguments.length, middlewares = Array(_len), _key = 0; _key < _len; _key++) {\n middlewares[_key] = arguments[_key];\n }\n\n return function (createStore) {\n return function (reducer, preloadedState, enhancer) {\n var store = createStore(reducer, preloadedState, enhancer);\n var _dispatch = store.dispatch;\n var chain = [];\n\n var middlewareAPI = {\n getState: store.getState,\n dispatch: function dispatch(action) {\n return _dispatch(action);\n }\n };\n chain = middlewares.map(function (middleware) {\n return middleware(middlewareAPI);\n });\n _dispatch = _compose2['default'].apply(undefined, chain)(store.dispatch);\n\n return _extends({}, store, {\n dispatch: _dispatch\n });\n };\n };\n}\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/redux/lib/applyMiddleware.js\n// module id = 22\n// module chunks = 0 1\n//# sourceURL=webpack:///./~/redux/lib/applyMiddleware.js?")},function(module,exports){eval('"use strict";\n\nexports.__esModule = true;\nexports["default"] = compose;\n/**\n * Composes single-argument functions from right to left. The rightmost\n * function can take multiple arguments as it provides the signature for\n * the resulting composite function.\n *\n * @param {...Function} funcs The functions to compose.\n * @returns {Function} A function obtained by composing the argument functions\n * from right to left. For example, compose(f, g, h) is identical to doing\n * (...args) => f(g(h(...args))).\n */\n\nfunction compose() {\n for (var _len = arguments.length, funcs = Array(_len), _key = 0; _key < _len; _key++) {\n funcs[_key] = arguments[_key];\n }\n\n if (funcs.length === 0) {\n return function (arg) {\n return arg;\n };\n }\n\n if (funcs.length === 1) {\n return funcs[0];\n }\n\n var last = funcs[funcs.length - 1];\n var rest = funcs.slice(0, -1);\n return function () {\n return rest.reduceRight(function (composed, f) {\n return f(composed);\n }, last.apply(undefined, arguments));\n };\n}\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/redux/lib/compose.js\n// module id = 23\n// module chunks = 0 1\n//# sourceURL=webpack:///./~/redux/lib/compose.js?')},function(module,exports,__webpack_require__){eval("'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _redux = __webpack_require__(3);\n\nvar _ValidationReducer = __webpack_require__(25);\n\nvar _ValidationReducer2 = _interopRequireDefault(_ValidationReducer);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\r\n * reducer ãã¾ã¨ãã\r\n */\nvar reducer = (0, _redux.combineReducers)({\n validation: _ValidationReducer2.default\n});\n\nexports.default = reducer;\n\n//////////////////\n// WEBPACK FOOTER\n// ./workspace/js/Reducer/Recucer.js\n// module id = 24\n// module chunks = 0 1\n//# sourceURL=webpack:///./workspace/js/Reducer/Recucer.js?")},function(module,exports,__webpack_require__){eval("'use strict';
2\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = validationReducer;\n\nvar _CheckInputItems = __webpack_require__(26);\n\nvar _CheckInputItems2 = _interopRequireDefault(_CheckInputItems);\n\nvar _actionTypes = __webpack_require__(27);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\r\n * validaiton ã®åæè¨å®\r\n */\n/**\r\n * validationã®Reducer\r\n * Storeã®ä¸ã®validationããããã£ã§ç®¡çãã\r\n * validationããããã£ã®ãªãã¸ã§ã¯ãæ§æã¯\r\n * {\r\n * [input name]: {\r\n * element: element object,\r\n * validaitonMessage: string,\r\n * flag: bool,\r\n * }\r\n * }\r\n */\nvar initialValidationState = {};\nfor (var i = 0; i < _CheckInputItems2.default.length; i++) {\n var name = _CheckInputItems2.default[i].dataset.formName;\n var flag = false;\n initialValidationState[name] = {\n elememt: _CheckInputItems2.default[i],\n validationMessage: '',\n flag: flag\n };\n};\n\nfunction validationReducer() {\n var validationState = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialValidationState;\n var action = arguments[1];\n\n var propObject = void 0,\n item = {};\n switch (action.type) {\n case _actionTypes.VALIDATION_CHECK_OK:\n propObject = {\n validationMessage: '',\n flag: true\n };\n item[action.name] = Object.assign({}, validationState[action.name], propObject);\n return Object.assign({}, validationState, item);\n case _actionTypes.VALIDATION_CHECK_ERROR:\n propObject = {\n validationMessage: action.validationMessage,\n flag: false\n };\n item[action.name] = Object.assign({}, validationState[action.name], propObject);\n return Object.assign({}, validationState, item);\n case _actionTypes.VALIDATION_ACTION_ERROR:\n console.error(_actionTypes.VALIDATION_ACTION_ERROR);\n return validationState;\n default:\n return validationState;\n }\n};\n\n//////////////////\n// WEBPACK FOOTER\n// ./workspace/js/Reducer/ValidationReducer.js\n// module id = 25\n// module chunks = 0 1\n//# sourceURL=webpack:///./workspace/js/Reducer/ValidationReducer.js?")},function(module,exports){eval("'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n/**\r\n * ãã§ãã¯ããDOMã®åå¾ã使ãã¾ããããç¬ç«ãããã\r\n * @type {[type]}\r\n */\nvar inputItems = document.getElementsByClassName('js_validation_item');\nexports.default = inputItems;\n\n//////////////////\n// WEBPACK FOOTER\n// ./workspace/js/CheckInputItems.js\n// module id = 26\n// module chunks = 0 1\n//# sourceURL=webpack:///./workspace/js/CheckInputItems.js?")},function(module,exports){eval("'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n/**\n * action type ä¸è¦§\n */\nvar VALIDATION_CHECK_OK = exports.VALIDATION_CHECK_OK = 'VALIDATION_CHECK_OK';\nvar VALIDATION_CHECK_ERROR = exports.VALIDATION_CHECK_ERROR = 'VALIDATION_CHECK_ERROR';\nvar VALIDATION_ACTION_ERROR = exports.VALIDATION_ACTION_ERROR = 'VALIDATION_CHECK_ERROR';\n\n//////////////////\n// WEBPACK FOOTER\n// ./workspace/js/ActionCreator/actionTypes.js\n// module id = 27\n// module chunks = 0 1\n//# sourceURL=webpack:///./workspace/js/ActionCreator/actionTypes.js?")},function(module,exports,__webpack_require__){eval("'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _ActionForm = __webpack_require__(29);\n\nvar _ActionForm2 = _interopRequireDefault(_ActionForm);\n\nvar _FormValidation = __webpack_require__(32);\n\nvar _FormValidation2 = _interopRequireDefault(_FormValidation);\n\nvar _Store = __webpack_require__(2);\n\nvar _Store2 = _interopRequireDefault(_Store);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar FormListener = function () {\n function FormListener() {\n _classCallCheck(this, FormListener);\n }\n\n _createClass(FormListener, [{\n key: 'input',\n\n /**\r\n * textãå
¥åããã¿ã¤ã\r\n */\n value: function input(elem) {\n var events = this._getValidationEvent(elem, ['input', 'change']);\n //required屿§ã¯æ¶ã\n elem.removeAttribute('required');\n //è¦ç´ èªä½ã«\n elem.classList.add('js_validation_submit_checker');\n for (var i = 0; i < events.length;
2 i++) {\n elem.addEventListener(events[i], function (e) {\n var element = e.target;\n var formValidation = new _FormValidation2.default(element);\n _Store2.default.dispatch(_ActionForm2.default.getAction(element, formValidation, e.type));\n }, false);\n }\n }\n\n /**\r\n * checkboxãå
¥åããã¿ã¤ã\r\n */\n\n }, {\n key: 'check',\n value: function check(elem) {\n var checkItems = elem.querySelectorAll('input:not([type=\"hidden\"])');\n var events = this._getValidationEvent(elem, ['change']);\n for (var n = 0; n < checkItems.length; n++) {\n //required屿§ã¯æ¶ã\n checkItems[n].removeAttribute('required');\n //è¦ç´ èªä½ã«\n if (n === 0) checkItems[n].classList.add('js_validation_submit_checker');\n for (var i = 0; i < events.length; i++) {\n checkItems[n].addEventListener(events[i], function (e) {\n var formValidation = new _FormValidation2.default(elem);\n _Store2.default.dispatch(_ActionForm2.default.getAction(elem, formValidation, e.type));\n }, false);\n }\n }\n }\n }, {\n key: 'select',\n\n\n /**\r\n * select\r\n */\n value: function select(elem) {\n var events = this._getValidationEvent(elem, ['change']);\n //required屿§ã¯æ¶ã\n elem.removeAttribute('required');\n //è¦ç´ èªä½ã«\n elem.classList.add('js_validation_submit_checker');\n for (var i = 0; i < events.length; i++) {\n elem.addEventListener(events[i], function (e) {\n var element = e.target;\n var formValidation = new _FormValidation2.default(element);\n _Store2.default.dispatch(_ActionForm2.default.getAction(element, formValidation, e.type));\n }, false);\n }\n }\n\n /**\r\n * ã¤ãã³ãã®ç¨®é¡\r\n * @param\r\n * element\r\n * event array initialEvent\r\n * @return\r\n * event array\r\n */\n\n }, {\n key: '_getValidationEvent',\n value: function _getValidationEvent(elem, events) {\n if (typeof elem.dataset.validationEvent !== 'undefined') {\n events = elem.dataset.validationEvent.split(',');\n }\n events.push('submitEvent', 'firstcheck'); //submitã®ç¬èªã¤ãã³ããããã©ã«ãã§ç»é²\n return events;\n }\n }]);\n\n return FormListener;\n}();\n\nvar formListener = new FormListener();\nexports.default = formListener;\n\n//////////////////\n// WEBPACK FOOTER\n// ./workspace/js/FormListener.js\n// module id = 28\n// module chunks = 0 1\n//# sourceURL=webpack:///./workspace/js/FormListener.js?")},function(module,exports,__webpack_require__){eval("'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _actionTypes = __webpack_require__(27);\n\nvar _ErrorMessageElement = __webpack_require__(30);\n\nvar _FormTypes = __webpack_require__(31);\n\nvar _FormTypes2 = _interopRequireDefault(_FormTypes);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\r\n * ActionCreator\r\n * getActionã¨data-form-nameããèªåã§è¨å®ããswitchã«è¿½å ãã\r\n * actionã«ã¯ãã©ã¼ã ã®ããªãã¼ã·ã§ã³ãè¡ãã\r\n */\nvar ActionForm = function () {\n function ActionForm() {\n _classCallCheck(this, ActionForm);\n\n this.eventType = '';\n }
2\n\n /**\r\n * data-form-nameã«å¯¾å¿ããactionãå¼ã³åºã\r\n * @param\r\n * element æ¤è¨¼å¯¾è±¡ã®element checkboxãªã©ã¯ãããã¾ã¨ãã¦ããã®\r\n * formValidation formValidationã¯ã©ã¹\r\n * eventType ã¤ãã³ãã®ã¿ã¤ã\r\n */\n\n\n _createClass(ActionForm, [{\n key: 'getAction',\n value: function getAction(elem, formValidation, eventType) {\n var inputName = elem.dataset.formName;\n this.eventType = eventType;\n var action = void 0;\n switch (inputName) {\n case 'gyosha':\n action = this.actionGyosha(elem, formValidation, inputName);\n break;\n case 'name':\n action = this.actionName(elem, formValidation, inputName);\n break;\n case 'name_kana':\n action = this.actionNameKana(elem, formValidation, inputName);\n break;\n case 'house_number':\n action = this.actionHouseNumber(elem, formValidation, inputName);\n break;\n case 'house_number2':\n action = this.actionHouseNumber2(elem, formValidation, inputName);\n break;\n case 'bill':\n action = this.actionBill(elem, formValidation, inputName);\n break;\n case 'phone_number':\n action = this.actionPhoneNumber(elem, formValidation, inputName);\n break;\n case 'email':\n action = this.actionEmail(elem, formValidation, inputName);\n break;\n case 'building_type':\n action = this.actionBuildingType(elem, formValidation, inputName);\n break;\n case 'trouble':\n action = this.actionTrouble(elem, formValidation, inputName);\n break;\n case 'term_confirm':\n action = this.actionTermConfirm(elem, formValidation, inputName);\n break;\n case 'prefecture':\n action = this.actionPrefecture(elem, formValidation, inputName);\n break;\n case 'city':\n action = this.actionCity(elem, formValidation, inputName);\n break;\n case 'support_building_type':\n action = this.actionSupportBuildingType(elem, formValidation, inputName);\n break;\n default:\n action = { type: _actionTypes.VALIDATION_ACTION_ERROR };\n }\n return action;\n }\n\n /**\r\n * resultããactionã使ãactionCreatorã§è¿ãactionã¯ããã§çæ\r\n * @param\r\n * elem: element\r\n * result: formValidationã®getResultããè¿ã£ã¦ãããªãã¸ã§ã¯ã\r\n * @return\r\n * action{type: , element: , name: so on}\r\n */\n\n }, {\n key: '_createAction',\n value: function _createAction(elem, result, inputName) {\n var errorMessageElement = _ErrorMessageElement.errorMessageElementList[inputName];\n if (result.flag === true && result.validationMessage === '') {\n //ããªãã¼ã·ã§ã³ãOKã®å ´å\n if (!errorMessageElement.classList.contains(_ErrorMessageElement.hiddenClassName)) errorMessageElement.classList.add(_ErrorMessageElement.hiddenClassName);\n errorMessageElement.textContent = '';\n if (_FormTypes2.default.input.indexOf(elem.dataset.formType) !== -1) {\n elem.classList.remove('error_input');\n }\n return {\n type: _actionTypes.VALIDATION_CHECK_OK,\n name: inputName,\n element: elem\n };\n } else {\n //ããªãã¼ã·ã§ã³ã§å¼ã£ããã£ãå ´å(èªã¿è¾¼ã¿æã®æåã®ãã§ãã¯ã¯ç¡è¦ãã)\n if (this.eventType !== 'firstcheck') {\n errorMessageElement.classList.remove(_ErrorMessageElement.hiddenClassName);\n }\n errorMessageElement.textContent = result.validationMessage;\n if (_FormTypes2.default.input.indexOf(elem.dataset.formType) !== -1) {\n if (!elem.classList.contains('error_input')) elem.classList.add('error_input');\n }\n return {\n type: _actionTypes.VALIDATION_CHECK_ERROR,\n name: inputName,\n element: elem,\n validationMessage: result.validationMessage\n };\n }\n }\n }, {\n key: 'actionGyosha',\n\n\n /**\r\n * åå¥actionã®è¨å®\r\n */\n value: function actionGyosha(elem, formValidation, inputName) {\n formValidation.start();\n formValidation.checkNocheck();\n var result = formValidation.getResult();\n return this._createAction(elem, result, inputName);\n }\n }, {\n key: 'actionName',\n value: function actionName(elem, formValidation, inputName) {\n formValidation.start();\n formValidation.checkEmpty();\n formValidation.checkStrLenMax(256);\n var result = formValidation.getResult();\n return this._createAction(elem, result, inputName);\n }\n }, {\n key: 'actionNameKana',\n value: function actionNameKana(elem, formValidation, inputName) {\n formValidation.start();\n formValidation.checkEmpty();\n formValidation.checkStrLenMax(256);\n formValidation.checkKana();\n var result = formValidation.getResult();\n return this._createAction(elem, result, inputName);\n }\n }, {\n key: 'actionHouseNumber',\n value: function actionHouseNumber(elem, formValidation, inputName) {\n formValidation.start();\n formValidation.checkEmpty();\n formValidation.checkStrLenMax(256);\n var result = formValidation.getResult();\n return this._createAction(elem, result, inputName);\n }\n }, {\n key: 'actionHouseNumber2',\n value: function actionHouseNumber2(elem, formValidation, inputName) {\n formValidation.start();\n formValidation.checkEmpty();\n formValidation.checkStrLenMax(256);\n var result = formValidation.getResult();\n return this._createAction(elem, result, inputName);\n }\n }, {\n key: 'actionBill',\n value: function actionBill(elem, formValidation, inputName) {\n formValidation.start();\n formValidation.checkStrLenMax(256);\n var result = formValidation.getResult();\n return this._createAction(elem, result, inputName);\n }\n }, {\n key: 'actionPhoneNumber',\n value: function actionPhoneNumber(elem, formValidation, inputName) {\n formValidation.start();\n formValidation.checkEmpty();\n formValidation.checkTelNumber();\n var result = formValidation.getResult();\n return this._createAction(elem, result, inputName);\n }\n }, {\n key: 'actionEmail',\n value: function actionEmail(elem, formValidation, inputName) {\n formValidation.start();\n formValidation.checkEmpty();\n formValidation.checkStrLenMax(256);\n formValidation.checkEmail();\n var result = formValidation.getResult();\n return this._createAction(elem, result, inputName);\n }\n }, {\n key: 'actionBuildingType',\n value: function actionBuildingType(elem, formValidation, inputName) {\n formValidation.start();\n formValidation.checkNocheck();\n var result = formValidation.getResult();\n return this._createAction(elem, result, inputName);\n }\n }, {\n key: 'actionTrouble',\n value: function actionTrouble(elem, formValidation, inputName) {\n formValidation.start();\n formValidation.checkEmpty();\n var result = formValidation.getResult();\n return this._createAction(elem, result, inputName);\n }\n }, {\n key: 'actionTermConfirm',\n value: function actionTermConfirm(elem, formValidation, inputName) {\n formValidation.start();\n formValidation.checkNocheck();\n var result = formValidation.getResult();\n return this._createAction(elem, result, inputName);\n }\n }, {\n key: 'actionPrefecture',\n value: function actionPrefecture(elem, formValidation, inputName) {\n formValidation.start();\n formValidation.checkNoSelect();\n var result = formValidation.getResult();\n return this._createAction(elem, result, inputName);\n }\n }, {\n key: 'actionCity',\n value: function actionCity(elem, formValidation, inputName) {\n formValidation.start();\n formValidation.checkNoSelect();\n var result = formValidation.getResult();\n return this._createAction(elem, result, inputName);\n }\n }, {\n key: 'actionSupportBuildingType',\n value: function actionSupportBuildingType(elem, formValidation, inputName) {\n formValidation.start();\n formValidation.checkNocheck();\n var result = formValidation.getResult();\n return this._createAction(elem, result, inputName);\n }\n }]);\n\n return ActionForm;\n}();\n\nvar actionForm = new ActionForm();\nexports.default = actionForm;\n\n//////////////////\n// WEBPACK FOOTER\n// ./workspace/js/ActionCreator/ActionForm.js\n// module id = 29\n// module chunks = 0 1\n//# sourceURL=webpack:///./workspace/js/ActionCreator/ActionForm.js?")},function(module,exports,__webpack_require__){eval("'use strict';
2\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.errorMessageElementList = exports.hiddenClassName = undefined;\n\nvar _CheckInputItems = __webpack_require__(26);\n\nvar _CheckInputItems2 = _interopRequireDefault(_CheckInputItems);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n//é表示ã®ã¯ã©ã¹\nvar hiddenClassName = exports.hiddenClassName = 'form_error_msg_hidden';\n\n//æ ¼ç´\n/**\r\n * ã¨ã©ã¼ã¡ãã»ã¼ã¸ã®DOMãä¸å 管ç\r\n * @type object\r\n */\nvar errorMessageElementList = exports.errorMessageElementList = {};\nfor (var i = 0; i < _CheckInputItems2.default.length; i++) {\n var errorObj = setErrorMessageElement(_CheckInputItems2.default[i]);\n if (errorObj.hasOwnProperty('name')) {\n errorMessageElementList[errorObj.name] = errorObj.elememt;\n }\n}\n\n//å®éã«çæ\nfunction setErrorMessageElement(elem) {\n var name = elem.dataset.formName;\n if (typeof name == 'undefined') {\n console.error('data-form-name屿§ãæå®ãã¦ãã ããã');\n return {};\n }\n //åå¥ãã¸ã·ã§ã³\n var position = elem.dataset.formErrorPosition;\n if (typeof position == 'undefined') position = 'beforebegin';\n //åå¥ã¯ã©ã¹\n var addingClassName = elem.dataset.formErrorMsgClass;\n if (typeof addingClassName == 'undefined') {\n addingClassName = '';\n } else {\n addingClassName = ' ' + addingClassName.replace(/\\, ?/g, ' ');\n }\n var className = 'form_error_msg error ' + hiddenClassName + addingClassName;\n var id = 'js_form_error_msg_' + name;\n var errorMessageElementString = '<p class=\"' + className + '\" id=\"' + id + '\"></p>';\n elem.insertAdjacentHTML(position, errorMessageElementString);\n return {\n elememt: document.getElementById(id),\n name: name\n };\n}\n\n//////////////////\n// WEBPACK FOOTER\n// ./workspace/js/ErrorMessageElement.js\n// module id = 30\n// module chunks = 0 1\n//# sourceURL=webpack:///./workspace/js/ErrorMessageElement.js?"); 3},function(module,exports){eval("'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n/**\r\n * formã®ç¨®å¥ã管ç\r\n * @type {Object}\r\n */\nvar formTypes = {\n input: ['text', 'tel', 'email', 'textarea'],\n check: ['radio', 'checkbox'],\n select: ['select']\n};\n\nexports.default = formTypes;\n\n//////////////////\n// WEBPACK FOOTER\n// ./workspace/js/FormTypes.js\n// module id = 31\n// module chunks = 0 1\n//# sourceURL=webpack:///./workspace/js/FormTypes.js?")},function(module,exports){eval("'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\r\n * form validaiton class\r\n * ãã©ã¼ã æ¯ã« new FormValidationã§ãªãã¸ã§ã¯ã管çã\r\n * start()ããã¦ããããããã®checkãå®è¡ãæå¾ã«getResultãã¦çµæãå¾ãã\r\n * @param\r\n * elem element\r\n */\nvar FormValidation = function () {\n function FormValidation(elem) {\n _classCallCheck(this, FormValidation);\n\n this.elem = elem;\n this.result = {\n validationMessage: '',\n flag: true\n };\n this.value = this._setValue();\n }\n\n //input,textareaãªãå¤ãåå¾\n\n\n _createClass(FormValidation, [{\n key: '_setValue',\n value: function _setValue() {\n if (this.elem.hasAttribute('value') || this.elem.tagName === 'TEXTAREA' || this.elem.tagName === 'SELECT') {\n return this.elem.value;\n } else {\n return false;\n }\n }\n\n //ãã§ãã¯ãå®è¡ãããã©ãã ããâtrue\n\n }, {\n key: '_isCheckable',\n value: function _isCheckable() {\n return this.result.flag;\n }\n\n //ããªãã¼ã·ã§ã³ã«ã¨ã©ã¼ãç»é²\n\n }, {\n key: '_setError',\n value: function _setError(message) {\n this.result.validationMessage = message;\n this.result.flag = false;\n }\n\n /**\r\n * flagãåæç¶æ ã«æ»ã\r\n */\n\n }, {\n key: 'start',\n value: function start() {\n this.result.flag = true;\n }\n\n /**\r\n * çµæãè¿ã\r\n * @return object {flag: true , validationMessage: ''}ãªãåæ ¼\r\n */\n\n }, {\n key: 'getResult',\n value: function getResult() {\n return this.result;\n }\n\n /**\r\n * checkerä¸è¦§\r\n */\n //空ã®ãã©ã¼ã ãã§ãã¯(spaceã ãã診æ)\n\n }, {\n key: 'checkEmpty',\n value: function checkEmpty() {\n if (!this._isCheckable()) return;\n if (this.value === false) return;\n if (this.value !== '') {\n if (/^[\\sã]+$/.test(this.value)) {\n this._setError('å ¥åãã¦ãã ãã');\n }\n } else {\n this._setError('å ¥åãã¦ãã ãã');\n }\n }\n\n //æåæ°ãã§ãã¯(æå¤§)\n\n }, {\n key: 'checkStrLenMax',\n value: function checkStrLenMax(num) {\n if (!this._isCheckable()) return;\n if (this.value === false) return;\n if (this.value !== '') {\n if (this.value.length > num) {\n this._setError(num + 'æå以å ã«ãã¦ãã ããã');\n }\n }\n }\n\n //ããªãã§ãã¯\n\n }, {\n key: 'checkKana',\n value: function checkKana() {\n if (!this._isCheckable()) return;\n if (this.value === false) return;\n if (this.value !== '') {\n if (!/^[ã-ãã¡-ã³ï½§-ï¾ï¾ï¾\\-ã¼ã\\s]+$/.test(this.value)) {\n this._setError('ã²ãããª, ã¾ãã¯ã«ã¿ã«ãã§å ¥åãã¦ãã ãã');\n }\n }\n }\n\n //é»è©±çªå·\n\n }, {\n key: 'checkTelNumber',\n value: function checkTelNumber() {\n if (!this._isCheckable()) return;\n if (this.value === false) return;\n if (this.value !== '') {\n var testValue = this.value.replace(/\\-/g, '');\n if (!/^0\\d{9,11}$/.test(testValue)) {\n this._setError('æ£ããé»è©±çªå·ãå ¥åãã¦ãã ããã');\n }\n }\n }\n\n //email\n\n }, {\n key: 'checkEmail',\n value: function checkEmail() {\n if (!this._isCheckable()) return;\n if (this.value === false) return;\n var regex = /^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\n if (!regex.test(this.value)) {\n this._setError('æ£ããã¡ã¼ã«ã¢ãã¬ã¹ãè¨å ¥ãã¦ãã ãã');\n }\n }\n\n //nocheck checkbox, radio ã«ãã§ãã¯å ¥ã£ã¦ãã\n\n }, {\n key: 'checkNocheck',\n value: function checkNocheck() {\n if (!this._isCheckable()) return;\n var checkItems = this.elem.querySelectorAll('input:checked:not([type=\"hidden\"])');\n if (!checkItems.length > 0) {\n this._setError('ãã§ãã¯ãã¦ãã ããã');\n }\n }\n\n //ã»ã¬ã¯ãããã¯ã¹é¸ã°ãã¦ãã\n\n }, {\n key: 'checkNoSelect',\n value: function checkNoSelect() {\n if (!this._isCheckable()) return;\n if (this.value === '') {\n this._setError('鏿ãã¦ãã ããã');\n }\n }\n }]);\n\n return FormValidation;\n}();\n\nexports.default = FormValidation;\n\n//////////////////\n// WEBPACK FOOTER\n// ./workspace/js/Validatior/FormValidation.js\n// module id = 32\n// module chunks = 0 1\n//# sourceURL=webpack:///./workspace/js/Validatior/FormValidation.js?")},function(module,exports,__webpack_require__){eval("'use strict';
3\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.scrollTo = scrollTo;\n\nvar _jump = __webpack_require__(34);\n\nvar _jump2 = _interopRequireDefault(_jump);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction scrollTo(to) {\n var duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 600;\n\n (0, _jump2.default)(to, {\n duration: duration\n });\n}\n\n//////////////////\n// WEBPACK FOOTER\n// ./workspace/js/Animation.js\n// module id = 33\n// module chunks = 0 1\n//# sourceURL=webpack:///./workspace/js/Animation.js?")},function(module,exports,__webpack_require__){eval('/*!\n * Jump.js 1.0.1 - A small, modern, dependency-free smooth scrolling library.\n * Copyright (c) 2016 Michael Cavalea - https://github.com/callmecavs/jump.js\n * License: MIT\n */\n\n!function(o,n){ true?module.exports=n():"function"==typeof define&&define.amd?define(n):o.Jump=n()}(this,function(){"use strict";var o=function(o,n,e,t){return o/=t/2,o<1?e/2*o*o+n:(o--,-e/2*(o*(o-2)-1)+n)},n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol?"symbol":typeof o},e=function(){function e(){return window.scrollY||window.pageYOffset}function t(o){return o.getBoundingClientRect().top+d}function i(o){v||(v=o),b=o-v,p=s(b,d,y,m),window.scrollTo(0,p),b<m?requestAnimationFrame(i):r()}function r(){window.scrollTo(0,d+y),c&&l&&(c.setAttribute("tabindex","-1"),c.focus()),"function"==typeof w&&w(),v=!1}function u(r){var u=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];switch(m=u.duration||1e3,a=u.offset||0,w=u.callback,s=u.easing||o,l=u.a11y||!1,d=e(),"undefined"==typeof r?"undefined":n(r)){case"number":c=void 0,l=!1,f=d+r;break;case"object":c=r,f=t(c);break;case"string":c=document.querySelector(r),f=t(c)}switch(y=f-d+a,n(u.duration)){case"number":m=u.duration;break;case"function":m=u.duration(y)}requestAnimationFrame(i)}var c=void 0,d=void 0,f=void 0,a=void 0,s=void 0,l=void 0,y=void 0,m=void 0,v=void 0,b=void 0,p=void 0,w=void 0;return u},t=e();return t});\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/jump.js/dist/jump.min.js\n// module id = 34\n// module chunks = 0 1\n//# sourceURL=webpack:///./~/jump.js/dist/jump.min.js?')},function(module,exports,__webpack_require__){eval("'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**\r\n * beforeUnload\r\n * é¢è
3±ç¢ºèªã¡ãã»ã¼ã¸é¢é£\r\n * @param\r\n * message str\r\n */\n\n\nvar _Analyze = __webpack_require__(36);\n\nvar _Analyze2 = _interopRequireDefault(_Analyze);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar BeforeUnloader = function () {\n function BeforeUnloader(message) {\n var _this = this;\n\n var isAnalyze = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n _classCallCheck(this, BeforeUnloader);\n\n this.message = message;\n this.handler = function (e) {\n e.returnValue = _this.message; // Gecko and Trident\n return _this.message; // Gecko and WebKit\n };\n this.isAnalyze = isAnalyze;\n }\n\n _createClass(BeforeUnloader, [{\n key: 'setUnload',\n value: function setUnload() {\n window.addEventListener('beforeunload', this.handler, false);\n }\n }, {\n key: 'removeUnload',\n value: function removeUnload() {\n window.removeEventListener('beforeunload', this.handler, false);\n }\n\n /**\r\n * ãªã¹ãã¼ã®å
容\r\n */\n\n }, {\n key: '_showMessage',\n value: function _showMessage(e) {\n var _this2 = this;\n\n if (this.isAnalyze) {\n _Analyze2.default.send('unload', function () {\n e.returnValue = _this2.message; // Gecko and Trident\n return _this2.message; // Gecko and WebKit\n });\n } else {\n e.returnValue = this.message; // Gecko and Trident\n return this.message; // Gecko and WebKit\n }\n }\n }]);\n\n return BeforeUnloader;\n}();\n\nexports.default = BeforeUnloader;\n\n//////////////////\n// WEBPACK FOOTER\n// ./workspace/js/BeforeUnloader.js\n// module id = 35\n// module chunks = 0 1\n//# sourceURL=webpack:///./workspace/js/BeforeUnloader.js?")},function(module,exports,__webpack_require__){eval("'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**\r\n * è¨æ¸¬ç³»\r\n */\n\n\nvar _jquery = __webpack_require__(37);\n\nvar _jquery2 = _interopRequireDefault(_jquery);\n\nvar _mixpanelBrowser = __webpack_require__(38);\n\nvar _mixpanelBrowser2 = _interopRequireDefault(_mixpanelBrowser);\n\nvar _Store = __webpack_require__(2);\n\nvar _Store2 = _interopRequireDefault(_Store);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar Analyze = function () {\n function Analyze() {\n _classCallCheck(this, Analyze);\n\n _mixpanelBrowser2.default.init('c70650a78f02488dffd07a50bac8456b');\n this.start = new Date();\n this.times = 0;\n }\n\n _createClass(Analyze, [{\n key: 'send',\n value: function send(eventName) {\n var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n var data = this._createData(eventName);\n _jquery2.default.when(this.sendMixpanel(eventName, data)).always(function () {\n if (callback !== false) callback();\n });\n }\n }, {\n key: 'sendMixpanel',\n value: function sendMixpanel(eventName, data) {\n var dfd = _jquery2.default.Deferred();\n _mixpanelBrowser2.default.track(eventName, data, function (status, data) {\n dfd.resolve();\n });\n setTimeout(function () {\n dfd.reject();\n }, 2000);\n return dfd.promise();\n }\n }, {\n key: '_createData',\n value: function _createData(eventName) {\n var data = {};\n if (eventName === 'confirm') {\n return data = {\n spendTime: getTimeDifference(this.start, new Date())\n };\n } else {\n var state = _Store2.default.getState().validation;\n for (var prop in state) {\n if (state.hasOwnProperty(prop)) {\n data[prop] = state[prop].validationMessage;\n }\n }\n return Object.assign({}, { spendTimes: this.times }, data);\n }\n }\n }, {\n key: 'sendTimer',\n value: function sendTimer(time, end) {\n var _this = this;\n\n setTimeout(function () {\n _this.times++;\n _this.send('timerData');\n if (time > end) return;\n _this._sendTimer(time / 2 * 3, end);\n }, time, false);\n }\n }]);\n\n return Analyze;\n}();\n\nvar analyze = new Analyze();\nexports.default = analyze;\n\n/**\r\n * æéå·®ã®åå¾\r\n * @param date start\r\n * @param date end\r\n * @return init second\r\n */\n\nfunction getTimeDifference(start, end) {\n var diff = end.getTime() - start.getTime();\n return Math.floor(diff / 1000);\n}\n\n//////////////////\n// WEBPACK FOOTER\n// ./workspace/js/Analyze.js\n// module id = 36\n// module chunks = 0 1\n//# sourceURL=webpack:///./workspace/js/Analyze.js?")},function(module,exports){eval('module.exports = jQuery;\n\n//////////////////\n// WEBPACK FOOTER\n// external "jQuery"\n// module id = 37\n// module chunks = 0 1\n//# sourceURL=webpack:///external_%22jQuery%22?')},function(module,exports){eval("'use strict';\n\nvar Config = {\n DEBUG: false,\n LIB_VERSION: '2.9.17'\n};\n\n// since es6 imports are static and we run unit tests from the console, window won't be defined when importing this file\nvar win;\nif (typeof(window) === 'undefined') {\n win = {\n navigator: {}\n };\n} else {\n win = window;\n}\n\n\n\n/*\n * Saved references to long variable names, so that closure compiler can\n * minimize file size.\n */\n\nvar ArrayProto = Array.prototype;\nvar FuncProto = Function.prototype;\nvar ObjProto = Object.prototype;\nvar slice = ArrayProto.slice;\nvar toString = ObjProto.toString;\nvar hasOwnProperty = ObjProto.hasOwnProperty;\nvar windowConsole = win.console;\nvar navigator$1 = win.navigator;\nvar document$1 = win.document;\nvar userAgent = navigator$1.userAgent;\nvar nativeBind = FuncProto.bind;\nvar nativeForEach = ArrayProto.forEach;\nvar nativeIndexOf = ArrayProto.indexOf;\nvar nativeIsArray = Array.isArray;\nvar breaker = {};\nvar _ = {\n trim: function(str) {\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/Trim#Polyfill\n return str.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '');\n }\n};\n\n// Console override\nvar console$1 = {\n /** @type {function(...[*])}
3 */\n log: function() {\n if (Config.DEBUG && !_.isUndefined(windowConsole) && windowConsole) {\n try {\n windowConsole.log.apply(windowConsole, arguments);\n } catch (err) {\n _.each(arguments, function(arg) {\n windowConsole.log(arg);\n });\n }\n }\n },\n /** @type {function(...[*])} */\n error: function() {\n if (Config.DEBUG && !_.isUndefined(windowConsole) && windowConsole) {\n var args = ['Mixpanel error:'].concat(_.toArray(arguments));\n try {\n windowConsole.error.apply(windowConsole, args);\n } catch (err) {\n _.each(args, function(arg) {\n windowConsole.error(arg);\n });\n }\n }\n },\n /** @type {function(...[*])} */\n critical: function() {\n if (!_.isUndefined(windowConsole) && windowConsole) {\n var args = ['Mixpanel error:'].concat(_.toArray(arguments));\n try {\n windowConsole.error.apply(windowConsole, args);\n } catch (err) {\n _.each(args, function(arg) {\n windowConsole.error(arg);\n });\n }\n }\n }\n};\n\n\n// UNDERSCORE\n// Embed part of the Underscore Library\n_.bind = function(func, context) {\n var args, bound;\n if (nativeBind && func.bind === nativeBind) {\n return nativeBind.apply(func, slice.call(arguments, 1));\n }\n if (!_.isFunction(func)) {\n throw new TypeError();\n }\n args = slice.call(arguments, 2);\n bound = function() {\n if (!(this instanceof bound)) {\n return func.apply(context, args.concat(slice.call(arguments)));\n }\n var ctor = {};\n ctor.prototype = func.prototype;\n var self = new ctor();\n ctor.prototype = null;\n var result = func.apply(self, args.concat(slice.call(arguments)));\n if (Object(result) === result) {\n return result;\n }\n return self;\n };\n return bound;\n};\n\n_.bind_instance_methods = function(obj) {\n for (var func in obj) {\n if (typeof(obj[func]) === 'function') {\n obj[func] = _.bind(obj[func], obj);\n }\n }\n};\n\n/**\n * @param {*=} obj\n * @param {function(...[*])=} iterator\n * @param {Object=} context\n */\n_.each = function(obj, iterator, context) {\n if (obj === null || obj === undefined) {\n return;\n }\n if (nativeForEach && obj.forEach === nativeForEach) {\n obj.forEach(iterator, context);\n } else if (obj.length === +obj.length) {\n for (var i = 0, l = obj.length; i < l; i++) {\n if (i in obj && iterator.call(context, obj[i], i, obj) === breaker) {\n return;\n }\n }\n } else {\n for (var key in obj) {\n if (hasOwnProperty.call(obj, key)) {\n if (iterator.call(context, obj[key], key, obj) === breaker) {\n return;\n }\n }\n }\n }\n};\n\n_.escapeHTML = function(s) {\n var escaped = s;\n if (escaped && _.isString(escaped)) {\n escaped = escaped\n .replace(/&/g, '&')\n .replace(/</g, '<')\n .replace(/>/g, '>')\n .replace(/\"/g, '"')\n .replace(/'/g, ''');\n }\n return escaped;\n};\n\n_.extend = function(obj) {\n _.each(slice.call(arguments, 1), function(source) {\n for (var prop in source) {\n if (source[prop] !== void 0) {\n obj[prop] = source[prop];\n }\n }\n });\n return obj;\n};\n\n_.isArray = nativeIsArray || function(obj) {\n return toString.call(obj) === '[object Array]';\n};\n\n// from a comment on http://dbj.org/dbj/?p=286\n// fails on only one very rare and deliberate custom object:\n// var bomb = { toString : undefined, valueOf: function(o) { return \"function BOMBA!\"; }};\n_.isFunction = function(f) {\n try {\n return /^\\s*\\bfunction\\b/.test(f);\n } catch (x) {\n return false;\n }\n};\n\n_.isArguments = function(obj) {\n return !!(obj && hasOwnProperty.call(obj, 'callee'));\n};\n\n_.toArray = function(iterable) {\n if (!iterable) {\n return [];\n }\n if (iterable.toArray) {\n return iterable.toArray();\n }\n if (_.isArray(iterable)) {\n return slice.call(iterable);\n }\n if (_.isArguments(iterable)) {\n return slice.call(iterable);\n }\n return _.values(iterable);\n};\n\n_.values = function(obj) {\n var results = [];\n if (obj === null) {\n return results;\n }\n _.each(obj, function(value) {\n results[results.length] = value;\n });\n return results;\n};\n\n_.identity = function(value) {\n return value;\n};\n\n_.include = function(obj, target) {\n var found = false;\n if (obj === null) {\n return found;\n }\n if (nativeIndexOf && obj.indexOf === nativeIndexOf) {\n return obj.indexOf(target) != -1;\n }\n _.each(obj, function(value) {\n if (found || (found = (value === target))) {\n return breaker;\n }\n });\n return found;\n};\n\n_.includes = function(str, needle) {\n return str.indexOf(needle) !== -1;\n};\n\n// Underscore Addons\n_.inherit = function(subclass, superclass) {\n subclass.prototype = new superclass();\n subclass.prototype.constructor = subclass;\n subclass.superclass = superclass.prototype;\n return subclass;\n};\n\n_.isObject = function(obj) {\n return (obj === Object(obj) && !_.isArray(obj));\n};\n\n_.isEmptyObject = function(obj) {\n if (_.isObject(obj)) {\n for (var key in obj) {\n if (hasOwnProperty.call(obj, key)) {\n return false;\n }\n }\n return true;\n }\n return false;\n};\n\n_.isUndefined = function(obj) {\n return obj === void 0;\n};\n\n_.isString = function(obj) {\n return toString.call(obj) == '[object String]';\n};\n\n_.isDate = function(obj) {\n return toString.call(obj) == '[object Date]';\n};\n\n_.isNumber = function(obj) {\n return toString.call(obj) == '[object Number]';\n};\n\n_.isElement = function(obj) {\n return !!(obj && obj.nodeType === 1);\n};\n\n_.encodeDates = function(obj) {\n _.each(obj, function(v, k) {\n if (_.isDate(v)) {\n obj[k] = _.formatDate(v);\n } else if (_.isObject(v)) {\n obj[k] = _.encodeDates(v); // recurse\n }\n });\n return obj;\n};
3\n\n_.timestamp = function() {\n Date.now = Date.now || function() {\n return +new Date;\n };\n return Date.now();\n};\n\n_.formatDate = function(d) {\n // YYYY-MM-DDTHH:MM:SS in UTC\n function pad(n) {\n return n < 10 ? '0' + n : n;\n }\n return d.getUTCFullYear() + '-' +\n pad(d.getUTCMonth() + 1) + '-' +\n pad(d.getUTCDate()) + 'T' +\n pad(d.getUTCHours()) + ':' +\n pad(d.getUTCMinutes()) + ':' +\n pad(d.getUTCSeconds());\n};\n\n_.safewrap = function(f) {\n return function() {\n try {\n return f.apply(this, arguments);\n } catch (e) {\n console$1.critical('Implementation error. Please contact [email protected].');\n }\n };\n};\n\n_.safewrap_class = function(klass, functions) {\n for (var i = 0; i < functions.length; i++) {\n klass.prototype[functions[i]] = _.safewrap(klass.prototype[functions[i]]);\n }\n};\n\n_.safewrap_instance_methods = function(obj) {\n for (var func in obj) {\n if (typeof(obj[func]) === 'function') {\n obj[func] = _.safewrap(obj[func]);\n }\n }\n};\n\n_.strip_empty_properties = function(p) {\n var ret = {};\n _.each(p, function(v, k) {\n if (_.isString(v) && v.length > 0) {\n ret[k] = v;\n }\n });\n return ret;\n};\n\n/*\n * this function returns a copy of object after truncating it. If\n * passed an Array or Object it will iterate through obj and\n * truncate all the values recursively.\n */\n_.truncate = function(obj, length) {\n var ret;\n\n if (typeof(obj) === 'string') {\n ret = obj.slice(0, length);\n } else if (_.isArray(obj)) {\n ret = [];\n _.each(obj, function(val) {\n ret.push(_.truncate(val, length));\n });\n } else if (_.isObject(obj)) {\n ret = {};\n _.each(obj, function(val, key) {\n ret[key] = _.truncate(val, length);\n });\n } else {\n ret = obj;\n }\n\n return ret;\n};\n\n_.JSONEncode = (function() {\n return function(mixed_val) {\n var value = mixed_val;\n var quote = function(string) {\n var escapable = /[\\\\\\\"\\x00-\\x1f\\x7f-\\x9f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]/g;\n var meta = { // table of character substitutions\n '\\b': '\\\\b',\n '\\t': '\\\\t',\n '\\n': '\\\\n',\n '\\f': '\\\\f',\n '\\r': '\\\\r',\n '\"': '\\\\\"',\n '\\\\': '\\\\\\\\'\n };\n\n escapable.lastIndex = 0;\n return escapable.test(string) ?\n '\"' + string.replace(escapable, function(a) {\n var c = meta[a];\n return typeof c === 'string' ? c :\n '\\\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);\n }) + '\"' :\n '\"' + string + '\"';\n };\n\n var str = function(key, holder) {\n var gap = '';\n var indent = ' ';\n var i = 0; // The loop counter.\n var k = ''; // The member key.\n var v = ''; // The member value.\n var length = 0;\n var mind = gap;\n var partial = [];\n var value = holder[key];\n\n // If the value has a toJSON method, call it to obtain a replacement value.\n if (value && typeof value === 'object' &&\n typeof value.toJSON === 'function') {\n value = value.toJSON(key);\n }\n\n // What happens next depends on the value's type.\n switch (typeof value) {\n case 'string':\n return quote(value);\n\n case 'number':\n // JSON numbers must be finite. Encode non-finite numbers as null.\n return isFinite(value) ? String(value) : 'null';\n\n case 'boolean':\n case 'null':\n // If the value is a boolean or null, convert it to a string. Note:\n // typeof null does not produce 'null'. The case is included here in\n // the remote chance that this gets fixed someday.\n\n return String(value);\n\n case 'object':\n // If the type is 'object', we might be dealing with an object or an array or\n // null.\n // Due to a specification blunder in ECMAScript, typeof null is 'object',\n // so watch out for that case.\n if (!value) {\n return 'null';\n }\n\n // Make an array to hold the partial results of stringifying this object value.\n gap += indent;\n partial = [];\n\n // Is the value an array?\n if (toString.apply(value) === '[object Array]') {\n // The value is an array. Stringify every element. Use null as a placeholder\n // for non-JSON values.\
3n\n length = value.length;\n for (i = 0; i < length; i += 1) {\n partial[i] = str(i, value) || 'null';\n }\n\n // Join all of the elements together, separated with commas, and wrap them in\n // brackets.\n v = partial.length === 0 ? '[]' :\n gap ? '[\\n' + gap +\n partial.join(',\\n' + gap) + '\\n' +\n mind + ']' :\n '[' + partial.join(',') + ']';\n gap = mind;\n return v;\n }\n\n // Iterate through all of the keys in the object.\n for (k in value) {\n if (hasOwnProperty.call(value, k)) {\n v = str(k, value);\n if (v) {\n partial.push(quote(k) + (gap ? ': ' : ':') + v);\n }\n }\n }\n\n // Join all of the member texts together, separated with commas,\n // and wrap them in braces.\n v = partial.length === 0 ? '{}' :\n gap ? '{' + partial.join(',') + '' +\n mind + '}' : '{' + partial.join(',') + '}';\n gap = mind;\n return v;\n }\n };\n\n // Make a fake root object containing our value under the key of ''.\n // Return the result of stringifying the value.\n return str('', {\n '': value\n });\n };\n})();\n\n_.JSONDecode = (function() { // https://github.com/douglascrockford/JSON-js/blob/master/json_parse.js\n var at, // The index of the current character\n ch, // The current character\n escapee = {\n '\"': '\"',\n '\\\\': '\\\\',\n '/': '/',\n 'b': '\\b',\n 'f': '\\f',\n 'n': '\\n',\n 'r': '\\r',\n 't': '\\t'\n },\n text,\n error = function(m) {\n throw {\n name: 'SyntaxError',\n message: m,\n at: at,\n text: text\n };\n },\n next = function(c) {\n // If a c parameter is provided, verify that it matches the current character.\n if (c && c !== ch) {\n error('Expected \\'' + c + '\\' instead of \\'' + ch + '\\'');\n }\n // Get the next character. When there are no more characters,\n // return the empty string.\n ch = text.charAt(at);\n at += 1;\n return ch;\n },\n number = function() {\n // Parse a number value.\n var number,\n string = '';\n\n if (ch === '-') {\n string = '-';\n next('-');\n }\n while (ch >= '0' && ch <= '9') {\n string += ch;\n next();\n }\n if (ch === '.') {\n string += '.';\n while (next() && ch >= '0' && ch <= '9') {\n string += ch;\n }\n }\n if (ch === 'e' || ch === 'E') {\n string += ch;\n next();\n if (ch === '-' || ch === '+') {\n string += ch;\n next();\n }\n while (ch >= '0' && ch <= '9') {\n string += ch;\n next();\n }\n }\n number = +string;\n if (!isFinite(number)) {\n error('Bad number');\n } else {\n return number;\n }\n },\n\n string = function() {\n // Parse a string value.\n var hex,\n i,\n str
3ing = '',\n uffff;\n // When parsing for string values, we must look for \" and \\ characters.\n if (ch === '\"') {\n while (next()) {\n if (ch === '\"') {\n next();\n return string;\n }\n if (ch === '\\\\') {\n next();\n if (ch === 'u') {\n uffff = 0;\n for (i = 0; i < 4; i += 1) {\n hex = parseInt(next(), 16);\n if (!isFinite(hex)) {\n break;\n }\n uffff = uffff * 16 + hex;\n }\n string += String.fromCharCode(uffff);\n } else if (typeof escapee[ch] === 'string') {\n string += escapee[ch];\n } else {\n break;\n }\n } else {\n string += ch;\n }\n }\n }\n error('Bad string');\n },\n white = function() {\n // Skip whitespace.\n while (ch && ch <= ' ') {\n next();\n }\n },\n word = function() {\n // true, false, or null.\n switch (ch) {\n case 't':\n next('t');\n next('r');\n next('u');\n next('e');\n return true;\n case 'f':\n next('f');\n next('a');\n next('l');\n next('s');\n next('e');\n return false;\n case 'n':\n next('n');\n next('u');\n next('l');\n next('l');\n return null;\n }\n error('Unexpected \"' + ch + '\"');\n },\n value, // Placeholder for the value function.\n array = function() {\n // Parse an array value.\n var array = [];\n\n if (ch === '[') {\n next('[');\n white();\n if (ch === ']') {\n next(']');\n return array; // empty array\n }\n while (ch) {\n array.push(value());\n white();\n if (ch === ']') {\n next(']');\n return array;\n }\n next(',');\n white();\n }\n }\n error('Bad array');\n },\n object = function() {\n // Parse an object value.\n var key,\n object = {};\n\n if (ch === '{') {\n next('{');\n white();\n if (ch === '}') {\n next('}');\n return object; // empty object\n }\n while (ch) {\n key = string();\n white();\n next(':');\n if (Object.hasOwnProperty.call(object, key)) {\n error('Duplicate key \"' + key + '\"');\n }\n object[key] = value();\n white();\n if (ch === '}') {\n next('}');\n return object;\n }\n next(',');\n white();\n }\n }\n error('Bad object');\n };\n\n value = function() {\n // Parse a JSON value. It could be an object, an array, a string,\n // a number, or a word.\n white();\n switch (ch) {\n case '{':\n return object();\n case '[':\n return array();\n case '\"':\n return string();\n case '-':\n return number();\n default:\n return ch >= '0' && ch <= '9' ? number() : word();\n }\n };\n\n // Return the json_parse function. It will have access to all of the\n // above functions and variables.\n return function(source) {\n var result;\n\n text = source;\n at = 0;\n ch = ' ';\n result = value();\n white();\n if (ch) {\n error('Syntax error');\n }\n\n return result;\n };\n})();
3\n\n_.base64Encode = function(data) {\n var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n var o1, o2, o3, h1, h2, h3, h4, bits, i = 0,\n ac = 0,\n enc = '',\n tmp_arr = [];\n\n if (!data) {\n return data;\n }\n\n data = _.utf8Encode(data);\n\n do { // pack three octets into four hexets\n o1 = data.charCodeAt(i++);\n o2 = data.charCodeAt(i++);\n o3 = data.charCodeAt(i++);\n\n bits = o1 << 16 | o2 << 8 | o3;\n\n h1 = bits >> 18 & 0x3f;\n h2 = bits >> 12 & 0x3f;\n h3 = bits >> 6 & 0x3f;\n h4 = bits & 0x3f;\n\n // use hexets to index into b64, and append result to encoded string\n tmp_arr[ac++] = b64.charAt(h1) + b64.charAt(h2) + b64.charAt(h3) + b64.charAt(h4);\n } while (i < data.length);\n\n enc = tmp_arr.join('');\n\n switch (data.length % 3) {\n case 1:\n enc = enc.slice(0, -2) + '==';\n break;\n case 2:\n enc = enc.slice(0, -1) + '=';\n break;\n }\n\n return enc;\n};\n\n_.utf8Encode = function(string) {\n string = (string + '').replace(/\\r\\n/g, '\\n').replace(/\\r/g, '\\n');\n\n var utftext = '',\n start,\n end;\n var stringl = 0,\n n;\n\n start = end = 0;\n stringl = string.length;\n\n for (n = 0; n < stringl; n++) {\n var c1 = string.charCodeAt(n);\n var enc = null;\n\n if (c1 < 128) {\n end++;\n } else if ((c1 > 127) && (c1 < 2048)) {\n enc = String.fromCharCode((c1 >> 6) | 192, (c1 & 63) | 128);\n } else {\n enc = String.fromCharCode((c1 >> 12) | 224, ((c1 >> 6) & 63) | 128, (c1 & 63) | 128);\n }\n if (enc !== null) {\n if (end > start) {\n utftext += string.substring(start, end);\n }\n utftext += enc;\n start = end = n + 1;\n }\n }\n\n if (end > start) {\n utftext += string.substring(start, string.length);\n }\n\n return utftext;\n};\n\n_.UUID = (function() {\n\n // Time/ticks information\n // 1*new Date() is a cross browser version of Date.now()\n var T = function() {\n var d = 1 * new Date(),\n i = 0;\n\n // this while loop figures how many browser ticks go by\n // before 1*new Date() returns a new number, ie the amount\n // of ticks that go by per millisecond\n while (d == 1 * new Date()) {\n i++;\n }\n\n return d.toString(16) + i.toString(16);\n };\n\n // Math.Random entropy\n var R = function() {\n return Math.random().toString(16).replace('.', '');\n };\n\n // User agent entropy\n // This function takes the user agent string, and then xors\n // together each sequence of 8 bytes. This produces a final\n // sequence of 8 bytes which it returns as hex.\n var UA = function() {\n var ua = userAgent,\n i, ch, buffer = [],\n ret = 0;\n\n function xor(result, byte_array) {\n var j, tmp = 0;\n for (j = 0; j < byte_array.length; j++) {\n tmp |= (buffer[j] << j * 8);\n }\n return result ^ tmp;\n }\n\n for (i = 0; i < ua.length; i++) {\n ch = ua.charCodeAt(i);\n buffer.unshift(ch & 0xFF);\n if (buffer.length >= 4) {\n ret = xor(ret, buffer);\n buffer = [];\n }\n }\n\n if (buffer.length > 0) {\n ret = xor(ret, buffer);\n }\n\n return ret.toString(16);\n };\n\n return function() {\n var se = (screen.height * screen.width).toString(16);\n return (T() + '-' + R() + '-' + UA() + '-' + se + '-' + T());\n };\n})();\n\n// _.isBlockedUA()\n// This is to block various web spiders from executing our JS and\n// sending false tracking data\n_.isBlockedUA = function(ua) {\n if (/(google web preview|baiduspider|yandexbot|bingbot|googlebot|yahoo! slurp)/i.test(ua)) {\n return true;\n }\n return false;\n};\n\n/**\n * @param {Object=} formdata\n * @param {string=} arg_separator\n */\n_.HTTPBuildQuery = function(formdata, arg_separator) {\n var use_val, use_key, tmp_arr = [];
3\n\n if (_.isUndefined(arg_separator)) {\n arg_separator = '&';\n }\n\n _.each(formdata, function(val, key) {\n use_val = encodeURIComponent(val.toString());\n use_key = encodeURIComponent(key);\n tmp_arr[tmp_arr.length] = use_key + '=' + use_val;\n });\n\n return tmp_arr.join(arg_separator);\n};\n\n_.getQueryParam = function(url, param) {\n // Expects a raw URL\n\n param = param.replace(/[\\[]/, '\\\\\\[').replace(/[\\]]/, '\\\\\\]');\n var regexS = '[\\\\?&]' + param + '=([^&#]*)',\n regex = new RegExp(regexS),\n results = regex.exec(url);\n if (results === null || (results && typeof(results[1]) !== 'string' && results[1].length)) {\n return '';\n } else {\n return decodeURIComponent(results[1]).replace(/\\+/g, ' ');\n }\n};\n\n_.getHashParam = function(hash, param) {\n var matches = hash.match(new RegExp(param + '=([^&]*)'));\n return matches ? matches[1] : null;\n};\n\n// _.cookie\n// Methods partially borrowed from quirksmode.org/js/cookies.html\n_.cookie = {\n get: function(name) {\n var nameEQ = name + '=';\n var ca = document$1.cookie.split(';');\n for (var i = 0; i < ca.length; i++) {\n var c = ca[i];\n while (c.charAt(0) == ' ') {\n c = c.substring(1, c.length);\n }\n if (c.indexOf(nameEQ) === 0) {\n return decodeURIComponent(c.substring(nameEQ.length, c.length));\n }\n }\n return null;\n },\n\n parse: function(name) {\n var cookie;\n try {\n cookie = _.JSONDecode(_.cookie.get(name)) || {};\n } catch (err) {\n // noop\n }\n return cookie;\n },\n\n set_seconds: function(name, value, seconds, cross_subdomain, is_secure) {\n var cdomain = '',\n expires = '',\n secure = '';\n\n if (cross_subdomain) {\n var matches = document$1.location.hostname.match(/[a-z0-9][a-z0-9\\-]+\\.[a-z\\.]{2,6}$/i),\n domain = matches ? matches[0] : '';\n\n cdomain = ((domain) ? '; domain=.' + domain : '');\n }\n\n if (seconds) {\n var date = new Date();\n date.setTime(date.getTime() + (seconds * 1000));\n expires = '; expires=' + date.toGMTString();\n }\n\n if (is_secure) {\n secure = '; secure';\n }\n\n document$1.cookie = name + '=' + encodeURIComponent(value) + expires + '; path=/' + cdomain + secure;\n },\n\n set: function(name, value, days, cross_subdomain, is_secure) {\n var cdomain = '', expires = '', secure = '';\n\n if (cross_subdomain) {\n var matches = document$1.location.hostname.match(/[a-z0-9][a-z0-9\\-]+\\.[a-z\\.]{2,6}$/i),\n domain = matches ? matches[0] : '';\n\n cdomain = ((domain) ? '; domain=.' + domain : '');\n }\n\n if (days) {\n var date = new Date();\n date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));\n expires = '; expires=' + date.toGMTString();\n }\n\n if (is_secure) {\n secure = '; secure';\n }\n\n var new_cookie_val = name + '=' + encodeURIComponent(value) + expires + '; path=/' + cdomain + secure;\n document$1.cookie = new_cookie_val;\n return new_cookie_val;\n },\n\n remove: function(name, cross_subdomain) {\n _.cookie.set(name, '', -1, cross_subdomain);\n }\n};\n\n// _.localStorage\n_.localStorage = {\n error: function(msg) {\n console$1.error('localStorage error: ' + msg);\n },\n\n get: function(name) {\n try {\n return window.localStorage.getItem(name);\n } catch (err) {\n _.localStorage.error(err);\n }\n return null;\n },\n\n parse: function(name) {\n try {\n return _.JSONDecode(_.localStorage.get(name)) || {};\n } catch (err) {\n // noop\n }\n return null;\n },\n\n set: function(name, value) {\n try {\n window.localStorage.setItem(name, value);\n } catch (err) {\n _.localStorage.error(err);\n }\n },\n\n remove: function(name) {\n try {\n window.localStorage.removeItem(name);\n } catch (err) {\n _.localStorage.error(err);\n }\n }\n};
3\n\n_.register_event = (function() {\n // written by Dean Edwards, 2005\n // with input from Tino Zijdel - [email protected]\n // with input from Carl Sverre - [email protected]\n // with input from Mixpanel\n // http://dean.edwards.name/weblog/2005/10/add-event/\n // https://gist.github.com/1930440\n\n /**\n * @param {Object} element\n * @param {string} type\n * @param {function(...[*])} handler\n * @param {boolean=} oldSchool\n * @param {boolean=} useCapture\n */\n var register_event = function(element, type, handler, oldSchool, useCapture) {\n if (!element) {\n console$1.error('No valid element provided to register_event');\n return;\n }\n\n if (element.addEventListener && !oldSchool) {\n element.addEventListener(type, handler, !!useCapture);\n } else {\n var ontype = 'on' + type;\n var old_handler = element[ontype]; // can be undefined\n element[ontype] = makeHandler(element, handler, old_handler);\n }\n };\n\n function makeHandler(element, new_handler, old_handlers) {\n var handler = function(event) {\n event = event || fixEvent(window.event);\n\n // this basically happens in firefox whenever another script\n // overwrites the onload callback and doesn't pass the event\n // object to previously defined callbacks. All the browsers\n // that don't define window.event implement addEventListener\n // so the dom_loaded handler will still be fired as usual.\n if (!event) {\n return undefined;\n }\n\n var ret = true;\n var old_result, new_result;\n\n if (_.isFunction(old_handlers)) {\n old_result = old_handlers(event);\n }\n new_result = new_handler.call(element, event);\n\n if ((false === old_result) || (false === new_result)) {\n ret = false;\n }\n\n return ret;\n };\n\n return handler;\n }\n\n function fixEvent(event) {\n if (event) {\n event.preventDefault = fixEvent.preventDefault;\n event.stopPropagation = fixEvent.stopPropagation;\n }\n return event;\n }\n fixEvent.preventDefault = function() {\n this.returnValue = false;\n };\n fixEvent.stopPropagation = function() {\n this.cancelBubble = true;\n };\n\n return register_event;\n})();\n\n_.dom_query = (function() {\n /* document.getElementsBySelector(selector)\n - returns an array of element objects from the current document\n matching the CSS selector. Selectors can contain element names,\n class names and ids and can be nested. For example:\n\n elements = document.getElementsBySelector('div#main p a.external')\n\n Will return an array of all 'a' elements with 'external' in their\n class attribute that are contained inside 'p' elements that are\n contained inside the 'div' element which has id=\"main\"\n\n New in version 0.4: Support for CSS2 and CSS3 attribute selectors:\n See http://www.w3.org/TR/css3-selectors/#attribute-selectors\n\n Version 0.4 - Simon Willison, March 25th 2003\n -- Works in Phoenix 0.5, Mozilla 1.3, Opera 7, Internet Explorer 6, Internet Explorer 5 on Windows\n -- Opera 7 fails\n\n Version 0.5 - Carl Sverre, Jan 7th 2013\n -- Now uses jQuery-esque `hasClass` for testing class name\n equality. This fixes a bug related to '-' characters being\n considered not part of a 'word' in regex.\n */\n\n function getAllChildren(e) {\n // Returns all children of element. Workaround required for IE5/Windows. Ugh.\n return e.all ? e.all : e.getElementsByTagName('*');\n }\n\n var bad_whitespace = /[\\t\\r\\n]/g;\n\n function hasClass(elem, selector) {\n var className = ' ' + selector + ' ';\n return ((' ' + elem.className + ' ').replace(bad_whitespace, ' ').indexOf(className) >= 0);\n }\n\n function getElementsBySelector(selector) {\n // Attempt to fail gracefully in lesser browsers\n if (!document$1.getElementsByTagName) {\n return [];\n }\n // Split selector in to tokens\n var tokens = selector.split(' ');\n var token, bits, tagName, found, foundCount, i, j, k, elements, currentContextIndex;\n var currentContext = [document$1];\n for (i = 0; i < tokens.length;
3 i++) {\n token = tokens[i].replace(/^\\s+/, '').replace(/\\s+$/, '');\n if (token.indexOf('#') > -1) {\n // Token is an ID selector\n bits = token.split('#');\n tagName = bits[0];\n var id = bits[1];\n var element = document$1.getElementById(id);\n if (!element || (tagName && element.nodeName.toLowerCase() != tagName)) {\n // element not found or tag with that ID not found, return false\n return [];\n }\n // Set currentContext to contain just this element\n currentContext = [element];\n continue; // Skip to next token\n }\n if (token.indexOf('.') > -1) {\n // Token contains a class selector\n bits = token.split('.');\n tagName = bits[0];\n var className = bits[1];\n if (!tagName) {\n tagName = '*';\n }\n // Get elements matching tag, filter them for class selector\n found = [];\n foundCount = 0;\n for (j = 0; j < currentContext.length; j++) {\n if (tagName == '*') {\n elements = getAllChildren(currentContext[j]);\n } else {\n elements = currentContext[j].getElementsByTagName(tagName);\n }\n for (k = 0; k < elements.length; k++) {\n found[foundCount++] = elements[k];\n }\n }\n currentContext = [];\n currentContextIndex = 0;\n for (j = 0; j < found.length; j++) {\n if (found[j].className &&\n _.isString(found[j].className) && // some SVG elements have classNames which are not strings\n hasClass(found[j], className)\n ) {\n currentContext[currentContextIndex++] = found[j];\n }\n }\n continue; // Skip to next token\n }\n // Code to deal with attribute selectors\n var token_match = token.match(/^(\\w*)\\[(\\w+)([=~\\|\\^\\$\\*]?)=?\"?([^\\]\"]*)\"?\\]$/);\n if (token_match) {\n tagName = token_match[1];\n var attrName = token_match[2];\n var attrOperator = token_match[3];\n var attrValue = token_match[4];\n if (!tagName) {\n tagName = '*';\n }\n // Grab all of the tagName elements within current context\n found = [];\n foundCount = 0;\n for (j = 0; j < currentContext.length; j++) {\n if (tagName == '*') {\n elements = getAllChildren(currentContext[j]);\n } else {\n elements = currentContext[j].getElementsByTagName(tagName);\n }\n for (k = 0; k < elements.length; k++) {\n found[foundCount++] = elements[k];\n }\n }\n currentContext = [];\n currentContextIndex = 0;\n var checkFunction; // This function will be used to filter the elements\n switch (attrOperator) {\n case '=': // Equality\n checkFunction = function(e) {\n return (e.getAttribute(attrName) == attrValue);\n };\n break;\n case '~': // Match one of space seperated words\n checkFunction = function(e) {\n return (e.getAttribute(attrName).match(new RegExp('\\\\b' + attrValue + '\\\\b')));\n };\n break;\n case '|': // Match start with value followed by optional hyphen\n checkFunction = function(e) {\n return (e.getAttribute(attrName).match(new RegExp('^' + attrValue + '-?')));\n };\n break;
3\n case '^': // Match starts with value\n checkFunction = function(e) {\n return (e.getAttribute(attrName).indexOf(attrValue) === 0);\n };\n break;\n case '$': // Match ends with value - fails with \"Warning\" in Opera 7\n checkFunction = function(e) {\n return (e.getAttribute(attrName).lastIndexOf(attrValue) == e.getAttribute(attrName).length - attrValue.length);\n };\n break;\n case '*': // Match ends with value\n checkFunction = function(e) {\n return (e.getAttribute(attrName).indexOf(attrValue) > -1);\n };\n break;\n default:\n // Just test for existence of attribute\n checkFunction = function(e) {\n return e.getAttribute(attrName);\n };\n }\n currentContext = [];\n currentContextIndex = 0;\n for (j = 0; j < found.length; j++) {\n if (checkFunction(found[j])) {\n currentContext[currentContextIndex++] = found[j];\n }\n }\n // alert('Attribute Selector: '+tagName+' '+attrName+' '+attrOperator+' '+attrValue);\n continue; // Skip to next token\n }\n // If we get here, token is JUST an element (not a class or ID selector)\n tagName = token;\n found = [];\n foundCount = 0;\n for (j = 0; j < currentContext.length; j++) {\n elements = currentContext[j].getElementsByTagName(tagName);\n for (k = 0; k < elements.length; k++) {\n found[foundCount++] = elements[k];\n }\n }\n currentContext = found;\n }\n return currentContext;\n }\n\n return function(query) {\n if (_.isElement(query)) {\n return [query];\n } else if (_.isObject(query) && !_.isUndefined(query.length)) {\n return query;\n } else {\n return getElementsBySelector.call(this, query);\n }\n };\n})();\n\n_.info = {\n campaignParams: function() {\n var campaign_keywords = 'utm_source utm_medium utm_campaign utm_content utm_term'.split(' '),\n kw = '',\n params = {};\n _.each(campaign_keywords, function(kwkey) {\n kw = _.getQueryParam(document$1.URL, kwkey);\n if (kw.length) {\n params[kwkey] = kw;\n }\n });\n\n return params;\n },\n\n searchEngine: function(referrer) {\n if (referrer.search('https?://(.*)google.([^/?]*)') === 0) {\n return 'google';\n } else if (referrer.search('https?://(.*)bing.com') === 0) {\n return 'bing';\n } else if (referrer.search('https?://(.*)yahoo.com') === 0) {\n return 'yahoo';\n } else if (referrer.search('https?://(.*)duckduckgo.com') === 0) {\n return 'duckduckgo';\n } else {\n return null;\n }\n },\n\n searchInfo: function(referrer) {\n var search = _.info.searchEngine(referrer),\n param = (search != 'yahoo') ? 'q' : 'p',\n ret = {};\n\n if (search !== null) {\n ret['$search_engine'] = search;\n\n var keyword = _.getQueryParam(referrer, param);\n if (keyword.length) {\n ret['mp_keyword'] = keyword;\n }\n }\n\n return ret;\n },\n\n /**\n * This function detects which browser is running this script.\n * The order of the checks are important since many user agents\n * include key words used in later checks.\n */\n browser: function(user_agent, vendor, opera) {\n vendor = vendor || ''; // vendor is undefined for at least IE9\n if (opera || _.includes(user_agent, ' OPR/')) {\n if (_.includes(user_agent, 'Mini')) {\n return 'Opera Mini';\n }\n return 'Opera';\n } else if (/(BlackBerry|PlayBook|BB10)/i.test(user_agent)) {\n return 'BlackBerry';\n } else if (_.includes(user_agent, 'IEMobile') || _.includes(user_agent, 'WPDesktop')) {\
3n return 'Internet Explorer Mobile';\n } else if (_.includes(user_agent, 'Edge')) {\n return 'Microsoft Edge';\n } else if (_.includes(user_agent, 'FBIOS')) {\n return 'Facebook Mobile';\n } else if (_.includes(user_agent, 'Chrome')) {\n return 'Chrome';\n } else if (_.includes(user_agent, 'CriOS')) {\n return 'Chrome iOS';\n } else if (_.includes(user_agent, 'FxiOS')) {\n return 'Firefox iOS';\n } else if (_.includes(vendor, 'Apple')) {\n if (_.includes(user_agent, 'Mobile')) {\n return 'Mobile Safari';\n }\n return 'Safari';\n } else if (_.includes(user_agent, 'Android')) {\n return 'Android Mobile';\n } else if (_.includes(user_agent, 'Konqueror')) {\n return 'Konqueror';\n } else if (_.includes(user_agent, 'Firefox')) {\n return 'Firefox';\n } else if (_.includes(user_agent, 'MSIE') || _.includes(user_agent, 'Trident/')) {\n return 'Internet Explorer';\n } else if (_.includes(user_agent, 'Gecko')) {\n return 'Mozilla';\n } else {\n return '';\n }\n },\n\n /**\n * This function detects which browser version is running this script,\n * parsing major and minor version (e.g., 42.1). User agent strings from:\n * http://www.useragentstring.com/pages/useragentstring.php\n */\n browserVersion: function(userAgent, vendor, opera) {\n var browser = _.info.browser(userAgent, vendor, opera);\n var versionRegexs = {\n 'Internet Explorer Mobile': /rv:(\\d+(\\.\\d+)?)/,\n 'Microsoft Edge': /Edge\\/(\\d+(\\.\\d+)?)/,\n 'Chrome': /Chrome\\/(\\d+(\\.\\d+)?)/,\n 'Chrome iOS': /CriOS\\/(\\d+(\\.\\d+)?)/,\n 'Safari': /Version\\/(\\d+(\\.\\d+)?)/,\n 'Mobile Safari': /Version\\/(\\d+(\\.\\d+)?)/,\n 'Opera': /(Opera|OPR)\\/(\\d+(\\.\\d+)?)/,\n 'Firefox': /Firefox\\/(\\d+(\\.\\d+)?)/,\n 'Firefox iOS': /FxiOS\\/(\\d+(\\.\\d+)?)/,\n 'Konqueror': /Konqueror:(\\d+(\\.\\d+)?)/,\n 'BlackBerry': /BlackBerry (\\d+(\\.\\d+)?)/,\n 'Android Mobile': /android\\s(\\d+(\\.\\d+)?)/,\n 'Internet Explorer': /(rv:|MSIE )(\\d+(\\.\\d+)?)/,\n 'Mozilla': /rv:(\\d+(\\.\\d+)?)/\n };\n var regex = versionRegexs[browser];\n if (regex === undefined) {\n return null;\n }\n var matches = userAgent.match(regex);\n if (!matches) {\n return null;\n }\n return parseFloat(matches[matches.length - 2]);\n },\n\n os: function() {\n var a = userAgent;\n if (/Windows/i.test(a)) {\n if (/Phone/.test(a) || /WPDesktop/.test(a)) {\n return 'Windows Phone';\n }\n return 'Windows';\n } else if (/(iPhone|iPad|iPod)/.test(a)) {\n return 'iOS';\n } else if (/Android/.test(a)) {\n return 'Android';\n } else if (/(BlackBerry|PlayBook|BB10)/i.test(a)) {\n return 'BlackBerry';\n } else if (/Mac/i.test(a)) {\n return 'Mac OS X';\n } else if (/Linux/.test(a)) {\n return 'Linux';\n } else {\n return '';\n }\n },\n\n device: function(user_agent) {\n if (/Windows Phone/i.test(user_agent) || /WPDesktop/.test(user_agent)) {\n return 'Windows Phone';\n } else if (/iPad/.test(user_agent)) {\n return 'iPad';\n } else if (/iPod/.test(user_agent)) {\n return 'iPod Touch';\n } else if (/iPhone/.test(user_agent)) {\n return 'iPhone';\n } else if (/(BlackBerry|PlayBook|BB10)/i.test(user_agent)) {\n return 'BlackBerry';\n } else if (/Android/.test(user_agent)) {\n return 'Android';\n } else {\n return '';\n }\n },\n\n referringDomain: function(referrer) {\n var split = referrer.split('/');\n if (split.length >= 3) {\n return split[2];\n }\n return '';\n }
3,\n\n properties: function() {\n return _.extend(_.strip_empty_properties({\n '$os': _.info.os(),\n '$browser': _.info.browser(userAgent, navigator$1.vendor, window.opera),\n '$referrer': document$1.referrer,\n '$referring_domain': _.info.referringDomain(document$1.referrer),\n '$device': _.info.device(userAgent)\n }), {\n '$current_url': window.location.href,\n '$browser_version': _.info.browserVersion(userAgent, navigator$1.vendor, window.opera),\n '$screen_height': screen.height,\n '$screen_width': screen.width,\n 'mp_lib': 'web',\n '$lib_version': Config.LIB_VERSION\n });\n },\n\n people_properties: function() {\n return _.extend(_.strip_empty_properties({\n '$os': _.info.os(),\n '$browser': _.info.browser(userAgent, navigator$1.vendor, window.opera)\n }), {\n '$browser_version': _.info.browserVersion(userAgent, navigator$1.vendor, window.opera)\n });\n },\n\n pageviewInfo: function(page) {\n return _.strip_empty_properties({\n 'mp_page': page,\n 'mp_referrer': document$1.referrer,\n 'mp_browser': _.info.browser(userAgent, navigator$1.vendor, window.opera),\n 'mp_platform': _.info.os()\n });\n }\n};\n\n// EXPORTS (for closure compiler)\n_['toArray'] = _.toArray;\n_['isObject'] = _.isObject;\n_['JSONEncode'] = _.JSONEncode;\n_['JSONDecode'] = _.JSONDecode;\n_['isBlockedUA'] = _.isBlockedUA;\n_['isEmptyObject'] = _.isEmptyObject;\n_['info'] = _.info;\n_['info']['device'] = _.info.device;\n_['info']['browser'] = _.info.browser;\n_['info']['properties'] = _.info.properties;\n\nvar DISABLE_COOKIE = '__mpced';\n\n// specifying these locally here since some websites override the global Node var\n// ex: https://www.codingame.com/\nvar ELEMENT_NODE = 1;\nvar TEXT_NODE = 3;\n\nvar autotrack = {\n _initializedTokens: [],\n\n _previousElementSibling: function(el) {\n if (el.previousElementSibling) {\n return el.previousElementSibling;\n } else {\n do {\n el = el.previousSibling;\n } while (el && el.nodeType !== ELEMENT_NODE);\n return el;\n }\n },\n\n _loadScript: function(scriptUrlToLoad, callback) {\n var scriptTag = document.createElement('script');\n scriptTag.type = 'text/javascript';\n scriptTag.src = scriptUrlToLoad;\n scriptTag.onload = callback;\n\n var scripts = document.getElementsByTagName('script');\n if (scripts.length > 0) {\n scripts[0].parentNode.insertBefore(scriptTag, scripts[0]);\n } else {\n document.body.appendChild(scriptTag);\n }\n },\n\n _getClassName: function(elem) {\n switch(typeof elem.className) {\n case 'string':\n return elem.className;\n case 'object': // handle cases where className might be SVGAnimatedString or some other type\n return elem.className.baseVal || elem.getAttribute('class') || '';\n default: // future proof\n return '';\n }\n },\n\n _getPropertiesFromElement: function(elem) {\n var props = {\n 'classes': this._getClassName(elem).split(' '),\n 'tag_name': elem.tagName.toLowerCase()\n };\n\n if (_.includes(['input', 'select', 'textarea'], elem.tagName.toLowerCase())) {\n var formFieldValue = this._getFormFieldValue(elem);\n if (this._includeProperty(elem, formFieldValue)) {\n props['value'] = formFieldValue;\n }\n }\n\n _.each(elem.attributes, function(attr) {\n props['attr__' + attr.name] = attr.value;\n });\n\n var nthChild = 1;\n var nthOfType = 1;\n var currentElem = elem;\n while (currentElem = this._previousElementSibling(currentElem)) { // eslint-disable-line no-cond-assign\n nthChild++;\n if (currentElem.tagName === elem.tagName) {\n nthOfType++;\n }\n }\n props['nth_child'] = nthChild;\n props['nth_of_type'] = nthOfType;\n\n return props;\n },\n\n /*\n * Due to potential reference discrepancies (such as the webcomponents.js polyfill)\n * We want to match tagNames instead of specific reference because something like element === document.body\n * won't always work because element might not be a native element.\n */\n _isTag: function(el, tag) {\n return el && el.tagName && el.tagName.toLowerCase() === tag.toLowerCase();\n },\n\n _shouldTrackDomEvent: function(element, event) {\n if (!element || this._isTag(element, 'html') || element.nodeType !== ELEMENT_NODE) {\n return false;\n }\n var tag = element.tagName.toLowerCase();\n switch (tag) {\n case 'html':\n return false;\n case 'form':\n return event.type === 'submit';\n case 'input':\n if (['button', 'submit'].indexOf(element.getAttribute('type')) === -1) {\n return event.type === 'change';\n } else {\n return event.type === 'click';\n }\n case 'select':\n case 'textarea':\n return event.type === 'change';\n default:\n return event.type === 'click';\n }\n },\n\n _getDefaultProperties: function(eventType) {\n return {\n '$event_type': eventType,\n '$ce_version': 1,\n '$host': window.location.host,\n '$pathname': window.location.pathname\n };\n },\n\n _getInputValue: function(input) {\n var value = null;\n var type = input.type.toLowerCase();\n switch(type) {\n case 'checkbox':\n if (input.checked) {\n value = [input.value];\n }\n break;\n case 'radio':\n if (input.checked) {\n value = input.value;\n }\n break;\n default:\n value = input.value;\n break;\n }\n return value;\n },\n\n _getSelectValue: function(select) {\n var value;\n if (select.multiple) {\n var values = [];\n _.each(select.querySelectorAll('[selected]'), function(option) {\n values.push(option.value);\n });\n value = values;\n } else {\n value = select.value;\n }\n return value;\n },\n\n _includeProperty: function(input, value) {\n for (var curEl = input; curEl.parentNode && !this._isTag(curEl, 'body'); curEl = curEl.parentNode) {\n var classes = this._getClassName(curEl).split(' ');\n if (_.includes(classes, 'mp-sensitive') || _.includes(classes, 'mp-no-track')) {\n return false;\n }\n }\n\n if (_.includes(this._getClassName(input).split(' '), 'mp-include')) {\n return true;\n }\n\n if (value === null) {\n return false;\n }\n\n // don't include hidden or password fields\n var type = input.type || '';\n switch(type.toLowerCase()) {\n case 'hidden':\n return false;\n case 'password':\n return false;\n }\n\n // filter out data from fields that look like sensitive fields\n var name = input.name || input.id || '';\n var sensitiveNameRegex = /^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|seccode|securitycode|securitynum|socialsec|socsec|ssn/i;\n if (sensitiveNameRegex.test(name.replace(/[^a-zA-Z0-9]/g, ''))) {\n return false;\n }\n\n if (typeof value === 'string') {\n // check to see if input value looks like a credit card number\n // see: https://www.safaribooksonline.com/library/view/regular-expressions-cookbook/9781449327453/ch04s20.html\n var ccRegex = /^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11}
3)|((?:2131|1800|35[0-9]{3})[0-9]{11}))$/;\n if (ccRegex.test((value || '').replace(/[\\- ]/g, ''))) {\n return false;\n }\n\n // check to see if input value looks like a social security number\n var ssnRegex = /(^\\d{3}-?\\d{2}-?\\d{4}$)/;\n if (ssnRegex.test(value)) {\n return false;\n }\n }\n\n return true;\n },\n\n _getFormFieldValue: function(field) {\n var val;\n switch(field.tagName.toLowerCase()) {\n case 'input':\n val = this._getInputValue(field);\n break;\n case 'select':\n val = this._getSelectValue(field);\n break;\n default:\n val = field.value || field.textContent;\n break;\n }\n return this._includeProperty(field, val) ? val : null;\n },\n\n _getFormFieldProperties: function(form) {\n var formFieldProps = {};\n _.each(form.elements, function(field) {\n var name = field.getAttribute('name') || field.getAttribute('id');\n if (name !== null) {\n name = '$form_field__' + name;\n var val = this._getFormFieldValue(field);\n if (this._includeProperty(field, val)) {\n var prevFieldVal = formFieldProps[name];\n if (prevFieldVal !== undefined) { // combine values for inputs of same name\n formFieldProps[name] = [].concat(prevFieldVal, val);\n } else {\n formFieldProps[name] = val;\n }\n }\n }\n }, this);\n return formFieldProps;\n },\n\n _extractCustomPropertyValue: function(customProperty) {\n var propValues = [];\n _.each(document.querySelectorAll(customProperty['css_selector']), function(matchedElem) {\n if (['input', 'select'].indexOf(matchedElem.tagName.toLowerCase()) > -1) {\n propValues.push(matchedElem['value']);\n } else if (matchedElem['textContent']) {\n propValues.push(matchedElem['textContent']);\n }\n });\n return propValues.join(', ');\n },\n\n _getCustomProperties: function(targetElementList) {\n var props = {};\n _.each(this._customProperties, function(customProperty) {\n _.each(customProperty['event_selectors'], function(eventSelector) {\n var eventElements = document.querySelectorAll(eventSelector);\n _.each(eventElements, function(eventElement) {\n if (_.includes(targetElementList, eventElement)) {\n props[customProperty['name']] = this._extractCustomPropertyValue(customProperty);\n }\n }, this);\n }, this);\n }, this);\n return props;\n },\n\n checkForBackoff: function(resp) {\n // temporarily stop CE for X seconds if the 'X-MP-CE-Backoff' header says to\n var secondsToDisable = parseInt(resp.getResponseHeader('X-MP-CE-Backoff'));\n if (!isNaN(secondsToDisable) && secondsToDisable > 0) {\n var disableUntil = _.timestamp() + (secondsToDisable * 1000);\n console.log('disabling CE for ' + secondsToDisable + ' seconds (from ' + _.timestamp() + ' until ' + disableUntil + ')');\n _.cookie.set_seconds(DISABLE_COOKIE, true, secondsToDisable, true);\n }\n },\n\n _getEventTarget: function(e) {\n // https://developer.mozilla.org/en-US/docs/Web/API/Event/target#Compatibility_notes\n if (typeof e.target === 'undefined') {\n return e.srcElement;\n } else {\n return e.target;\n }\n },\n\n _trackEvent: function(e, instance) {\n /*** Don't mess with this code without running IE8 tests on it ***/\n var target = this._getEventTarget(e);\n if (target.nodeType === TEXT_NODE) { // defeat Safari bug (see: http://www.quirksmode.org/js/events_properties.html)\n target = target.parentNode;\n }\n\n if (this._shouldTrackDomEvent(target, e)) {\n var targetElementList = [target];\n var curEl = target;\n while (curEl.parentNode && !this._isTag(curEl, 'body')) {\n targetElementList.push(curEl.parentNode);\n curEl = curEl.parentNode;\n }\n\n var elementsJson = [];\n var href, elementText, form, explicitNoTrack = false;\n _.each(targetElementList, function(el, idx) {\n // if the element or a parent element is an anchor tag\n // include the href as a property\n if (el.tagName.toLowerCase() === 'a') {\n href = el.getAttribute('href');\n } else if (el.tagName.toLowerCase() === 'form') {\n form = el;\n }
3\n // crawl up to max of 5 nodes to populate text content\n if (!elementText && idx < 5 && el.textContent) {\n var textContent = _.trim(el.textContent);\n if (textContent) {\n elementText = textContent.replace(/[\\r\\n]/g, ' ').replace(/[ ]+/g, ' ').substring(0, 255);\n }\n }\n\n // allow users to programatically prevent tracking of elements by adding class 'mp-no-track'\n var classes = this._getClassName(el).split(' ');\n if (_.includes(classes, 'mp-no-track')) {\n explicitNoTrack = true;\n }\n\n elementsJson.push(this._getPropertiesFromElement(el));\n }, this);\n\n if (explicitNoTrack) {\n return false;\n }\n\n var props = _.extend(\n this._getDefaultProperties(e.type),\n {\n '$elements': elementsJson,\n '$el_attr__href': href,\n '$el_text': elementText\n },\n this._getCustomProperties(targetElementList)\n );\n\n if (form && (e.type === 'submit' || e.type === 'click')) {\n _.extend(props, this._getFormFieldProperties(form));\n }\n instance.track('$web_event', props);\n return true;\n }\n },\n\n // only reason is to stub for unit tests\n // since you can't override window.location props\n _navigate: function(href) {\n window.location.href = href;\n },\n\n _addDomEventHandlers: function(instance) {\n var handler = _.bind(function(e) {\n if (_.cookie.parse(DISABLE_COOKIE) !== true) {\n e = e || window.event;\n this._trackEvent(e, instance);\n }\n }, this);\n _.register_event(document, 'submit', handler, false, true);\n _.register_event(document, 'change', handler, false, true);\n _.register_event(document, 'click', handler, false, true);\n },\n\n _customProperties: {},\n init: function(instance) {\n if (!(document && document.body)) {\n console.log('document not ready yet, trying again in 500 milliseconds...');\n var that = this;\n setTimeout(function() { that.init(instance); }, 500);\n return;\n }\n\n var token = instance.get_config('token');\n if (this._initializedTokens.indexOf(token) > -1) {\n console.log('autotrack already initialized for token \"' + token + '\"');\n return;\n }\n this._initializedTokens.push(token);\n\n if (!this._maybeLoadEditor(instance)) { // don't autotrack actions when the editor is enabled\n var parseDecideResponse = _.bind(function(response) {\n if (response && response['config'] && response['config']['enable_collect_everything'] === true) {\n\n if (response['custom_properties']) {\n this._customProperties = response['custom_properties'];\n }\n\n instance.track('$web_event', _.extend({\n '$title': document.title\n }, this._getDefaultProperties('pageview')));\n\n this._addDomEventHandlers(instance);\n\n } else {\n instance['__autotrack_enabled'] = false;\n }\n }, this);\n\n instance._send_request(\n instance.get_config('decide_host') + '/decide/', {\n 'verbose': true,\n 'version': '1',\n 'lib': 'web',\n 'token': token\n },\n instance._prepare_callback(parseDecideResponse)\n );\n }\n },\n\n _editorParamsFromHash: function(instance, hash) {\n var editorParams;\n try {\n var state = _.getHashParam(hash, 'state');\n state = JSON.parse(decodeURIComponent(state));\n var expiresInSeconds = _.getHashParam(hash, 'expires_in');\n editorParams = {\n 'accessToken': _.getHashParam(hash, 'access_token'),\n 'accessTokenExpiresAt': (new Date()).getTime() + (Number(expiresInSeconds) * 1000),\n 'bookmarkletMode': !!state['bookmarkletMode'],\n 'projectId': state['projectId'],\n 'projectOwnerId': state['projectOwnerId'],\n 'projectToken': state['token'],\n 'readOnly': state['readOnly'],\n 'userFlags': state['userFlags'],\n 'userId': state['userId']\n };\n window.sessionStorage.setItem('editorParams', JSON.stringify(editorParams));\n\n if (state['desiredHash']) {\n window.location.hash = state['desiredHash'];\n } else if (window.history) {\n history.replaceState('', document.title, window.location.pathname + window.location.search); // completely remove hash\n } else {\n window.location.hash = ''; // clear hash (but leaves # unfortunately)\n }\n } catch (e) {\n console.error('Unable to parse data from hash', e);\n }\n return editorParams;\n },\n\n /**\n * To load the visual editor, we need an access token and other state. That state comes from one of three places:\n * 1. In the URL hash params if the customer is using an old snippet\n * 2. From session storage under the key `_mpcehash` if the snippet already parsed the hash\n * 3. From session storage under the key `editorParams` if the editor was initialized on a previous page\n */\n _maybeLoadEditor: function(instance) {\n var parseFromUrl = false;\n if (_.getHashParam(window.location.hash, 'state')) {\n var state = _.getHashParam(window.location.hash, 'state');\n state = JSON.parse(decodeURIComponent(state));\n parseFromUrl = state['action'] === 'mpeditor';\n }\n var parseFromStorage = !!window.sessionStorage.getItem('_mpcehash');\n var editorParams;\n\n if (parseFromUrl) { // happens if they are initializing the editor using an old snippet\n editorParams = this._editorParamsFromHash(instance, window.location.hash);\n } else if (parseFromStorage) { // happens if they are initialized the editor and using the new snippet\n editorParams = this._editorParamsFromHash(instance, window.sessionStorage.getItem('_mpcehash'));\n window.sessionStorage.removeItem('_mpcehash');\n } else { // get credentials from sessionStorage from a previous initialzation\n editorParams = JSON.parse(window.sessionStorage.getItem('editorParams') || '{}');\n }\n\n if (editorParams['projectToken'] && instance.get_config('token') === editorParams['projectToken']) {\n this._loadEditor(instance, editorParams);\n return true;\n } else {\n return false;\n }\n },\n\n // only load the codeless event editor once, even if there are multiple instances of MixpanelLib\n _editorLoaded: false,\n _loadEditor: function(instance, editorParams) {\n if (!this._editorLoaded) {\n this._editorLoaded = true;\n var editorUrl;\n var cacheBuster = '?_ts=' + (new Date()).getTime();\n var siteMedia = instance.get_config('app_host') + '/site_media';\n if (Config.DEBUG) {\n editorUrl = siteMedia + '/compiled/reports/collect-everything/editor.js' + cac
3heBuster;\n } else {\n editorUrl = siteMedia + '/bundle-webpack/reports/collect-everything/editor.min.js' + cacheBuster;\n }\n this._loadScript(editorUrl, function() {\n window['mp_load_editor'](editorParams);\n });\n return true;\n }\n return false;\n },\n\n // this is a mechanism to ramp up CE with no server-side interaction.\n // when CE is active, every page load results in a decide request. we\n // need to gently ramp this up so we don't overload decide. this decides\n // deterministically if CE is enabled for this project by modding the char\n // value of the project token.\n enabledForProject: function(token, numBuckets, numEnabledBuckets) {\n numBuckets = !_.isUndefined(numBuckets) ? numBuckets : 10;\n numEnabledBuckets = !_.isUndefined(numEnabledBuckets) ? numEnabledBuckets : 10;\n var charCodeSum = 0;\n for (var i = 0; i < token.length; i++) {\n charCodeSum += token.charCo
3deAt(i);\n }\n return (charCodeSum % numBuckets) < numEnabledBuckets;\n },\n\n isBrowserSupported: function() {\n return _.isFunction(document.querySelectorAll);\n }\n};\n\n_.bind_instance_methods(autotrack);\n_.safewrap_instance_methods(autotrack);\n\n/*\n * Mixpanel JS Library\n *\n * Copyright 2012, Mixpanel, Inc. All Rights Reserved\n * http://mixpanel.com/\n *\n * Includes portions of Underscore.js\n * http://documentcloud.github.com/underscore/\n * (c) 2011 Jeremy Ashkenas, DocumentCloud Inc.\n * Released under the MIT License.\n */\n\n// ==ClosureCompiler==\n// @compilation_level ADVANCED_OPTIMIZATIONS\n// @output_file_name mixpanel-2.8.min.js\n// ==/ClosureCompiler==\n\n/*\nSIMPLE STYLE GUIDE:\n\nthis.x === public function\nthis._x === internal - only use within this file\nthis.__x === private - only use within the class\n\nGlobals should be all caps\n*/\n\nvar init_type; // MODULE or SNIPPET loader\nvar mixpanel_master; // main mixpanel instance / object\nvar INIT_MODULE = 0;\nvar INIT_SNIPPET = 1;\n\n/*\n * Constants\n */\n/** @const */ var PRIMARY_INSTANCE_NAME = 'mixpanel';\n/** @const */ var SET_QUEUE_KEY = '__mps';\n/** @const */ var SET_ONCE_QUEUE_KEY = '__mpso';\n/** @const */ var ADD_QUEUE_KEY = '__mpa';\n/** @const */ var APPEND_QUEUE_KEY = '__mpap';\n/** @const */ var UNION_QUEUE_KEY = '__mpu';\n/** @const */ var SET_ACTION = '$set';\n/** @const */ var SET_ONCE_ACTION = '$set_once';\n/** @const */ var ADD_ACTION = '$add';\n/** @const */ var APPEND_ACTION = '$append';\n/** @const */ var UNION_ACTION = '$union';\n// This key is deprecated, but we want to check for it to see whether aliasing is allowed.\n/** @const */ var PEOPLE_DISTINCT_ID_KEY = '$people_distinct_id';\n/** @const */ var ALIAS_ID_KEY = '__alias';\n/** @const */ var CAMPAIGN_IDS_KEY = '__cmpns';\n/** @const */ var EVENT_TIMERS_KEY = '__timers';\n/** @const */ var RESERVED_PROPERTIES = [\n SET_QUEUE_KEY,\n SET_ONCE_QUEUE_KEY,\n ADD_QUEUE_KEY,\n APPEND_QUEUE_KEY,\n UNION_QUEUE_KEY,\n PEOPLE_DISTINCT_ID_KEY,\n ALIAS_ID_KEY,\n CAMPAIGN_IDS_KEY,\n EVENT_TIMERS_KEY\n];\n\n/*\n * Dynamic... constants? Is that an oxymoron?\n */\nvar HTTP_PROTOCOL = (('https:' === document.location.protocol) ? 'https://' : 'http://');\n\n // http://hacks.mozilla.org/2009/07/cross-site-xmlhttprequest-with-cors/\n // https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest#withCredentials\nvar USE_XHR = (window.XMLHttpRequest && 'withCredentials' in new XMLHttpRequest());\n\n // IE<10 does not support cross-origin XHR's but script tags\n // with defer won't block window.onload; ENQUEUE_REQUESTS\n // should only be true for Opera<12\nvar ENQUEUE_REQUESTS = !USE_XHR && (userAgent.indexOf('MSIE') === -1) && (userAgent.indexOf('Mozilla') === -1);\n\n/*\n * Module-level globals\n */\nvar DEFAULT_CONFIG = {\n 'api_host': HTTP_PROTOCOL + 'api.mixpanel.com',\n 'app_host': HTTP_PROTOCOL + 'mixpanel.com',\n 'autotrack': true,\n 'cdn': HTTP_PROTOCOL + 'cdn.mxpnl.com',\n 'cross_subdomain_cookie': true,\n 'persistence': 'cookie',\n 'persistence_name': '',\n 'cookie_name': '',\n 'loaded': function() {},\n 'store_google': true,\n 'save_referrer': true,\n 'test': false,\n 'verbose': false,\n 'img': false,\n 'track_pageview': true,\n 'debug': false,\n 'track_links_timeout': 300,\n 'cookie_expiration': 365,\n 'upgrade': false,\n 'disable_persistence': false,\n 'disable_cookie': false,\n 'secure_cookie': false,\n 'ip': true,\n 'property_blacklist': []\n};\nDEFAULT_CONFIG['decide_host'] = DEFAULT_CONFIG['api_host'];\n\nvar DOM_LOADED = false;\n\n/**\n * DomTracker Object\n * @constructor\n */\nvar DomTracker = function() {};\n\n// interface\nDomTracker.prototype.create_properties = function() {};\nDomTracker.prototype.event_handler = function() {};\nDomTracker.prototype.after_track_handler = function() {};\n\nDomTracker.prototype.init = function(mixpanel_instance) {\n this.mp = mixpanel_instance;\n return this;\n};\n\n/**\n * @param {Object|string} query\n * @param {string} event_name\n * @param {Object=} properties\n * @param {function(...[*])=} user_callback\n */\nDomTracker.prototype.track = function(query, event_name, properties, user_callback) {\n var that = this;\n var elements = _.dom_query(query);\n\n if (elements.length === 0) {\n console$1.error('The DOM query (' + query + ') returned 0 elements');\n return;\n }\n\n _.each(elements, function(element) {\n _.register_event(element, this.override_event, function(e) {\n var options = {};\n var props = that.create_properties(properties, this);\n var timeout = that.mp.get_config('track_links_timeout');\n\n that.event_handler(e, this, options);\n\n // in case the mixpanel servers don't get back to us in time\n window.setTimeout(that.track_callback(user_callback, props, options, true), timeout);\n\n // fire the tracking event\n that.mp.track(event_name, props, that.track_callback(user_callback, props, options));\n });\n }, this);\n\n return true;\n};\n\n/**\n * @param {function(...[*])} user_callback\n * @param {Object} props\n * @param {boolean=} timeout_occured\n */\nDomTracker.prototype.track_callback = function(user_callback, props, options, timeout_occured) {\n timeout_occured = timeout_occured || false;\n var that = this;
3\n\n return function() {\n // options is referenced from both callbacks, so we can have\n // a 'lock' of sorts to ensure only one fires\n if (options.callback_fired) { return; }\n options.callback_fired = true;\n\n if (user_callback && user_callback(timeout_occured, props) === false) {\n // user can prevent the default functionality by\n // returning false from their callback\n return;\n }\n\n that.after_track_handler(props, options, timeout_occured);\n };\n};\n\nDomTracker.prototype.create_properties = function(properties, element) {\n var props;\n\n if (typeof(properties) === 'function') {\n props = properties(element);\n } else {\n props = _.extend({}, properties);\n }\n\n return props;\n};\n\n/**\n * LinkTracker Object\n * @constructor\n * @extends DomTracker\n */\nvar LinkTracker = function() {\n this.override_event = 'click';\n};\n_.inherit(LinkTracker, DomTracker);\n\nLinkTracker.prototype.create_properties = function(properties, element) {\n var props = LinkTracker.superclass.create_properties.apply(this, arguments);\n\n if (element.href) { props['url'] = element.href; }\n\n return props;\n};\n\nLinkTracker.prototype.event_handler = function(evt, element, options) {\n options.new_tab = (\n evt.which === 2 ||\n evt.metaKey ||\n evt.ctrlKey ||\n element.target === '_blank'\n );\n options.href = element.href;\n\n if (!options.new_tab) {\n evt.preventDefault();\n }\n};\n\nLinkTracker.prototype.after_track_handler = function(props, options) {\n if (options.new_tab) { return; }\n\n setTimeout(function() {\n window.location = options.href;\n }, 0);\n};\n\n/**\n * FormTracker Object\n * @constructor\n * @extends DomTracker\n */\nvar FormTracker = function() {\n this.override_event = 'submit';\n};\n_.inherit(FormTracker, DomTracker);\n\nFormTracker.prototype.event_handler = function(evt, element, options) {\n options.element = element;\n evt.preventDefault();\n};\n\nFormTracker.prototype.after_track_handler = function(props, options) {\n setTimeout(function() {\n options.element.submit();\n }, 0);\n};\n\n/**\n * Mixpanel Persistence Object\n * @constructor\n */\nvar MixpanelPersistence = function(config) {\n this['props'] = {};\n this.campaign_params_saved = false;\n\n if (config['persistence_name']) {\n this.name = 'mp_' + config['persistence_name'];\n } else {\n this.name = 'mp_' + config['token'] + '_mixpanel';\n }\n\n var storage_type = config['persistence'];\n if (storage_type !== 'cookie' && storage_type !== 'localStorage') {\n console$1.critical('Unknown persistence type ' + storage_type + '; falling back to cookie');\n storage_type = config['persistence'] = 'cookie';\n }\n\n var localStorage_supported = function() {\n var supported = true;\n try {\n var key = '__mplssupport__',\n val = 'xyz';\n _.localStorage.set(key, val);\n if (_.localStorage.get(key) !== val) {\n supported = false;\n }\n _.localStorage.remove(key);\n } catch (err) {\n supported = false;\n }\n if (!supported) {\n console$1.error('localStorage unsupported; falling back to cookie store');\n }\n return supported;\n };\n if (storage_type === 'localStorage' && localStorage_supported()) {\n this.storage = _.localStorage;\n } else {\n this.storage = _.cookie;\n }\n\n this.load();\n this.update_config(config);\n this.upgrade(config);\n this.save();\n};\n\nMixpanelPersistence.prototype.properties = function() {\n var p = {};\n // Filter out reserved properties\n _.each(this['props'], function(v, k) {\n if (!_.include(RESERVED_PROPERTIES, k)) {\n p[k] = v;\n }\n });\n return p;\n};\n\nMixpanelPersistence.prototype.load = function() {\n if (this.disabled) { return; }\n\n var entry = this.storage.parse(this.name);\n\n if (entry) {\n this['props'] = _.extend({}, entry);\n }\n};\n\nMixpanelPersistence.prototype.upgrade = function(config) {\n var upgrade_from_old_lib = config['upgrade'],\n old_cookie_name,\n old_cookie;\n\n if (upgrade_from_old_lib) {\n old_cookie_name = 'mp_super_properties';\n // Case where they had a custom cookie name before.\n if (typeof(upgrade_from_old_lib) === 'string') {\n old_cookie_name = upgrade_from_old_lib;\n }\n\n old_cookie = this.storage.parse(old_cookie_name);\n\n // remove the cookie\n this.storage.remove(old_cookie_name);\n this.storage.remove(old_cookie_name, true);\n\n if (old_cookie) {\n this['props'] = _.extend(\n this['props'],\n old_cookie['all'],\n old_cookie['events']\n );\n }\n }\n\n if (!config['cookie_name'] && config['name'] !== 'mixpanel') {\n // special case to handle people with cookies of the form\n // mp_TOKEN_INSTANCENAME from the first release of this library\n old_cookie_name = 'mp_' + config['token'] + '_' + config['name'];\n old_cookie = this.storage.parse(old_cookie_name);\n\n if (old_cookie) {\n this.storage.remove(old_cookie_name);\n this.storage.remove(old_cookie_name, true);\n\n // Save the prop values that were in the cookie from before -\n // this should only happen once as we delete the old one.\n this.register_once(old_cookie);\n }\n }\n\n if (this.storage === _.localStorage) {\n old_cookie = _.cookie.parse(this.name);\n\n _.cookie.remove(this.name);\n _.cookie.remove(this.name, true);\n\n if (old_cookie) {\n this.register_once(old_cookie);\n }\n }\n};
3\n\nMixpanelPersistence.prototype.save = function() {\n if (this.disabled) { return; }\n this._expire_notification_campaigns();\n this.storage.set(\n this.name,\n _.JSONEncode(this['props']),\n this.expire_days,\n this.cross_subdomain,\n this.secure\n );\n};\n\nMixpanelPersistence.prototype.remove = function() {\n // remove both domain and subdomain cookies\n this.storage.remove(this.name, false);\n this.storage.remove(this.name, true);\n};\n\n// removes the storage entry and deletes all loaded data\n// forced name for tests\nMixpanelPersistence.prototype.clear = function() {\n this.remove();\n this['props'] = {};\n};\n\n/**\n * @param {Object} props\n * @param {*=} default_value\n * @param {number=} days\n */\nMixpanelPersistence.prototype.register_once = function(props, default_value, days) {\n if (_.isObject(props)) {\n if (typeof(default_value) === 'undefined') { default_value = 'None'; }\n this.expire_days = (typeof(days) === 'undefined') ? this.default_expiry : days;\n\n _.each(props, function(val, prop) {\n if (!this['props'][prop] || this['props'][prop] === default_value) {\n this['props'][prop] = val;\n }\n }, this);\n\n this.save();\n\n return true;\n }\n return false;\n};\n\n/**\n * @param {Object} props\n * @param {number=} days\n */\nMixpanelPersistence.prototype.register = function(props, days) {\n if (_.isObject(props)) {\n this.expire_days = (typeof(days) === 'undefined') ? this.default_expiry : days;\n\n _.extend(this['props'], props);\n\n this.save();\n\n return true;\n }\n return false;\n};\n\nMixpanelPersistence.prototype.unregister = function(prop) {\n if (prop in this['props']) {\n delete this['props'][prop];\n this.save();\n }\n};\n\nMixpanelPersistence.prototype._expire_notification_campaigns = _.safewrap(function() {\n var campaigns_shown = this['props'][CAMPAIGN_IDS_KEY],\n EXPIRY_TIME = Config.DEBUG ? 60 * 1000 : 60 * 60 * 1000; // 1 minute (Config.DEBUG) / 1 hour (PDXN)\n if (!campaigns_shown) {\n return;\n }\n for (var campaign_id in campaigns_shown) {\n if (1 * new Date() - campaigns_shown[campaign_id] > EXPIRY_TIME) {\n delete campaigns_shown[campaign_id];\n }\n }\n if (_.isEmptyObject(campaigns_shown)) {\n delete this['props'][CAMPAIGN_IDS_KEY];\n }\n});\n\nMixpanelPersistence.prototype.update_campaign_params = function() {\n if (!this.campaign_params_saved) {\n this.register_once(_.info.campaignParams());\n this.campaign_params_saved = true;\n }\n};\n\nMixpanelPersistence.prototype.update_search_keyword = function(referrer) {\n this.register(_.info.searchInfo(referrer));\n};\n\n// EXPORTED METHOD, we test this directly.\nMixpanelPersistence.prototype.update_referrer_info = function(referrer) {\n // If referrer doesn't exist, we want to note the fact that it was type-in traffic.\n this.register_once({\n '$initial_referrer': referrer || '$direct',\n '$initial_referring_domain': _.info.referringDomain(referrer) || '$direct'\n }, '');\n};\n\nMixpanelPersistence.prototype.get_referrer_info = function() {\n return _.strip_empty_properties({\n '$initial_referrer': this['props']['$initial_referrer'],\n '$initial_referring_domain': this['props']['$initial_referring_domain']\n });\n};\n\n// safely fills the passed in object with stored properties,\n// does not override any properties defined in both\n// returns the passed in object\nMixpanelPersistence.prototype.safe_merge = function(props) {\n _.each(this['props'], function(val, prop) {\n if (!(prop in props)) {\n props[prop] = val;\n }\n });\n\n return props;\n};\n\nMixpanelPersistence.prototype.update_config = function(config) {\n this.default_expiry = this.expire_days = config['cookie_expiration'];\n this.set_disabled(config['disable_persistence']);\n this.set_cross_subdomain(config['cross_subdomain_cookie']);\n this.set_secure(config['secure_cookie']);\n};\n\nMixpanelPersistence.prototype.set_disabled = function(disabled) {\n this.disabled = disabled;\n if (this.disabled) {\n this.remove();\n }\n};\n\nMixpanelPersistence.prototype.set_cross_subdomain = function(cross_subdomain) {\n if (cross_subdomain !== this.cross_subdomain) {\n this.cross_subdomain = cross_subdomain;\n this.remove();\n this.save();\n }\n};\n\nMixpanelPersistence.prototype.get_cross_subdomain = function() {\
3n return this.cross_subdomain;\n};\n\nMixpanelPersistence.prototype.set_secure = function(secure) {\n if (secure !== this.secure) {\n this.secure = secure ? true : false;\n this.remove();\n this.save();\n }\n};\n\nMixpanelPersistence.prototype._add_to_people_queue = function(queue, data) {\n var q_key = this._get_queue_key(queue),\n q_data = data[queue],\n set_q = this._get_or_create_queue(SET_ACTION),\n set_once_q = this._get_or_create_queue(SET_ONCE_ACTION),\n add_q = this._get_or_create_queue(ADD_ACTION),\n union_q = this._get_or_create_queue(UNION_ACTION),\n append_q = this._get_or_create_queue(APPEND_ACTION, []);\n\n if (q_key === SET_QUEUE_KEY) {\n // Update the set queue - we can override any existing values\n _.extend(set_q, q_data);\n // if there was a pending increment, override it\n // with the set.\n this._pop_from_people_queue(ADD_ACTION, q_data);\n // if there was a pending union, override it\n // with the set.\n this._pop_from_people_queue(UNION_ACTION, q_data);\n } else if (q_key === SET_ONCE_QUEUE_KEY) {\n // only queue the data if there is not already a set_once call for it.\n _.each(q_data, function(v, k) {\n if (!(k in set_once_q)) {\n set_once_q[k] = v;\n }\n });\n } else if (q_key === ADD_QUEUE_KEY) {\n _.each(q_data, function(v, k) {\n // If it exists in the set queue, increment\n // the value\n if (k in set_q) {\n set_q[k] += v;\n } else {\n // If it doesn't exist, update the add\n // queue\n if (!(k in add_q)) {\n add_q[k] = 0;\n }\n add_q[k] += v;\n }\n }, this);\n } else if (q_key === UNION_QUEUE_KEY) {\n _.each(q_data, function(v, k) {\n if (_.isArray(v)) {\n if (!(k in union_q)) {\n union_q[k] = [];\n }\n // We may send duplicates, the server will dedup them.\n union_q[k] = union_q[k].concat(v);\n }\n });\n } else if (q_key === APPEND_QUEUE_KEY) {\n append_q.push(q_data);\n }\n\n console$1.log('MIXPANEL PEOPLE REQUEST (QUEUED, PENDING IDENTIFY):');\n console$1.log(data);\n\n this.save();\n};\n\nMixpanelPersistence.prototype._pop_from_people_queue = function(queue, data) {\n var q = this._get_queue(queue);\n if (!_.isUndefined(q)) {\n _.each(data, function(v, k) {\n delete q[k];\n }, this);\n\n this.save();\n }\n};\n\nMixpanelPersistence.prototype._get_queue_key = function(queue) {\n if (queue === SET_ACTION) {\n return SET_QUEUE_KEY;\n } else if (queue === SET_ONCE_ACTION) {\n return SET_ONCE_QUEUE_KEY;\n } else if (queue === ADD_ACTION) {\n return ADD_QUEUE_KEY;\n } else if (queue === APPEND_ACTION) {\n return APPEND_QUEUE_KEY;\n } else if (queue === UNION_ACTION) {\n return UNION_QUEUE_KEY;\n } else {\n console$1.error('Invalid queue:', queue);\n }\n};\n\nMixpanelPersistence.prototype._get_queue = function(queue) {\n return this['props'][this._get_queue_key(queue)];\n};\nMixpanelPersistence.prototype._get_or_create_queue = function(queue, default_val) {\n var key = this._get_queue_key(queue);\n default_val = _.isUndefined(default_val) ? {} : default_val;\n\n return this['props'][key] || (this['props'][key] = default_val);\n};\n\nMixpanelPersistence.prototype.set_event_timer = function(event_name, timestamp) {\n var timers = this['props'][EVENT_TIMERS_KEY] || {};\n timers[event_name] = timestamp;\n this['props'][EVENT_TIMERS_KEY] = timers;\n this.save();\n};\n\nMixpanelPersistence.prototype.remove_event_timer = function(event_name) {\n var timers = this['props'][EVENT_TIMERS_KEY] || {};\n var timestamp = timers[event_name];\n if (!_.isUndefined(timestamp)) {\n delete this['props'][EVENT_TIMERS_KEY][event_name];\n this.save();\n }\n return timestamp;\n};\n\n/**\n * Mixpanel Library Object\n * @constructor\n */\nvar MixpanelLib = function() {};\n\n/**\n * Mixpanel People Object\n * @constructor\n */\nvar MixpanelPeople = function() {};\n\nvar MPNotif;
3\n\n/**\n * create_mplib(token:string, config:object, name:string)\n *\n * This function is used by the init method of MixpanelLib objects\n * as well as the main initializer at the end of the JSLib (that\n * initializes document.mixpanel as well as any additional instances\n * declared before this file has loaded).\n */\nvar create_mplib = function(token, config, name) {\n var instance,\n target = (name === PRIMARY_INSTANCE_NAME) ? mixpanel_master : mixpanel_master[name];\n\n if (target && init_type === INIT_MODULE) {\n instance = target;\n } else {\n if (target && !_.isArray(target)) {\n console$1.error('You have already initialized ' + name);\n return;\n }\n instance = new MixpanelLib();\n }\n\n instance._init(token, config, name);\n\n instance['people'] = new MixpanelPeople();\n instance['people']._init(instance);\n\n // if any instance on the page has debug = true, we set the\n // global debug to be true\n Config.DEBUG = Config.DEBUG || instance.get_config('debug');\n\n instance['__autotrack_enabled'] = instance.get_config('autotrack');\n if (instance.get_config('autotrack')) {\n var num_buckets = 100;\n var num_enabled_buckets = 100;\n if (!autotrack.enabledForProject(instance.get_config('token'), num_buckets, num_enabled_buckets)) {\n instance['__autotrack_enabled'] = false;\n console$1.log('Not in active bucket: disabling Automatic Event Collection.');\n } else if (!autotrack.isBrowserSupported()) {\n instance['__autotrack_enabled'] = false;\n console$1.log('Disabling Automatic Event Collection because this browser is not supported');\n } else {\n autotrack.init(instance);\n }\n\n try {\n add_dom_event_counting_handlers(instance);\n } catch (e) {\n console$1.error(e);\n }\n }\n\n // if target is not defined, we called init after the lib already\n // loaded, so there won't be an array of things to execute\n if (!_.isUndefined(target) && _.isArray(target)) {\n // Crunch through the people queue first - we queue this data up &\n // flush on identify, so it's better to do all these operations first\n instance._execute_array.call(instance['people'], target['people']);\n instance._execute_array(target);\n }\n\n return instance;\n};\n\n// Initialization methods\n\n/**\n * This function initializes a new instance of the Mixpanel tracking object.\n * All new instances are added to the main mixpanel object as sub properties (such as\n * mixpanel.library_name) and also returned by this function. To define a\n * second instance on the page, you would call:\n *\n * mixpanel.init('new token', { your: 'config' }, 'library_name');\n *\n * and use it like so:\n *\n * mixpanel.library_name.track(...);\n *\n * @param {String} token Your Mixpanel API token\n * @param {Object} [config] A dictionary of config options to override\n * @param {String} [name] The name for the new mixpanel instance that you want created\n */\nMixpanelLib.prototype.init = function (token, config, name) {\n if (_.isUndefined(name)) {\n console$1.error('You must name your new library: init(token, config, name)');\n return;\n }\n if (name === PRIMARY_INSTANCE_NAME) {\n console$1.error('You must initialize the main mixpanel object right after you include the Mixpanel js snippet');\n return;\n }\n\n var instance = create_mplib(token, config, name);\n mixpanel_master[name] = instance;\n instance._loaded();\n\n return instance;\n};\n\n// mixpanel._init(token:string, config:object, name:string)\n//\n// This function sets up the current instance of the mixpanel\n// library. The difference between this method and the init(...)\n// method is this one initializes the actual instance, whereas the\n// init(...) method sets up a new library and calls _init on it.\n//\nMixpanelLib.prototype._init = function(token, config, name) {\n this['__loaded'] = true;\n this['config'] = {};\n\n this.set_config(_.extend({}, DEFAULT_CONFIG, config, {\n 'name': name,\n 'token': token,\n 'callback_fn': ((name === PRIMARY_INSTANCE_NAME) ? name : PRIMARY_INSTANCE_NAME + '.' + name) + '._jsc'\n }));\n\n this['_jsc'] = function() {};\n\n this.__dom_loaded_queue = [];\n this.__request_queue = [];\n this.__disabled_events = [];\n this._flags = {\n 'disable_all_events': false,\n 'identify_called': false\n };\n\n this['persistence'] = this['cookie'] = new MixpanelPersistence(this['config']);\n this.register_once({'distinct_id': _.UUID()}, '');\n};\n\n// Private methods\n\nMixpanelLib.prototype._loaded = function() {\
3n this.get_config('loaded')(this);\n\n // this happens after so a user can call identify/name_tag in\n // the loaded callback\n if (this.get_config('track_pageview')) {\n this.track_pageview();\n }\n};\n\nMixpanelLib.prototype._dom_loaded = function() {\n _.each(this.__dom_loaded_queue, function(item) {\n this._track_dom.apply(this, item);\n }, this);\n _.each(this.__request_queue, function(item) {\n this._send_request.apply(this, item);\n }, this);\n delete this.__dom_loaded_queue;\n delete this.__request_queue;\n};\n\nMixpanelLib.prototype._track_dom = function(DomClass, args) {\n if (this.get_config('img')) {\n console$1.error('You can\\'t use DOM tracking functions with img = true.');\n return false;\n }\n\n if (!DOM_LOADED) {\n this.__dom_loaded_queue.push([DomClass, args]);\n return false;\n }\n\n var dt = new DomClass().init(this);\n return dt.track.apply(dt, args);\n};\n\n/**\n * _prepare_callback() should be called by callers of _send_request for use\n * as the callback argument.\n *\n * If there is no callback, this returns null.\n * If we are going to make XHR/XDR requests, this returns a function.\n * If we are going to use script tags, this returns a string to use as the\n * callback GET param.\n */\nMixpanelLib.prototype._prepare_callback = function(callback, data) {\n if (_.isUndefined(callback)) {\n return null;\n }\n\n if (USE_XHR) {\n var callback_function = function(response) {\n callback(response, data);\n };\n return callback_function;\n } else {\n // if the user gives us a callback, we store as a random\n // property on this instances jsc function and update our\n // callback string to reflect that.\n var jsc = this['_jsc'];\n var randomized_cb = '' + Math.floor(Math.random() * 100000000);\n var callback_string = this.get_config('callback_fn') + '[' + randomized_cb + ']';\n jsc[randomized_cb] = function(response) {\n delete jsc[randomized_cb];\n callback(response, data);\n };\n return callback_string;\n }\n};\n\nMixpanelLib.prototype._send_request = function(url, data, callback) {\n if (ENQUEUE_REQUESTS) {\n this.__request_queue.push(arguments);\n return;\n }\n\n // needed to correctly format responses\n var verbose_mode = this.get_config('verbose');\n if (data['verbose']) { verbose_mode = true; }\n\n if (this.get_config('test')) { data['test'] = 1; }\n if (verbose_mode) { data['verbose'] = 1; }\n if (this.get_config('img')) { data['img'] = 1; }\n if (!USE_XHR) {\n if (callback) {\n data['callback'] = callback;\n } else if (verbose_mode || this.get_config('test')) {\n // Verbose output (from verbose mode, or an error in test mode) is a json blob,\n // which by itself is not valid javascript. Without a callback, this verbose output will\n // cause an error when returned via jsonp, so we force a no-op callback param.\n // See the ECMA script spec: http://www.ecma-international.org/ecma-262/5.1/#sec-12.4\n data['callback'] = '(function(){})';\n }\n }\n\n data['ip'] = this.get_config('ip')?1:0;\n data['_'] = new Date().getTime().toString();\n url += '?' + _.HTTPBuildQuery(data);\n\n if ('img' in data) {\n var img = document.createElement('img');\n img.src = url;\n document.body.appendChild(img);\n } else if (USE_XHR) {\n try {\n var req = new XMLHttpRequest();\n req.open('GET', url, true);\n // send the mp_optout cookie\n // withCredentials cannot be modified until after calling .open on Android and Mobile Safari\n req.withCredentials = true;\n req.onreadystatechange = function () {\n if (req.readyState === 4) { // XMLHttpRequest.DONE == 4, except in safari 4\n if (url.indexOf('api.mixpanel.com/track') !== -1) {\n autotrack.checkForBackoff(req);\n }\n if (req.status === 200) {\n if (callback) {\n if (verbose_mode) {\n callback(_.JSONDecode(req.responseText));\n } else {\n callback(Number(req.responseText));\n }\n }\n } else {\n var error = 'Bad HTTP status: ' + req.status + ' ' + req.statusText;\n console$1.error(error);\n if (callback) {\n if (verbose_mode) {\n callback({status: 0, error: error});\n } else {\n callback(0);\n }\n }\n }\n }\n };\n req.send(null);\n } catch (e) {\n console$1.error(e);\n }\n } else {\n var script = document.createElement('script');\n script.type = 'text/javascript';\n script.async = true;\n script.defer = true;\n script.src = url;\n var s = document.getElementsByTagName('script')[0];\n s.parentNode.insertBefore(script, s);\n }\n};\n\n/**\n * _execute_array() deals with processing any mixpanel function\n * calls that were called before the Mixpanel library were loaded\n * (and are thus stored in an array so they can be called later)\n *\n * Note: we fire off all the mixpanel function calls && user defined\n * functions BEFORE we fire off mixpanel tracking calls. This is so\n * identify/register/set_config calls can properly modify early\n * tracking calls.\n *\n * @param {Array} array\n */\nMixpanelLib.prototype._execute_array = function(array) {\n var fn_name, alias_calls = [], other_calls = [], tracking_calls = [];\n _.each(array, function(item) {\n if (item) {\n fn_name = item[0];\n if (typeof(item) === 'function') {\n item.call(this);\n } else if (_.isArray(item) && fn_name === 'alias') {\n alias_calls.push(item);\n } else if (_.isArray(item) && fn_name.indexOf('track') !== -1 && typeof(this[fn_name]) === 'function') {\n tracking_calls.push(item);\n } else {\n other_calls.push(item);\n }\n }\n }, this);\n\n var execute = function(calls, context) {\n _.each(calls, function(item) {\n this[item[0]].apply(this, item.slice(1));\n }, context);\n };\n\n execute(alias_calls, this);\n execute(other_calls, this);\n execute(tracking_calls, this);\n};\n\n/**\n * push() keeps the standard async-array-push\n * behavior around after the lib is loaded.\n * This is only useful for external integrations that\n * do not wish to rely on our convenience methods\n * (created in the snippet).\n *\n * ### Usage:\n * mixpanel.push(['register', { a: 'b' }]);\n *\n * @param {Array} item A [function_name, args...] array to be executed\n */\nMixpanelLib.prototype.push = function(item) {\n this._execute_array([item]);\n};\n\n/**\n * Disable events on the Mixpanel object. If passed no arguments,\n * this function disables tracking of any event. If passed an\n * array of event names, those events will be disabled, but other\n * events will continue to be tracked.\n *\n * Note: this function does not stop other mixpanel functions from\n * firing, such as register() or people.set().\n *\n * @param {Array} [events] An array of event names to disable\n */\nMixpanelLib.prototype.disable = function(events) {\n if (typeof(events) === 'undefined') {\n this._flags.disable_all_events = true;\n } else {\n this.__disabled_events = this.__disabled_events.concat(events);\n }\n};\n\n/**\n * Track an event. This is the most important and\n * frequently used Mixpanel function.\n *\n * ### Usage:\n *\n * // track an event named 'Registered'\n * mixpanel.track('Registered', {'Gender': 'Male', 'Age': 21});\n *\n * To track link clicks or form submissions, see track_links() or track_forms().\n *\n * @param {String} event_name The name of the event. This can be anything the user does - 'Button Click', 'Sign Up', 'Item Purchased', etc.\n * @param {Object} [properties] A set of properties to include with the event you're sending. These describe the user who did the event or details about the event itself.\n * @param {Function} [callback] If provided, the callback function will be called after tracking the event.\n */\nMixpanelLib.prototype.track = function(event_name, properties, callback) {\n if (typeof(callback) !== 'function') {\n callback = function() {};\n }
3\n\n if (_.isUndefined(event_name)) {\n console$1.error('No event name provided to mixpanel.track');\n return;\n }\n\n if (this._event_is_disabled(event_name)) {\n callback(0);\n return;\n }\n\n // set defaults\n properties = properties || {};\n properties['token'] = this.get_config('token');\n\n // set $duration if time_event was previously called for this event\n var start_timestamp = this['persistence'].remove_event_timer(event_name);\n if (!_.isUndefined(start_timestamp)) {\n var duration_in_ms = new Date().getTime() - start_timestamp;\n properties['$duration'] = parseFloat((duration_in_ms / 1000).toFixed(3));\n }\n\n // update persistence\n this['persistence'].update_search_keyword(document.referrer);\n\n if (this.get_config('store_google')) { this['persistence'].update_campaign_params(); }\n if (this.get_config('save_referrer')) { this['persistence'].update_referrer_info(document.referrer); }\n\n // note: extend writes to the first object, so lets make sure we\n // don't write to the persistence properties object and info\n // properties object by passing in a new object\n\n // update properties with pageview info and super-properties\n properties = _.extend(\n {},\n _.info.properties(),\n this['persistence'].properties(),\n properties\n );\n\n try {\n if (this.get_config('autotrack') && event_name !== 'mp_page_view' && event_name !== '$create_alias') {\n // The point of $__c is to count how many clicks occur per tracked event. Since we're\n // tracking an event in this function, we need to reset the $__c value.\n properties = _.extend({}, properties, this.mp_counts);\n this.mp_counts = {'$__c': 0};\n _.cookie.set('mp_' + this.get_config('name') + '__c', 0, 1, true);\n }\n } catch (e) {\n console$1.error(e);\n }\n\n var property_blacklist = this.get_config('property_blacklist');\n if (_.isArray(property_blacklist)) {\n _.each(property_blacklist, function(blacklisted_prop) {\n delete properties[blacklisted_prop];\n });\n } else {\n console$1.error('Invalid value for property_blacklist config: ' + property_blacklist);\n }\n\n var data = {\n 'event': event_name,\n 'properties': properties\n };\n\n var truncated_data = _.truncate(data, 255);\n var json_data = _.JSONEncode(truncated_data);\n var encoded_data = _.base64Encode(json_data);\n\n console$1.log('MIXPANEL REQUEST:');\n console$1.log(truncated_data);\n\n this._send_request(\n this.get_config('api_host') + '/track/',\n { 'data': encoded_data },\n this._prepare_callback(callback, truncated_data)\n );\n\n return truncated_data;\n};\n\n/**\n * Track a page view event, which is currently ignored by the server.\n * This function is called by default on page load unless the\n * track_pageview configuration variable is false.\n *\n * @param {String} [page] The url of the page to record. If you don't include this, it defaults to the current url.\n * @api private\n */\nMixpanelLib.prototype.track_pageview = function(page) {\n if (_.isUndefined(page)) {\n page = document.location.href;\n }\n this.track('mp_page_view', _.info.pageviewInfo(page));\n};\n\n/**\n * Track clicks on a set of document elements. Selector must be a\n * valid query. Elements must exist on the page at the time track_links is called.\n *\n * ### Usage:\n *\n * // track click for link id #nav\n * mixpanel.track_links('#nav', 'Clicked Nav Link');\n *\n * ### Notes:\n *\n * This function will wait up to 300 ms for the Mixpanel\n * servers to respond. If they have not responded by that time\n * it will head to the link without ensuring that your event\n * has been tracked. To configure this timeout please see the\n * set_config() documentation below.\n *\n * If you pass a function in as the properties argument, the\n * function will receive the DOMElement that triggered the\n * event as an argument. You are expected to return an object\n * from the function; any properties defined on this object\n * will be sent to mixpanel as event properties.\n *\n * @type {Function}\n * @param {Object|String} query A valid DOM query, element or jQuery-esque list\n * @param {String} event_name The name of the event to track\n * @param {Object|Function} [properties] A properties object or function that returns a dictionary of properties when passed a DOMElement\n */\nMixpanelLib.prototype.track_links = function() {\
3n return this._track_dom.call(this, LinkTracker, arguments);\n};\n\n/**\n * Track form submissions. Selector must be a valid query.\n *\n * ### Usage:\n *\n * // track submission for form id 'register'\n * mixpanel.track_forms('#register', 'Created Account');\n *\n * ### Notes:\n *\n * This function will wait up to 300 ms for the mixpanel\n * servers to respond, if they have not responded by that time\n * it will head to the link without ensuring that your event\n * has been tracked. To configure this timeout please see the\n * set_config() documentation below.\n *\n * If you pass a function in as the properties argument, the\n * function will receive the DOMElement that triggered the\n * event as an argument. You are expected to return an object\n * from the function; any properties defined on this object\n * will be sent to mixpanel as event properties.\n *\n * @type {Function}\n * @param {Object|String} query A valid DOM query, element or jQuery-esque list\n * @param {String} event_name The name of the event to track\n * @param {Object|Function} [properties] This can be a set of properties, or a function that returns a set of properties after being passed a DOMElement\n */\nMixpanelLib.prototype.track_forms = function() {\n return this._track_dom.call(this, FormTracker, arguments);\n};\n\n/**\n * Time an event by including the time between this call and a\n * later 'track' call for the same event in the properties sent\n * with the event.\n *\n * ### Usage:\n *\n * // time an event named 'Registered'\n * mixpanel.time_event('Registered');\n * mixpanel.track('Registered', {'Gender': 'Male', 'Age': 21});\n *\n * When called for a particular event name, the next track call for that event\n * name will include the elapsed time between the 'time_event' and 'track'\n * calls. This value is stored as seconds in the '$duration' property.\n *\n * @param {String} event_name The name of the event.\n */\nMixpanelLib.prototype.time_event = function(event_name) {\n if (_.isUndefined(event_name)) {\n console$1.error('No event name provided to mixpanel.time_event');\n return;\n }\n\n if (this._event_is_disabled(event_name)) {\n return;\n }\n\n this['persistence'].set_event_timer(event_name, new Date().getTime());\n};\n\n/**\n * Register a set of super properties, which are included with all\n * events. This will overwrite previous super property values.\n *\n * ### Usage:\n *\n * // register 'Gender' as a super property\n * mixpanel.register({'Gender': 'Female'});\n *\n * // register several super properties when a user signs up\n * mixpanel.register({\n * 'Email': '[email protected]',\n * 'Account Type': 'Free'\n * });\n *\n * @param {Object} properties An associative array of properties to store about the user\n * @param {Number} [days] How many days since the user's last visit to store the super properties\n */\nMixpanelLib.prototype.register = function(props, days) {\n this['persistence'].register(props, days);\n};\n\n/**\n * Register a set of super properties only once. This will not\n * overwrite previous super property values, unlike register().\n *\n * ### Usage:\n *\n * // register a super property for the first time only\n * mixpanel.register_once({\n * 'First Login Date': new Date().toISOString()\n * });\n *\n * ### Notes:\n *\n * If default_value is specified, current super properties\n * with that value will be overwritten.\n *\n * @param {Object} properties An associative array of properties to store about the user\n * @param {*} [default_value] Value to override if already set in super properties (ex: 'False') Default: 'None'\n * @param {Number} [days] How many days since the users last visit to store the super properties\n */\nMixpanelLib.prototype.register_once = function(props, default_value, days) {\n this['persistence'].register_once(props, default_value, days);\n};\n\n/**\n * Delete a super property stored with the current user.\n *\n * @param {String} property The name of the super property to remove\n */\nMixpanelLib.prototype.unregister = function(property) {\n this['persistence'].unregister(property);\n};\n\nMixpanelLib.prototype._register_single = function(prop, value) {\n var props = {};\n props[prop] = value;\n this.register(props);\n};\n\n/**\n * Identify a user with a unique ID. All subsequent\n * actions caused by this user will be tied to this unique ID. This\n * property is used to track unique visitors. If the method is\n * never called, then unique visitors will be identified by a UUID\n * generated the first time they visit the site.\n *\n * ### Notes:\n *\n * You can call this function to overwrite a previously set\n * unique ID for the current user. Mixpanel cannot translate\n * between IDs at this time, so when you change a user's ID\n * they will appear to be a new user.\n *\n * identify() should not be called to link anonymous activity to\n * subsequent activity when a unique ID is first assigned.\n * Use alias() when a unique ID is first assigned (registration), and\n * use identify() to identify the user with that unique ID on an ongoing\n * basis (e.g., each time a user logs in after registering).\n * Do not call identify() at the same time as alias().\n *\n * @param {String} [unique_id] A string that uniquely identifies a user. If not provided, the distinct_id currently in the persistent store (cookie or localStorage) will be used.\n */\nMixpanelLib.prototype.identify = function(unique_id, _set_callback, _add_callback, _append_callback, _set_once_callback, _union_callback) {\n // Optional Parameters\n // _set_callback:function A c
3allback to be run if and when the People set queue is flushed\n // _add_callback:function A callback to be run if and when the People add queue is flushed\n // _append_callback:function A callback to be run if and when the People append queue is flushed\n // _set_once_callback:function A callback to be run if and when the People set_once queue is flushed\n // _union_callback:function A callback to be run if and when the People union queue is flushed\n\n // identify only changes the distinct id if it doesn't match either the existing or the alias;\n // if it's new, blow away the alias as well.\n if (unique_id !== this.get_distinct_id() && unique_id !== this.get_property(ALIAS_ID_KEY)) {\n this.unregister(ALIAS_ID_KEY);\n this._register_single('distinct_id', unique_id);\n }\n this._check_and_handle_notifications(this.get_distinct_id());\n this._flags.identify_called = true;\n // Flush any queued up people requests\n this['people']._flush(_set_callback, _add_callback, _append_callback, _set_once_callback, _union_callback);\n};\n\n/**\n * Clears super properties and generates a new random distinct_id for this instance.\n * Useful for clearing data when a user logs out.\n */\nMixpanelLib.prototype.reset = function() {\n this['persistence'].clear();\n this._flags.identify_called = false;\n this.register_once({'distinct_id': _.UUID()}, '');\n};\n\n/**\n * Returns the current distinct id of the user. This is either the id automatically\n * generated by the library or the id that has been passed by a call to identify().\n *\n * ### Notes:\n *\n * get_distinct_id() can only be called after the Mixpanel library has finished loading.\n * init() has a loaded function available to handle this automatically. For example:\n *\n * // set distinct_id after the mixpanel library has loaded\n * mixpanel.init('YOUR PROJECT TOKEN', {\n * loaded: function(mixpanel) {\n * distinct_id = mixpanel.get_distinct_id();\n * }\n * });\n */\nMixpanelLib.prototype.get_distinct_id = function() {\n return this.get_property('distinct_id');\n};\n\n/**\n * Create an alias, which Mixpanel will use to link two distinct_ids going forward (not retroactively).\n * Multiple aliases can map to the same original ID, but not vice-versa. Aliases can also be chained - the\n * following is a valid scenario:\n *\n * mixpanel.alias('new_id', 'existing_id');\n * ...\n * mixpanel.alias('newer_id', 'new_id');\n *\n * If the original ID is not passed in, we will use the current distinct_id - probably the auto-generated GUID.\n *\n * ### Notes:\n *\n * The best practice is to call alias() when a unique ID is first created for a user\n * (e.g., when a user first registers for an account and provides an email address).\n * alias() should never be called more than once for a given user, except to\n * chain a newer ID to a previously new ID, as described above.\n *\n * @param {String} alias A unique identifier that you want to use for this user in the future.\n * @param {String} [original] The current identifier being used for this user.\n */\nMixpanelLib.prototype.alias = function(alias, original) {\n // If the $people_distinct_id key exists in persistence, there has been a previous\n // mixpanel.people.identify() call made for this user. It is VERY BAD to make an alias with\n // this ID, as it will duplicate users.\n if (alias === this.get_property(PEOPLE_DISTINCT_ID_KEY)) {\n console$1.critical('Attempting to create alias for existing People user - aborting.');\n return -2;\n }\n\n var _this = this;\n if (_.isUndefined(original)) {\n original = this.get_distinct_id();\n }\n if (alias !== original) {\n this._register_single(ALIAS_ID_KEY, alias);\n return this.track('$create_alias', { 'alias': alias, 'distinct_id': original }, function() {\n // Flush the people queue\n _this.identify(alias);\n });\n } else {\n console$1.error('alias matches current distinct_id - skipping api call.');\n this.identify(alias);\n return -1;\n }\n};
3\n\n/**\n * Provide a string to recognize the user by. The string passed to\n * this method will appear in the Mixpanel Streams product rather\n * than an automatically generated name. Name tags do not have to\n * be unique.\n *\n * This value will only be included in Streams data.\n *\n * @param {String} name_tag A human readable name for the user\n * @api private\n */\nMixpanelLib.prototype.name_tag = function(name_tag) {\n this._register_single('mp_name_tag', name_tag);\n};\n\n/**\n * Update the configuration of a mixpanel library instance.\n *\n * The default config is:\n *\n * {\n * // super properties cookie expiration (in days)\n * cookie_expiration: 365\n *\n * // super properties span subdomains\n * cross_subdomain_cookie: true\n *\n * // if this is true, the mixpanel cookie or localStorage entry\n * // will be deleted, and no user persistence will take place\n * disable_persistence: false\n *\n * // type of persistent store for super properties (cookie/\n * // localStorage) if set to 'localStorage', any existing\n * // mixpanel cookie value with the same persistence_name\n * // will be transferred to localStorage and deleted\n * persistence: 'cookie'\n *\n * // name for super properties persistent store\n * persistence_name: ''\n *\n * // names of properties/superproperties which should never\n * // be sent with track() calls\n * property_blacklist: []\n *\n * // if this is true, mixpanel cookies will be marked as\n * // secure, meaning they will only be transmitted over https\n * secure_cookie: false\n *\n * // the amount of time track_links will\n * // wait for Mixpanel's servers to respond\n * track_links_timeout: 300\n *\n * // should we track a page view on page load\n * track_pageview: true\n *\n * // if you set upgrade to be true, the library will check for\n * // a cookie from our old js library and import super\n * // properties from it, then the old cookie is deleted\n * // The upgrade config option only works in the initialization,\n * // so make sure you set it when you create the library.\n * upgrade: false\n * }\n *\n *\n * @param {Object} config A dictionary of new configuration values to update\n */\nMixpanelLib.prototype.set_config = function(config) {\n if (_.isObject(config)) {\n _.extend(this['config'], config);\n\n if (!this.get_config('persistence_name')) {\n this['config']['persistence_name'] = this['config']['cookie_name'];\n }\n if (!this.get_config('disable_persistence')) {\n this['config']['disable_persistence'] = this['config']['disable_cookie'];\n }\n\n if (this['persistence']) {\n this['persistence'].update_config(this['config']);\n }\n Config.DEBUG = Config.DEBUG || this.get_config('debug');\n }\n};\n\n/**\n * returns the current config object for the library.\n */\nMixpanelLib.prototype.get_config = function(prop_name) {\n return this['config'][prop_name];\n};\n\n/**\n * Returns the value of the super property named property_name. If no such\n * property is set, get_property() will return the undefined value.\n *\n * ### Notes:\n *\n * get_property() can only be called after the Mixpanel library has finished loading.\n * init() has a loaded function available to handle this automatically. For example:\n *\n * // grab value for 'user_id' after the mixpanel library has loaded\n * mixpanel.init('YOUR PROJECT TOKEN', {\n * loaded: function(mixpanel) {\n * user_id = mixpanel.get_property('user_id');\n * }\n * });\n *\n * @param {String} property_name The name of the super property you want to retrieve\n */\nMixpanelLib.prototype.get_property = function(property_name) {\n return this['persistence']['props'][property_name];\n};
3\n\nMixpanelLib.prototype.toString = function() {\n var name = this.get_config('name');\n if (name !== PRIMARY_INSTANCE_NAME) {\n name = PRIMARY_INSTANCE_NAME + '.' + name;\n }\n return name;\n};\n\nMixpanelLib.prototype._event_is_disabled = function(event_name) {\n return _.isBlockedUA(userAgent) ||\n this._flags.disable_all_events ||\n _.include(this.__disabled_events, event_name);\n};\n\nMixpanelLib.prototype._check_and_handle_notifications = function(distinct_id) {\n if (!distinct_id || this._flags.identify_called || this.get_config('disable_notifications')) {\n return;\n }\n\n console$1.log('MIXPANEL NOTIFICATION CHECK');\n\n var data = {\n 'verbose': true,\n 'version': '2',\n 'lib': 'web',\n 'token': this.get_config('token'),\n 'distinct_id': distinct_id\n };\n var self = this;\n this._send_request(\n this.get_config('decide_host') + '/decide/',\n data,\n this._prepare_callback(function(r) {\n if (r['notifications'] && r['notifications'].length > 0) {\n self._show_notification.call(self, r['notifications'][0]);\n }\n })\n );\n};\n\nMixpanelLib.prototype._show_notification = function(notification_data) {\n var notification = new MPNotif(notification_data, this);\n notification.show();\n};\n\nMixpanelPeople.prototype._init = function(mixpanel_instance) {\n this._mixpanel = mixpanel_instance;\n};\n\n/*\n * Set properties on a user record.\n *\n * ### Usage:\n *\n * mixpanel.people.set('gender', 'm');\n *\n * // or set multiple properties at once\n * mixpanel.people.set({\n * 'Company': 'Acme',\n * 'Plan': 'Premium',\n * 'Upgrade date': new Date()\n * });\n * // properties can be strings, integers, dates, or lists\n *\n * @param {Object|String} prop If a string, this is the name of the property. If an object, this is an associative array of names and values.\n * @param {*} [to] A value to set on the given property name\n * @param {Function} [callback] If provided, the callback will be called after the tracking event\n */\nMixpanelPeople.prototype.set = function(prop, to, callback) {\n var data = {};\n var $set = {};\n if (_.isObject(prop)) {\n _.each(prop, function(v, k) {\n if (!this._is_reserved_property(k)) {\n $set[k] = v;\n }\n }, this);\n callback = to;\n } else {\n $set[prop] = to;\n }\n\n // make sure that the referrer info has been updated and saved\n if (this._get_config('save_referrer')) {\n this._mixpanel['persistence'].update_referrer_info(document.referrer);\n }\n\n // update $set object with default people properties\n $set = _.extend(\n {},\n _.info.people_properties(),\n this._mixpanel['persistence'].get_referrer_info(),\n $set\n );\n\n data[SET_ACTION] = $set;\n\n return this._send_request(data, callback);\n};\n\n/*\n * Set properties on a user record, only if they do not yet exist.\n * This will not overwrite previous people property values, unlike\n * people.set().\n *\n * ### Usage:\n *\n * mixpanel.people.set_once('First Login Date', new Date());\n *\n * // or set multiple properties at once\n * mixpanel.people.set_once({\n * 'First Login Date': new Date(),\n * 'Starting Plan': 'Premium'\n * });\n *\n * // properties can be strings, integers or dates\n *\n * @param {Object|String} prop If a string, this is the name of the property. If an object, this is an associative array of names and values.\n * @param {*} [to] A value to set on the given property name\n * @param {Function} [callback] If provided, the callback will be called after the tracking event\n */\nMixpanelPeople.prototype.set_once = function(prop, to, callback) {\n var data = {};\n var $set_once = {};\n if (_.isObject(prop)) {\n _.each(prop, function(v, k) {\n if (!this._is_reserved_property(k)) {\n $set_once[k] = v;\n }\n }, this);\n callback = to;\n } else {\n $set_once[prop] = to;\n }\n data[SET_ONCE_ACTION] = $set_once;\n return this._send_request(data, callback);\n};\n\n/*\n * Increment/decrement numeric people analytics properties.\n *\n * ### Usage:\n *\n * mixpanel.people.increment('page_views', 1);\n *\n * // or, for convenience, if you're just incrementing a counter by\n * // 1, you can simply do\n * mixpanel.people.increment('page_views');\n *\n * // to decrement a counter, pass a negative number\n * mixpanel.people.increment('credits_left', -1);\n *\n * // like mixpanel.people.set(), you can increment multiple\n * // properties at once:\n * mixpanel.people.increment({\n * counter1: 1,\n * counter2: 6\n * });\n *\n * @param {Object|String} prop If a string, this is the name of the property. If an object, this is an associative array of names and numeric values.\
3n * @param {Number} [by] An amount to increment the given property\n * @param {Function} [callback] If provided, the callback will be called after the tracking event\n */\nMixpanelPeople.prototype.increment = function(prop, by, callback) {\n var data = {};\n var $add = {};\n if (_.isObject(prop)) {\n _.each(prop, function(v, k) {\n if (!this._is_reserved_property(k)) {\n if (isNaN(parseFloat(v))) {\n console$1.error('Invalid increment value passed to mixpanel.people.increment - must be a number');\n return;\n } else {\n $add[k] = v;\n }\n }\n }, this);\n callback = by;\n } else {\n // convenience: mixpanel.people.increment('property'); will\n // increment 'property' by 1\n if (_.isUndefined(by)) {\n by = 1;\n }\n $add[prop] = by;\n }\n data[ADD_ACTION] = $add;\n\n return this._send_request(data, callback);\n};\n\n/*\n * Append a value to a list-valued people analytics property.\n *\n * ### Usage:\n *\n * // append a value to a list, creating it if needed\n * mixpanel.people.append('pages_visited', 'homepage');\n *\n * // like mixpanel.people.set(), you can append multiple\n * // properties at once:\n * mixpanel.people.append({\n * list1: 'bob',\n * list2: 123\n * });\n *\n * @param {Object|String} prop If a string, this is the name of the property. If an object, this is an associative array of names and values.\n * @param {*} [value] An item to append to the list\n * @param {Function} [callback] If provided, the callback will be called after the tracking event\n */\nMixpanelPeople.prototype.append = function(list_name, value, callback) {\n var data = {};\n var $append = {};\n if (_.isObject(list_name)) {\n _.each(list_name, function(v, k) {\n if (!this._is_reserved_property(k)) {\n $append[k] = v;\n }\n }, this);\n callback = value;\n } else {\n $append[list_name] = value;\n }\n data[APPEND_ACTION] = $append;\n\n return this._send_request(data, callback);\n};\n\n/*\n * Merge a given list with a list-valued people analytics property,\n * excluding duplicate values.\
3n *\n * ### Usage:\n *\n * // merge a value to a list, creating it if needed\n * mixpanel.people.union('pages_visited', 'homepage');\n *\n * // like mixpanel.people.set(), you can append multiple\n * // properties at once:\n * mixpanel.people.union({\n * list1: 'bob',\n * list2: 123\n * });\n *\n * // like mixpanel.people.append(), you can append multiple\n * // values to the same list:\n * mixpanel.people.union({\n * list1: ['bob', 'billy']\n * });\n *\n * @param {Object|String} prop If a string, this is the name of the property. If an object, this is an associative array of names and values.\n * @param {*} [value] Value / values to merge with the given property\n * @param {Function} [callback] If provided, the callback will be called after the tracking event\n */\nMixpanelPeople.prototype.union = function(list_name, values, callback) {\n var data = {};\n var $union = {};\n if (_.isObject(list_name)) {\n _.each(list_name, function(v, k) {\n if (!this._is_reserved_property(k)) {\n $union[k] = _.isArray(v) ? v : [v];\n }\n }, this);\n callback = values;\n } else {\n $union[list_name] = _.isArray(values) ? values : [values];\n }\n data[UNION_ACTION] = $union;\n\n return this._send_request(data, callback);\n};\n\n/*\n * Record that you have charged the current user a certain amount\n * of money. Charges recorded with track_charge() will appear in the\n * Mixpanel revenue report.\n *\n * ### Usage:\n *\n * // charge a user $50\n * mixpanel.people.track_charge(50);\n *\n * // charge a user $30.50 on the 2nd of january\n * mixpanel.people.track_charge(30.50, {\n * '$time': new Date('jan 1 2012')\n * });\n *\n * @param {Number} amount The amount of money charged to the current user\n * @param {Object} [properties] An associative array of properties associated with the charge\n * @param {Function} [callback] If provided, the callback will be called when the server responds\n */\nMixpanelPeople.prototype.track_charge = function(amount, properties, callback) {\n if (!_.isNumber(amount)) {\n amount = parseFloat(amount);\n if (isNaN(amount)) {\n console$1.error('Invalid value passed to mixpanel.people.track_charge - must be a number');\n return;\n }\n }\n\n return this.append('$transactions', _.extend({\n '$amount': amount\n }, properties), callback);\n};\n\n/*\n * Permanently clear all revenue report transactions from the\n * current user's people analytics profile.\n *\n * ### Usage:\n *\n * mixpanel.people.clear_charges();\n *\n * @param {Function} [callback] If provided, the callback will be called after the tracking event\n */\nMixpanelPeople.prototype.clear_charges = function(callback) {\n return this.set('$transactions', [], callback);\n};\n\n/*\n * Permanently deletes the current people analytics profile from\n * Mixpanel (using the current distinct_id).\n *\n * ### Usage:\n *\n * // remove the all data you have stored about the current user\n * mixpanel.people.delete_user();\n *\n */\nMixpanelPeople.prototype.delete_user = function() {\n if (!this._identify_called()) {\n console$1.error('mixpanel.people.delete_user() requires you to call identify() first');\n return;\n }\n var data = {'$delete': this._mixpanel.get_distinct_id()};\n return this._send_request(data);\n};\n\nMixpanelPeople.prototype.toString = function() {\n return this._mixpanel.toString() + '.people';\n};\n\nMixpanelPeople.prototype._send_request = function(data, callback) {\n data['$token'] = this._get_config('token');\n data['$distinct_id'] = this._mixpanel.get_distinct_id();\n\n var date_encoded_data = _.encodeDates(data);\n var truncated_data = _.truncate(date_encoded_data, 255);\n var json_data = _.JSONEncode(date_encoded_data);\n var encoded_data = _.base64Encode(json_data);\n\n if (!this._identify_called()) {\n this._enqueue(data);\n if (!_.isUndefined(callback)) {\n if (this._get_config('verbose')) {\n callback({status: -1, error: null});\n } else {\n callback(-1);\n }\n }\n return truncated_data;\n }\n\n console$1.log('MIXPANEL PEOPLE REQUEST:');\n console$1.log(truncated_data);\n\n this._mixpanel._send_request(\n this._get_config('api_host') + '/engage/',\n {'data': encoded_data},\n this._mixpanel._prepare_callback(callback, truncated_data)\n );\n\n return truncated_data;\n};\n\nMixpanelPeople.prototype._get_config = function(conf_var) {\n return this._mixpanel.get_config(conf_var);\n};
3\n\nMixpanelPeople.prototype._identify_called = function() {\n return this._mixpanel._flags.identify_called === true;\n};\n\n// Queue up engage operations if identify hasn't been called yet.\nMixpanelPeople.prototype._enqueue = function(data) {\n if (SET_ACTION in data) {\n this._mixpanel['persistence']._add_to_people_queue(SET_ACTION, data);\n } else if (SET_ONCE_ACTION in data) {\n this._mixpanel['persistence']._add_to_people_queue(SET_ONCE_ACTION, data);\n } else if (ADD_ACTION in data) {\n this._mixpanel['persistence']._add_to_people_queue(ADD_ACTION, data);\n } else if (APPEND_ACTION in data) {\n this._mixpanel['persistence']._add_to_people_queue(APPEND_ACTION, data);\n } else if (UNION_ACTION in data) {\n this._mixpanel['persistence']._add_to_people_queue(UNION_ACTION, data);\n } else {\n console$1.error('Invalid call to _enqueue():', data);\n }\n};\n\n// Flush queued engage operations - order does not matter,\n// and there are network level race conditions anyway\nMixpanelPeople.prototype._flush = function(_set_callback, _add_callback, _append_callback, _set_once_callback, _union_callback) {\n var _this = this;\n var $set_queue = _.extend({}, this._mixpanel['persistence']._get_queue(SET_ACTION));\n var $set_once_queue = _.extend({}, this._mixpanel['persistence']._get_queue(SET_ONCE_ACTION));\n var $add_queue = _.extend({}, this._mixpanel['persistence']._get_queue(ADD_ACTION));\n var $append_queue = this._mixpanel['persistence']._get_queue(APPEND_ACTION);\n var $union_queue = _.extend({}, this._mixpanel['persistence']._get_queue(UNION_ACTION));\n\n if (!_.isUndefined($set_queue) && _.isObject($set_queue) && !_.isEmptyObject($set_queue)) {\n _this._mixpanel['persistence']._pop_from_people_queue(SET_ACTION, $set_queue);\n this.set($set_queue, function(response, data) {\n // on bad response, we want to add it back to the queue\n if (response === 0) {\n _this._mixpanel['persistence']._add_to_people_queue(SET_ACTION, $set_queue);\n }\n if (!_.isUndefined(_set_callback)) {\n _set_callback(response, data);\n }\n });\n }\n\n if (!_.isUndefined($set_once_queue) && _.isObject($set_once_queue) && !_.isEmptyObject($set_once_queue)) {\n _this._mixpanel['persistence']._pop_from_people_queue(SET_ONCE_ACTION, $set_once_queue);\n this.set_once($set_once_queue, function(response, data) {\n // on bad response, we want to add it back to the queue\n if (response === 0) {\n _this._mixpanel['persistence']._add_to_people_queue(SET_ONCE_ACTION, $set_once_queue);\n }\n if (!_.isUndefined(_set_once_callback)) {\n _set_once_callback(response, data);\n }\n });\n }\n\n if (!_.isUndefined($add_queue) && _.isObject($add_queue) && !_.isEmptyObject($add_queue)) {\n _this._mixpanel['persistence']._pop_from_people_queue(ADD_ACTION, $add_queue);\n this.increment($add_queue, function(response, data) {\n // on bad response, we want to add it back to the queue\n if (response === 0) {\n _this._mixpanel['persistence']._add_to_people_queue(ADD_ACTION, $add_queue);\n }\n if (!_.isUndefined(_add_callback)) {\n _add_callback(response, data);\n }\n });\n }\n\n if (!_.isUndefined($union_queue) && _.isObject($union_queue) && !_.isEmptyObject($union_queue)) {\n _this._mixpanel['persistence']._pop_from_people_queue(UNION_ACTION, $union_queue);\n this.union($union_queue, function(response, data) {\n // on bad response, we want to add it back to the queue\n if (response === 0) {\n _this._mixpanel['persistence']._add_to_people_queue(UNION_ACTION, $union_queue);\n }\n if (!_.isUndefined(_union_callback)) {\n _union_callback(response, data);\n }\n });\n }\n\n // we have to fire off each $append individually since there is\n // no concat method server side\n if (!_.isUndefined($append_queue) && _.isArray($append_queue) && $append_queue.length) {\n var $append_item;\n var callback = function(response, data) {\n if (response === 0) {\n _this._mixpanel['persistence']._add_to_people_queue(APPEND_ACTION, $append_item);\n }\n if (!_.isUndefined(_append_callback)) {\n _append_callback(response, data);\n }\n };\n for (var i = $append_queue.length - 1; i >= 0; i--) {\n $append_item = $append_queue.pop();\n _this.append($append_item, callback);\n }\n // Save the shortened append queue\n _this._mixpanel['persistence'].save();\n }\n};\n\nMixpanelPeople.prototype._is_reserved_property = function(prop) {\n return prop === '$distinct_id' || prop === '$token';\n};
3\n\n\n// Internal class for notification display\nMixpanelLib._Notification = function(notif_data, mixpanel_instance) {\n _.bind_instance_methods(this);\n\n this.mixpanel = mixpanel_instance;\n this.persistence = this.mixpanel['persistence'];\n\n this.campaign_id = _.escapeHTML(notif_data['id']);\n this.message_id = _.escapeHTML(notif_data['message_id']);\n\n this.body = (_.escapeHTML(notif_data['body']) || '').replace(/\\n/g, '<br/>');\n this.cta = _.escapeHTML(notif_data['cta']) || 'Close';\n this.notif_type = _.escapeHTML(notif_data['type']) || 'takeover';\n this.style = _.escapeHTML(notif_data['style']) || 'light';\n this.title = _.escapeHTML(notif_data['title']) || '';\n this.video_width = MPNotif.VIDEO_WIDTH;\n this.video_height = MPNotif.VIDEO_HEIGHT;\n\n // These fields are url-sanitized in the backend already.\n this.dest_url = notif_data['cta_url'] || null;\n this.image_url = notif_data['image_url'] || null;\n this.thumb_image_url = notif_data['thumb_image_url'] || null;\n this.video_url = notif_data['video_url'] || null;\n\n this.clickthrough = true;\n if (!this.dest_url) {\n this.dest_url = '#dismiss';\n this.clickthrough = false;\n }\n\n this.mini = this.notif_type === 'mini';\n if (!this.mini) {\n this.notif_type = 'takeover';\n }\n this.notif_width = !this.mini ? MPNotif.NOTIF_WIDTH : MPNotif.NOTIF_WIDTH_MINI;\n\n this._set_client_config();\n this.imgs_to_preload = this._init_image_html();\n this._init_video();\n};\n\nMPNotif = MixpanelLib._Notification;\n\nMPNotif.ANIM_TIME = 200;\nMPNotif.MARKUP_PREFIX = 'mixpanel-notification';\nMPNotif.BG_OPACITY = 0.6;\nMPNotif.NOTIF_TOP = 25;\nMPNotif.NOTIF_START_TOP = 200;\nMPNotif.NOTIF_WIDTH = 388;\nMPNotif.NOTIF_WIDTH_MINI = 420;\nMPNotif.NOTIF_HEIGHT_MINI = 85;\nMPNotif.THUMB_BORDER_SIZE = 5;\nMPNotif.THUMB_IMG_SIZE = 60;\nMPNotif.THUMB_OFFSET = Math.round(MPNotif.THUMB_IMG_SIZE / 2);\nMPNotif.VIDEO_WIDTH = 595;\nMPNotif.VIDEO_HEIGHT = 334;\n\nMPNotif.prototype.show = function() {\n var self = this;\n this._set_client_config();\n\n // don't display until HTML body exists\n if (!this.body_el) {\n setTimeout(function() { self.show(); }, 300);\n return;\n }\n\n this._init_styles();\n this._init_notification_el();\n\n // wait for any images to load before showing notification\n this._preload_images(this._attach_and_animate);\n};\n\nMPNotif.prototype.dismiss = _.safewrap(function() {\n if (!this.marked_as_shown) {\n // unexpected condition: user interacted with notif even though we didn't consider it\n // visible (see _mark_as_shown()); send tracking signals to mark delivery\n this._mark_delivery({'invisible': true});\n }\n\n var exiting_el = this.showing_video ? this._get_el('video') : this._get_notification_display_el();\n if (this.use_transitions) {\n this._remove_class('bg', 'visible');\n this._add_class(exiting_el, 'exiting');\n setTimeout(this._remove_notification_el, MPNotif.ANIM_TIME);\n } else {\n var notif_attr, notif_start, notif_goal;\n if (this.mini) {\n notif_attr = 'right';\n notif_start = 20;\n notif_goal = -100;\n } else {\n notif_attr = 'top';\n notif_start = MPNotif.NOTIF_TOP;\n notif_goal = MPNotif.NOTIF_START_TOP + MPNotif.NOTIF_TOP;\n }\n this._animate_els([\n {\n el: this._get_el('bg'),\n attr: 'opacity',\n start: MPNotif.BG_OPACITY,\n goal: 0.0\n },\n {\n el: exiting_el,\n attr: 'opacity',\n start: 1.0,\n goal: 0.0\n },\n {\n el: exiting_el,\n attr: notif_attr,\n start: notif_start,\n goal: notif_goal\n }
3\n ], MPNotif.ANIM_TIME, this._remove_notification_el);\n }\n});\n\nMPNotif.prototype._add_class = _.safewrap(function(el, class_name) {\n class_name = MPNotif.MARKUP_PREFIX + '-' + class_name;\n if (typeof el === 'string') {\n el = this._get_el(el);\n }\n if (!el.className) {\n el.className = class_name;\n } else if (!~(' ' + el.className + ' ').indexOf(' ' + class_name + ' ')) {\n el.className += ' ' + class_name;\n }\n});\nMPNotif.prototype._remove_class = _.safewrap(function(el, class_name) {\n class_name = MPNotif.MARKUP_PREFIX + '-' + class_name;\n if (typeof el === 'string') {\n el = this._get_el(el);\n }\n if (el.className) {\n el.className = (' ' + el.className + ' ')\n .replace(' ' + class_name + ' ', '')\n .replace(/^[\\s\\xA0]+/, '')\n .replace(/[\\s\\xA0]+$/, '');\n }\n});\n\nMPNotif.prototype._animate_els = _.safewrap(function(anims, mss, done_cb, start_time) {\n var self = this,\n in_progress = false,\n ai, anim,\n cur_time = 1 * new Date(), time_diff;\n\n start_time = start_time || cur_time;\n time_diff = cur_time - start_time;\n\n for (ai = 0; ai < anims.length; ai++) {\n anim = anims[ai];\n if (typeof anim.val === 'undefined') {\n anim.val = anim.start;\n }\n if (anim.val !== anim.goal) {\n in_progress = true;\n var anim_diff = anim.goal - anim.start,\n anim_dir = anim.goal >= anim.start ? 1 : -1;\n anim.val = anim.start + anim_diff * time_diff / mss;\n if (anim.attr !== 'opacity') {\n anim.val = Math.round(anim.val);\n }\n if ((anim_dir > 0 && anim.val >= anim.goal) || (anim_dir < 0 && anim.val <= anim.goal)) {\n anim.val = anim.goal;\n }\n }\n }\n if (!in_progress) {\n if (done_cb) {\n done_cb();\n }\n return;\n }\n\n for (ai = 0; ai < anims.length; ai++) {\n anim = anims[ai];\n if (anim.el) {\n var suffix = anim.attr === 'opacity' ? '' : 'px';\n anim.el.style[anim.attr] = String(anim.val) + suffix;\n }\n }\n setTimeout(function() { self._animate_els(anims, mss, done_cb, start_time); }, 10);\n});\n\nMPNotif.prototype._attach_and_animate = _.safewrap(function() {\n var self = this;\n\n // no possibility to double-display\n if (this.shown || this._get_shown_campaigns()[this.campaign_id]) {\n return;\n }\n this.shown = true;\n\n this.body_el.appendChild(this.notification_el);\n setTimeout(function() {\n var notif_el = self._get_notification_display_el();\n if (self.use_transitions) {\n if (!self.mini) {\n self._add_class('bg', 'visible');\n }\n self._add_class(notif_el, 'visible');\n self._mark_as_shown();\n } else {\n var notif_attr, notif_start, notif_goal;\n if (self.mini) {\n notif_attr = 'right';\n notif_start = -100;\n notif_goal = 20;\n } else {\n notif_attr = 'top';\n notif_start = MPNotif.NOTIF_START_TOP + MPNotif.NOTIF_TOP;\n notif_goal = MPNotif.NOTIF_TOP;\n }\n self._animate_els([\n {\n el: self._get_el('bg'),\n attr: 'opacity',\n start: 0.0,\n goal: MPNotif.BG_OPACITY\n },\n {\n el: notif_el,\n attr: 'opacity',\n start: 0.0,\n goal: 1.0\n },\n {\n el: notif_el,\n attr: notif_attr,\n start: notif_start,\n goal: notif_goal\n }\n ], MPNotif.ANIM_TIME, self._mark_as_shown);\n }\n }, 100);\n _.register_event(self._get_el('cancel'), 'click', function(e) {\n e.preventDefault();\n self.dismiss();\n });\n var click_el = self._get_el('button') ||\n self._get_el('mini-content');\n _.register_event(click_el, 'click', function(e) {\n e.preventDefault();\n if (self.show_video) {\n self._track_event('$campaign_open', {'$resource_type': 'video'});\n self._switch_to_video();\n } else {\n self.dismiss();
3\n if (self.clickthrough) {\n self._track_event('$campaign_open', {'$resource_type': 'link'}, function() {\n window.location.href = self.dest_url;\n });\n }\n }\n });\n});\n\nMPNotif.prototype._get_el = function(id) {\n return document.getElementById(MPNotif.MARKUP_PREFIX + '-' + id);\n};\n\nMPNotif.prototype._get_notification_display_el = function() {\n return this._get_el(this.notif_type);\n};\n\nMPNotif.prototype._get_shown_campaigns = function() {\n return this.persistence['props'][CAMPAIGN_IDS_KEY] || (this.persistence['props'][CAMPAIGN_IDS_KEY] = {});\n};\n\nMPNotif.prototype._browser_lte = function(browser, version) {\n return this.browser_versions[browser] && this.browser_versions[browser] <= version;\n};\n\nMPNotif.prototype._init_image_html = function() {\n var imgs_to_preload = [];\n\n if (!this.mini) {\n if (this.image_url) {\n imgs_to_preload.push(this.image_url);\n this.img_html = '<img id=\"img\" src=\"' + this.image_url + '\"/>';\n } else {\n this.img_html = '';\n }\n if (this.thumb_image_url) {\n imgs_to_preload.push(this.thumb_image_url);\n this.thumb_img_html =\n '<div id=\"thumbborder-wrapper\"><div id=\"thumbborder\"></div></div>' +\n '<img id=\"thumbnail\"' +\n ' src=\"' + this.thumb_image_url + '\"' +\n ' width=\"' + MPNotif.THUMB_IMG_SIZE + '\"' +\n ' height=\"' + MPNotif.THUMB_IMG_SIZE + '\"' +\n '/>' +\n '<div id=\"thumbspacer\"></div>';\n } else {\n this.thumb_img_html = '';\n }\n } else {\n this.thumb_image_url = this.thumb_image_url || '//cdn.mxpnl.com/site_media/images/icons/notifications/mini-news-dark.png';\n imgs_to_preload.push(this.thumb_image_url);\n }\n\n return imgs_to_preload;\n};\n\nMPNotif.prototype._init_notification_el = function() {\n var notification_html = '';\n var video_src = '';\n var video_html = '';\n var cancel_html = '<div id=\"cancel\">' +\n '<div id=\"cancel-icon\"></div>' +\n '</div>';\n\n this.notification_el = document.createElement('div');\n this.notification_el.id = MPNotif.MARKUP_PREFIX + '-wrapper';\n if (!this.mini) {\n // TAKEOVER notification\n var close_html = (this.clickthrough || this.show_video) ? '' : '<div id=\"button-close\"></div>',\n play_html = this.show_video ? '<div id=\"button-play\"></div>' : '';\n if (this._browser_lte('ie', 7)) {\n close_html = '';\n play_html = '';\n }\n notification_html =\n '<div id=\"takeover\">' +\n this.thumb_img_html +\n '<div id=\"mainbox\">' +\n cancel_html +\n '<div id=\"content\">' +\n this.img_html +\n '<div id=\"title\">' + this.title + '</div>' +\n '<div id=\"body\">' + this.body + '</div>' +\n '<div id=\"tagline\">' +\n '<a href=\"http://mixpanel.com?from=inapp\" target=\"_blank\">POWERED BY MIXPANEL</a>' +\n '</div>' +\n '</div>' +\n '<div id=\"button\">' +\n close_html +\n '<a id=\"button-link\" href=\"' + this.dest_url + '\">' + this.cta + '</a>' +\n play_html +\n '</div>' +\n '</div>' +\n '</div>';\n } else {\n // MINI notification\n notification_html =\n '<div id=\"mini\">' +\n '<div id=\"mainbox\">' +\n cancel_html +\n '<div id=\"mini-content\">
3' +\n '<div id=\"mini-icon\">' +\n '<div id=\"mini-icon-img\"></div>' +\n '</div>' +\n '<div id=\"body\">' +\n '<div id=\"body-text\"><div>' + this.body + '</div></div>' +\n '</div>' +\n '</div>' +\n '</div>' +\n '<div id=\"mini-border\"></div>' +\n '</div>';\n }\n if (this.youtube_video) {\n video_src = '//www.youtube.com/embed/' + this.youtube_video +\n '?wmode=transparent&showinfo=0&modestbranding=0&rel=0&autoplay=1&loop=0&vq=hd1080';\n if (this.yt_custom) {\n video_src += '&enablejsapi=1&html5=1&controls=0';\n video_html =\n '<div id=\"video-controls\">' +\n '<div id=\"video-progress\" class=\"video-progress-el\">' +\n '<div id=\"video-progress-total\" class=\"video-progress-el\"></div>' +\n '<div id=\"video-elapsed\" class=\"video-progress-el\"></div>' +\n '</div>' +\n '<div id=\"video-time\" class=\"video-progress-el\"></div>' +\n '</div>';\n }\n } else if (this.vimeo_video) {\n video_src = '//player.vimeo.com/video/' + this.vimeo_video + '?autoplay=1&title=0&byline=0&portrait=0';\n }\n if (this.show_video) {\n this.video_iframe =\n '<iframe id=\"' + MPNotif.MARKUP_PREFIX + '-video-frame\" ' +\n 'width=\"' + this.video_width + '\" height=\"' + this.video_height + '\" ' +\n ' src=\"' + video_src + '\"' +\n ' frameborder=\"0\" webkitallowfullscreen mozallowfullscreen allowfullscreen=\"1\" scrolling=\"no\"' +\n '></iframe>';\n video_html =\n '<div id=\"video-' + (this.flip_animate ? '' : 'no') + 'flip\">' +\n '<div id=\"video\">' +\n '<div id=\"video-holder\"></div>' +\n video_html +\n '</div>' +\n '</div>';\n }\n var main_html = video_html + notification_html;\n if (this.flip_animate) {\n main_html =\n (this.mini ? notification_html : '') +\n '<div id=\"flipcontainer\"><div id=\"flipper\">' +\n (this.mini ? video_html : main_html) +\n '</div></div>';\n }\n\n this.notification_el.innerHTML =\n ('<div id=\"overlay\" class=\"' + this.notif_type + '\">' +\n '<div id=\"campaignid-' + this.campaign_id + '\">' +\n '<div id=\"bgwrapper\">' +\n '<div id=\"bg\"></div>' +\n main_html +\n '</div>' +\n '</div>' +\n '</div>')\n .replace(/class=\\\"/g, 'class=\"' + MPNotif.MARKUP_PREFIX + '-')\n .replace(/id=\\\"/g, 'id=\"' + MPNotif.MARKUP_PREFIX + '-');\n};\n\nMPNotif.prototype._init_styles = function() {\n if (this.style === 'dark') {\n this.style_vals = {\n bg: '#1d1f25',\n bg_actions: '#282b32',\n bg_hover: '#3a4147',\n bg_light: '#4a5157',\n border_gray: '#32353c',\n cancel_opacity: '0.4',\n mini_hover: '#2a3137',\n text_title: '#fff',\n text_main: '#9498a3',\n text_tagline: '#464851',\n text_hover: '#ddd'\n };\n } else {\n this.style_vals = {\n bg: '#fff',\n bg_actions: '#e7eaee',\n bg_hover: '#eceff3',\n bg_light: '#f5f5f5',\n border_gray: '#e4ecf2',\n cancel_opacity: '1.0',\n mini_hover: '#fafafa',\n text_title: '#5c6578',\n text_main: '#8b949b',\n text_tagline: '#ced9e6',\n text_hover: '#7c8598'\n };\n }\n var shadow = '0px 0px 35px 0px rgba(45, 49, 56, 0.7)',\n video_shadow = shadow,\n mini_shadow = shadow,\n thumb_total_size = MPNotif.THUMB_IMG_SIZE + MPNotif.THUMB_BORDER_SIZE * 2,\n anim_seconds = (MPNotif.AN
3IM_TIME / 1000) + 's';\n if (this.mini) {\n shadow = 'none';\n }\n\n // don't display on small viewports\n var notif_media_queries = {},\n min_width = MPNotif.NOTIF_WIDTH_MINI + 20;\n notif_media_queries['@media only screen and (max-width: ' + (min_width - 1) + 'px)'] = {\n '#overlay': {\n 'display': 'none'\n }\n };\n var notif_styles = {\n '.flipped': {\n 'transform': 'rotateY(180deg)'\n },\n '#overlay': {\n 'position': 'fixed',\n 'top': '0',\n 'left': '0',\n 'width': '100%',\n 'height': '100%',\n 'overflow': 'auto',\n 'text-align': 'center',\n 'z-index': '10000',\n 'font-family': '\"Helvetica\", \"Arial\", sans-serif',\n '-webkit-font-smoothing': 'antialiased',\n '-moz-osx-font-smoothing': 'grayscale'\n },\n '#overlay.mini': {\n 'height': '0',\n 'overflow': 'visible'\n },\n '#overlay a': {\n 'width': 'initial',\n 'padding': '0',\n 'text-decoration': 'none',\n 'text-transform': 'none',\n 'color': 'inherit'\n },\n '#bgwrapper': {\n 'position': 'relative',\n 'width': '100%',\n 'height': '100%'\n },\n '#bg': {\n 'position': 'fixed',\n 'top': '0',\n 'left': '0',\n 'width': '100%',\n 'height': '100%',\n 'min-width': this.doc_width * 4 + 'px',\n 'min-height': this.doc_height * 4 + 'px',\n 'background-color': 'black',\n 'opacity': '0.0',\n '-ms-filter': 'progid:DXImageTransform.Microsoft.Alpha(Opacity=60)', // IE8\n 'filter': 'alpha(opacity=60)', // IE5-7\n 'transition': 'opacity ' + anim_seconds\n },\n '#bg.visible': {\n 'opacity': MPNotif.BG_OPACITY\n },\n '.mini #bg': {\n 'width': '0',\n 'height': '0',\n 'min-width': '0'\n },\n '#flipcontainer': {\n 'perspective': '1000px',\n 'position': 'absolute',\n 'width': '100%'\n },\n '#flipper': {\n 'position': 'relative',\n 'transform-style': 'preserve-3d',\n 'transition': '0.3s'\n },\n '#takeover': {\n 'position': 'absolute',\n 'left': '50%',\n 'width': MPNotif.NOTIF_WIDTH + 'px',\n 'margin-left': Math.round(-MPNotif.NOTIF_WIDTH / 2) + 'px',\n 'backface-visibility': 'hidden',\n 'transform': 'rotateY(0deg)',\n 'opacity': '0.0',\n 'top': MPNotif.NOTIF_START_TOP + 'px',\n 'transition': 'opacity ' + anim_seconds + ', top ' + anim_seconds\n },\n '#takeover.visible': {\n 'opacity': '1.0',\n 'top': MPNotif.NOTIF_TOP + 'px'\n },\n '#takeover.exiting': {\n 'opacity': '0.0',\n 'top': MPNotif.NOTIF_START_TOP + 'px'\n },\n '#thumbspacer': {\n 'height': MPNotif.THUMB_OFFSET + 'px'\n },\n '#thumbborder-wrapper': {\n 'position': 'absolute',\n 'top': (-MPNotif.THUMB_BORDER_SIZE) + 'px',\n 'left': (MPNotif.NOTIF_WIDTH / 2 - MPNotif.THUMB_OFFSET - MPNotif.THUMB_BORDER_SIZE) + 'px',\n 'width': thumb_total_size + 'px',\n 'height': (thumb_total_size / 2) + 'px',\n 'overflow': 'hidden'\n },\n '#thumbborder': {\n 'position': 'absolute',\n 'width': thumb_total_size + 'px',\n 'height': thumb_total_size + 'px',\n 'border-radius': thumb_total_size + 'px',\n 'background-color': this.style_vals.bg_actions,\n 'opacity': '0.5'\n },\n '#thumbnail': {\n 'position': 'absolute',\n 'top': '0px',\n 'left': (MPNotif.NOTIF_WIDTH / 2 - MPNotif.THUMB_OFFSET) + 'px',\n 'width': MPNotif.THUMB_IMG_SIZE + 'px',\n 'height': MPNotif.THUMB_IMG_SIZE + 'px',\n 'overflow': 'hidden',\n 'z-index': '100',\n 'border-radius': MPNotif.THUMB_IMG_SIZE + 'px'\n },\n '#mini': {\n 'position': 'absolute',\n 'right': '20p
3x',\n 'top': MPNotif.NOTIF_TOP + 'px',\n 'width': this.notif_width + 'px',\n 'height': MPNotif.NOTIF_HEIGHT_MINI * 2 + 'px',\n 'margin-top': 20 - MPNotif.NOTIF_HEIGHT_MINI + 'px',\n 'backface-visibility': 'hidden',\n 'opacity': '0.0',\n 'transform': 'rotateX(90deg)',\n 'transition': 'opacity 0.3s, transform 0.3s, right 0.3s'\n },\n '#mini.visible': {\n 'opacity': '1.0',\n 'transform': 'rotateX(0deg)'\n },\n '#mini.exiting': {\n 'opacity': '0.0',\n 'right': '-150px'\n },\n '#mainbox': {\n 'border-radius': '4px',\n 'box-shadow': shadow,\n 'text-align': 'center',\n 'background-color': this.style_vals.bg,\n 'font-size': '14px',\n 'color': this.style_vals.text_main\n },\n '#mini #mainbox': {\n 'height': MPNotif.NOTIF_HEIGHT_MINI + 'px',\n 'margin-top': MPNotif.NOTIF_HEIGHT_MINI + 'px',\n 'border-radius': '3px',\n 'transition': 'background-color ' + anim_seconds\n },\n '#mini-border': {\n 'height': (MPNotif.NOTIF_HEIGHT_MINI + 6) + 'px',\n 'width': (MPNotif.NOTIF_WIDTH_MINI + 6) + 'px',\n 'position': 'absolute',\n 'top': '-3px',\n 'left': '-3px',\n 'margin-top': MPNotif.NOTIF_HEIGHT_MINI + 'px',\n 'border-radius': '6px',\n 'opacity': '0.25',\n 'background-color': '#fff',\n 'z-index': '-1',\n 'box-shadow': mini_shadow\n },\n '#mini-icon': {\n 'position': 'relative',\n 'display': 'inline-block',\n 'width': '75px',\n 'height': MPNotif.NOTIF_HEIGHT_MINI + 'px',\n 'border-radius': '3px 0 0 3px',\n 'background-color': this.style_vals.bg_actions,\n 'background': 'linear-gradient(135deg, ' + this.style_vals.bg_light + ' 0%, ' + this.style_vals.bg_actions + ' 100%)',\n 'transition': 'background-color ' + anim_seconds\n },\n '#mini:hover #mini-icon': {\n 'background-color': this.style_vals.mini_hover\n },\n '#mini:hover #mainbox': {\n 'background-color': this.style_vals.mini_hover\n },\n '#mini-icon-img': {\n 'position': 'absolute',\n 'background-image': 'url(' + this.thumb_image_url + ')',\n 'width': '48px',\n 'height': '48px',\n 'top': '20px',\n 'left': '12px'\n },\n '#content': {\n 'padding': '30px 20px 0px 20px'\n },\n '#mini-content': {\n 'text-align': 'left',\n 'height': MPNotif.NOTIF_HEIGHT_MINI + 'px',\n 'cursor': 'pointer'\n },\n '#img': {\n 'width': '328px',\n 'margin-top': '30px',\n 'border-radius': '5px'\n },\n '#title': {\n 'max-height': '600px',\n 'overflow': 'hidden',\n 'word-wrap': 'break-word',\n 'padding': '25px 0px 20px 0px',\n 'font-size': '19px',\n 'font-weight': 'bold',\n 'color': this.style_vals.text_title\n },\n '#body': {\n 'max-height': '600px',\n 'margin-bottom': '25px',\n 'overflow': 'hidden',\n 'word-wrap': 'break-word',\n 'line-height': '21px',\n 'font-size': '15px',\n 'font-weight': 'normal',\n 'text-align': 'left'\n },\n '#mini #body': {\n 'display': 'inline-block',\n 'max-width': '250px',\n 'margin': '0 0 0 30px',\n 'height': MPNotif.NOTIF_HEIGHT_MINI + 'px',\n 'font-size': '16px',\n 'letter-spacing': '0.8px',\n 'color': this.style_vals.text_title\n },\n '#mini #body-text': {\n 'display': 'table',\n 'height': MPNotif.NOTIF_HEIGHT_MINI + 'px'\n },\n '#mini #body-text div': {\n 'display': 'table-cell',\n 'vertical-align': 'middle'\n },\n '#tagline': {\n 'margin-bottom': '15px',\n 'font-size': '10px',\n 'font-weight': '600',\n 'letter-spacing': '0.8px',\n 'color': '#ccd7e0',\n 'text-align': 'left'\n },\n '#tagline a': {\n 'color': this.style_vals.text_tagline,\n 'transition': 'color ' + anim_seconds\n },\n '#tagline a:hover': {\n 'color': this.style_vals.text_hover\n },\n '#cancel': {\n 'position': 'absolute',\n 'right': '0',\n 'width': '8px',\n 'height': '8px',\n 'padding': '10px',\n 'border-radius': '20px',\n 'margin': '12px 12px 0 0',\n 'box-sizing': 'content-box',\n 'cursor': 'pointer',\n 'transition': 'background-color ' + anim_seconds\n },\n '#mini #cancel': {\n 'margin': '7px 7px 0 0'\n },\n '#cancel-icon': {\n 'width': '8px',\n 'height': '8px',\n 'overflow': 'hidden',\n 'background-image': 'url(//cdn.mxpnl.com/site_media/images/icons/notifications/cancel-x.png)',\n 'opacity': this.style_vals.cancel_opacity\n },\n '#cancel:hover': {\n 'background-color': this.style_vals.bg_hover\n },\n '#button': {\n 'display': 'block',\n 'height': '60px',\n 'line-height': '60px',\n 'text-align': 'center',\n 'background-color': this.style_vals.bg_actions,\n 'border-radius': '0 0 4px 4px',\n 'overflow': 'hidden',\n 'cursor': 'pointer',\n 'transition': 'background-color ' + anim_seconds\n },\n '#button-close': {\n 'display': 'inline-block',\n 'width': '9px',\n 'height': '60px',\n 'margin-right': '8px',\n 'vertical-align': 'top',\n 'background-image': 'url(//cdn.mxpnl.com/site_media/images/icons/notifications/close-x-' + this.style + '.png)',\n 'background-repeat': 'no-repeat',\n 'background-position': '0px 25px'\n },\n '#button-play': {\n 'display': 'inline-block',\n 'width': '30px',\n 'height': '60px',\n 'margin-left': '15px',\n 'background-image': 'url(//cdn.mxpnl.com/site_media/images/icons/notifications/play-' + this.style + '-small.png)',\n 'background-repeat': 'no-repeat',\n 'background-position': '0px 15px'\n },\n 'a#button-link': {\n 'display': 'inline-block',\n 'vertical-align': 'top',\n 'text-align': 'center',\n 'font-size': '17px',\n 'font-weight': 'bold',\n 'overflow': 'hidden',\n 'word-wrap': 'break-word',\n 'color': this.style_vals.text_title,\n 'transition': 'color ' + anim_seconds\n },\n '#button:hover': {\n 'background-color': this.style_vals.bg_hover,\n 'color': this.style_vals.text_hover\n },\n '#button:hover a': {\n 'color': this.style_vals.text_hover\n },\n\n '#video-noflip': {\n 'position': 'relative',\n 'top': (-this.video_height * 2) + 'px'\n },\n '#video-flip': {\n 'backface-visibility': 'hidden',\n 'transform': 'rotateY(180deg)'\n },\n '#video': {\n 'position': 'absolute',\n 'width': (this.video_width - 1) + 'px',\n 'height': this.video_height + 'px',\n 'top': MPNotif.NOTIF_TOP + 'px',\n 'margin-top': '100px',\n 'left': '50%',\n 'margin-left': Math.round(-this.video_width / 2) + 'px',\n 'overflow': 'hidden',\n 'border-radius': '5px',\n 'box-shadow': video_shadow,\n 'transform': 'translateZ(1px)', // webkit rendering bug http://stackoverflow.com/questions/18167981/clickable-link-area-unexpectedly-smaller-after-css-transform\n 'transition': 'opacity ' + anim_seconds + ', top ' + anim_seconds\n },\n '#video.exiting': {\n 'opacity': '0.0',\n 'top': this.video_height + 'px'\n },\n '#video-holder': {\n 'position': 'absolute',\n 'width': (this.video_width - 1) + 'px',\n 'height': this.video_height + 'px',\n 'overflow': 'hidden',\n 'border-radius': '5px'\n },\n '#video-frame': {\n 'margin-left': '-1px',\n 'width': this.video_width + 'px'\n }
3,\n '#video-controls': {\n 'opacity': '0',\n 'transition': 'opacity 0.5s'\n },\n '#video:hover #video-controls': {\n 'opacity': '1.0'\n },\n '#video .video-progress-el': {\n 'position': 'absolute',\n 'bottom': '0',\n 'height': '25px',\n 'border-radius': '0 0 0 5px'\n },\n '#video-progress': {\n 'width': '90%'\n },\n '#video-progress-total': {\n 'width': '100%',\n 'background-color': this.style_vals.bg,\n 'opacity': '0.7'\n },\n '#video-elapsed': {\n 'width': '0',\n 'background-color': '#6cb6f5',\n 'opacity': '0.9'\n },\n '#video #video-time': {\n 'width': '10%',\n 'right': '0',\n 'font-size': '11px',\n 'line-height': '25px',\n 'color': this.style_vals.text_main,\n 'background-color': '#666',\n 'border-radius': '0 0 5px 0'\n }\n };\n\n // IE hacks\n if (this._browser_lte('ie', 8)) {\n _.extend(notif_styles, {\n '* html #overlay': {\n 'position': 'absolute'\n },\n '* html #bg': {\n 'position': 'absolute'\n },\n 'html, body': {\n 'height': '100%'\n }\n });\n }\n if (this._browser_lte('ie', 7)) {\n _.extend(notif_styles, {\n '#mini #body': {\n 'display': 'inline',\n 'zoom': '1',\n 'border': '1px solid ' + this.style_vals.bg_hover\n },\n '#mini #body-text': {\n 'padding': '20px'\n },\n '#mini #mini-icon': {\n 'display': 'none'\n }\n });\n }\n\n // add vendor-prefixed style rules\n var VENDOR_STYLES = ['backface-visibility', 'border-radius', 'box-shadow', 'opacity',\n 'perspective', 'transform', 'transform-style', 'transition'],\n VENDOR_PREFIXES = ['khtml', 'moz', 'ms', 'o', 'webkit'];\n for (var selector in notif_styles) {\n for (var si = 0; si < VENDOR_STYLES.length; si++) {\n var prop = VENDOR_STYLES[si];\n if (prop in notif_styles[selector]) {\n var val = notif_styles[selector][prop];\n for (var pi = 0; pi < VENDOR_PREFIXES.length; pi++) {\n notif_styles[selector]['-' + VENDOR_PREFIXES[pi] + '-' + prop] = val;\n }\n }\n }\n }\n\n var inject_styles = function(styles, media_queries) {\n var create_style_text = function(style_defs) {\n var st = '';\n for (var selector in style_defs) {\n var mp_selector = selector\n .replace(/#/g, '#' + MPNotif.MARKUP_PREFIX + '-')\n .replace(/\\./g, '.' + MPNotif.MARKUP_PREFIX + '-');\n st += '\\n' + mp_selector + ' {';\n var props = style_defs[selector];\n for (var k in props) {\n st += k + ':' + props[k] + ';';\n }\n st += '}';\n }\n return st;\n };\n var create_media_query_text = function(mq_defs) {\n var mqt = '';\n for (var mq in mq_defs) {\n mqt += '\\n' + mq + ' {' + create_style_text(mq_defs[mq]) + '\\n}';\n }\n return mqt;\n };\n\n var style_text = create_style_text(styles) + create_media_query_text(media_queries),\n head_el = document.head || document.getElementsByTagName('head')[0] || document.documentElement,\n style_el = document.createElement('style');\n head_el.appendChild(style_el);\n style_el.setAttribute('type', 'text/css');\n if (style_el.styleSheet) { // IE\n style_el.styleSheet.cssText = style_text;\n } else {\n style_el.textContent = style_text;\n }\n };\n inject_styles(notif_styles, notif_media_queries);\n};
3\n\nMPNotif.prototype._init_video = _.safewrap(function() {\n if (!this.video_url) {\n return;\n }\n var self = this;\n\n // Youtube iframe API compatibility\n self.yt_custom = 'postMessage' in window;\n\n self.dest_url = self.video_url;\n var youtube_match = self.video_url.match(\n // http://stackoverflow.com/questions/2936467/parse-youtube-video-id-using-preg-match\n /(?:youtube(?:-nocookie)?\\.com\\/(?:[^\\/]+\\/.+\\/|(?:v|e(?:mbed)?)\\/|.*[?&]v=)|youtu\\.be\\/)([^\"&?\\/ ]{11})/i\n ),\n vimeo_match = self.video_url.match(\n /vimeo\\.com\\/.*?(\\d+)/i\n );\n if (youtube_match) {\n self.show_video = true;\n self.youtube_video = youtube_match[1];\n\n if (self.yt_custom) {\n window['onYouTubeIframeAPIReady'] = function() {\n if (self._get_el('video-frame')) {\n self._yt_video_ready();\n }\n };\n\n // load Youtube iframe API; see https://developers.google.com/youtube/iframe_api_reference\n var tag = document.createElement('script');\n tag.src = '//www.youtube.com/iframe_api';\n var firstScriptTag = document.getElementsByTagName('script')[0];\n firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);\n }\n } else if (vimeo_match) {\n self.show_video = true;\n self.vimeo_video = vimeo_match[1];\n }\n\n // IE <= 7, FF <= 3: fall through to video link rather than embedded player\n if (self._browser_lte('ie', 7) || self._browser_lte('firefox', 3)) {\n self.show_video = false;\n self.clickthrough = true;\n }\n});\n\nMPNotif.prototype._mark_as_shown = _.safewrap(function() {\n // click on background to dismiss\n var self = this;\n _.register_event(self._get_el('bg'), 'click', function() {\n self.dismiss();\n });\n\n var get_style = function(el, style_name) {\n var styles = {};\n if (document.defaultView && document.defaultView.getComputedStyle) {\n styles = document.defaultView.getComputedStyle(el, null); // FF3 requires both args\n } else if (el.currentStyle) { // IE\n styles = el.currentStyle;\n }\n return styles[style_name];\n };\n\n if (this.campaign_id) {\n var notif_el = this._get_el('overlay');\n if (notif_el && get_style(notif_el, 'visibility') !== 'hidden' && get_style(notif_el, 'display') !== 'none') {\n this._mark_delivery();\n }\n }\n});\n\nMPNotif.prototype._mark_delivery = _.safewrap(function(extra_props) {\n if (!this.marked_as_shown) {\n this.marked_as_shown = true;\n\n if (this.campaign_id) {\n // mark notification shown (local cache)\n this._get_shown_campaigns()[this.campaign_id] = 1 * new Date();\n this.persistence.save();\n }\n\n // track delivery\n this._track_event('$campaign_delivery', extra_props);\n\n // mark notification shown (mixpanel property)\n this.mixpanel['people']['append']({\n '$campaigns': this.campaign_id,\n '$notifications': {\n 'campaign_id': this.campaign_id,\n 'message_id': this.message_id,\n 'type': 'web',\n 'time': new Date()\n }\n });\n }\n});\n\nMPNotif.prototype._preload_images = function(all_loaded_cb) {\n var self = this;\n if (this.imgs_to_preload.length === 0) {\n all_loaded_cb();\n return;\n }\n\n var preloaded_imgs = 0;\n var img_objs = [];\n var onload = function() {\n preloaded_imgs++;\n if (preloaded_imgs === self.imgs_to_preload.length && all_loaded_cb) {\n all_loaded_cb();\n all_loaded_cb = null;\n }\n };\n for (var i = 0; i < this.imgs_to_preload.length; i++) {\n var img = new Image();\n img.onload = onload;\n img.src = this.imgs_to_preload[i];\n if (img.complete) {\n onload();\n }\n img_objs.push(img);\n }\n\n // IE6/7 doesn't fire onload reliably\n if (this._browser_lte('ie', 7)) {\n setTimeout(function() {\
3n var imgs_loaded = true;\n for (i = 0; i < img_objs.length; i++) {\n if (!img_objs[i].complete) {\n imgs_loaded = false;\n }\n }\n if (imgs_loaded && all_loaded_cb) {\n all_loaded_cb();\n all_loaded_cb = null;\n }\n }, 500);\n }\n};\n\nMPNotif.prototype._remove_notification_el = _.safewrap(function() {\n window.clearInterval(this._video_progress_checker);\n this.notification_el.style.visibility = 'hidden';\n this.body_el.removeChild(this.notification_el);\n});\n\nMPNotif.prototype._set_client_config = function() {\n var get_browser_version = function(browser_ex) {\n var match = navigator.userAgent.match(browser_ex);\n return match && match[1];\n };\n this.browser_versions = {};\n this.browser_versions['chrome'] = get_browser_version(/Chrome\\/(\\d+)/);\n this.browser_versions['firefox'] = get_browser_version(/Firefox\\/(\\d+)/);\n this.browser_versions['ie'] = get_browser_version(/MSIE (\\d+).+/);\n if (!this.browser_versions['ie'] && !(window.ActiveXObject) && 'ActiveXObject' in window) {\n this.browser_versions['ie'] = 11;\n }\n\n this.body_el = document.body || document.getElementsByTagName('body')[0];\n if (this.body_el) {\n this.doc_width = Math.max(\n this.body_el.scrollWidth, document.documentElement.scrollWidth,\n this.body_el.offsetWidth, document.documentElement.offsetWidth,\n this.body_el.clientWidth, document.documentElement.clientWidth\n );\n this.doc_height = Math.max(\n this.body_el.scrollHeight, document.documentElement.scrollHeight,\n this.body_el.offsetHeight, document.documentElement.offsetHeight,\n this.body_el.clientHeight, document.documentElement.clientHeight\n );\n }\n\n // detect CSS compatibility\n var ie_ver = this.browser_versions['ie'];\n var sample_styles = document.createElement('div').style,\n is_css_compatible = function(rule) {\n if (rule in sample_styles) {\n return true;\n }\n if (!ie_ver) {\n rule = rule[0].toUpperCase() + rule.slice(1);\n var props = ['O' + rule, 'Webkit' + rule, 'Moz' + rule];\n for (var i = 0; i < props.length; i++) {\n if (props[i] in sample_styles) {\n return true;\n }\n }\n }\n return false;\n };\n this.use_transitions = this.body_el &&\n is_css_compatible('transition') &&\n is_css_compatible('transform');\n this.flip_animate = (this.browser_versions['chrome'] >= 33 || this.browser_versions['firefox'] >= 15) &&\n this.body_el &&\n is_css_compatible('backfaceVisibility') &&\n is_css_compatible('perspective') &&\n is_css_compatible('transform');\n};\n\nMPNotif.prototype._switch_to_video = _.safewrap(function() {\n var self = this,\n anims = [\n {\n el: self._get_notification_display_el(),\n attr: 'opacity',\n start: 1.0,\n goal: 0.0\n },\n {\n el: self._get_notification_display_el(),\n attr: 'top',\n start: MPNotif.NOTIF_TOP,\n goal: -500\n },\n {\n el: self._get_el('video-noflip'),\n attr: 'opacity',\n start: 0.0,\n goal: 1.0\n },\n {\n el: self._get_el('video-noflip'),\n attr: 'top',\n start: -self.video_height * 2,\n goal: 0\n }\n ];\n\n if (self.mini) {\n var bg = self._get_el('bg'),\n overlay = self._get_el('overlay');\n bg.style.width = '100%';\n bg.style.height = '100%';\n overlay.style.width = '100%';\n\n self._add_class(self._get_notification_display_el(), 'exiting');\n self._add_class(bg, 'visible');\n\n anims.push({\n el: self._get_el('bg'),\n attr: 'opacity',\n start: 0.0,\n goal: MPNotif.BG_OPACITY\n });\n }\n\n var video_el = self._get_el('video-holder');\n video_el.innerHTML = self.video_iframe;
3\n\n var video_ready = function() {\n if (window['YT'] && window['YT']['loaded']) {\n self._yt_video_ready();\n }\n self.showing_video = true;\n self._get_notification_display_el().style.visibility = 'hidden';\n };\n if (self.flip_animate) {\n self._add_class('flipper', 'flipped');\n setTimeout(video_ready, MPNotif.ANIM_TIME);\n } else {\n self._animate_els(anims, MPNotif.ANIM_TIME, video_ready);\n }\n});\n\nMPNotif.prototype._track_event = function(event_name, properties, cb) {\n if (this.campaign_id) {\n properties = properties || {};\n properties = _.extend(properties, {\n 'campaign_id': this.campaign_id,\n 'message_id': this.message_id,\n 'message_type': 'web_inapp',\n 'message_subtype': this.notif_type\n });\n this.mixpanel['track'](event_name, properties, cb);\n } else if (cb) {\n cb.call();\n }\n};\n\nMPNotif.prototype._yt_video_ready = _.safewrap(function() {\n var self = this;\n if (self.video_inited) {\n return;\n }\n self.video_inited = true;\n\n var progress_bar = self._get_el('video-elapsed'),\n progress_time = self._get_el('video-time'),\n progress_el = self._get_el('video-progress');\n\n new window['YT']['Player'](MPNotif.MARKUP_PREFIX + '-video-frame', {\n 'events': {\n 'onReady': function(event) {\n var ytplayer = event['target'],\n video_duration = ytplayer['getDuration'](),\n pad = function(i) {\n return ('00' + i).slice(-2);\n },\n update_video_time = function(current_time) {\n var secs = Math.round(video_duration - current_time),\n mins = Math.floor(secs / 60),\n hours = Math.floor(mins / 60);\n secs -= mins * 60;\n mins -= hours * 60;\n progress_time.innerHTML = '-' + (hours ? hours + ':' : '') + pad(mins) + ':' + pad(secs);\n };\n update_video_time(0);\n self._video_progress_checker = window.setInterval(function() {\n var current_time = ytplayer['getCurrentTime']();\n progress_bar.style.width = (current_time / video_duration * 100) + '%';\n update_video_time(current_time);\n }, 250);\n _.register_event(progress_el, 'click', function(e) {\n var clickx = Math.max(0, e.pageX - progress_el.getBoundingClientRect().left);\n ytplayer['seekTo'](video_duration * clickx / progress_el.clientWidth, true);\n });\n }\n }\n });\n});\n\n// EXPORTS (for closure compiler)\n\n// MixpanelLib Exports\nMixpanelLib.prototype['init'] = MixpanelLib.prototype.init;\nMixpanelLib.prototype['reset'] = MixpanelLib.prototype.reset;\nMixpanelLib.prototype['disable'] = MixpanelLib.prototype.disable;\nMixpanelLib.prototype['time_event'] = MixpanelLib.prototype.time_event;\nMixpanelLib.prototype['track'] = MixpanelLib.prototype.track;\nMixpanelLib.prototype['track_links'] = MixpanelLib.prototype.track_links;\nMixpanelLib.prototype['track_forms'] = MixpanelLib.prototype.track_forms;\nMixpanelLib.prototype['track_pageview'] = MixpanelLib.prototype.track_pageview;\nMixpanelLib.prototype['register'] = MixpanelLib.prototype.register;\nMixpanelLib.prototype['register_once'] = MixpanelLib.prototype.register_once;\nMixpanelLib.prototype['unregister'] = MixpanelLib.prototype.unregister;\nMixpanelLib.prototype['identify'] = MixpanelLib.prototype.identify;\nMixpanelLib.prototype['alias'] = MixpanelLib.prototype.alias;\nMixpanelLib.prototype['name_tag'] = MixpanelLib.prototype.name_tag;\nMixpanelLib.prototype['set_config'] = MixpanelLib.prototype.set_config;\nMixpanelLib.prototype['get_config'] = MixpanelLib.prototype.get_config;\nMixpanelLib.prototype['get_property'] = MixpanelLib.prototype.get_property;\nMixpanelLib.prototype['get_distinct_id'] = MixpanelLib.prototype.get_distinct_id;\nMixpanelLib.prototype['toString'] = MixpanelLib.prototype.toString;\nMixpanelLib.prototype['_check_and_handle_notifications'] = MixpanelLib.prototype._check_and_handle_notifications;\nMixpanelLib.prototype['_show_notification'] = MixpanelLib.prototype._show_notification;\n\n// MixpanelPersistence Exports\nMixpanelPersistence.prototype['properties'] = MixpanelPersistence.prototype.properties;\nMixpanelPersistence.prototype['update_search_keyword'] = MixpanelPersistence.prototype.update_search_keyword;\nMixpanelPersistence.prototype['update_referrer_info'] = MixpanelPersistence.prototype.update_referrer_info;\nMixpanelPersistence.prototype['get_cross_subdomain'] = MixpanelPersistence.prototype.get_cross_subdomain;\nMixpanelPersistence.prototype['clear'] = MixpanelPersistence.prototype.clear;\n\n// MixpanelPeople Exports\nMixpanelPeople.prototype['set'] = MixpanelPeople.prototype.set;\nMixpanelPeople.prototype['set_once'] = MixpanelPeople.prototype.set_once;\nMixpanelPeople.prototype['increment'] = MixpanelPeople.prototype.increment;\nMixpanelPeople.prototype['append'] = MixpanelPeople.prototype.append;\nMixpanelPeople.prototype['union'] = MixpanelPeople.prototype.union;\nMixpanelPeople.prototype['track_charge'] = MixpanelPeople.prototype.track_charge;\nMixpanelPeople.prototype['clear_charges'] = MixpanelPeople.prototype.clear_charges;\nMixpanelPeople.prototype['delete_user'] = MixpanelPeople.prototype.delete_user;\nMixpanelPeople.prototype['toString'] = MixpanelPeople.prototype.toString;\n\n_.safewrap_class(MixpanelLib, ['identify', '_check_and_handle_notifications', '_show_notification']);\n\nvar instances = {};
3\nvar extend_mp = function() {\n // add all the sub mixpanel instances\n _.each(instances, function(instance, name) {\n if (name !== PRIMARY_INSTANCE_NAME) { mixpanel_master[name] = instance; }\n });\n\n // add private functions as _\n mixpanel_master['_'] = _;\n};\n\nvar override_mp_init_func = function() {\n // we override the snippets init function to handle the case where a\n // user initializes the mixpanel library after the script loads & runs\n mixpanel_master['init'] = function(token, config, name) {\n if (name) {\n // initialize a sub library\n if (!mixpanel_master[name]) {\n mixpanel_master[name] = instances[name] = create_mplib(token, config, name);\n mixpanel_master[name]._loaded();\n }\n return mixpanel_master[name];\n } else {\n var instance = mixpanel_master;\n\n if (instances[PRIMARY_INSTANCE_NAME]) {\n // main mixpanel lib already initialized\n instance = instances[PRIMARY_INSTANCE_NAME];\n } else if (token) {\n // intialize the main mixpanel lib\n instance = create_mplib(token, config, PRIMARY_INSTANCE_NAME);\n instance._loaded();\n instances[PRIMARY_INSTANCE_NAME] = instance;\n }\n\n mixpanel_master = instance;\n if (init_type === INIT_SNIPPET) {\n window[PRIMARY_INSTANCE_NAME] = mixpanel_master;\n }\n extend_mp();\n }\n };\n};\n\nvar add_dom_loaded_handler = function() {\n // Cross browser DOM Loaded support\n function dom_loaded_handler() {\n // function flag since we only want to execute this once\n if (dom_loaded_handler.done) { return; }\n dom_loaded_handler.done = true;\n\n DOM_LOADED = true;\n ENQUEUE_REQUESTS = false;\n\n _.each(instances, function(inst) {\n inst._dom_loaded();\n });\n }\n\n function do_scroll_check() {\n try {\n document.documentElement.doScroll('left');\n } catch(e) {\n setTimeout(do_scroll_check, 1);\n return;\n }\n\n dom_loaded_handler();\n }\n\n if (document.addEventListener) {\n if (document.readyState === 'complete') {\n // safari 4 can fire the DOMContentLoaded event before loading all\n // external JS (including this file). you will see some copypasta\n // on the internet that checks for 'complete' and 'loaded', but\n // 'loaded' is an IE thing\n dom_loaded_handler();\n } else {\n document.addEventListener('DOMContentLoaded', dom_loaded_handler, false);\n }\n } else if (document.attachEvent) {\n // IE\n document.attachEvent('onreadystatechange', dom_loaded_handler);\n\n // check to make sure we arn't in a frame\n var toplevel = false;\n try {\n toplevel = window.frameElement === null;\n } catch(e) {\n // noop\n }\n\n if (document.documentElement.doScroll && toplevel) {\n do_scroll_check();\n }\n }\n\n // fallback handler, always will work\n _.register_event(window, 'load', dom_loaded_handler, true);\n};\n\nvar add_dom_event_counting_handlers = function(instance) {\n var name = instance.get_config('name');\n\n instance.mp_counts = instance.mp_counts || {};\n instance.mp_counts['$__c'] = parseInt(_.cookie.get('mp_' + name + '__c')) || 0;\n\n var increment_count = function() {\n instance.mp_counts['$__c'] = (instance.mp_counts['$__c'] || 0) + 1;\n _.cookie.set('mp_' + name + '__c', instance.mp_counts['$__c'], 1, true);\n };\n\n var evtCallback = function() {\n try {\n instance.mp_counts = instance.mp_counts || {};\n increment_count();\n } catch (e) {\n console$1.error(e);\n }\n };\n _.register_event(document, 'submit', evtCallback);\n _.register_event(document, 'change', evtCallback);\n var mousedownTarget = null;\n _.register_event(document, 'mousedown', function(e) {\n mousedownTarget = e.target;\n });\n _.register_event(document, 'mouseup', function(e) {\n if (e.target === mousedownTarget) {\n evtCallback(e);\n }\n });\n};\n\nfunction init_as_module() {\n init_type = INIT_MODULE;\n mixpanel_master = new MixpanelLib();\n\n override_mp_init_func();\n mixpanel_master['init']();\n add_dom_loaded_handler();\n\n return mixpanel_master;\n}\n\nvar mixpanel = init_as_module();\n\nmodule.exports = mixpanel;\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/mixpanel-browser/build/mixpanel.cjs.js\n// module id = 38\n// module chunks = 0 1 2\n//# sourceURL=webpack:///./~/mixpanel-browser/build/mixpanel.cjs.js?"); 4}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.