From 8af9c56cc16acfa05c19db653f09f4887426421a Mon Sep 17 00:00:00 2001 From: alex1504 Date: Wed, 15 Feb 2017 12:49:20 +0800 Subject: [PATCH] add spinnerClass --- build/build.js | 45 +++++++++++++--------- build/build.js.map | 2 +- package.json | 2 +- src/components/book/book.vue | 6 ++- src/components/common/navbar.vue | 2 +- src/components/movie/movie_list_coming.vue | 7 +++- src/components/movie/movie_list_hot.vue | 7 +++- src/components/movie/movie_list_top250.vue | 7 +++- src/components/music/music.vue | 6 ++- src/components/photo/photo.vue | 7 +++- src/store/store.js | 8 ++-- src/store/types.js | 4 +- 12 files changed, 68 insertions(+), 35 deletions(-) diff --git a/build/build.js b/build/build.js index c5d9034..152ab8b 100644 --- a/build/build.js +++ b/build/build.js @@ -1,7 +1,7 @@ -!function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var n={};return e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="./build/",e(e.s=138)}([function(t,e){t.exports=function(){var t=[];return t.toString=function(){for(var t=[],e=0;e=0&&v.splice(e,1)}function a(t){var e=document.createElement("style");return e.type="text/css",i(t,e),e}function s(t,e){var n,r,i;if(e.singleton){var s=m++;n=p||(p=a(e)),r=u.bind(null,n,s,!1),i=u.bind(null,n,s,!0)}else n=a(e),r=c.bind(null,n),i=function(){o(n)};return r(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;r(t=e)}else i()}}function u(t,e,n,r){var i=n?"":r.css;if(t.styleSheet)t.styleSheet.cssText=g(e,i);else{var o=document.createTextNode(i),a=t.childNodes;a[e]&&t.removeChild(a[e]),a.length?t.insertBefore(o,a[e]):t.appendChild(o)}}function c(t,e){var n=e.css,r=e.media,i=e.sourceMap;if(r&&t.setAttribute("media",r),i&&(n+="\n/*# sourceURL="+i.sources[0]+" */",n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(i))))+" */"),t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}var l={},d=function(t){var e;return function(){return"undefined"==typeof e&&(e=t.apply(this,arguments)),e}},f=d(function(){return/msie [6-9]\b/.test(window.navigator.userAgent.toLowerCase())}),h=d(function(){return document.head||document.getElementsByTagName("head")[0]}),p=null,m=0,v=[];t.exports=function(t,e){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");e=e||{},"undefined"==typeof e.singleton&&(e.singleton=f()),"undefined"==typeof e.insertAt&&(e.insertAt="bottom");var i=r(t);return n(i,e),function(t){for(var o=[],a=0;a0&&void 0!==arguments[0]?arguments[0]:10,e=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],n="",r=0;r=0&&o0?0:s-1;return arguments.length<3&&(i=n[a?a[u]:u],u+=t),e(n,r,i,a,u,s)}}function o(t){return function(e,n,r){n=A(n,r);for(var i=k(e),o=t>0?0:i-1;o>=0&&o0?a=o>=0?o:Math.max(o+s,a):s=o>=0?Math.min(o+1,s):o+s+1;else if(n&&o&&s)return o=n(r,i),r[o]===i?o:-1;if(i!==i)return o=e(m.call(r,a,s),E.isNaN),o>=0?o+a:-1;for(o=t>0?a:s-1;o>=0&&o=0&&e<=R};E.each=E.forEach=function(t,e,n){e=C(e,n);var r,i;if(M(t))for(r=0,i=t.length;r=0},E.invoke=function(t,e){var n=m.call(arguments,2),r=E.isFunction(e);return E.map(t,function(t){var i=r?e:t[e];return null==i?i:i.apply(t,n)})},E.pluck=function(t,e){return E.map(t,E.property(e))},E.where=function(t,e){return E.filter(t,E.matcher(e))},E.findWhere=function(t,e){return E.find(t,E.matcher(e))},E.max=function(t,e,n){var r,i,o=-(1/0),a=-(1/0);if(null==e&&null!=t){t=M(t)?t:E.values(t);for(var s=0,u=t.length;so&&(o=r)}else e=A(e,n),E.each(t,function(t,n,r){i=e(t,n,r),(i>a||i===-(1/0)&&o===-(1/0))&&(o=t,a=i)});return o},E.min=function(t,e,n){var r,i,o=1/0,a=1/0;if(null==e&&null!=t){t=M(t)?t:E.values(t);for(var s=0,u=t.length;sr||void 0===n)return 1;if(ne?(a&&(clearTimeout(a),a=null),s=c,o=t.apply(r,i),a||(r=i=null)):a||n.trailing===!1||(a=setTimeout(u,l)),o}},E.debounce=function(t,e,n){var r,i,o,a,s,u=function u(){var c=E.now()-a;c=0?r=setTimeout(u,e-c):(r=null,n||(s=t.apply(o,i),r||(o=i=null)))};return function(){o=this,i=arguments,a=E.now();var c=n&&!r;return r||(r=setTimeout(u,e)),c&&(s=t.apply(o,i),o=i=null),s}},E.wrap=function(t,e){return E.partial(e,t)},E.negate=function(t){return function(){return!t.apply(this,arguments)}},E.compose=function(){var t=arguments,e=t.length-1;return function(){for(var n=e,r=t[e].apply(this,arguments);n--;)r=t[n].call(this,r);return r}},E.after=function(t,e){return function(){if(--t<1)return e.apply(this,arguments)}},E.before=function(t,e){var n;return function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=null),n}},E.once=E.partial(E.before,2);var L=!{toString:null}.propertyIsEnumerable("toString"),I=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];E.keys=function(t){if(!E.isObject(t))return[];if(y)return y(t);var e=[];for(var n in t)E.has(t,n)&&e.push(n);return L&&u(t,e),e},E.allKeys=function(t){if(!E.isObject(t))return[];var e=[];for(var n in t)e.push(n);return L&&u(t,e),e},E.values=function(t){for(var e=E.keys(t),n=e.length,r=Array(n),i=0;i":">",'"':""","'":"'","`":"`"},F=E.invert(D),U=function(t){var e=function(e){return t[e]},n="(?:"+E.keys(t).join("|")+")",r=RegExp(n),i=RegExp(n,"g");return function(t){return t=null==t?"":""+t,r.test(t)?t.replace(i,e):t}};E.escape=U(D),E.unescape=U(F),E.result=function(t,e,n){var r=null==t?void 0:t[e];return void 0===r&&(r=n),E.isFunction(r)?r.call(t):r};var H=0;E.uniqueId=function(t){var e=++H+"";return t?t+e:e},E.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var B=/(.)^/,q={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},z=/\\|'|\r|\n|\u2028|\u2029/g,W=function(t){return"\\"+q[t]};E.template=function(t,e,n){!e&&n&&(e=n),e=E.defaults({},e,E.templateSettings);var r=RegExp([(e.escape||B).source,(e.interpolate||B).source,(e.evaluate||B).source].join("|")+"|$","g"),i=0,o="__p+='";t.replace(r,function(e,n,r,a,s){return o+=t.slice(i,s).replace(z,W),i=s+e.length,n?o+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":r?o+="'+\n((__t=("+r+"))==null?'':__t)+\n'":a&&(o+="';\n"+a+"\n__p+='"),e}),o+="';\n",e.variable||(o="with(obj||{}){\n"+o+"}\n"),o="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+o+"return __p;\n";try{var a=new Function(e.variable||"obj","_",o)}catch(t){throw t.source=o,t}var s=function(t){return a.call(this,t,E)},u=e.variable||"obj";return s.source="function("+u+"){\n"+o+"}",s},E.chain=function(t){var e=E(t);return e._chain=!0,e};var Y=function(t,e){return t._chain?E(e).chain():e};E.mixin=function(t){E.each(E.functions(t),function(e){var n=E[e]=t[e];E.prototype[e]=function(){var t=[this._wrapped];return p.apply(t,arguments),Y(this,n.apply(E,t))}})},E.mixin(E),E.each(["pop","push","reverse","shift","sort","splice","unshift"],function(t){var e=d[t];E.prototype[t]=function(){var n=this._wrapped;return e.apply(n,arguments),"shift"!==t&&"splice"!==t||0!==n.length||delete n[0],Y(this,n)}}),E.each(["concat","join","slice"],function(t){var e=d[t];E.prototype[t]=function(){return Y(this,e.apply(this._wrapped,arguments))}}),E.prototype.value=function(){return this._wrapped},E.prototype.valueOf=E.prototype.toJSON=E.prototype.value,E.prototype.toString=function(){return""+this._wrapped},r=[],i=function(){return E}.apply(e,r),!(void 0!==i&&(t.exports=i))}).call(this)},function(t,e,n){"use strict";var r="function"==typeof Symbol&&"symbol"===s(Symbol.iterator)?function(t){return"undefined"==typeof t?"undefined":s(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":"undefined"==typeof t?"undefined":s(t)},i=n(6),o=n(7)("leancloud:request"),a=n(43),u=n(2),c=n(10),l=n(3),d=n(4),f=n(0),h=n(5),p=h.getSessionToken,m=void 0,v={cn:"https://api.leancloud.cn",us:"https://us-api.leancloud.cn"},g=function(t,e){var n=(new Date).getTime(),r=a(n+t);return e?r+","+n+",master":r+","+n},b=function(t){var e=["batch","classes","files","date","functions","call","login","push","search/select","requestPasswordReset","requestEmailVerify","requestPasswordResetBySmsCode","resetPasswordBySmsCode","requestMobilePhoneVerify","requestLoginSmsCode","verifyMobilePhone","requestSmsCode","verifySmsCode","users","usersByMobilePhone","cloudQuery","qiniu","fileTokens","statuses","bigquery","search/select","subscribe/statuses/count","subscribe/statuses","installations"];if(e.indexOf(t)===-1&&!/users\/[^\/]+\/updatePassword/.test(t)&&!/users\/[^\/]+\/friendship\/[^\/]+/.test(t))throw new Error("Bad router: "+t+".")},y=0,_=function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=arguments[4],s=y++;return o("request("+s+")",t,e,n,r),new u(function(u,c){var l=i(t,e).set(r).send(n);a&&l.on("progress",a),l.end(function(t,e){return e&&o("response("+s+")",e.status,e.body||e.text,e.header),t?(e&&(t.statusCode=e.status,t.responseText=e.text,t.response=e.body),c(t)):u(e.body)})})},w=function(t,e){e?t["X-LC-Sign"]=g(d.applicationKey):t["X-LC-Key"]=d.applicationKey},x=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments[1],n={"X-LC-Id":d.applicationId,"Content-Type":"application/json;charset=UTF-8"},r=!1;return"boolean"==typeof t.useMasterKey?r=t.useMasterKey:"boolean"==typeof d._useMasterKey&&(r=d._useMasterKey),r?d.masterKey?e?n["X-LC-Sign"]=g(d.masterKey,!0):n["X-LC-Key"]=d.masterKey+",master":(console.warn("masterKey is not set, fall back to use appKey"),w(n,e)):w(n,e),d.hookKey&&(n["X-LC-Hook-Key"]=d.hookKey),null!==d._config.applicationProduction&&(n["X-LC-Prod"]=String(d._config.applicationProduction)),n["X-LC-UA"]=d._config.userAgent,u.resolve().then(function(){var e=p(t);if(e)n["X-LC-Session"]=e;else if(!d._config.disableCurrentUser)return d.User.currentAsync().then(function(t){return t&&t._sessionToken&&(n["X-LC-Session"]=t._sessionToken),n});return n})},E=function(t,e,n,i,o){d.serverURL&&(d._config.APIServerURL=d.serverURL,console.warn("Please use AV._config.APIServerURL to replace AV.serverURL, and it is an internal interface."));var a=d._config.APIServerURL||v.cn;if("/"!==a.charAt(a.length-1)&&(a+="/"),a+="1.1/"+t,e&&(a+="/"+e),n&&(a+="/"+n),"users"!==t&&"classes"!==t||!o||(a+="?",o._fetchWhenSave&&(delete o._fetchWhenSave,a+="&new=true"),o._where&&(a+="&where="+encodeURIComponent(JSON.stringify(o._where)),delete o._where)),"get"===i.toLowerCase()){a.indexOf("?")===-1&&(a+="?");for(var s in o)"object"===r(o[s])&&(o[s]=JSON.stringify(o[s])),a+="&"+s+"="+encodeURIComponent(o[s])}return a},C=function(t,e){return"number"!=typeof e&&(e=3600),c.setAsync("APIServerURL",t,1e3*e)},A=function(t){return new u(function(e,n){if(410===t.statusCode)C(t.response.api_server,t.response.ttl).then(function(){e(t.response.location)}).catch(n);else{var r={code:t.code||-1,error:t.message||t.responseText};if(t.response&&t.response.code)r=t.response;else if(t.responseText)try{r=JSON.parse(t.responseText)}catch(t){}n(new l(r.code,r.error))}})},T=function(t){d._config.APIServerURL="https://"+t;var e=f.findKey(v,function(t){return t===d._config.APIServerURL});e&&(d._config.region=e)},O=function(){var t="https://app-router.leancloud.cn/1/route?appId="+d.applicationId;return _("get",t).then(function(t){if(t.api_server)return T(t.api_server),C(t.api_server,t.ttl)},function(t){if(t.statusCode>=400&&t.statusCode<500)throw t})},S=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"cn";m=new u(function(e,n){return d._config.APIServerURL?void e():"cn"===t?c.getAsync("APIServerURL").then(function(t){return t?void T(t):O()}).then(function(){e()}).catch(function(t){n(t)}):(d._config.region=t,d._config.APIServerURL=v[t],e(),void 0)})},R=function t(e,n,r,i){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},a=arguments[5];if(!d.applicationId)throw new Error("You must specify your applicationId using AV.init()");if(!d.applicationKey&&!d.masterKey)throw new Error("You must specify a AppKey using AV.init()");return b(e),m?m.then(function(){var s=E(e,n,r,i,o);if(s.length>2e3&&"get"===i.toLowerCase()){var u={request:{method:i,path:s}};return t("batch",null,null,"POST",u,a)}return x(a).then(function(t){return _(i,s,o,t).then(null,function(e){return A(e).then(function(e){return _(i,e,o,t)})})})}):u.reject(new Error("Not initialized"))};t.exports={ajax:_,request:R,setServerUrlByRegion:S}},function(t,e,n){"use strict";var r=(n(0),n(40).Promise);r._continueWhile=function(t,e){return t()?e().then(function(){return r._continueWhile(t,e)}):r.resolve()},t.exports=r},function(t,e,n){"use strict";function r(t,e){var n=new Error(e);return n.code=t,n}var i=n(0);i.extend(r,{OTHER_CAUSE:-1,INTERNAL_SERVER_ERROR:1,CONNECTION_FAILED:100,OBJECT_NOT_FOUND:101,INVALID_QUERY:102,INVALID_CLASS_NAME:103,MISSING_OBJECT_ID:104,INVALID_KEY_NAME:105,INVALID_POINTER:106,INVALID_JSON:107,COMMAND_UNAVAILABLE:108,NOT_INITIALIZED:109,INCORRECT_TYPE:111,INVALID_CHANNEL_NAME:112,PUSH_MISCONFIGURED:115,OBJECT_TOO_LARGE:116,OPERATION_FORBIDDEN:119,CACHE_MISS:120,INVALID_NESTED_KEY:121,INVALID_FILE_NAME:122,INVALID_ACL:123,TIMEOUT:124,INVALID_EMAIL_ADDRESS:125,MISSING_CONTENT_TYPE:126,MISSING_CONTENT_LENGTH:127,INVALID_CONTENT_LENGTH:128,FILE_TOO_LARGE:129,FILE_SAVE_ERROR:130,FILE_DELETE_ERROR:153,DUPLICATE_VALUE:137,INVALID_ROLE_NAME:139,EXCEEDED_QUOTA:140,SCRIPT_FAILED:141,VALIDATION_ERROR:142,INVALID_IMAGE_DATA:150,UNSAVED_FILE_ERROR:151,INVALID_PUSH_TIME_ERROR:152,USERNAME_MISSING:200,PASSWORD_MISSING:201,USERNAME_TAKEN:202,EMAIL_TAKEN:203,EMAIL_MISSING:204,EMAIL_NOT_FOUND:205,SESSION_MISSING:206,MUST_CREATE_USER_THROUGH_SIGNUP:207,ACCOUNT_ALREADY_LINKED:208,LINKED_ID_MISSING:250,INVALID_LINKED_SESSION:251,UNSUPPORTED_SERVICE:252,X_DOMAIN_REQUEST:602}),t.exports=r},function(t,e,n){"use strict";(function(e){var r=n(0),i=n(31),o=n(5),a=o.isNullOrUndefined,s=e.AV||{};s._config=s._config||{};var u=s._config;r.extend(u,{region:"cn",APIServerURL:u.APIServerURL||"",disableCurrentUser:!1,userAgent:i,applicationProduction:null});var c=function(){},l=function(t,e,n){var i;return i=e&&e.hasOwnProperty("constructor")?e.constructor:function(){t.apply(this,arguments)},r.extend(i,t),c.prototype=t.prototype,i.prototype=new c,e&&r.extend(i.prototype,e),n&&r.extend(i,n),i.prototype.constructor=i,i.__super__=t.prototype,i};s.setProduction=function(t){a(t)?u.applicationProduction=null:u.applicationProduction=t?1:0},s._getAVPath=function(t){if(!s.applicationId)throw new Error("You need to call AV.initialize before using AV.");if(t||(t=""),!r.isString(t))throw new Error("Tried to get a localStorage path that wasn't a String.");return"/"===t[0]&&(t=t.substring(1)),"AV/"+s.applicationId+"/"+t},s._installationId=null,s._getInstallationId=function(){if(s._installationId)return s.Promise.resolve(s._installationId);var t=s._getAVPath("installationId");return s.localStorage.getItemAsync(t).then(function(e){if(s._installationId=e,s._installationId)return e;var n=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return s._installationId=n()+n()+"-"+n()+"-"+n()+"-"+n()+"-"+n()+n()+n(),s.localStorage.setItemAsync(t,s._installationId)})},s._parseDate=function(t){var e=new RegExp("^([0-9]{1,4})-([0-9]{1,2})-([0-9]{1,2})T([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})(.([0-9]+))?Z$"),n=e.exec(t);if(!n)return null;var r=n[1]||0,i=(n[2]||1)-1,o=n[3]||0,a=n[4]||0,s=n[5]||0,u=n[6]||0,c=n[8]||0;return new Date(Date.UTC(r,i,o,a,s,u,c))},s._extend=function(t,e){var n=l(this,t,e);return n.extend=this.extend,n},s._getValue=function(t,e){return t&&t[e]?r.isFunction(t[e])?t[e]():t[e]:null},s._encode=function(t,e,n){if(t instanceof s.Object){if(n)throw new Error("AV.Objects not allowed here");if(!e||r.include(e,t)||!t._hasData)return t._toPointer();if(!t.dirty())return e=e.concat(t),s._encode(t._toFullJSON(e),e,n);throw new Error("Tried to save an object with a pointer to a new, unsaved object.")}if(t instanceof s.ACL)return t.toJSON();if(r.isDate(t))return{__type:"Date", -iso:t.toJSON()};if(t instanceof s.GeoPoint)return t.toJSON();if(r.isArray(t))return r.map(t,function(t){return s._encode(t,e,n)});if(r.isRegExp(t))return t.source;if(t instanceof s.Relation)return t.toJSON();if(t instanceof s.Op)return t.toJSON();if(t instanceof s.File){if(!t.url()&&!t.id)throw new Error("Tried to save an object containing an unsaved file.");return{__type:"File",id:t.id,name:t.name(),url:t.url()}}return r.isObject(t)?r.mapObject(t,function(t,r){return s._encode(t,e,n)}):t},s._decode=function(t,e){if(!r.isObject(t)||r.isDate(t))return t;if(r.isArray(t))return r.map(t,function(t){return s._decode(t)});if(t instanceof s.Object)return t;if(t instanceof s.File)return t;if(t instanceof s.Op)return t;if(t instanceof s.GeoPoint)return t;if(t instanceof s.ACL)return t;if(t.__op)return s.Op._decode(t);var n;if("Pointer"===t.__type){n=t.className;var i=s.Object._create(n);if(Object.keys(t).length>3){var o=r.clone(t);delete o.__type,delete o.className,i._finishFetch(o,!0)}else i._finishFetch({objectId:t.objectId},!1);return i}if("Object"===t.__type){n=t.className;var a=r.clone(t);delete a.__type,delete a.className;var u=s.Object._create(n);return u._finishFetch(a,!0),u}if("Date"===t.__type)return s._parseDate(t.iso);if("GeoPoint"===t.__type)return new s.GeoPoint({latitude:t.latitude,longitude:t.longitude});if("Relation"===t.__type){if(!e)throw new Error("key missing decoding a Relation");var c=new s.Relation(null,e);return c.targetClassName=t.className,c}if("File"===t.__type){var l=new s.File(t.name),d=r.clone(t);return delete d.__type,l._finishFetch(d),l}return r.mapObject(t,function(t,e){return"ACL"===e?new s.ACL(t):s._decode(t,e)})},s._encodeObjectOrArray=function(t){var e=function(t){return t&&t._toFullJSON&&(t=t._toFullJSON([])),r.mapObject(t,function(t){return s._encode(t,[])})};return r.isArray(t)?t.map(function(t){return e(t)}):e(t)},s._arrayEach=r.each,s._traverse=function(t,e,n){if(t instanceof s.Object){if(n=n||[],r.indexOf(n,t)>=0)return;return n.push(t),s._traverse(t.attributes,e,n),e(t)}return t instanceof s.Relation||t instanceof s.File?e(t):r.isArray(t)?(r.each(t,function(r,i){var o=s._traverse(r,e,n);o&&(t[i]=o)}),e(t)):r.isObject(t)?(s._each(t,function(r,i){var o=s._traverse(r,e,n);o&&(t[i]=o)}),e(t)):e(t)},s._objectEach=s._each=function(t,e){r.isObject(t)?r.each(r.keys(t),function(n){e(t[n],n)}):r.each(t,e)},t.exports=s}).call(e,n(9))},function(t,e,n){"use strict";var r=n(0),i=function(t){return r.isNull(t)||r.isUndefined(t)},o=function(t){return r.isArray(t)?t:void 0===t||null===t?[]:[t]},a=function(t){return t.sessionToken?t.sessionToken:t.user&&"function"==typeof t.user.getSessionToken?t.user.getSessionToken():void 0};t.exports={isNullOrUndefined:i,ensureArray:o,getSessionToken:a}},function(t,e,n){function r(){}function i(t){if(!v(t))return t;var e=[];for(var n in t)o(e,n,t[n]);return e.join("&")}function o(t,e,n){if(null!=n)if(Array.isArray(n))n.forEach(function(n){o(t,e,n)});else if(v(n))for(var r in n)o(t,e+"["+r+"]",n[r]);else t.push(encodeURIComponent(e)+"="+encodeURIComponent(n));else null===n&&t.push(encodeURIComponent(e))}function a(t){for(var e,n,r={},i=t.split("&"),o=0,a=i.length;o=0?"&":"?")+t),this._sort){var e=this.url.indexOf("?");if(e>=0){var n=this.url.substring(e+1).split("&");g(this._sort)?n.sort(this._sort):n.sort(),this.url=this.url.substring(0,e)+"?"+n.join("&")}}},d.prototype._isHost=function(t){return t&&"object"===("undefined"==typeof t?"undefined":s(t))&&!Array.isArray(t)&&"[object Object]"!==Object.prototype.toString.call(t)},d.prototype.end=function(t){var e=this,n=this.xhr=y.getXHR(),i=this._formData||this._data;this._endCalled&&console.warn("Warning: .end() was called twice. This is not supported in superagent"),this._endCalled=!0,this._callback=t||r,n.onreadystatechange=function(){var t=n.readyState;if(t>=2&&e._responseTimeoutTimer&&clearTimeout(e._responseTimeoutTimer),4==t){var r;try{r=n.status}catch(t){r=0}if(!r){if(e.timedout||e._aborted)return;return e.crossDomainError()}e.emit("end")}};var o=function(t,n){n.total>0&&(n.percent=n.loaded/n.total*100),n.direction=t,e.emit("progress",n)};if(this.hasListeners("progress"))try{n.onprogress=o.bind(null,"download"),n.upload&&(n.upload.onprogress=o.bind(null,"upload"))}catch(t){}this._appendQueryString(),this._setTimeouts();try{this.username&&this.password?n.open(this.method,this.url,!0,this.username,this.password):n.open(this.method,this.url,!0)}catch(t){return this.callback(t)}if(this._withCredentials&&(n.withCredentials=!0),!this._formData&&"GET"!=this.method&&"HEAD"!=this.method&&"string"!=typeof i&&!this._isHost(i)){var a=this._header["content-type"],s=this._serializer||y.serialize[a?a.split(";")[0]:""];!s&&c(a)&&(s=y.serialize["application/json"]),s&&(i=s(i))}for(var u in this.header)null!=this.header[u]&&n.setRequestHeader(u,this.header[u]);return this._responseType&&(n.responseType=this._responseType),this.emit("request",this),n.send("undefined"!=typeof i?i:null),this},y.get=function(t,e,n){var r=y("GET",t);return"function"==typeof e&&(n=e,e=null),e&&r.query(e),n&&r.end(n),r},y.head=function(t,e,n){var r=y("HEAD",t);return"function"==typeof e&&(n=e,e=null),e&&r.send(e),n&&r.end(n),r},y.options=function(t,e,n){var r=y("OPTIONS",t);return"function"==typeof e&&(n=e,e=null),e&&r.send(e),n&&r.end(n),r},y.del=f,y.delete=f,y.patch=function(t,e,n){var r=y("PATCH",t);return"function"==typeof e&&(n=e,e=null),e&&r.send(e),n&&r.end(n),r},y.post=function(t,e,n){var r=y("POST",t);return"function"==typeof e&&(n=e,e=null),e&&r.send(e),n&&r.end(n),r},y.put=function(t,e,n){var r=y("PUT",t);return"function"==typeof e&&(n=e,e=null),e&&r.send(e),n&&r.end(n),r}},function(e,n,r){function i(){return!("undefined"==typeof window||!window||"undefined"==typeof window.process||"renderer"!==window.process.type)||("undefined"!=typeof document&&document&&"WebkitAppearance"in document.documentElement.style||"undefined"!=typeof window&&window&&window.console&&(console.firebug||console.exception&&console.table)||"undefined"!=typeof navigator&&navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))}function o(t){var e=this.useColors;if(t[0]=(e?"%c":"")+this.namespace+(e?" %c":" ")+t[0]+(e?"%c ":" ")+"+"+n.humanize(this.diff),e){var r="color: "+this.color;t.splice(1,0,r,"color: inherit");var i=0,o=0;t[0].replace(/%[a-zA-Z%]/g,function(t){"%%"!==t&&(i++,"%c"===t&&(o=i))}),t.splice(o,0,r)}}function a(){return"object"===("undefined"==typeof console?"undefined":s(console))&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function u(t){try{null==t?n.storage.removeItem("debug"):n.storage.debug=t}catch(t){}}function c(){try{return n.storage.debug}catch(t){}if("undefined"!=typeof t&&"env"in t)return{NODE_ENV:"production"}.DEBUG}function l(){try{return window.localStorage}catch(t){}}n=e.exports=r(39),n.log=a,n.formatArgs=o,n.save=u,n.load=c,n.useColors=i,n.storage="undefined"!=typeof chrome&&"undefined"!=typeof chrome.storage?chrome.storage.local:l(),n.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],n.formatters.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}},n.enable(c())},function(t,e){function n(t){return null!==t&&"object"===("undefined"==typeof t?"undefined":s(t))}t.exports=n},function(t,e){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(t){"object"===("undefined"==typeof window?"undefined":s(window))&&(n=window)}t.exports=n},function(t,e,n){"use strict";var r=n(11),i=n(4),o=e.removeAsync=r.removeItemAsync.bind(r),a=function(t,e){try{t=JSON.parse(t)}catch(t){return null}if(t){var n=t.expiredAt&&t.expiredAt>2&63),f(r<<4&48|i>>4&15),a?f(i<<2&60|o>>6&3):"=",s?f(63&o):"="].join("")}),e.join("")};t.File=function(e,o,a){this.attributes={name:e,url:"",metaData:{},base64:""},this._extName="";var s=void 0;if(o&&o.owner)s=o.owner;else if(!t._config.disableCurrentUser)try{s=t.User.current()}catch(t){if("SYNC_API_NOT_AVAILABLE"!==t.code)throw t;console.warn("Get current user failed. It seems this runtime use an async storage system, please create AV.File in the callback of AV.User.currentAsync().")}if(this.attributes.metaData={owner:s?s.id:"unknown"},this.set("mime_type",a),i.isArray(o)&&(this.attributes.metaData.size=o.length,o={base64:h(o)}),o&&o.base64){var u=r(36),c=u(o.base64,a);this._source=l.resolve({data:c,type:a})}else if(o&&o.blob)!o.blob.type&&a&&(o.blob.type=a),o.blob.name||(o.blob.name=e),this._source=l.resolve({data:o.blob,type:a});else if("undefined"!=typeof File&&o instanceof File)o.size&&(this.attributes.metaData.size=o.size),o.name&&(this._extName=d(o.name)),this._source=l.resolve({data:o,type:a});else if("undefined"!=typeof n&&n.isBuffer(o))this.attributes.metaData.size=o.length,this._source=l.resolve({data:o,type:a});else if(i.isString(o))throw new Error("Creating a AV.File from a String is not yet supported.")},t.File.withURL=function(e,n,r,i){if(!e||!n)throw new Error("Please provide file name and url");var o=new t.File(e,null,i);if(r)for(var a in r)o.attributes.metaData[a]||(o.attributes.metaData[a]=r[a]);return o.attributes.url=n,o.attributes.metaData.__source="external",o},t.File.createWithoutData=function(e){var n=new t.File;return n.id=e,n},t.File.prototype={className:"_File",toJSON:function(){return t._encode(this)},getACL:function(){return this._acl},setACL:function(e){return e instanceof t.ACL?void(this._acl=e):new u(u.OTHER_CAUSE,"ACL must be a AV.ACL.")},name:function(){return this.get("name")},url:function(){return this.get("url")},get:function(t){switch(t){case"objectId":return this.id;case"url":case"name":case"mime_type":case"metaData":case"createdAt":case"updatedAt":return this.attributes[t];default:return this.attributes.metaData[t]}},set:function t(){for(var e=this,t=function(t,n){switch(t){case"name":case"url":case"mime_type":case"base64":case"metaData":e.attributes[t]=n;break;default:e.attributes.metaData[t]=n}},n=arguments.length,r=Array(n),i=0;i100)throw new Error("Invalid quality value.");i=i||"png";var a=r?2:1;return o+"?imageView/"+a+"/w/"+t+"/h/"+e+"/q/"+n+"/format/"+i},size:function(){return this.metaData().size},ownerId:function(){return this.metaData().owner},destroy:function(t){if(!this.id)return l.reject(new Error("The file id is not eixsts."));var e=c("files",null,this.id,"DELETE",null,t);return e},_fileToken:function(t){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"fileTokens",i=this.attributes.name,o=d(i)||this._extName,a=e()+e()+e()+e()+e()+o,s={key:a,name:i,ACL:this._acl,mime_type:t,metaData:this.attributes.metaData};return this._qiniu_key=a,c(r,null,null,"POST",s).then(function(t){return t.mime_type&&n.set("mime_type",t.mime_type),t})},save:function(t){var e=this;if(this.id)throw new Error("File already saved. If you want to manipulate a file, use AV.Query to get it.");if(!this._previousSave)if(this._source)this._previousSave=this._source.then(function(n){var r=n.data,i=n.type;return e._fileToken(i).then(function(n){var i=void 0;switch(n.provider){case"s3":i=s(n,r,e,t);break;case"qcloud":i=o(n,r,e,t);break;case"qiniu":default:i=a(n,r,e,t)}return i.catch(function(t){throw e.destroy(),t})})});else if(this.attributes.url&&"external"===this.attributes.metaData.__source){var n={name:this.attributes.name,ACL:this._acl,metaData:this.attributes.metaData,mime_type:this.mimeType,url:this.attributes.url};this._previousSave=c("files",this.attributes.name,null,"post",n).then(function(t){return e.attributes.name=t.name,e.attributes.url=t.url,e.id=t.objectId,t.size&&(e.attributes.metaData.size=t.size),e})}return this._previousSave},fetch:function(t){var t=null,e=c("files",null,this.id,"GET",t);return e.then(this._finishFetch.bind(this))},_finishFetch:function(e){var n=t.Object.prototype.parse(e);return n.attributes={name:n.name,url:n.url,mime_type:n.mime_type},n.attributes.metaData=n.metaData||{},n.id=n.objectId,delete n.objectId,delete n.metaData,delete n.url,delete n.name,delete n.mime_type,i.extend(this,n),this}}}},function(t,e,n){"use strict";var r=n(0);t.exports=function(t){t.GeoPoint=function(e,n){r.isArray(e)?(t.GeoPoint._validate(e[0],e[1]),this.latitude=e[0],this.longitude=e[1]):r.isObject(e)?(t.GeoPoint._validate(e.latitude,e.longitude),this.latitude=e.latitude,this.longitude=e.longitude):r.isNumber(e)&&r.isNumber(n)?(t.GeoPoint._validate(e,n),this.latitude=e,this.longitude=n):(this.latitude=0,this.longitude=0);var i=this;this.__defineGetter__&&this.__defineSetter__&&(this._latitude=this.latitude,this._longitude=this.longitude,this.__defineGetter__("latitude",function(){return i._latitude}),this.__defineGetter__("longitude",function(){return i._longitude}),this.__defineSetter__("latitude",function(e){t.GeoPoint._validate(e,i.longitude),i._latitude=e}),this.__defineSetter__("longitude",function(e){t.GeoPoint._validate(i.latitude,e),i._longitude=e}))},t.GeoPoint._validate=function(t,e){if(t<-90)throw new Error("AV.GeoPoint latitude "+t+" < -90.0.");if(t>90)throw new Error("AV.GeoPoint latitude "+t+" > 90.0.");if(e<-180)throw new Error("AV.GeoPoint longitude "+e+" < -180.0.");if(e>180)throw new Error("AV.GeoPoint longitude "+e+" > 180.0.")},t.GeoPoint.current=function(){return new t.Promise(function(e,n){navigator.geolocation.getCurrentPosition(function(n){e(new t.GeoPoint({latitude:n.coords.latitude,longitude:n.coords.longitude}))},n)})},t.GeoPoint.prototype={toJSON:function(){return t.GeoPoint._validate(this.latitude,this.longitude),{__type:"GeoPoint",latitude:this.latitude,longitude:this.longitude}},radiansTo:function(t){var e=Math.PI/180,n=this.latitude*e,r=this.longitude*e,i=t.latitude*e,o=t.longitude*e,a=n-i,s=r-o,u=Math.sin(a/2),c=Math.sin(s/2),l=u*u+Math.cos(n)*Math.cos(i)*c*c;return l=Math.min(1,l),2*Math.asin(Math.sqrt(l))},kilometersTo:function(t){return 6371*this.radiansTo(t)},milesTo:function(t){return 3958.8*this.radiansTo(t)}}}},function(t,e,n){"use strict";var r="function"==typeof Symbol&&"symbol"===s(Symbol.iterator)?function(t){return"undefined"==typeof t?"undefined":s(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":"undefined"==typeof t?"undefined":s(t)},i=n(4),o=n(1),a=function(t,e,n,r){i.applicationId&&t!==i.applicationId&&e!==i.applicationKey&&n!==i.masterKey&&console.warn("LeanCloud SDK is already initialized, please do not reinitialize it."),i.applicationId=t,i.applicationKey=e,i.masterKey=n,i._useMasterKey=!1},u=function(){console.warn("MasterKey is not supposed to be used in browser.")};i.init=function(){switch(arguments.length){case 1:var t=arguments.length<=0?void 0:arguments[0];if("object"!==("undefined"==typeof t?"undefined":r(t)))throw new Error("AV.init(): Parameter is not correct.");t.masterKey&&u(),a(t.appId,t.appKey,t.masterKey,t.hookKey),o.setServerUrlByRegion(t.region),i._config.disableCurrentUser=t.disableCurrentUser;break;case 2:case 3:console.warn("Please use AV.init() to replace AV.initialize(), AV.init() need an Object param, like { appId: 'YOUR_APP_ID', appKey: 'YOUR_APP_KEY' } . Docs: https://leancloud.cn/docs/sdk_setup-js.html"),3===arguments.length&&u(),a.apply(void 0,arguments),o.setServerUrlByRegion("cn")}},i.initialize=i.init},function(t,e,n){"use strict";var r=n(0),i=n(3),o=n(1).request;t.exports=function(t){t.Insight=t.Insight||{},r.extend(t.Insight,{startJob:function(e,n){if(!e||!e.sql)throw new Error("Please provide the sql to run the job.");var r={jobConfig:e,appId:t.applicationId},i=o("bigquery","jobs",null,"POST",t._encode(r,null,!0),n);return i.then(function(e){return t._decode(e).id})},on:function(t,e){}}),t.Insight.JobQuery=function(t,e){if(!t)throw new Error("Please provide the job id.");this.id=t,this.className=e,this._skip=0,this._limit=100},t.Insight.JobQuery.prototype={skip:function(t){return this._skip=t,this},limit:function(t){return this._limit=t,this},find:function(e){var n={skip:this._skip,limit:this._limit},r=o("bigquery","jobs",this.id,"GET",n,e);return r.then(function(e){return e.error?t.Promise.reject(new i(e.code,e.error)):t.Promise.resolve(e)})}}}},function(t,e,n){"use strict";var r=n(0),i=n(3),o=n(1).request,a=n(5),s=["objectId","createdAt","updatedAt"],u=function(t){if(s.indexOf(t)!==-1)throw new Error("key["+t+"] is reserved")};t.exports=function(t){t.Object=function(e,n){if(r.isString(e))return t.Object._create.apply(this,arguments);e=e||{},n&&n.parse&&(e=this.parse(e),e=this._mergeMagicFields(e));var i=t._getValue(this,"defaults");i&&(e=r.extend({},i,e)),n&&n.collection&&(this.collection=n.collection),this._serverData={},this._opSetQueue=[{}],this._flags={},this.attributes={},this._hashedJSON={},this._escapedAttributes={},this.cid=r.uniqueId("c"),this.changed={},this._silent={},this._pending={},this.set(e,{silent:!0}),this.changed={},this._silent={},this._pending={},this._hasData=!0,this._previousAttributes=r.clone(this.attributes),this.initialize.apply(this,arguments)},t.Object.saveAll=function(e,n){return t.Object._deepSaveAsync(e,null,n)},t.Object.fetchAll=function(e,n){return t.Promise.resolve().then(function(){return o("batch",null,null,"POST",{requests:r.map(e,function(t){if(!t.className)throw new Error("object must have className to fetch");if(!t.id)throw new Error("object must have id to fetch");if(t.dirty())throw new Error("object is modified but not saved");return{method:"GET",path:"/1.1/classes/"+t.className+"/"+t.id}})},n)}).then(function(t){return r.forEach(e,function(e,n){if(!t[n].success){var r=new Error(t[n].error.error);throw r.code=t[n].error.code,r}e._finishFetch(e.parse(t[n].success))}),e})},r.extend(t.Object.prototype,t.Events,{_fetchWhenSave:!1,initialize:function(){},fetchWhenSave:function(t){if(console.warn("AV.Object#fetchWhenSave is deprecated, use AV.Object#save with options.fetchWhenSave instead."),!r.isBoolean(t))throw new Error("Expect boolean value for fetchWhenSave");this._fetchWhenSave=t},getObjectId:function(){return this.id},getCreatedAt:function(){return this.createdAt||this.get("createdAt")},getUpdatedAt:function(){return this.updatedAt||this.get("updatedAt")},toJSON:function(){var e=this._toFullJSON();return t._arrayEach(["__type","className"],function(t){delete e[t]}),e},_toFullJSON:function(e){var n=r.clone(this.attributes);return t._objectEach(n,function(r,i){n[i]=t._encode(r,e)}),t._objectEach(this._operations,function(t,e){n[e]=t}),r.has(this,"id")&&(n.objectId=this.id),r.has(this,"createdAt")&&(r.isDate(this.createdAt)?n.createdAt=this.createdAt.toJSON():n.createdAt=this.createdAt),r.has(this,"updatedAt")&&(r.isDate(this.updatedAt)?n.updatedAt=this.updatedAt.toJSON():n.updatedAt=this.updatedAt),n.__type="Object",n.className=this.className,n},_refreshCache:function(){var e=this;e._refreshingCache||(e._refreshingCache=!0,t._objectEach(this.attributes,function(n,i){n instanceof t.Object?n._refreshCache():r.isObject(n)&&e._resetCacheForKey(i)&&e.set(i,new t.Op.Set(n),{silent:!0})}),delete e._refreshingCache)},dirty:function(t){this._refreshCache();var e=r.last(this._opSetQueue);return t?!!e[t]:!this.id||r.keys(e).length>0},_toPointer:function(){return{__type:"Pointer",className:this.className,objectId:this.id}},get:function(t){switch(t){case"objectId":return this.id;case"createdAt":case"updatedAt":return this[t];default:return this.attributes[t]}},relation:function(e){var n=this.get(e);if(n){if(!(n instanceof t.Relation))throw new Error("Called relation() on non-relation field "+e);return n._ensureParentAndKey(this,e),n}return new t.Relation(this,e)},escape:function(t){var e=this._escapedAttributes[t];if(e)return e;var n,i=this.attributes[t];return n=a.isNullOrUndefined(i)?"":r.escape(i.toString()), -this._escapedAttributes[t]=n,n},has:function(t){return!a.isNullOrUndefined(this.attributes[t])},_mergeMagicFields:function(e){var n=this,i=["objectId","createdAt","updatedAt"];return t._arrayEach(i,function(i){e[i]&&("objectId"===i?n.id=e[i]:"createdAt"!==i&&"updatedAt"!==i||r.isDate(e[i])?n[i]=e[i]:n[i]=t._parseDate(e[i]),delete e[i])}),e},_startSave:function(){this._opSetQueue.push({})},_cancelSave:function(){var e=r.first(this._opSetQueue);this._opSetQueue=r.rest(this._opSetQueue);var n=r.first(this._opSetQueue);t._objectEach(e,function(t,r){var i=e[r],o=n[r];i&&o?n[r]=o._mergeWithPrevious(i):i&&(n[r]=i)}),this._saving=this._saving-1},_finishSave:function(e){var n={};t._traverse(this.attributes,function(e){e instanceof t.Object&&e.id&&e._hasData&&(n[e.id]=e)});var i=r.first(this._opSetQueue);this._opSetQueue=r.rest(this._opSetQueue),this._applyOpSet(i,this._serverData),this._mergeMagicFields(e);var o=this;t._objectEach(e,function(e,r){o._serverData[r]=t._decode(e,r);var i=t._traverse(o._serverData[r],function(e){if(e instanceof t.Object&&n[e.id])return n[e.id]});i&&(o._serverData[r]=i)}),this._rebuildAllEstimatedData(),this._saving=this._saving-1},_finishFetch:function(e,n){this._opSetQueue=[{}],this._mergeMagicFields(e);var r=this;t._objectEach(e,function(e,n){r._serverData[n]=t._decode(e,n)}),this._rebuildAllEstimatedData(),this._refreshCache(),this._opSetQueue=[{}],this._hasData=n},_applyOpSet:function(e,n){var r=this;t._objectEach(e,function(e,i){n[i]=e._estimate(n[i],r,i),n[i]===t.Op._UNSET&&delete n[i]})},_resetCacheForKey:function(e){var n=this.attributes[e];if(r.isObject(n)&&!(n instanceof t.Object)&&!(n instanceof t.File)){n=n.toJSON?n.toJSON():n;var i=JSON.stringify(n);if(this._hashedJSON[e]!==i){var o=!!this._hashedJSON[e];return this._hashedJSON[e]=i,o}}return!1},_rebuildEstimatedDataForKey:function(e){var n=this;delete this.attributes[e],this._serverData[e]&&(this.attributes[e]=this._serverData[e]),t._arrayEach(this._opSetQueue,function(r){var i=r[e];i&&(n.attributes[e]=i._estimate(n.attributes[e],n,e),n.attributes[e]===t.Op._UNSET?delete n.attributes[e]:n._resetCacheForKey(e))})},_rebuildAllEstimatedData:function(){var e=this,n=r.clone(this.attributes);this.attributes=r.clone(this._serverData),t._arrayEach(this._opSetQueue,function(n){e._applyOpSet(n,e.attributes),t._objectEach(n,function(t,n){e._resetCacheForKey(n)})}),t._objectEach(n,function(t,n){e.attributes[n]!==t&&e.trigger("change:"+n,e,e.attributes[n],{})}),t._objectEach(this.attributes,function(t,i){r.has(n,i)||e.trigger("change:"+i,e,t,{})})},set:function(e,n,i){var o;if(r.isObject(e)||a.isNullOrUndefined(e)?(o=r.mapObject(e,function(e,n){return u(n),t._decode(e,n)}),i=n):(o={},u(e),o[e]=t._decode(n,e)),i=i||{},!o)return this;o instanceof t.Object&&(o=o.attributes),i.unset&&t._objectEach(o,function(e,n){o[n]=new t.Op.Unset});var s=r.clone(o),c=this;t._objectEach(s,function(e,n){e instanceof t.Op&&(s[n]=e._estimate(c.attributes[n],c,n),s[n]===t.Op._UNSET&&delete s[n])}),this._validate(o,i),i.changes={};var l=this._escapedAttributes;this._previousAttributes||{};return t._arrayEach(r.keys(o),function(e){var n=o[e];n instanceof t.Relation&&(n.parent=c),n instanceof t.Op||(n=new t.Op.Set(n));var a=!0;n instanceof t.Op.Set&&r.isEqual(c.attributes[e],n.value)&&(a=!1),a&&(delete l[e],i.silent?c._silent[e]=!0:i.changes[e]=!0);var s=r.last(c._opSetQueue);s[e]=n._mergeWithPrevious(s[e]),c._rebuildEstimatedDataForKey(e),a?(c.changed[e]=c.attributes[e],i.silent||(c._pending[e]=!0)):(delete c.changed[e],delete c._pending[e])}),i.silent||this.change(i),this},unset:function(t,e){return e=e||{},e.unset=!0,this.set(t,null,e)},increment:function(e,n){return(r.isUndefined(n)||r.isNull(n))&&(n=1),this.set(e,new t.Op.Increment(n))},add:function(e,n){return this.set(e,new t.Op.Add(a.ensureArray(n)))},addUnique:function(e,n){return this.set(e,new t.Op.AddUnique(a.ensureArray(n)))},remove:function(e,n){return this.set(e,new t.Op.Remove(a.ensureArray(n)))},op:function(t){return r.last(this._opSetQueue)[t]},clear:function(t){t=t||{},t.unset=!0;var e=r.extend(this.attributes,this._operations);return this.set(e,t)},_getSaveJSON:function(){var e=r.clone(r.first(this._opSetQueue));return t._objectEach(e,function(t,n){e[n]=t.toJSON()}),e},_canBeSerialized:function(){return t.Object._canBeSerializedAsValue(this.attributes)},fetch:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments[1];r.isArray(t.keys)&&(t.keys=t.keys.join(",")),r.isArray(t.include)&&(t.include=t.include.join(","));var n=this,i=o("classes",this.className,this.id,"GET",t,e);return i.then(function(t){return n._finishFetch(n.parse(t),!0),n})},save:function(e,n,i){var s,u,c;r.isObject(e)||a.isNullOrUndefined(e)?(s=e,c=n):(s={},s[e]=n,c=i),c=r.clone(c)||{},c.wait&&(u=r.clone(this.attributes));var l=r.clone(c)||{};l.wait&&(l.silent=!0),s&&this.set(s,l);var d=this;d._refreshCache();var f=[],h=[];return t.Object._findUnsavedChildren(d.attributes,f,h),f.length+h.length>0?t.Object._deepSaveAsync(this.attributes,d,c).then(function(){return d.save(null,c)}):(this._startSave(),this._saving=(this._saving||0)+1,this._allPreviousSaves=this._allPreviousSaves||t.Promise.resolve(),this._allPreviousSaves=this._allPreviousSaves.catch(function(t){}).then(function(){var t=d.id?"PUT":"POST",e=d._getSaveJSON();if(d._fetchWhenSave&&(e._fetchWhenSave=!0),c.fetchWhenSave&&(e._fetchWhenSave=!0),c.query){var n;if("function"==typeof c.query.toJSON&&(n=c.query.toJSON(),n&&(e._where=n.where)),!e._where){var i=new Error("options.query is not an AV.Query");throw i}}r.extend(e,d._flags);var a="classes",f=d.className;"_User"!==d.className||d.id||(a="users",f=null);var h=c._makeRequest||o,p=h(a,f,d.id,t,e,c);return p=p.then(function(t){var e=d.parse(t);return c.wait&&(e=r.extend(s||{},e)),d._finishSave(e),c.wait&&d.set(u,l),d},function(t){throw d._cancelSave(),t})}),this._allPreviousSaves)},destroy:function(t){t=t||{};var e=this,n=function(){e.trigger("destroy",e,e.collection,t)};if(!this.id)return n();t.wait||n();var r=o("classes",this.className,this.id,"DELETE",this._flags,t);return r.then(function(){return t.wait&&n(),e})},parse:function(e){var n=r.clone(e);return r(["createdAt","updatedAt"]).each(function(e){n[e]&&(n[e]=t._parseDate(n[e]))}),n.updatedAt||(n.updatedAt=n.createdAt),n},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return!this.id},change:function(e){e=e||{};var n=this._changing;this._changing=!0;var i=this;t._objectEach(this._silent,function(t){i._pending[t]=!0});var o=r.extend({},e.changes,this._silent);if(this._silent={},t._objectEach(o,function(t,n){i.trigger("change:"+n,i,i.get(n),e)}),n)return this;for(var a=function(t,e){i._pending[e]||i._silent[e]||delete i.changed[e]};!r.isEmpty(this._pending);)this._pending={},this.trigger("change",this,e),t._objectEach(this.changed,a),i._previousAttributes=r.clone(this.attributes);return this._changing=!1,this},hasChanged:function(t){return arguments.length?this.changed&&r.has(this.changed,t):!r.isEmpty(this.changed)},changedAttributes:function(e){if(!e)return!!this.hasChanged()&&r.clone(this.changed);var n={},i=this._previousAttributes;return t._objectEach(e,function(t,e){r.isEqual(i[e],t)||(n[e]=t)}),n},previous:function(t){return arguments.length&&this._previousAttributes?this._previousAttributes[t]:null},previousAttributes:function(){return r.clone(this._previousAttributes)},isValid:function(){try{this.validate(this.attributes)}catch(t){return!1}return!0},validate:function(e){if(r.has(e,"ACL")&&!(e.ACL instanceof t.ACL))throw new i(i.OTHER_CAUSE,"ACL must be a AV.ACL.")},_validate:function(t,e){!e.silent&&this.validate&&(t=r.extend({},this.attributes,t),this.validate(t))},getACL:function(){return this.get("ACL")},setACL:function(t,e){return this.set("ACL",t,e)},disableBeforeHook:function(){this.ignoreHook("beforeSave"),this.ignoreHook("beforeUpdate"),this.ignoreHook("beforeDelete")},disableAfterHook:function(){this.ignoreHook("afterSave"),this.ignoreHook("afterUpdate"),this.ignoreHook("afterDelete")},ignoreHook:function(e){r.contains(["beforeSave","afterSave","beforeUpdate","afterUpdate","beforeDelete","afterDelete"],e)||console.trace("Unsupported hookName: "+e),t.hookKey||console.trace("ignoreHook required hookKey"),this._flags.__ignore_hooks||(this._flags.__ignore_hooks=[]),this._flags.__ignore_hooks.push(e)}}),t.Object.createWithoutData=function(e,n,r){var i=new t.Object(e);return i.id=n,i._hasData=r,i},t.Object.destroyAll=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e||0===e.length)return t.Promise.resolve();var i=r.groupBy(e,function(t){return JSON.stringify({className:t.className,flags:t._flags})}),a={requests:r.map(i,function(t){var e=r.map(t,"id").join(",");return{method:"DELETE",path:"/1.1/classes/"+t[0].className+"/"+e,body:t[0]._flags}})};return o("batch",null,null,"POST",a,n)},t.Object._getSubclass=function(e){if(!r.isString(e))throw new Error("AV.Object._getSubclass requires a string argument.");var n=t.Object._classMap[e];return n||(n=t.Object.extend(e),t.Object._classMap[e]=n),n},t.Object._create=function(e,n,r){var i=t.Object._getSubclass(e);return new i(n,r)},t.Object._classMap={},t.Object._extend=t._extend,t.Object.new=function(e,n){return new t.Object(e,n)},t.Object.extend=function(e,n,i){if(!r.isString(e)){if(e&&r.has(e,"className"))return t.Object.extend(e.className,e,n);throw new Error("AV.Object.extend's first argument should be the className.")}"User"===e&&(e="_User");var o=null;if(r.has(t.Object._classMap,e)){var a=t.Object._classMap[e];if(!n&&!i)return a;o=a._extend(n,i)}else n=n||{},n._className=e,o=this._extend(n,i);return o.extend=function(n){if(r.isString(n)||n&&r.has(n,"className"))return t.Object.extend.apply(o,arguments);var i=[e].concat(r.toArray(arguments));return t.Object.extend.apply(o,i)},o.new=function(t,e){return new o(t,e)},t.Object._classMap[e]=o,o},Object.defineProperty(t.Object.prototype,"className",{get:function(){var t=this._className||this.constructor._LCClassName||this.constructor.name;return"User"===t?"_User":t}}),t.Object.register=function(e,n){if(!(e.prototype instanceof t.Object))throw new Error("registered class is not a subclass of AV.Object");var r=n||e.name;if(!r.length)throw new Error("registered class must be named");n&&(e._LCClassName=n),t.Object._classMap[r]=e},t.Object._findUnsavedChildren=function(e,n,r){t._traverse(e,function(e){return e instanceof t.Object?(e._refreshCache(),void(e.dirty()&&n.push(e))):e instanceof t.File?void(e.url()||e.id||r.push(e)):void 0})},t.Object._canBeSerializedAsValue=function(e){var n=!0;return e instanceof t.Object||e instanceof t.File?n=!!e.id:r.isArray(e)?t._arrayEach(e,function(e){t.Object._canBeSerializedAsValue(e)||(n=!1)}):r.isObject(e)&&t._objectEach(e,function(e){t.Object._canBeSerializedAsValue(e)||(n=!1)}),n},t.Object._deepSaveAsync=function(e,n,a){var s=[],u=[];t.Object._findUnsavedChildren(e,s,u),n&&(s=r.filter(s,function(t){return t!=n}));var c=t.Promise.resolve();r.each(u,function(t){c=c.then(function(){return t.save()})});var l=r.uniq(s),d=r.uniq(l);return c.then(function(){return t.Promise._continueWhile(function(){return d.length>0},function(){var e=[],n=[];if(t._arrayEach(d,function(t){return e.length>20?void n.push(t):void(t._canBeSerialized()?e.push(t):n.push(t))}),d=n,0===e.length)return t.Promise.reject(new i(i.OTHER_CAUSE,"Tried to save a batch with a cycle."));var s=t.Promise.resolve(r.map(e,function(e){return e._allPreviousSaves||t.Promise.resolve()})),u=s.then(function(){return o("batch",null,null,"POST",{requests:r.map(e,function(t){var e=t._getSaveJSON();r.extend(e,t._flags);var n="POST",i="/1.1/classes/"+t.className;return t.id&&(i=i+"/"+t.id,n="PUT"),t._startSave(),{method:n,path:i,body:e}})},a).then(function(n){var r;if(t._arrayEach(e,function(t,e){n[e].success?t._finishSave(t.parse(n[e].success)):(r=r||n[e].error,t._cancelSave())}),r)return t.Promise.reject(new i(r.code,r.error))})});return t._arrayEach(e,function(t){t._allPreviousSaves=u}),u})}).then(function(){return e})}}},function(t,e,n){"use strict";var r=n(0);t.exports=function(t){t.Op=function(){this._initialize.apply(this,arguments)},t.Op.prototype={_initialize:function(){}},r.extend(t.Op,{_extend:t._extend,_opDecoderMap:{},_registerDecoder:function(e,n){t.Op._opDecoderMap[e]=n},_decode:function(e){var n=t.Op._opDecoderMap[e.__op];return n?n(e):void 0}}),t.Op._registerDecoder("Batch",function(e){var n=null;return t._arrayEach(e.ops,function(e){e=t.Op._decode(e),n=e._mergeWithPrevious(n)}),n}),t.Op.Set=t.Op._extend({_initialize:function(t){this._value=t},value:function(){return this._value},toJSON:function(){return t._encode(this.value())},_mergeWithPrevious:function(t){return this},_estimate:function(t){return this.value()}}),t.Op._UNSET={},t.Op.Unset=t.Op._extend({toJSON:function(){return{__op:"Delete"}},_mergeWithPrevious:function(t){return this},_estimate:function(e){return t.Op._UNSET}}),t.Op._registerDecoder("Delete",function(e){return new t.Op.Unset}),t.Op.Increment=t.Op._extend({_initialize:function(t){this._amount=t},amount:function(){return this._amount},toJSON:function(){return{__op:"Increment",amount:this._amount}},_mergeWithPrevious:function(e){if(e){if(e instanceof t.Op.Unset)return new t.Op.Set(this.amount());if(e instanceof t.Op.Set)return new t.Op.Set(e.value()+this.amount());if(e instanceof t.Op.Increment)return new t.Op.Increment(this.amount()+e.amount());throw new Error("Op is invalid after previous op.")}return this},_estimate:function(t){return t?t+this.amount():this.amount()}}),t.Op._registerDecoder("Increment",function(e){return new t.Op.Increment(e.amount)}),t.Op.Add=t.Op._extend({_initialize:function(t){this._objects=t},objects:function(){return this._objects},toJSON:function(){return{__op:"Add",objects:t._encode(this.objects())}},_mergeWithPrevious:function(e){if(e){if(e instanceof t.Op.Unset)return new t.Op.Set(this.objects());if(e instanceof t.Op.Set)return new t.Op.Set(this._estimate(e.value()));if(e instanceof t.Op.Add)return new t.Op.Add(e.objects().concat(this.objects()));throw new Error("Op is invalid after previous op.")}return this},_estimate:function(t){return t?t.concat(this.objects()):r.clone(this.objects())}}),t.Op._registerDecoder("Add",function(e){return new t.Op.Add(t._decode(e.objects))}),t.Op.AddUnique=t.Op._extend({_initialize:function(t){this._objects=r.uniq(t)},objects:function(){return this._objects},toJSON:function(){return{__op:"AddUnique",objects:t._encode(this.objects())}},_mergeWithPrevious:function(e){if(e){if(e instanceof t.Op.Unset)return new t.Op.Set(this.objects());if(e instanceof t.Op.Set)return new t.Op.Set(this._estimate(e.value()));if(e instanceof t.Op.AddUnique)return new t.Op.AddUnique(this._estimate(e.objects()));throw new Error("Op is invalid after previous op.")}return this},_estimate:function(e){if(e){var n=r.clone(e);return t._arrayEach(this.objects(),function(e){if(e instanceof t.Object&&e.id){var i=r.find(n,function(n){return n instanceof t.Object&&n.id===e.id});if(i){var o=r.indexOf(n,i);n[o]=e}else n.push(e)}else r.contains(n,e)||n.push(e)}),n}return r.clone(this.objects())}}),t.Op._registerDecoder("AddUnique",function(e){return new t.Op.AddUnique(t._decode(e.objects))}),t.Op.Remove=t.Op._extend({_initialize:function(t){this._objects=r.uniq(t)},objects:function(){return this._objects},toJSON:function(){return{__op:"Remove",objects:t._encode(this.objects())}},_mergeWithPrevious:function(e){if(e){if(e instanceof t.Op.Unset)return e;if(e instanceof t.Op.Set)return new t.Op.Set(this._estimate(e.value()));if(e instanceof t.Op.Remove)return new t.Op.Remove(r.union(e.objects(),this.objects()));throw new Error("Op is invalid after previous op.")}return this},_estimate:function(e){if(e){var n=r.difference(e,this.objects());return t._arrayEach(this.objects(),function(e){e instanceof t.Object&&e.id&&(n=r.reject(n,function(n){return n instanceof t.Object&&n.id===e.id}))}),n}return[]}}),t.Op._registerDecoder("Remove",function(e){return new t.Op.Remove(t._decode(e.objects))}),t.Op.Relation=t.Op._extend({_initialize:function(e,n){this._targetClassName=null;var i=this,o=function(e){if(e instanceof t.Object){if(!e.id)throw new Error("You can't add an unsaved AV.Object to a relation.");if(i._targetClassName||(i._targetClassName=e.className),i._targetClassName!==e.className)throw new Error("Tried to create a AV.Relation with 2 different types: "+i._targetClassName+" and "+e.className+".");return e.id}return e};this.relationsToAdd=r.uniq(r.map(e,o)),this.relationsToRemove=r.uniq(r.map(n,o))},added:function(){var e=this;return r.map(this.relationsToAdd,function(n){var r=t.Object._create(e._targetClassName);return r.id=n,r})},removed:function(){var e=this;return r.map(this.relationsToRemove,function(n){var r=t.Object._create(e._targetClassName);return r.id=n,r})},toJSON:function(){var t=null,e=null,n=this,i=function(t){return{__type:"Pointer",className:n._targetClassName,objectId:t}},o=null;return this.relationsToAdd.length>0&&(o=r.map(this.relationsToAdd,i),t={__op:"AddRelation",objects:o}),this.relationsToRemove.length>0&&(o=r.map(this.relationsToRemove,i),e={__op:"RemoveRelation",objects:o}),t&&e?{__op:"Batch",ops:[t,e]}:t||e||{}},_mergeWithPrevious:function(e){if(e){if(e instanceof t.Op.Unset)throw new Error("You can't modify a relation after deleting it.");if(e instanceof t.Op.Relation){if(e._targetClassName&&e._targetClassName!==this._targetClassName)throw new Error("Related object must be of class "+e._targetClassName+", but "+this._targetClassName+" was passed in.");var n=r.union(r.difference(e.relationsToAdd,this.relationsToRemove),this.relationsToAdd),i=r.union(r.difference(e.relationsToRemove,this.relationsToAdd),this.relationsToRemove),o=new t.Op.Relation(n,i);return o._targetClassName=this._targetClassName,o}throw new Error("Op is invalid after previous op.")}return this},_estimate:function(e,n,r){if(e){if(e instanceof t.Relation){if(this._targetClassName)if(e.targetClassName){if(e.targetClassName!==this._targetClassName)throw new Error("Related object must be a "+e.targetClassName+", but a "+this._targetClassName+" was passed in.")}else e.targetClassName=this._targetClassName;return e}throw new Error("Op is invalid after previous op.")}var i=new t.Relation(n,r);i.targetClassName=this._targetClassName}}),t.Op._registerDecoder("AddRelation",function(e){return new t.Op.Relation(t._decode(e.objects),[])}),t.Op._registerDecoder("RemoveRelation",function(e){return new t.Op.Relation([],t._decode(e.objects))})}},function(t,e,n){"use strict";var r=n(1).request;t.exports=function(t){t.Installation=t.Object.extend("_Installation"),t.Push=t.Push||{},t.Push.send=function(t,e){if(t.where&&(t.where=t.where.toJSON().where),t.where&&t.cql)throw new Error("Both where and cql can't be set");if(t.push_time&&(t.push_time=t.push_time.toJSON()),t.expiration_time&&(t.expiration_time=t.expiration_time.toJSON()),t.expiration_time&&t.expiration_time_interval)throw new Error("Both expiration_time and expiration_time_interval can't be set");var n=r("push",null,null,"POST",t,e);return n}}},function(t,e,n){"use strict";var r=n(0),i=n(3),o=n(1).request,a=n(5),s=a.ensureArray,u=function(t,e){if(void 0===t)throw new Error(e)};t.exports=function(t){t.Query=function(e){r.isString(e)&&(e=t.Object._getSubclass(e)),this.objectClass=e,this.className=e.prototype.className,this._where={},this._include=[],this._select=[],this._limit=-1,this._skip=0,this._extraOptions={}},t.Query.or=function(){var e=r.toArray(arguments),n=null;t._arrayEach(e,function(t){if(r.isNull(n)&&(n=t.className),n!==t.className)throw new Error("All queries must be for the same class")});var i=new t.Query(n);return i._orQuery(e),i},t.Query.and=function(){var e=r.toArray(arguments),n=null;t._arrayEach(e,function(t){if(r.isNull(n)&&(n=t.className),n!==t.className)throw new Error("All queries must be for the same class")});var i=new t.Query(n);return i._andQuery(e),i},t.Query.doCloudQuery=function(e,n,i){var a={cql:e};r.isArray(n)?a.pvalues=n:i=n;var s=o("cloudQuery",null,null,"GET",a,i);return s.then(function(e){var n=new t.Query(e.className),i=r.map(e.results,function(t){var r=n._newObject(e);return r._finishFetch&&r._finishFetch(n._processResult(t),!0),r});return{results:i,count:e.count,className:e.className}})},t.Query._extend=t._extend,t.Query.prototype={_processResult:function(t){return t},get:function(t,e){if(!t){var n=new i(i.OBJECT_NOT_FOUND,"Object not found.");throw n}var r=this,o=r._newObject();o.id=t;var a=r.toJSON(),s={};return a.keys&&(s.keys=a.keys),a.include&&(s.include=a.include),o.fetch(s,e)},toJSON:function(){var e={where:this._where};return this._include.length>0&&(e.include=this._include.join(",")),this._select.length>0&&(e.keys=this._select.join(",")),this._limit>=0&&(e.limit=this._limit),this._skip>0&&(e.skip=this._skip),void 0!==this._order&&(e.order=this._order),t._objectEach(this._extraOptions,function(t,n){e[n]=t}),e},_newObject:function(e){var n;return n=e&&e.className?new t.Object(e.className):new this.objectClass},_createRequest:function(t,e){return o("classes",this.className,null,"GET",t||this.toJSON(),e)},find:function(t){var e=this,n=this._createRequest(null,t);return n.then(function(t){return r.map(t.results,function(n){var r=e._newObject(t);return r._finishFetch&&r._finishFetch(e._processResult(n),!0),r})})},destroyAll:function(e){var n=this;return n.find(e).then(function(e){return t.Object.destroyAll(e)})},count:function(t){var e=this.toJSON();e.limit=0,e.count=1;var n=this._createRequest(e,t);return n.then(function(t){return t.count})},first:function(t){var e=this,n=this.toJSON();n.limit=1;var i=this._createRequest(n,t);return i.then(function(t){return r.map(t.results,function(t){var n=e._newObject();return n._finishFetch&&n._finishFetch(e._processResult(t),!0),n})[0]})},skip:function(t){return u(t,"undefined is not a valid skip value"),this._skip=t,this},limit:function(t){return u(t,"undefined is not a valid limit value"),this._limit=t,this},equalTo:function(e,n){return u(e,"undefined is not a valid key"),u(n,"undefined is not a valid value"),this._where[e]=t._encode(n),this},_addCondition:function(e,n,r){return u(e,"undefined is not a valid condition key"),u(n,"undefined is not a valid condition"),u(r,"undefined is not a valid condition value"),this._where[e]||(this._where[e]={}),this._where[e][n]=t._encode(r),this},sizeEqualTo:function(t,e){this._addCondition(t,"$size",e)},notEqualTo:function(t,e){return this._addCondition(t,"$ne",e),this},lessThan:function(t,e){return this._addCondition(t,"$lt",e),this},greaterThan:function(t,e){return this._addCondition(t,"$gt",e),this},lessThanOrEqualTo:function(t,e){return this._addCondition(t,"$lte",e),this},greaterThanOrEqualTo:function(t,e){return this._addCondition(t,"$gte",e),this},containedIn:function(t,e){return this._addCondition(t,"$in",e),this},notContainedIn:function(t,e){return this._addCondition(t,"$nin",e),this},containsAll:function(t,e){return this._addCondition(t,"$all",e),this},exists:function(t){return this._addCondition(t,"$exists",!0),this},doesNotExist:function(t){return this._addCondition(t,"$exists",!1),this},matches:function(t,e,n){return this._addCondition(t,"$regex",e),n||(n=""),e.ignoreCase&&(n+="i"),e.multiline&&(n+="m"),n&&n.length&&this._addCondition(t,"$options",n),this},matchesQuery:function(t,e){var n=e.toJSON();return n.className=e.className,this._addCondition(t,"$inQuery",n),this},doesNotMatchQuery:function(t,e){var n=e.toJSON();return n.className=e.className,this._addCondition(t,"$notInQuery",n),this},matchesKeyInQuery:function(t,e,n){var r=n.toJSON();return r.className=n.className,this._addCondition(t,"$select",{key:e,query:r}),this},doesNotMatchKeyInQuery:function(t,e,n){var r=n.toJSON();return r.className=n.className,this._addCondition(t,"$dontSelect",{key:e,query:r}),this},_orQuery:function(t){var e=r.map(t,function(t){return t.toJSON().where});return this._where.$or=e,this},_andQuery:function(t){var e=r.map(t,function(t){return t.toJSON().where});return this._where.$and=e,this},_quote:function(t){return"\\Q"+t.replace("\\E","\\E\\\\E\\Q")+"\\E"},contains:function(t,e){return this._addCondition(t,"$regex",this._quote(e)),this},startsWith:function(t,e){return this._addCondition(t,"$regex","^"+this._quote(e)),this},endsWith:function(t,e){return this._addCondition(t,"$regex",this._quote(e)+"$"),this},ascending:function(t){return u(t,"undefined is not a valid key"),this._order=t,this},addAscending:function(t){return u(t,"undefined is not a valid key"),this._order?this._order+=","+t:this._order=t,this},descending:function(t){return u(t,"undefined is not a valid key"),this._order="-"+t,this},addDescending:function(t){return u(t,"undefined is not a valid key"),this._order?this._order+=",-"+t:this._order="-"+t,this},near:function(e,n){return n instanceof t.GeoPoint||(n=new t.GeoPoint(n)),this._addCondition(e,"$nearSphere",n),this},withinRadians:function(t,e,n){return this.near(t,e),this._addCondition(t,"$maxDistance",n),this},withinMiles:function(t,e,n){return this.withinRadians(t,e,n/3958.8)},withinKilometers:function(t,e,n){return this.withinRadians(t,e,n/6371)},withinGeoBox:function(e,n,r){return n instanceof t.GeoPoint||(n=new t.GeoPoint(n)),r instanceof t.GeoPoint||(r=new t.GeoPoint(r)),this._addCondition(e,"$within",{$box:[n,r]}),this},include:function(t){var e=this;return u(t,"undefined is not a valid key"),r(arguments).forEach(function(t){e._include=e._include.concat(s(t))}),this},select:function(t){var e=this;return u(t,"undefined is not a valid key"),r(arguments).forEach(function(t){e._select=e._select.concat(s(t))}),this},each:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this._order||this._skip||this._limit>=0){var i=new Error("Cannot iterate on a query with sort, skip, or limit.");return t.Promise.reject(i)}var o=new t.Query(this.objectClass);o._limit=n.batchSize||100,o._where=r.clone(this._where),o._include=r.clone(this._include),o.ascending("objectId");var a=!1;return t.Promise._continueWhile(function(){return!a},function(){return o.find(n).then(function(n){var i=t.Promise.resolve();return r.each(n,function(t){i=i.then(function(){return e(t)})}),i.then(function(){n.length>=o._limit?o.greaterThan("objectId",n[n.length-1].id):a=!0})})})}},t.FriendShipQuery=t.Query._extend({_objectClass:t.User,_newObject:function(){return new t.User},_processResult:function(t){if(t&&t[this._friendshipTag]){var e=t[this._friendshipTag];return"Pointer"===e.__type&&"_User"===e.className&&(delete e.__type,delete e.className),e}return null}})}},function(t,e,n){"use strict";var r=n(0);t.exports=function(t){t.Relation=function(t,e){if(!r.isString(e))throw new TypeError("key must be a string");this.parent=t,this.key=e,this.targetClassName=null},t.Relation.reverseQuery=function(e,n,r){var i=new t.Query(e);return i.equalTo(n,r._toPointer()),i},t.Relation.prototype={_ensureParentAndKey:function(t,e){if(this.parent=this.parent||t,this.key=this.key||e,this.parent!==t)throw new Error("Internal Error. Relation retrieved from two different Objects.");if(this.key!==e)throw new Error("Internal Error. Relation retrieved from two different keys.")},add:function(e){r.isArray(e)||(e=[e]);var n=new t.Op.Relation(e,[]);this.parent.set(this.key,n),this.targetClassName=n._targetClassName},remove:function(e){r.isArray(e)||(e=[e]);var n=new t.Op.Relation([],e);this.parent.set(this.key,n),this.targetClassName=n._targetClassName},toJSON:function(){return{__type:"Relation",className:this.targetClassName}},query:function e(){var n,e;return this.targetClassName?(n=t.Object._getSubclass(this.targetClassName),e=new t.Query(n)):(n=t.Object._getSubclass(this.parent.className),e=new t.Query(n),e._extraOptions.redirectClassNameForKey=this.key),e._addCondition("$relatedTo","object",this.parent._toPointer()),e._addCondition("$relatedTo","key",this.key),e}}}},function(t,e,n){"use strict";var r=n(0),i=n(3);t.exports=function(t){t.Role=t.Object.extend("_Role",{constructor:function(e,n){if(r.isString(e)?(t.Object.prototype.constructor.call(this,null,null),this.setName(e)):t.Object.prototype.constructor.call(this,e,n),void 0===n){var i=new t.ACL;i.setPublicReadAccess(!0),this.getACL()||this.setACL(i)}else{if(!(n instanceof t.ACL))throw new TypeError("acl must be an instance of AV.ACL");this.setACL(n)}},getName:function(){return this.get("name")},setName:function(t,e){return this.set("name",t,e)},getUsers:function(){return this.relation("users")},getRoles:function(){return this.relation("roles")},validate:function(e,n){if("name"in e&&e.name!==this.getName()){var o=e.name;if(this.id&&this.id!==e.objectId)return new i(i.OTHER_CAUSE,"A role's name can only be set before it has been saved.");if(!r.isString(o))return new i(i.OTHER_CAUSE,"A role's name must be a String.");if(!/^[0-9a-zA-Z\-_ ]+$/.test(o))return new i(i.OTHER_CAUSE,"A role's name can only contain alphanumeric characters, _, -, and spaces.")}return!!t.Object.prototype.validate&&t.Object.prototype.validate.call(this,e,n)}})}},function(t,e,n){"use strict";var r=n(0),i=n(1).request;t.exports=function(t){t.SearchSortBuilder=function(){this._sortFields=[]},t.SearchSortBuilder.prototype={_addField:function(t,e,n,r){var i={};return i[t]={order:e||"asc",mode:n||"avg",missing:"_"+(r||"last")},this._sortFields.push(i),this},ascending:function(t,e,n){return this._addField(t,"asc",e,n)},descending:function(t,e,n){return this._addField(t,"desc",e,n)},whereNear:function(t,e,n){n=n||{};var r={},i={lat:e.latitude,lon:e.longitude},o={order:n.order||"asc",mode:n.mode||"avg",unit:n.unit||"km"};return o[t]=i,r._geo_distance=o,this._sortFields.push(r),this},build:function(){return JSON.stringify(t._encode(this._sortFields))}},t.SearchQuery=t.Query._extend({_sid:null,_hits:0,_queryString:null,_highlights:null,_sortBuilder:null,_createRequest:function(t,e){return i("search/select",null,null,"GET",t||this.toJSON(),e)},sid:function(t){return this._sid=t,this},queryString:function(t){return this._queryString=t,this},highlights:function(t){var e;return e=t&&r.isString(t)?arguments:t,this._highlights=e,this},sortBy:function(t){return this._sortBuilder=t,this},hits:function(){return this._hits||(this._hits=0),this._hits},_processResult:function(t){return delete t.className,delete t._app_url,delete t._deeplink,t},hasMore:function(){return!this._hitEnd},reset:function(){this._hitEnd=!1,this._sid=null,this._hits=0},find:function(){var t=this,e=this._createRequest();return e.then(function(e){return e.sid?(t._oldSid=t._sid,t._sid=e.sid):(t._sid=null,t._hitEnd=!0),t._hits=e.hits||0,r.map(e.results,function(n){n.className&&(e.className=n.className);var r=t._newObject(e);return r.appURL=n._app_url,r._finishFetch(t._processResult(n),!0),r})})},toJSON:function(){var e=t.SearchQuery.__super__.toJSON.call(this);if(delete e.where,this.className&&(e.clazz=this.className),this._sid&&(e.sid=this._sid),!this._queryString)throw new Error("Please set query string.");if(e.q=this._queryString,this._highlights&&(e.highlights=this._highlights.join(",")),this._sortBuilder&&e.order)throw new Error("sort and order can not be set at same time.");return this._sortBuilder&&(e.sort=this._sortBuilder.build()),e}})}},function(t,e,n){"use strict";var r="function"==typeof Symbol&&"symbol"===s(Symbol.iterator)?function(t){return"undefined"==typeof t?"undefined":s(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":"undefined"==typeof t?"undefined":s(t)},i=n(0),o=n(1).request;t.exports=function(t){var e=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t.User.currentAsync().then(function(n){return n||t.User._fetchUserBySessionToken(e.sessionToken)})},n=function(n){return e(n).then(function(e){return t.Object.createWithoutData("_User",e.id)._toPointer()})};t.Status=function(t,e){return this.data={},this.inboxType="default",this.query=null,t&&"object"===("undefined"==typeof t?"undefined":r(t))?this.data=t:(t&&(this.data.image=t), -e&&(this.data.message=e)),this},t.Status.prototype={get:function(t){return this.data[t]},set:function(t,e){return this.data[t]=e,this},destroy:function(e){if(!this.id)return t.Promise.reject(new Error("The status id is not exists."));var n=o("statuses",null,this.id,"DELETE",e&&e.sessionToken);return n},toObject:function(){return this.id?t.Object.createWithoutData("_Status",this.id):null},_getDataJSON:function(){var e=i.clone(this.data);return t._encode(e)},send:function(){var e=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!r.sessionToken&&!t.User.current())throw new Error("Please signin an user.");return this.query?n(r).then(function(t){var n=e.query.toJSON();n.className=e.query.className;var i={};return i.query=n,e.data=e.data||{},e.data.source=e.data.source||t,i.data=e._getDataJSON(),i.inboxType=e.inboxType||"default",o("statuses",null,null,"POST",i,r.sessionToken)}).then(function(n){return e.id=n.objectId,e.createdAt=t._parseDate(n.createdAt),e}):t.Status.sendStatusToFollowers(this,r)},_finishFetch:function(e){this.id=e.objectId,this.createdAt=t._parseDate(e.createdAt),this.updatedAt=t._parseDate(e.updatedAt),this.messageId=e.messageId,delete e.messageId,delete e.objectId,delete e.createdAt,delete e.updatedAt,this.data=t._decode(e)}},t.Status.sendStatusToFollowers=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!r.sessionToken&&!t.User.current())throw new Error("Please signin an user.");return n(r).then(function(n){var i={};i.className="_Follower",i.keys="follower",i.where={user:n};var a={};a.query=i,e.data=e.data||{},e.data.source=e.data.source||n,a.data=e._getDataJSON(),a.inboxType=e.inboxType||"default";var s=o("statuses",null,null,"POST",a,r.sessionToken);return s.then(function(n){return e.id=n.objectId,e.createdAt=t._parseDate(n.createdAt),e})})},t.Status.sendPrivateStatus=function(e,r){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!a.sessionToken&&!t.User.current())throw new Error("Please signin an user.");if(!r)throw new Error("Invalid target user.");var s=i.isString(r)?r:r.id;if(!s)throw new Error("Invalid target user.");return n(a).then(function(n){var r={};r.className="_User",r.where={objectId:s};var i={};i.query=r,e.data=e.data||{},e.data.source=e.data.source||n,i.data=e._getDataJSON(),i.inboxType="private",e.inboxType="private";var u=o("statuses",null,null,"POST",i,a.sessionToken);return u.then(function(n){return e.id=n.objectId,e.createdAt=t._parseDate(n.createdAt),e})})},t.Status.countUnreadStatuses=function(n){var r=(i.isString(arguments[1])?arguments[2]:arguments[1])||{},a=i.isString(arguments[1])?arguments[1]:"default";if(!r.sessionToken&&null==n&&!t.User.current())throw new Error("Please signin an user or pass the owner objectId.");return e(r).then(function(e){var n={};return n.inboxType=t._encode(a),n.owner=t._encode(e),o("subscribe/statuses/count",null,null,"GET",n,r.sessionToken)})},t.Status.statusQuery=function(e){var n=new t.Query("_Status");return e&&n.equalTo("source",e),n},t.InboxQuery=t.Query._extend({_objectClass:t.Status,_sinceId:0,_maxId:0,_inboxType:"default",_owner:null,_newObject:function(){return new t.Status},_createRequest:function(t,e){return o("subscribe/statuses",null,null,"GET",t||this.toJSON(),e&&e.sessionToken)},sinceId:function(t){return this._sinceId=t,this},maxId:function(t){return this._maxId=t,this},owner:function(t){return this._owner=t,this},inboxType:function(t){return this._inboxType=t,this},toJSON:function(){var e=t.InboxQuery.__super__.toJSON.call(this);return e.owner=t._encode(this._owner),e.inboxType=t._encode(this._inboxType),e.sinceId=t._encode(this._sinceId),e.maxId=t._encode(this._maxId),e}}),t.Status.inboxQuery=function(e,n){var r=new t.InboxQuery(t.Status);return e&&(r._owner=e),n&&(r._inboxType=n),r}}},function(t,e,n){"use strict";var r=n(0),i=n(3),o=n(1).request,a=n(2),s=function(){if("undefined"==typeof wx||"function"!=typeof wx.login)throw new Error("Weapp Login is only available in Weapp");return new a(function(t,e){wx.login({success:function(n){var r=n.code,i=n.errMsg;r?t(r):e(new Error(i))}})})};t.exports=function(t){t.User=t.Object.extend("_User",{_isCurrentUser:!1,_mergeMagicFields:function(e){e.sessionToken&&(this._sessionToken=e.sessionToken,delete e.sessionToken),t.User.__super__._mergeMagicFields.call(this,e)},_cleanupAuthData:function(){if(this.isCurrent()){var e=this.get("authData");e&&t._objectEach(this.get("authData"),function(t,n){e[n]||delete e[n]})}},_synchronizeAllAuthData:function(){var e=this.get("authData");if(e){var n=this;t._objectEach(this.get("authData"),function(t,e){n._synchronizeAuthData(e)})}},_synchronizeAuthData:function(e){if(this.isCurrent()){var n;r.isString(e)?(n=e,e=t.User._authProviders[n]):n=e.getAuthType();var i=this.get("authData");if(i&&e){var o=e.restoreAuthentication(i[n]);o||this._unlinkFrom(e)}}},_handleSaveResult:function(e){return e&&!t._config.disableCurrentUser&&(this._isCurrentUser=!0),this._cleanupAuthData(),this._synchronizeAllAuthData(),delete this._serverData.password,this._rebuildEstimatedDataForKey("password"),this._refreshCache(),!e&&!this.isCurrent()||t._config.disableCurrentUser?a.resolve():a.resolve(t.User._saveCurrentUser(this))},_linkWith:function(e,n){var i,o=this;if(r.isString(e)?(i=e,e=t.User._authProviders[e]):i=e.getAuthType(),n){var a=this.get("authData")||{};return a[i]=n,this.save({authData:a}).then(function(t){return t._handleSaveResult(!0).then(function(){return t})})}return e.authenticate().then(function(t){return o._linkWith(e,t)})},linkWithWeapp:function(){var t=this;return s().then(function(e){return t._linkWith("lc_weapp",{code:e})})},_unlinkFrom:function(e){var n=this;return r.isString(e)&&(e=t.User._authProviders[e]),this._linkWith(e,null).then(function(t){return n._synchronizeAuthData(e),t})},_isLinked:function(t){var e;e=r.isString(t)?t:t.getAuthType();var n=this.get("authData")||{};return!!n[e]},logOut:function(){this._logOutWithAll(),this._isCurrentUser=!1},_logOutWithAll:function(){var e=this.get("authData");if(e){var n=this;t._objectEach(this.get("authData"),function(t,e){n._logOutWith(e)})}},_logOutWith:function(e){this.isCurrent()&&(r.isString(e)&&(e=t.User._authProviders[e]),e&&e.deauthenticate&&e.deauthenticate())},signUp:function(t,e){var n,r=t&&t.username||this.get("username");if(!r||""===r)throw n=new i(i.OTHER_CAUSE,"Cannot sign up user with an empty name.");var o=t&&t.password||this.get("password");if(!o||""===o)throw n=new i(i.OTHER_CAUSE,"Cannot sign up user with an empty password.");return this.save(t,e).then(function(t){return t._handleSaveResult(!0).then(function(){return t})})},signUpOrlogInWithMobilePhone:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t&&t.mobilePhoneNumber||this.get("mobilePhoneNumber");if(!r||""===r)throw e=new i(i.OTHER_CAUSE,"Cannot sign up or login user by mobilePhoneNumber with an empty mobilePhoneNumber.");var a=t&&t.smsCode||this.get("smsCode");if(!a||""===a)throw e=new i(i.OTHER_CAUSE,"Cannot sign up or login user by mobilePhoneNumber with an empty smsCode.");return n._makeRequest=function(t,e,n,r,i){return o("usersByMobilePhone",null,null,"POST",i)},this.save(t,n).then(function(t){return delete t.attributes.smsCode,delete t._serverData.smsCode,t._handleSaveResult(!0).then(function(){return t})})},logIn:function(){var t=this,e=o("login",null,null,"POST",this.toJSON());return e.then(function(e){var n=t.parse(e);return t._finishFetch(n),t._handleSaveResult(!0).then(function(){return n.smsCode||delete t.attributes.smsCode,t})})},save:function(e,n,i){var o,a;return r.isObject(e)||r.isNull(e)||r.isUndefined(e)?(o=e,a=n):(o={},o[e]=n,a=i),a=a||{},t.Object.prototype.save.call(this,o,a).then(function(t){return t._handleSaveResult(!1).then(function(){return t})})},follow:function(t,e){if(!this.id)throw new Error("Please signin.");if(!t)throw new Error("Invalid target user.");var n=r.isString(t)?t:t.id;if(!n)throw new Error("Invalid target user.");var i="users/"+this.id+"/friendship/"+n,a=o(i,null,null,"POST",null,e);return a},unfollow:function(t,e){if(!this.id)throw new Error("Please signin.");if(!t)throw new Error("Invalid target user.");var n=r.isString(t)?t:t.id;if(!n)throw new Error("Invalid target user.");var i="users/"+this.id+"/friendship/"+n,a=o(i,null,null,"DELETE",null,e);return a},followerQuery:function(){return t.User.followerQuery(this.id)},followeeQuery:function(){return t.User.followeeQuery(this.id)},fetch:function(e,n){return t.Object.prototype.fetch.call(this,e,n).then(function(t){return t._handleSaveResult(!1).then(function(){return t})})},updatePassword:function(t,e,n){var r="users/"+this.id+"/updatePassword",i={old_password:t,new_password:e},a=o(r,null,null,"PUT",i,n);return a},isCurrent:function(){return this._isCurrentUser},getUsername:function(){return this.get("username")},getMobilePhoneNumber:function(){return this.get("mobilePhoneNumber")},setMobilePhoneNumber:function(t,e){return this.set("mobilePhoneNumber",t,e)},setUsername:function(t,e){return this.set("username",t,e)},setPassword:function(t,e){return this.set("password",t,e)},getEmail:function(){return this.get("email")},setEmail:function(t,e){return this.set("email",t,e)},authenticated:function(){return console.warn("DEPRECATED: 如果要判断当前用户的登录状态是否有效,请使用 currentUser.isAuthenticated().then(),如果要判断该用户是否是当前登录用户,请使用 user.id === currentUser.id。"),!!this._sessionToken&&!t._config.disableCurrentUser&&t.User.current()&&t.User.current().id===this.id},isAuthenticated:function(){var e=this;return a.resolve().then(function(){return!!e._sessionToken&&t.User._fetchUserBySessionToken(e._sessionToken).then(function(){return!0},function(t){if(211===t.code)return!1;throw t})})},getSessionToken:function(){return this._sessionToken},getRoles:function(e){return t.Relation.reverseQuery("_Role","users",this).find(e)}},{_currentUser:null,_currentUserMatchesDisk:!1,_CURRENT_USER_KEY:"currentUser",_authProviders:{},signUp:function(e,n,r,i){r=r||{},r.username=e,r.password=n;var o=t.Object._create("_User");return o.signUp(r,i)},logIn:function(e,n,r){var i=t.Object._create("_User");return i._finishFetch({username:e,password:n}),i.logIn(r)},become:function(t){return this._fetchUserBySessionToken(t).then(function(t){return t._handleSaveResult(!0).then(function(){return t})})},_fetchUserBySessionToken:function(e){var n=t.Object._create("_User");return o("users","me",null,"GET",{session_token:e}).then(function(t){var e=n.parse(t);return n._finishFetch(e),n})},logInWithMobilePhoneSmsCode:function(e,n,r){var i=t.Object._create("_User");return i._finishFetch({mobilePhoneNumber:e,smsCode:n}),i.logIn(r)},signUpOrlogInWithMobilePhone:function(e,n,r,i){r=r||{},r.mobilePhoneNumber=e,r.smsCode=n;var o=t.Object._create("_User");return o.signUpOrlogInWithMobilePhone(r,i)},logInWithMobilePhone:function(e,n,r){var i=t.Object._create("_User");return i._finishFetch({mobilePhoneNumber:e,password:n}),i.logIn(r)},signUpOrlogInWithAuthData:function(e,n){return t.User._logInWith(n,e)},loginWithWeapp:function(){var t=this;return s().then(function(e){return t.signUpOrlogInWithAuthData({code:e},"lc_weapp")})},associateWithAuthData:function(t,e,n){return t._linkWith(e,n)},logOut:function(){return t._config.disableCurrentUser?(console.warn("AV.User.current() was disabled in multi-user environment, call logOut() from user object instead https://leancloud.cn/docs/leanengine-node-sdk-upgrade-1.html"),a.resolve(null)):(null!==t.User._currentUser&&(t.User._currentUser._logOutWithAll(),t.User._currentUser._isCurrentUser=!1),t.User._currentUserMatchesDisk=!0,t.User._currentUser=null,t.localStorage.removeItemAsync(t._getAVPath(t.User._CURRENT_USER_KEY)))},followerQuery:function(e){if(!e||!r.isString(e))throw new Error("Invalid user object id.");var n=new t.FriendShipQuery("_Follower");return n._friendshipTag="follower",n.equalTo("user",t.Object.createWithoutData("_User",e)),n},followeeQuery:function(e){if(!e||!r.isString(e))throw new Error("Invalid user object id.");var n=new t.FriendShipQuery("_Followee");return n._friendshipTag="followee",n.equalTo("user",t.Object.createWithoutData("_User",e)),n},requestPasswordReset:function(t){var e={email:t},n=o("requestPasswordReset",null,null,"POST",e);return n},requestEmailVerify:function(t){var e={email:t},n=o("requestEmailVerify",null,null,"POST",e);return n},requestMobilePhoneVerify:function(t){var e={mobilePhoneNumber:t},n=o("requestMobilePhoneVerify",null,null,"POST",e);return n},requestPasswordResetBySmsCode:function(t){var e={mobilePhoneNumber:t},n=o("requestPasswordResetBySmsCode",null,null,"POST",e);return n},resetPasswordBySmsCode:function(t,e){var n={password:e},r=o("resetPasswordBySmsCode",null,t,"PUT",n);return r},verifyMobilePhone:function(t){var e=o("verifyMobilePhone",null,t,"POST",null);return e},requestLoginSmsCode:function(t){var e={mobilePhoneNumber:t},n=o("requestLoginSmsCode",null,null,"POST",e);return n},currentAsync:function(){return t._config.disableCurrentUser?(console.warn("AV.User.currentAsync() was disabled in multi-user environment, access user from request instead https://leancloud.cn/docs/leanengine-node-sdk-upgrade-1.html"),a.resolve(null)):t.User._currentUser?a.resolve(t.User._currentUser):t.User._currentUserMatchesDisk?a.resolve(t.User._currentUser):t.localStorage.getItemAsync(t._getAVPath(t.User._CURRENT_USER_KEY)).then(function(e){if(!e)return null;t.User._currentUserMatchesDisk=!0,t.User._currentUser=t.Object._create("_User"),t.User._currentUser._isCurrentUser=!0;var n=JSON.parse(e);return t.User._currentUser.id=n._id,delete n._id,t.User._currentUser._sessionToken=n._sessionToken,delete n._sessionToken,t.User._currentUser._finishFetch(n),t.User._currentUser._synchronizeAllAuthData(),t.User._currentUser._refreshCache(),t.User._currentUser._opSetQueue=[{}],t.User._currentUser})},current:function(){if(t._config.disableCurrentUser)return console.warn("AV.User.current() was disabled in multi-user environment, access user from request instead https://leancloud.cn/docs/leanengine-node-sdk-upgrade-1.html"),null;if(t.User._currentUser)return t.User._currentUser;if(t.User._currentUserMatchesDisk)return t.User._currentUser;t.User._currentUserMatchesDisk=!0;var e=t.localStorage.getItem(t._getAVPath(t.User._CURRENT_USER_KEY));if(!e)return null;t.User._currentUser=t.Object._create("_User"),t.User._currentUser._isCurrentUser=!0;var n=JSON.parse(e);return t.User._currentUser.id=n._id,delete n._id,t.User._currentUser._sessionToken=n._sessionToken,delete n._sessionToken,t.User._currentUser._finishFetch(n),t.User._currentUser._synchronizeAllAuthData(),t.User._currentUser._refreshCache(),t.User._currentUser._opSetQueue=[{}],t.User._currentUser},_saveCurrentUser:function(e){var n;return n=t.User._currentUser!==e?t.User.logOut():a.resolve(),n.then(function(){e._isCurrentUser=!0,t.User._currentUser=e;var n=e.toJSON();return n._id=e.id,n._sessionToken=e._sessionToken,t.localStorage.setItemAsync(t._getAVPath(t.User._CURRENT_USER_KEY),JSON.stringify(n)).then(function(){t.User._currentUserMatchesDisk=!0})})},_registerAuthenticationProvider:function(e){t.User._authProviders[e.getAuthType()]=e,!t._config.disableCurrentUser&&t.User.current()&&t.User.current()._synchronizeAuthData(e.getAuthType())},_logInWith:function(e,n){var r=t.Object._create("_User");return r._linkWith(e,n)}})}},function(t,e,n){"use strict";t.exports=[]},function(t,e,n){"use strict";var r=n(12),i=["Browser"].concat(n(30));t.exports="LeanCloud-JS-SDK/"+r+" ("+i.join("; ")+")"},function(t,e,n){"use strict";var r=n(6),i=n(7)("cos"),o=n(2);t.exports=function(t,e,n){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};n.attributes.url=t.url,n._bucket=t.bucket,n.id=t.objectId;var s=t.upload_url+"?sign="+encodeURIComponent(t.token);return new o(function(t,o){var u=r("POST",s).field("fileContent",e).field("op","upload");a.onprogress&&u.on("progress",a.onprogress),u.end(function(e,r){return r&&i(r.status,r.body,r.text),e?(r&&(e.statusCode=r.status,e.responseText=r.text,e.response=r.body),o(e)):void t(n)})})}},function(t,e,n){"use strict";var r=n(6),i=n(2),o=n(7)("qiniu");t.exports=function(t,e,n){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};n.attributes.url=t.url,n._bucket=t.bucket,n.id=t.objectId;var s=t.token;return new i(function(t,i){var u=r("POST","https://up.qbox.me").field("file",e).field("name",n.attributes.name).field("key",n._qiniu_key).field("token",s);a.onprogress&&u.on("progress",a.onprogress),u.end(function(e,r){return r&&o(r.status,r.body,r.text),e?(r&&(e.statusCode=r.status,e.responseText=r.text,e.response=r.body),i(e)):void t(n)})})}},function(t,e,n){"use strict";var r=n(6);n(2);t.exports=function(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return n.attributes.url=t.url,n._bucket=t.bucket,n.id=t.objectId,new Promise(function(o,a){var s=r("PUT",t.upload_url).set("Content-Type",n.get("mime_type")).send(e);i.onprogress&&s.on("progress",i.onprogress),s.end(function(t,e){return t?(e&&(t.statusCode=e.status,t.responseText=e.text,t.response=e.body),a(t)):void o(n)})})}},function(t,e,n){"use strict";(function(e){var r=n(0),i=(n(2),{}),o=["getItem","setItem","removeItem","clear"],a=e.localStorage;try{var s="__storejs__";if(a.setItem(s,s),a.getItem(s)!=s)throw new Error;a.removeItem(s)}catch(t){a=n(42)}r(o).each(function(t){i[t]=function(){return e.localStorage[t].apply(e.localStorage,arguments)}}),i.async=!1,t.exports=i}).call(e,n(9))},function(t,e,n){"use strict";var r=function(t,e){var n;t.indexOf("base64")<0?n=atob(t):t.split(",")[0].indexOf("base64")>=0?(e=e||t.split(",")[0].split(":")[1].split(";")[0],n=atob(t.split(",")[1])):n=unescape(t.split(",")[1]);for(var r=new Uint8Array(n.length),i=0;i>>32-e},rotr:function(t,e){return t<<32-e|t>>>e},endian:function(t){if(t.constructor==Number)return 16711935&n.rotl(t,8)|4278255360&n.rotl(t,24);for(var e=0;e0;t--)e.push(Math.floor(256*Math.random()));return e},bytesToWords:function(t){for(var e=[],n=0,r=0;n>>5]|=t[n]<<24-r%32;return e},wordsToBytes:function(t){for(var e=[],n=0;n<32*t.length;n+=8)e.push(t[n>>>5]>>>24-n%32&255);return e},bytesToHex:function(t){for(var e=[],n=0;n>>4).toString(16)),e.push((15&t[n]).toString(16));return e.join("")},hexToBytes:function(t){for(var e=[],n=0;n>>6*(3-o)&63)):n.push("=");return n.join("")},base64ToBytes:function(t){t=t.replace(/[^A-Z0-9+\/]/gi,"");for(var n=[],r=0,i=0;r>>6-2*i);return n}};t.exports=n}()},function(t,e,n){function r(t){var n,r=0;for(n in t)r=(r<<5)-r+t.charCodeAt(n),r|=0;return e.colors[Math.abs(r)%e.colors.length]}function i(t){function n(){if(n.enabled){var t=n,r=+new Date,i=r-(c||r);t.diff=i,t.prev=c,t.curr=r,c=r;for(var o=new Array(arguments.length),a=0;a=0&&v.splice(e,1)}function a(t){var e=document.createElement("style");return e.type="text/css",i(t,e),e}function s(t,e){var n,r,i;if(e.singleton){var s=m++;n=p||(p=a(e)),r=u.bind(null,n,s,!1),i=u.bind(null,n,s,!0)}else n=a(e),r=c.bind(null,n),i=function(){o(n)};return r(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;r(t=e)}else i()}}function u(t,e,n,r){var i=n?"":r.css;if(t.styleSheet)t.styleSheet.cssText=g(e,i);else{var o=document.createTextNode(i),a=t.childNodes;a[e]&&t.removeChild(a[e]),a.length?t.insertBefore(o,a[e]):t.appendChild(o)}}function c(t,e){var n=e.css,r=e.media,i=e.sourceMap;if(r&&t.setAttribute("media",r),i&&(n+="\n/*# sourceURL="+i.sources[0]+" */",n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(i))))+" */"),t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}var l={},d=function(t){var e;return function(){return"undefined"==typeof e&&(e=t.apply(this,arguments)),e}},f=d(function(){return/msie [6-9]\b/.test(window.navigator.userAgent.toLowerCase())}),h=d(function(){return document.head||document.getElementsByTagName("head")[0]}),p=null,m=0,v=[];t.exports=function(t,e){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");e=e||{},"undefined"==typeof e.singleton&&(e.singleton=f()),"undefined"==typeof e.insertAt&&(e.insertAt="bottom");var i=r(t);return n(i,e),function(t){for(var o=[],a=0;a0&&void 0!==arguments[0]?arguments[0]:10,e=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],n="",r=0;r=0&&o0?0:s-1;return arguments.length<3&&(i=n[a?a[u]:u],u+=t),e(n,r,i,a,u,s)}}function o(t){return function(e,n,r){n=A(n,r);for(var i=k(e),o=t>0?0:i-1;o>=0&&o0?a=o>=0?o:Math.max(o+s,a):s=o>=0?Math.min(o+1,s):o+s+1;else if(n&&o&&s)return o=n(r,i),r[o]===i?o:-1;if(i!==i)return o=e(m.call(r,a,s),E.isNaN),o>=0?o+a:-1;for(o=t>0?a:s-1;o>=0&&o=0&&e<=R};E.each=E.forEach=function(t,e,n){e=C(e,n);var r,i;if(M(t))for(r=0,i=t.length;r=0},E.invoke=function(t,e){var n=m.call(arguments,2),r=E.isFunction(e);return E.map(t,function(t){var i=r?e:t[e];return null==i?i:i.apply(t,n)})},E.pluck=function(t,e){return E.map(t,E.property(e))},E.where=function(t,e){return E.filter(t,E.matcher(e))},E.findWhere=function(t,e){return E.find(t,E.matcher(e))},E.max=function(t,e,n){var r,i,o=-(1/0),a=-(1/0);if(null==e&&null!=t){t=M(t)?t:E.values(t);for(var s=0,u=t.length;so&&(o=r)}else e=A(e,n),E.each(t,function(t,n,r){i=e(t,n,r),(i>a||i===-(1/0)&&o===-(1/0))&&(o=t,a=i)});return o},E.min=function(t,e,n){var r,i,o=1/0,a=1/0;if(null==e&&null!=t){t=M(t)?t:E.values(t);for(var s=0,u=t.length;sr||void 0===n)return 1;if(ne?(a&&(clearTimeout(a),a=null),s=c,o=t.apply(r,i),a||(r=i=null)):a||n.trailing===!1||(a=setTimeout(u,l)),o}},E.debounce=function(t,e,n){var r,i,o,a,s,u=function u(){var c=E.now()-a;c=0?r=setTimeout(u,e-c):(r=null,n||(s=t.apply(o,i),r||(o=i=null)))};return function(){o=this,i=arguments,a=E.now();var c=n&&!r;return r||(r=setTimeout(u,e)),c&&(s=t.apply(o,i),o=i=null),s}},E.wrap=function(t,e){return E.partial(e,t)},E.negate=function(t){return function(){return!t.apply(this,arguments)}},E.compose=function(){var t=arguments,e=t.length-1;return function(){for(var n=e,r=t[e].apply(this,arguments);n--;)r=t[n].call(this,r);return r}},E.after=function(t,e){return function(){if(--t<1)return e.apply(this,arguments)}},E.before=function(t,e){var n;return function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=null),n}},E.once=E.partial(E.before,2);var L=!{toString:null}.propertyIsEnumerable("toString"),I=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];E.keys=function(t){if(!E.isObject(t))return[];if(y)return y(t);var e=[];for(var n in t)E.has(t,n)&&e.push(n);return L&&u(t,e),e},E.allKeys=function(t){if(!E.isObject(t))return[];var e=[];for(var n in t)e.push(n);return L&&u(t,e),e},E.values=function(t){for(var e=E.keys(t),n=e.length,r=Array(n),i=0;i":">",'"':""","'":"'","`":"`"},F=E.invert(D),U=function(t){var e=function(e){return t[e]},n="(?:"+E.keys(t).join("|")+")",r=RegExp(n),i=RegExp(n,"g");return function(t){return t=null==t?"":""+t,r.test(t)?t.replace(i,e):t}};E.escape=U(D),E.unescape=U(F),E.result=function(t,e,n){var r=null==t?void 0:t[e];return void 0===r&&(r=n),E.isFunction(r)?r.call(t):r};var H=0;E.uniqueId=function(t){var e=++H+"";return t?t+e:e},E.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var B=/(.)^/,q={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},z=/\\|'|\r|\n|\u2028|\u2029/g,W=function(t){return"\\"+q[t]};E.template=function(t,e,n){!e&&n&&(e=n),e=E.defaults({},e,E.templateSettings);var r=RegExp([(e.escape||B).source,(e.interpolate||B).source,(e.evaluate||B).source].join("|")+"|$","g"),i=0,o="__p+='";t.replace(r,function(e,n,r,a,s){return o+=t.slice(i,s).replace(z,W),i=s+e.length,n?o+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":r?o+="'+\n((__t=("+r+"))==null?'':__t)+\n'":a&&(o+="';\n"+a+"\n__p+='"),e}),o+="';\n",e.variable||(o="with(obj||{}){\n"+o+"}\n"),o="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+o+"return __p;\n";try{var a=new Function(e.variable||"obj","_",o)}catch(t){throw t.source=o,t}var s=function(t){return a.call(this,t,E)},u=e.variable||"obj";return s.source="function("+u+"){\n"+o+"}",s},E.chain=function(t){var e=E(t);return e._chain=!0,e};var Y=function(t,e){return t._chain?E(e).chain():e};E.mixin=function(t){E.each(E.functions(t),function(e){var n=E[e]=t[e];E.prototype[e]=function(){var t=[this._wrapped];return p.apply(t,arguments),Y(this,n.apply(E,t))}})},E.mixin(E),E.each(["pop","push","reverse","shift","sort","splice","unshift"],function(t){var e=d[t];E.prototype[t]=function(){var n=this._wrapped;return e.apply(n,arguments),"shift"!==t&&"splice"!==t||0!==n.length||delete n[0],Y(this,n)}}),E.each(["concat","join","slice"],function(t){var e=d[t];E.prototype[t]=function(){return Y(this,e.apply(this._wrapped,arguments))}}),E.prototype.value=function(){return this._wrapped},E.prototype.valueOf=E.prototype.toJSON=E.prototype.value,E.prototype.toString=function(){return""+this._wrapped},r=[],i=function(){return E}.apply(e,r),!(void 0!==i&&(t.exports=i))}).call(this)},function(t,e,n){"use strict";var r="function"==typeof Symbol&&"symbol"===s(Symbol.iterator)?function(t){return"undefined"==typeof t?"undefined":s(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":"undefined"==typeof t?"undefined":s(t)},i=n(6),o=n(7)("leancloud:request"),a=n(43),u=n(2),c=n(10),l=n(3),d=n(4),f=n(0),h=n(5),p=h.getSessionToken,m=void 0,v={cn:"https://api.leancloud.cn",us:"https://us-api.leancloud.cn"},g=function(t,e){var n=(new Date).getTime(),r=a(n+t);return e?r+","+n+",master":r+","+n},b=function(t){var e=["batch","classes","files","date","functions","call","login","push","search/select","requestPasswordReset","requestEmailVerify","requestPasswordResetBySmsCode","resetPasswordBySmsCode","requestMobilePhoneVerify","requestLoginSmsCode","verifyMobilePhone","requestSmsCode","verifySmsCode","users","usersByMobilePhone","cloudQuery","qiniu","fileTokens","statuses","bigquery","search/select","subscribe/statuses/count","subscribe/statuses","installations"];if(e.indexOf(t)===-1&&!/users\/[^\/]+\/updatePassword/.test(t)&&!/users\/[^\/]+\/friendship\/[^\/]+/.test(t))throw new Error("Bad router: "+t+".")},y=0,_=function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=arguments[4],s=y++;return o("request("+s+")",t,e,n,r),new u(function(u,c){var l=i(t,e).set(r).send(n);a&&l.on("progress",a),l.end(function(t,e){return e&&o("response("+s+")",e.status,e.body||e.text,e.header),t?(e&&(t.statusCode=e.status,t.responseText=e.text,t.response=e.body),c(t)):u(e.body)})})},w=function(t,e){e?t["X-LC-Sign"]=g(d.applicationKey):t["X-LC-Key"]=d.applicationKey},x=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments[1],n={"X-LC-Id":d.applicationId,"Content-Type":"application/json;charset=UTF-8"},r=!1;return"boolean"==typeof t.useMasterKey?r=t.useMasterKey:"boolean"==typeof d._useMasterKey&&(r=d._useMasterKey),r?d.masterKey?e?n["X-LC-Sign"]=g(d.masterKey,!0):n["X-LC-Key"]=d.masterKey+",master":(console.warn("masterKey is not set, fall back to use appKey"),w(n,e)):w(n,e),d.hookKey&&(n["X-LC-Hook-Key"]=d.hookKey),null!==d._config.applicationProduction&&(n["X-LC-Prod"]=String(d._config.applicationProduction)),n["X-LC-UA"]=d._config.userAgent,u.resolve().then(function(){var e=p(t);if(e)n["X-LC-Session"]=e;else if(!d._config.disableCurrentUser)return d.User.currentAsync().then(function(t){return t&&t._sessionToken&&(n["X-LC-Session"]=t._sessionToken),n});return n})},E=function(t,e,n,i,o){d.serverURL&&(d._config.APIServerURL=d.serverURL,console.warn("Please use AV._config.APIServerURL to replace AV.serverURL, and it is an internal interface."));var a=d._config.APIServerURL||v.cn;if("/"!==a.charAt(a.length-1)&&(a+="/"),a+="1.1/"+t,e&&(a+="/"+e),n&&(a+="/"+n),"users"!==t&&"classes"!==t||!o||(a+="?",o._fetchWhenSave&&(delete o._fetchWhenSave,a+="&new=true"),o._where&&(a+="&where="+encodeURIComponent(JSON.stringify(o._where)),delete o._where)),"get"===i.toLowerCase()){a.indexOf("?")===-1&&(a+="?");for(var s in o)"object"===r(o[s])&&(o[s]=JSON.stringify(o[s])),a+="&"+s+"="+encodeURIComponent(o[s])}return a},C=function(t,e){return"number"!=typeof e&&(e=3600),c.setAsync("APIServerURL",t,1e3*e)},A=function(t){return new u(function(e,n){if(410===t.statusCode)C(t.response.api_server,t.response.ttl).then(function(){e(t.response.location)}).catch(n);else{var r={code:t.code||-1,error:t.message||t.responseText};if(t.response&&t.response.code)r=t.response;else if(t.responseText)try{r=JSON.parse(t.responseText)}catch(t){}n(new l(r.code,r.error))}})},T=function(t){d._config.APIServerURL="https://"+t;var e=f.findKey(v,function(t){return t===d._config.APIServerURL});e&&(d._config.region=e)},O=function(){var t="https://app-router.leancloud.cn/1/route?appId="+d.applicationId;return _("get",t).then(function(t){if(t.api_server)return T(t.api_server),C(t.api_server,t.ttl)},function(t){if(t.statusCode>=400&&t.statusCode<500)throw t})},S=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"cn";m=new u(function(e,n){return d._config.APIServerURL?void e():"cn"===t?c.getAsync("APIServerURL").then(function(t){return t?void T(t):O()}).then(function(){e()}).catch(function(t){n(t)}):(d._config.region=t,d._config.APIServerURL=v[t],e(),void 0)})},R=function t(e,n,r,i){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},a=arguments[5];if(!d.applicationId)throw new Error("You must specify your applicationId using AV.init()");if(!d.applicationKey&&!d.masterKey)throw new Error("You must specify a AppKey using AV.init()");return b(e),m?m.then(function(){var s=E(e,n,r,i,o);if(s.length>2e3&&"get"===i.toLowerCase()){var u={request:{method:i,path:s}};return t("batch",null,null,"POST",u,a)}return x(a).then(function(t){return _(i,s,o,t).then(null,function(e){return A(e).then(function(e){return _(i,e,o,t)})})})}):u.reject(new Error("Not initialized"))};t.exports={ajax:_,request:R,setServerUrlByRegion:S}},function(t,e,n){"use strict";var r=(n(0),n(40).Promise);r._continueWhile=function(t,e){return t()?e().then(function(){return r._continueWhile(t,e)}):r.resolve()},t.exports=r},function(t,e,n){"use strict";function r(t,e){var n=new Error(e);return n.code=t,n}var i=n(0);i.extend(r,{OTHER_CAUSE:-1,INTERNAL_SERVER_ERROR:1,CONNECTION_FAILED:100,OBJECT_NOT_FOUND:101,INVALID_QUERY:102,INVALID_CLASS_NAME:103,MISSING_OBJECT_ID:104,INVALID_KEY_NAME:105,INVALID_POINTER:106,INVALID_JSON:107,COMMAND_UNAVAILABLE:108,NOT_INITIALIZED:109,INCORRECT_TYPE:111,INVALID_CHANNEL_NAME:112,PUSH_MISCONFIGURED:115,OBJECT_TOO_LARGE:116,OPERATION_FORBIDDEN:119,CACHE_MISS:120,INVALID_NESTED_KEY:121,INVALID_FILE_NAME:122,INVALID_ACL:123,TIMEOUT:124,INVALID_EMAIL_ADDRESS:125,MISSING_CONTENT_TYPE:126,MISSING_CONTENT_LENGTH:127,INVALID_CONTENT_LENGTH:128,FILE_TOO_LARGE:129,FILE_SAVE_ERROR:130,FILE_DELETE_ERROR:153,DUPLICATE_VALUE:137,INVALID_ROLE_NAME:139,EXCEEDED_QUOTA:140,SCRIPT_FAILED:141,VALIDATION_ERROR:142,INVALID_IMAGE_DATA:150,UNSAVED_FILE_ERROR:151,INVALID_PUSH_TIME_ERROR:152,USERNAME_MISSING:200,PASSWORD_MISSING:201,USERNAME_TAKEN:202,EMAIL_TAKEN:203,EMAIL_MISSING:204,EMAIL_NOT_FOUND:205,SESSION_MISSING:206,MUST_CREATE_USER_THROUGH_SIGNUP:207,ACCOUNT_ALREADY_LINKED:208,LINKED_ID_MISSING:250,INVALID_LINKED_SESSION:251,UNSUPPORTED_SERVICE:252,X_DOMAIN_REQUEST:602}),t.exports=r},function(t,e,n){"use strict";(function(e){var r=n(0),i=n(31),o=n(5),a=o.isNullOrUndefined,s=e.AV||{};s._config=s._config||{};var u=s._config;r.extend(u,{region:"cn",APIServerURL:u.APIServerURL||"",disableCurrentUser:!1,userAgent:i,applicationProduction:null});var c=function(){},l=function(t,e,n){var i;return i=e&&e.hasOwnProperty("constructor")?e.constructor:function(){t.apply(this,arguments)},r.extend(i,t),c.prototype=t.prototype,i.prototype=new c,e&&r.extend(i.prototype,e),n&&r.extend(i,n),i.prototype.constructor=i,i.__super__=t.prototype,i};s.setProduction=function(t){a(t)?u.applicationProduction=null:u.applicationProduction=t?1:0},s._getAVPath=function(t){if(!s.applicationId)throw new Error("You need to call AV.initialize before using AV.");if(t||(t=""),!r.isString(t))throw new Error("Tried to get a localStorage path that wasn't a String.");return"/"===t[0]&&(t=t.substring(1)),"AV/"+s.applicationId+"/"+t},s._installationId=null,s._getInstallationId=function(){if(s._installationId)return s.Promise.resolve(s._installationId);var t=s._getAVPath("installationId");return s.localStorage.getItemAsync(t).then(function(e){if(s._installationId=e,s._installationId)return e;var n=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return s._installationId=n()+n()+"-"+n()+"-"+n()+"-"+n()+"-"+n()+n()+n(),s.localStorage.setItemAsync(t,s._installationId)})},s._parseDate=function(t){var e=new RegExp("^([0-9]{1,4})-([0-9]{1,2})-([0-9]{1,2})T([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})(.([0-9]+))?Z$"),n=e.exec(t);if(!n)return null;var r=n[1]||0,i=(n[2]||1)-1,o=n[3]||0,a=n[4]||0,s=n[5]||0,u=n[6]||0,c=n[8]||0;return new Date(Date.UTC(r,i,o,a,s,u,c))},s._extend=function(t,e){var n=l(this,t,e);return n.extend=this.extend,n},s._getValue=function(t,e){return t&&t[e]?r.isFunction(t[e])?t[e]():t[e]:null; +},s._encode=function(t,e,n){if(t instanceof s.Object){if(n)throw new Error("AV.Objects not allowed here");if(!e||r.include(e,t)||!t._hasData)return t._toPointer();if(!t.dirty())return e=e.concat(t),s._encode(t._toFullJSON(e),e,n);throw new Error("Tried to save an object with a pointer to a new, unsaved object.")}if(t instanceof s.ACL)return t.toJSON();if(r.isDate(t))return{__type:"Date",iso:t.toJSON()};if(t instanceof s.GeoPoint)return t.toJSON();if(r.isArray(t))return r.map(t,function(t){return s._encode(t,e,n)});if(r.isRegExp(t))return t.source;if(t instanceof s.Relation)return t.toJSON();if(t instanceof s.Op)return t.toJSON();if(t instanceof s.File){if(!t.url()&&!t.id)throw new Error("Tried to save an object containing an unsaved file.");return{__type:"File",id:t.id,name:t.name(),url:t.url()}}return r.isObject(t)?r.mapObject(t,function(t,r){return s._encode(t,e,n)}):t},s._decode=function(t,e){if(!r.isObject(t)||r.isDate(t))return t;if(r.isArray(t))return r.map(t,function(t){return s._decode(t)});if(t instanceof s.Object)return t;if(t instanceof s.File)return t;if(t instanceof s.Op)return t;if(t instanceof s.GeoPoint)return t;if(t instanceof s.ACL)return t;if(t.__op)return s.Op._decode(t);var n;if("Pointer"===t.__type){n=t.className;var i=s.Object._create(n);if(Object.keys(t).length>3){var o=r.clone(t);delete o.__type,delete o.className,i._finishFetch(o,!0)}else i._finishFetch({objectId:t.objectId},!1);return i}if("Object"===t.__type){n=t.className;var a=r.clone(t);delete a.__type,delete a.className;var u=s.Object._create(n);return u._finishFetch(a,!0),u}if("Date"===t.__type)return s._parseDate(t.iso);if("GeoPoint"===t.__type)return new s.GeoPoint({latitude:t.latitude,longitude:t.longitude});if("Relation"===t.__type){if(!e)throw new Error("key missing decoding a Relation");var c=new s.Relation(null,e);return c.targetClassName=t.className,c}if("File"===t.__type){var l=new s.File(t.name),d=r.clone(t);return delete d.__type,l._finishFetch(d),l}return r.mapObject(t,function(t,e){return"ACL"===e?new s.ACL(t):s._decode(t,e)})},s._encodeObjectOrArray=function(t){var e=function(t){return t&&t._toFullJSON&&(t=t._toFullJSON([])),r.mapObject(t,function(t){return s._encode(t,[])})};return r.isArray(t)?t.map(function(t){return e(t)}):e(t)},s._arrayEach=r.each,s._traverse=function(t,e,n){if(t instanceof s.Object){if(n=n||[],r.indexOf(n,t)>=0)return;return n.push(t),s._traverse(t.attributes,e,n),e(t)}return t instanceof s.Relation||t instanceof s.File?e(t):r.isArray(t)?(r.each(t,function(r,i){var o=s._traverse(r,e,n);o&&(t[i]=o)}),e(t)):r.isObject(t)?(s._each(t,function(r,i){var o=s._traverse(r,e,n);o&&(t[i]=o)}),e(t)):e(t)},s._objectEach=s._each=function(t,e){r.isObject(t)?r.each(r.keys(t),function(n){e(t[n],n)}):r.each(t,e)},t.exports=s}).call(e,n(9))},function(t,e,n){"use strict";var r=n(0),i=function(t){return r.isNull(t)||r.isUndefined(t)},o=function(t){return r.isArray(t)?t:void 0===t||null===t?[]:[t]},a=function(t){return t.sessionToken?t.sessionToken:t.user&&"function"==typeof t.user.getSessionToken?t.user.getSessionToken():void 0};t.exports={isNullOrUndefined:i,ensureArray:o,getSessionToken:a}},function(t,e,n){function r(){}function i(t){if(!v(t))return t;var e=[];for(var n in t)o(e,n,t[n]);return e.join("&")}function o(t,e,n){if(null!=n)if(Array.isArray(n))n.forEach(function(n){o(t,e,n)});else if(v(n))for(var r in n)o(t,e+"["+r+"]",n[r]);else t.push(encodeURIComponent(e)+"="+encodeURIComponent(n));else null===n&&t.push(encodeURIComponent(e))}function a(t){for(var e,n,r={},i=t.split("&"),o=0,a=i.length;o=0?"&":"?")+t),this._sort){var e=this.url.indexOf("?");if(e>=0){var n=this.url.substring(e+1).split("&");g(this._sort)?n.sort(this._sort):n.sort(),this.url=this.url.substring(0,e)+"?"+n.join("&")}}},d.prototype._isHost=function(t){return t&&"object"===("undefined"==typeof t?"undefined":s(t))&&!Array.isArray(t)&&"[object Object]"!==Object.prototype.toString.call(t)},d.prototype.end=function(t){var e=this,n=this.xhr=y.getXHR(),i=this._formData||this._data;this._endCalled&&console.warn("Warning: .end() was called twice. This is not supported in superagent"),this._endCalled=!0,this._callback=t||r,n.onreadystatechange=function(){var t=n.readyState;if(t>=2&&e._responseTimeoutTimer&&clearTimeout(e._responseTimeoutTimer),4==t){var r;try{r=n.status}catch(t){r=0}if(!r){if(e.timedout||e._aborted)return;return e.crossDomainError()}e.emit("end")}};var o=function(t,n){n.total>0&&(n.percent=n.loaded/n.total*100),n.direction=t,e.emit("progress",n)};if(this.hasListeners("progress"))try{n.onprogress=o.bind(null,"download"),n.upload&&(n.upload.onprogress=o.bind(null,"upload"))}catch(t){}this._appendQueryString(),this._setTimeouts();try{this.username&&this.password?n.open(this.method,this.url,!0,this.username,this.password):n.open(this.method,this.url,!0)}catch(t){return this.callback(t)}if(this._withCredentials&&(n.withCredentials=!0),!this._formData&&"GET"!=this.method&&"HEAD"!=this.method&&"string"!=typeof i&&!this._isHost(i)){var a=this._header["content-type"],s=this._serializer||y.serialize[a?a.split(";")[0]:""];!s&&c(a)&&(s=y.serialize["application/json"]),s&&(i=s(i))}for(var u in this.header)null!=this.header[u]&&n.setRequestHeader(u,this.header[u]);return this._responseType&&(n.responseType=this._responseType),this.emit("request",this),n.send("undefined"!=typeof i?i:null),this},y.get=function(t,e,n){var r=y("GET",t);return"function"==typeof e&&(n=e,e=null),e&&r.query(e),n&&r.end(n),r},y.head=function(t,e,n){var r=y("HEAD",t);return"function"==typeof e&&(n=e,e=null),e&&r.send(e),n&&r.end(n),r},y.options=function(t,e,n){var r=y("OPTIONS",t);return"function"==typeof e&&(n=e,e=null),e&&r.send(e),n&&r.end(n),r},y.del=f,y.delete=f,y.patch=function(t,e,n){var r=y("PATCH",t);return"function"==typeof e&&(n=e,e=null),e&&r.send(e),n&&r.end(n),r},y.post=function(t,e,n){var r=y("POST",t);return"function"==typeof e&&(n=e,e=null),e&&r.send(e),n&&r.end(n),r},y.put=function(t,e,n){var r=y("PUT",t);return"function"==typeof e&&(n=e,e=null),e&&r.send(e),n&&r.end(n),r}},function(e,n,r){function i(){return!("undefined"==typeof window||!window||"undefined"==typeof window.process||"renderer"!==window.process.type)||("undefined"!=typeof document&&document&&"WebkitAppearance"in document.documentElement.style||"undefined"!=typeof window&&window&&window.console&&(console.firebug||console.exception&&console.table)||"undefined"!=typeof navigator&&navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))}function o(t){var e=this.useColors;if(t[0]=(e?"%c":"")+this.namespace+(e?" %c":" ")+t[0]+(e?"%c ":" ")+"+"+n.humanize(this.diff),e){var r="color: "+this.color;t.splice(1,0,r,"color: inherit");var i=0,o=0;t[0].replace(/%[a-zA-Z%]/g,function(t){"%%"!==t&&(i++,"%c"===t&&(o=i))}),t.splice(o,0,r)}}function a(){return"object"===("undefined"==typeof console?"undefined":s(console))&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function u(t){try{null==t?n.storage.removeItem("debug"):n.storage.debug=t}catch(t){}}function c(){try{return n.storage.debug}catch(t){}if("undefined"!=typeof t&&"env"in t)return r.i({NODE_ENV:"production"}).DEBUG}function l(){try{return window.localStorage}catch(t){}}n=e.exports=r(39),n.log=a,n.formatArgs=o,n.save=u,n.load=c,n.useColors=i,n.storage="undefined"!=typeof chrome&&"undefined"!=typeof chrome.storage?chrome.storage.local:l(),n.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],n.formatters.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}},n.enable(c())},function(t,e){function n(t){return null!==t&&"object"===("undefined"==typeof t?"undefined":s(t))}t.exports=n},function(t,e){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(t){"object"===("undefined"==typeof window?"undefined":s(window))&&(n=window)}t.exports=n},function(t,e,n){"use strict";var r=n(11),i=n(4),o=e.removeAsync=r.removeItemAsync.bind(r),a=function(t,e){try{t=JSON.parse(t)}catch(t){return null}if(t){var n=t.expiredAt&&t.expiredAt>2&63),f(r<<4&48|i>>4&15),a?f(i<<2&60|o>>6&3):"=",s?f(63&o):"="].join("")}),e.join("")};t.File=function(e,o,a){this.attributes={name:e,url:"",metaData:{},base64:""},this._extName="";var s=void 0;if(o&&o.owner)s=o.owner;else if(!t._config.disableCurrentUser)try{s=t.User.current()}catch(t){if("SYNC_API_NOT_AVAILABLE"!==t.code)throw t;console.warn("Get current user failed. It seems this runtime use an async storage system, please create AV.File in the callback of AV.User.currentAsync().")}if(this.attributes.metaData={owner:s?s.id:"unknown"},this.set("mime_type",a),i.isArray(o)&&(this.attributes.metaData.size=o.length,o={base64:h(o)}),o&&o.base64){var u=r(36),c=u(o.base64,a);this._source=l.resolve({data:c,type:a})}else if(o&&o.blob)!o.blob.type&&a&&(o.blob.type=a),o.blob.name||(o.blob.name=e),this._source=l.resolve({data:o.blob,type:a});else if("undefined"!=typeof File&&o instanceof File)o.size&&(this.attributes.metaData.size=o.size),o.name&&(this._extName=d(o.name)),this._source=l.resolve({data:o,type:a});else if("undefined"!=typeof n&&n.isBuffer(o))this.attributes.metaData.size=o.length,this._source=l.resolve({data:o,type:a});else if(i.isString(o))throw new Error("Creating a AV.File from a String is not yet supported.")},t.File.withURL=function(e,n,r,i){if(!e||!n)throw new Error("Please provide file name and url");var o=new t.File(e,null,i);if(r)for(var a in r)o.attributes.metaData[a]||(o.attributes.metaData[a]=r[a]);return o.attributes.url=n,o.attributes.metaData.__source="external",o},t.File.createWithoutData=function(e){var n=new t.File;return n.id=e,n},t.File.prototype={className:"_File",toJSON:function(){return t._encode(this)},getACL:function(){return this._acl},setACL:function(e){return e instanceof t.ACL?void(this._acl=e):new u(u.OTHER_CAUSE,"ACL must be a AV.ACL.")},name:function(){return this.get("name")},url:function(){return this.get("url")},get:function(t){switch(t){case"objectId":return this.id;case"url":case"name":case"mime_type":case"metaData":case"createdAt":case"updatedAt":return this.attributes[t];default:return this.attributes.metaData[t]}},set:function t(){for(var e=this,t=function(t,n){switch(t){case"name":case"url":case"mime_type":case"base64":case"metaData":e.attributes[t]=n;break;default:e.attributes.metaData[t]=n}},n=arguments.length,r=Array(n),i=0;i100)throw new Error("Invalid quality value.");i=i||"png";var a=r?2:1;return o+"?imageView/"+a+"/w/"+t+"/h/"+e+"/q/"+n+"/format/"+i},size:function(){return this.metaData().size},ownerId:function(){return this.metaData().owner},destroy:function(t){if(!this.id)return l.reject(new Error("The file id is not eixsts."));var e=c("files",null,this.id,"DELETE",null,t);return e},_fileToken:function(t){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"fileTokens",i=this.attributes.name,o=d(i)||this._extName,a=e()+e()+e()+e()+e()+o,s={key:a,name:i,ACL:this._acl,mime_type:t,metaData:this.attributes.metaData};return this._qiniu_key=a,c(r,null,null,"POST",s).then(function(t){return t.mime_type&&n.set("mime_type",t.mime_type),t})},save:function(t){var e=this;if(this.id)throw new Error("File already saved. If you want to manipulate a file, use AV.Query to get it.");if(!this._previousSave)if(this._source)this._previousSave=this._source.then(function(n){var r=n.data,i=n.type;return e._fileToken(i).then(function(n){var i=void 0;switch(n.provider){case"s3":i=s(n,r,e,t);break;case"qcloud":i=o(n,r,e,t);break;case"qiniu":default:i=a(n,r,e,t)}return i.catch(function(t){throw e.destroy(),t})})});else if(this.attributes.url&&"external"===this.attributes.metaData.__source){var n={name:this.attributes.name,ACL:this._acl,metaData:this.attributes.metaData,mime_type:this.mimeType,url:this.attributes.url};this._previousSave=c("files",this.attributes.name,null,"post",n).then(function(t){return e.attributes.name=t.name,e.attributes.url=t.url,e.id=t.objectId,t.size&&(e.attributes.metaData.size=t.size),e})}return this._previousSave},fetch:function(t){var t=null,e=c("files",null,this.id,"GET",t);return e.then(this._finishFetch.bind(this))},_finishFetch:function(e){var n=t.Object.prototype.parse(e);return n.attributes={name:n.name,url:n.url,mime_type:n.mime_type},n.attributes.metaData=n.metaData||{},n.id=n.objectId,delete n.objectId,delete n.metaData,delete n.url,delete n.name,delete n.mime_type,i.extend(this,n),this}}}},function(t,e,n){"use strict";var r=n(0);t.exports=function(t){t.GeoPoint=function(e,n){r.isArray(e)?(t.GeoPoint._validate(e[0],e[1]),this.latitude=e[0],this.longitude=e[1]):r.isObject(e)?(t.GeoPoint._validate(e.latitude,e.longitude),this.latitude=e.latitude,this.longitude=e.longitude):r.isNumber(e)&&r.isNumber(n)?(t.GeoPoint._validate(e,n),this.latitude=e,this.longitude=n):(this.latitude=0,this.longitude=0);var i=this;this.__defineGetter__&&this.__defineSetter__&&(this._latitude=this.latitude,this._longitude=this.longitude,this.__defineGetter__("latitude",function(){return i._latitude}),this.__defineGetter__("longitude",function(){return i._longitude}),this.__defineSetter__("latitude",function(e){t.GeoPoint._validate(e,i.longitude),i._latitude=e}),this.__defineSetter__("longitude",function(e){t.GeoPoint._validate(i.latitude,e),i._longitude=e}))},t.GeoPoint._validate=function(t,e){if(t<-90)throw new Error("AV.GeoPoint latitude "+t+" < -90.0.");if(t>90)throw new Error("AV.GeoPoint latitude "+t+" > 90.0.");if(e<-180)throw new Error("AV.GeoPoint longitude "+e+" < -180.0.");if(e>180)throw new Error("AV.GeoPoint longitude "+e+" > 180.0.")},t.GeoPoint.current=function(){return new t.Promise(function(e,n){navigator.geolocation.getCurrentPosition(function(n){e(new t.GeoPoint({latitude:n.coords.latitude,longitude:n.coords.longitude}))},n)})},t.GeoPoint.prototype={toJSON:function(){return t.GeoPoint._validate(this.latitude,this.longitude),{__type:"GeoPoint",latitude:this.latitude,longitude:this.longitude}},radiansTo:function(t){var e=Math.PI/180,n=this.latitude*e,r=this.longitude*e,i=t.latitude*e,o=t.longitude*e,a=n-i,s=r-o,u=Math.sin(a/2),c=Math.sin(s/2),l=u*u+Math.cos(n)*Math.cos(i)*c*c;return l=Math.min(1,l),2*Math.asin(Math.sqrt(l))},kilometersTo:function(t){return 6371*this.radiansTo(t)},milesTo:function(t){return 3958.8*this.radiansTo(t)}}}},function(t,e,n){"use strict";var r="function"==typeof Symbol&&"symbol"===s(Symbol.iterator)?function(t){return"undefined"==typeof t?"undefined":s(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":"undefined"==typeof t?"undefined":s(t)},i=n(4),o=n(1),a=function(t,e,n,r){i.applicationId&&t!==i.applicationId&&e!==i.applicationKey&&n!==i.masterKey&&console.warn("LeanCloud SDK is already initialized, please do not reinitialize it."),i.applicationId=t,i.applicationKey=e,i.masterKey=n,i._useMasterKey=!1},u=function(){console.warn("MasterKey is not supposed to be used in browser.")};i.init=function(){switch(arguments.length){case 1:var t=arguments.length<=0?void 0:arguments[0];if("object"!==("undefined"==typeof t?"undefined":r(t)))throw new Error("AV.init(): Parameter is not correct.");t.masterKey&&u(),a(t.appId,t.appKey,t.masterKey,t.hookKey),o.setServerUrlByRegion(t.region),i._config.disableCurrentUser=t.disableCurrentUser;break;case 2:case 3:console.warn("Please use AV.init() to replace AV.initialize(), AV.init() need an Object param, like { appId: 'YOUR_APP_ID', appKey: 'YOUR_APP_KEY' } . Docs: https://leancloud.cn/docs/sdk_setup-js.html"),3===arguments.length&&u(),a.apply(void 0,arguments),o.setServerUrlByRegion("cn")}},i.initialize=i.init},function(t,e,n){"use strict";var r=n(0),i=n(3),o=n(1).request;t.exports=function(t){t.Insight=t.Insight||{},r.extend(t.Insight,{startJob:function(e,n){if(!e||!e.sql)throw new Error("Please provide the sql to run the job.");var r={jobConfig:e,appId:t.applicationId},i=o("bigquery","jobs",null,"POST",t._encode(r,null,!0),n);return i.then(function(e){return t._decode(e).id})},on:function(t,e){}}),t.Insight.JobQuery=function(t,e){if(!t)throw new Error("Please provide the job id.");this.id=t,this.className=e,this._skip=0,this._limit=100},t.Insight.JobQuery.prototype={skip:function(t){return this._skip=t,this},limit:function(t){return this._limit=t,this},find:function(e){var n={skip:this._skip,limit:this._limit},r=o("bigquery","jobs",this.id,"GET",n,e);return r.then(function(e){return e.error?t.Promise.reject(new i(e.code,e.error)):t.Promise.resolve(e)})}}}},function(t,e,n){"use strict";var r=n(0),i=n(3),o=n(1).request,a=n(5),s=["objectId","createdAt","updatedAt"],u=function(t){if(s.indexOf(t)!==-1)throw new Error("key["+t+"] is reserved")};t.exports=function(t){t.Object=function(e,n){if(r.isString(e))return t.Object._create.apply(this,arguments);e=e||{},n&&n.parse&&(e=this.parse(e),e=this._mergeMagicFields(e));var i=t._getValue(this,"defaults");i&&(e=r.extend({},i,e)),n&&n.collection&&(this.collection=n.collection),this._serverData={},this._opSetQueue=[{}],this._flags={},this.attributes={},this._hashedJSON={},this._escapedAttributes={},this.cid=r.uniqueId("c"),this.changed={},this._silent={},this._pending={},this.set(e,{silent:!0}),this.changed={},this._silent={},this._pending={},this._hasData=!0,this._previousAttributes=r.clone(this.attributes),this.initialize.apply(this,arguments)},t.Object.saveAll=function(e,n){return t.Object._deepSaveAsync(e,null,n)},t.Object.fetchAll=function(e,n){return t.Promise.resolve().then(function(){return o("batch",null,null,"POST",{requests:r.map(e,function(t){if(!t.className)throw new Error("object must have className to fetch");if(!t.id)throw new Error("object must have id to fetch");if(t.dirty())throw new Error("object is modified but not saved");return{method:"GET",path:"/1.1/classes/"+t.className+"/"+t.id}})},n)}).then(function(t){return r.forEach(e,function(e,n){if(!t[n].success){var r=new Error(t[n].error.error);throw r.code=t[n].error.code,r}e._finishFetch(e.parse(t[n].success))}),e})},r.extend(t.Object.prototype,t.Events,{_fetchWhenSave:!1,initialize:function(){},fetchWhenSave:function(t){if(console.warn("AV.Object#fetchWhenSave is deprecated, use AV.Object#save with options.fetchWhenSave instead."),!r.isBoolean(t))throw new Error("Expect boolean value for fetchWhenSave");this._fetchWhenSave=t},getObjectId:function(){return this.id},getCreatedAt:function(){return this.createdAt||this.get("createdAt")},getUpdatedAt:function(){return this.updatedAt||this.get("updatedAt")},toJSON:function(){var e=this._toFullJSON();return t._arrayEach(["__type","className"],function(t){delete e[t]}),e},_toFullJSON:function(e){var n=r.clone(this.attributes);return t._objectEach(n,function(r,i){n[i]=t._encode(r,e)}),t._objectEach(this._operations,function(t,e){n[e]=t}),r.has(this,"id")&&(n.objectId=this.id),r.has(this,"createdAt")&&(r.isDate(this.createdAt)?n.createdAt=this.createdAt.toJSON():n.createdAt=this.createdAt),r.has(this,"updatedAt")&&(r.isDate(this.updatedAt)?n.updatedAt=this.updatedAt.toJSON():n.updatedAt=this.updatedAt),n.__type="Object",n.className=this.className,n},_refreshCache:function(){var e=this;e._refreshingCache||(e._refreshingCache=!0,t._objectEach(this.attributes,function(n,i){n instanceof t.Object?n._refreshCache():r.isObject(n)&&e._resetCacheForKey(i)&&e.set(i,new t.Op.Set(n),{silent:!0})}),delete e._refreshingCache)},dirty:function(t){this._refreshCache();var e=r.last(this._opSetQueue);return t?!!e[t]:!this.id||r.keys(e).length>0},_toPointer:function(){return{__type:"Pointer",className:this.className,objectId:this.id}},get:function(t){switch(t){case"objectId":return this.id;case"createdAt":case"updatedAt": +return this[t];default:return this.attributes[t]}},relation:function(e){var n=this.get(e);if(n){if(!(n instanceof t.Relation))throw new Error("Called relation() on non-relation field "+e);return n._ensureParentAndKey(this,e),n}return new t.Relation(this,e)},escape:function(t){var e=this._escapedAttributes[t];if(e)return e;var n,i=this.attributes[t];return n=a.isNullOrUndefined(i)?"":r.escape(i.toString()),this._escapedAttributes[t]=n,n},has:function(t){return!a.isNullOrUndefined(this.attributes[t])},_mergeMagicFields:function(e){var n=this,i=["objectId","createdAt","updatedAt"];return t._arrayEach(i,function(i){e[i]&&("objectId"===i?n.id=e[i]:"createdAt"!==i&&"updatedAt"!==i||r.isDate(e[i])?n[i]=e[i]:n[i]=t._parseDate(e[i]),delete e[i])}),e},_startSave:function(){this._opSetQueue.push({})},_cancelSave:function(){var e=r.first(this._opSetQueue);this._opSetQueue=r.rest(this._opSetQueue);var n=r.first(this._opSetQueue);t._objectEach(e,function(t,r){var i=e[r],o=n[r];i&&o?n[r]=o._mergeWithPrevious(i):i&&(n[r]=i)}),this._saving=this._saving-1},_finishSave:function(e){var n={};t._traverse(this.attributes,function(e){e instanceof t.Object&&e.id&&e._hasData&&(n[e.id]=e)});var i=r.first(this._opSetQueue);this._opSetQueue=r.rest(this._opSetQueue),this._applyOpSet(i,this._serverData),this._mergeMagicFields(e);var o=this;t._objectEach(e,function(e,r){o._serverData[r]=t._decode(e,r);var i=t._traverse(o._serverData[r],function(e){if(e instanceof t.Object&&n[e.id])return n[e.id]});i&&(o._serverData[r]=i)}),this._rebuildAllEstimatedData(),this._saving=this._saving-1},_finishFetch:function(e,n){this._opSetQueue=[{}],this._mergeMagicFields(e);var r=this;t._objectEach(e,function(e,n){r._serverData[n]=t._decode(e,n)}),this._rebuildAllEstimatedData(),this._refreshCache(),this._opSetQueue=[{}],this._hasData=n},_applyOpSet:function(e,n){var r=this;t._objectEach(e,function(e,i){n[i]=e._estimate(n[i],r,i),n[i]===t.Op._UNSET&&delete n[i]})},_resetCacheForKey:function(e){var n=this.attributes[e];if(r.isObject(n)&&!(n instanceof t.Object)&&!(n instanceof t.File)){n=n.toJSON?n.toJSON():n;var i=JSON.stringify(n);if(this._hashedJSON[e]!==i){var o=!!this._hashedJSON[e];return this._hashedJSON[e]=i,o}}return!1},_rebuildEstimatedDataForKey:function(e){var n=this;delete this.attributes[e],this._serverData[e]&&(this.attributes[e]=this._serverData[e]),t._arrayEach(this._opSetQueue,function(r){var i=r[e];i&&(n.attributes[e]=i._estimate(n.attributes[e],n,e),n.attributes[e]===t.Op._UNSET?delete n.attributes[e]:n._resetCacheForKey(e))})},_rebuildAllEstimatedData:function(){var e=this,n=r.clone(this.attributes);this.attributes=r.clone(this._serverData),t._arrayEach(this._opSetQueue,function(n){e._applyOpSet(n,e.attributes),t._objectEach(n,function(t,n){e._resetCacheForKey(n)})}),t._objectEach(n,function(t,n){e.attributes[n]!==t&&e.trigger("change:"+n,e,e.attributes[n],{})}),t._objectEach(this.attributes,function(t,i){r.has(n,i)||e.trigger("change:"+i,e,t,{})})},set:function(e,n,i){var o;if(r.isObject(e)||a.isNullOrUndefined(e)?(o=r.mapObject(e,function(e,n){return u(n),t._decode(e,n)}),i=n):(o={},u(e),o[e]=t._decode(n,e)),i=i||{},!o)return this;o instanceof t.Object&&(o=o.attributes),i.unset&&t._objectEach(o,function(e,n){o[n]=new t.Op.Unset});var s=r.clone(o),c=this;t._objectEach(s,function(e,n){e instanceof t.Op&&(s[n]=e._estimate(c.attributes[n],c,n),s[n]===t.Op._UNSET&&delete s[n])}),this._validate(o,i),i.changes={};var l=this._escapedAttributes;this._previousAttributes||{};return t._arrayEach(r.keys(o),function(e){var n=o[e];n instanceof t.Relation&&(n.parent=c),n instanceof t.Op||(n=new t.Op.Set(n));var a=!0;n instanceof t.Op.Set&&r.isEqual(c.attributes[e],n.value)&&(a=!1),a&&(delete l[e],i.silent?c._silent[e]=!0:i.changes[e]=!0);var s=r.last(c._opSetQueue);s[e]=n._mergeWithPrevious(s[e]),c._rebuildEstimatedDataForKey(e),a?(c.changed[e]=c.attributes[e],i.silent||(c._pending[e]=!0)):(delete c.changed[e],delete c._pending[e])}),i.silent||this.change(i),this},unset:function(t,e){return e=e||{},e.unset=!0,this.set(t,null,e)},increment:function(e,n){return(r.isUndefined(n)||r.isNull(n))&&(n=1),this.set(e,new t.Op.Increment(n))},add:function(e,n){return this.set(e,new t.Op.Add(a.ensureArray(n)))},addUnique:function(e,n){return this.set(e,new t.Op.AddUnique(a.ensureArray(n)))},remove:function(e,n){return this.set(e,new t.Op.Remove(a.ensureArray(n)))},op:function(t){return r.last(this._opSetQueue)[t]},clear:function(t){t=t||{},t.unset=!0;var e=r.extend(this.attributes,this._operations);return this.set(e,t)},_getSaveJSON:function(){var e=r.clone(r.first(this._opSetQueue));return t._objectEach(e,function(t,n){e[n]=t.toJSON()}),e},_canBeSerialized:function(){return t.Object._canBeSerializedAsValue(this.attributes)},fetch:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments[1];r.isArray(t.keys)&&(t.keys=t.keys.join(",")),r.isArray(t.include)&&(t.include=t.include.join(","));var n=this,i=o("classes",this.className,this.id,"GET",t,e);return i.then(function(t){return n._finishFetch(n.parse(t),!0),n})},save:function(e,n,i){var s,u,c;r.isObject(e)||a.isNullOrUndefined(e)?(s=e,c=n):(s={},s[e]=n,c=i),c=r.clone(c)||{},c.wait&&(u=r.clone(this.attributes));var l=r.clone(c)||{};l.wait&&(l.silent=!0),s&&this.set(s,l);var d=this;d._refreshCache();var f=[],h=[];return t.Object._findUnsavedChildren(d.attributes,f,h),f.length+h.length>0?t.Object._deepSaveAsync(this.attributes,d,c).then(function(){return d.save(null,c)}):(this._startSave(),this._saving=(this._saving||0)+1,this._allPreviousSaves=this._allPreviousSaves||t.Promise.resolve(),this._allPreviousSaves=this._allPreviousSaves.catch(function(t){}).then(function(){var t=d.id?"PUT":"POST",e=d._getSaveJSON();if(d._fetchWhenSave&&(e._fetchWhenSave=!0),c.fetchWhenSave&&(e._fetchWhenSave=!0),c.query){var n;if("function"==typeof c.query.toJSON&&(n=c.query.toJSON(),n&&(e._where=n.where)),!e._where){var i=new Error("options.query is not an AV.Query");throw i}}r.extend(e,d._flags);var a="classes",f=d.className;"_User"!==d.className||d.id||(a="users",f=null);var h=c._makeRequest||o,p=h(a,f,d.id,t,e,c);return p=p.then(function(t){var e=d.parse(t);return c.wait&&(e=r.extend(s||{},e)),d._finishSave(e),c.wait&&d.set(u,l),d},function(t){throw d._cancelSave(),t})}),this._allPreviousSaves)},destroy:function(t){t=t||{};var e=this,n=function(){e.trigger("destroy",e,e.collection,t)};if(!this.id)return n();t.wait||n();var r=o("classes",this.className,this.id,"DELETE",this._flags,t);return r.then(function(){return t.wait&&n(),e})},parse:function(e){var n=r.clone(e);return r(["createdAt","updatedAt"]).each(function(e){n[e]&&(n[e]=t._parseDate(n[e]))}),n.updatedAt||(n.updatedAt=n.createdAt),n},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return!this.id},change:function(e){e=e||{};var n=this._changing;this._changing=!0;var i=this;t._objectEach(this._silent,function(t){i._pending[t]=!0});var o=r.extend({},e.changes,this._silent);if(this._silent={},t._objectEach(o,function(t,n){i.trigger("change:"+n,i,i.get(n),e)}),n)return this;for(var a=function(t,e){i._pending[e]||i._silent[e]||delete i.changed[e]};!r.isEmpty(this._pending);)this._pending={},this.trigger("change",this,e),t._objectEach(this.changed,a),i._previousAttributes=r.clone(this.attributes);return this._changing=!1,this},hasChanged:function(t){return arguments.length?this.changed&&r.has(this.changed,t):!r.isEmpty(this.changed)},changedAttributes:function(e){if(!e)return!!this.hasChanged()&&r.clone(this.changed);var n={},i=this._previousAttributes;return t._objectEach(e,function(t,e){r.isEqual(i[e],t)||(n[e]=t)}),n},previous:function(t){return arguments.length&&this._previousAttributes?this._previousAttributes[t]:null},previousAttributes:function(){return r.clone(this._previousAttributes)},isValid:function(){try{this.validate(this.attributes)}catch(t){return!1}return!0},validate:function(e){if(r.has(e,"ACL")&&!(e.ACL instanceof t.ACL))throw new i(i.OTHER_CAUSE,"ACL must be a AV.ACL.")},_validate:function(t,e){!e.silent&&this.validate&&(t=r.extend({},this.attributes,t),this.validate(t))},getACL:function(){return this.get("ACL")},setACL:function(t,e){return this.set("ACL",t,e)},disableBeforeHook:function(){this.ignoreHook("beforeSave"),this.ignoreHook("beforeUpdate"),this.ignoreHook("beforeDelete")},disableAfterHook:function(){this.ignoreHook("afterSave"),this.ignoreHook("afterUpdate"),this.ignoreHook("afterDelete")},ignoreHook:function(e){r.contains(["beforeSave","afterSave","beforeUpdate","afterUpdate","beforeDelete","afterDelete"],e)||console.trace("Unsupported hookName: "+e),t.hookKey||console.trace("ignoreHook required hookKey"),this._flags.__ignore_hooks||(this._flags.__ignore_hooks=[]),this._flags.__ignore_hooks.push(e)}}),t.Object.createWithoutData=function(e,n,r){var i=new t.Object(e);return i.id=n,i._hasData=r,i},t.Object.destroyAll=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e||0===e.length)return t.Promise.resolve();var i=r.groupBy(e,function(t){return JSON.stringify({className:t.className,flags:t._flags})}),a={requests:r.map(i,function(t){var e=r.map(t,"id").join(",");return{method:"DELETE",path:"/1.1/classes/"+t[0].className+"/"+e,body:t[0]._flags}})};return o("batch",null,null,"POST",a,n)},t.Object._getSubclass=function(e){if(!r.isString(e))throw new Error("AV.Object._getSubclass requires a string argument.");var n=t.Object._classMap[e];return n||(n=t.Object.extend(e),t.Object._classMap[e]=n),n},t.Object._create=function(e,n,r){var i=t.Object._getSubclass(e);return new i(n,r)},t.Object._classMap={},t.Object._extend=t._extend,t.Object.new=function(e,n){return new t.Object(e,n)},t.Object.extend=function(e,n,i){if(!r.isString(e)){if(e&&r.has(e,"className"))return t.Object.extend(e.className,e,n);throw new Error("AV.Object.extend's first argument should be the className.")}"User"===e&&(e="_User");var o=null;if(r.has(t.Object._classMap,e)){var a=t.Object._classMap[e];if(!n&&!i)return a;o=a._extend(n,i)}else n=n||{},n._className=e,o=this._extend(n,i);return o.extend=function(n){if(r.isString(n)||n&&r.has(n,"className"))return t.Object.extend.apply(o,arguments);var i=[e].concat(r.toArray(arguments));return t.Object.extend.apply(o,i)},o.new=function(t,e){return new o(t,e)},t.Object._classMap[e]=o,o},Object.defineProperty(t.Object.prototype,"className",{get:function(){var t=this._className||this.constructor._LCClassName||this.constructor.name;return"User"===t?"_User":t}}),t.Object.register=function(e,n){if(!(e.prototype instanceof t.Object))throw new Error("registered class is not a subclass of AV.Object");var r=n||e.name;if(!r.length)throw new Error("registered class must be named");n&&(e._LCClassName=n),t.Object._classMap[r]=e},t.Object._findUnsavedChildren=function(e,n,r){t._traverse(e,function(e){return e instanceof t.Object?(e._refreshCache(),void(e.dirty()&&n.push(e))):e instanceof t.File?void(e.url()||e.id||r.push(e)):void 0})},t.Object._canBeSerializedAsValue=function(e){var n=!0;return e instanceof t.Object||e instanceof t.File?n=!!e.id:r.isArray(e)?t._arrayEach(e,function(e){t.Object._canBeSerializedAsValue(e)||(n=!1)}):r.isObject(e)&&t._objectEach(e,function(e){t.Object._canBeSerializedAsValue(e)||(n=!1)}),n},t.Object._deepSaveAsync=function(e,n,a){var s=[],u=[];t.Object._findUnsavedChildren(e,s,u),n&&(s=r.filter(s,function(t){return t!=n}));var c=t.Promise.resolve();r.each(u,function(t){c=c.then(function(){return t.save()})});var l=r.uniq(s),d=r.uniq(l);return c.then(function(){return t.Promise._continueWhile(function(){return d.length>0},function(){var e=[],n=[];if(t._arrayEach(d,function(t){return e.length>20?void n.push(t):void(t._canBeSerialized()?e.push(t):n.push(t))}),d=n,0===e.length)return t.Promise.reject(new i(i.OTHER_CAUSE,"Tried to save a batch with a cycle."));var s=t.Promise.resolve(r.map(e,function(e){return e._allPreviousSaves||t.Promise.resolve()})),u=s.then(function(){return o("batch",null,null,"POST",{requests:r.map(e,function(t){var e=t._getSaveJSON();r.extend(e,t._flags);var n="POST",i="/1.1/classes/"+t.className;return t.id&&(i=i+"/"+t.id,n="PUT"),t._startSave(),{method:n,path:i,body:e}})},a).then(function(n){var r;if(t._arrayEach(e,function(t,e){n[e].success?t._finishSave(t.parse(n[e].success)):(r=r||n[e].error,t._cancelSave())}),r)return t.Promise.reject(new i(r.code,r.error))})});return t._arrayEach(e,function(t){t._allPreviousSaves=u}),u})}).then(function(){return e})}}},function(t,e,n){"use strict";var r=n(0);t.exports=function(t){t.Op=function(){this._initialize.apply(this,arguments)},t.Op.prototype={_initialize:function(){}},r.extend(t.Op,{_extend:t._extend,_opDecoderMap:{},_registerDecoder:function(e,n){t.Op._opDecoderMap[e]=n},_decode:function(e){var n=t.Op._opDecoderMap[e.__op];return n?n(e):void 0}}),t.Op._registerDecoder("Batch",function(e){var n=null;return t._arrayEach(e.ops,function(e){e=t.Op._decode(e),n=e._mergeWithPrevious(n)}),n}),t.Op.Set=t.Op._extend({_initialize:function(t){this._value=t},value:function(){return this._value},toJSON:function(){return t._encode(this.value())},_mergeWithPrevious:function(t){return this},_estimate:function(t){return this.value()}}),t.Op._UNSET={},t.Op.Unset=t.Op._extend({toJSON:function(){return{__op:"Delete"}},_mergeWithPrevious:function(t){return this},_estimate:function(e){return t.Op._UNSET}}),t.Op._registerDecoder("Delete",function(e){return new t.Op.Unset}),t.Op.Increment=t.Op._extend({_initialize:function(t){this._amount=t},amount:function(){return this._amount},toJSON:function(){return{__op:"Increment",amount:this._amount}},_mergeWithPrevious:function(e){if(e){if(e instanceof t.Op.Unset)return new t.Op.Set(this.amount());if(e instanceof t.Op.Set)return new t.Op.Set(e.value()+this.amount());if(e instanceof t.Op.Increment)return new t.Op.Increment(this.amount()+e.amount());throw new Error("Op is invalid after previous op.")}return this},_estimate:function(t){return t?t+this.amount():this.amount()}}),t.Op._registerDecoder("Increment",function(e){return new t.Op.Increment(e.amount)}),t.Op.Add=t.Op._extend({_initialize:function(t){this._objects=t},objects:function(){return this._objects},toJSON:function(){return{__op:"Add",objects:t._encode(this.objects())}},_mergeWithPrevious:function(e){if(e){if(e instanceof t.Op.Unset)return new t.Op.Set(this.objects());if(e instanceof t.Op.Set)return new t.Op.Set(this._estimate(e.value()));if(e instanceof t.Op.Add)return new t.Op.Add(e.objects().concat(this.objects()));throw new Error("Op is invalid after previous op.")}return this},_estimate:function(t){return t?t.concat(this.objects()):r.clone(this.objects())}}),t.Op._registerDecoder("Add",function(e){return new t.Op.Add(t._decode(e.objects))}),t.Op.AddUnique=t.Op._extend({_initialize:function(t){this._objects=r.uniq(t)},objects:function(){return this._objects},toJSON:function(){return{__op:"AddUnique",objects:t._encode(this.objects())}},_mergeWithPrevious:function(e){if(e){if(e instanceof t.Op.Unset)return new t.Op.Set(this.objects());if(e instanceof t.Op.Set)return new t.Op.Set(this._estimate(e.value()));if(e instanceof t.Op.AddUnique)return new t.Op.AddUnique(this._estimate(e.objects()));throw new Error("Op is invalid after previous op.")}return this},_estimate:function(e){if(e){var n=r.clone(e);return t._arrayEach(this.objects(),function(e){if(e instanceof t.Object&&e.id){var i=r.find(n,function(n){return n instanceof t.Object&&n.id===e.id});if(i){var o=r.indexOf(n,i);n[o]=e}else n.push(e)}else r.contains(n,e)||n.push(e)}),n}return r.clone(this.objects())}}),t.Op._registerDecoder("AddUnique",function(e){return new t.Op.AddUnique(t._decode(e.objects))}),t.Op.Remove=t.Op._extend({_initialize:function(t){this._objects=r.uniq(t)},objects:function(){return this._objects},toJSON:function(){return{__op:"Remove",objects:t._encode(this.objects())}},_mergeWithPrevious:function(e){if(e){if(e instanceof t.Op.Unset)return e;if(e instanceof t.Op.Set)return new t.Op.Set(this._estimate(e.value()));if(e instanceof t.Op.Remove)return new t.Op.Remove(r.union(e.objects(),this.objects()));throw new Error("Op is invalid after previous op.")}return this},_estimate:function(e){if(e){var n=r.difference(e,this.objects());return t._arrayEach(this.objects(),function(e){e instanceof t.Object&&e.id&&(n=r.reject(n,function(n){return n instanceof t.Object&&n.id===e.id}))}),n}return[]}}),t.Op._registerDecoder("Remove",function(e){return new t.Op.Remove(t._decode(e.objects))}),t.Op.Relation=t.Op._extend({_initialize:function(e,n){this._targetClassName=null;var i=this,o=function(e){if(e instanceof t.Object){if(!e.id)throw new Error("You can't add an unsaved AV.Object to a relation.");if(i._targetClassName||(i._targetClassName=e.className),i._targetClassName!==e.className)throw new Error("Tried to create a AV.Relation with 2 different types: "+i._targetClassName+" and "+e.className+".");return e.id}return e};this.relationsToAdd=r.uniq(r.map(e,o)),this.relationsToRemove=r.uniq(r.map(n,o))},added:function(){var e=this;return r.map(this.relationsToAdd,function(n){var r=t.Object._create(e._targetClassName);return r.id=n,r})},removed:function(){var e=this;return r.map(this.relationsToRemove,function(n){var r=t.Object._create(e._targetClassName);return r.id=n,r})},toJSON:function(){var t=null,e=null,n=this,i=function(t){return{__type:"Pointer",className:n._targetClassName,objectId:t}},o=null;return this.relationsToAdd.length>0&&(o=r.map(this.relationsToAdd,i),t={__op:"AddRelation",objects:o}),this.relationsToRemove.length>0&&(o=r.map(this.relationsToRemove,i),e={__op:"RemoveRelation",objects:o}),t&&e?{__op:"Batch",ops:[t,e]}:t||e||{}},_mergeWithPrevious:function(e){if(e){if(e instanceof t.Op.Unset)throw new Error("You can't modify a relation after deleting it.");if(e instanceof t.Op.Relation){if(e._targetClassName&&e._targetClassName!==this._targetClassName)throw new Error("Related object must be of class "+e._targetClassName+", but "+this._targetClassName+" was passed in.");var n=r.union(r.difference(e.relationsToAdd,this.relationsToRemove),this.relationsToAdd),i=r.union(r.difference(e.relationsToRemove,this.relationsToAdd),this.relationsToRemove),o=new t.Op.Relation(n,i);return o._targetClassName=this._targetClassName,o}throw new Error("Op is invalid after previous op.")}return this},_estimate:function(e,n,r){if(e){if(e instanceof t.Relation){if(this._targetClassName)if(e.targetClassName){if(e.targetClassName!==this._targetClassName)throw new Error("Related object must be a "+e.targetClassName+", but a "+this._targetClassName+" was passed in.")}else e.targetClassName=this._targetClassName;return e}throw new Error("Op is invalid after previous op.")}var i=new t.Relation(n,r);i.targetClassName=this._targetClassName}}),t.Op._registerDecoder("AddRelation",function(e){return new t.Op.Relation(t._decode(e.objects),[])}),t.Op._registerDecoder("RemoveRelation",function(e){return new t.Op.Relation([],t._decode(e.objects))})}},function(t,e,n){"use strict";var r=n(1).request;t.exports=function(t){t.Installation=t.Object.extend("_Installation"),t.Push=t.Push||{},t.Push.send=function(t,e){if(t.where&&(t.where=t.where.toJSON().where),t.where&&t.cql)throw new Error("Both where and cql can't be set");if(t.push_time&&(t.push_time=t.push_time.toJSON()),t.expiration_time&&(t.expiration_time=t.expiration_time.toJSON()),t.expiration_time&&t.expiration_time_interval)throw new Error("Both expiration_time and expiration_time_interval can't be set");var n=r("push",null,null,"POST",t,e);return n}}},function(t,e,n){"use strict";var r=n(0),i=n(3),o=n(1).request,a=n(5),s=a.ensureArray,u=function(t,e){if(void 0===t)throw new Error(e)};t.exports=function(t){t.Query=function(e){r.isString(e)&&(e=t.Object._getSubclass(e)),this.objectClass=e,this.className=e.prototype.className,this._where={},this._include=[],this._select=[],this._limit=-1,this._skip=0,this._extraOptions={}},t.Query.or=function(){var e=r.toArray(arguments),n=null;t._arrayEach(e,function(t){if(r.isNull(n)&&(n=t.className),n!==t.className)throw new Error("All queries must be for the same class")});var i=new t.Query(n);return i._orQuery(e),i},t.Query.and=function(){var e=r.toArray(arguments),n=null;t._arrayEach(e,function(t){if(r.isNull(n)&&(n=t.className),n!==t.className)throw new Error("All queries must be for the same class")});var i=new t.Query(n);return i._andQuery(e),i},t.Query.doCloudQuery=function(e,n,i){var a={cql:e};r.isArray(n)?a.pvalues=n:i=n;var s=o("cloudQuery",null,null,"GET",a,i);return s.then(function(e){var n=new t.Query(e.className),i=r.map(e.results,function(t){var r=n._newObject(e);return r._finishFetch&&r._finishFetch(n._processResult(t),!0),r});return{results:i,count:e.count,className:e.className}})},t.Query._extend=t._extend,t.Query.prototype={_processResult:function(t){return t},get:function(t,e){if(!t){var n=new i(i.OBJECT_NOT_FOUND,"Object not found.");throw n}var r=this,o=r._newObject();o.id=t;var a=r.toJSON(),s={};return a.keys&&(s.keys=a.keys),a.include&&(s.include=a.include),o.fetch(s,e)},toJSON:function(){var e={where:this._where};return this._include.length>0&&(e.include=this._include.join(",")),this._select.length>0&&(e.keys=this._select.join(",")),this._limit>=0&&(e.limit=this._limit),this._skip>0&&(e.skip=this._skip),void 0!==this._order&&(e.order=this._order),t._objectEach(this._extraOptions,function(t,n){e[n]=t}),e},_newObject:function(e){var n;return n=e&&e.className?new t.Object(e.className):new this.objectClass},_createRequest:function(t,e){return o("classes",this.className,null,"GET",t||this.toJSON(),e)},find:function(t){var e=this,n=this._createRequest(null,t);return n.then(function(t){return r.map(t.results,function(n){var r=e._newObject(t);return r._finishFetch&&r._finishFetch(e._processResult(n),!0),r})})},destroyAll:function(e){var n=this;return n.find(e).then(function(e){return t.Object.destroyAll(e)})},count:function(t){var e=this.toJSON();e.limit=0,e.count=1;var n=this._createRequest(e,t);return n.then(function(t){return t.count})},first:function(t){var e=this,n=this.toJSON();n.limit=1;var i=this._createRequest(n,t);return i.then(function(t){return r.map(t.results,function(t){var n=e._newObject();return n._finishFetch&&n._finishFetch(e._processResult(t),!0),n})[0]})},skip:function(t){return u(t,"undefined is not a valid skip value"),this._skip=t,this},limit:function(t){return u(t,"undefined is not a valid limit value"),this._limit=t,this},equalTo:function(e,n){return u(e,"undefined is not a valid key"),u(n,"undefined is not a valid value"),this._where[e]=t._encode(n),this},_addCondition:function(e,n,r){return u(e,"undefined is not a valid condition key"),u(n,"undefined is not a valid condition"),u(r,"undefined is not a valid condition value"),this._where[e]||(this._where[e]={}),this._where[e][n]=t._encode(r),this},sizeEqualTo:function(t,e){this._addCondition(t,"$size",e)},notEqualTo:function(t,e){return this._addCondition(t,"$ne",e),this},lessThan:function(t,e){return this._addCondition(t,"$lt",e),this},greaterThan:function(t,e){return this._addCondition(t,"$gt",e),this},lessThanOrEqualTo:function(t,e){return this._addCondition(t,"$lte",e),this},greaterThanOrEqualTo:function(t,e){return this._addCondition(t,"$gte",e),this},containedIn:function(t,e){return this._addCondition(t,"$in",e),this},notContainedIn:function(t,e){return this._addCondition(t,"$nin",e),this},containsAll:function(t,e){return this._addCondition(t,"$all",e),this},exists:function(t){return this._addCondition(t,"$exists",!0),this},doesNotExist:function(t){return this._addCondition(t,"$exists",!1),this},matches:function(t,e,n){return this._addCondition(t,"$regex",e),n||(n=""),e.ignoreCase&&(n+="i"),e.multiline&&(n+="m"),n&&n.length&&this._addCondition(t,"$options",n),this},matchesQuery:function(t,e){var n=e.toJSON();return n.className=e.className,this._addCondition(t,"$inQuery",n),this},doesNotMatchQuery:function(t,e){var n=e.toJSON();return n.className=e.className,this._addCondition(t,"$notInQuery",n),this},matchesKeyInQuery:function(t,e,n){var r=n.toJSON();return r.className=n.className,this._addCondition(t,"$select",{key:e,query:r}),this},doesNotMatchKeyInQuery:function(t,e,n){var r=n.toJSON();return r.className=n.className,this._addCondition(t,"$dontSelect",{key:e,query:r}),this},_orQuery:function(t){var e=r.map(t,function(t){return t.toJSON().where});return this._where.$or=e,this},_andQuery:function(t){var e=r.map(t,function(t){return t.toJSON().where});return this._where.$and=e,this},_quote:function(t){return"\\Q"+t.replace("\\E","\\E\\\\E\\Q")+"\\E"},contains:function(t,e){return this._addCondition(t,"$regex",this._quote(e)),this},startsWith:function(t,e){return this._addCondition(t,"$regex","^"+this._quote(e)),this},endsWith:function(t,e){return this._addCondition(t,"$regex",this._quote(e)+"$"),this},ascending:function(t){return u(t,"undefined is not a valid key"),this._order=t,this},addAscending:function(t){return u(t,"undefined is not a valid key"),this._order?this._order+=","+t:this._order=t,this},descending:function(t){return u(t,"undefined is not a valid key"),this._order="-"+t,this},addDescending:function(t){return u(t,"undefined is not a valid key"),this._order?this._order+=",-"+t:this._order="-"+t,this},near:function(e,n){return n instanceof t.GeoPoint||(n=new t.GeoPoint(n)),this._addCondition(e,"$nearSphere",n),this},withinRadians:function(t,e,n){return this.near(t,e),this._addCondition(t,"$maxDistance",n),this},withinMiles:function(t,e,n){return this.withinRadians(t,e,n/3958.8)},withinKilometers:function(t,e,n){return this.withinRadians(t,e,n/6371)},withinGeoBox:function(e,n,r){return n instanceof t.GeoPoint||(n=new t.GeoPoint(n)),r instanceof t.GeoPoint||(r=new t.GeoPoint(r)),this._addCondition(e,"$within",{$box:[n,r]}),this},include:function(t){var e=this;return u(t,"undefined is not a valid key"),r(arguments).forEach(function(t){e._include=e._include.concat(s(t))}),this},select:function(t){var e=this;return u(t,"undefined is not a valid key"),r(arguments).forEach(function(t){e._select=e._select.concat(s(t))}),this},each:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this._order||this._skip||this._limit>=0){var i=new Error("Cannot iterate on a query with sort, skip, or limit.");return t.Promise.reject(i)}var o=new t.Query(this.objectClass);o._limit=n.batchSize||100,o._where=r.clone(this._where),o._include=r.clone(this._include),o.ascending("objectId");var a=!1;return t.Promise._continueWhile(function(){return!a},function(){return o.find(n).then(function(n){var i=t.Promise.resolve();return r.each(n,function(t){i=i.then(function(){return e(t)})}),i.then(function(){n.length>=o._limit?o.greaterThan("objectId",n[n.length-1].id):a=!0})})})}},t.FriendShipQuery=t.Query._extend({_objectClass:t.User,_newObject:function(){return new t.User},_processResult:function(t){if(t&&t[this._friendshipTag]){var e=t[this._friendshipTag];return"Pointer"===e.__type&&"_User"===e.className&&(delete e.__type,delete e.className),e}return null}})}},function(t,e,n){"use strict";var r=n(0);t.exports=function(t){t.Relation=function(t,e){if(!r.isString(e))throw new TypeError("key must be a string");this.parent=t,this.key=e,this.targetClassName=null},t.Relation.reverseQuery=function(e,n,r){var i=new t.Query(e);return i.equalTo(n,r._toPointer()),i},t.Relation.prototype={_ensureParentAndKey:function(t,e){if(this.parent=this.parent||t,this.key=this.key||e,this.parent!==t)throw new Error("Internal Error. Relation retrieved from two different Objects.");if(this.key!==e)throw new Error("Internal Error. Relation retrieved from two different keys.")},add:function(e){r.isArray(e)||(e=[e]);var n=new t.Op.Relation(e,[]);this.parent.set(this.key,n),this.targetClassName=n._targetClassName},remove:function(e){r.isArray(e)||(e=[e]);var n=new t.Op.Relation([],e);this.parent.set(this.key,n),this.targetClassName=n._targetClassName},toJSON:function(){return{__type:"Relation",className:this.targetClassName}},query:function e(){var n,e;return this.targetClassName?(n=t.Object._getSubclass(this.targetClassName),e=new t.Query(n)):(n=t.Object._getSubclass(this.parent.className),e=new t.Query(n),e._extraOptions.redirectClassNameForKey=this.key),e._addCondition("$relatedTo","object",this.parent._toPointer()),e._addCondition("$relatedTo","key",this.key),e}}}},function(t,e,n){"use strict";var r=n(0),i=n(3);t.exports=function(t){t.Role=t.Object.extend("_Role",{constructor:function(e,n){if(r.isString(e)?(t.Object.prototype.constructor.call(this,null,null),this.setName(e)):t.Object.prototype.constructor.call(this,e,n),void 0===n){var i=new t.ACL;i.setPublicReadAccess(!0),this.getACL()||this.setACL(i)}else{if(!(n instanceof t.ACL))throw new TypeError("acl must be an instance of AV.ACL");this.setACL(n)}},getName:function(){return this.get("name")},setName:function(t,e){return this.set("name",t,e)},getUsers:function(){return this.relation("users")},getRoles:function(){return this.relation("roles")},validate:function(e,n){if("name"in e&&e.name!==this.getName()){var o=e.name;if(this.id&&this.id!==e.objectId)return new i(i.OTHER_CAUSE,"A role's name can only be set before it has been saved.");if(!r.isString(o))return new i(i.OTHER_CAUSE,"A role's name must be a String.");if(!/^[0-9a-zA-Z\-_ ]+$/.test(o))return new i(i.OTHER_CAUSE,"A role's name can only contain alphanumeric characters, _, -, and spaces.")}return!!t.Object.prototype.validate&&t.Object.prototype.validate.call(this,e,n)}})}},function(t,e,n){"use strict";var r=n(0),i=n(1).request;t.exports=function(t){t.SearchSortBuilder=function(){this._sortFields=[]},t.SearchSortBuilder.prototype={_addField:function(t,e,n,r){var i={};return i[t]={order:e||"asc",mode:n||"avg",missing:"_"+(r||"last")},this._sortFields.push(i),this},ascending:function(t,e,n){return this._addField(t,"asc",e,n)},descending:function(t,e,n){return this._addField(t,"desc",e,n)},whereNear:function(t,e,n){n=n||{};var r={},i={lat:e.latitude,lon:e.longitude},o={order:n.order||"asc",mode:n.mode||"avg",unit:n.unit||"km"};return o[t]=i,r._geo_distance=o,this._sortFields.push(r),this},build:function(){return JSON.stringify(t._encode(this._sortFields))}},t.SearchQuery=t.Query._extend({_sid:null,_hits:0,_queryString:null,_highlights:null,_sortBuilder:null,_createRequest:function(t,e){return i("search/select",null,null,"GET",t||this.toJSON(),e)},sid:function(t){return this._sid=t,this},queryString:function(t){return this._queryString=t,this},highlights:function(t){var e;return e=t&&r.isString(t)?arguments:t,this._highlights=e,this},sortBy:function(t){return this._sortBuilder=t,this},hits:function(){return this._hits||(this._hits=0),this._hits},_processResult:function(t){return delete t.className,delete t._app_url,delete t._deeplink,t},hasMore:function(){return!this._hitEnd},reset:function(){this._hitEnd=!1,this._sid=null,this._hits=0},find:function(){var t=this,e=this._createRequest();return e.then(function(e){return e.sid?(t._oldSid=t._sid,t._sid=e.sid):(t._sid=null,t._hitEnd=!0),t._hits=e.hits||0,r.map(e.results,function(n){n.className&&(e.className=n.className);var r=t._newObject(e);return r.appURL=n._app_url,r._finishFetch(t._processResult(n),!0),r})})},toJSON:function(){var e=t.SearchQuery.__super__.toJSON.call(this);if(delete e.where,this.className&&(e.clazz=this.className),this._sid&&(e.sid=this._sid),!this._queryString)throw new Error("Please set query string.");if(e.q=this._queryString,this._highlights&&(e.highlights=this._highlights.join(",")),this._sortBuilder&&e.order)throw new Error("sort and order can not be set at same time.");return this._sortBuilder&&(e.sort=this._sortBuilder.build()),e}})}},function(t,e,n){"use strict";var r="function"==typeof Symbol&&"symbol"===s(Symbol.iterator)?function(t){return"undefined"==typeof t?"undefined":s(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":"undefined"==typeof t?"undefined":s(t)},i=n(0),o=n(1).request;t.exports=function(t){var e=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}; +return t.User.currentAsync().then(function(n){return n||t.User._fetchUserBySessionToken(e.sessionToken)})},n=function(n){return e(n).then(function(e){return t.Object.createWithoutData("_User",e.id)._toPointer()})};t.Status=function(t,e){return this.data={},this.inboxType="default",this.query=null,t&&"object"===("undefined"==typeof t?"undefined":r(t))?this.data=t:(t&&(this.data.image=t),e&&(this.data.message=e)),this},t.Status.prototype={get:function(t){return this.data[t]},set:function(t,e){return this.data[t]=e,this},destroy:function(e){if(!this.id)return t.Promise.reject(new Error("The status id is not exists."));var n=o("statuses",null,this.id,"DELETE",e&&e.sessionToken);return n},toObject:function(){return this.id?t.Object.createWithoutData("_Status",this.id):null},_getDataJSON:function(){var e=i.clone(this.data);return t._encode(e)},send:function(){var e=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!r.sessionToken&&!t.User.current())throw new Error("Please signin an user.");return this.query?n(r).then(function(t){var n=e.query.toJSON();n.className=e.query.className;var i={};return i.query=n,e.data=e.data||{},e.data.source=e.data.source||t,i.data=e._getDataJSON(),i.inboxType=e.inboxType||"default",o("statuses",null,null,"POST",i,r.sessionToken)}).then(function(n){return e.id=n.objectId,e.createdAt=t._parseDate(n.createdAt),e}):t.Status.sendStatusToFollowers(this,r)},_finishFetch:function(e){this.id=e.objectId,this.createdAt=t._parseDate(e.createdAt),this.updatedAt=t._parseDate(e.updatedAt),this.messageId=e.messageId,delete e.messageId,delete e.objectId,delete e.createdAt,delete e.updatedAt,this.data=t._decode(e)}},t.Status.sendStatusToFollowers=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!r.sessionToken&&!t.User.current())throw new Error("Please signin an user.");return n(r).then(function(n){var i={};i.className="_Follower",i.keys="follower",i.where={user:n};var a={};a.query=i,e.data=e.data||{},e.data.source=e.data.source||n,a.data=e._getDataJSON(),a.inboxType=e.inboxType||"default";var s=o("statuses",null,null,"POST",a,r.sessionToken);return s.then(function(n){return e.id=n.objectId,e.createdAt=t._parseDate(n.createdAt),e})})},t.Status.sendPrivateStatus=function(e,r){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!a.sessionToken&&!t.User.current())throw new Error("Please signin an user.");if(!r)throw new Error("Invalid target user.");var s=i.isString(r)?r:r.id;if(!s)throw new Error("Invalid target user.");return n(a).then(function(n){var r={};r.className="_User",r.where={objectId:s};var i={};i.query=r,e.data=e.data||{},e.data.source=e.data.source||n,i.data=e._getDataJSON(),i.inboxType="private",e.inboxType="private";var u=o("statuses",null,null,"POST",i,a.sessionToken);return u.then(function(n){return e.id=n.objectId,e.createdAt=t._parseDate(n.createdAt),e})})},t.Status.countUnreadStatuses=function(n){var r=(i.isString(arguments[1])?arguments[2]:arguments[1])||{},a=i.isString(arguments[1])?arguments[1]:"default";if(!r.sessionToken&&null==n&&!t.User.current())throw new Error("Please signin an user or pass the owner objectId.");return e(r).then(function(e){var n={};return n.inboxType=t._encode(a),n.owner=t._encode(e),o("subscribe/statuses/count",null,null,"GET",n,r.sessionToken)})},t.Status.statusQuery=function(e){var n=new t.Query("_Status");return e&&n.equalTo("source",e),n},t.InboxQuery=t.Query._extend({_objectClass:t.Status,_sinceId:0,_maxId:0,_inboxType:"default",_owner:null,_newObject:function(){return new t.Status},_createRequest:function(t,e){return o("subscribe/statuses",null,null,"GET",t||this.toJSON(),e&&e.sessionToken)},sinceId:function(t){return this._sinceId=t,this},maxId:function(t){return this._maxId=t,this},owner:function(t){return this._owner=t,this},inboxType:function(t){return this._inboxType=t,this},toJSON:function(){var e=t.InboxQuery.__super__.toJSON.call(this);return e.owner=t._encode(this._owner),e.inboxType=t._encode(this._inboxType),e.sinceId=t._encode(this._sinceId),e.maxId=t._encode(this._maxId),e}}),t.Status.inboxQuery=function(e,n){var r=new t.InboxQuery(t.Status);return e&&(r._owner=e),n&&(r._inboxType=n),r}}},function(t,e,n){"use strict";var r=n(0),i=n(3),o=n(1).request,a=n(2),s=function(){if("undefined"==typeof wx||"function"!=typeof wx.login)throw new Error("Weapp Login is only available in Weapp");return new a(function(t,e){wx.login({success:function(n){var r=n.code,i=n.errMsg;r?t(r):e(new Error(i))}})})};t.exports=function(t){t.User=t.Object.extend("_User",{_isCurrentUser:!1,_mergeMagicFields:function(e){e.sessionToken&&(this._sessionToken=e.sessionToken,delete e.sessionToken),t.User.__super__._mergeMagicFields.call(this,e)},_cleanupAuthData:function(){if(this.isCurrent()){var e=this.get("authData");e&&t._objectEach(this.get("authData"),function(t,n){e[n]||delete e[n]})}},_synchronizeAllAuthData:function(){var e=this.get("authData");if(e){var n=this;t._objectEach(this.get("authData"),function(t,e){n._synchronizeAuthData(e)})}},_synchronizeAuthData:function(e){if(this.isCurrent()){var n;r.isString(e)?(n=e,e=t.User._authProviders[n]):n=e.getAuthType();var i=this.get("authData");if(i&&e){var o=e.restoreAuthentication(i[n]);o||this._unlinkFrom(e)}}},_handleSaveResult:function(e){return e&&!t._config.disableCurrentUser&&(this._isCurrentUser=!0),this._cleanupAuthData(),this._synchronizeAllAuthData(),delete this._serverData.password,this._rebuildEstimatedDataForKey("password"),this._refreshCache(),!e&&!this.isCurrent()||t._config.disableCurrentUser?a.resolve():a.resolve(t.User._saveCurrentUser(this))},_linkWith:function(e,n){var i,o=this;if(r.isString(e)?(i=e,e=t.User._authProviders[e]):i=e.getAuthType(),n){var a=this.get("authData")||{};return a[i]=n,this.save({authData:a}).then(function(t){return t._handleSaveResult(!0).then(function(){return t})})}return e.authenticate().then(function(t){return o._linkWith(e,t)})},linkWithWeapp:function(){var t=this;return s().then(function(e){return t._linkWith("lc_weapp",{code:e})})},_unlinkFrom:function(e){var n=this;return r.isString(e)&&(e=t.User._authProviders[e]),this._linkWith(e,null).then(function(t){return n._synchronizeAuthData(e),t})},_isLinked:function(t){var e;e=r.isString(t)?t:t.getAuthType();var n=this.get("authData")||{};return!!n[e]},logOut:function(){this._logOutWithAll(),this._isCurrentUser=!1},_logOutWithAll:function(){var e=this.get("authData");if(e){var n=this;t._objectEach(this.get("authData"),function(t,e){n._logOutWith(e)})}},_logOutWith:function(e){this.isCurrent()&&(r.isString(e)&&(e=t.User._authProviders[e]),e&&e.deauthenticate&&e.deauthenticate())},signUp:function(t,e){var n,r=t&&t.username||this.get("username");if(!r||""===r)throw n=new i(i.OTHER_CAUSE,"Cannot sign up user with an empty name.");var o=t&&t.password||this.get("password");if(!o||""===o)throw n=new i(i.OTHER_CAUSE,"Cannot sign up user with an empty password.");return this.save(t,e).then(function(t){return t._handleSaveResult(!0).then(function(){return t})})},signUpOrlogInWithMobilePhone:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t&&t.mobilePhoneNumber||this.get("mobilePhoneNumber");if(!r||""===r)throw e=new i(i.OTHER_CAUSE,"Cannot sign up or login user by mobilePhoneNumber with an empty mobilePhoneNumber.");var a=t&&t.smsCode||this.get("smsCode");if(!a||""===a)throw e=new i(i.OTHER_CAUSE,"Cannot sign up or login user by mobilePhoneNumber with an empty smsCode.");return n._makeRequest=function(t,e,n,r,i){return o("usersByMobilePhone",null,null,"POST",i)},this.save(t,n).then(function(t){return delete t.attributes.smsCode,delete t._serverData.smsCode,t._handleSaveResult(!0).then(function(){return t})})},logIn:function(){var t=this,e=o("login",null,null,"POST",this.toJSON());return e.then(function(e){var n=t.parse(e);return t._finishFetch(n),t._handleSaveResult(!0).then(function(){return n.smsCode||delete t.attributes.smsCode,t})})},save:function(e,n,i){var o,a;return r.isObject(e)||r.isNull(e)||r.isUndefined(e)?(o=e,a=n):(o={},o[e]=n,a=i),a=a||{},t.Object.prototype.save.call(this,o,a).then(function(t){return t._handleSaveResult(!1).then(function(){return t})})},follow:function(t,e){if(!this.id)throw new Error("Please signin.");if(!t)throw new Error("Invalid target user.");var n=r.isString(t)?t:t.id;if(!n)throw new Error("Invalid target user.");var i="users/"+this.id+"/friendship/"+n,a=o(i,null,null,"POST",null,e);return a},unfollow:function(t,e){if(!this.id)throw new Error("Please signin.");if(!t)throw new Error("Invalid target user.");var n=r.isString(t)?t:t.id;if(!n)throw new Error("Invalid target user.");var i="users/"+this.id+"/friendship/"+n,a=o(i,null,null,"DELETE",null,e);return a},followerQuery:function(){return t.User.followerQuery(this.id)},followeeQuery:function(){return t.User.followeeQuery(this.id)},fetch:function(e,n){return t.Object.prototype.fetch.call(this,e,n).then(function(t){return t._handleSaveResult(!1).then(function(){return t})})},updatePassword:function(t,e,n){var r="users/"+this.id+"/updatePassword",i={old_password:t,new_password:e},a=o(r,null,null,"PUT",i,n);return a},isCurrent:function(){return this._isCurrentUser},getUsername:function(){return this.get("username")},getMobilePhoneNumber:function(){return this.get("mobilePhoneNumber")},setMobilePhoneNumber:function(t,e){return this.set("mobilePhoneNumber",t,e)},setUsername:function(t,e){return this.set("username",t,e)},setPassword:function(t,e){return this.set("password",t,e)},getEmail:function(){return this.get("email")},setEmail:function(t,e){return this.set("email",t,e)},authenticated:function(){return console.warn("DEPRECATED: 如果要判断当前用户的登录状态是否有效,请使用 currentUser.isAuthenticated().then(),如果要判断该用户是否是当前登录用户,请使用 user.id === currentUser.id。"),!!this._sessionToken&&!t._config.disableCurrentUser&&t.User.current()&&t.User.current().id===this.id},isAuthenticated:function(){var e=this;return a.resolve().then(function(){return!!e._sessionToken&&t.User._fetchUserBySessionToken(e._sessionToken).then(function(){return!0},function(t){if(211===t.code)return!1;throw t})})},getSessionToken:function(){return this._sessionToken},getRoles:function(e){return t.Relation.reverseQuery("_Role","users",this).find(e)}},{_currentUser:null,_currentUserMatchesDisk:!1,_CURRENT_USER_KEY:"currentUser",_authProviders:{},signUp:function(e,n,r,i){r=r||{},r.username=e,r.password=n;var o=t.Object._create("_User");return o.signUp(r,i)},logIn:function(e,n,r){var i=t.Object._create("_User");return i._finishFetch({username:e,password:n}),i.logIn(r)},become:function(t){return this._fetchUserBySessionToken(t).then(function(t){return t._handleSaveResult(!0).then(function(){return t})})},_fetchUserBySessionToken:function(e){var n=t.Object._create("_User");return o("users","me",null,"GET",{session_token:e}).then(function(t){var e=n.parse(t);return n._finishFetch(e),n})},logInWithMobilePhoneSmsCode:function(e,n,r){var i=t.Object._create("_User");return i._finishFetch({mobilePhoneNumber:e,smsCode:n}),i.logIn(r)},signUpOrlogInWithMobilePhone:function(e,n,r,i){r=r||{},r.mobilePhoneNumber=e,r.smsCode=n;var o=t.Object._create("_User");return o.signUpOrlogInWithMobilePhone(r,i)},logInWithMobilePhone:function(e,n,r){var i=t.Object._create("_User");return i._finishFetch({mobilePhoneNumber:e,password:n}),i.logIn(r)},signUpOrlogInWithAuthData:function(e,n){return t.User._logInWith(n,e)},loginWithWeapp:function(){var t=this;return s().then(function(e){return t.signUpOrlogInWithAuthData({code:e},"lc_weapp")})},associateWithAuthData:function(t,e,n){return t._linkWith(e,n)},logOut:function(){return t._config.disableCurrentUser?(console.warn("AV.User.current() was disabled in multi-user environment, call logOut() from user object instead https://leancloud.cn/docs/leanengine-node-sdk-upgrade-1.html"),a.resolve(null)):(null!==t.User._currentUser&&(t.User._currentUser._logOutWithAll(),t.User._currentUser._isCurrentUser=!1),t.User._currentUserMatchesDisk=!0,t.User._currentUser=null,t.localStorage.removeItemAsync(t._getAVPath(t.User._CURRENT_USER_KEY)))},followerQuery:function(e){if(!e||!r.isString(e))throw new Error("Invalid user object id.");var n=new t.FriendShipQuery("_Follower");return n._friendshipTag="follower",n.equalTo("user",t.Object.createWithoutData("_User",e)),n},followeeQuery:function(e){if(!e||!r.isString(e))throw new Error("Invalid user object id.");var n=new t.FriendShipQuery("_Followee");return n._friendshipTag="followee",n.equalTo("user",t.Object.createWithoutData("_User",e)),n},requestPasswordReset:function(t){var e={email:t},n=o("requestPasswordReset",null,null,"POST",e);return n},requestEmailVerify:function(t){var e={email:t},n=o("requestEmailVerify",null,null,"POST",e);return n},requestMobilePhoneVerify:function(t){var e={mobilePhoneNumber:t},n=o("requestMobilePhoneVerify",null,null,"POST",e);return n},requestPasswordResetBySmsCode:function(t){var e={mobilePhoneNumber:t},n=o("requestPasswordResetBySmsCode",null,null,"POST",e);return n},resetPasswordBySmsCode:function(t,e){var n={password:e},r=o("resetPasswordBySmsCode",null,t,"PUT",n);return r},verifyMobilePhone:function(t){var e=o("verifyMobilePhone",null,t,"POST",null);return e},requestLoginSmsCode:function(t){var e={mobilePhoneNumber:t},n=o("requestLoginSmsCode",null,null,"POST",e);return n},currentAsync:function(){return t._config.disableCurrentUser?(console.warn("AV.User.currentAsync() was disabled in multi-user environment, access user from request instead https://leancloud.cn/docs/leanengine-node-sdk-upgrade-1.html"),a.resolve(null)):t.User._currentUser?a.resolve(t.User._currentUser):t.User._currentUserMatchesDisk?a.resolve(t.User._currentUser):t.localStorage.getItemAsync(t._getAVPath(t.User._CURRENT_USER_KEY)).then(function(e){if(!e)return null;t.User._currentUserMatchesDisk=!0,t.User._currentUser=t.Object._create("_User"),t.User._currentUser._isCurrentUser=!0;var n=JSON.parse(e);return t.User._currentUser.id=n._id,delete n._id,t.User._currentUser._sessionToken=n._sessionToken,delete n._sessionToken,t.User._currentUser._finishFetch(n),t.User._currentUser._synchronizeAllAuthData(),t.User._currentUser._refreshCache(),t.User._currentUser._opSetQueue=[{}],t.User._currentUser})},current:function(){if(t._config.disableCurrentUser)return console.warn("AV.User.current() was disabled in multi-user environment, access user from request instead https://leancloud.cn/docs/leanengine-node-sdk-upgrade-1.html"),null;if(t.User._currentUser)return t.User._currentUser;if(t.User._currentUserMatchesDisk)return t.User._currentUser;t.User._currentUserMatchesDisk=!0;var e=t.localStorage.getItem(t._getAVPath(t.User._CURRENT_USER_KEY));if(!e)return null;t.User._currentUser=t.Object._create("_User"),t.User._currentUser._isCurrentUser=!0;var n=JSON.parse(e);return t.User._currentUser.id=n._id,delete n._id,t.User._currentUser._sessionToken=n._sessionToken,delete n._sessionToken,t.User._currentUser._finishFetch(n),t.User._currentUser._synchronizeAllAuthData(),t.User._currentUser._refreshCache(),t.User._currentUser._opSetQueue=[{}],t.User._currentUser},_saveCurrentUser:function(e){var n;return n=t.User._currentUser!==e?t.User.logOut():a.resolve(),n.then(function(){e._isCurrentUser=!0,t.User._currentUser=e;var n=e.toJSON();return n._id=e.id,n._sessionToken=e._sessionToken,t.localStorage.setItemAsync(t._getAVPath(t.User._CURRENT_USER_KEY),JSON.stringify(n)).then(function(){t.User._currentUserMatchesDisk=!0})})},_registerAuthenticationProvider:function(e){t.User._authProviders[e.getAuthType()]=e,!t._config.disableCurrentUser&&t.User.current()&&t.User.current()._synchronizeAuthData(e.getAuthType())},_logInWith:function(e,n){var r=t.Object._create("_User");return r._linkWith(e,n)}})}},function(t,e,n){"use strict";t.exports=[]},function(t,e,n){"use strict";var r=n(12),i=["Browser"].concat(n(30));t.exports="LeanCloud-JS-SDK/"+r+" ("+i.join("; ")+")"},function(t,e,n){"use strict";var r=n(6),i=n(7)("cos"),o=n(2);t.exports=function(t,e,n){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};n.attributes.url=t.url,n._bucket=t.bucket,n.id=t.objectId;var s=t.upload_url+"?sign="+encodeURIComponent(t.token);return new o(function(t,o){var u=r("POST",s).field("fileContent",e).field("op","upload");a.onprogress&&u.on("progress",a.onprogress),u.end(function(e,r){return r&&i(r.status,r.body,r.text),e?(r&&(e.statusCode=r.status,e.responseText=r.text,e.response=r.body),o(e)):void t(n)})})}},function(t,e,n){"use strict";var r=n(6),i=n(2),o=n(7)("qiniu");t.exports=function(t,e,n){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};n.attributes.url=t.url,n._bucket=t.bucket,n.id=t.objectId;var s=t.token;return new i(function(t,i){var u=r("POST","https://up.qbox.me").field("file",e).field("name",n.attributes.name).field("key",n._qiniu_key).field("token",s);a.onprogress&&u.on("progress",a.onprogress),u.end(function(e,r){return r&&o(r.status,r.body,r.text),e?(r&&(e.statusCode=r.status,e.responseText=r.text,e.response=r.body),i(e)):void t(n)})})}},function(t,e,n){"use strict";var r=n(6);n(2);t.exports=function(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return n.attributes.url=t.url,n._bucket=t.bucket,n.id=t.objectId,new Promise(function(o,a){var s=r("PUT",t.upload_url).set("Content-Type",n.get("mime_type")).send(e);i.onprogress&&s.on("progress",i.onprogress),s.end(function(t,e){return t?(e&&(t.statusCode=e.status,t.responseText=e.text,t.response=e.body),a(t)):void o(n)})})}},function(t,e,n){"use strict";(function(e){var r=n(0),i=(n(2),{}),o=["getItem","setItem","removeItem","clear"],a=e.localStorage;try{var s="__storejs__";if(a.setItem(s,s),a.getItem(s)!=s)throw new Error;a.removeItem(s)}catch(t){a=n(42)}r(o).each(function(t){i[t]=function(){return e.localStorage[t].apply(e.localStorage,arguments)}}),i.async=!1,t.exports=i}).call(e,n(9))},function(t,e,n){"use strict";var r=function(t,e){var n;t.indexOf("base64")<0?n=atob(t):t.split(",")[0].indexOf("base64")>=0?(e=e||t.split(",")[0].split(":")[1].split(";")[0],n=atob(t.split(",")[1])):n=unescape(t.split(",")[1]);for(var r=new Uint8Array(n.length),i=0;i>>32-e},rotr:function(t,e){return t<<32-e|t>>>e},endian:function(t){if(t.constructor==Number)return 16711935&n.rotl(t,8)|4278255360&n.rotl(t,24);for(var e=0;e0;t--)e.push(Math.floor(256*Math.random()));return e},bytesToWords:function(t){for(var e=[],n=0,r=0;n>>5]|=t[n]<<24-r%32;return e},wordsToBytes:function(t){for(var e=[],n=0;n<32*t.length;n+=8)e.push(t[n>>>5]>>>24-n%32&255);return e},bytesToHex:function(t){for(var e=[],n=0;n>>4).toString(16)),e.push((15&t[n]).toString(16));return e.join("")},hexToBytes:function(t){for(var e=[],n=0;n>>6*(3-o)&63)):n.push("=");return n.join("")},base64ToBytes:function(t){t=t.replace(/[^A-Z0-9+\/]/gi,"");for(var n=[],r=0,i=0;r>>6-2*i);return n}};t.exports=n}()},function(t,e,n){function r(t){var n,r=0;for(n in t)r=(r<<5)-r+t.charCodeAt(n),r|=0;return e.colors[Math.abs(r)%e.colors.length]}function i(t){function n(){if(n.enabled){var t=n,r=+new Date,i=r-(c||r);t.diff=i,t.prev=c,t.curr=r,c=r;for(var o=new Array(arguments.length),a=0;a-1)return t.splice(n,1)}}function a(t,e){return ii.call(t,e)}function s(t){return"string"==typeof t||"number"==typeof t}function u(t){var e=Object.create(null);return function(n){var r=e[n];return r||(e[n]=t(n))}}function c(t,e){function n(n){var r=arguments.length;return r?r>1?t.apply(e,arguments):t.call(e,n):t.call(e)}return n._length=t.length,n}function l(t,e){e=e||0;for(var n=t.length-e,r=new Array(n);n--;)r[n]=t[n+e];return r}function d(t,e){for(var n in e)t[n]=e[n];return t}function f(t){return null!==t&&"object"==typeof t}function h(t){return li.call(t)===di}function p(t){for(var e={},n=0;n=0&&Ui[n].id>t.id;)n--;Ui.splice(Math.max(n,zi)+1,0,t)}else Ui.push(t);Bi||(Bi=!0,Ti(z))}}function Y(t){Gi.clear(),V(t,Gi)}function V(t,e){var n,r,i=Array.isArray(t);if((i||f(t))&&Object.isExtensible(t)){if(t.__ob__){var o=t.__ob__.dep.id;if(e.has(o))return;e.add(o)}if(i)for(n=t.length;n--;)V(t[n],e);else for(r=Object.keys(t),n=r.length;n--;)V(t[r[n]],e)}}function G(t){t._watchers=[];var e=t.$options;e.props&&K(t,e.props),e.methods&&Z(t,e.methods),e.data?J(t):O(t._data={},!0),e.computed&&X(t,e.computed),e.watch&&tt(t,e.watch)}function K(t,e){var n=t.$options.propsData||{},r=t.$options._propKeys=Object.keys(e),i=!t.$parent;Li.shouldConvert=i;for(var o=function(i){var o=r[i];S(t,o,F(o,e,n,t))},a=0;a1?l(n):n;for(var r=l(arguments,1),i=0,o=n.length;i-1:t.test(e)}function Jt(t){var e={};e.get=function(){return pi},Object.defineProperty(t,"config",e),t.util=Fi,t.set=R,t.delete=k,t.nextTick=Ti,t.options=Object.create(null),pi._assetTypes.forEach(function(e){t.options[e+"s"]=Object.create(null)}),t.options._base=t,d(t.options.components,ao),Wt(t),Yt(t),Vt(t),Gt(t)}function Xt(t){for(var e=t.data,n=t,r=t;r.child;)r=r.child._vnode,r.data&&(e=Qt(r.data,e));for(;n=n.parent;)n.data&&(e=Qt(e,n.data));return Zt(e)}function Qt(t,e){return{staticClass:te(t.staticClass,e.staticClass),class:t.class?[t.class,e.class]:e.class}}function Zt(t){var e=t.class,n=t.staticClass;return n||e?te(n,ee(e)):""}function te(t,e){return t?e?t+" "+e:t:e||""}function ee(t){var e="";if(!t)return e;if("string"==typeof t)return t;if(Array.isArray(t)){for(var n,r=0,i=t.length;r-1?Eo[t]=e.constructor===window.HTMLUnknownElement||e.constructor===window.HTMLElement:Eo[t]=/HTMLUnknownElement/.test(e.toString())}function ie(t){if("string"==typeof t){if(t=document.querySelector(t),!t)return document.createElement("div")}return t}function oe(t,e){var n=document.createElement(t);return"select"!==t?n:(e.data&&e.data.attrs&&"multiple"in e.data.attrs&&n.setAttribute("multiple","multiple"),n)}function ae(t,e){return document.createElementNS(bo[t],e)}function se(t){return document.createTextNode(t)}function ue(t){return document.createComment(t)}function ce(t,e,n){t.insertBefore(e,n)}function le(t,e){t.removeChild(e)}function de(t,e){t.appendChild(e)}function fe(t){return t.parentNode}function he(t){return t.nextSibling}function pe(t){return t.tagName}function me(t,e){t.textContent=e}function ve(t,e,n){t.setAttribute(e,n)}function ge(t,e){var n=t.data.ref;if(n){var r=t.context,i=t.child||t.elm,a=r.$refs;e?Array.isArray(a[n])?o(a[n],i):a[n]===i&&(a[n]=void 0):t.data.refInFor?Array.isArray(a[n])&&a[n].indexOf(i)<0?a[n].push(i):a[n]=[i]:a[n]=i}}function be(t){return null==t}function ye(t){return null!=t}function _e(t,e){return t.key===e.key&&t.tag===e.tag&&t.isComment===e.isComment&&!t.data==!e.data}function we(t,e,n){var r,i,o={};for(r=e;r<=n;++r)i=t[r].key,ye(i)&&(o[i]=r);return o}function xe(t){function e(t){return new Ji(O.tagName(t).toLowerCase(),{},[],void 0,t)}function n(t,e){function n(){0===--n.listeners&&r(t)}return n.listeners=e,n}function r(t){var e=O.parentNode(t);e&&O.removeChild(e,t)}function o(t,e,n,r,i){if(t.isRootInsert=!i,!a(t,e,n,r)){var o=t.data,s=t.children,u=t.tag;ye(u)?(t.elm=t.ns?O.createElementNS(t.ns,u):O.createElement(u,t),p(t),l(t,s,e),ye(o)&&f(t,e),c(n,t.elm,r)):t.isComment?(t.elm=O.createComment(t.text),c(n,t.elm,r)):(t.elm=O.createTextNode(t.text),c(n,t.elm,r))}}function a(t,e,n,r){var i=t.data;if(ye(i)){var o=ye(t.child)&&i.keepAlive;if(ye(i=i.hook)&&ye(i=i.init)&&i(t,!1,n,r),ye(t.child))return h(t,e),o&&u(t,e,n,r),!0}}function u(t,e,n,r){for(var i,o=t;o.child;)if(o=o.child._vnode,ye(i=o.data)&&ye(i=i.transition)){for(i=0;if?(c=be(n[v+1])?null:n[v+1].elm,m(t,c,n,d,v,r)):d>v&&g(t,e,l,f)}function _(t,e,n,r){if(t!==e){if(e.isStatic&&t.isStatic&&e.key===t.key&&(e.isCloned||e.isOnce))return e.elm=t.elm,void(e.child=t.child);var i,o=e.data,a=ye(o);a&&ye(i=o.hook)&&ye(i=i.prepatch)&&i(t,e);var s=e.elm=t.elm,u=t.children,c=e.children;if(a&&d(e)){for(i=0;i-1?e.split(/\s+/).forEach(function(e){return t.classList.add(e)}):t.classList.add(e);else{var n=" "+t.getAttribute("class")+" ";n.indexOf(" "+e+" ")<0&&t.setAttribute("class",(n+e).trim())}}function qe(t,e){if(e&&e.trim())if(t.classList)e.indexOf(" ")>-1?e.split(/\s+/).forEach(function(e){return t.classList.remove(e)}):t.classList.remove(e);else{for(var n=" "+t.getAttribute("class")+" ",r=" "+e+" ";n.indexOf(r)>=0;)n=n.replace(r," ");t.setAttribute("class",n.trim())}}function ze(t){Ko(function(){Ko(t)})}function We(t,e){(t._transitionClasses||(t._transitionClasses=[])).push(e),Be(t,e)}function Ye(t,e){t._transitionClasses&&o(t._transitionClasses,e),qe(t,e)}function Ve(t,e,n){var r=Ge(t,e),i=r.type,o=r.timeout,a=r.propCount;if(!i)return n();var s=i===qo?Yo:Go,u=0,c=function(){t.removeEventListener(s,l),n()},l=function(e){e.target===t&&++u>=a&&c()};setTimeout(function(){u0&&(n=qo,l=a,d=o.length):e===zo?c>0&&(n=zo,l=c,d=u.length):(l=Math.max(a,c),n=l>0?a>c?qo:zo:null,d=n?n===qo?o.length:u.length:0);var f=n===qo&&Jo.test(r[Wo+"Property"]);return{type:n,timeout:l,propCount:d,hasTransform:f}}function Ke(t,e){for(;t.length1,N=n._enterCb=tn(function(){k&&(Ye(n,A),Ye(n,C)),N.cancelled?(k&&Ye(n,E),R&&R(n)):S&&S(n),n._enterCb=null});t.data.show||st(t.data.hook||(t.data.hook={}),"insert",function(){var e=n.parentNode,r=e&&e._pending&&e._pending[t.key];r&&r.context===t.context&&r.tag===t.tag&&r.elm._leaveCb&&r.elm._leaveCb(),O&&O(n,N)},"transition-insert"),T&&T(n),k&&(We(n,E),We(n,C),ze(function(){We(n,A),Ye(n,E),N.cancelled||M||Ve(n,o,N)})),t.data.show&&(e&&e(),O&&O(n,N)),k||M||N()}}}function Qe(t,e){function n(){g.cancelled||(t.data.show||((r.parentNode._pending||(r.parentNode._pending={}))[t.key]=t),l&&l(r),m&&(We(r,s),We(r,c),ze(function(){We(r,u),Ye(r,s),g.cancelled||v||Ve(r,a,g)})),d&&d(r,g),m||v||g())}var r=t.elm;r._enterCb&&(r._enterCb.cancelled=!0,r._enterCb());var i=Ze(t.data.transition);if(!i)return e();if(!r._leaveCb&&1===r.nodeType){var o=i.css,a=i.type,s=i.leaveClass,u=i.leaveToClass,c=i.leaveActiveClass,l=i.beforeLeave,d=i.leave,f=i.afterLeave,h=i.leaveCancelled,p=i.delayLeave,m=o!==!1&&!_i,v=d&&(d._length||d.length)>1,g=r._leaveCb=tn(function(){r.parentNode&&r.parentNode._pending&&(r.parentNode._pending[t.key]=null),m&&(Ye(r,u),Ye(r,c)),g.cancelled?(m&&Ye(r,s),h&&h(r)):(e(),f&&f(r)),r._leaveCb=null});p?p(n):n()}}function Ze(t){if(t){if("object"==typeof t){var e={};return t.css!==!1&&d(e,Xo(t.name||"v")),d(e,t),e}return"string"==typeof t?Xo(t):void 0}}function tn(t){var e=!1;return function(){e||(e=!0,t())}}function en(t,e){e.data.show||Xe(e)}function nn(t,e,n){var r=e.value,i=t.multiple;if(!i||Array.isArray(r)){for(var o,a,s=0,u=t.options.length;s-1,a.selected!==o&&(a.selected=o);else if(g(on(a),r))return void(t.selectedIndex!==s&&(t.selectedIndex=s));i||(t.selectedIndex=-1)}}function rn(t,e){for(var n=0,r=e.length;n',n.innerHTML.indexOf(e)>0}function yn(t){return la=la||document.createElement("div"),la.innerHTML=t,la.textContent}function _n(t,e){return e&&(t=t.replace(os,"\n")),t.replace(rs,"<").replace(is,">").replace(as,"&").replace(ss,'"')}function wn(t,e){function n(e){d+=e,t=t.substring(e)}function r(){var e=t.match(wa);if(e){var r={tagName:e[1],attrs:[],start:d};n(e[0].length);for(var i,o;!(i=t.match(xa))&&(o=t.match(ba));)n(o[0].length),r.attrs.push(o);if(i)return r.unarySlash=i[1],n(i[0].length),r.end=d,r}}function i(t){var n=t.tagName,r=t.unarySlash;c&&("p"===s&&pa(n)&&o("",s),ha(n)&&s===n&&o("",n));for(var i=l(n)||"html"===n&&"head"===s||!!r,a=t.attrs.length,d=new Array(a),f=0;f=0&&u[o].tag.toLowerCase()!==a;o--);}else o=0;if(o>=0){for(var c=u.length-1;c>=o;c--)e.end&&e.end(u[c].tag,r,i);u.length=o,s=o&&u[o-1].tag}else"br"===n.toLowerCase()?e.start&&e.start(n,[],!0,r,i):"p"===n.toLowerCase()&&(e.start&&e.start(n,[],!1,r,i),e.end&&e.end(n,r,i))}for(var a,s,u=[],c=e.expectHTML,l=e.isUnaryTag||fi,d=0;t;){if(a=t,s&&es(s,e.sfc,u)){var f=s.toLowerCase(),h=ns[f]||(ns[f]=new RegExp("([\\s\\S]*?)(]*>)","i")),p=0,m=t.replace(h,function(t,n,r){return p=r.length,"script"!==f&&"style"!==f&&"noscript"!==f&&(n=n.replace(//g,"$1").replace(//g,"$1")),e.chars&&e.chars(n),""});d+=t.length-m.length,t=m,o("",f,d-p,d)}else{var v=t.indexOf("<");if(0===v){if(Aa.test(t)){var g=t.indexOf("-->");if(g>=0){n(g+3);continue}}if(Ta.test(t)){var b=t.indexOf("]>");if(b>=0){n(b+2);continue}}var y=t.match(Ca);if(y){n(y[0].length);continue}var _=t.match(Ea);if(_){var w=d;n(_[0].length),o(_[0],_[1],w,d);continue}var x=r();if(x){i(x);continue}}var E=void 0,C=void 0,A=void 0;if(v>0){for(C=t.slice(v);!(Ea.test(C)||wa.test(C)||Aa.test(C)||Ta.test(C)||(A=C.indexOf("<",1),A<0));)v+=A,C=t.slice(v);E=t.substring(0,v),n(v)}v<0&&(E=t,t=""),e.chars&&E&&e.chars(E)}if(t===a&&e.chars){e.chars(t);break}}o()}function xn(t){function e(){(a||(a=[])).push(t.slice(p,i).trim()),p=i+1}var n,r,i,o,a,s=!1,u=!1,c=!1,l=!1,d=0,f=0,h=0,p=0;for(i=0;i=0&&(v=t.charAt(m)," "===v);m--);v&&/[\w$]/.test(v)||(l=!0)}}else void 0===o?(p=i+1,o=t.slice(0,i).trim()):e();if(void 0===o?o=t.slice(0,i).trim():0!==p&&e(),a)for(i=0;ia&&o.push(JSON.stringify(t.slice(a,i)));var s=xn(r[1].trim());o.push("_s("+s+")"),a=i+r[0].length}return a=Sa}function In(t){return 34===t||39===t}function $n(t){var e=1;for(Na=Ma;!Ln();)if(t=jn(),In(t))Dn(t);else if(91===t&&e++,93===t&&e--,0===e){Pa=Ma;break}}function Dn(t){for(var e=t;!Ln()&&(t=jn(),t!==e););}function Fn(t,e){ja=e.warn||An,La=e.getTagNamespace||fi,Ia=e.mustUseProp||fi,$a=e.isPreTag||fi,Da=Tn(e.modules,"preTransformNode"),Fa=Tn(e.modules,"transformNode"),Ua=Tn(e.modules,"postTransformNode"),Ha=e.delimiters;var n,r,i=[],o=e.preserveWhitespace!==!1,a=!1,s=!1;return wn(t,{expectHTML:e.expectHTML,isUnaryTag:e.isUnaryTag,shouldDecodeNewlines:e.shouldDecodeNewlines,start:function(t,o,u){function c(t){}var l=r&&r.ns||La(t);yi&&"svg"===l&&(o=rr(o));var d={type:1,tag:t,attrsList:o,attrsMap:er(o),parent:r,children:[]};l&&(d.ns=l),nr(d)&&!Ci()&&(d.forbidden=!0);for(var f=0;f-1"+("true"===o?":("+e+")":":_q("+e+","+o+")")),kn(t,"change","var $$a="+e+",$$el=$event.target,$$c=$$el.checked?("+o+"):("+a+");if(Array.isArray($$a)){var $$v="+(r?"_n("+i+")":i)+",$$i=_i($$a,$$v);if($$c){$$i<0&&("+e+"=$$a.concat($$v))}else{$$i>-1&&("+e+"=$$a.slice(0,$$i).concat($$a.slice($$i+1)))}}else{"+e+"=$$c}",null,!0)}function Wr(t,e,n){var r=n&&n.number,i=Mn(t,"value")||"null";i=r?"_n("+i+")":i,On(t,"checked","_q("+e+","+i+")"),kn(t,"change",Gr(e,i),null,!0)}function Yr(t,e,n){var r=t.attrsMap.type,i=n||{},o=i.lazy,a=i.number,s=i.trim,u=o||yi&&"range"===r?"change":"input",c=!o&&"range"!==r,l="input"===t.tag||"textarea"===t.tag,d=l?"$event.target.value"+(s?".trim()":""):s?"(typeof $event === 'string' ? $event.trim() : $event)":"$event";d=a||"number"===r?"_n("+d+")":d;var f=Gr(e,d);l&&c&&(f="if($event.target.composing)return;"+f),On(t,"value",l?"_s("+e+")":"("+e+")"),kn(t,u,f,null,!0),(s||a||"number"===r)&&kn(t,"blur","$forceUpdate()")}function Vr(t,e,n){var r=n&&n.number,i='Array.prototype.filter.call($event.target.options,function(o){return o.selected}).map(function(o){var val = "_value" in o ? o._value : o.value;return '+(r?"_n(val)":"val")+"})"+(null==t.attrsMap.multiple?"[0]":""),o=Gr(e,i);kn(t,"change",o,null,!0)}function Gr(t,e){var n=Pn(t);return null===n.idx?t+"="+e:"var $$exp = "+n.exp+", $$idx = "+n.idx+";if (!Array.isArray($$exp)){"+t+"="+e+"}else{$$exp.splice($$idx, 1, "+e+")}"}function Kr(t,e){e.value&&On(t,"textContent","_s("+e.value+")")}function Jr(t,e){e.value&&On(t,"innerHTML","_s("+e.value+")")}function Xr(t,e){return e=e?d(d({},Ns),e):Ns,Dr(t,e)}function Qr(t,e,n){var r=(e&&e.warn||Si,e&&e.delimiters?String(e.delimiters)+t:t);if(Ms[r])return Ms[r];var i={},o=Xr(t,e);i.render=Zr(o.render);var a=o.staticRenderFns.length;i.staticRenderFns=new Array(a);for(var s=0;s0,wi=bi&&bi.indexOf("edge/")>0,xi=bi&&bi.indexOf("android")>0,Ei=bi&&/iphone|ipad|ipod|ios/.test(bi),Ci=function(){return void 0===ei&&(ei=!gi&&"undefined"!=typeof e&&"server"===e.process.env.VUE_ENV),ei},Ai=gi&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__,Ti=function(){function t(){r=!1;var t=n.slice(0);n.length=0;for(var e=0;e1&&(e[n[0].trim()]=n[1].trim())}}),e}),Io=/^--/,$o=/\s*!important$/,Do=function(t,e,n){Io.test(e)?t.style.setProperty(e,n):$o.test(n)?t.style.setProperty(e,n.replace($o,""),"important"):t.style[Uo(e)]=n; -},Fo=["Webkit","Moz","ms"],Uo=u(function(t){if(uo=uo||document.createElement("div"),t=ai(t),"filter"!==t&&t in uo.style)return t;for(var e=t.charAt(0).toUpperCase()+t.slice(1),n=0;n\/=]+)/,va=/(?:=)/,ga=[/"([^"]*)"+/.source,/'([^']*)'+/.source,/([^\s"'=<>`]+)/.source],ba=new RegExp("^\\s*"+ma.source+"(?:\\s*("+va.source+")\\s*(?:"+ga.join("|")+"))?"),ya="[a-zA-Z_][\\w\\-\\.]*",_a="((?:"+ya+"\\:)?"+ya+")",wa=new RegExp("^<"+_a),xa=/^\s*(\/?)>/,Ea=new RegExp("^<\\/"+_a+"[^>]*>"),Ca=/^]+>/i,Aa=/^/g,"$1").replace(//g,"$1")),e.chars&&e.chars(n),""});d+=t.length-m.length,t=m,o(f,d-p,d)}else{var v=t.indexOf("<");if(0===v){if(Ra.test(t)){var g=t.indexOf("-->");if(g>=0){n(g+3);continue}}if(ka.test(t)){var b=t.indexOf("]>");if(b>=0){n(b+2);continue}}var y=t.match(Sa);if(y){n(y[0].length);continue}var _=t.match(Oa);if(_){var w=d;n(_[0].length),o(_[1],w,d);continue}var x=r();if(x){i(x);continue}}var E=void 0,C=void 0,A=void 0;if(v>0){for(C=t.slice(v);!(Oa.test(C)||Aa.test(C)||Ra.test(C)||ka.test(C)||(A=C.indexOf("<",1),A<0));)v+=A,C=t.slice(v);E=t.substring(0,v),n(v)}v<0&&(E=t,t=""),e.chars&&E&&e.chars(E)}if(t===a&&e.chars){e.chars(t);break}}o()}function Cn(t){function e(){(a||(a=[])).push(t.slice(p,i).trim()),p=i+1}var n,r,i,o,a,s=!1,u=!1,c=!1,l=!1,d=0,f=0,h=0,p=0;for(i=0;i=0&&(v=t.charAt(m)," "===v);m--);v&&/[\w$]/.test(v)||(l=!0)}}else void 0===o?(p=i+1,o=t.slice(0,i).trim()):e();if(void 0===o?o=t.slice(0,i).trim():0!==p&&e(),a)for(i=0;ia&&o.push(JSON.stringify(t.slice(a,i)));var s=Cn(r[1].trim());o.push("_s("+s+")"),a=i+r[0].length}return a=Na}function Dn(t){return 34===t||39===t}function Fn(t){var e=1;for(Ia=La;!$n();)if(t=In(),Dn(t))Un(t);else if(91===t&&e++,93===t&&e--,0===e){$a=La;break}}function Un(t){for(var e=t;!$n()&&(t=In(),t!==e););}function Hn(t,e){Da=e.warn||On,Fa=e.getTagNamespace||pi,Ua=e.mustUseProp||pi,Ha=e.isPreTag||pi,Ba=Sn(e.modules,"preTransformNode"),qa=Sn(e.modules,"transformNode"),za=Sn(e.modules,"postTransformNode"),Wa=e.delimiters;var n,r,i=[],o=e.preserveWhitespace!==!1,a=!1,s=!1;return En(t,{expectHTML:e.expectHTML,isUnaryTag:e.isUnaryTag,shouldDecodeNewlines:e.shouldDecodeNewlines,start:function(t,o,u){function c(t){}var l=r&&r.ns||Fa(t);wi&&"svg"===l&&(o=or(o));var d={type:1,tag:t,attrsList:o,attrsMap:rr(o),parent:r,children:[]};l&&(d.ns=l),ir(d)&&!Ti()&&(d.forbidden=!0);for(var f=0;f-1"+("true"===o?":("+e+")":":_q("+e+","+o+")")),Nn(t,"click","var $$a="+e+",$$el=$event.target,$$c=$$el.checked?("+o+"):("+a+");if(Array.isArray($$a)){var $$v="+(r?"_n("+i+")":i)+",$$i=_i($$a,$$v);if($$c){$$i<0&&("+e+"=$$a.concat($$v))}else{$$i>-1&&("+e+"=$$a.slice(0,$$i).concat($$a.slice($$i+1)))}}else{"+e+"=$$c}",null,!0)}function Vr(t,e,n){var r=n&&n.number,i=Pn(t,"value")||"null";i=r?"_n("+i+")":i,Rn(t,"checked","_q("+e+","+i+")"),Nn(t,"click",Jr(e,i),null,!0)}function Gr(t,e,n){var r=t.attrsMap.type,i=n||{},o=i.lazy,a=i.number,s=i.trim,u=o||wi&&"range"===r?"change":"input",c=!o&&"range"!==r,l="input"===t.tag||"textarea"===t.tag,d=l?"$event.target.value"+(s?".trim()":""):s?"(typeof $event === 'string' ? $event.trim() : $event)":"$event";d=a||"number"===r?"_n("+d+")":d;var f=Jr(e,d);l&&c&&(f="if($event.target.composing)return;"+f),Rn(t,"value",l?"_s("+e+")":"("+e+")"),Nn(t,u,f,null,!0),(s||a||"number"===r)&&Nn(t,"blur","$forceUpdate()")}function Kr(t,e,n){var r=n&&n.number,i='Array.prototype.filter.call($event.target.options,function(o){return o.selected}).map(function(o){var val = "_value" in o ? o._value : o.value;return '+(r?"_n(val)":"val")+"})"+(null==t.attrsMap.multiple?"[0]":""),o=Jr(e,i);Nn(t,"change",o,null,!0)}function Jr(t,e){var n=Ln(t);return null===n.idx?t+"="+e:"var $$exp = "+n.exp+", $$idx = "+n.idx+";if (!Array.isArray($$exp)){"+t+"="+e+"}else{$$exp.splice($$idx, 1, "+e+")}"}function Xr(t,e){e.value&&Rn(t,"textContent","_s("+e.value+")")}function Qr(t,e){e.value&&Rn(t,"innerHTML","_s("+e.value+")")}function Zr(t,e){return e=e?d(d({},js),e):js,Ur(t,e)}function ti(t,e,n){var r=(e&&e.warn||ki,e&&e.delimiters?String(e.delimiters)+t:t);if(Ps[r])return Ps[r];var i={},o=Zr(t,e);i.render=ei(o.render);var a=o.staticRenderFns.length;i.staticRenderFns=new Array(a);for(var s=0;s0,Ei=_i&&_i.indexOf("edge/")>0,Ci=_i&&_i.indexOf("android")>0,Ai=_i&&/iphone|ipad|ipod|ios/.test(_i),Ti=function(){return void 0===ri&&(ri=!yi&&"undefined"!=typeof e&&"server"===e.process.env.VUE_ENV),ri},Oi=yi&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__,Si=function(){function t(){r=!1;var t=n.slice(0);n.length=0;for(var e=0;e1&&(e[n[0].trim()]=n[1].trim())}}),e}),Uo=/^--/,Ho=/\s*!important$/,Bo=function(t,e,n){Uo.test(e)?t.style.setProperty(e,n):Ho.test(n)?t.style.setProperty(e,n.replace(Ho,""),"important"):t.style[zo(e)]=n},qo=["Webkit","Moz","ms"],zo=u(function(t){if(ho=ho||document.createElement("div"),t=ui(t),"filter"!==t&&t in ho.style)return t;for(var e=t.charAt(0).toUpperCase()+t.slice(1),n=0;n\/=]+)/,_a=/(?:=)/,wa=[/"([^"]*)"+/.source,/'([^']*)'+/.source,/([^\s"'=<>`]+)/.source],xa=new RegExp("^\\s*"+ya.source+"(?:\\s*("+_a.source+")\\s*(?:"+wa.join("|")+"))?"),Ea="[a-zA-Z_][\\w\\-\\.]*",Ca="((?:"+Ea+"\\:)?"+Ea+")",Aa=new RegExp("^<"+Ca),Ta=/^\s*(\/?)>/,Oa=new RegExp("^<\\/"+Ca+"[^>]*>"),Sa=/^]+>/i,Ra=/^');\n\n if (commentEnd >= 0) {\n advance(commentEnd + 3);\n continue\n }\n }\n\n // http://en.wikipedia.org/wiki/Conditional_comment#Downlevel-revealed_conditional_comment\n if (conditionalComment.test(html)) {\n var conditionalEnd = html.indexOf(']>');\n\n if (conditionalEnd >= 0) {\n advance(conditionalEnd + 2);\n continue\n }\n }\n\n // Doctype:\n var doctypeMatch = html.match(doctype);\n if (doctypeMatch) {\n advance(doctypeMatch[0].length);\n continue\n }\n\n // End tag:\n var endTagMatch = html.match(endTag);\n if (endTagMatch) {\n var curIndex = index;\n advance(endTagMatch[0].length);\n parseEndTag(endTagMatch[0], endTagMatch[1], curIndex, index);\n continue\n }\n\n // Start tag:\n var startTagMatch = parseStartTag();\n if (startTagMatch) {\n handleStartTag(startTagMatch);\n continue\n }\n }\n\n var text = (void 0), rest$1 = (void 0), next = (void 0);\n if (textEnd > 0) {\n rest$1 = html.slice(textEnd);\n while (\n !endTag.test(rest$1) &&\n !startTagOpen.test(rest$1) &&\n !comment.test(rest$1) &&\n !conditionalComment.test(rest$1)\n ) {\n // < in plain text, be forgiving and treat it as text\n next = rest$1.indexOf('<', 1);\n if (next < 0) { break }\n textEnd += next;\n rest$1 = html.slice(textEnd);\n }\n text = html.substring(0, textEnd);\n advance(textEnd);\n }\n\n if (textEnd < 0) {\n text = html;\n html = '';\n }\n\n if (options.chars && text) {\n options.chars(text);\n }\n } else {\n var stackedTag = lastTag.toLowerCase();\n var reStackedTag = reCache[stackedTag] || (reCache[stackedTag] = new RegExp('([\\\\s\\\\S]*?)(]*>)', 'i'));\n var endTagLength = 0;\n var rest = html.replace(reStackedTag, function (all, text, endTag) {\n endTagLength = endTag.length;\n if (stackedTag !== 'script' && stackedTag !== 'style' && stackedTag !== 'noscript') {\n text = text\n .replace(//g, '$1')\n .replace(//g, '$1');\n }\n if (options.chars) {\n options.chars(text);\n }\n return ''\n });\n index += html.length - rest.length;\n html = rest;\n parseEndTag('', stackedTag, index - endTagLength, index);\n }\n\n if (html === last && options.chars) {\n options.chars(html);\n break\n }\n }\n\n // Clean up any remaining tags\n parseEndTag();\n\n function advance (n) {\n index += n;\n html = html.substring(n);\n }\n\n function parseStartTag () {\n var start = html.match(startTagOpen);\n if (start) {\n var match = {\n tagName: start[1],\n attrs: [],\n start: index\n };\n advance(start[0].length);\n var end, attr;\n while (!(end = html.match(startTagClose)) && (attr = html.match(attribute))) {\n advance(attr[0].length);\n match.attrs.push(attr);\n }\n if (end) {\n match.unarySlash = end[1];\n advance(end[0].length);\n match.end = index;\n return match\n }\n }\n }\n\n function handleStartTag (match) {\n var tagName = match.tagName;\n var unarySlash = match.unarySlash;\n\n if (expectHTML) {\n if (lastTag === 'p' && isNonPhrasingTag(tagName)) {\n parseEndTag('', lastTag);\n }\n if (canBeLeftOpenTag(tagName) && lastTag === tagName) {\n parseEndTag('', tagName);\n }\n }\n\n var unary = isUnaryTag$$1(tagName) || tagName === 'html' && lastTag === 'head' || !!unarySlash;\n\n var l = match.attrs.length;\n var attrs = new Array(l);\n for (var i = 0; i < l; i++) {\n var args = match.attrs[i];\n // hackish work around FF bug https://bugzilla.mozilla.org/show_bug.cgi?id=369778\n if (IS_REGEX_CAPTURING_BROKEN && args[0].indexOf('\"\"') === -1) {\n if (args[3] === '') { delete args[3]; }\n if (args[4] === '') { delete args[4]; }\n if (args[5] === '') { delete args[5]; }\n }\n var value = args[3] || args[4] || args[5] || '';\n attrs[i] = {\n name: args[1],\n value: decodeAttr(\n value,\n options.shouldDecodeNewlines\n )\n };\n }\n\n if (!unary) {\n stack.push({ tag: tagName, attrs: attrs });\n lastTag = tagName;\n unarySlash = '';\n }\n\n if (options.start) {\n options.start(tagName, attrs, unary, match.start, match.end);\n }\n }\n\n function parseEndTag (tag, tagName, start, end) {\n var pos;\n if (start == null) { start = index; }\n if (end == null) { end = index; }\n\n // Find the closest opened tag of the same type\n if (tagName) {\n var needle = tagName.toLowerCase();\n for (pos = stack.length - 1; pos >= 0; pos--) {\n if (stack[pos].tag.toLowerCase() === needle) {\n break\n }\n }\n } else {\n // If no tag name is provided, clean shop\n pos = 0;\n }\n\n if (pos >= 0) {\n // Close all the open elements, up the stack\n for (var i = stack.length - 1; i >= pos; i--) {\n if (options.end) {\n options.end(stack[i].tag, start, end);\n }\n }\n\n // Remove the open elements from the stack\n stack.length = pos;\n lastTag = pos && stack[pos - 1].tag;\n } else if (tagName.toLowerCase() === 'br') {\n if (options.start) {\n options.start(tagName, [], true, start, end);\n }\n } else if (tagName.toLowerCase() === 'p') {\n if (options.start) {\n options.start(tagName, [], false, start, end);\n }\n if (options.end) {\n options.end(tagName, start, end);\n }\n }\n }\n}\n\n/* */\n\nfunction parseFilters (exp) {\n var inSingle = false;\n var inDouble = false;\n var inTemplateString = false;\n var inRegex = false;\n var curly = 0;\n var square = 0;\n var paren = 0;\n var lastFilterIndex = 0;\n var c, prev, i, expression, filters;\n\n for (i = 0; i < exp.length; i++) {\n prev = c;\n c = exp.charCodeAt(i);\n if (inSingle) {\n if (c === 0x27 && prev !== 0x5C) { inSingle = false; }\n } else if (inDouble) {\n if (c === 0x22 && prev !== 0x5C) { inDouble = false; }\n } else if (inTemplateString) {\n if (c === 0x60 && prev !== 0x5C) { inTemplateString = false; }\n } else if (inRegex) {\n if (c === 0x2f && prev !== 0x5C) { inRegex = false; }\n } else if (\n c === 0x7C && // pipe\n exp.charCodeAt(i + 1) !== 0x7C &&\n exp.charCodeAt(i - 1) !== 0x7C &&\n !curly && !square && !paren\n ) {\n if (expression === undefined) {\n // first filter, end of expression\n lastFilterIndex = i + 1;\n expression = exp.slice(0, i).trim();\n } else {\n pushFilter();\n }\n } else {\n switch (c) {\n case 0x22: inDouble = true; break // \"\n case 0x27: inSingle = true; break // '\n case 0x60: inTemplateString = true; break // `\n case 0x28: paren++; break // (\n case 0x29: paren--; break // )\n case 0x5B: square++; break // [\n case 0x5D: square--; break // ]\n case 0x7B: curly++; break // {\n case 0x7D: curly--; break // }\n }\n if (c === 0x2f) { // /\n var j = i - 1;\n var p = (void 0);\n // find first non-whitespace prev char\n for (; j >= 0; j--) {\n p = exp.charAt(j);\n if (p !== ' ') { break }\n }\n if (!p || !/[\\w$]/.test(p)) {\n inRegex = true;\n }\n }\n }\n }\n\n if (expression === undefined) {\n expression = exp.slice(0, i).trim();\n } else if (lastFilterIndex !== 0) {\n pushFilter();\n }\n\n function pushFilter () {\n (filters || (filters = [])).push(exp.slice(lastFilterIndex, i).trim());\n lastFilterIndex = i + 1;\n }\n\n if (filters) {\n for (i = 0; i < filters.length; i++) {\n expression = wrapFilter(expression, filters[i]);\n }\n }\n\n return expression\n}\n\nfunction wrapFilter (exp, filter) {\n var i = filter.indexOf('(');\n if (i < 0) {\n // _f: resolveFilter\n return (\"_f(\\\"\" + filter + \"\\\")(\" + exp + \")\")\n } else {\n var name = filter.slice(0, i);\n var args = filter.slice(i + 1);\n return (\"_f(\\\"\" + name + \"\\\")(\" + exp + \",\" + args)\n }\n}\n\n/* */\n\nvar defaultTagRE = /\\{\\{((?:.|\\n)+?)\\}\\}/g;\nvar regexEscapeRE = /[-.*+?^${}()|[\\]/\\\\]/g;\n\nvar buildRegex = cached(function (delimiters) {\n var open = delimiters[0].replace(regexEscapeRE, '\\\\$&');\n var close = delimiters[1].replace(regexEscapeRE, '\\\\$&');\n return new RegExp(open + '((?:.|\\\\n)+?)' + close, 'g')\n});\n\nfunction parseText (\n text,\n delimiters\n) {\n var tagRE = delimiters ? buildRegex(delimiters) : defaultTagRE;\n if (!tagRE.test(text)) {\n return\n }\n var tokens = [];\n var lastIndex = tagRE.lastIndex = 0;\n var match, index;\n while ((match = tagRE.exec(text))) {\n index = match.index;\n // push text token\n if (index > lastIndex) {\n tokens.push(JSON.stringify(text.slice(lastIndex, index)));\n }\n // tag token\n var exp = parseFilters(match[1].trim());\n tokens.push((\"_s(\" + exp + \")\"));\n lastIndex = index + match[0].length;\n }\n if (lastIndex < text.length) {\n tokens.push(JSON.stringify(text.slice(lastIndex)));\n }\n return tokens.join('+')\n}\n\n/* */\n\nfunction baseWarn (msg) {\n console.error((\"[Vue parser]: \" + msg));\n}\n\nfunction pluckModuleFunction (\n modules,\n key\n) {\n return modules\n ? modules.map(function (m) { return m[key]; }).filter(function (_) { return _; })\n : []\n}\n\nfunction addProp (el, name, value) {\n (el.props || (el.props = [])).push({ name: name, value: value });\n}\n\nfunction addAttr (el, name, value) {\n (el.attrs || (el.attrs = [])).push({ name: name, value: value });\n}\n\nfunction addDirective (\n el,\n name,\n rawName,\n value,\n arg,\n modifiers\n) {\n (el.directives || (el.directives = [])).push({ name: name, rawName: rawName, value: value, arg: arg, modifiers: modifiers });\n}\n\nfunction addHandler (\n el,\n name,\n value,\n modifiers,\n important\n) {\n // check capture modifier\n if (modifiers && modifiers.capture) {\n delete modifiers.capture;\n name = '!' + name; // mark the event as captured\n }\n if (modifiers && modifiers.once) {\n delete modifiers.once;\n name = '~' + name; // mark the event as once\n }\n var events;\n if (modifiers && modifiers.native) {\n delete modifiers.native;\n events = el.nativeEvents || (el.nativeEvents = {});\n } else {\n events = el.events || (el.events = {});\n }\n var newHandler = { value: value, modifiers: modifiers };\n var handlers = events[name];\n /* istanbul ignore if */\n if (Array.isArray(handlers)) {\n important ? handlers.unshift(newHandler) : handlers.push(newHandler);\n } else if (handlers) {\n events[name] = important ? [newHandler, handlers] : [handlers, newHandler];\n } else {\n events[name] = newHandler;\n }\n}\n\nfunction getBindingAttr (\n el,\n name,\n getStatic\n) {\n var dynamicValue =\n getAndRemoveAttr(el, ':' + name) ||\n getAndRemoveAttr(el, 'v-bind:' + name);\n if (dynamicValue != null) {\n return parseFilters(dynamicValue)\n } else if (getStatic !== false) {\n var staticValue = getAndRemoveAttr(el, name);\n if (staticValue != null) {\n return JSON.stringify(staticValue)\n }\n }\n}\n\nfunction getAndRemoveAttr (el, name) {\n var val;\n if ((val = el.attrsMap[name]) != null) {\n var list = el.attrsList;\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i].name === name) {\n list.splice(i, 1);\n break\n }\n }\n }\n return val\n}\n\nvar len;\nvar str;\nvar chr;\nvar index$1;\nvar expressionPos;\nvar expressionEndPos;\n\n/**\n * parse directive model to do the array update transform. a[idx] = val => $$a.splice($$idx, 1, val)\n *\n * for loop possible cases:\n *\n * - test\n * - test[idx]\n * - test[test1[idx]]\n * - test[\"a\"][idx]\n * - xxx.test[a[a].test1[idx]]\n * - test.xxx.a[\"asa\"][test1[idx]]\n *\n */\n\nfunction parseModel (val) {\n str = val;\n len = str.length;\n index$1 = expressionPos = expressionEndPos = 0;\n\n if (val.indexOf('[') < 0 || val.lastIndexOf(']') < len - 1) {\n return {\n exp: val,\n idx: null\n }\n }\n\n while (!eof()) {\n chr = next();\n /* istanbul ignore if */\n if (isStringStart(chr)) {\n parseString(chr);\n } else if (chr === 0x5B) {\n parseBracket(chr);\n }\n }\n\n return {\n exp: val.substring(0, expressionPos),\n idx: val.substring(expressionPos + 1, expressionEndPos)\n }\n}\n\nfunction next () {\n return str.charCodeAt(++index$1)\n}\n\nfunction eof () {\n return index$1 >= len\n}\n\nfunction isStringStart (chr) {\n return chr === 0x22 || chr === 0x27\n}\n\nfunction parseBracket (chr) {\n var inBracket = 1;\n expressionPos = index$1;\n while (!eof()) {\n chr = next();\n if (isStringStart(chr)) {\n parseString(chr);\n continue\n }\n if (chr === 0x5B) { inBracket++; }\n if (chr === 0x5D) { inBracket--; }\n if (inBracket === 0) {\n expressionEndPos = index$1;\n break\n }\n }\n}\n\nfunction parseString (chr) {\n var stringQuote = chr;\n while (!eof()) {\n chr = next();\n if (chr === stringQuote) {\n break\n }\n }\n}\n\n/* */\n\nvar dirRE = /^v-|^@|^:/;\nvar forAliasRE = /(.*?)\\s+(?:in|of)\\s+(.*)/;\nvar forIteratorRE = /\\((\\{[^}]*\\}|[^,]*),([^,]*)(?:,([^,]*))?\\)/;\nvar bindRE = /^:|^v-bind:/;\nvar onRE = /^@|^v-on:/;\nvar argRE = /:(.*)$/;\nvar modifierRE = /\\.[^.]+/g;\n\nvar decodeHTMLCached = cached(decode);\n\n// configurable state\nvar warn$1;\nvar platformGetTagNamespace;\nvar platformMustUseProp;\nvar platformIsPreTag;\nvar preTransforms;\nvar transforms;\nvar postTransforms;\nvar delimiters;\n\n/**\n * Convert HTML string to AST.\n */\nfunction parse (\n template,\n options\n) {\n warn$1 = options.warn || baseWarn;\n platformGetTagNamespace = options.getTagNamespace || no;\n platformMustUseProp = options.mustUseProp || no;\n platformIsPreTag = options.isPreTag || no;\n preTransforms = pluckModuleFunction(options.modules, 'preTransformNode');\n transforms = pluckModuleFunction(options.modules, 'transformNode');\n postTransforms = pluckModuleFunction(options.modules, 'postTransformNode');\n delimiters = options.delimiters;\n var stack = [];\n var preserveWhitespace = options.preserveWhitespace !== false;\n var root;\n var currentParent;\n var inVPre = false;\n var inPre = false;\n var warned = false;\n parseHTML(template, {\n expectHTML: options.expectHTML,\n isUnaryTag: options.isUnaryTag,\n shouldDecodeNewlines: options.shouldDecodeNewlines,\n start: function start (tag, attrs, unary) {\n // check namespace.\n // inherit parent ns if there is one\n var ns = (currentParent && currentParent.ns) || platformGetTagNamespace(tag);\n\n // handle IE svg bug\n /* istanbul ignore if */\n if (isIE && ns === 'svg') {\n attrs = guardIESVGBug(attrs);\n }\n\n var element = {\n type: 1,\n tag: tag,\n attrsList: attrs,\n attrsMap: makeAttrsMap(attrs),\n parent: currentParent,\n children: []\n };\n if (ns) {\n element.ns = ns;\n }\n\n if (isForbiddenTag(element) && !isServerRendering()) {\n element.forbidden = true;\n \"production\" !== 'production' && warn$1(\n 'Templates should only be responsible for mapping the state to the ' +\n 'UI. Avoid placing tags with side-effects in your templates, such as ' +\n \"<\" + tag + \">\" + ', as they will not be parsed.'\n );\n }\n\n // apply pre-transforms\n for (var i = 0; i < preTransforms.length; i++) {\n preTransforms[i](element, options);\n }\n\n if (!inVPre) {\n processPre(element);\n if (element.pre) {\n inVPre = true;\n }\n }\n if (platformIsPreTag(element.tag)) {\n inPre = true;\n }\n if (inVPre) {\n processRawAttrs(element);\n } else {\n processFor(element);\n processIf(element);\n processOnce(element);\n processKey(element);\n\n // determine whether this is a plain element after\n // removing structural attributes\n element.plain = !element.key && !attrs.length;\n\n processRef(element);\n processSlot(element);\n processComponent(element);\n for (var i$1 = 0; i$1 < transforms.length; i$1++) {\n transforms[i$1](element, options);\n }\n processAttrs(element);\n }\n\n function checkRootConstraints (el) {\n if (false) {\n if (el.tag === 'slot' || el.tag === 'template') {\n warned = true;\n warn$1(\n \"Cannot use <\" + (el.tag) + \"> as component root element because it may \" +\n 'contain multiple nodes:\\n' + template\n );\n }\n if (el.attrsMap.hasOwnProperty('v-for')) {\n warned = true;\n warn$1(\n 'Cannot use v-for on stateful component root element because ' +\n 'it renders multiple elements:\\n' + template\n );\n }\n }\n }\n\n // tree management\n if (!root) {\n root = element;\n checkRootConstraints(root);\n } else if (!stack.length) {\n // allow root elements with v-if, v-else-if and v-else\n if (root.if && (element.elseif || element.else)) {\n checkRootConstraints(element);\n addIfCondition(root, {\n exp: element.elseif,\n block: element\n });\n } else if (false) {\n warned = true;\n warn$1(\n \"Component template should contain exactly one root element:\" +\n \"\\n\\n\" + template + \"\\n\\n\" +\n \"If you are using v-if on multiple elements, \" +\n \"use v-else-if to chain them instead.\"\n );\n }\n }\n if (currentParent && !element.forbidden) {\n if (element.elseif || element.else) {\n processIfConditions(element, currentParent);\n } else if (element.slotScope) { // scoped slot\n currentParent.plain = false;\n var name = element.slotTarget || 'default';(currentParent.scopedSlots || (currentParent.scopedSlots = {}))[name] = element;\n } else {\n currentParent.children.push(element);\n element.parent = currentParent;\n }\n }\n if (!unary) {\n currentParent = element;\n stack.push(element);\n }\n // apply post-transforms\n for (var i$2 = 0; i$2 < postTransforms.length; i$2++) {\n postTransforms[i$2](element, options);\n }\n },\n\n end: function end () {\n // remove trailing whitespace\n var element = stack[stack.length - 1];\n var lastNode = element.children[element.children.length - 1];\n if (lastNode && lastNode.type === 3 && lastNode.text === ' ') {\n element.children.pop();\n }\n // pop stack\n stack.length -= 1;\n currentParent = stack[stack.length - 1];\n // check pre state\n if (element.pre) {\n inVPre = false;\n }\n if (platformIsPreTag(element.tag)) {\n inPre = false;\n }\n },\n\n chars: function chars (text) {\n if (!currentParent) {\n if (false) {\n warned = true;\n warn$1(\n 'Component template requires a root element, rather than just text:\\n\\n' + template\n );\n }\n return\n }\n // IE textarea placeholder bug\n /* istanbul ignore if */\n if (isIE &&\n currentParent.tag === 'textarea' &&\n currentParent.attrsMap.placeholder === text) {\n return\n }\n var children = currentParent.children;\n text = inPre || text.trim()\n ? decodeHTMLCached(text)\n // only preserve whitespace if its not right after a starting tag\n : preserveWhitespace && children.length ? ' ' : '';\n if (text) {\n var expression;\n if (!inVPre && text !== ' ' && (expression = parseText(text, delimiters))) {\n children.push({\n type: 2,\n expression: expression,\n text: text\n });\n } else if (text !== ' ' || children[children.length - 1].text !== ' ') {\n currentParent.children.push({\n type: 3,\n text: text\n });\n }\n }\n }\n });\n return root\n}\n\nfunction processPre (el) {\n if (getAndRemoveAttr(el, 'v-pre') != null) {\n el.pre = true;\n }\n}\n\nfunction processRawAttrs (el) {\n var l = el.attrsList.length;\n if (l) {\n var attrs = el.attrs = new Array(l);\n for (var i = 0; i < l; i++) {\n attrs[i] = {\n name: el.attrsList[i].name,\n value: JSON.stringify(el.attrsList[i].value)\n };\n }\n } else if (!el.pre) {\n // non root node in pre blocks with no attributes\n el.plain = true;\n }\n}\n\nfunction processKey (el) {\n var exp = getBindingAttr(el, 'key');\n if (exp) {\n if (false) {\n warn$1(\"