{"version":3,"sources":["webpack:///node_modules/chart.js/dist/chart.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oGAAoG,MAAM,0BAA0B,EAAE,WAAW,EAAE,EAAE;AACrJ,oFAAoF,4BAA4B,MAAM,0BAA0B,EAAE,WAAW,EAAE,EAAE,IAAI,EAAE;AACvK;AACA,CAAC,2BAA2B;;AAE5B;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,iBAAiB,OAAO;AACxB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;;AAExB;AACA;AACA;AACA,kBAAkB,OAAO,QAAQ;AACjC,kBAAkB,OAAO,QAAQ;AACjC,mBAAmB,OAAO,OAAO;AACjC,mBAAmB,OAAO,OAAO;AACjC,kBAAkB,QAAQ,OAAO;AACjC,kBAAkB,QAAQ,OAAO;AACjC;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;;AAEA;AACA;;AAEA,uD;AACA;AACA;AACA;;AAEA;AACA;AACA,mBAAmB;;AAEnB,qBAAqB,gBAAgB;AACrC;AACA;AACA;AACA,GAAG;AACH;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gD;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;;AAED;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,+BAA+B,IAAI;AACnC,8BAA8B,EAAE,aAAa,EAAE;AAC/C;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,gBAAgB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,gBAAgB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,gBAAgB;AACrC;AACA;AACA;AACA;AACA;AACA,qBAAqB,gBAAgB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,kBAAkB,gBAAgB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;;;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA,EAAE;AACF;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;;AAEF;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;;AAEF;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA,iBAAiB,gBAAgB;AACjC;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;;AAEA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA,EAAE;;AAEF;AACA;AACA,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,gBAAgB,kBAAkB;AAClC;AACA;;AAEA;AACA;AACA;;AAEA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA,EAAE;AACF,MAAM;AACN,aAAa,kBAAkB;AAC/B;AACA;;AAEA;AACA,EAAE;AACF,MAAM;AACN;;AAEA,aAAa,kBAAkB;AAC/B;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA,YAAY,kBAAkB;AAC9B;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;;AAEpB;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA,YAAY,EAAE;AACd,cAAc;AACd;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA,YAAY,EAAE;AACd,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA,YAAY,EAAE;AACd,cAAc;AACd;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA,YAAY,EAAE;AACd,cAAc;AACd;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA,YAAY,EAAE;AACd,YAAY,EAAE;AACd,cAAc;AACd;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA,YAAY,MAAM;AAClB,YAAY,OAAO;AACnB,YAAY,EAAE;AACd,cAAc;AACd;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA,YAAY,SAAS;AACrB,YAAY,qBAAqB;AACjC,YAAY,OAAO;AACnB,cAAc;AACd;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA,YAAY,aAAa;AACzB,YAAY,SAAS;AACrB,YAAY,OAAO;AACnB,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,QAAQ;AAC7B;AACA;AACA,IAAI;AACJ,eAAe,SAAS;AACxB;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,cAAc,SAAS;AACvB;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA,YAAY,MAAM;AAClB,YAAY,MAAM;AAClB,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;;AAEA,+BAA+B,UAAU;AACzC;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAI;AACJ,kEAAkE,KAAK,KAAK;AAC5E;AACA;AACA;;AAEA;AACA,EAAE;;AAEF;AACA;AACA,YAAY,EAAE;AACd,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,SAAS,UAAU;AACnB;AACA;;AAEA;AACA;;AAEA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA,YAAY,OAAO;AACnB,YAAY,gBAAgB;AAC5B,YAAY,OAAO;AACnB,YAAY,SAAS;AACrB,cAAc,OAAO;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,aAAa,UAAU;AACvB;AACA;AACA;AACA;;AAEA;AACA,kCAAkC,UAAU;AAC5C;AACA;AACA;;AAEA;AACA,EAAE;;AAEF;AACA;AACA;AACA,YAAY,OAAO;AACnB,YAAY,gBAAgB;AAC5B,cAAc,OAAO;AACrB;AACA;AACA,wCAAwC,0BAA0B;AAClE,EAAE;;AAEF;AACA;AACA,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB,cAAc,OAAO;AACrB;AACA;AACA;AACA;AACA;AACA,0CAA0C,UAAU;AACpD;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA,EAAE;;AAEF;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA,EAAE;;AAEF;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA,EAAE;;AAEF;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA,EAAE;;AAEF;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA,EAAE;;AAEF;AACA;AACA,EAAE;;AAEF;AACA;AACA,EAAE;;AAEF;AACA;AACA,EAAE;;AAEF;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,MAAM;AAClB;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA,YAAY,yBAAyB;AACrC,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,EAAE;;AAEF;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,EAAE;;AAEF;AACA;AACA,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB,cAAc;AACd;AACA;AACA;AACA,qBAAqB;;AAErB;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,4DAA4D;AAC5D;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;;AAEA;;AAEA;AACA;AACA,WAAW,OAAO;AAClB,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,cAAc;AAC1B,YAAY,OAAO;AACnB,cAAc,OAAO;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,EAAE;;AAEF;AACA;AACA,YAAY,cAAc;AAC1B;AACA,cAAc,OAAO;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA,YAAY,OAAO;AACnB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,EAAE;;AAEF;AACA;AACA,YAAY,MAAM;AAClB,YAAY,OAAO;AACnB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA,mCAAmC,UAAU;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,gCAAgC,UAAU;AAC1C;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA,CAAC;;AAED;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC;;AAED;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;;AAEA;AACA,YAAY,MAAM;AAClB,YAAY,gBAAgB;AAC5B,YAAY,OAAO;AACnB,YAAY,QAAQ;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,uCAAuC,UAAU;AACjD;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,GAAG;AACH,EAAE;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,EAAE;;AAEF;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,WAAW;AACX;AACA;;AAEA;AACA;AACA,WAAW;AACX;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA,EAAE;;AAEF;AACA;AACA,EAAE;;AAEF;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;;AAEA,iCAAiC,UAAU;AAC3C;AACA;;AAEA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,EAAE;;AAEF;;AAEA;AACA;AACA;AACA;AACA;;AAEA,QAAQ,UAAU;AAClB;AACA;;AAEA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,QAAQ,UAAU;AAClB;AACA;AACA,EAAE;;AAEF;AACA,8DAA8D;AAC9D;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA,iBAAiB,WAAW;AAC5B;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;;AAEA;AACA,gEAAgE,qBAAqB;AACrF;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,IAAI;AACJ;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,CAAC;;AAED;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,iBAAiB,uBAAuB;AACxC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,CAAC;;AAED;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD;;AAEjD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;;AAEA;AACA;AACA,eAAe,wBAAwB;AACvC,YAAY,OAAO;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA,EAAE;;AAEF;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA,UAAU;AACV,EAAE;;AAEF;AACA;;AAEA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA,GAAG;AACH;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,kCAAkC,UAAU;AAC5C;AACA;;AAEA,iCAAiC,UAAU;AAC3C;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;;AAEA;;AAEA,kCAAkC,UAAU;AAC5C;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA,YAAY,OAAO;AACnB,cAAc,SAAS;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,aAAa,UAAU;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB,cAAc,OAAO;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;;AAER;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,8CAA8C,UAAU;AACxD;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,cAAc,kBAAkB;AAChC;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,QAAQ,UAAU;AAClB;AACA;AACA;AACA;;AAEA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,iCAAiC,UAAU;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC;;AAED;AACA;;AAEA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,GAAG;AACH,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,iCAAiC,UAAU;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC;;AAED;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,kBAAkB,6BAA6B;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;;AAEA,yDAAyD,UAAU;AACnE;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,EAAE;;AAEF;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;;AAED;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA,iBAAiB,kBAAkB;AACnC;AACA;AACA;AACA;;AAEA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB,cAAc;AACd;AACA;AACA;AACA;AACA;AACA,cAAc;AACd,cAAc;AACd,eAAe;AACf;AACA,aAAa;AACb;;AAEA,iCAAiC,UAAU;AAC3C;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA,iCAAiC,UAAU;AAC3C;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC,+BAA+B;AAC/B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;;AAEA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;;AAEA;AACA;;AAEA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA,GAAG;;AAEH;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,iDAAiD,UAAU;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,iCAAiC,UAAU;AAC3C;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,iCAAiC,UAAU;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;;AAEA,iBAAiB,kBAAkB;AACnC;AACA;AACA;AACA;;AAEA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,EAAE;;AAEF;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA,CAAC;;AAED;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,mCAAmC,UAAU;AAC7C;AACA;;AAEA;AACA;AACA;;AAEA;AACA,mCAAmC,UAAU;AAC7C;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,iCAAiC,UAAU;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,iCAAiC,UAAU;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,cAAc,kBAAkB;AAChC;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAI;AACJ;;AAEA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH,oCAAoC,UAAU;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,oCAAoC,UAAU;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAI;;AAEJ;;AAEA;AACA;;AAEA;AACA,QAAQ,UAAU;AAClB;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAE;AACF,CAAC;;AAED;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,kBAAkB,6BAA6B;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;;AAEA,yDAAyD,UAAU;AACnE;AACA;AACA;;AAEA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA,yCAAyC,UAAU;AACnD;AACA;AACA;AACA;AACA;;AAEA,iCAAiC,UAAU;AAC3C;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA,EAAE;;AAEF;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,iCAAiC,UAAU;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA,CAAC;;AAED;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,mCAAmC,UAAU;AAC7C;AACA;;AAEA;AACA;;AAEA;AACA,mCAAmC,UAAU;AAC7C;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,iCAAiC,UAAU;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,iCAAiC,UAAU;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,mCAAmC,UAAU;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,GAAG;AACH,EAAE;;AAEF;;AAEA;AACA;AACA;AACA,cAAc;AACd,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,MAAM;AACjB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,SAAS;AACpB;AACA;AACA;AACA;;AAEA,oCAAoC,UAAU;AAC9C;AACA;AACA;;AAEA;AACA,sCAAsC,UAAU;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,WAAW,eAAe;AAC1B,WAAW,OAAO;AAClB,YAAY,eAAe;AAC3B;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;;AAEA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB,WAAW,SAAS;AACpB,YAAY,eAAe;AAC3B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,EAAE;;AAEF;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAI;;AAEJ;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa,MAAM;AACnB,aAAa,MAAM;AACnB,aAAa,oBAAoB;AACjC,cAAc,gBAAgB;AAC9B;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa,MAAM;AACnB,aAAa,MAAM;AACnB,aAAa,oBAAoB;AACjC,cAAc,gBAAgB;AAC9B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,iBAAiB;AAChD,GAAG;;AAEH;AACA;AACA;AACA;AACA,aAAa,MAAM;AACnB,aAAa,MAAM;AACnB,cAAc,gBAAgB;AAC9B;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,aAAa,MAAM;AACnB,aAAa,MAAM;AACnB,aAAa,oBAAoB;AACjC,cAAc,gBAAgB;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,aAAa,MAAM;AACnB,aAAa,MAAM;AACnB,aAAa,oBAAoB;AACjC,cAAc,gBAAgB;AAC9B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAI;;AAEJ;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,aAAa,MAAM;AACnB,aAAa,MAAM;AACnB,aAAa,oBAAoB;AACjC,cAAc,gBAAgB;AAC9B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAI;;AAEJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,EAAE;AACF;;AAEA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,EAAE;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA,UAAU,OAAO;AACjB;AACA,UAAU,OAAO;AACjB,UAAU,QAAQ;AAClB,UAAU,SAAS;AACnB,UAAU,SAAS;AACnB,UAAU,SAAS;AACnB,UAAU,OAAO;AACjB,UAAU,OAAO;AACjB,UAAU,OAAO;AACjB,UAAU,OAAO;AACjB,UAAU,OAAO;AACjB,UAAU,OAAO;AACjB;;AAEA;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA;AACA,YAAY,MAAM;AAClB,YAAY,YAAY;AACxB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,EAAE;;AAEF;AACA;AACA,YAAY,MAAM;AAClB,YAAY,YAAY;AACxB;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA,YAAY,MAAM;AAClB,YAAY,YAAY;AACxB,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;;AAEA,QAAQ,UAAU;AAClB;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA,YAAY,MAAM;AAClB,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,sCAAsC;;AAEtC;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAI;AACJ;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAI;;AAEJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAI;;AAEJ;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,mBAAmB;AACnB;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAI;;AAEJ;AACA;AACA;AACA;AACA,IAAI;;AAEJ;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,IAAI;;AAEJ;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,wJAAwJ,UAAU,eAAe,EAAE,QAAQ,YAAY,EAAE,GAAG,6BAA6B,+CAA+C,GAAG,sLAAsL,uBAAuB,mBAAmB,YAAY,WAAW,aAAa,cAAc,qBAAqB,yBAAyB,uBAAuB,gBAAgB,GAAG,wCAAwC,uBAAuB,qBAAqB,sBAAsB,YAAY,WAAW,GAAG,wCAAwC,uBAAuB,gBAAgB,iBAAiB,YAAY,WAAW,GAAG;;AAEn4B;AACA;AACA,CAAC;;AAED;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,EAAE;AACF;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA,2DAA2D,cAAc;;AAEzE;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,2DAA2D;AAC3D;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;;AAEA;AACA,2DAA2D;;AAE3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,EAAE;AACF;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA,GAAG;;AAEH,oCAAoC;AACpC;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,oEAAoE;AACpE,wDAAwD;AACxD;AACA;AACA;;AAEA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B;;AAE1B;AACA;AACA,6CAA6C,uCAAuC;AACpF,YAAY,EAAE;AACd,YAAY,OAAO;AACnB,cAAc,yBAAyB;AACvC;AACA,8BAA8B;;AAE9B;AACA;AACA;AACA,YAAY,yBAAyB;AACrC,cAAc,QAAQ;AACtB;AACA,8BAA8B;;AAE9B;AACA;AACA,YAAY,MAAM;AAClB,YAAY,OAAO,cAAc,aAAa;AAC9C,YAAY,SAAS;AACrB,SAAS,aAAa;AACtB;AACA,gCAAgC;;AAEhC;AACA;AACA,YAAY,MAAM;AAClB,YAAY,OAAO,cAAc,aAAa;AAC9C,YAAY,SAAS;AACrB;AACA;;AAEA,CAAC;;AAED;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,YAAY,kBAAkB;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA,EAAE;;AAEF;AACA;AACA,YAAY,kBAAkB;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA,cAAc,UAAU;AACxB;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA,YAAY,MAAM;AAClB,YAAY,OAAO;AACnB,YAAY,MAAM;AAClB,cAAc,QAAQ;AACtB;AACA;AACA;AACA;AACA;;AAEA,aAAa,UAAU;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,EAAE;;AAEF;AACA;AACA,cAAc,SAAS,GAAG,kBAAkB;AAC5C;AACA;AACA;AACA,oDAAoD;AACpD;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAI;AACJ,GAAG;;AAEH;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;;AAEA;AACA,aAAa;AACb;AACA;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA,gEAAgE;AAChE,EAAE;AACF;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA,IAAI;AACJ;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA,IAAI;AACJ;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA,qBAAqB,eAAe;AACpC,cAAc,OAAO;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,oCAAoC,SAAS;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA,qBAAqB,gBAAgB;AACrC,0BAA0B,OAAO;AACjC,cAAc,OAAO;AACrB;AACA;AACA;AACA;AACA;AACA;;AAEA,oCAAoC,SAAS;AAC7C;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD;AAChD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,uBAAuB,OAAO;AAC9B;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,iCAAiC;AACjC;;AAEA;AACA;AACA;AACA;AACA,EAAE;AACF;;AAEA;AACA;AACA;AACA;AACA;;AAEA,0CAA0C;AAC1C,0EAA0E;AAC1E,wDAAwD;AACxD,6CAA6C;AAC7C,iFAAiF;AACjF,uDAAuD;AACvD,8CAA8C;AAC9C,6EAA6E;;AAE7E;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,EAAE;AACF;AACA;;AAEA,YAAY;AACZ,cAAc;AACd,QAAQ;AACR;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,EAAE;AACF;AACA,EAAE;AACF;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,EAAE;AACF;AACA,EAAE;AACF;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,EAAE;;AAEF;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;;AAEH;AACA,EAAE;;AAEF;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,EAAE;;AAEF;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,mCAAmC,SAAS;AAC5C;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA,IAAI;;;AAGJ;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA,EAAE;;AAEF;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,IAAI;AACJ;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV,EAAE;;AAEF;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,kCAAkC,SAAS;AAC3C;AACA,yCAAyC;;AAEzC;AACA,iDAAiD;AACjD;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,IAAI;;AAEJ;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA,sBAAsB;AACtB,EAAE;;AAEF;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,IAAI;AACJ;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA,YAAY,OAAO;AACnB,cAAc,QAAQ;AACtB;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,eAAe,UAAU;AACzB;AACA;;AAEA;AACA,yBAAyB;AACzB;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,EAAE;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,EAAE;AACF;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,sBAAsB;;AAEtB;AACA;;AAEA;AACA;;AAEA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;;AAErB;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,EAAE;;AAEF;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAI;AACJ;AACA,EAAE;;AAEF;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG,IAAI;;AAEP;AACA;AACA;AACA,aAAa;AACb,KAAK;AACL;AACA,aAAa;AACb,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;;AAEA;AACA,EAAE;;AAEF;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;;AAEH;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,GAAG;;AAEH;;AAEA;AACA;AACA;AACA;AACA,IAAI;AACJ;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,iDAAiD,UAAU;AAC3D;AACA;;AAEA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA,EAAE;;AAEF;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA,IAAI;;AAEJ;AACA,GAAG;AACH;;AAEA;AACA,kCAAkC,uBAAuB;AACzD;;AAEA;AACA,EAAE;;AAEF;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;;AAEA,yDAAyD,UAAU;AACnE;AACA;AACA;AACA;;AAEA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,mDAAmD,QAAQ;AAC3D;AACA;AACA;AACA;;AAEA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA,gDAAgD,gBAAgB;AAChE,EAAE;;AAEF;AACA,oDAAoD,gBAAgB;AACpE,EAAE;;AAEF;AACA;AACA;AACA;AACA;;AAEA;AACA,EAAE;;AAEF;AACA,kDAAkD,gBAAgB;AAClE,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,EAAE;;AAEF;AACA;AACA,mDAAmD,UAAU;AAC7D;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;;AAEA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;;AAEA;;AAEA;AACA,6CAA6C,UAAU;AACvD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,EAAE;;AAEF;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH,EAAE;;AAEF;AACA;AACA;;AAEA,qCAAqC,UAAU;AAC/C;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;;AAEA;AACA;;AAEA;AACA,EAAE;;AAEF;AACA;AACA;AACA,YAAY,OAAO;AACnB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,uCAAuC,UAAU;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,0BAA0B;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,QAAQ;AACtC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,4CAA4C;AAC5C;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAY,OAAO;AACnB,cAAc,OAAO;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,0BAA0B;AAC1B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,YAAY,MAAM;AAClB,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB,cAAc,OAAO;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,mBAAmB;AACnB;;AAEA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,aAAa,eAAe;AAC5B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA;AACA;;AAEA;AACA;AACA,aAAa,mBAAmB;AAChC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,eAAe;AAC5B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,YAAY,YAAY;AACxB,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,GAAG;;AAEH;AACA;AACA,kBAAkB,WAAW;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa;AACb;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;;AAEA;AACA;AACA,YAAY,IAAI;AAChB,YAAY,OAAO;AACnB,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB,aAAa;AACb;AACA;AACA;;AAEA;AACA;AACA,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB,YAAY,KAAK;AACjB,aAAa;AACb;AACA;AACA;;AAEA;AACA;AACA,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB,YAAY,KAAK;AACjB,aAAa;AACb;AACA;AACA;;AAEA;AACA;AACA,YAAY,OAAO;AACnB,YAAY,KAAK;AACjB,YAAY,OAAO;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA,YAAY,OAAO;AACnB,YAAY,KAAK;AACjB;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,gBAAgB;AAC9B;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,uBAAuB,OAAO;AAC9B,mBAAmB,OAAO;AAC1B,mBAAmB,SAAS;AAC5B,cAAc,OAAO;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,yBAAyB,gCAAgC;AACzD;AACA;AACA,KAAK;AACL;AACA,wDAAwD;AACxD;AACA;AACA,IAAI;AACJ,qBAAqB;AACrB;;AAEA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,CAAC;;AAED;AACA;AACA;;AAEA,iCAAiC,UAAU;AAC3C;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc,QAAQ;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA,qCAAqC,aAAa;AAClD;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;;AAEF;AACA;AACA;;AAEA,uFAAuF;AACvF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA,oBAAoB;;AAEpB;;AAEA;AACA,mCAAmC,UAAU;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,IAAI;AACJ;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,EAAE;AACF;AACA;AACA,EAAE;;AAEF;;AAEA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;;AAEF;;AAEA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,EAAE;AACF;AACA;AACA,EAAE;;AAEF;;AAEA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH,iCAAiC;AACjC;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,IAAI;AACJ;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB;;AAEjB;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,+DAA+D;AAC/D;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA,2EAA2E;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;;AAEA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,aAAa,eAAe;AAC5B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,gDAAgD,UAAU;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,EAAE;;AAEF;AACA;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA,0BAA0B;;AAE1B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,qDAAqD;;AAErD;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ,GAAG;;AAEH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,oBAAoB,kBAAkB;AACtC;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,uDAAuD;AACvD;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,2CAA2C;AAC3C;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,EAAE;;AAEF;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA,EAAE;;AAEF;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;;AAEA;AACA;AACA;AACA,gBAAgB,eAAe;AAC/B;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA,IAAI;AACJ;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA,IAAI;AACJ;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,EAAE;;AAEF;AACA;AACA,EAAE;;AAEF;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA,MAAM;AACN;AACA,IAAI;;AAEJ;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;;AAEJ,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA,MAAM;AACN;AACA,IAAI;AACJ;;AAEA;AACA;;AAEA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,aAAa,SAAS;AACtB;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,EAAE;;AAEF;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA,IAAI;;AAEJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;;AAEJ,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA,IAAI;AACJ;;AAEA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;;AAEA;AACA,EAAE;;AAEF;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA,EAAE;;AAEF;AACA;AACA,YAAY,OAAO;AACnB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;;AAEA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,cAAc;AACd;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,EAAE;;AAEF;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,YAAY,gBAAgB;AAC5B;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,EAAE;AACF;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,iCAAiC,UAAU;AAC3C;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;;AAEA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA,uCAAuC,QAAQ;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;;AAEA,iBAAiB,gBAAgB;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA,EAAE;;AAEF;AACA;;AAEA;;AAEA;AACA;AACA,EAAE;;AAEF;AACA;AACA,EAAE;;AAEF;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,EAAE;;AAEF;AACA;;AAEA;AACA,YAAY;AACZ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA,CAAC;;AAED;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,iCAAiC,UAAU;AAC3C;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,wBAAwB,UAAU;AAClC;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB,WAAW,OAAO;AAClB,yEAAyE,OAAO,MAAM,OAAO;AAC7F;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,kBAAkB;AACtB,IAAI;AACJ;AACA;;AAEA;AACA;AACA;;AAEA,sCAAsC,UAAU;AAChD;AACA;AACA;AACA;AACA;;AAEA;;AAEA,iCAAiC,UAAU;AAC3C;AACA;AACA;;AAEA;AACA;AACA,eAAe,gCAAgC;AAC/C;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,WAAW;AACX,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH,WAAW;AACX;AACA;;AAEA;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,iCAAiC,UAAU;AAC3C;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,iCAAiC,cAAc;AAC/C;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,mBAAmB,6BAA6B;AAChD;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,2DAA2D,UAAU;AACrE;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,aAAa;AACpB;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA,gEAAgE;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;;AAEA,SAAS;AACT;;AAEA;AACA;AACA;;AAEA,kCAAkC,UAAU;AAC5C;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;;AAEA;AACA;AACA;AACA,sEAAsE,MAAM;AAC5E;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA,+CAA+C;AAC/C;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,uCAAuC,UAAU;AACjD;AACA;;AAEA;AACA,wDAAwD,UAAU;AAClE;AACA;;AAEA;AACA;AACA;;AAEA,oCAAoC,UAAU;AAC9C;AACA;AACA;AACA;AACA,KAAK;AACL,sCAAsC,UAAU;AAChD;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,uCAAuC,UAAU;AACjD;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,EAAE;;AAEF;AACA;AACA;;AAEA,kCAAkC,UAAU;AAC5C;AACA;;AAEA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,EAAE;;AAEF;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC;;AAED;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA,EAAE;;AAEF;AACA;AACA,EAAE;;AAEF;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA,EAAE;;AAEF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF,CAAC,KAAK;;AAEN;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,EAAE;AACF;AACA,EAAE;AACF;AACA,EAAE;AACF;AACA,EAAE;AACF;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,YAAY,UAAU;AACtB;AACA;;AAEA;AACA;;AAEA;AACA,mBAAmB,OAAO;AAC1B;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,qCAAqC,UAAU;AAC/C;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,aAAa,WAAW;AACxB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,aAAa,WAAW;AACxB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA,iBAAiB,gCAAgC;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,EAAE;;AAEF;AACA;AACA;;AAEA;AACA;AACA;;AAEA,uFAAuF;AACvF;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,EAAE;AACF;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAI;AACJ;;AAEA;AACA;AACA;;AAEA;AACA,EAAE;AACF;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,+BAA+B;AAC/B;AACA,GAAG;AACH;AACA,iCAAiC;AACjC;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;;AAEA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,yCAAyC;;AAEzC;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,EAAE;AACF;;AAEA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B,6BAA6B;AAC7B;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;;AAEA,IAAI;AACJ;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,cAAc,eAAe;AAC7B;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,EAAE;;AAEF;AACA;AACA;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,EAAE;;AAEF;;AAEA;AACA;AACA;;AAEA,uFAAuF;AACvF;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,EAAE;AACF;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,+BAA+B;AAC/B;AACA,GAAG;AACH;AACA,iCAAiC;AACjC;;AAEA;AACA;;AAEA,EAAE;AACF;;AAEA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,mGAAmG;AACnG;;AAEA;AACA;AACA,yCAAyC;AACzC;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,mBAAmB,iBAAiB;AACpC;AACA;AACA;AACA,IAAI;AACJ;AACA;;AAEA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;AAGA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,CAAC;;AAED;;;AAGA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8DAA8D;;AAE9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,sDAAsD,QAAQ,WAAW,EAAE;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0EAA0E;AAC1E;AACA,IAAI;AACJ;AACA;AACA;;AAEA;;AAEA,CAAC","file":"scripts.d166cef3882d735b5181.js","sourcesContent":["/*!\n * Chart.js v2.8.0\n * https://www.chartjs.org\n * (c) 2019 Chart.js Contributors\n * Released under the MIT License\n */\n(function (global, factory) {\ntypeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(function() { try { return require('moment'); } catch(e) { } }()) :\ntypeof define === 'function' && define.amd ? define(['require'], function(require) { return factory(function() { try { return require('moment'); } catch(e) { } }()); }) :\n(global.Chart = factory(global.moment));\n}(this, (function (moment) { 'use strict';\n\nmoment = moment && moment.hasOwnProperty('default') ? moment['default'] : moment;\n\n/* MIT license */\n\nvar conversions = {\n rgb2hsl: rgb2hsl,\n rgb2hsv: rgb2hsv,\n rgb2hwb: rgb2hwb,\n rgb2cmyk: rgb2cmyk,\n rgb2keyword: rgb2keyword,\n rgb2xyz: rgb2xyz,\n rgb2lab: rgb2lab,\n rgb2lch: rgb2lch,\n\n hsl2rgb: hsl2rgb,\n hsl2hsv: hsl2hsv,\n hsl2hwb: hsl2hwb,\n hsl2cmyk: hsl2cmyk,\n hsl2keyword: hsl2keyword,\n\n hsv2rgb: hsv2rgb,\n hsv2hsl: hsv2hsl,\n hsv2hwb: hsv2hwb,\n hsv2cmyk: hsv2cmyk,\n hsv2keyword: hsv2keyword,\n\n hwb2rgb: hwb2rgb,\n hwb2hsl: hwb2hsl,\n hwb2hsv: hwb2hsv,\n hwb2cmyk: hwb2cmyk,\n hwb2keyword: hwb2keyword,\n\n cmyk2rgb: cmyk2rgb,\n cmyk2hsl: cmyk2hsl,\n cmyk2hsv: cmyk2hsv,\n cmyk2hwb: cmyk2hwb,\n cmyk2keyword: cmyk2keyword,\n\n keyword2rgb: keyword2rgb,\n keyword2hsl: keyword2hsl,\n keyword2hsv: keyword2hsv,\n keyword2hwb: keyword2hwb,\n keyword2cmyk: keyword2cmyk,\n keyword2lab: keyword2lab,\n keyword2xyz: keyword2xyz,\n\n xyz2rgb: xyz2rgb,\n xyz2lab: xyz2lab,\n xyz2lch: xyz2lch,\n\n lab2xyz: lab2xyz,\n lab2rgb: lab2rgb,\n lab2lch: lab2lch,\n\n lch2lab: lch2lab,\n lch2xyz: lch2xyz,\n lch2rgb: lch2rgb\n};\n\n\nfunction rgb2hsl(rgb) {\n var r = rgb[0]/255,\n g = rgb[1]/255,\n b = rgb[2]/255,\n min = Math.min(r, g, b),\n max = Math.max(r, g, b),\n delta = max - min,\n h, s, l;\n\n if (max == min)\n h = 0;\n else if (r == max)\n h = (g - b) / delta;\n else if (g == max)\n h = 2 + (b - r) / delta;\n else if (b == max)\n h = 4 + (r - g)/ delta;\n\n h = Math.min(h * 60, 360);\n\n if (h < 0)\n h += 360;\n\n l = (min + max) / 2;\n\n if (max == min)\n s = 0;\n else if (l <= 0.5)\n s = delta / (max + min);\n else\n s = delta / (2 - max - min);\n\n return [h, s * 100, l * 100];\n}\n\nfunction rgb2hsv(rgb) {\n var r = rgb[0],\n g = rgb[1],\n b = rgb[2],\n min = Math.min(r, g, b),\n max = Math.max(r, g, b),\n delta = max - min,\n h, s, v;\n\n if (max == 0)\n s = 0;\n else\n s = (delta/max * 1000)/10;\n\n if (max == min)\n h = 0;\n else if (r == max)\n h = (g - b) / delta;\n else if (g == max)\n h = 2 + (b - r) / delta;\n else if (b == max)\n h = 4 + (r - g) / delta;\n\n h = Math.min(h * 60, 360);\n\n if (h < 0)\n h += 360;\n\n v = ((max / 255) * 1000) / 10;\n\n return [h, s, v];\n}\n\nfunction rgb2hwb(rgb) {\n var r = rgb[0],\n g = rgb[1],\n b = rgb[2],\n h = rgb2hsl(rgb)[0],\n w = 1/255 * Math.min(r, Math.min(g, b)),\n b = 1 - 1/255 * Math.max(r, Math.max(g, b));\n\n return [h, w * 100, b * 100];\n}\n\nfunction rgb2cmyk(rgb) {\n var r = rgb[0] / 255,\n g = rgb[1] / 255,\n b = rgb[2] / 255,\n c, m, y, k;\n\n k = Math.min(1 - r, 1 - g, 1 - b);\n c = (1 - r - k) / (1 - k) || 0;\n m = (1 - g - k) / (1 - k) || 0;\n y = (1 - b - k) / (1 - k) || 0;\n return [c * 100, m * 100, y * 100, k * 100];\n}\n\nfunction rgb2keyword(rgb) {\n return reverseKeywords[JSON.stringify(rgb)];\n}\n\nfunction rgb2xyz(rgb) {\n var r = rgb[0] / 255,\n g = rgb[1] / 255,\n b = rgb[2] / 255;\n\n // assume sRGB\n r = r > 0.04045 ? Math.pow(((r + 0.055) / 1.055), 2.4) : (r / 12.92);\n g = g > 0.04045 ? Math.pow(((g + 0.055) / 1.055), 2.4) : (g / 12.92);\n b = b > 0.04045 ? Math.pow(((b + 0.055) / 1.055), 2.4) : (b / 12.92);\n\n var x = (r * 0.4124) + (g * 0.3576) + (b * 0.1805);\n var y = (r * 0.2126) + (g * 0.7152) + (b * 0.0722);\n var z = (r * 0.0193) + (g * 0.1192) + (b * 0.9505);\n\n return [x * 100, y *100, z * 100];\n}\n\nfunction rgb2lab(rgb) {\n var xyz = rgb2xyz(rgb),\n x = xyz[0],\n y = xyz[1],\n z = xyz[2],\n l, a, b;\n\n x /= 95.047;\n y /= 100;\n z /= 108.883;\n\n x = x > 0.008856 ? Math.pow(x, 1/3) : (7.787 * x) + (16 / 116);\n y = y > 0.008856 ? Math.pow(y, 1/3) : (7.787 * y) + (16 / 116);\n z = z > 0.008856 ? Math.pow(z, 1/3) : (7.787 * z) + (16 / 116);\n\n l = (116 * y) - 16;\n a = 500 * (x - y);\n b = 200 * (y - z);\n\n return [l, a, b];\n}\n\nfunction rgb2lch(args) {\n return lab2lch(rgb2lab(args));\n}\n\nfunction hsl2rgb(hsl) {\n var h = hsl[0] / 360,\n s = hsl[1] / 100,\n l = hsl[2] / 100,\n t1, t2, t3, rgb, val;\n\n if (s == 0) {\n val = l * 255;\n return [val, val, val];\n }\n\n if (l < 0.5)\n t2 = l * (1 + s);\n else\n t2 = l + s - l * s;\n t1 = 2 * l - t2;\n\n rgb = [0, 0, 0];\n for (var i = 0; i < 3; i++) {\n t3 = h + 1 / 3 * - (i - 1);\n t3 < 0 && t3++;\n t3 > 1 && t3--;\n\n if (6 * t3 < 1)\n val = t1 + (t2 - t1) * 6 * t3;\n else if (2 * t3 < 1)\n val = t2;\n else if (3 * t3 < 2)\n val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;\n else\n val = t1;\n\n rgb[i] = val * 255;\n }\n\n return rgb;\n}\n\nfunction hsl2hsv(hsl) {\n var h = hsl[0],\n s = hsl[1] / 100,\n l = hsl[2] / 100,\n sv, v;\n\n if(l === 0) {\n // no need to do calc on black\n // also avoids divide by 0 error\n return [0, 0, 0];\n }\n\n l *= 2;\n s *= (l <= 1) ? l : 2 - l;\n v = (l + s) / 2;\n sv = (2 * s) / (l + s);\n return [h, sv * 100, v * 100];\n}\n\nfunction hsl2hwb(args) {\n return rgb2hwb(hsl2rgb(args));\n}\n\nfunction hsl2cmyk(args) {\n return rgb2cmyk(hsl2rgb(args));\n}\n\nfunction hsl2keyword(args) {\n return rgb2keyword(hsl2rgb(args));\n}\n\n\nfunction hsv2rgb(hsv) {\n var h = hsv[0] / 60,\n s = hsv[1] / 100,\n v = hsv[2] / 100,\n hi = Math.floor(h) % 6;\n\n var f = h - Math.floor(h),\n p = 255 * v * (1 - s),\n q = 255 * v * (1 - (s * f)),\n t = 255 * v * (1 - (s * (1 - f))),\n v = 255 * v;\n\n switch(hi) {\n case 0:\n return [v, t, p];\n case 1:\n return [q, v, p];\n case 2:\n return [p, v, t];\n case 3:\n return [p, q, v];\n case 4:\n return [t, p, v];\n case 5:\n return [v, p, q];\n }\n}\n\nfunction hsv2hsl(hsv) {\n var h = hsv[0],\n s = hsv[1] / 100,\n v = hsv[2] / 100,\n sl, l;\n\n l = (2 - s) * v;\n sl = s * v;\n sl /= (l <= 1) ? l : 2 - l;\n sl = sl || 0;\n l /= 2;\n return [h, sl * 100, l * 100];\n}\n\nfunction hsv2hwb(args) {\n return rgb2hwb(hsv2rgb(args))\n}\n\nfunction hsv2cmyk(args) {\n return rgb2cmyk(hsv2rgb(args));\n}\n\nfunction hsv2keyword(args) {\n return rgb2keyword(hsv2rgb(args));\n}\n\n// http://dev.w3.org/csswg/css-color/#hwb-to-rgb\nfunction hwb2rgb(hwb) {\n var h = hwb[0] / 360,\n wh = hwb[1] / 100,\n bl = hwb[2] / 100,\n ratio = wh + bl,\n i, v, f, n;\n\n // wh + bl cant be > 1\n if (ratio > 1) {\n wh /= ratio;\n bl /= ratio;\n }\n\n i = Math.floor(6 * h);\n v = 1 - bl;\n f = 6 * h - i;\n if ((i & 0x01) != 0) {\n f = 1 - f;\n }\n n = wh + f * (v - wh); // linear interpolation\n\n switch (i) {\n default:\n case 6:\n case 0: r = v; g = n; b = wh; break;\n case 1: r = n; g = v; b = wh; break;\n case 2: r = wh; g = v; b = n; break;\n case 3: r = wh; g = n; b = v; break;\n case 4: r = n; g = wh; b = v; break;\n case 5: r = v; g = wh; b = n; break;\n }\n\n return [r * 255, g * 255, b * 255];\n}\n\nfunction hwb2hsl(args) {\n return rgb2hsl(hwb2rgb(args));\n}\n\nfunction hwb2hsv(args) {\n return rgb2hsv(hwb2rgb(args));\n}\n\nfunction hwb2cmyk(args) {\n return rgb2cmyk(hwb2rgb(args));\n}\n\nfunction hwb2keyword(args) {\n return rgb2keyword(hwb2rgb(args));\n}\n\nfunction cmyk2rgb(cmyk) {\n var c = cmyk[0] / 100,\n m = cmyk[1] / 100,\n y = cmyk[2] / 100,\n k = cmyk[3] / 100,\n r, g, b;\n\n r = 1 - Math.min(1, c * (1 - k) + k);\n g = 1 - Math.min(1, m * (1 - k) + k);\n b = 1 - Math.min(1, y * (1 - k) + k);\n return [r * 255, g * 255, b * 255];\n}\n\nfunction cmyk2hsl(args) {\n return rgb2hsl(cmyk2rgb(args));\n}\n\nfunction cmyk2hsv(args) {\n return rgb2hsv(cmyk2rgb(args));\n}\n\nfunction cmyk2hwb(args) {\n return rgb2hwb(cmyk2rgb(args));\n}\n\nfunction cmyk2keyword(args) {\n return rgb2keyword(cmyk2rgb(args));\n}\n\n\nfunction xyz2rgb(xyz) {\n var x = xyz[0] / 100,\n y = xyz[1] / 100,\n z = xyz[2] / 100,\n r, g, b;\n\n r = (x * 3.2406) + (y * -1.5372) + (z * -0.4986);\n g = (x * -0.9689) + (y * 1.8758) + (z * 0.0415);\n b = (x * 0.0557) + (y * -0.2040) + (z * 1.0570);\n\n // assume sRGB\n r = r > 0.0031308 ? ((1.055 * Math.pow(r, 1.0 / 2.4)) - 0.055)\n : r = (r * 12.92);\n\n g = g > 0.0031308 ? ((1.055 * Math.pow(g, 1.0 / 2.4)) - 0.055)\n : g = (g * 12.92);\n\n b = b > 0.0031308 ? ((1.055 * Math.pow(b, 1.0 / 2.4)) - 0.055)\n : b = (b * 12.92);\n\n r = Math.min(Math.max(0, r), 1);\n g = Math.min(Math.max(0, g), 1);\n b = Math.min(Math.max(0, b), 1);\n\n return [r * 255, g * 255, b * 255];\n}\n\nfunction xyz2lab(xyz) {\n var x = xyz[0],\n y = xyz[1],\n z = xyz[2],\n l, a, b;\n\n x /= 95.047;\n y /= 100;\n z /= 108.883;\n\n x = x > 0.008856 ? Math.pow(x, 1/3) : (7.787 * x) + (16 / 116);\n y = y > 0.008856 ? Math.pow(y, 1/3) : (7.787 * y) + (16 / 116);\n z = z > 0.008856 ? Math.pow(z, 1/3) : (7.787 * z) + (16 / 116);\n\n l = (116 * y) - 16;\n a = 500 * (x - y);\n b = 200 * (y - z);\n\n return [l, a, b];\n}\n\nfunction xyz2lch(args) {\n return lab2lch(xyz2lab(args));\n}\n\nfunction lab2xyz(lab) {\n var l = lab[0],\n a = lab[1],\n b = lab[2],\n x, y, z, y2;\n\n if (l <= 8) {\n y = (l * 100) / 903.3;\n y2 = (7.787 * (y / 100)) + (16 / 116);\n } else {\n y = 100 * Math.pow((l + 16) / 116, 3);\n y2 = Math.pow(y / 100, 1/3);\n }\n\n x = x / 95.047 <= 0.008856 ? x = (95.047 * ((a / 500) + y2 - (16 / 116))) / 7.787 : 95.047 * Math.pow((a / 500) + y2, 3);\n\n z = z / 108.883 <= 0.008859 ? z = (108.883 * (y2 - (b / 200) - (16 / 116))) / 7.787 : 108.883 * Math.pow(y2 - (b / 200), 3);\n\n return [x, y, z];\n}\n\nfunction lab2lch(lab) {\n var l = lab[0],\n a = lab[1],\n b = lab[2],\n hr, h, c;\n\n hr = Math.atan2(b, a);\n h = hr * 360 / 2 / Math.PI;\n if (h < 0) {\n h += 360;\n }\n c = Math.sqrt(a * a + b * b);\n return [l, c, h];\n}\n\nfunction lab2rgb(args) {\n return xyz2rgb(lab2xyz(args));\n}\n\nfunction lch2lab(lch) {\n var l = lch[0],\n c = lch[1],\n h = lch[2],\n a, b, hr;\n\n hr = h / 360 * 2 * Math.PI;\n a = c * Math.cos(hr);\n b = c * Math.sin(hr);\n return [l, a, b];\n}\n\nfunction lch2xyz(args) {\n return lab2xyz(lch2lab(args));\n}\n\nfunction lch2rgb(args) {\n return lab2rgb(lch2lab(args));\n}\n\nfunction keyword2rgb(keyword) {\n return cssKeywords[keyword];\n}\n\nfunction keyword2hsl(args) {\n return rgb2hsl(keyword2rgb(args));\n}\n\nfunction keyword2hsv(args) {\n return rgb2hsv(keyword2rgb(args));\n}\n\nfunction keyword2hwb(args) {\n return rgb2hwb(keyword2rgb(args));\n}\n\nfunction keyword2cmyk(args) {\n return rgb2cmyk(keyword2rgb(args));\n}\n\nfunction keyword2lab(args) {\n return rgb2lab(keyword2rgb(args));\n}\n\nfunction keyword2xyz(args) {\n return rgb2xyz(keyword2rgb(args));\n}\n\nvar cssKeywords = {\n aliceblue: [240,248,255],\n antiquewhite: [250,235,215],\n aqua: [0,255,255],\n aquamarine: [127,255,212],\n azure: [240,255,255],\n beige: [245,245,220],\n bisque: [255,228,196],\n black: [0,0,0],\n blanchedalmond: [255,235,205],\n blue: [0,0,255],\n blueviolet: [138,43,226],\n brown: [165,42,42],\n burlywood: [222,184,135],\n cadetblue: [95,158,160],\n chartreuse: [127,255,0],\n chocolate: [210,105,30],\n coral: [255,127,80],\n cornflowerblue: [100,149,237],\n cornsilk: [255,248,220],\n crimson: [220,20,60],\n cyan: [0,255,255],\n darkblue: [0,0,139],\n darkcyan: [0,139,139],\n darkgoldenrod: [184,134,11],\n darkgray: [169,169,169],\n darkgreen: [0,100,0],\n darkgrey: [169,169,169],\n darkkhaki: [189,183,107],\n darkmagenta: [139,0,139],\n darkolivegreen: [85,107,47],\n darkorange: [255,140,0],\n darkorchid: [153,50,204],\n darkred: [139,0,0],\n darksalmon: [233,150,122],\n darkseagreen: [143,188,143],\n darkslateblue: [72,61,139],\n darkslategray: [47,79,79],\n darkslategrey: [47,79,79],\n darkturquoise: [0,206,209],\n darkviolet: [148,0,211],\n deeppink: [255,20,147],\n deepskyblue: [0,191,255],\n dimgray: [105,105,105],\n dimgrey: [105,105,105],\n dodgerblue: [30,144,255],\n firebrick: [178,34,34],\n floralwhite: [255,250,240],\n forestgreen: [34,139,34],\n fuchsia: [255,0,255],\n gainsboro: [220,220,220],\n ghostwhite: [248,248,255],\n gold: [255,215,0],\n goldenrod: [218,165,32],\n gray: [128,128,128],\n green: [0,128,0],\n greenyellow: [173,255,47],\n grey: [128,128,128],\n honeydew: [240,255,240],\n hotpink: [255,105,180],\n indianred: [205,92,92],\n indigo: [75,0,130],\n ivory: [255,255,240],\n khaki: [240,230,140],\n lavender: [230,230,250],\n lavenderblush: [255,240,245],\n lawngreen: [124,252,0],\n lemonchiffon: [255,250,205],\n lightblue: [173,216,230],\n lightcoral: [240,128,128],\n lightcyan: [224,255,255],\n lightgoldenrodyellow: [250,250,210],\n lightgray: [211,211,211],\n lightgreen: [144,238,144],\n lightgrey: [211,211,211],\n lightpink: [255,182,193],\n lightsalmon: [255,160,122],\n lightseagreen: [32,178,170],\n lightskyblue: [135,206,250],\n lightslategray: [119,136,153],\n lightslategrey: [119,136,153],\n lightsteelblue: [176,196,222],\n lightyellow: [255,255,224],\n lime: [0,255,0],\n limegreen: [50,205,50],\n linen: [250,240,230],\n magenta: [255,0,255],\n maroon: [128,0,0],\n mediumaquamarine: [102,205,170],\n mediumblue: [0,0,205],\n mediumorchid: [186,85,211],\n mediumpurple: [147,112,219],\n mediumseagreen: [60,179,113],\n mediumslateblue: [123,104,238],\n mediumspringgreen: [0,250,154],\n mediumturquoise: [72,209,204],\n mediumvioletred: [199,21,133],\n midnightblue: [25,25,112],\n mintcream: [245,255,250],\n mistyrose: [255,228,225],\n moccasin: [255,228,181],\n navajowhite: [255,222,173],\n navy: [0,0,128],\n oldlace: [253,245,230],\n olive: [128,128,0],\n olivedrab: [107,142,35],\n orange: [255,165,0],\n orangered: [255,69,0],\n orchid: [218,112,214],\n palegoldenrod: [238,232,170],\n palegreen: [152,251,152],\n paleturquoise: [175,238,238],\n palevioletred: [219,112,147],\n papayawhip: [255,239,213],\n peachpuff: [255,218,185],\n peru: [205,133,63],\n pink: [255,192,203],\n plum: [221,160,221],\n powderblue: [176,224,230],\n purple: [128,0,128],\n rebeccapurple: [102, 51, 153],\n red: [255,0,0],\n rosybrown: [188,143,143],\n royalblue: [65,105,225],\n saddlebrown: [139,69,19],\n salmon: [250,128,114],\n sandybrown: [244,164,96],\n seagreen: [46,139,87],\n seashell: [255,245,238],\n sienna: [160,82,45],\n silver: [192,192,192],\n skyblue: [135,206,235],\n slateblue: [106,90,205],\n slategray: [112,128,144],\n slategrey: [112,128,144],\n snow: [255,250,250],\n springgreen: [0,255,127],\n steelblue: [70,130,180],\n tan: [210,180,140],\n teal: [0,128,128],\n thistle: [216,191,216],\n tomato: [255,99,71],\n turquoise: [64,224,208],\n violet: [238,130,238],\n wheat: [245,222,179],\n white: [255,255,255],\n whitesmoke: [245,245,245],\n yellow: [255,255,0],\n yellowgreen: [154,205,50]\n};\n\nvar reverseKeywords = {};\nfor (var key in cssKeywords) {\n reverseKeywords[JSON.stringify(cssKeywords[key])] = key;\n}\n\nvar convert = function() {\n return new Converter();\n};\n\nfor (var func in conversions) {\n // export Raw versions\n convert[func + \"Raw\"] = (function(func) {\n // accept array or plain args\n return function(arg) {\n if (typeof arg == \"number\")\n arg = Array.prototype.slice.call(arguments);\n return conversions[func](arg);\n }\n })(func);\n\n var pair = /(\\w+)2(\\w+)/.exec(func),\n from = pair[1],\n to = pair[2];\n\n // export rgb2hsl and [\"rgb\"][\"hsl\"]\n convert[from] = convert[from] || {};\n\n convert[from][to] = convert[func] = (function(func) { \n return function(arg) {\n if (typeof arg == \"number\")\n arg = Array.prototype.slice.call(arguments);\n \n var val = conversions[func](arg);\n if (typeof val == \"string\" || val === undefined)\n return val; // keyword\n\n for (var i = 0; i < val.length; i++)\n val[i] = Math.round(val[i]);\n return val;\n }\n })(func);\n}\n\n\n/* Converter does lazy conversion and caching */\nvar Converter = function() {\n this.convs = {};\n};\n\n/* Either get the values for a space or\n set the values for a space, depending on args */\nConverter.prototype.routeSpace = function(space, args) {\n var values = args[0];\n if (values === undefined) {\n // color.rgb()\n return this.getValues(space);\n }\n // color.rgb(10, 10, 10)\n if (typeof values == \"number\") {\n values = Array.prototype.slice.call(args); \n }\n\n return this.setValues(space, values);\n};\n \n/* Set the values for a space, invalidating cache */\nConverter.prototype.setValues = function(space, values) {\n this.space = space;\n this.convs = {};\n this.convs[space] = values;\n return this;\n};\n\n/* Get the values for a space. If there's already\n a conversion for the space, fetch it, otherwise\n compute it */\nConverter.prototype.getValues = function(space) {\n var vals = this.convs[space];\n if (!vals) {\n var fspace = this.space,\n from = this.convs[fspace];\n vals = convert[fspace][space](from);\n\n this.convs[space] = vals;\n }\n return vals;\n};\n\n[\"rgb\", \"hsl\", \"hsv\", \"cmyk\", \"keyword\"].forEach(function(space) {\n Converter.prototype[space] = function(vals) {\n return this.routeSpace(space, arguments);\n };\n});\n\nvar colorConvert = convert;\n\nvar colorName = {\r\n\t\"aliceblue\": [240, 248, 255],\r\n\t\"antiquewhite\": [250, 235, 215],\r\n\t\"aqua\": [0, 255, 255],\r\n\t\"aquamarine\": [127, 255, 212],\r\n\t\"azure\": [240, 255, 255],\r\n\t\"beige\": [245, 245, 220],\r\n\t\"bisque\": [255, 228, 196],\r\n\t\"black\": [0, 0, 0],\r\n\t\"blanchedalmond\": [255, 235, 205],\r\n\t\"blue\": [0, 0, 255],\r\n\t\"blueviolet\": [138, 43, 226],\r\n\t\"brown\": [165, 42, 42],\r\n\t\"burlywood\": [222, 184, 135],\r\n\t\"cadetblue\": [95, 158, 160],\r\n\t\"chartreuse\": [127, 255, 0],\r\n\t\"chocolate\": [210, 105, 30],\r\n\t\"coral\": [255, 127, 80],\r\n\t\"cornflowerblue\": [100, 149, 237],\r\n\t\"cornsilk\": [255, 248, 220],\r\n\t\"crimson\": [220, 20, 60],\r\n\t\"cyan\": [0, 255, 255],\r\n\t\"darkblue\": [0, 0, 139],\r\n\t\"darkcyan\": [0, 139, 139],\r\n\t\"darkgoldenrod\": [184, 134, 11],\r\n\t\"darkgray\": [169, 169, 169],\r\n\t\"darkgreen\": [0, 100, 0],\r\n\t\"darkgrey\": [169, 169, 169],\r\n\t\"darkkhaki\": [189, 183, 107],\r\n\t\"darkmagenta\": [139, 0, 139],\r\n\t\"darkolivegreen\": [85, 107, 47],\r\n\t\"darkorange\": [255, 140, 0],\r\n\t\"darkorchid\": [153, 50, 204],\r\n\t\"darkred\": [139, 0, 0],\r\n\t\"darksalmon\": [233, 150, 122],\r\n\t\"darkseagreen\": [143, 188, 143],\r\n\t\"darkslateblue\": [72, 61, 139],\r\n\t\"darkslategray\": [47, 79, 79],\r\n\t\"darkslategrey\": [47, 79, 79],\r\n\t\"darkturquoise\": [0, 206, 209],\r\n\t\"darkviolet\": [148, 0, 211],\r\n\t\"deeppink\": [255, 20, 147],\r\n\t\"deepskyblue\": [0, 191, 255],\r\n\t\"dimgray\": [105, 105, 105],\r\n\t\"dimgrey\": [105, 105, 105],\r\n\t\"dodgerblue\": [30, 144, 255],\r\n\t\"firebrick\": [178, 34, 34],\r\n\t\"floralwhite\": [255, 250, 240],\r\n\t\"forestgreen\": [34, 139, 34],\r\n\t\"fuchsia\": [255, 0, 255],\r\n\t\"gainsboro\": [220, 220, 220],\r\n\t\"ghostwhite\": [248, 248, 255],\r\n\t\"gold\": [255, 215, 0],\r\n\t\"goldenrod\": [218, 165, 32],\r\n\t\"gray\": [128, 128, 128],\r\n\t\"green\": [0, 128, 0],\r\n\t\"greenyellow\": [173, 255, 47],\r\n\t\"grey\": [128, 128, 128],\r\n\t\"honeydew\": [240, 255, 240],\r\n\t\"hotpink\": [255, 105, 180],\r\n\t\"indianred\": [205, 92, 92],\r\n\t\"indigo\": [75, 0, 130],\r\n\t\"ivory\": [255, 255, 240],\r\n\t\"khaki\": [240, 230, 140],\r\n\t\"lavender\": [230, 230, 250],\r\n\t\"lavenderblush\": [255, 240, 245],\r\n\t\"lawngreen\": [124, 252, 0],\r\n\t\"lemonchiffon\": [255, 250, 205],\r\n\t\"lightblue\": [173, 216, 230],\r\n\t\"lightcoral\": [240, 128, 128],\r\n\t\"lightcyan\": [224, 255, 255],\r\n\t\"lightgoldenrodyellow\": [250, 250, 210],\r\n\t\"lightgray\": [211, 211, 211],\r\n\t\"lightgreen\": [144, 238, 144],\r\n\t\"lightgrey\": [211, 211, 211],\r\n\t\"lightpink\": [255, 182, 193],\r\n\t\"lightsalmon\": [255, 160, 122],\r\n\t\"lightseagreen\": [32, 178, 170],\r\n\t\"lightskyblue\": [135, 206, 250],\r\n\t\"lightslategray\": [119, 136, 153],\r\n\t\"lightslategrey\": [119, 136, 153],\r\n\t\"lightsteelblue\": [176, 196, 222],\r\n\t\"lightyellow\": [255, 255, 224],\r\n\t\"lime\": [0, 255, 0],\r\n\t\"limegreen\": [50, 205, 50],\r\n\t\"linen\": [250, 240, 230],\r\n\t\"magenta\": [255, 0, 255],\r\n\t\"maroon\": [128, 0, 0],\r\n\t\"mediumaquamarine\": [102, 205, 170],\r\n\t\"mediumblue\": [0, 0, 205],\r\n\t\"mediumorchid\": [186, 85, 211],\r\n\t\"mediumpurple\": [147, 112, 219],\r\n\t\"mediumseagreen\": [60, 179, 113],\r\n\t\"mediumslateblue\": [123, 104, 238],\r\n\t\"mediumspringgreen\": [0, 250, 154],\r\n\t\"mediumturquoise\": [72, 209, 204],\r\n\t\"mediumvioletred\": [199, 21, 133],\r\n\t\"midnightblue\": [25, 25, 112],\r\n\t\"mintcream\": [245, 255, 250],\r\n\t\"mistyrose\": [255, 228, 225],\r\n\t\"moccasin\": [255, 228, 181],\r\n\t\"navajowhite\": [255, 222, 173],\r\n\t\"navy\": [0, 0, 128],\r\n\t\"oldlace\": [253, 245, 230],\r\n\t\"olive\": [128, 128, 0],\r\n\t\"olivedrab\": [107, 142, 35],\r\n\t\"orange\": [255, 165, 0],\r\n\t\"orangered\": [255, 69, 0],\r\n\t\"orchid\": [218, 112, 214],\r\n\t\"palegoldenrod\": [238, 232, 170],\r\n\t\"palegreen\": [152, 251, 152],\r\n\t\"paleturquoise\": [175, 238, 238],\r\n\t\"palevioletred\": [219, 112, 147],\r\n\t\"papayawhip\": [255, 239, 213],\r\n\t\"peachpuff\": [255, 218, 185],\r\n\t\"peru\": [205, 133, 63],\r\n\t\"pink\": [255, 192, 203],\r\n\t\"plum\": [221, 160, 221],\r\n\t\"powderblue\": [176, 224, 230],\r\n\t\"purple\": [128, 0, 128],\r\n\t\"rebeccapurple\": [102, 51, 153],\r\n\t\"red\": [255, 0, 0],\r\n\t\"rosybrown\": [188, 143, 143],\r\n\t\"royalblue\": [65, 105, 225],\r\n\t\"saddlebrown\": [139, 69, 19],\r\n\t\"salmon\": [250, 128, 114],\r\n\t\"sandybrown\": [244, 164, 96],\r\n\t\"seagreen\": [46, 139, 87],\r\n\t\"seashell\": [255, 245, 238],\r\n\t\"sienna\": [160, 82, 45],\r\n\t\"silver\": [192, 192, 192],\r\n\t\"skyblue\": [135, 206, 235],\r\n\t\"slateblue\": [106, 90, 205],\r\n\t\"slategray\": [112, 128, 144],\r\n\t\"slategrey\": [112, 128, 144],\r\n\t\"snow\": [255, 250, 250],\r\n\t\"springgreen\": [0, 255, 127],\r\n\t\"steelblue\": [70, 130, 180],\r\n\t\"tan\": [210, 180, 140],\r\n\t\"teal\": [0, 128, 128],\r\n\t\"thistle\": [216, 191, 216],\r\n\t\"tomato\": [255, 99, 71],\r\n\t\"turquoise\": [64, 224, 208],\r\n\t\"violet\": [238, 130, 238],\r\n\t\"wheat\": [245, 222, 179],\r\n\t\"white\": [255, 255, 255],\r\n\t\"whitesmoke\": [245, 245, 245],\r\n\t\"yellow\": [255, 255, 0],\r\n\t\"yellowgreen\": [154, 205, 50]\r\n};\n\n/* MIT license */\n\n\nvar colorString = {\n getRgba: getRgba,\n getHsla: getHsla,\n getRgb: getRgb,\n getHsl: getHsl,\n getHwb: getHwb,\n getAlpha: getAlpha,\n\n hexString: hexString,\n rgbString: rgbString,\n rgbaString: rgbaString,\n percentString: percentString,\n percentaString: percentaString,\n hslString: hslString,\n hslaString: hslaString,\n hwbString: hwbString,\n keyword: keyword\n};\n\nfunction getRgba(string) {\n if (!string) {\n return;\n }\n var abbr = /^#([a-fA-F0-9]{3,4})$/i,\n hex = /^#([a-fA-F0-9]{6}([a-fA-F0-9]{2})?)$/i,\n rgba = /^rgba?\\(\\s*([+-]?\\d+)\\s*,\\s*([+-]?\\d+)\\s*,\\s*([+-]?\\d+)\\s*(?:,\\s*([+-]?[\\d\\.]+)\\s*)?\\)$/i,\n per = /^rgba?\\(\\s*([+-]?[\\d\\.]+)\\%\\s*,\\s*([+-]?[\\d\\.]+)\\%\\s*,\\s*([+-]?[\\d\\.]+)\\%\\s*(?:,\\s*([+-]?[\\d\\.]+)\\s*)?\\)$/i,\n keyword = /(\\w+)/;\n\n var rgb = [0, 0, 0],\n a = 1,\n match = string.match(abbr),\n hexAlpha = \"\";\n if (match) {\n match = match[1];\n hexAlpha = match[3];\n for (var i = 0; i < rgb.length; i++) {\n rgb[i] = parseInt(match[i] + match[i], 16);\n }\n if (hexAlpha) {\n a = Math.round((parseInt(hexAlpha + hexAlpha, 16) / 255) * 100) / 100;\n }\n }\n else if (match = string.match(hex)) {\n hexAlpha = match[2];\n match = match[1];\n for (var i = 0; i < rgb.length; i++) {\n rgb[i] = parseInt(match.slice(i * 2, i * 2 + 2), 16);\n }\n if (hexAlpha) {\n a = Math.round((parseInt(hexAlpha, 16) / 255) * 100) / 100;\n }\n }\n else if (match = string.match(rgba)) {\n for (var i = 0; i < rgb.length; i++) {\n rgb[i] = parseInt(match[i + 1]);\n }\n a = parseFloat(match[4]);\n }\n else if (match = string.match(per)) {\n for (var i = 0; i < rgb.length; i++) {\n rgb[i] = Math.round(parseFloat(match[i + 1]) * 2.55);\n }\n a = parseFloat(match[4]);\n }\n else if (match = string.match(keyword)) {\n if (match[1] == \"transparent\") {\n return [0, 0, 0, 0];\n }\n rgb = colorName[match[1]];\n if (!rgb) {\n return;\n }\n }\n\n for (var i = 0; i < rgb.length; i++) {\n rgb[i] = scale(rgb[i], 0, 255);\n }\n if (!a && a != 0) {\n a = 1;\n }\n else {\n a = scale(a, 0, 1);\n }\n rgb[3] = a;\n return rgb;\n}\n\nfunction getHsla(string) {\n if (!string) {\n return;\n }\n var hsl = /^hsla?\\(\\s*([+-]?\\d+)(?:deg)?\\s*,\\s*([+-]?[\\d\\.]+)%\\s*,\\s*([+-]?[\\d\\.]+)%\\s*(?:,\\s*([+-]?[\\d\\.]+)\\s*)?\\)/;\n var match = string.match(hsl);\n if (match) {\n var alpha = parseFloat(match[4]);\n var h = scale(parseInt(match[1]), 0, 360),\n s = scale(parseFloat(match[2]), 0, 100),\n l = scale(parseFloat(match[3]), 0, 100),\n a = scale(isNaN(alpha) ? 1 : alpha, 0, 1);\n return [h, s, l, a];\n }\n}\n\nfunction getHwb(string) {\n if (!string) {\n return;\n }\n var hwb = /^hwb\\(\\s*([+-]?\\d+)(?:deg)?\\s*,\\s*([+-]?[\\d\\.]+)%\\s*,\\s*([+-]?[\\d\\.]+)%\\s*(?:,\\s*([+-]?[\\d\\.]+)\\s*)?\\)/;\n var match = string.match(hwb);\n if (match) {\n var alpha = parseFloat(match[4]);\n var h = scale(parseInt(match[1]), 0, 360),\n w = scale(parseFloat(match[2]), 0, 100),\n b = scale(parseFloat(match[3]), 0, 100),\n a = scale(isNaN(alpha) ? 1 : alpha, 0, 1);\n return [h, w, b, a];\n }\n}\n\nfunction getRgb(string) {\n var rgba = getRgba(string);\n return rgba && rgba.slice(0, 3);\n}\n\nfunction getHsl(string) {\n var hsla = getHsla(string);\n return hsla && hsla.slice(0, 3);\n}\n\nfunction getAlpha(string) {\n var vals = getRgba(string);\n if (vals) {\n return vals[3];\n }\n else if (vals = getHsla(string)) {\n return vals[3];\n }\n else if (vals = getHwb(string)) {\n return vals[3];\n }\n}\n\n// generators\nfunction hexString(rgba, a) {\n var a = (a !== undefined && rgba.length === 3) ? a : rgba[3];\n return \"#\" + hexDouble(rgba[0]) \n + hexDouble(rgba[1])\n + hexDouble(rgba[2])\n + (\n (a >= 0 && a < 1)\n ? hexDouble(Math.round(a * 255))\n : \"\"\n );\n}\n\nfunction rgbString(rgba, alpha) {\n if (alpha < 1 || (rgba[3] && rgba[3] < 1)) {\n return rgbaString(rgba, alpha);\n }\n return \"rgb(\" + rgba[0] + \", \" + rgba[1] + \", \" + rgba[2] + \")\";\n}\n\nfunction rgbaString(rgba, alpha) {\n if (alpha === undefined) {\n alpha = (rgba[3] !== undefined ? rgba[3] : 1);\n }\n return \"rgba(\" + rgba[0] + \", \" + rgba[1] + \", \" + rgba[2]\n + \", \" + alpha + \")\";\n}\n\nfunction percentString(rgba, alpha) {\n if (alpha < 1 || (rgba[3] && rgba[3] < 1)) {\n return percentaString(rgba, alpha);\n }\n var r = Math.round(rgba[0]/255 * 100),\n g = Math.round(rgba[1]/255 * 100),\n b = Math.round(rgba[2]/255 * 100);\n\n return \"rgb(\" + r + \"%, \" + g + \"%, \" + b + \"%)\";\n}\n\nfunction percentaString(rgba, alpha) {\n var r = Math.round(rgba[0]/255 * 100),\n g = Math.round(rgba[1]/255 * 100),\n b = Math.round(rgba[2]/255 * 100);\n return \"rgba(\" + r + \"%, \" + g + \"%, \" + b + \"%, \" + (alpha || rgba[3] || 1) + \")\";\n}\n\nfunction hslString(hsla, alpha) {\n if (alpha < 1 || (hsla[3] && hsla[3] < 1)) {\n return hslaString(hsla, alpha);\n }\n return \"hsl(\" + hsla[0] + \", \" + hsla[1] + \"%, \" + hsla[2] + \"%)\";\n}\n\nfunction hslaString(hsla, alpha) {\n if (alpha === undefined) {\n alpha = (hsla[3] !== undefined ? hsla[3] : 1);\n }\n return \"hsla(\" + hsla[0] + \", \" + hsla[1] + \"%, \" + hsla[2] + \"%, \"\n + alpha + \")\";\n}\n\n// hwb is a bit different than rgb(a) & hsl(a) since there is no alpha specific syntax\n// (hwb have alpha optional & 1 is default value)\nfunction hwbString(hwb, alpha) {\n if (alpha === undefined) {\n alpha = (hwb[3] !== undefined ? hwb[3] : 1);\n }\n return \"hwb(\" + hwb[0] + \", \" + hwb[1] + \"%, \" + hwb[2] + \"%\"\n + (alpha !== undefined && alpha !== 1 ? \", \" + alpha : \"\") + \")\";\n}\n\nfunction keyword(rgb) {\n return reverseNames[rgb.slice(0, 3)];\n}\n\n// helpers\nfunction scale(num, min, max) {\n return Math.min(Math.max(min, num), max);\n}\n\nfunction hexDouble(num) {\n var str = num.toString(16).toUpperCase();\n return (str.length < 2) ? \"0\" + str : str;\n}\n\n\n//create a list of reverse color names\nvar reverseNames = {};\nfor (var name in colorName) {\n reverseNames[colorName[name]] = name;\n}\n\n/* MIT license */\n\n\n\nvar Color = function (obj) {\n\tif (obj instanceof Color) {\n\t\treturn obj;\n\t}\n\tif (!(this instanceof Color)) {\n\t\treturn new Color(obj);\n\t}\n\n\tthis.valid = false;\n\tthis.values = {\n\t\trgb: [0, 0, 0],\n\t\thsl: [0, 0, 0],\n\t\thsv: [0, 0, 0],\n\t\thwb: [0, 0, 0],\n\t\tcmyk: [0, 0, 0, 0],\n\t\talpha: 1\n\t};\n\n\t// parse Color() argument\n\tvar vals;\n\tif (typeof obj === 'string') {\n\t\tvals = colorString.getRgba(obj);\n\t\tif (vals) {\n\t\t\tthis.setValues('rgb', vals);\n\t\t} else if (vals = colorString.getHsla(obj)) {\n\t\t\tthis.setValues('hsl', vals);\n\t\t} else if (vals = colorString.getHwb(obj)) {\n\t\t\tthis.setValues('hwb', vals);\n\t\t}\n\t} else if (typeof obj === 'object') {\n\t\tvals = obj;\n\t\tif (vals.r !== undefined || vals.red !== undefined) {\n\t\t\tthis.setValues('rgb', vals);\n\t\t} else if (vals.l !== undefined || vals.lightness !== undefined) {\n\t\t\tthis.setValues('hsl', vals);\n\t\t} else if (vals.v !== undefined || vals.value !== undefined) {\n\t\t\tthis.setValues('hsv', vals);\n\t\t} else if (vals.w !== undefined || vals.whiteness !== undefined) {\n\t\t\tthis.setValues('hwb', vals);\n\t\t} else if (vals.c !== undefined || vals.cyan !== undefined) {\n\t\t\tthis.setValues('cmyk', vals);\n\t\t}\n\t}\n};\n\nColor.prototype = {\n\tisValid: function () {\n\t\treturn this.valid;\n\t},\n\trgb: function () {\n\t\treturn this.setSpace('rgb', arguments);\n\t},\n\thsl: function () {\n\t\treturn this.setSpace('hsl', arguments);\n\t},\n\thsv: function () {\n\t\treturn this.setSpace('hsv', arguments);\n\t},\n\thwb: function () {\n\t\treturn this.setSpace('hwb', arguments);\n\t},\n\tcmyk: function () {\n\t\treturn this.setSpace('cmyk', arguments);\n\t},\n\n\trgbArray: function () {\n\t\treturn this.values.rgb;\n\t},\n\thslArray: function () {\n\t\treturn this.values.hsl;\n\t},\n\thsvArray: function () {\n\t\treturn this.values.hsv;\n\t},\n\thwbArray: function () {\n\t\tvar values = this.values;\n\t\tif (values.alpha !== 1) {\n\t\t\treturn values.hwb.concat([values.alpha]);\n\t\t}\n\t\treturn values.hwb;\n\t},\n\tcmykArray: function () {\n\t\treturn this.values.cmyk;\n\t},\n\trgbaArray: function () {\n\t\tvar values = this.values;\n\t\treturn values.rgb.concat([values.alpha]);\n\t},\n\thslaArray: function () {\n\t\tvar values = this.values;\n\t\treturn values.hsl.concat([values.alpha]);\n\t},\n\talpha: function (val) {\n\t\tif (val === undefined) {\n\t\t\treturn this.values.alpha;\n\t\t}\n\t\tthis.setValues('alpha', val);\n\t\treturn this;\n\t},\n\n\tred: function (val) {\n\t\treturn this.setChannel('rgb', 0, val);\n\t},\n\tgreen: function (val) {\n\t\treturn this.setChannel('rgb', 1, val);\n\t},\n\tblue: function (val) {\n\t\treturn this.setChannel('rgb', 2, val);\n\t},\n\thue: function (val) {\n\t\tif (val) {\n\t\t\tval %= 360;\n\t\t\tval = val < 0 ? 360 + val : val;\n\t\t}\n\t\treturn this.setChannel('hsl', 0, val);\n\t},\n\tsaturation: function (val) {\n\t\treturn this.setChannel('hsl', 1, val);\n\t},\n\tlightness: function (val) {\n\t\treturn this.setChannel('hsl', 2, val);\n\t},\n\tsaturationv: function (val) {\n\t\treturn this.setChannel('hsv', 1, val);\n\t},\n\twhiteness: function (val) {\n\t\treturn this.setChannel('hwb', 1, val);\n\t},\n\tblackness: function (val) {\n\t\treturn this.setChannel('hwb', 2, val);\n\t},\n\tvalue: function (val) {\n\t\treturn this.setChannel('hsv', 2, val);\n\t},\n\tcyan: function (val) {\n\t\treturn this.setChannel('cmyk', 0, val);\n\t},\n\tmagenta: function (val) {\n\t\treturn this.setChannel('cmyk', 1, val);\n\t},\n\tyellow: function (val) {\n\t\treturn this.setChannel('cmyk', 2, val);\n\t},\n\tblack: function (val) {\n\t\treturn this.setChannel('cmyk', 3, val);\n\t},\n\n\thexString: function () {\n\t\treturn colorString.hexString(this.values.rgb);\n\t},\n\trgbString: function () {\n\t\treturn colorString.rgbString(this.values.rgb, this.values.alpha);\n\t},\n\trgbaString: function () {\n\t\treturn colorString.rgbaString(this.values.rgb, this.values.alpha);\n\t},\n\tpercentString: function () {\n\t\treturn colorString.percentString(this.values.rgb, this.values.alpha);\n\t},\n\thslString: function () {\n\t\treturn colorString.hslString(this.values.hsl, this.values.alpha);\n\t},\n\thslaString: function () {\n\t\treturn colorString.hslaString(this.values.hsl, this.values.alpha);\n\t},\n\thwbString: function () {\n\t\treturn colorString.hwbString(this.values.hwb, this.values.alpha);\n\t},\n\tkeyword: function () {\n\t\treturn colorString.keyword(this.values.rgb, this.values.alpha);\n\t},\n\n\trgbNumber: function () {\n\t\tvar rgb = this.values.rgb;\n\t\treturn (rgb[0] << 16) | (rgb[1] << 8) | rgb[2];\n\t},\n\n\tluminosity: function () {\n\t\t// http://www.w3.org/TR/WCAG20/#relativeluminancedef\n\t\tvar rgb = this.values.rgb;\n\t\tvar lum = [];\n\t\tfor (var i = 0; i < rgb.length; i++) {\n\t\t\tvar chan = rgb[i] / 255;\n\t\t\tlum[i] = (chan <= 0.03928) ? chan / 12.92 : Math.pow(((chan + 0.055) / 1.055), 2.4);\n\t\t}\n\t\treturn 0.2126 * lum[0] + 0.7152 * lum[1] + 0.0722 * lum[2];\n\t},\n\n\tcontrast: function (color2) {\n\t\t// http://www.w3.org/TR/WCAG20/#contrast-ratiodef\n\t\tvar lum1 = this.luminosity();\n\t\tvar lum2 = color2.luminosity();\n\t\tif (lum1 > lum2) {\n\t\t\treturn (lum1 + 0.05) / (lum2 + 0.05);\n\t\t}\n\t\treturn (lum2 + 0.05) / (lum1 + 0.05);\n\t},\n\n\tlevel: function (color2) {\n\t\tvar contrastRatio = this.contrast(color2);\n\t\tif (contrastRatio >= 7.1) {\n\t\t\treturn 'AAA';\n\t\t}\n\n\t\treturn (contrastRatio >= 4.5) ? 'AA' : '';\n\t},\n\n\tdark: function () {\n\t\t// YIQ equation from http://24ways.org/2010/calculating-color-contrast\n\t\tvar rgb = this.values.rgb;\n\t\tvar yiq = (rgb[0] * 299 + rgb[1] * 587 + rgb[2] * 114) / 1000;\n\t\treturn yiq < 128;\n\t},\n\n\tlight: function () {\n\t\treturn !this.dark();\n\t},\n\n\tnegate: function () {\n\t\tvar rgb = [];\n\t\tfor (var i = 0; i < 3; i++) {\n\t\t\trgb[i] = 255 - this.values.rgb[i];\n\t\t}\n\t\tthis.setValues('rgb', rgb);\n\t\treturn this;\n\t},\n\n\tlighten: function (ratio) {\n\t\tvar hsl = this.values.hsl;\n\t\thsl[2] += hsl[2] * ratio;\n\t\tthis.setValues('hsl', hsl);\n\t\treturn this;\n\t},\n\n\tdarken: function (ratio) {\n\t\tvar hsl = this.values.hsl;\n\t\thsl[2] -= hsl[2] * ratio;\n\t\tthis.setValues('hsl', hsl);\n\t\treturn this;\n\t},\n\n\tsaturate: function (ratio) {\n\t\tvar hsl = this.values.hsl;\n\t\thsl[1] += hsl[1] * ratio;\n\t\tthis.setValues('hsl', hsl);\n\t\treturn this;\n\t},\n\n\tdesaturate: function (ratio) {\n\t\tvar hsl = this.values.hsl;\n\t\thsl[1] -= hsl[1] * ratio;\n\t\tthis.setValues('hsl', hsl);\n\t\treturn this;\n\t},\n\n\twhiten: function (ratio) {\n\t\tvar hwb = this.values.hwb;\n\t\thwb[1] += hwb[1] * ratio;\n\t\tthis.setValues('hwb', hwb);\n\t\treturn this;\n\t},\n\n\tblacken: function (ratio) {\n\t\tvar hwb = this.values.hwb;\n\t\thwb[2] += hwb[2] * ratio;\n\t\tthis.setValues('hwb', hwb);\n\t\treturn this;\n\t},\n\n\tgreyscale: function () {\n\t\tvar rgb = this.values.rgb;\n\t\t// http://en.wikipedia.org/wiki/Grayscale#Converting_color_to_grayscale\n\t\tvar val = rgb[0] * 0.3 + rgb[1] * 0.59 + rgb[2] * 0.11;\n\t\tthis.setValues('rgb', [val, val, val]);\n\t\treturn this;\n\t},\n\n\tclearer: function (ratio) {\n\t\tvar alpha = this.values.alpha;\n\t\tthis.setValues('alpha', alpha - (alpha * ratio));\n\t\treturn this;\n\t},\n\n\topaquer: function (ratio) {\n\t\tvar alpha = this.values.alpha;\n\t\tthis.setValues('alpha', alpha + (alpha * ratio));\n\t\treturn this;\n\t},\n\n\trotate: function (degrees) {\n\t\tvar hsl = this.values.hsl;\n\t\tvar hue = (hsl[0] + degrees) % 360;\n\t\thsl[0] = hue < 0 ? 360 + hue : hue;\n\t\tthis.setValues('hsl', hsl);\n\t\treturn this;\n\t},\n\n\t/**\n\t * Ported from sass implementation in C\n\t * https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209\n\t */\n\tmix: function (mixinColor, weight) {\n\t\tvar color1 = this;\n\t\tvar color2 = mixinColor;\n\t\tvar p = weight === undefined ? 0.5 : weight;\n\n\t\tvar w = 2 * p - 1;\n\t\tvar a = color1.alpha() - color2.alpha();\n\n\t\tvar w1 = (((w * a === -1) ? w : (w + a) / (1 + w * a)) + 1) / 2.0;\n\t\tvar w2 = 1 - w1;\n\n\t\treturn this\n\t\t\t.rgb(\n\t\t\t\tw1 * color1.red() + w2 * color2.red(),\n\t\t\t\tw1 * color1.green() + w2 * color2.green(),\n\t\t\t\tw1 * color1.blue() + w2 * color2.blue()\n\t\t\t)\n\t\t\t.alpha(color1.alpha() * p + color2.alpha() * (1 - p));\n\t},\n\n\ttoJSON: function () {\n\t\treturn this.rgb();\n\t},\n\n\tclone: function () {\n\t\t// NOTE(SB): using node-clone creates a dependency to Buffer when using browserify,\n\t\t// making the final build way to big to embed in Chart.js. So let's do it manually,\n\t\t// assuming that values to clone are 1 dimension arrays containing only numbers,\n\t\t// except 'alpha' which is a number.\n\t\tvar result = new Color();\n\t\tvar source = this.values;\n\t\tvar target = result.values;\n\t\tvar value, type;\n\n\t\tfor (var prop in source) {\n\t\t\tif (source.hasOwnProperty(prop)) {\n\t\t\t\tvalue = source[prop];\n\t\t\t\ttype = ({}).toString.call(value);\n\t\t\t\tif (type === '[object Array]') {\n\t\t\t\t\ttarget[prop] = value.slice(0);\n\t\t\t\t} else if (type === '[object Number]') {\n\t\t\t\t\ttarget[prop] = value;\n\t\t\t\t} else {\n\t\t\t\t\tconsole.error('unexpected color value:', value);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t}\n};\n\nColor.prototype.spaces = {\n\trgb: ['red', 'green', 'blue'],\n\thsl: ['hue', 'saturation', 'lightness'],\n\thsv: ['hue', 'saturation', 'value'],\n\thwb: ['hue', 'whiteness', 'blackness'],\n\tcmyk: ['cyan', 'magenta', 'yellow', 'black']\n};\n\nColor.prototype.maxes = {\n\trgb: [255, 255, 255],\n\thsl: [360, 100, 100],\n\thsv: [360, 100, 100],\n\thwb: [360, 100, 100],\n\tcmyk: [100, 100, 100, 100]\n};\n\nColor.prototype.getValues = function (space) {\n\tvar values = this.values;\n\tvar vals = {};\n\n\tfor (var i = 0; i < space.length; i++) {\n\t\tvals[space.charAt(i)] = values[space][i];\n\t}\n\n\tif (values.alpha !== 1) {\n\t\tvals.a = values.alpha;\n\t}\n\n\t// {r: 255, g: 255, b: 255, a: 0.4}\n\treturn vals;\n};\n\nColor.prototype.setValues = function (space, vals) {\n\tvar values = this.values;\n\tvar spaces = this.spaces;\n\tvar maxes = this.maxes;\n\tvar alpha = 1;\n\tvar i;\n\n\tthis.valid = true;\n\n\tif (space === 'alpha') {\n\t\talpha = vals;\n\t} else if (vals.length) {\n\t\t// [10, 10, 10]\n\t\tvalues[space] = vals.slice(0, space.length);\n\t\talpha = vals[space.length];\n\t} else if (vals[space.charAt(0)] !== undefined) {\n\t\t// {r: 10, g: 10, b: 10}\n\t\tfor (i = 0; i < space.length; i++) {\n\t\t\tvalues[space][i] = vals[space.charAt(i)];\n\t\t}\n\n\t\talpha = vals.a;\n\t} else if (vals[spaces[space][0]] !== undefined) {\n\t\t// {red: 10, green: 10, blue: 10}\n\t\tvar chans = spaces[space];\n\n\t\tfor (i = 0; i < space.length; i++) {\n\t\t\tvalues[space][i] = vals[chans[i]];\n\t\t}\n\n\t\talpha = vals.alpha;\n\t}\n\n\tvalues.alpha = Math.max(0, Math.min(1, (alpha === undefined ? values.alpha : alpha)));\n\n\tif (space === 'alpha') {\n\t\treturn false;\n\t}\n\n\tvar capped;\n\n\t// cap values of the space prior converting all values\n\tfor (i = 0; i < space.length; i++) {\n\t\tcapped = Math.max(0, Math.min(maxes[space][i], values[space][i]));\n\t\tvalues[space][i] = Math.round(capped);\n\t}\n\n\t// convert to all the other color spaces\n\tfor (var sname in spaces) {\n\t\tif (sname !== space) {\n\t\t\tvalues[sname] = colorConvert[space][sname](values[space]);\n\t\t}\n\t}\n\n\treturn true;\n};\n\nColor.prototype.setSpace = function (space, args) {\n\tvar vals = args[0];\n\n\tif (vals === undefined) {\n\t\t// color.rgb()\n\t\treturn this.getValues(space);\n\t}\n\n\t// color.rgb(10, 10, 10)\n\tif (typeof vals === 'number') {\n\t\tvals = Array.prototype.slice.call(args);\n\t}\n\n\tthis.setValues(space, vals);\n\treturn this;\n};\n\nColor.prototype.setChannel = function (space, index, val) {\n\tvar svalues = this.values[space];\n\tif (val === undefined) {\n\t\t// color.red()\n\t\treturn svalues[index];\n\t} else if (val === svalues[index]) {\n\t\t// color.red(color.red())\n\t\treturn this;\n\t}\n\n\t// color.red(100)\n\tsvalues[index] = val;\n\tthis.setValues(space, svalues);\n\n\treturn this;\n};\n\nif (typeof window !== 'undefined') {\n\twindow.Color = Color;\n}\n\nvar chartjsColor = Color;\n\n/**\n * @namespace Chart.helpers\n */\nvar helpers = {\n\t/**\n\t * An empty function that can be used, for example, for optional callback.\n\t */\n\tnoop: function() {},\n\n\t/**\n\t * Returns a unique id, sequentially generated from a global variable.\n\t * @returns {number}\n\t * @function\n\t */\n\tuid: (function() {\n\t\tvar id = 0;\n\t\treturn function() {\n\t\t\treturn id++;\n\t\t};\n\t}()),\n\n\t/**\n\t * Returns true if `value` is neither null nor undefined, else returns false.\n\t * @param {*} value - The value to test.\n\t * @returns {boolean}\n\t * @since 2.7.0\n\t */\n\tisNullOrUndef: function(value) {\n\t\treturn value === null || typeof value === 'undefined';\n\t},\n\n\t/**\n\t * Returns true if `value` is an array (including typed arrays), else returns false.\n\t * @param {*} value - The value to test.\n\t * @returns {boolean}\n\t * @function\n\t */\n\tisArray: function(value) {\n\t\tif (Array.isArray && Array.isArray(value)) {\n\t\t\treturn true;\n\t\t}\n\t\tvar type = Object.prototype.toString.call(value);\n\t\tif (type.substr(0, 7) === '[object' && type.substr(-6) === 'Array]') {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t},\n\n\t/**\n\t * Returns true if `value` is an object (excluding null), else returns false.\n\t * @param {*} value - The value to test.\n\t * @returns {boolean}\n\t * @since 2.7.0\n\t */\n\tisObject: function(value) {\n\t\treturn value !== null && Object.prototype.toString.call(value) === '[object Object]';\n\t},\n\n\t/**\n\t * Returns true if `value` is a finite number, else returns false\n\t * @param {*} value - The value to test.\n\t * @returns {boolean}\n\t */\n\tisFinite: function(value) {\n\t\treturn (typeof value === 'number' || value instanceof Number) && isFinite(value);\n\t},\n\n\t/**\n\t * Returns `value` if defined, else returns `defaultValue`.\n\t * @param {*} value - The value to return if defined.\n\t * @param {*} defaultValue - The value to return if `value` is undefined.\n\t * @returns {*}\n\t */\n\tvalueOrDefault: function(value, defaultValue) {\n\t\treturn typeof value === 'undefined' ? defaultValue : value;\n\t},\n\n\t/**\n\t * Returns value at the given `index` in array if defined, else returns `defaultValue`.\n\t * @param {Array} value - The array to lookup for value at `index`.\n\t * @param {number} index - The index in `value` to lookup for value.\n\t * @param {*} defaultValue - The value to return if `value[index]` is undefined.\n\t * @returns {*}\n\t */\n\tvalueAtIndexOrDefault: function(value, index, defaultValue) {\n\t\treturn helpers.valueOrDefault(helpers.isArray(value) ? value[index] : value, defaultValue);\n\t},\n\n\t/**\n\t * Calls `fn` with the given `args` in the scope defined by `thisArg` and returns the\n\t * value returned by `fn`. If `fn` is not a function, this method returns undefined.\n\t * @param {function} fn - The function to call.\n\t * @param {Array|undefined|null} args - The arguments with which `fn` should be called.\n\t * @param {object} [thisArg] - The value of `this` provided for the call to `fn`.\n\t * @returns {*}\n\t */\n\tcallback: function(fn, args, thisArg) {\n\t\tif (fn && typeof fn.call === 'function') {\n\t\t\treturn fn.apply(thisArg, args);\n\t\t}\n\t},\n\n\t/**\n\t * Note(SB) for performance sake, this method should only be used when loopable type\n\t * is unknown or in none intensive code (not called often and small loopable). Else\n\t * it's preferable to use a regular for() loop and save extra function calls.\n\t * @param {object|Array} loopable - The object or array to be iterated.\n\t * @param {function} fn - The function to call for each item.\n\t * @param {object} [thisArg] - The value of `this` provided for the call to `fn`.\n\t * @param {boolean} [reverse] - If true, iterates backward on the loopable.\n\t */\n\teach: function(loopable, fn, thisArg, reverse) {\n\t\tvar i, len, keys;\n\t\tif (helpers.isArray(loopable)) {\n\t\t\tlen = loopable.length;\n\t\t\tif (reverse) {\n\t\t\t\tfor (i = len - 1; i >= 0; i--) {\n\t\t\t\t\tfn.call(thisArg, loopable[i], i);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor (i = 0; i < len; i++) {\n\t\t\t\t\tfn.call(thisArg, loopable[i], i);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (helpers.isObject(loopable)) {\n\t\t\tkeys = Object.keys(loopable);\n\t\t\tlen = keys.length;\n\t\t\tfor (i = 0; i < len; i++) {\n\t\t\t\tfn.call(thisArg, loopable[keys[i]], keys[i]);\n\t\t\t}\n\t\t}\n\t},\n\n\t/**\n\t * Returns true if the `a0` and `a1` arrays have the same content, else returns false.\n\t * @see https://stackoverflow.com/a/14853974\n\t * @param {Array} a0 - The array to compare\n\t * @param {Array} a1 - The array to compare\n\t * @returns {boolean}\n\t */\n\tarrayEquals: function(a0, a1) {\n\t\tvar i, ilen, v0, v1;\n\n\t\tif (!a0 || !a1 || a0.length !== a1.length) {\n\t\t\treturn false;\n\t\t}\n\n\t\tfor (i = 0, ilen = a0.length; i < ilen; ++i) {\n\t\t\tv0 = a0[i];\n\t\t\tv1 = a1[i];\n\n\t\t\tif (v0 instanceof Array && v1 instanceof Array) {\n\t\t\t\tif (!helpers.arrayEquals(v0, v1)) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t} else if (v0 !== v1) {\n\t\t\t\t// NOTE: two different object instances will never be equal: {x:20} != {x:20}\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t},\n\n\t/**\n\t * Returns a deep copy of `source` without keeping references on objects and arrays.\n\t * @param {*} source - The value to clone.\n\t * @returns {*}\n\t */\n\tclone: function(source) {\n\t\tif (helpers.isArray(source)) {\n\t\t\treturn source.map(helpers.clone);\n\t\t}\n\n\t\tif (helpers.isObject(source)) {\n\t\t\tvar target = {};\n\t\t\tvar keys = Object.keys(source);\n\t\t\tvar klen = keys.length;\n\t\t\tvar k = 0;\n\n\t\t\tfor (; k < klen; ++k) {\n\t\t\t\ttarget[keys[k]] = helpers.clone(source[keys[k]]);\n\t\t\t}\n\n\t\t\treturn target;\n\t\t}\n\n\t\treturn source;\n\t},\n\n\t/**\n\t * The default merger when Chart.helpers.merge is called without merger option.\n\t * Note(SB): also used by mergeConfig and mergeScaleConfig as fallback.\n\t * @private\n\t */\n\t_merger: function(key, target, source, options) {\n\t\tvar tval = target[key];\n\t\tvar sval = source[key];\n\n\t\tif (helpers.isObject(tval) && helpers.isObject(sval)) {\n\t\t\thelpers.merge(tval, sval, options);\n\t\t} else {\n\t\t\ttarget[key] = helpers.clone(sval);\n\t\t}\n\t},\n\n\t/**\n\t * Merges source[key] in target[key] only if target[key] is undefined.\n\t * @private\n\t */\n\t_mergerIf: function(key, target, source) {\n\t\tvar tval = target[key];\n\t\tvar sval = source[key];\n\n\t\tif (helpers.isObject(tval) && helpers.isObject(sval)) {\n\t\t\thelpers.mergeIf(tval, sval);\n\t\t} else if (!target.hasOwnProperty(key)) {\n\t\t\ttarget[key] = helpers.clone(sval);\n\t\t}\n\t},\n\n\t/**\n\t * Recursively deep copies `source` properties into `target` with the given `options`.\n\t * IMPORTANT: `target` is not cloned and will be updated with `source` properties.\n\t * @param {object} target - The target object in which all sources are merged into.\n\t * @param {object|object[]} source - Object(s) to merge into `target`.\n\t * @param {object} [options] - Merging options:\n\t * @param {function} [options.merger] - The merge method (key, target, source, options)\n\t * @returns {object} The `target` object.\n\t */\n\tmerge: function(target, source, options) {\n\t\tvar sources = helpers.isArray(source) ? source : [source];\n\t\tvar ilen = sources.length;\n\t\tvar merge, i, keys, klen, k;\n\n\t\tif (!helpers.isObject(target)) {\n\t\t\treturn target;\n\t\t}\n\n\t\toptions = options || {};\n\t\tmerge = options.merger || helpers._merger;\n\n\t\tfor (i = 0; i < ilen; ++i) {\n\t\t\tsource = sources[i];\n\t\t\tif (!helpers.isObject(source)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tkeys = Object.keys(source);\n\t\t\tfor (k = 0, klen = keys.length; k < klen; ++k) {\n\t\t\t\tmerge(keys[k], target, source, options);\n\t\t\t}\n\t\t}\n\n\t\treturn target;\n\t},\n\n\t/**\n\t * Recursively deep copies `source` properties into `target` *only* if not defined in target.\n\t * IMPORTANT: `target` is not cloned and will be updated with `source` properties.\n\t * @param {object} target - The target object in which all sources are merged into.\n\t * @param {object|object[]} source - Object(s) to merge into `target`.\n\t * @returns {object} The `target` object.\n\t */\n\tmergeIf: function(target, source) {\n\t\treturn helpers.merge(target, source, {merger: helpers._mergerIf});\n\t},\n\n\t/**\n\t * Applies the contents of two or more objects together into the first object.\n\t * @param {object} target - The target object in which all objects are merged into.\n\t * @param {object} arg1 - Object containing additional properties to merge in target.\n\t * @param {object} argN - Additional objects containing properties to merge in target.\n\t * @returns {object} The `target` object.\n\t */\n\textend: function(target) {\n\t\tvar setFn = function(value, key) {\n\t\t\ttarget[key] = value;\n\t\t};\n\t\tfor (var i = 1, ilen = arguments.length; i < ilen; ++i) {\n\t\t\thelpers.each(arguments[i], setFn);\n\t\t}\n\t\treturn target;\n\t},\n\n\t/**\n\t * Basic javascript inheritance based on the model created in Backbone.js\n\t */\n\tinherits: function(extensions) {\n\t\tvar me = this;\n\t\tvar ChartElement = (extensions && extensions.hasOwnProperty('constructor')) ? extensions.constructor : function() {\n\t\t\treturn me.apply(this, arguments);\n\t\t};\n\n\t\tvar Surrogate = function() {\n\t\t\tthis.constructor = ChartElement;\n\t\t};\n\n\t\tSurrogate.prototype = me.prototype;\n\t\tChartElement.prototype = new Surrogate();\n\t\tChartElement.extend = helpers.inherits;\n\n\t\tif (extensions) {\n\t\t\thelpers.extend(ChartElement.prototype, extensions);\n\t\t}\n\n\t\tChartElement.__super__ = me.prototype;\n\t\treturn ChartElement;\n\t}\n};\n\nvar helpers_core = helpers;\n\n// DEPRECATIONS\n\n/**\n * Provided for backward compatibility, use Chart.helpers.callback instead.\n * @function Chart.helpers.callCallback\n * @deprecated since version 2.6.0\n * @todo remove at version 3\n * @private\n */\nhelpers.callCallback = helpers.callback;\n\n/**\n * Provided for backward compatibility, use Array.prototype.indexOf instead.\n * Array.prototype.indexOf compatibility: Chrome, Opera, Safari, FF1.5+, IE9+\n * @function Chart.helpers.indexOf\n * @deprecated since version 2.7.0\n * @todo remove at version 3\n * @private\n */\nhelpers.indexOf = function(array, item, fromIndex) {\n\treturn Array.prototype.indexOf.call(array, item, fromIndex);\n};\n\n/**\n * Provided for backward compatibility, use Chart.helpers.valueOrDefault instead.\n * @function Chart.helpers.getValueOrDefault\n * @deprecated since version 2.7.0\n * @todo remove at version 3\n * @private\n */\nhelpers.getValueOrDefault = helpers.valueOrDefault;\n\n/**\n * Provided for backward compatibility, use Chart.helpers.valueAtIndexOrDefault instead.\n * @function Chart.helpers.getValueAtIndexOrDefault\n * @deprecated since version 2.7.0\n * @todo remove at version 3\n * @private\n */\nhelpers.getValueAtIndexOrDefault = helpers.valueAtIndexOrDefault;\n\n/**\n * Easing functions adapted from Robert Penner's easing equations.\n * @namespace Chart.helpers.easingEffects\n * @see http://www.robertpenner.com/easing/\n */\nvar effects = {\n\tlinear: function(t) {\n\t\treturn t;\n\t},\n\n\teaseInQuad: function(t) {\n\t\treturn t * t;\n\t},\n\n\teaseOutQuad: function(t) {\n\t\treturn -t * (t - 2);\n\t},\n\n\teaseInOutQuad: function(t) {\n\t\tif ((t /= 0.5) < 1) {\n\t\t\treturn 0.5 * t * t;\n\t\t}\n\t\treturn -0.5 * ((--t) * (t - 2) - 1);\n\t},\n\n\teaseInCubic: function(t) {\n\t\treturn t * t * t;\n\t},\n\n\teaseOutCubic: function(t) {\n\t\treturn (t = t - 1) * t * t + 1;\n\t},\n\n\teaseInOutCubic: function(t) {\n\t\tif ((t /= 0.5) < 1) {\n\t\t\treturn 0.5 * t * t * t;\n\t\t}\n\t\treturn 0.5 * ((t -= 2) * t * t + 2);\n\t},\n\n\teaseInQuart: function(t) {\n\t\treturn t * t * t * t;\n\t},\n\n\teaseOutQuart: function(t) {\n\t\treturn -((t = t - 1) * t * t * t - 1);\n\t},\n\n\teaseInOutQuart: function(t) {\n\t\tif ((t /= 0.5) < 1) {\n\t\t\treturn 0.5 * t * t * t * t;\n\t\t}\n\t\treturn -0.5 * ((t -= 2) * t * t * t - 2);\n\t},\n\n\teaseInQuint: function(t) {\n\t\treturn t * t * t * t * t;\n\t},\n\n\teaseOutQuint: function(t) {\n\t\treturn (t = t - 1) * t * t * t * t + 1;\n\t},\n\n\teaseInOutQuint: function(t) {\n\t\tif ((t /= 0.5) < 1) {\n\t\t\treturn 0.5 * t * t * t * t * t;\n\t\t}\n\t\treturn 0.5 * ((t -= 2) * t * t * t * t + 2);\n\t},\n\n\teaseInSine: function(t) {\n\t\treturn -Math.cos(t * (Math.PI / 2)) + 1;\n\t},\n\n\teaseOutSine: function(t) {\n\t\treturn Math.sin(t * (Math.PI / 2));\n\t},\n\n\teaseInOutSine: function(t) {\n\t\treturn -0.5 * (Math.cos(Math.PI * t) - 1);\n\t},\n\n\teaseInExpo: function(t) {\n\t\treturn (t === 0) ? 0 : Math.pow(2, 10 * (t - 1));\n\t},\n\n\teaseOutExpo: function(t) {\n\t\treturn (t === 1) ? 1 : -Math.pow(2, -10 * t) + 1;\n\t},\n\n\teaseInOutExpo: function(t) {\n\t\tif (t === 0) {\n\t\t\treturn 0;\n\t\t}\n\t\tif (t === 1) {\n\t\t\treturn 1;\n\t\t}\n\t\tif ((t /= 0.5) < 1) {\n\t\t\treturn 0.5 * Math.pow(2, 10 * (t - 1));\n\t\t}\n\t\treturn 0.5 * (-Math.pow(2, -10 * --t) + 2);\n\t},\n\n\teaseInCirc: function(t) {\n\t\tif (t >= 1) {\n\t\t\treturn t;\n\t\t}\n\t\treturn -(Math.sqrt(1 - t * t) - 1);\n\t},\n\n\teaseOutCirc: function(t) {\n\t\treturn Math.sqrt(1 - (t = t - 1) * t);\n\t},\n\n\teaseInOutCirc: function(t) {\n\t\tif ((t /= 0.5) < 1) {\n\t\t\treturn -0.5 * (Math.sqrt(1 - t * t) - 1);\n\t\t}\n\t\treturn 0.5 * (Math.sqrt(1 - (t -= 2) * t) + 1);\n\t},\n\n\teaseInElastic: function(t) {\n\t\tvar s = 1.70158;\n\t\tvar p = 0;\n\t\tvar a = 1;\n\t\tif (t === 0) {\n\t\t\treturn 0;\n\t\t}\n\t\tif (t === 1) {\n\t\t\treturn 1;\n\t\t}\n\t\tif (!p) {\n\t\t\tp = 0.3;\n\t\t}\n\t\tif (a < 1) {\n\t\t\ta = 1;\n\t\t\ts = p / 4;\n\t\t} else {\n\t\t\ts = p / (2 * Math.PI) * Math.asin(1 / a);\n\t\t}\n\t\treturn -(a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t - s) * (2 * Math.PI) / p));\n\t},\n\n\teaseOutElastic: function(t) {\n\t\tvar s = 1.70158;\n\t\tvar p = 0;\n\t\tvar a = 1;\n\t\tif (t === 0) {\n\t\t\treturn 0;\n\t\t}\n\t\tif (t === 1) {\n\t\t\treturn 1;\n\t\t}\n\t\tif (!p) {\n\t\t\tp = 0.3;\n\t\t}\n\t\tif (a < 1) {\n\t\t\ta = 1;\n\t\t\ts = p / 4;\n\t\t} else {\n\t\t\ts = p / (2 * Math.PI) * Math.asin(1 / a);\n\t\t}\n\t\treturn a * Math.pow(2, -10 * t) * Math.sin((t - s) * (2 * Math.PI) / p) + 1;\n\t},\n\n\teaseInOutElastic: function(t) {\n\t\tvar s = 1.70158;\n\t\tvar p = 0;\n\t\tvar a = 1;\n\t\tif (t === 0) {\n\t\t\treturn 0;\n\t\t}\n\t\tif ((t /= 0.5) === 2) {\n\t\t\treturn 1;\n\t\t}\n\t\tif (!p) {\n\t\t\tp = 0.45;\n\t\t}\n\t\tif (a < 1) {\n\t\t\ta = 1;\n\t\t\ts = p / 4;\n\t\t} else {\n\t\t\ts = p / (2 * Math.PI) * Math.asin(1 / a);\n\t\t}\n\t\tif (t < 1) {\n\t\t\treturn -0.5 * (a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t - s) * (2 * Math.PI) / p));\n\t\t}\n\t\treturn a * Math.pow(2, -10 * (t -= 1)) * Math.sin((t - s) * (2 * Math.PI) / p) * 0.5 + 1;\n\t},\n\teaseInBack: function(t) {\n\t\tvar s = 1.70158;\n\t\treturn t * t * ((s + 1) * t - s);\n\t},\n\n\teaseOutBack: function(t) {\n\t\tvar s = 1.70158;\n\t\treturn (t = t - 1) * t * ((s + 1) * t + s) + 1;\n\t},\n\n\teaseInOutBack: function(t) {\n\t\tvar s = 1.70158;\n\t\tif ((t /= 0.5) < 1) {\n\t\t\treturn 0.5 * (t * t * (((s *= (1.525)) + 1) * t - s));\n\t\t}\n\t\treturn 0.5 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2);\n\t},\n\n\teaseInBounce: function(t) {\n\t\treturn 1 - effects.easeOutBounce(1 - t);\n\t},\n\n\teaseOutBounce: function(t) {\n\t\tif (t < (1 / 2.75)) {\n\t\t\treturn 7.5625 * t * t;\n\t\t}\n\t\tif (t < (2 / 2.75)) {\n\t\t\treturn 7.5625 * (t -= (1.5 / 2.75)) * t + 0.75;\n\t\t}\n\t\tif (t < (2.5 / 2.75)) {\n\t\t\treturn 7.5625 * (t -= (2.25 / 2.75)) * t + 0.9375;\n\t\t}\n\t\treturn 7.5625 * (t -= (2.625 / 2.75)) * t + 0.984375;\n\t},\n\n\teaseInOutBounce: function(t) {\n\t\tif (t < 0.5) {\n\t\t\treturn effects.easeInBounce(t * 2) * 0.5;\n\t\t}\n\t\treturn effects.easeOutBounce(t * 2 - 1) * 0.5 + 0.5;\n\t}\n};\n\nvar helpers_easing = {\n\teffects: effects\n};\n\n// DEPRECATIONS\n\n/**\n * Provided for backward compatibility, use Chart.helpers.easing.effects instead.\n * @function Chart.helpers.easingEffects\n * @deprecated since version 2.7.0\n * @todo remove at version 3\n * @private\n */\nhelpers_core.easingEffects = effects;\n\nvar PI = Math.PI;\nvar RAD_PER_DEG = PI / 180;\nvar DOUBLE_PI = PI * 2;\nvar HALF_PI = PI / 2;\nvar QUARTER_PI = PI / 4;\nvar TWO_THIRDS_PI = PI * 2 / 3;\n\n/**\n * @namespace Chart.helpers.canvas\n */\nvar exports$1 = {\n\t/**\n\t * Clears the entire canvas associated to the given `chart`.\n\t * @param {Chart} chart - The chart for which to clear the canvas.\n\t */\n\tclear: function(chart) {\n\t\tchart.ctx.clearRect(0, 0, chart.width, chart.height);\n\t},\n\n\t/**\n\t * Creates a \"path\" for a rectangle with rounded corners at position (x, y) with a\n\t * given size (width, height) and the same `radius` for all corners.\n\t * @param {CanvasRenderingContext2D} ctx - The canvas 2D Context.\n\t * @param {number} x - The x axis of the coordinate for the rectangle starting point.\n\t * @param {number} y - The y axis of the coordinate for the rectangle starting point.\n\t * @param {number} width - The rectangle's width.\n\t * @param {number} height - The rectangle's height.\n\t * @param {number} radius - The rounded amount (in pixels) for the four corners.\n\t * @todo handle `radius` as top-left, top-right, bottom-right, bottom-left array/object?\n\t */\n\troundedRect: function(ctx, x, y, width, height, radius) {\n\t\tif (radius) {\n\t\t\tvar r = Math.min(radius, height / 2, width / 2);\n\t\t\tvar left = x + r;\n\t\t\tvar top = y + r;\n\t\t\tvar right = x + width - r;\n\t\t\tvar bottom = y + height - r;\n\n\t\t\tctx.moveTo(x, top);\n\t\t\tif (left < right && top < bottom) {\n\t\t\t\tctx.arc(left, top, r, -PI, -HALF_PI);\n\t\t\t\tctx.arc(right, top, r, -HALF_PI, 0);\n\t\t\t\tctx.arc(right, bottom, r, 0, HALF_PI);\n\t\t\t\tctx.arc(left, bottom, r, HALF_PI, PI);\n\t\t\t} else if (left < right) {\n\t\t\t\tctx.moveTo(left, y);\n\t\t\t\tctx.arc(right, top, r, -HALF_PI, HALF_PI);\n\t\t\t\tctx.arc(left, top, r, HALF_PI, PI + HALF_PI);\n\t\t\t} else if (top < bottom) {\n\t\t\t\tctx.arc(left, top, r, -PI, 0);\n\t\t\t\tctx.arc(left, bottom, r, 0, PI);\n\t\t\t} else {\n\t\t\t\tctx.arc(left, top, r, -PI, PI);\n\t\t\t}\n\t\t\tctx.closePath();\n\t\t\tctx.moveTo(x, y);\n\t\t} else {\n\t\t\tctx.rect(x, y, width, height);\n\t\t}\n\t},\n\n\tdrawPoint: function(ctx, style, radius, x, y, rotation) {\n\t\tvar type, xOffset, yOffset, size, cornerRadius;\n\t\tvar rad = (rotation || 0) * RAD_PER_DEG;\n\n\t\tif (style && typeof style === 'object') {\n\t\t\ttype = style.toString();\n\t\t\tif (type === '[object HTMLImageElement]' || type === '[object HTMLCanvasElement]') {\n\t\t\t\tctx.drawImage(style, x - style.width / 2, y - style.height / 2, style.width, style.height);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tif (isNaN(radius) || radius <= 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tctx.beginPath();\n\n\t\tswitch (style) {\n\t\t// Default includes circle\n\t\tdefault:\n\t\t\tctx.arc(x, y, radius, 0, DOUBLE_PI);\n\t\t\tctx.closePath();\n\t\t\tbreak;\n\t\tcase 'triangle':\n\t\t\tctx.moveTo(x + Math.sin(rad) * radius, y - Math.cos(rad) * radius);\n\t\t\trad += TWO_THIRDS_PI;\n\t\t\tctx.lineTo(x + Math.sin(rad) * radius, y - Math.cos(rad) * radius);\n\t\t\trad += TWO_THIRDS_PI;\n\t\t\tctx.lineTo(x + Math.sin(rad) * radius, y - Math.cos(rad) * radius);\n\t\t\tctx.closePath();\n\t\t\tbreak;\n\t\tcase 'rectRounded':\n\t\t\t// NOTE: the rounded rect implementation changed to use `arc` instead of\n\t\t\t// `quadraticCurveTo` since it generates better results when rect is\n\t\t\t// almost a circle. 0.516 (instead of 0.5) produces results with visually\n\t\t\t// closer proportion to the previous impl and it is inscribed in the\n\t\t\t// circle with `radius`. For more details, see the following PRs:\n\t\t\t// https://github.com/chartjs/Chart.js/issues/5597\n\t\t\t// https://github.com/chartjs/Chart.js/issues/5858\n\t\t\tcornerRadius = radius * 0.516;\n\t\t\tsize = radius - cornerRadius;\n\t\t\txOffset = Math.cos(rad + QUARTER_PI) * size;\n\t\t\tyOffset = Math.sin(rad + QUARTER_PI) * size;\n\t\t\tctx.arc(x - xOffset, y - yOffset, cornerRadius, rad - PI, rad - HALF_PI);\n\t\t\tctx.arc(x + yOffset, y - xOffset, cornerRadius, rad - HALF_PI, rad);\n\t\t\tctx.arc(x + xOffset, y + yOffset, cornerRadius, rad, rad + HALF_PI);\n\t\t\tctx.arc(x - yOffset, y + xOffset, cornerRadius, rad + HALF_PI, rad + PI);\n\t\t\tctx.closePath();\n\t\t\tbreak;\n\t\tcase 'rect':\n\t\t\tif (!rotation) {\n\t\t\t\tsize = Math.SQRT1_2 * radius;\n\t\t\t\tctx.rect(x - size, y - size, 2 * size, 2 * size);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\trad += QUARTER_PI;\n\t\t\t/* falls through */\n\t\tcase 'rectRot':\n\t\t\txOffset = Math.cos(rad) * radius;\n\t\t\tyOffset = Math.sin(rad) * radius;\n\t\t\tctx.moveTo(x - xOffset, y - yOffset);\n\t\t\tctx.lineTo(x + yOffset, y - xOffset);\n\t\t\tctx.lineTo(x + xOffset, y + yOffset);\n\t\t\tctx.lineTo(x - yOffset, y + xOffset);\n\t\t\tctx.closePath();\n\t\t\tbreak;\n\t\tcase 'crossRot':\n\t\t\trad += QUARTER_PI;\n\t\t\t/* falls through */\n\t\tcase 'cross':\n\t\t\txOffset = Math.cos(rad) * radius;\n\t\t\tyOffset = Math.sin(rad) * radius;\n\t\t\tctx.moveTo(x - xOffset, y - yOffset);\n\t\t\tctx.lineTo(x + xOffset, y + yOffset);\n\t\t\tctx.moveTo(x + yOffset, y - xOffset);\n\t\t\tctx.lineTo(x - yOffset, y + xOffset);\n\t\t\tbreak;\n\t\tcase 'star':\n\t\t\txOffset = Math.cos(rad) * radius;\n\t\t\tyOffset = Math.sin(rad) * radius;\n\t\t\tctx.moveTo(x - xOffset, y - yOffset);\n\t\t\tctx.lineTo(x + xOffset, y + yOffset);\n\t\t\tctx.moveTo(x + yOffset, y - xOffset);\n\t\t\tctx.lineTo(x - yOffset, y + xOffset);\n\t\t\trad += QUARTER_PI;\n\t\t\txOffset = Math.cos(rad) * radius;\n\t\t\tyOffset = Math.sin(rad) * radius;\n\t\t\tctx.moveTo(x - xOffset, y - yOffset);\n\t\t\tctx.lineTo(x + xOffset, y + yOffset);\n\t\t\tctx.moveTo(x + yOffset, y - xOffset);\n\t\t\tctx.lineTo(x - yOffset, y + xOffset);\n\t\t\tbreak;\n\t\tcase 'line':\n\t\t\txOffset = Math.cos(rad) * radius;\n\t\t\tyOffset = Math.sin(rad) * radius;\n\t\t\tctx.moveTo(x - xOffset, y - yOffset);\n\t\t\tctx.lineTo(x + xOffset, y + yOffset);\n\t\t\tbreak;\n\t\tcase 'dash':\n\t\t\tctx.moveTo(x, y);\n\t\t\tctx.lineTo(x + Math.cos(rad) * radius, y + Math.sin(rad) * radius);\n\t\t\tbreak;\n\t\t}\n\n\t\tctx.fill();\n\t\tctx.stroke();\n\t},\n\n\t/**\n\t * Returns true if the point is inside the rectangle\n\t * @param {object} point - The point to test\n\t * @param {object} area - The rectangle\n\t * @returns {boolean}\n\t * @private\n\t */\n\t_isPointInArea: function(point, area) {\n\t\tvar epsilon = 1e-6; // 1e-6 is margin in pixels for accumulated error.\n\n\t\treturn point.x > area.left - epsilon && point.x < area.right + epsilon &&\n\t\t\tpoint.y > area.top - epsilon && point.y < area.bottom + epsilon;\n\t},\n\n\tclipArea: function(ctx, area) {\n\t\tctx.save();\n\t\tctx.beginPath();\n\t\tctx.rect(area.left, area.top, area.right - area.left, area.bottom - area.top);\n\t\tctx.clip();\n\t},\n\n\tunclipArea: function(ctx) {\n\t\tctx.restore();\n\t},\n\n\tlineTo: function(ctx, previous, target, flip) {\n\t\tvar stepped = target.steppedLine;\n\t\tif (stepped) {\n\t\t\tif (stepped === 'middle') {\n\t\t\t\tvar midpoint = (previous.x + target.x) / 2.0;\n\t\t\t\tctx.lineTo(midpoint, flip ? target.y : previous.y);\n\t\t\t\tctx.lineTo(midpoint, flip ? previous.y : target.y);\n\t\t\t} else if ((stepped === 'after' && !flip) || (stepped !== 'after' && flip)) {\n\t\t\t\tctx.lineTo(previous.x, target.y);\n\t\t\t} else {\n\t\t\t\tctx.lineTo(target.x, previous.y);\n\t\t\t}\n\t\t\tctx.lineTo(target.x, target.y);\n\t\t\treturn;\n\t\t}\n\n\t\tif (!target.tension) {\n\t\t\tctx.lineTo(target.x, target.y);\n\t\t\treturn;\n\t\t}\n\n\t\tctx.bezierCurveTo(\n\t\t\tflip ? previous.controlPointPreviousX : previous.controlPointNextX,\n\t\t\tflip ? previous.controlPointPreviousY : previous.controlPointNextY,\n\t\t\tflip ? target.controlPointNextX : target.controlPointPreviousX,\n\t\t\tflip ? target.controlPointNextY : target.controlPointPreviousY,\n\t\t\ttarget.x,\n\t\t\ttarget.y);\n\t}\n};\n\nvar helpers_canvas = exports$1;\n\n// DEPRECATIONS\n\n/**\n * Provided for backward compatibility, use Chart.helpers.canvas.clear instead.\n * @namespace Chart.helpers.clear\n * @deprecated since version 2.7.0\n * @todo remove at version 3\n * @private\n */\nhelpers_core.clear = exports$1.clear;\n\n/**\n * Provided for backward compatibility, use Chart.helpers.canvas.roundedRect instead.\n * @namespace Chart.helpers.drawRoundedRectangle\n * @deprecated since version 2.7.0\n * @todo remove at version 3\n * @private\n */\nhelpers_core.drawRoundedRectangle = function(ctx) {\n\tctx.beginPath();\n\texports$1.roundedRect.apply(exports$1, arguments);\n};\n\nvar defaults = {\n\t/**\n\t * @private\n\t */\n\t_set: function(scope, values) {\n\t\treturn helpers_core.merge(this[scope] || (this[scope] = {}), values);\n\t}\n};\n\ndefaults._set('global', {\n\tdefaultColor: 'rgba(0,0,0,0.1)',\n\tdefaultFontColor: '#666',\n\tdefaultFontFamily: \"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif\",\n\tdefaultFontSize: 12,\n\tdefaultFontStyle: 'normal',\n\tdefaultLineHeight: 1.2,\n\tshowLines: true\n});\n\nvar core_defaults = defaults;\n\nvar valueOrDefault = helpers_core.valueOrDefault;\n\n/**\n * Converts the given font object into a CSS font string.\n * @param {object} font - A font object.\n * @return {string} The CSS font string. See https://developer.mozilla.org/en-US/docs/Web/CSS/font\n * @private\n */\nfunction toFontString(font) {\n\tif (!font || helpers_core.isNullOrUndef(font.size) || helpers_core.isNullOrUndef(font.family)) {\n\t\treturn null;\n\t}\n\n\treturn (font.style ? font.style + ' ' : '')\n\t\t+ (font.weight ? font.weight + ' ' : '')\n\t\t+ font.size + 'px '\n\t\t+ font.family;\n}\n\n/**\n * @alias Chart.helpers.options\n * @namespace\n */\nvar helpers_options = {\n\t/**\n\t * Converts the given line height `value` in pixels for a specific font `size`.\n\t * @param {number|string} value - The lineHeight to parse (eg. 1.6, '14px', '75%', '1.6em').\n\t * @param {number} size - The font size (in pixels) used to resolve relative `value`.\n\t * @returns {number} The effective line height in pixels (size * 1.2 if value is invalid).\n\t * @see https://developer.mozilla.org/en-US/docs/Web/CSS/line-height\n\t * @since 2.7.0\n\t */\n\ttoLineHeight: function(value, size) {\n\t\tvar matches = ('' + value).match(/^(normal|(\\d+(?:\\.\\d+)?)(px|em|%)?)$/);\n\t\tif (!matches || matches[1] === 'normal') {\n\t\t\treturn size * 1.2;\n\t\t}\n\n\t\tvalue = +matches[2];\n\n\t\tswitch (matches[3]) {\n\t\tcase 'px':\n\t\t\treturn value;\n\t\tcase '%':\n\t\t\tvalue /= 100;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\n\t\treturn size * value;\n\t},\n\n\t/**\n\t * Converts the given value into a padding object with pre-computed width/height.\n\t * @param {number|object} value - If a number, set the value to all TRBL component,\n\t * else, if and object, use defined properties and sets undefined ones to 0.\n\t * @returns {object} The padding values (top, right, bottom, left, width, height)\n\t * @since 2.7.0\n\t */\n\ttoPadding: function(value) {\n\t\tvar t, r, b, l;\n\n\t\tif (helpers_core.isObject(value)) {\n\t\t\tt = +value.top || 0;\n\t\t\tr = +value.right || 0;\n\t\t\tb = +value.bottom || 0;\n\t\t\tl = +value.left || 0;\n\t\t} else {\n\t\t\tt = r = b = l = +value || 0;\n\t\t}\n\n\t\treturn {\n\t\t\ttop: t,\n\t\t\tright: r,\n\t\t\tbottom: b,\n\t\t\tleft: l,\n\t\t\theight: t + b,\n\t\t\twidth: l + r\n\t\t};\n\t},\n\n\t/**\n\t * Parses font options and returns the font object.\n\t * @param {object} options - A object that contains font options to be parsed.\n\t * @return {object} The font object.\n\t * @todo Support font.* options and renamed to toFont().\n\t * @private\n\t */\n\t_parseFont: function(options) {\n\t\tvar globalDefaults = core_defaults.global;\n\t\tvar size = valueOrDefault(options.fontSize, globalDefaults.defaultFontSize);\n\t\tvar font = {\n\t\t\tfamily: valueOrDefault(options.fontFamily, globalDefaults.defaultFontFamily),\n\t\t\tlineHeight: helpers_core.options.toLineHeight(valueOrDefault(options.lineHeight, globalDefaults.defaultLineHeight), size),\n\t\t\tsize: size,\n\t\t\tstyle: valueOrDefault(options.fontStyle, globalDefaults.defaultFontStyle),\n\t\t\tweight: null,\n\t\t\tstring: ''\n\t\t};\n\n\t\tfont.string = toFontString(font);\n\t\treturn font;\n\t},\n\n\t/**\n\t * Evaluates the given `inputs` sequentially and returns the first defined value.\n\t * @param {Array} inputs - An array of values, falling back to the last value.\n\t * @param {object} [context] - If defined and the current value is a function, the value\n\t * is called with `context` as first argument and the result becomes the new input.\n\t * @param {number} [index] - If defined and the current value is an array, the value\n\t * at `index` become the new input.\n\t * @since 2.7.0\n\t */\n\tresolve: function(inputs, context, index) {\n\t\tvar i, ilen, value;\n\n\t\tfor (i = 0, ilen = inputs.length; i < ilen; ++i) {\n\t\t\tvalue = inputs[i];\n\t\t\tif (value === undefined) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (context !== undefined && typeof value === 'function') {\n\t\t\t\tvalue = value(context);\n\t\t\t}\n\t\t\tif (index !== undefined && helpers_core.isArray(value)) {\n\t\t\t\tvalue = value[index];\n\t\t\t}\n\t\t\tif (value !== undefined) {\n\t\t\t\treturn value;\n\t\t\t}\n\t\t}\n\t}\n};\n\nvar helpers$1 = helpers_core;\nvar easing = helpers_easing;\nvar canvas = helpers_canvas;\nvar options = helpers_options;\nhelpers$1.easing = easing;\nhelpers$1.canvas = canvas;\nhelpers$1.options = options;\n\nfunction interpolate(start, view, model, ease) {\n\tvar keys = Object.keys(model);\n\tvar i, ilen, key, actual, origin, target, type, c0, c1;\n\n\tfor (i = 0, ilen = keys.length; i < ilen; ++i) {\n\t\tkey = keys[i];\n\n\t\ttarget = model[key];\n\n\t\t// if a value is added to the model after pivot() has been called, the view\n\t\t// doesn't contain it, so let's initialize the view to the target value.\n\t\tif (!view.hasOwnProperty(key)) {\n\t\t\tview[key] = target;\n\t\t}\n\n\t\tactual = view[key];\n\n\t\tif (actual === target || key[0] === '_') {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (!start.hasOwnProperty(key)) {\n\t\t\tstart[key] = actual;\n\t\t}\n\n\t\torigin = start[key];\n\n\t\ttype = typeof target;\n\n\t\tif (type === typeof origin) {\n\t\t\tif (type === 'string') {\n\t\t\t\tc0 = chartjsColor(origin);\n\t\t\t\tif (c0.valid) {\n\t\t\t\t\tc1 = chartjsColor(target);\n\t\t\t\t\tif (c1.valid) {\n\t\t\t\t\t\tview[key] = c1.mix(c0, ease).rgbString();\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (helpers$1.isFinite(origin) && helpers$1.isFinite(target)) {\n\t\t\t\tview[key] = origin + (target - origin) * ease;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\tview[key] = target;\n\t}\n}\n\nvar Element = function(configuration) {\n\thelpers$1.extend(this, configuration);\n\tthis.initialize.apply(this, arguments);\n};\n\nhelpers$1.extend(Element.prototype, {\n\n\tinitialize: function() {\n\t\tthis.hidden = false;\n\t},\n\n\tpivot: function() {\n\t\tvar me = this;\n\t\tif (!me._view) {\n\t\t\tme._view = helpers$1.clone(me._model);\n\t\t}\n\t\tme._start = {};\n\t\treturn me;\n\t},\n\n\ttransition: function(ease) {\n\t\tvar me = this;\n\t\tvar model = me._model;\n\t\tvar start = me._start;\n\t\tvar view = me._view;\n\n\t\t// No animation -> No Transition\n\t\tif (!model || ease === 1) {\n\t\t\tme._view = model;\n\t\t\tme._start = null;\n\t\t\treturn me;\n\t\t}\n\n\t\tif (!view) {\n\t\t\tview = me._view = {};\n\t\t}\n\n\t\tif (!start) {\n\t\t\tstart = me._start = {};\n\t\t}\n\n\t\tinterpolate(start, view, model, ease);\n\n\t\treturn me;\n\t},\n\n\ttooltipPosition: function() {\n\t\treturn {\n\t\t\tx: this._model.x,\n\t\t\ty: this._model.y\n\t\t};\n\t},\n\n\thasValue: function() {\n\t\treturn helpers$1.isNumber(this._model.x) && helpers$1.isNumber(this._model.y);\n\t}\n});\n\nElement.extend = helpers$1.inherits;\n\nvar core_element = Element;\n\nvar exports$2 = core_element.extend({\n\tchart: null, // the animation associated chart instance\n\tcurrentStep: 0, // the current animation step\n\tnumSteps: 60, // default number of steps\n\teasing: '', // the easing to use for this animation\n\trender: null, // render function used by the animation service\n\n\tonAnimationProgress: null, // user specified callback to fire on each step of the animation\n\tonAnimationComplete: null, // user specified callback to fire when the animation finishes\n});\n\nvar core_animation = exports$2;\n\n// DEPRECATIONS\n\n/**\n * Provided for backward compatibility, use Chart.Animation instead\n * @prop Chart.Animation#animationObject\n * @deprecated since version 2.6.0\n * @todo remove at version 3\n */\nObject.defineProperty(exports$2.prototype, 'animationObject', {\n\tget: function() {\n\t\treturn this;\n\t}\n});\n\n/**\n * Provided for backward compatibility, use Chart.Animation#chart instead\n * @prop Chart.Animation#chartInstance\n * @deprecated since version 2.6.0\n * @todo remove at version 3\n */\nObject.defineProperty(exports$2.prototype, 'chartInstance', {\n\tget: function() {\n\t\treturn this.chart;\n\t},\n\tset: function(value) {\n\t\tthis.chart = value;\n\t}\n});\n\ncore_defaults._set('global', {\n\tanimation: {\n\t\tduration: 1000,\n\t\teasing: 'easeOutQuart',\n\t\tonProgress: helpers$1.noop,\n\t\tonComplete: helpers$1.noop\n\t}\n});\n\nvar core_animations = {\n\tanimations: [],\n\trequest: null,\n\n\t/**\n\t * @param {Chart} chart - The chart to animate.\n\t * @param {Chart.Animation} animation - The animation that we will animate.\n\t * @param {number} duration - The animation duration in ms.\n\t * @param {boolean} lazy - if true, the chart is not marked as animating to enable more responsive interactions\n\t */\n\taddAnimation: function(chart, animation, duration, lazy) {\n\t\tvar animations = this.animations;\n\t\tvar i, ilen;\n\n\t\tanimation.chart = chart;\n\t\tanimation.startTime = Date.now();\n\t\tanimation.duration = duration;\n\n\t\tif (!lazy) {\n\t\t\tchart.animating = true;\n\t\t}\n\n\t\tfor (i = 0, ilen = animations.length; i < ilen; ++i) {\n\t\t\tif (animations[i].chart === chart) {\n\t\t\t\tanimations[i] = animation;\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tanimations.push(animation);\n\n\t\t// If there are no animations queued, manually kickstart a digest, for lack of a better word\n\t\tif (animations.length === 1) {\n\t\t\tthis.requestAnimationFrame();\n\t\t}\n\t},\n\n\tcancelAnimation: function(chart) {\n\t\tvar index = helpers$1.findIndex(this.animations, function(animation) {\n\t\t\treturn animation.chart === chart;\n\t\t});\n\n\t\tif (index !== -1) {\n\t\t\tthis.animations.splice(index, 1);\n\t\t\tchart.animating = false;\n\t\t}\n\t},\n\n\trequestAnimationFrame: function() {\n\t\tvar me = this;\n\t\tif (me.request === null) {\n\t\t\t// Skip animation frame requests until the active one is executed.\n\t\t\t// This can happen when processing mouse events, e.g. 'mousemove'\n\t\t\t// and 'mouseout' events will trigger multiple renders.\n\t\t\tme.request = helpers$1.requestAnimFrame.call(window, function() {\n\t\t\t\tme.request = null;\n\t\t\t\tme.startDigest();\n\t\t\t});\n\t\t}\n\t},\n\n\t/**\n\t * @private\n\t */\n\tstartDigest: function() {\n\t\tvar me = this;\n\n\t\tme.advance();\n\n\t\t// Do we have more stuff to animate?\n\t\tif (me.animations.length > 0) {\n\t\t\tme.requestAnimationFrame();\n\t\t}\n\t},\n\n\t/**\n\t * @private\n\t */\n\tadvance: function() {\n\t\tvar animations = this.animations;\n\t\tvar animation, chart, numSteps, nextStep;\n\t\tvar i = 0;\n\n\t\t// 1 animation per chart, so we are looping charts here\n\t\twhile (i < animations.length) {\n\t\t\tanimation = animations[i];\n\t\t\tchart = animation.chart;\n\t\t\tnumSteps = animation.numSteps;\n\n\t\t\t// Make sure that currentStep starts at 1\n\t\t\t// https://github.com/chartjs/Chart.js/issues/6104\n\t\t\tnextStep = Math.floor((Date.now() - animation.startTime) / animation.duration * numSteps) + 1;\n\t\t\tanimation.currentStep = Math.min(nextStep, numSteps);\n\n\t\t\thelpers$1.callback(animation.render, [chart, animation], chart);\n\t\t\thelpers$1.callback(animation.onAnimationProgress, [animation], chart);\n\n\t\t\tif (animation.currentStep >= numSteps) {\n\t\t\t\thelpers$1.callback(animation.onAnimationComplete, [animation], chart);\n\t\t\t\tchart.animating = false;\n\t\t\t\tanimations.splice(i, 1);\n\t\t\t} else {\n\t\t\t\t++i;\n\t\t\t}\n\t\t}\n\t}\n};\n\nvar resolve = helpers$1.options.resolve;\n\nvar arrayEvents = ['push', 'pop', 'shift', 'splice', 'unshift'];\n\n/**\n * Hooks the array methods that add or remove values ('push', pop', 'shift', 'splice',\n * 'unshift') and notify the listener AFTER the array has been altered. Listeners are\n * called on the 'onData*' callbacks (e.g. onDataPush, etc.) with same arguments.\n */\nfunction listenArrayEvents(array, listener) {\n\tif (array._chartjs) {\n\t\tarray._chartjs.listeners.push(listener);\n\t\treturn;\n\t}\n\n\tObject.defineProperty(array, '_chartjs', {\n\t\tconfigurable: true,\n\t\tenumerable: false,\n\t\tvalue: {\n\t\t\tlisteners: [listener]\n\t\t}\n\t});\n\n\tarrayEvents.forEach(function(key) {\n\t\tvar method = 'onData' + key.charAt(0).toUpperCase() + key.slice(1);\n\t\tvar base = array[key];\n\n\t\tObject.defineProperty(array, key, {\n\t\t\tconfigurable: true,\n\t\t\tenumerable: false,\n\t\t\tvalue: function() {\n\t\t\t\tvar args = Array.prototype.slice.call(arguments);\n\t\t\t\tvar res = base.apply(this, args);\n\n\t\t\t\thelpers$1.each(array._chartjs.listeners, function(object) {\n\t\t\t\t\tif (typeof object[method] === 'function') {\n\t\t\t\t\t\tobject[method].apply(object, args);\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\treturn res;\n\t\t\t}\n\t\t});\n\t});\n}\n\n/**\n * Removes the given array event listener and cleanup extra attached properties (such as\n * the _chartjs stub and overridden methods) if array doesn't have any more listeners.\n */\nfunction unlistenArrayEvents(array, listener) {\n\tvar stub = array._chartjs;\n\tif (!stub) {\n\t\treturn;\n\t}\n\n\tvar listeners = stub.listeners;\n\tvar index = listeners.indexOf(listener);\n\tif (index !== -1) {\n\t\tlisteners.splice(index, 1);\n\t}\n\n\tif (listeners.length > 0) {\n\t\treturn;\n\t}\n\n\tarrayEvents.forEach(function(key) {\n\t\tdelete array[key];\n\t});\n\n\tdelete array._chartjs;\n}\n\n// Base class for all dataset controllers (line, bar, etc)\nvar DatasetController = function(chart, datasetIndex) {\n\tthis.initialize(chart, datasetIndex);\n};\n\nhelpers$1.extend(DatasetController.prototype, {\n\n\t/**\n\t * Element type used to generate a meta dataset (e.g. Chart.element.Line).\n\t * @type {Chart.core.element}\n\t */\n\tdatasetElementType: null,\n\n\t/**\n\t * Element type used to generate a meta data (e.g. Chart.element.Point).\n\t * @type {Chart.core.element}\n\t */\n\tdataElementType: null,\n\n\tinitialize: function(chart, datasetIndex) {\n\t\tvar me = this;\n\t\tme.chart = chart;\n\t\tme.index = datasetIndex;\n\t\tme.linkScales();\n\t\tme.addElements();\n\t},\n\n\tupdateIndex: function(datasetIndex) {\n\t\tthis.index = datasetIndex;\n\t},\n\n\tlinkScales: function() {\n\t\tvar me = this;\n\t\tvar meta = me.getMeta();\n\t\tvar dataset = me.getDataset();\n\n\t\tif (meta.xAxisID === null || !(meta.xAxisID in me.chart.scales)) {\n\t\t\tmeta.xAxisID = dataset.xAxisID || me.chart.options.scales.xAxes[0].id;\n\t\t}\n\t\tif (meta.yAxisID === null || !(meta.yAxisID in me.chart.scales)) {\n\t\t\tmeta.yAxisID = dataset.yAxisID || me.chart.options.scales.yAxes[0].id;\n\t\t}\n\t},\n\n\tgetDataset: function() {\n\t\treturn this.chart.data.datasets[this.index];\n\t},\n\n\tgetMeta: function() {\n\t\treturn this.chart.getDatasetMeta(this.index);\n\t},\n\n\tgetScaleForId: function(scaleID) {\n\t\treturn this.chart.scales[scaleID];\n\t},\n\n\t/**\n\t * @private\n\t */\n\t_getValueScaleId: function() {\n\t\treturn this.getMeta().yAxisID;\n\t},\n\n\t/**\n\t * @private\n\t */\n\t_getIndexScaleId: function() {\n\t\treturn this.getMeta().xAxisID;\n\t},\n\n\t/**\n\t * @private\n\t */\n\t_getValueScale: function() {\n\t\treturn this.getScaleForId(this._getValueScaleId());\n\t},\n\n\t/**\n\t * @private\n\t */\n\t_getIndexScale: function() {\n\t\treturn this.getScaleForId(this._getIndexScaleId());\n\t},\n\n\treset: function() {\n\t\tthis.update(true);\n\t},\n\n\t/**\n\t * @private\n\t */\n\tdestroy: function() {\n\t\tif (this._data) {\n\t\t\tunlistenArrayEvents(this._data, this);\n\t\t}\n\t},\n\n\tcreateMetaDataset: function() {\n\t\tvar me = this;\n\t\tvar type = me.datasetElementType;\n\t\treturn type && new type({\n\t\t\t_chart: me.chart,\n\t\t\t_datasetIndex: me.index\n\t\t});\n\t},\n\n\tcreateMetaData: function(index) {\n\t\tvar me = this;\n\t\tvar type = me.dataElementType;\n\t\treturn type && new type({\n\t\t\t_chart: me.chart,\n\t\t\t_datasetIndex: me.index,\n\t\t\t_index: index\n\t\t});\n\t},\n\n\taddElements: function() {\n\t\tvar me = this;\n\t\tvar meta = me.getMeta();\n\t\tvar data = me.getDataset().data || [];\n\t\tvar metaData = meta.data;\n\t\tvar i, ilen;\n\n\t\tfor (i = 0, ilen = data.length; i < ilen; ++i) {\n\t\t\tmetaData[i] = metaData[i] || me.createMetaData(i);\n\t\t}\n\n\t\tmeta.dataset = meta.dataset || me.createMetaDataset();\n\t},\n\n\taddElementAndReset: function(index) {\n\t\tvar element = this.createMetaData(index);\n\t\tthis.getMeta().data.splice(index, 0, element);\n\t\tthis.updateElement(element, index, true);\n\t},\n\n\tbuildOrUpdateElements: function() {\n\t\tvar me = this;\n\t\tvar dataset = me.getDataset();\n\t\tvar data = dataset.data || (dataset.data = []);\n\n\t\t// In order to correctly handle data addition/deletion animation (an thus simulate\n\t\t// real-time charts), we need to monitor these data modifications and synchronize\n\t\t// the internal meta data accordingly.\n\t\tif (me._data !== data) {\n\t\t\tif (me._data) {\n\t\t\t\t// This case happens when the user replaced the data array instance.\n\t\t\t\tunlistenArrayEvents(me._data, me);\n\t\t\t}\n\n\t\t\tif (data && Object.isExtensible(data)) {\n\t\t\t\tlistenArrayEvents(data, me);\n\t\t\t}\n\t\t\tme._data = data;\n\t\t}\n\n\t\t// Re-sync meta data in case the user replaced the data array or if we missed\n\t\t// any updates and so make sure that we handle number of datapoints changing.\n\t\tme.resyncElements();\n\t},\n\n\tupdate: helpers$1.noop,\n\n\ttransition: function(easingValue) {\n\t\tvar meta = this.getMeta();\n\t\tvar elements = meta.data || [];\n\t\tvar ilen = elements.length;\n\t\tvar i = 0;\n\n\t\tfor (; i < ilen; ++i) {\n\t\t\telements[i].transition(easingValue);\n\t\t}\n\n\t\tif (meta.dataset) {\n\t\t\tmeta.dataset.transition(easingValue);\n\t\t}\n\t},\n\n\tdraw: function() {\n\t\tvar meta = this.getMeta();\n\t\tvar elements = meta.data || [];\n\t\tvar ilen = elements.length;\n\t\tvar i = 0;\n\n\t\tif (meta.dataset) {\n\t\t\tmeta.dataset.draw();\n\t\t}\n\n\t\tfor (; i < ilen; ++i) {\n\t\t\telements[i].draw();\n\t\t}\n\t},\n\n\tremoveHoverStyle: function(element) {\n\t\thelpers$1.merge(element._model, element.$previousStyle || {});\n\t\tdelete element.$previousStyle;\n\t},\n\n\tsetHoverStyle: function(element) {\n\t\tvar dataset = this.chart.data.datasets[element._datasetIndex];\n\t\tvar index = element._index;\n\t\tvar custom = element.custom || {};\n\t\tvar model = element._model;\n\t\tvar getHoverColor = helpers$1.getHoverColor;\n\n\t\telement.$previousStyle = {\n\t\t\tbackgroundColor: model.backgroundColor,\n\t\t\tborderColor: model.borderColor,\n\t\t\tborderWidth: model.borderWidth\n\t\t};\n\n\t\tmodel.backgroundColor = resolve([custom.hoverBackgroundColor, dataset.hoverBackgroundColor, getHoverColor(model.backgroundColor)], undefined, index);\n\t\tmodel.borderColor = resolve([custom.hoverBorderColor, dataset.hoverBorderColor, getHoverColor(model.borderColor)], undefined, index);\n\t\tmodel.borderWidth = resolve([custom.hoverBorderWidth, dataset.hoverBorderWidth, model.borderWidth], undefined, index);\n\t},\n\n\t/**\n\t * @private\n\t */\n\tresyncElements: function() {\n\t\tvar me = this;\n\t\tvar meta = me.getMeta();\n\t\tvar data = me.getDataset().data;\n\t\tvar numMeta = meta.data.length;\n\t\tvar numData = data.length;\n\n\t\tif (numData < numMeta) {\n\t\t\tmeta.data.splice(numData, numMeta - numData);\n\t\t} else if (numData > numMeta) {\n\t\t\tme.insertElements(numMeta, numData - numMeta);\n\t\t}\n\t},\n\n\t/**\n\t * @private\n\t */\n\tinsertElements: function(start, count) {\n\t\tfor (var i = 0; i < count; ++i) {\n\t\t\tthis.addElementAndReset(start + i);\n\t\t}\n\t},\n\n\t/**\n\t * @private\n\t */\n\tonDataPush: function() {\n\t\tvar count = arguments.length;\n\t\tthis.insertElements(this.getDataset().data.length - count, count);\n\t},\n\n\t/**\n\t * @private\n\t */\n\tonDataPop: function() {\n\t\tthis.getMeta().data.pop();\n\t},\n\n\t/**\n\t * @private\n\t */\n\tonDataShift: function() {\n\t\tthis.getMeta().data.shift();\n\t},\n\n\t/**\n\t * @private\n\t */\n\tonDataSplice: function(start, count) {\n\t\tthis.getMeta().data.splice(start, count);\n\t\tthis.insertElements(start, arguments.length - 2);\n\t},\n\n\t/**\n\t * @private\n\t */\n\tonDataUnshift: function() {\n\t\tthis.insertElements(0, arguments.length);\n\t}\n});\n\nDatasetController.extend = helpers$1.inherits;\n\nvar core_datasetController = DatasetController;\n\ncore_defaults._set('global', {\n\telements: {\n\t\tarc: {\n\t\t\tbackgroundColor: core_defaults.global.defaultColor,\n\t\t\tborderColor: '#fff',\n\t\t\tborderWidth: 2,\n\t\t\tborderAlign: 'center'\n\t\t}\n\t}\n});\n\nvar element_arc = core_element.extend({\n\tinLabelRange: function(mouseX) {\n\t\tvar vm = this._view;\n\n\t\tif (vm) {\n\t\t\treturn (Math.pow(mouseX - vm.x, 2) < Math.pow(vm.radius + vm.hoverRadius, 2));\n\t\t}\n\t\treturn false;\n\t},\n\n\tinRange: function(chartX, chartY) {\n\t\tvar vm = this._view;\n\n\t\tif (vm) {\n\t\t\tvar pointRelativePosition = helpers$1.getAngleFromPoint(vm, {x: chartX, y: chartY});\n\t\t\tvar\tangle = pointRelativePosition.angle;\n\t\t\tvar distance = pointRelativePosition.distance;\n\n\t\t\t// Sanitise angle range\n\t\t\tvar startAngle = vm.startAngle;\n\t\t\tvar endAngle = vm.endAngle;\n\t\t\twhile (endAngle < startAngle) {\n\t\t\t\tendAngle += 2.0 * Math.PI;\n\t\t\t}\n\t\t\twhile (angle > endAngle) {\n\t\t\t\tangle -= 2.0 * Math.PI;\n\t\t\t}\n\t\t\twhile (angle < startAngle) {\n\t\t\t\tangle += 2.0 * Math.PI;\n\t\t\t}\n\n\t\t\t// Check if within the range of the open/close angle\n\t\t\tvar betweenAngles = (angle >= startAngle && angle <= endAngle);\n\t\t\tvar withinRadius = (distance >= vm.innerRadius && distance <= vm.outerRadius);\n\n\t\t\treturn (betweenAngles && withinRadius);\n\t\t}\n\t\treturn false;\n\t},\n\n\tgetCenterPoint: function() {\n\t\tvar vm = this._view;\n\t\tvar halfAngle = (vm.startAngle + vm.endAngle) / 2;\n\t\tvar halfRadius = (vm.innerRadius + vm.outerRadius) / 2;\n\t\treturn {\n\t\t\tx: vm.x + Math.cos(halfAngle) * halfRadius,\n\t\t\ty: vm.y + Math.sin(halfAngle) * halfRadius\n\t\t};\n\t},\n\n\tgetArea: function() {\n\t\tvar vm = this._view;\n\t\treturn Math.PI * ((vm.endAngle - vm.startAngle) / (2 * Math.PI)) * (Math.pow(vm.outerRadius, 2) - Math.pow(vm.innerRadius, 2));\n\t},\n\n\ttooltipPosition: function() {\n\t\tvar vm = this._view;\n\t\tvar centreAngle = vm.startAngle + ((vm.endAngle - vm.startAngle) / 2);\n\t\tvar rangeFromCentre = (vm.outerRadius - vm.innerRadius) / 2 + vm.innerRadius;\n\n\t\treturn {\n\t\t\tx: vm.x + (Math.cos(centreAngle) * rangeFromCentre),\n\t\t\ty: vm.y + (Math.sin(centreAngle) * rangeFromCentre)\n\t\t};\n\t},\n\n\tdraw: function() {\n\t\tvar ctx = this._chart.ctx;\n\t\tvar vm = this._view;\n\t\tvar sA = vm.startAngle;\n\t\tvar eA = vm.endAngle;\n\t\tvar pixelMargin = (vm.borderAlign === 'inner') ? 0.33 : 0;\n\t\tvar angleMargin;\n\n\t\tctx.save();\n\n\t\tctx.beginPath();\n\t\tctx.arc(vm.x, vm.y, Math.max(vm.outerRadius - pixelMargin, 0), sA, eA);\n\t\tctx.arc(vm.x, vm.y, vm.innerRadius, eA, sA, true);\n\t\tctx.closePath();\n\n\t\tctx.fillStyle = vm.backgroundColor;\n\t\tctx.fill();\n\n\t\tif (vm.borderWidth) {\n\t\t\tif (vm.borderAlign === 'inner') {\n\t\t\t\t// Draw an inner border by cliping the arc and drawing a double-width border\n\t\t\t\t// Enlarge the clipping arc by 0.33 pixels to eliminate glitches between borders\n\t\t\t\tctx.beginPath();\n\t\t\t\tangleMargin = pixelMargin / vm.outerRadius;\n\t\t\t\tctx.arc(vm.x, vm.y, vm.outerRadius, sA - angleMargin, eA + angleMargin);\n\t\t\t\tif (vm.innerRadius > pixelMargin) {\n\t\t\t\t\tangleMargin = pixelMargin / vm.innerRadius;\n\t\t\t\t\tctx.arc(vm.x, vm.y, vm.innerRadius - pixelMargin, eA + angleMargin, sA - angleMargin, true);\n\t\t\t\t} else {\n\t\t\t\t\tctx.arc(vm.x, vm.y, pixelMargin, eA + Math.PI / 2, sA - Math.PI / 2);\n\t\t\t\t}\n\t\t\t\tctx.closePath();\n\t\t\t\tctx.clip();\n\n\t\t\t\tctx.beginPath();\n\t\t\t\tctx.arc(vm.x, vm.y, vm.outerRadius, sA, eA);\n\t\t\t\tctx.arc(vm.x, vm.y, vm.innerRadius, eA, sA, true);\n\t\t\t\tctx.closePath();\n\n\t\t\t\tctx.lineWidth = vm.borderWidth * 2;\n\t\t\t\tctx.lineJoin = 'round';\n\t\t\t} else {\n\t\t\t\tctx.lineWidth = vm.borderWidth;\n\t\t\t\tctx.lineJoin = 'bevel';\n\t\t\t}\n\n\t\t\tctx.strokeStyle = vm.borderColor;\n\t\t\tctx.stroke();\n\t\t}\n\n\t\tctx.restore();\n\t}\n});\n\nvar valueOrDefault$1 = helpers$1.valueOrDefault;\n\nvar defaultColor = core_defaults.global.defaultColor;\n\ncore_defaults._set('global', {\n\telements: {\n\t\tline: {\n\t\t\ttension: 0.4,\n\t\t\tbackgroundColor: defaultColor,\n\t\t\tborderWidth: 3,\n\t\t\tborderColor: defaultColor,\n\t\t\tborderCapStyle: 'butt',\n\t\t\tborderDash: [],\n\t\t\tborderDashOffset: 0.0,\n\t\t\tborderJoinStyle: 'miter',\n\t\t\tcapBezierPoints: true,\n\t\t\tfill: true, // do we fill in the area between the line and its base axis\n\t\t}\n\t}\n});\n\nvar element_line = core_element.extend({\n\tdraw: function() {\n\t\tvar me = this;\n\t\tvar vm = me._view;\n\t\tvar ctx = me._chart.ctx;\n\t\tvar spanGaps = vm.spanGaps;\n\t\tvar points = me._children.slice(); // clone array\n\t\tvar globalDefaults = core_defaults.global;\n\t\tvar globalOptionLineElements = globalDefaults.elements.line;\n\t\tvar lastDrawnIndex = -1;\n\t\tvar index, current, previous, currentVM;\n\n\t\t// If we are looping, adding the first point again\n\t\tif (me._loop && points.length) {\n\t\t\tpoints.push(points[0]);\n\t\t}\n\n\t\tctx.save();\n\n\t\t// Stroke Line Options\n\t\tctx.lineCap = vm.borderCapStyle || globalOptionLineElements.borderCapStyle;\n\n\t\t// IE 9 and 10 do not support line dash\n\t\tif (ctx.setLineDash) {\n\t\t\tctx.setLineDash(vm.borderDash || globalOptionLineElements.borderDash);\n\t\t}\n\n\t\tctx.lineDashOffset = valueOrDefault$1(vm.borderDashOffset, globalOptionLineElements.borderDashOffset);\n\t\tctx.lineJoin = vm.borderJoinStyle || globalOptionLineElements.borderJoinStyle;\n\t\tctx.lineWidth = valueOrDefault$1(vm.borderWidth, globalOptionLineElements.borderWidth);\n\t\tctx.strokeStyle = vm.borderColor || globalDefaults.defaultColor;\n\n\t\t// Stroke Line\n\t\tctx.beginPath();\n\t\tlastDrawnIndex = -1;\n\n\t\tfor (index = 0; index < points.length; ++index) {\n\t\t\tcurrent = points[index];\n\t\t\tprevious = helpers$1.previousItem(points, index);\n\t\t\tcurrentVM = current._view;\n\n\t\t\t// First point moves to it's starting position no matter what\n\t\t\tif (index === 0) {\n\t\t\t\tif (!currentVM.skip) {\n\t\t\t\t\tctx.moveTo(currentVM.x, currentVM.y);\n\t\t\t\t\tlastDrawnIndex = index;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tprevious = lastDrawnIndex === -1 ? previous : points[lastDrawnIndex];\n\n\t\t\t\tif (!currentVM.skip) {\n\t\t\t\t\tif ((lastDrawnIndex !== (index - 1) && !spanGaps) || lastDrawnIndex === -1) {\n\t\t\t\t\t\t// There was a gap and this is the first point after the gap\n\t\t\t\t\t\tctx.moveTo(currentVM.x, currentVM.y);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Line to next point\n\t\t\t\t\t\thelpers$1.canvas.lineTo(ctx, previous._view, current._view);\n\t\t\t\t\t}\n\t\t\t\t\tlastDrawnIndex = index;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tctx.stroke();\n\t\tctx.restore();\n\t}\n});\n\nvar valueOrDefault$2 = helpers$1.valueOrDefault;\n\nvar defaultColor$1 = core_defaults.global.defaultColor;\n\ncore_defaults._set('global', {\n\telements: {\n\t\tpoint: {\n\t\t\tradius: 3,\n\t\t\tpointStyle: 'circle',\n\t\t\tbackgroundColor: defaultColor$1,\n\t\t\tborderColor: defaultColor$1,\n\t\t\tborderWidth: 1,\n\t\t\t// Hover\n\t\t\thitRadius: 1,\n\t\t\thoverRadius: 4,\n\t\t\thoverBorderWidth: 1\n\t\t}\n\t}\n});\n\nfunction xRange(mouseX) {\n\tvar vm = this._view;\n\treturn vm ? (Math.abs(mouseX - vm.x) < vm.radius + vm.hitRadius) : false;\n}\n\nfunction yRange(mouseY) {\n\tvar vm = this._view;\n\treturn vm ? (Math.abs(mouseY - vm.y) < vm.radius + vm.hitRadius) : false;\n}\n\nvar element_point = core_element.extend({\n\tinRange: function(mouseX, mouseY) {\n\t\tvar vm = this._view;\n\t\treturn vm ? ((Math.pow(mouseX - vm.x, 2) + Math.pow(mouseY - vm.y, 2)) < Math.pow(vm.hitRadius + vm.radius, 2)) : false;\n\t},\n\n\tinLabelRange: xRange,\n\tinXRange: xRange,\n\tinYRange: yRange,\n\n\tgetCenterPoint: function() {\n\t\tvar vm = this._view;\n\t\treturn {\n\t\t\tx: vm.x,\n\t\t\ty: vm.y\n\t\t};\n\t},\n\n\tgetArea: function() {\n\t\treturn Math.PI * Math.pow(this._view.radius, 2);\n\t},\n\n\ttooltipPosition: function() {\n\t\tvar vm = this._view;\n\t\treturn {\n\t\t\tx: vm.x,\n\t\t\ty: vm.y,\n\t\t\tpadding: vm.radius + vm.borderWidth\n\t\t};\n\t},\n\n\tdraw: function(chartArea) {\n\t\tvar vm = this._view;\n\t\tvar ctx = this._chart.ctx;\n\t\tvar pointStyle = vm.pointStyle;\n\t\tvar rotation = vm.rotation;\n\t\tvar radius = vm.radius;\n\t\tvar x = vm.x;\n\t\tvar y = vm.y;\n\t\tvar globalDefaults = core_defaults.global;\n\t\tvar defaultColor = globalDefaults.defaultColor; // eslint-disable-line no-shadow\n\n\t\tif (vm.skip) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Clipping for Points.\n\t\tif (chartArea === undefined || helpers$1.canvas._isPointInArea(vm, chartArea)) {\n\t\t\tctx.strokeStyle = vm.borderColor || defaultColor;\n\t\t\tctx.lineWidth = valueOrDefault$2(vm.borderWidth, globalDefaults.elements.point.borderWidth);\n\t\t\tctx.fillStyle = vm.backgroundColor || defaultColor;\n\t\t\thelpers$1.canvas.drawPoint(ctx, pointStyle, radius, x, y, rotation);\n\t\t}\n\t}\n});\n\nvar defaultColor$2 = core_defaults.global.defaultColor;\n\ncore_defaults._set('global', {\n\telements: {\n\t\trectangle: {\n\t\t\tbackgroundColor: defaultColor$2,\n\t\t\tborderColor: defaultColor$2,\n\t\t\tborderSkipped: 'bottom',\n\t\t\tborderWidth: 0\n\t\t}\n\t}\n});\n\nfunction isVertical(vm) {\n\treturn vm && vm.width !== undefined;\n}\n\n/**\n * Helper function to get the bounds of the bar regardless of the orientation\n * @param bar {Chart.Element.Rectangle} the bar\n * @return {Bounds} bounds of the bar\n * @private\n */\nfunction getBarBounds(vm) {\n\tvar x1, x2, y1, y2, half;\n\n\tif (isVertical(vm)) {\n\t\thalf = vm.width / 2;\n\t\tx1 = vm.x - half;\n\t\tx2 = vm.x + half;\n\t\ty1 = Math.min(vm.y, vm.base);\n\t\ty2 = Math.max(vm.y, vm.base);\n\t} else {\n\t\thalf = vm.height / 2;\n\t\tx1 = Math.min(vm.x, vm.base);\n\t\tx2 = Math.max(vm.x, vm.base);\n\t\ty1 = vm.y - half;\n\t\ty2 = vm.y + half;\n\t}\n\n\treturn {\n\t\tleft: x1,\n\t\ttop: y1,\n\t\tright: x2,\n\t\tbottom: y2\n\t};\n}\n\nfunction swap(orig, v1, v2) {\n\treturn orig === v1 ? v2 : orig === v2 ? v1 : orig;\n}\n\nfunction parseBorderSkipped(vm) {\n\tvar edge = vm.borderSkipped;\n\tvar res = {};\n\n\tif (!edge) {\n\t\treturn res;\n\t}\n\n\tif (vm.horizontal) {\n\t\tif (vm.base > vm.x) {\n\t\t\tedge = swap(edge, 'left', 'right');\n\t\t}\n\t} else if (vm.base < vm.y) {\n\t\tedge = swap(edge, 'bottom', 'top');\n\t}\n\n\tres[edge] = true;\n\treturn res;\n}\n\nfunction parseBorderWidth(vm, maxW, maxH) {\n\tvar value = vm.borderWidth;\n\tvar skip = parseBorderSkipped(vm);\n\tvar t, r, b, l;\n\n\tif (helpers$1.isObject(value)) {\n\t\tt = +value.top || 0;\n\t\tr = +value.right || 0;\n\t\tb = +value.bottom || 0;\n\t\tl = +value.left || 0;\n\t} else {\n\t\tt = r = b = l = +value || 0;\n\t}\n\n\treturn {\n\t\tt: skip.top || (t < 0) ? 0 : t > maxH ? maxH : t,\n\t\tr: skip.right || (r < 0) ? 0 : r > maxW ? maxW : r,\n\t\tb: skip.bottom || (b < 0) ? 0 : b > maxH ? maxH : b,\n\t\tl: skip.left || (l < 0) ? 0 : l > maxW ? maxW : l\n\t};\n}\n\nfunction boundingRects(vm) {\n\tvar bounds = getBarBounds(vm);\n\tvar width = bounds.right - bounds.left;\n\tvar height = bounds.bottom - bounds.top;\n\tvar border = parseBorderWidth(vm, width / 2, height / 2);\n\n\treturn {\n\t\touter: {\n\t\t\tx: bounds.left,\n\t\t\ty: bounds.top,\n\t\t\tw: width,\n\t\t\th: height\n\t\t},\n\t\tinner: {\n\t\t\tx: bounds.left + border.l,\n\t\t\ty: bounds.top + border.t,\n\t\t\tw: width - border.l - border.r,\n\t\t\th: height - border.t - border.b\n\t\t}\n\t};\n}\n\nfunction inRange(vm, x, y) {\n\tvar skipX = x === null;\n\tvar skipY = y === null;\n\tvar bounds = !vm || (skipX && skipY) ? false : getBarBounds(vm);\n\n\treturn bounds\n\t\t&& (skipX || x >= bounds.left && x <= bounds.right)\n\t\t&& (skipY || y >= bounds.top && y <= bounds.bottom);\n}\n\nvar element_rectangle = core_element.extend({\n\tdraw: function() {\n\t\tvar ctx = this._chart.ctx;\n\t\tvar vm = this._view;\n\t\tvar rects = boundingRects(vm);\n\t\tvar outer = rects.outer;\n\t\tvar inner = rects.inner;\n\n\t\tctx.fillStyle = vm.backgroundColor;\n\t\tctx.fillRect(outer.x, outer.y, outer.w, outer.h);\n\n\t\tif (outer.w === inner.w && outer.h === inner.h) {\n\t\t\treturn;\n\t\t}\n\n\t\tctx.save();\n\t\tctx.beginPath();\n\t\tctx.rect(outer.x, outer.y, outer.w, outer.h);\n\t\tctx.clip();\n\t\tctx.fillStyle = vm.borderColor;\n\t\tctx.rect(inner.x, inner.y, inner.w, inner.h);\n\t\tctx.fill('evenodd');\n\t\tctx.restore();\n\t},\n\n\theight: function() {\n\t\tvar vm = this._view;\n\t\treturn vm.base - vm.y;\n\t},\n\n\tinRange: function(mouseX, mouseY) {\n\t\treturn inRange(this._view, mouseX, mouseY);\n\t},\n\n\tinLabelRange: function(mouseX, mouseY) {\n\t\tvar vm = this._view;\n\t\treturn isVertical(vm)\n\t\t\t? inRange(vm, mouseX, null)\n\t\t\t: inRange(vm, null, mouseY);\n\t},\n\n\tinXRange: function(mouseX) {\n\t\treturn inRange(this._view, mouseX, null);\n\t},\n\n\tinYRange: function(mouseY) {\n\t\treturn inRange(this._view, null, mouseY);\n\t},\n\n\tgetCenterPoint: function() {\n\t\tvar vm = this._view;\n\t\tvar x, y;\n\t\tif (isVertical(vm)) {\n\t\t\tx = vm.x;\n\t\t\ty = (vm.y + vm.base) / 2;\n\t\t} else {\n\t\t\tx = (vm.x + vm.base) / 2;\n\t\t\ty = vm.y;\n\t\t}\n\n\t\treturn {x: x, y: y};\n\t},\n\n\tgetArea: function() {\n\t\tvar vm = this._view;\n\n\t\treturn isVertical(vm)\n\t\t\t? vm.width * Math.abs(vm.y - vm.base)\n\t\t\t: vm.height * Math.abs(vm.x - vm.base);\n\t},\n\n\ttooltipPosition: function() {\n\t\tvar vm = this._view;\n\t\treturn {\n\t\t\tx: vm.x,\n\t\t\ty: vm.y\n\t\t};\n\t}\n});\n\nvar elements = {};\nvar Arc = element_arc;\nvar Line = element_line;\nvar Point = element_point;\nvar Rectangle = element_rectangle;\nelements.Arc = Arc;\nelements.Line = Line;\nelements.Point = Point;\nelements.Rectangle = Rectangle;\n\nvar resolve$1 = helpers$1.options.resolve;\n\ncore_defaults._set('bar', {\n\thover: {\n\t\tmode: 'label'\n\t},\n\n\tscales: {\n\t\txAxes: [{\n\t\t\ttype: 'category',\n\t\t\tcategoryPercentage: 0.8,\n\t\t\tbarPercentage: 0.9,\n\t\t\toffset: true,\n\t\t\tgridLines: {\n\t\t\t\toffsetGridLines: true\n\t\t\t}\n\t\t}],\n\n\t\tyAxes: [{\n\t\t\ttype: 'linear'\n\t\t}]\n\t}\n});\n\n/**\n * Computes the \"optimal\" sample size to maintain bars equally sized while preventing overlap.\n * @private\n */\nfunction computeMinSampleSize(scale, pixels) {\n\tvar min = scale.isHorizontal() ? scale.width : scale.height;\n\tvar ticks = scale.getTicks();\n\tvar prev, curr, i, ilen;\n\n\tfor (i = 1, ilen = pixels.length; i < ilen; ++i) {\n\t\tmin = Math.min(min, Math.abs(pixels[i] - pixels[i - 1]));\n\t}\n\n\tfor (i = 0, ilen = ticks.length; i < ilen; ++i) {\n\t\tcurr = scale.getPixelForTick(i);\n\t\tmin = i > 0 ? Math.min(min, curr - prev) : min;\n\t\tprev = curr;\n\t}\n\n\treturn min;\n}\n\n/**\n * Computes an \"ideal\" category based on the absolute bar thickness or, if undefined or null,\n * uses the smallest interval (see computeMinSampleSize) that prevents bar overlapping. This\n * mode currently always generates bars equally sized (until we introduce scriptable options?).\n * @private\n */\nfunction computeFitCategoryTraits(index, ruler, options) {\n\tvar thickness = options.barThickness;\n\tvar count = ruler.stackCount;\n\tvar curr = ruler.pixels[index];\n\tvar size, ratio;\n\n\tif (helpers$1.isNullOrUndef(thickness)) {\n\t\tsize = ruler.min * options.categoryPercentage;\n\t\tratio = options.barPercentage;\n\t} else {\n\t\t// When bar thickness is enforced, category and bar percentages are ignored.\n\t\t// Note(SB): we could add support for relative bar thickness (e.g. barThickness: '50%')\n\t\t// and deprecate barPercentage since this value is ignored when thickness is absolute.\n\t\tsize = thickness * count;\n\t\tratio = 1;\n\t}\n\n\treturn {\n\t\tchunk: size / count,\n\t\tratio: ratio,\n\t\tstart: curr - (size / 2)\n\t};\n}\n\n/**\n * Computes an \"optimal\" category that globally arranges bars side by side (no gap when\n * percentage options are 1), based on the previous and following categories. This mode\n * generates bars with different widths when data are not evenly spaced.\n * @private\n */\nfunction computeFlexCategoryTraits(index, ruler, options) {\n\tvar pixels = ruler.pixels;\n\tvar curr = pixels[index];\n\tvar prev = index > 0 ? pixels[index - 1] : null;\n\tvar next = index < pixels.length - 1 ? pixels[index + 1] : null;\n\tvar percent = options.categoryPercentage;\n\tvar start, size;\n\n\tif (prev === null) {\n\t\t// first data: its size is double based on the next point or,\n\t\t// if it's also the last data, we use the scale size.\n\t\tprev = curr - (next === null ? ruler.end - ruler.start : next - curr);\n\t}\n\n\tif (next === null) {\n\t\t// last data: its size is also double based on the previous point.\n\t\tnext = curr + curr - prev;\n\t}\n\n\tstart = curr - (curr - Math.min(prev, next)) / 2 * percent;\n\tsize = Math.abs(next - prev) / 2 * percent;\n\n\treturn {\n\t\tchunk: size / ruler.stackCount,\n\t\tratio: options.barPercentage,\n\t\tstart: start\n\t};\n}\n\nvar controller_bar = core_datasetController.extend({\n\n\tdataElementType: elements.Rectangle,\n\n\tinitialize: function() {\n\t\tvar me = this;\n\t\tvar meta;\n\n\t\tcore_datasetController.prototype.initialize.apply(me, arguments);\n\n\t\tmeta = me.getMeta();\n\t\tmeta.stack = me.getDataset().stack;\n\t\tmeta.bar = true;\n\t},\n\n\tupdate: function(reset) {\n\t\tvar me = this;\n\t\tvar rects = me.getMeta().data;\n\t\tvar i, ilen;\n\n\t\tme._ruler = me.getRuler();\n\n\t\tfor (i = 0, ilen = rects.length; i < ilen; ++i) {\n\t\t\tme.updateElement(rects[i], i, reset);\n\t\t}\n\t},\n\n\tupdateElement: function(rectangle, index, reset) {\n\t\tvar me = this;\n\t\tvar meta = me.getMeta();\n\t\tvar dataset = me.getDataset();\n\t\tvar options = me._resolveElementOptions(rectangle, index);\n\n\t\trectangle._xScale = me.getScaleForId(meta.xAxisID);\n\t\trectangle._yScale = me.getScaleForId(meta.yAxisID);\n\t\trectangle._datasetIndex = me.index;\n\t\trectangle._index = index;\n\t\trectangle._model = {\n\t\t\tbackgroundColor: options.backgroundColor,\n\t\t\tborderColor: options.borderColor,\n\t\t\tborderSkipped: options.borderSkipped,\n\t\t\tborderWidth: options.borderWidth,\n\t\t\tdatasetLabel: dataset.label,\n\t\t\tlabel: me.chart.data.labels[index]\n\t\t};\n\n\t\tme._updateElementGeometry(rectangle, index, reset);\n\n\t\trectangle.pivot();\n\t},\n\n\t/**\n\t * @private\n\t */\n\t_updateElementGeometry: function(rectangle, index, reset) {\n\t\tvar me = this;\n\t\tvar model = rectangle._model;\n\t\tvar vscale = me._getValueScale();\n\t\tvar base = vscale.getBasePixel();\n\t\tvar horizontal = vscale.isHorizontal();\n\t\tvar ruler = me._ruler || me.getRuler();\n\t\tvar vpixels = me.calculateBarValuePixels(me.index, index);\n\t\tvar ipixels = me.calculateBarIndexPixels(me.index, index, ruler);\n\n\t\tmodel.horizontal = horizontal;\n\t\tmodel.base = reset ? base : vpixels.base;\n\t\tmodel.x = horizontal ? reset ? base : vpixels.head : ipixels.center;\n\t\tmodel.y = horizontal ? ipixels.center : reset ? base : vpixels.head;\n\t\tmodel.height = horizontal ? ipixels.size : undefined;\n\t\tmodel.width = horizontal ? undefined : ipixels.size;\n\t},\n\n\t/**\n\t * Returns the stacks based on groups and bar visibility.\n\t * @param {number} [last] - The dataset index\n\t * @returns {string[]} The list of stack IDs\n\t * @private\n\t */\n\t_getStacks: function(last) {\n\t\tvar me = this;\n\t\tvar chart = me.chart;\n\t\tvar scale = me._getIndexScale();\n\t\tvar stacked = scale.options.stacked;\n\t\tvar ilen = last === undefined ? chart.data.datasets.length : last + 1;\n\t\tvar stacks = [];\n\t\tvar i, meta;\n\n\t\tfor (i = 0; i < ilen; ++i) {\n\t\t\tmeta = chart.getDatasetMeta(i);\n\t\t\tif (meta.bar && chart.isDatasetVisible(i) &&\n\t\t\t\t(stacked === false ||\n\t\t\t\t(stacked === true && stacks.indexOf(meta.stack) === -1) ||\n\t\t\t\t(stacked === undefined && (meta.stack === undefined || stacks.indexOf(meta.stack) === -1)))) {\n\t\t\t\tstacks.push(meta.stack);\n\t\t\t}\n\t\t}\n\n\t\treturn stacks;\n\t},\n\n\t/**\n\t * Returns the effective number of stacks based on groups and bar visibility.\n\t * @private\n\t */\n\tgetStackCount: function() {\n\t\treturn this._getStacks().length;\n\t},\n\n\t/**\n\t * Returns the stack index for the given dataset based on groups and bar visibility.\n\t * @param {number} [datasetIndex] - The dataset index\n\t * @param {string} [name] - The stack name to find\n\t * @returns {number} The stack index\n\t * @private\n\t */\n\tgetStackIndex: function(datasetIndex, name) {\n\t\tvar stacks = this._getStacks(datasetIndex);\n\t\tvar index = (name !== undefined)\n\t\t\t? stacks.indexOf(name)\n\t\t\t: -1; // indexOf returns -1 if element is not present\n\n\t\treturn (index === -1)\n\t\t\t? stacks.length - 1\n\t\t\t: index;\n\t},\n\n\t/**\n\t * @private\n\t */\n\tgetRuler: function() {\n\t\tvar me = this;\n\t\tvar scale = me._getIndexScale();\n\t\tvar stackCount = me.getStackCount();\n\t\tvar datasetIndex = me.index;\n\t\tvar isHorizontal = scale.isHorizontal();\n\t\tvar start = isHorizontal ? scale.left : scale.top;\n\t\tvar end = start + (isHorizontal ? scale.width : scale.height);\n\t\tvar pixels = [];\n\t\tvar i, ilen, min;\n\n\t\tfor (i = 0, ilen = me.getMeta().data.length; i < ilen; ++i) {\n\t\t\tpixels.push(scale.getPixelForValue(null, i, datasetIndex));\n\t\t}\n\n\t\tmin = helpers$1.isNullOrUndef(scale.options.barThickness)\n\t\t\t? computeMinSampleSize(scale, pixels)\n\t\t\t: -1;\n\n\t\treturn {\n\t\t\tmin: min,\n\t\t\tpixels: pixels,\n\t\t\tstart: start,\n\t\t\tend: end,\n\t\t\tstackCount: stackCount,\n\t\t\tscale: scale\n\t\t};\n\t},\n\n\t/**\n\t * Note: pixel values are not clamped to the scale area.\n\t * @private\n\t */\n\tcalculateBarValuePixels: function(datasetIndex, index) {\n\t\tvar me = this;\n\t\tvar chart = me.chart;\n\t\tvar meta = me.getMeta();\n\t\tvar scale = me._getValueScale();\n\t\tvar isHorizontal = scale.isHorizontal();\n\t\tvar datasets = chart.data.datasets;\n\t\tvar value = +scale.getRightValue(datasets[datasetIndex].data[index]);\n\t\tvar minBarLength = scale.options.minBarLength;\n\t\tvar stacked = scale.options.stacked;\n\t\tvar stack = meta.stack;\n\t\tvar start = 0;\n\t\tvar i, imeta, ivalue, base, head, size;\n\n\t\tif (stacked || (stacked === undefined && stack !== undefined)) {\n\t\t\tfor (i = 0; i < datasetIndex; ++i) {\n\t\t\t\timeta = chart.getDatasetMeta(i);\n\n\t\t\t\tif (imeta.bar &&\n\t\t\t\t\timeta.stack === stack &&\n\t\t\t\t\timeta.controller._getValueScaleId() === scale.id &&\n\t\t\t\t\tchart.isDatasetVisible(i)) {\n\n\t\t\t\t\tivalue = +scale.getRightValue(datasets[i].data[index]);\n\t\t\t\t\tif ((value < 0 && ivalue < 0) || (value >= 0 && ivalue > 0)) {\n\t\t\t\t\t\tstart += ivalue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tbase = scale.getPixelForValue(start);\n\t\thead = scale.getPixelForValue(start + value);\n\t\tsize = head - base;\n\n\t\tif (minBarLength !== undefined && Math.abs(size) < minBarLength) {\n\t\t\tsize = minBarLength;\n\t\t\tif (value >= 0 && !isHorizontal || value < 0 && isHorizontal) {\n\t\t\t\thead = base - minBarLength;\n\t\t\t} else {\n\t\t\t\thead = base + minBarLength;\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\tsize: size,\n\t\t\tbase: base,\n\t\t\thead: head,\n\t\t\tcenter: head + size / 2\n\t\t};\n\t},\n\n\t/**\n\t * @private\n\t */\n\tcalculateBarIndexPixels: function(datasetIndex, index, ruler) {\n\t\tvar me = this;\n\t\tvar options = ruler.scale.options;\n\t\tvar range = options.barThickness === 'flex'\n\t\t\t? computeFlexCategoryTraits(index, ruler, options)\n\t\t\t: computeFitCategoryTraits(index, ruler, options);\n\n\t\tvar stackIndex = me.getStackIndex(datasetIndex, me.getMeta().stack);\n\t\tvar center = range.start + (range.chunk * stackIndex) + (range.chunk / 2);\n\t\tvar size = Math.min(\n\t\t\thelpers$1.valueOrDefault(options.maxBarThickness, Infinity),\n\t\t\trange.chunk * range.ratio);\n\n\t\treturn {\n\t\t\tbase: center - size / 2,\n\t\t\thead: center + size / 2,\n\t\t\tcenter: center,\n\t\t\tsize: size\n\t\t};\n\t},\n\n\tdraw: function() {\n\t\tvar me = this;\n\t\tvar chart = me.chart;\n\t\tvar scale = me._getValueScale();\n\t\tvar rects = me.getMeta().data;\n\t\tvar dataset = me.getDataset();\n\t\tvar ilen = rects.length;\n\t\tvar i = 0;\n\n\t\thelpers$1.canvas.clipArea(chart.ctx, chart.chartArea);\n\n\t\tfor (; i < ilen; ++i) {\n\t\t\tif (!isNaN(scale.getRightValue(dataset.data[i]))) {\n\t\t\t\trects[i].draw();\n\t\t\t}\n\t\t}\n\n\t\thelpers$1.canvas.unclipArea(chart.ctx);\n\t},\n\n\t/**\n\t * @private\n\t */\n\t_resolveElementOptions: function(rectangle, index) {\n\t\tvar me = this;\n\t\tvar chart = me.chart;\n\t\tvar datasets = chart.data.datasets;\n\t\tvar dataset = datasets[me.index];\n\t\tvar custom = rectangle.custom || {};\n\t\tvar options = chart.options.elements.rectangle;\n\t\tvar values = {};\n\t\tvar i, ilen, key;\n\n\t\t// Scriptable options\n\t\tvar context = {\n\t\t\tchart: chart,\n\t\t\tdataIndex: index,\n\t\t\tdataset: dataset,\n\t\t\tdatasetIndex: me.index\n\t\t};\n\n\t\tvar keys = [\n\t\t\t'backgroundColor',\n\t\t\t'borderColor',\n\t\t\t'borderSkipped',\n\t\t\t'borderWidth'\n\t\t];\n\n\t\tfor (i = 0, ilen = keys.length; i < ilen; ++i) {\n\t\t\tkey = keys[i];\n\t\t\tvalues[key] = resolve$1([\n\t\t\t\tcustom[key],\n\t\t\t\tdataset[key],\n\t\t\t\toptions[key]\n\t\t\t], context, index);\n\t\t}\n\n\t\treturn values;\n\t}\n});\n\nvar valueOrDefault$3 = helpers$1.valueOrDefault;\nvar resolve$2 = helpers$1.options.resolve;\n\ncore_defaults._set('bubble', {\n\thover: {\n\t\tmode: 'single'\n\t},\n\n\tscales: {\n\t\txAxes: [{\n\t\t\ttype: 'linear', // bubble should probably use a linear scale by default\n\t\t\tposition: 'bottom',\n\t\t\tid: 'x-axis-0' // need an ID so datasets can reference the scale\n\t\t}],\n\t\tyAxes: [{\n\t\t\ttype: 'linear',\n\t\t\tposition: 'left',\n\t\t\tid: 'y-axis-0'\n\t\t}]\n\t},\n\n\ttooltips: {\n\t\tcallbacks: {\n\t\t\ttitle: function() {\n\t\t\t\t// Title doesn't make sense for scatter since we format the data as a point\n\t\t\t\treturn '';\n\t\t\t},\n\t\t\tlabel: function(item, data) {\n\t\t\t\tvar datasetLabel = data.datasets[item.datasetIndex].label || '';\n\t\t\t\tvar dataPoint = data.datasets[item.datasetIndex].data[item.index];\n\t\t\t\treturn datasetLabel + ': (' + item.xLabel + ', ' + item.yLabel + ', ' + dataPoint.r + ')';\n\t\t\t}\n\t\t}\n\t}\n});\n\nvar controller_bubble = core_datasetController.extend({\n\t/**\n\t * @protected\n\t */\n\tdataElementType: elements.Point,\n\n\t/**\n\t * @protected\n\t */\n\tupdate: function(reset) {\n\t\tvar me = this;\n\t\tvar meta = me.getMeta();\n\t\tvar points = meta.data;\n\n\t\t// Update Points\n\t\thelpers$1.each(points, function(point, index) {\n\t\t\tme.updateElement(point, index, reset);\n\t\t});\n\t},\n\n\t/**\n\t * @protected\n\t */\n\tupdateElement: function(point, index, reset) {\n\t\tvar me = this;\n\t\tvar meta = me.getMeta();\n\t\tvar custom = point.custom || {};\n\t\tvar xScale = me.getScaleForId(meta.xAxisID);\n\t\tvar yScale = me.getScaleForId(meta.yAxisID);\n\t\tvar options = me._resolveElementOptions(point, index);\n\t\tvar data = me.getDataset().data[index];\n\t\tvar dsIndex = me.index;\n\n\t\tvar x = reset ? xScale.getPixelForDecimal(0.5) : xScale.getPixelForValue(typeof data === 'object' ? data : NaN, index, dsIndex);\n\t\tvar y = reset ? yScale.getBasePixel() : yScale.getPixelForValue(data, index, dsIndex);\n\n\t\tpoint._xScale = xScale;\n\t\tpoint._yScale = yScale;\n\t\tpoint._options = options;\n\t\tpoint._datasetIndex = dsIndex;\n\t\tpoint._index = index;\n\t\tpoint._model = {\n\t\t\tbackgroundColor: options.backgroundColor,\n\t\t\tborderColor: options.borderColor,\n\t\t\tborderWidth: options.borderWidth,\n\t\t\thitRadius: options.hitRadius,\n\t\t\tpointStyle: options.pointStyle,\n\t\t\trotation: options.rotation,\n\t\t\tradius: reset ? 0 : options.radius,\n\t\t\tskip: custom.skip || isNaN(x) || isNaN(y),\n\t\t\tx: x,\n\t\t\ty: y,\n\t\t};\n\n\t\tpoint.pivot();\n\t},\n\n\t/**\n\t * @protected\n\t */\n\tsetHoverStyle: function(point) {\n\t\tvar model = point._model;\n\t\tvar options = point._options;\n\t\tvar getHoverColor = helpers$1.getHoverColor;\n\n\t\tpoint.$previousStyle = {\n\t\t\tbackgroundColor: model.backgroundColor,\n\t\t\tborderColor: model.borderColor,\n\t\t\tborderWidth: model.borderWidth,\n\t\t\tradius: model.radius\n\t\t};\n\n\t\tmodel.backgroundColor = valueOrDefault$3(options.hoverBackgroundColor, getHoverColor(options.backgroundColor));\n\t\tmodel.borderColor = valueOrDefault$3(options.hoverBorderColor, getHoverColor(options.borderColor));\n\t\tmodel.borderWidth = valueOrDefault$3(options.hoverBorderWidth, options.borderWidth);\n\t\tmodel.radius = options.radius + options.hoverRadius;\n\t},\n\n\t/**\n\t * @private\n\t */\n\t_resolveElementOptions: function(point, index) {\n\t\tvar me = this;\n\t\tvar chart = me.chart;\n\t\tvar datasets = chart.data.datasets;\n\t\tvar dataset = datasets[me.index];\n\t\tvar custom = point.custom || {};\n\t\tvar options = chart.options.elements.point;\n\t\tvar data = dataset.data[index];\n\t\tvar values = {};\n\t\tvar i, ilen, key;\n\n\t\t// Scriptable options\n\t\tvar context = {\n\t\t\tchart: chart,\n\t\t\tdataIndex: index,\n\t\t\tdataset: dataset,\n\t\t\tdatasetIndex: me.index\n\t\t};\n\n\t\tvar keys = [\n\t\t\t'backgroundColor',\n\t\t\t'borderColor',\n\t\t\t'borderWidth',\n\t\t\t'hoverBackgroundColor',\n\t\t\t'hoverBorderColor',\n\t\t\t'hoverBorderWidth',\n\t\t\t'hoverRadius',\n\t\t\t'hitRadius',\n\t\t\t'pointStyle',\n\t\t\t'rotation'\n\t\t];\n\n\t\tfor (i = 0, ilen = keys.length; i < ilen; ++i) {\n\t\t\tkey = keys[i];\n\t\t\tvalues[key] = resolve$2([\n\t\t\t\tcustom[key],\n\t\t\t\tdataset[key],\n\t\t\t\toptions[key]\n\t\t\t], context, index);\n\t\t}\n\n\t\t// Custom radius resolution\n\t\tvalues.radius = resolve$2([\n\t\t\tcustom.radius,\n\t\t\tdata ? data.r : undefined,\n\t\t\tdataset.radius,\n\t\t\toptions.radius\n\t\t], context, index);\n\n\t\treturn values;\n\t}\n});\n\nvar resolve$3 = helpers$1.options.resolve;\nvar valueOrDefault$4 = helpers$1.valueOrDefault;\n\ncore_defaults._set('doughnut', {\n\tanimation: {\n\t\t// Boolean - Whether we animate the rotation of the Doughnut\n\t\tanimateRotate: true,\n\t\t// Boolean - Whether we animate scaling the Doughnut from the centre\n\t\tanimateScale: false\n\t},\n\thover: {\n\t\tmode: 'single'\n\t},\n\tlegendCallback: function(chart) {\n\t\tvar text = [];\n\t\ttext.push('');\n\t\treturn text.join('');\n\t},\n\tlegend: {\n\t\tlabels: {\n\t\t\tgenerateLabels: function(chart) {\n\t\t\t\tvar data = chart.data;\n\t\t\t\tif (data.labels.length && data.datasets.length) {\n\t\t\t\t\treturn data.labels.map(function(label, i) {\n\t\t\t\t\t\tvar meta = chart.getDatasetMeta(0);\n\t\t\t\t\t\tvar ds = data.datasets[0];\n\t\t\t\t\t\tvar arc = meta.data[i];\n\t\t\t\t\t\tvar custom = arc && arc.custom || {};\n\t\t\t\t\t\tvar arcOpts = chart.options.elements.arc;\n\t\t\t\t\t\tvar fill = resolve$3([custom.backgroundColor, ds.backgroundColor, arcOpts.backgroundColor], undefined, i);\n\t\t\t\t\t\tvar stroke = resolve$3([custom.borderColor, ds.borderColor, arcOpts.borderColor], undefined, i);\n\t\t\t\t\t\tvar bw = resolve$3([custom.borderWidth, ds.borderWidth, arcOpts.borderWidth], undefined, i);\n\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\ttext: label,\n\t\t\t\t\t\t\tfillStyle: fill,\n\t\t\t\t\t\t\tstrokeStyle: stroke,\n\t\t\t\t\t\t\tlineWidth: bw,\n\t\t\t\t\t\t\thidden: isNaN(ds.data[i]) || meta.data[i].hidden,\n\n\t\t\t\t\t\t\t// Extra data used for toggling the correct item\n\t\t\t\t\t\t\tindex: i\n\t\t\t\t\t\t};\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn [];\n\t\t\t}\n\t\t},\n\n\t\tonClick: function(e, legendItem) {\n\t\t\tvar index = legendItem.index;\n\t\t\tvar chart = this.chart;\n\t\t\tvar i, ilen, meta;\n\n\t\t\tfor (i = 0, ilen = (chart.data.datasets || []).length; i < ilen; ++i) {\n\t\t\t\tmeta = chart.getDatasetMeta(i);\n\t\t\t\t// toggle visibility of index if exists\n\t\t\t\tif (meta.data[index]) {\n\t\t\t\t\tmeta.data[index].hidden = !meta.data[index].hidden;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tchart.update();\n\t\t}\n\t},\n\n\t// The percentage of the chart that we cut out of the middle.\n\tcutoutPercentage: 50,\n\n\t// The rotation of the chart, where the first data arc begins.\n\trotation: Math.PI * -0.5,\n\n\t// The total circumference of the chart.\n\tcircumference: Math.PI * 2.0,\n\n\t// Need to override these to give a nice default\n\ttooltips: {\n\t\tcallbacks: {\n\t\t\ttitle: function() {\n\t\t\t\treturn '';\n\t\t\t},\n\t\t\tlabel: function(tooltipItem, data) {\n\t\t\t\tvar dataLabel = data.labels[tooltipItem.index];\n\t\t\t\tvar value = ': ' + data.datasets[tooltipItem.datasetIndex].data[tooltipItem.index];\n\n\t\t\t\tif (helpers$1.isArray(dataLabel)) {\n\t\t\t\t\t// show value on first line of multiline label\n\t\t\t\t\t// need to clone because we are changing the value\n\t\t\t\t\tdataLabel = dataLabel.slice();\n\t\t\t\t\tdataLabel[0] += value;\n\t\t\t\t} else {\n\t\t\t\t\tdataLabel += value;\n\t\t\t\t}\n\n\t\t\t\treturn dataLabel;\n\t\t\t}\n\t\t}\n\t}\n});\n\nvar controller_doughnut = core_datasetController.extend({\n\n\tdataElementType: elements.Arc,\n\n\tlinkScales: helpers$1.noop,\n\n\t// Get index of the dataset in relation to the visible datasets. This allows determining the inner and outer radius correctly\n\tgetRingIndex: function(datasetIndex) {\n\t\tvar ringIndex = 0;\n\n\t\tfor (var j = 0; j < datasetIndex; ++j) {\n\t\t\tif (this.chart.isDatasetVisible(j)) {\n\t\t\t\t++ringIndex;\n\t\t\t}\n\t\t}\n\n\t\treturn ringIndex;\n\t},\n\n\tupdate: function(reset) {\n\t\tvar me = this;\n\t\tvar chart = me.chart;\n\t\tvar chartArea = chart.chartArea;\n\t\tvar opts = chart.options;\n\t\tvar availableWidth = chartArea.right - chartArea.left;\n\t\tvar availableHeight = chartArea.bottom - chartArea.top;\n\t\tvar minSize = Math.min(availableWidth, availableHeight);\n\t\tvar offset = {x: 0, y: 0};\n\t\tvar meta = me.getMeta();\n\t\tvar arcs = meta.data;\n\t\tvar cutoutPercentage = opts.cutoutPercentage;\n\t\tvar circumference = opts.circumference;\n\t\tvar chartWeight = me._getRingWeight(me.index);\n\t\tvar i, ilen;\n\n\t\t// If the chart's circumference isn't a full circle, calculate minSize as a ratio of the width/height of the arc\n\t\tif (circumference < Math.PI * 2.0) {\n\t\t\tvar startAngle = opts.rotation % (Math.PI * 2.0);\n\t\t\tstartAngle += Math.PI * 2.0 * (startAngle >= Math.PI ? -1 : startAngle < -Math.PI ? 1 : 0);\n\t\t\tvar endAngle = startAngle + circumference;\n\t\t\tvar start = {x: Math.cos(startAngle), y: Math.sin(startAngle)};\n\t\t\tvar end = {x: Math.cos(endAngle), y: Math.sin(endAngle)};\n\t\t\tvar contains0 = (startAngle <= 0 && endAngle >= 0) || (startAngle <= Math.PI * 2.0 && Math.PI * 2.0 <= endAngle);\n\t\t\tvar contains90 = (startAngle <= Math.PI * 0.5 && Math.PI * 0.5 <= endAngle) || (startAngle <= Math.PI * 2.5 && Math.PI * 2.5 <= endAngle);\n\t\t\tvar contains180 = (startAngle <= -Math.PI && -Math.PI <= endAngle) || (startAngle <= Math.PI && Math.PI <= endAngle);\n\t\t\tvar contains270 = (startAngle <= -Math.PI * 0.5 && -Math.PI * 0.5 <= endAngle) || (startAngle <= Math.PI * 1.5 && Math.PI * 1.5 <= endAngle);\n\t\t\tvar cutout = cutoutPercentage / 100.0;\n\t\t\tvar min = {x: contains180 ? -1 : Math.min(start.x * (start.x < 0 ? 1 : cutout), end.x * (end.x < 0 ? 1 : cutout)), y: contains270 ? -1 : Math.min(start.y * (start.y < 0 ? 1 : cutout), end.y * (end.y < 0 ? 1 : cutout))};\n\t\t\tvar max = {x: contains0 ? 1 : Math.max(start.x * (start.x > 0 ? 1 : cutout), end.x * (end.x > 0 ? 1 : cutout)), y: contains90 ? 1 : Math.max(start.y * (start.y > 0 ? 1 : cutout), end.y * (end.y > 0 ? 1 : cutout))};\n\t\t\tvar size = {width: (max.x - min.x) * 0.5, height: (max.y - min.y) * 0.5};\n\t\t\tminSize = Math.min(availableWidth / size.width, availableHeight / size.height);\n\t\t\toffset = {x: (max.x + min.x) * -0.5, y: (max.y + min.y) * -0.5};\n\t\t}\n\n\t\tfor (i = 0, ilen = arcs.length; i < ilen; ++i) {\n\t\t\tarcs[i]._options = me._resolveElementOptions(arcs[i], i);\n\t\t}\n\n\t\tchart.borderWidth = me.getMaxBorderWidth();\n\t\tchart.outerRadius = Math.max((minSize - chart.borderWidth) / 2, 0);\n\t\tchart.innerRadius = Math.max(cutoutPercentage ? (chart.outerRadius / 100) * (cutoutPercentage) : 0, 0);\n\t\tchart.radiusLength = (chart.outerRadius - chart.innerRadius) / (me._getVisibleDatasetWeightTotal() || 1);\n\t\tchart.offsetX = offset.x * chart.outerRadius;\n\t\tchart.offsetY = offset.y * chart.outerRadius;\n\n\t\tmeta.total = me.calculateTotal();\n\n\t\tme.outerRadius = chart.outerRadius - chart.radiusLength * me._getRingWeightOffset(me.index);\n\t\tme.innerRadius = Math.max(me.outerRadius - chart.radiusLength * chartWeight, 0);\n\n\t\tfor (i = 0, ilen = arcs.length; i < ilen; ++i) {\n\t\t\tme.updateElement(arcs[i], i, reset);\n\t\t}\n\t},\n\n\tupdateElement: function(arc, index, reset) {\n\t\tvar me = this;\n\t\tvar chart = me.chart;\n\t\tvar chartArea = chart.chartArea;\n\t\tvar opts = chart.options;\n\t\tvar animationOpts = opts.animation;\n\t\tvar centerX = (chartArea.left + chartArea.right) / 2;\n\t\tvar centerY = (chartArea.top + chartArea.bottom) / 2;\n\t\tvar startAngle = opts.rotation; // non reset case handled later\n\t\tvar endAngle = opts.rotation; // non reset case handled later\n\t\tvar dataset = me.getDataset();\n\t\tvar circumference = reset && animationOpts.animateRotate ? 0 : arc.hidden ? 0 : me.calculateCircumference(dataset.data[index]) * (opts.circumference / (2.0 * Math.PI));\n\t\tvar innerRadius = reset && animationOpts.animateScale ? 0 : me.innerRadius;\n\t\tvar outerRadius = reset && animationOpts.animateScale ? 0 : me.outerRadius;\n\t\tvar options = arc._options || {};\n\n\t\thelpers$1.extend(arc, {\n\t\t\t// Utility\n\t\t\t_datasetIndex: me.index,\n\t\t\t_index: index,\n\n\t\t\t// Desired view properties\n\t\t\t_model: {\n\t\t\t\tbackgroundColor: options.backgroundColor,\n\t\t\t\tborderColor: options.borderColor,\n\t\t\t\tborderWidth: options.borderWidth,\n\t\t\t\tborderAlign: options.borderAlign,\n\t\t\t\tx: centerX + chart.offsetX,\n\t\t\t\ty: centerY + chart.offsetY,\n\t\t\t\tstartAngle: startAngle,\n\t\t\t\tendAngle: endAngle,\n\t\t\t\tcircumference: circumference,\n\t\t\t\touterRadius: outerRadius,\n\t\t\t\tinnerRadius: innerRadius,\n\t\t\t\tlabel: helpers$1.valueAtIndexOrDefault(dataset.label, index, chart.data.labels[index])\n\t\t\t}\n\t\t});\n\n\t\tvar model = arc._model;\n\n\t\t// Set correct angles if not resetting\n\t\tif (!reset || !animationOpts.animateRotate) {\n\t\t\tif (index === 0) {\n\t\t\t\tmodel.startAngle = opts.rotation;\n\t\t\t} else {\n\t\t\t\tmodel.startAngle = me.getMeta().data[index - 1]._model.endAngle;\n\t\t\t}\n\n\t\t\tmodel.endAngle = model.startAngle + model.circumference;\n\t\t}\n\n\t\tarc.pivot();\n\t},\n\n\tcalculateTotal: function() {\n\t\tvar dataset = this.getDataset();\n\t\tvar meta = this.getMeta();\n\t\tvar total = 0;\n\t\tvar value;\n\n\t\thelpers$1.each(meta.data, function(element, index) {\n\t\t\tvalue = dataset.data[index];\n\t\t\tif (!isNaN(value) && !element.hidden) {\n\t\t\t\ttotal += Math.abs(value);\n\t\t\t}\n\t\t});\n\n\t\t/* if (total === 0) {\n\t\t\ttotal = NaN;\n\t\t}*/\n\n\t\treturn total;\n\t},\n\n\tcalculateCircumference: function(value) {\n\t\tvar total = this.getMeta().total;\n\t\tif (total > 0 && !isNaN(value)) {\n\t\t\treturn (Math.PI * 2.0) * (Math.abs(value) / total);\n\t\t}\n\t\treturn 0;\n\t},\n\n\t// gets the max border or hover width to properly scale pie charts\n\tgetMaxBorderWidth: function(arcs) {\n\t\tvar me = this;\n\t\tvar max = 0;\n\t\tvar chart = me.chart;\n\t\tvar i, ilen, meta, arc, controller, options, borderWidth, hoverWidth;\n\n\t\tif (!arcs) {\n\t\t\t// Find the outmost visible dataset\n\t\t\tfor (i = 0, ilen = chart.data.datasets.length; i < ilen; ++i) {\n\t\t\t\tif (chart.isDatasetVisible(i)) {\n\t\t\t\t\tmeta = chart.getDatasetMeta(i);\n\t\t\t\t\tarcs = meta.data;\n\t\t\t\t\tif (i !== me.index) {\n\t\t\t\t\t\tcontroller = meta.controller;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (!arcs) {\n\t\t\treturn 0;\n\t\t}\n\n\t\tfor (i = 0, ilen = arcs.length; i < ilen; ++i) {\n\t\t\tarc = arcs[i];\n\t\t\toptions = controller ? controller._resolveElementOptions(arc, i) : arc._options;\n\t\t\tif (options.borderAlign !== 'inner') {\n\t\t\t\tborderWidth = options.borderWidth;\n\t\t\t\thoverWidth = options.hoverBorderWidth;\n\n\t\t\t\tmax = borderWidth > max ? borderWidth : max;\n\t\t\t\tmax = hoverWidth > max ? hoverWidth : max;\n\t\t\t}\n\t\t}\n\t\treturn max;\n\t},\n\n\t/**\n\t * @protected\n\t */\n\tsetHoverStyle: function(arc) {\n\t\tvar model = arc._model;\n\t\tvar options = arc._options;\n\t\tvar getHoverColor = helpers$1.getHoverColor;\n\n\t\tarc.$previousStyle = {\n\t\t\tbackgroundColor: model.backgroundColor,\n\t\t\tborderColor: model.borderColor,\n\t\t\tborderWidth: model.borderWidth,\n\t\t};\n\n\t\tmodel.backgroundColor = valueOrDefault$4(options.hoverBackgroundColor, getHoverColor(options.backgroundColor));\n\t\tmodel.borderColor = valueOrDefault$4(options.hoverBorderColor, getHoverColor(options.borderColor));\n\t\tmodel.borderWidth = valueOrDefault$4(options.hoverBorderWidth, options.borderWidth);\n\t},\n\n\t/**\n\t * @private\n\t */\n\t_resolveElementOptions: function(arc, index) {\n\t\tvar me = this;\n\t\tvar chart = me.chart;\n\t\tvar dataset = me.getDataset();\n\t\tvar custom = arc.custom || {};\n\t\tvar options = chart.options.elements.arc;\n\t\tvar values = {};\n\t\tvar i, ilen, key;\n\n\t\t// Scriptable options\n\t\tvar context = {\n\t\t\tchart: chart,\n\t\t\tdataIndex: index,\n\t\t\tdataset: dataset,\n\t\t\tdatasetIndex: me.index\n\t\t};\n\n\t\tvar keys = [\n\t\t\t'backgroundColor',\n\t\t\t'borderColor',\n\t\t\t'borderWidth',\n\t\t\t'borderAlign',\n\t\t\t'hoverBackgroundColor',\n\t\t\t'hoverBorderColor',\n\t\t\t'hoverBorderWidth',\n\t\t];\n\n\t\tfor (i = 0, ilen = keys.length; i < ilen; ++i) {\n\t\t\tkey = keys[i];\n\t\t\tvalues[key] = resolve$3([\n\t\t\t\tcustom[key],\n\t\t\t\tdataset[key],\n\t\t\t\toptions[key]\n\t\t\t], context, index);\n\t\t}\n\n\t\treturn values;\n\t},\n\n\t/**\n\t * Get radius length offset of the dataset in relation to the visible datasets weights. This allows determining the inner and outer radius correctly\n\t * @private\n\t */\n\t_getRingWeightOffset: function(datasetIndex) {\n\t\tvar ringWeightOffset = 0;\n\n\t\tfor (var i = 0; i < datasetIndex; ++i) {\n\t\t\tif (this.chart.isDatasetVisible(i)) {\n\t\t\t\tringWeightOffset += this._getRingWeight(i);\n\t\t\t}\n\t\t}\n\n\t\treturn ringWeightOffset;\n\t},\n\n\t/**\n\t * @private\n\t */\n\t_getRingWeight: function(dataSetIndex) {\n\t\treturn Math.max(valueOrDefault$4(this.chart.data.datasets[dataSetIndex].weight, 1), 0);\n\t},\n\n\t/**\n\t * Returns the sum of all visibile data set weights. This value can be 0.\n\t * @private\n\t */\n\t_getVisibleDatasetWeightTotal: function() {\n\t\treturn this._getRingWeightOffset(this.chart.data.datasets.length);\n\t}\n});\n\ncore_defaults._set('horizontalBar', {\n\thover: {\n\t\tmode: 'index',\n\t\taxis: 'y'\n\t},\n\n\tscales: {\n\t\txAxes: [{\n\t\t\ttype: 'linear',\n\t\t\tposition: 'bottom'\n\t\t}],\n\n\t\tyAxes: [{\n\t\t\ttype: 'category',\n\t\t\tposition: 'left',\n\t\t\tcategoryPercentage: 0.8,\n\t\t\tbarPercentage: 0.9,\n\t\t\toffset: true,\n\t\t\tgridLines: {\n\t\t\t\toffsetGridLines: true\n\t\t\t}\n\t\t}]\n\t},\n\n\telements: {\n\t\trectangle: {\n\t\t\tborderSkipped: 'left'\n\t\t}\n\t},\n\n\ttooltips: {\n\t\tmode: 'index',\n\t\taxis: 'y'\n\t}\n});\n\nvar controller_horizontalBar = controller_bar.extend({\n\t/**\n\t * @private\n\t */\n\t_getValueScaleId: function() {\n\t\treturn this.getMeta().xAxisID;\n\t},\n\n\t/**\n\t * @private\n\t */\n\t_getIndexScaleId: function() {\n\t\treturn this.getMeta().yAxisID;\n\t}\n});\n\nvar valueOrDefault$5 = helpers$1.valueOrDefault;\nvar resolve$4 = helpers$1.options.resolve;\nvar isPointInArea = helpers$1.canvas._isPointInArea;\n\ncore_defaults._set('line', {\n\tshowLines: true,\n\tspanGaps: false,\n\n\thover: {\n\t\tmode: 'label'\n\t},\n\n\tscales: {\n\t\txAxes: [{\n\t\t\ttype: 'category',\n\t\t\tid: 'x-axis-0'\n\t\t}],\n\t\tyAxes: [{\n\t\t\ttype: 'linear',\n\t\t\tid: 'y-axis-0'\n\t\t}]\n\t}\n});\n\nfunction lineEnabled(dataset, options) {\n\treturn valueOrDefault$5(dataset.showLine, options.showLines);\n}\n\nvar controller_line = core_datasetController.extend({\n\n\tdatasetElementType: elements.Line,\n\n\tdataElementType: elements.Point,\n\n\tupdate: function(reset) {\n\t\tvar me = this;\n\t\tvar meta = me.getMeta();\n\t\tvar line = meta.dataset;\n\t\tvar points = meta.data || [];\n\t\tvar scale = me.getScaleForId(meta.yAxisID);\n\t\tvar dataset = me.getDataset();\n\t\tvar showLine = lineEnabled(dataset, me.chart.options);\n\t\tvar i, ilen;\n\n\t\t// Update Line\n\t\tif (showLine) {\n\t\t\t// Compatibility: If the properties are defined with only the old name, use those values\n\t\t\tif ((dataset.tension !== undefined) && (dataset.lineTension === undefined)) {\n\t\t\t\tdataset.lineTension = dataset.tension;\n\t\t\t}\n\n\t\t\t// Utility\n\t\t\tline._scale = scale;\n\t\t\tline._datasetIndex = me.index;\n\t\t\t// Data\n\t\t\tline._children = points;\n\t\t\t// Model\n\t\t\tline._model = me._resolveLineOptions(line);\n\n\t\t\tline.pivot();\n\t\t}\n\n\t\t// Update Points\n\t\tfor (i = 0, ilen = points.length; i < ilen; ++i) {\n\t\t\tme.updateElement(points[i], i, reset);\n\t\t}\n\n\t\tif (showLine && line._model.tension !== 0) {\n\t\t\tme.updateBezierControlPoints();\n\t\t}\n\n\t\t// Now pivot the point for animation\n\t\tfor (i = 0, ilen = points.length; i < ilen; ++i) {\n\t\t\tpoints[i].pivot();\n\t\t}\n\t},\n\n\tupdateElement: function(point, index, reset) {\n\t\tvar me = this;\n\t\tvar meta = me.getMeta();\n\t\tvar custom = point.custom || {};\n\t\tvar dataset = me.getDataset();\n\t\tvar datasetIndex = me.index;\n\t\tvar value = dataset.data[index];\n\t\tvar yScale = me.getScaleForId(meta.yAxisID);\n\t\tvar xScale = me.getScaleForId(meta.xAxisID);\n\t\tvar lineModel = meta.dataset._model;\n\t\tvar x, y;\n\n\t\tvar options = me._resolvePointOptions(point, index);\n\n\t\tx = xScale.getPixelForValue(typeof value === 'object' ? value : NaN, index, datasetIndex);\n\t\ty = reset ? yScale.getBasePixel() : me.calculatePointY(value, index, datasetIndex);\n\n\t\t// Utility\n\t\tpoint._xScale = xScale;\n\t\tpoint._yScale = yScale;\n\t\tpoint._options = options;\n\t\tpoint._datasetIndex = datasetIndex;\n\t\tpoint._index = index;\n\n\t\t// Desired view properties\n\t\tpoint._model = {\n\t\t\tx: x,\n\t\t\ty: y,\n\t\t\tskip: custom.skip || isNaN(x) || isNaN(y),\n\t\t\t// Appearance\n\t\t\tradius: options.radius,\n\t\t\tpointStyle: options.pointStyle,\n\t\t\trotation: options.rotation,\n\t\t\tbackgroundColor: options.backgroundColor,\n\t\t\tborderColor: options.borderColor,\n\t\t\tborderWidth: options.borderWidth,\n\t\t\ttension: valueOrDefault$5(custom.tension, lineModel ? lineModel.tension : 0),\n\t\t\tsteppedLine: lineModel ? lineModel.steppedLine : false,\n\t\t\t// Tooltip\n\t\t\thitRadius: options.hitRadius\n\t\t};\n\t},\n\n\t/**\n\t * @private\n\t */\n\t_resolvePointOptions: function(element, index) {\n\t\tvar me = this;\n\t\tvar chart = me.chart;\n\t\tvar dataset = chart.data.datasets[me.index];\n\t\tvar custom = element.custom || {};\n\t\tvar options = chart.options.elements.point;\n\t\tvar values = {};\n\t\tvar i, ilen, key;\n\n\t\t// Scriptable options\n\t\tvar context = {\n\t\t\tchart: chart,\n\t\t\tdataIndex: index,\n\t\t\tdataset: dataset,\n\t\t\tdatasetIndex: me.index\n\t\t};\n\n\t\tvar ELEMENT_OPTIONS = {\n\t\t\tbackgroundColor: 'pointBackgroundColor',\n\t\t\tborderColor: 'pointBorderColor',\n\t\t\tborderWidth: 'pointBorderWidth',\n\t\t\thitRadius: 'pointHitRadius',\n\t\t\thoverBackgroundColor: 'pointHoverBackgroundColor',\n\t\t\thoverBorderColor: 'pointHoverBorderColor',\n\t\t\thoverBorderWidth: 'pointHoverBorderWidth',\n\t\t\thoverRadius: 'pointHoverRadius',\n\t\t\tpointStyle: 'pointStyle',\n\t\t\tradius: 'pointRadius',\n\t\t\trotation: 'pointRotation'\n\t\t};\n\t\tvar keys = Object.keys(ELEMENT_OPTIONS);\n\n\t\tfor (i = 0, ilen = keys.length; i < ilen; ++i) {\n\t\t\tkey = keys[i];\n\t\t\tvalues[key] = resolve$4([\n\t\t\t\tcustom[key],\n\t\t\t\tdataset[ELEMENT_OPTIONS[key]],\n\t\t\t\tdataset[key],\n\t\t\t\toptions[key]\n\t\t\t], context, index);\n\t\t}\n\n\t\treturn values;\n\t},\n\n\t/**\n\t * @private\n\t */\n\t_resolveLineOptions: function(element) {\n\t\tvar me = this;\n\t\tvar chart = me.chart;\n\t\tvar dataset = chart.data.datasets[me.index];\n\t\tvar custom = element.custom || {};\n\t\tvar options = chart.options;\n\t\tvar elementOptions = options.elements.line;\n\t\tvar values = {};\n\t\tvar i, ilen, key;\n\n\t\tvar keys = [\n\t\t\t'backgroundColor',\n\t\t\t'borderWidth',\n\t\t\t'borderColor',\n\t\t\t'borderCapStyle',\n\t\t\t'borderDash',\n\t\t\t'borderDashOffset',\n\t\t\t'borderJoinStyle',\n\t\t\t'fill',\n\t\t\t'cubicInterpolationMode'\n\t\t];\n\n\t\tfor (i = 0, ilen = keys.length; i < ilen; ++i) {\n\t\t\tkey = keys[i];\n\t\t\tvalues[key] = resolve$4([\n\t\t\t\tcustom[key],\n\t\t\t\tdataset[key],\n\t\t\t\telementOptions[key]\n\t\t\t]);\n\t\t}\n\n\t\t// The default behavior of lines is to break at null values, according\n\t\t// to https://github.com/chartjs/Chart.js/issues/2435#issuecomment-216718158\n\t\t// This option gives lines the ability to span gaps\n\t\tvalues.spanGaps = valueOrDefault$5(dataset.spanGaps, options.spanGaps);\n\t\tvalues.tension = valueOrDefault$5(dataset.lineTension, elementOptions.tension);\n\t\tvalues.steppedLine = resolve$4([custom.steppedLine, dataset.steppedLine, elementOptions.stepped]);\n\n\t\treturn values;\n\t},\n\n\tcalculatePointY: function(value, index, datasetIndex) {\n\t\tvar me = this;\n\t\tvar chart = me.chart;\n\t\tvar meta = me.getMeta();\n\t\tvar yScale = me.getScaleForId(meta.yAxisID);\n\t\tvar sumPos = 0;\n\t\tvar sumNeg = 0;\n\t\tvar i, ds, dsMeta;\n\n\t\tif (yScale.options.stacked) {\n\t\t\tfor (i = 0; i < datasetIndex; i++) {\n\t\t\t\tds = chart.data.datasets[i];\n\t\t\t\tdsMeta = chart.getDatasetMeta(i);\n\t\t\t\tif (dsMeta.type === 'line' && dsMeta.yAxisID === yScale.id && chart.isDatasetVisible(i)) {\n\t\t\t\t\tvar stackedRightValue = Number(yScale.getRightValue(ds.data[index]));\n\t\t\t\t\tif (stackedRightValue < 0) {\n\t\t\t\t\t\tsumNeg += stackedRightValue || 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsumPos += stackedRightValue || 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar rightValue = Number(yScale.getRightValue(value));\n\t\t\tif (rightValue < 0) {\n\t\t\t\treturn yScale.getPixelForValue(sumNeg + rightValue);\n\t\t\t}\n\t\t\treturn yScale.getPixelForValue(sumPos + rightValue);\n\t\t}\n\n\t\treturn yScale.getPixelForValue(value);\n\t},\n\n\tupdateBezierControlPoints: function() {\n\t\tvar me = this;\n\t\tvar chart = me.chart;\n\t\tvar meta = me.getMeta();\n\t\tvar lineModel = meta.dataset._model;\n\t\tvar area = chart.chartArea;\n\t\tvar points = meta.data || [];\n\t\tvar i, ilen, model, controlPoints;\n\n\t\t// Only consider points that are drawn in case the spanGaps option is used\n\t\tif (lineModel.spanGaps) {\n\t\t\tpoints = points.filter(function(pt) {\n\t\t\t\treturn !pt._model.skip;\n\t\t\t});\n\t\t}\n\n\t\tfunction capControlPoint(pt, min, max) {\n\t\t\treturn Math.max(Math.min(pt, max), min);\n\t\t}\n\n\t\tif (lineModel.cubicInterpolationMode === 'monotone') {\n\t\t\thelpers$1.splineCurveMonotone(points);\n\t\t} else {\n\t\t\tfor (i = 0, ilen = points.length; i < ilen; ++i) {\n\t\t\t\tmodel = points[i]._model;\n\t\t\t\tcontrolPoints = helpers$1.splineCurve(\n\t\t\t\t\thelpers$1.previousItem(points, i)._model,\n\t\t\t\t\tmodel,\n\t\t\t\t\thelpers$1.nextItem(points, i)._model,\n\t\t\t\t\tlineModel.tension\n\t\t\t\t);\n\t\t\t\tmodel.controlPointPreviousX = controlPoints.previous.x;\n\t\t\t\tmodel.controlPointPreviousY = controlPoints.previous.y;\n\t\t\t\tmodel.controlPointNextX = controlPoints.next.x;\n\t\t\t\tmodel.controlPointNextY = controlPoints.next.y;\n\t\t\t}\n\t\t}\n\n\t\tif (chart.options.elements.line.capBezierPoints) {\n\t\t\tfor (i = 0, ilen = points.length; i < ilen; ++i) {\n\t\t\t\tmodel = points[i]._model;\n\t\t\t\tif (isPointInArea(model, area)) {\n\t\t\t\t\tif (i > 0 && isPointInArea(points[i - 1]._model, area)) {\n\t\t\t\t\t\tmodel.controlPointPreviousX = capControlPoint(model.controlPointPreviousX, area.left, area.right);\n\t\t\t\t\t\tmodel.controlPointPreviousY = capControlPoint(model.controlPointPreviousY, area.top, area.bottom);\n\t\t\t\t\t}\n\t\t\t\t\tif (i < points.length - 1 && isPointInArea(points[i + 1]._model, area)) {\n\t\t\t\t\t\tmodel.controlPointNextX = capControlPoint(model.controlPointNextX, area.left, area.right);\n\t\t\t\t\t\tmodel.controlPointNextY = capControlPoint(model.controlPointNextY, area.top, area.bottom);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\n\tdraw: function() {\n\t\tvar me = this;\n\t\tvar chart = me.chart;\n\t\tvar meta = me.getMeta();\n\t\tvar points = meta.data || [];\n\t\tvar area = chart.chartArea;\n\t\tvar ilen = points.length;\n\t\tvar halfBorderWidth;\n\t\tvar i = 0;\n\n\t\tif (lineEnabled(me.getDataset(), chart.options)) {\n\t\t\thalfBorderWidth = (meta.dataset._model.borderWidth || 0) / 2;\n\n\t\t\thelpers$1.canvas.clipArea(chart.ctx, {\n\t\t\t\tleft: area.left,\n\t\t\t\tright: area.right,\n\t\t\t\ttop: area.top - halfBorderWidth,\n\t\t\t\tbottom: area.bottom + halfBorderWidth\n\t\t\t});\n\n\t\t\tmeta.dataset.draw();\n\n\t\t\thelpers$1.canvas.unclipArea(chart.ctx);\n\t\t}\n\n\t\t// Draw the points\n\t\tfor (; i < ilen; ++i) {\n\t\t\tpoints[i].draw(area);\n\t\t}\n\t},\n\n\t/**\n\t * @protected\n\t */\n\tsetHoverStyle: function(point) {\n\t\tvar model = point._model;\n\t\tvar options = point._options;\n\t\tvar getHoverColor = helpers$1.getHoverColor;\n\n\t\tpoint.$previousStyle = {\n\t\t\tbackgroundColor: model.backgroundColor,\n\t\t\tborderColor: model.borderColor,\n\t\t\tborderWidth: model.borderWidth,\n\t\t\tradius: model.radius\n\t\t};\n\n\t\tmodel.backgroundColor = valueOrDefault$5(options.hoverBackgroundColor, getHoverColor(options.backgroundColor));\n\t\tmodel.borderColor = valueOrDefault$5(options.hoverBorderColor, getHoverColor(options.borderColor));\n\t\tmodel.borderWidth = valueOrDefault$5(options.hoverBorderWidth, options.borderWidth);\n\t\tmodel.radius = valueOrDefault$5(options.hoverRadius, options.radius);\n\t},\n});\n\nvar resolve$5 = helpers$1.options.resolve;\n\ncore_defaults._set('polarArea', {\n\tscale: {\n\t\ttype: 'radialLinear',\n\t\tangleLines: {\n\t\t\tdisplay: false\n\t\t},\n\t\tgridLines: {\n\t\t\tcircular: true\n\t\t},\n\t\tpointLabels: {\n\t\t\tdisplay: false\n\t\t},\n\t\tticks: {\n\t\t\tbeginAtZero: true\n\t\t}\n\t},\n\n\t// Boolean - Whether to animate the rotation of the chart\n\tanimation: {\n\t\tanimateRotate: true,\n\t\tanimateScale: true\n\t},\n\n\tstartAngle: -0.5 * Math.PI,\n\tlegendCallback: function(chart) {\n\t\tvar text = [];\n\t\ttext.push('');\n\t\treturn text.join('');\n\t},\n\tlegend: {\n\t\tlabels: {\n\t\t\tgenerateLabels: function(chart) {\n\t\t\t\tvar data = chart.data;\n\t\t\t\tif (data.labels.length && data.datasets.length) {\n\t\t\t\t\treturn data.labels.map(function(label, i) {\n\t\t\t\t\t\tvar meta = chart.getDatasetMeta(0);\n\t\t\t\t\t\tvar ds = data.datasets[0];\n\t\t\t\t\t\tvar arc = meta.data[i];\n\t\t\t\t\t\tvar custom = arc.custom || {};\n\t\t\t\t\t\tvar arcOpts = chart.options.elements.arc;\n\t\t\t\t\t\tvar fill = resolve$5([custom.backgroundColor, ds.backgroundColor, arcOpts.backgroundColor], undefined, i);\n\t\t\t\t\t\tvar stroke = resolve$5([custom.borderColor, ds.borderColor, arcOpts.borderColor], undefined, i);\n\t\t\t\t\t\tvar bw = resolve$5([custom.borderWidth, ds.borderWidth, arcOpts.borderWidth], undefined, i);\n\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\ttext: label,\n\t\t\t\t\t\t\tfillStyle: fill,\n\t\t\t\t\t\t\tstrokeStyle: stroke,\n\t\t\t\t\t\t\tlineWidth: bw,\n\t\t\t\t\t\t\thidden: isNaN(ds.data[i]) || meta.data[i].hidden,\n\n\t\t\t\t\t\t\t// Extra data used for toggling the correct item\n\t\t\t\t\t\t\tindex: i\n\t\t\t\t\t\t};\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn [];\n\t\t\t}\n\t\t},\n\n\t\tonClick: function(e, legendItem) {\n\t\t\tvar index = legendItem.index;\n\t\t\tvar chart = this.chart;\n\t\t\tvar i, ilen, meta;\n\n\t\t\tfor (i = 0, ilen = (chart.data.datasets || []).length; i < ilen; ++i) {\n\t\t\t\tmeta = chart.getDatasetMeta(i);\n\t\t\t\tmeta.data[index].hidden = !meta.data[index].hidden;\n\t\t\t}\n\n\t\t\tchart.update();\n\t\t}\n\t},\n\n\t// Need to override these to give a nice default\n\ttooltips: {\n\t\tcallbacks: {\n\t\t\ttitle: function() {\n\t\t\t\treturn '';\n\t\t\t},\n\t\t\tlabel: function(item, data) {\n\t\t\t\treturn data.labels[item.index] + ': ' + item.yLabel;\n\t\t\t}\n\t\t}\n\t}\n});\n\nvar controller_polarArea = core_datasetController.extend({\n\n\tdataElementType: elements.Arc,\n\n\tlinkScales: helpers$1.noop,\n\n\tupdate: function(reset) {\n\t\tvar me = this;\n\t\tvar dataset = me.getDataset();\n\t\tvar meta = me.getMeta();\n\t\tvar start = me.chart.options.startAngle || 0;\n\t\tvar starts = me._starts = [];\n\t\tvar angles = me._angles = [];\n\t\tvar arcs = meta.data;\n\t\tvar i, ilen, angle;\n\n\t\tme._updateRadius();\n\n\t\tmeta.count = me.countVisibleElements();\n\n\t\tfor (i = 0, ilen = dataset.data.length; i < ilen; i++) {\n\t\t\tstarts[i] = start;\n\t\t\tangle = me._computeAngle(i);\n\t\t\tangles[i] = angle;\n\t\t\tstart += angle;\n\t\t}\n\n\t\tfor (i = 0, ilen = arcs.length; i < ilen; ++i) {\n\t\t\tarcs[i]._options = me._resolveElementOptions(arcs[i], i);\n\t\t\tme.updateElement(arcs[i], i, reset);\n\t\t}\n\t},\n\n\t/**\n\t * @private\n\t */\n\t_updateRadius: function() {\n\t\tvar me = this;\n\t\tvar chart = me.chart;\n\t\tvar chartArea = chart.chartArea;\n\t\tvar opts = chart.options;\n\t\tvar minSize = Math.min(chartArea.right - chartArea.left, chartArea.bottom - chartArea.top);\n\n\t\tchart.outerRadius = Math.max(minSize / 2, 0);\n\t\tchart.innerRadius = Math.max(opts.cutoutPercentage ? (chart.outerRadius / 100) * (opts.cutoutPercentage) : 1, 0);\n\t\tchart.radiusLength = (chart.outerRadius - chart.innerRadius) / chart.getVisibleDatasetCount();\n\n\t\tme.outerRadius = chart.outerRadius - (chart.radiusLength * me.index);\n\t\tme.innerRadius = me.outerRadius - chart.radiusLength;\n\t},\n\n\tupdateElement: function(arc, index, reset) {\n\t\tvar me = this;\n\t\tvar chart = me.chart;\n\t\tvar dataset = me.getDataset();\n\t\tvar opts = chart.options;\n\t\tvar animationOpts = opts.animation;\n\t\tvar scale = chart.scale;\n\t\tvar labels = chart.data.labels;\n\n\t\tvar centerX = scale.xCenter;\n\t\tvar centerY = scale.yCenter;\n\n\t\t// var negHalfPI = -0.5 * Math.PI;\n\t\tvar datasetStartAngle = opts.startAngle;\n\t\tvar distance = arc.hidden ? 0 : scale.getDistanceFromCenterForValue(dataset.data[index]);\n\t\tvar startAngle = me._starts[index];\n\t\tvar endAngle = startAngle + (arc.hidden ? 0 : me._angles[index]);\n\n\t\tvar resetRadius = animationOpts.animateScale ? 0 : scale.getDistanceFromCenterForValue(dataset.data[index]);\n\t\tvar options = arc._options || {};\n\n\t\thelpers$1.extend(arc, {\n\t\t\t// Utility\n\t\t\t_datasetIndex: me.index,\n\t\t\t_index: index,\n\t\t\t_scale: scale,\n\n\t\t\t// Desired view properties\n\t\t\t_model: {\n\t\t\t\tbackgroundColor: options.backgroundColor,\n\t\t\t\tborderColor: options.borderColor,\n\t\t\t\tborderWidth: options.borderWidth,\n\t\t\t\tborderAlign: options.borderAlign,\n\t\t\t\tx: centerX,\n\t\t\t\ty: centerY,\n\t\t\t\tinnerRadius: 0,\n\t\t\t\touterRadius: reset ? resetRadius : distance,\n\t\t\t\tstartAngle: reset && animationOpts.animateRotate ? datasetStartAngle : startAngle,\n\t\t\t\tendAngle: reset && animationOpts.animateRotate ? datasetStartAngle : endAngle,\n\t\t\t\tlabel: helpers$1.valueAtIndexOrDefault(labels, index, labels[index])\n\t\t\t}\n\t\t});\n\n\t\tarc.pivot();\n\t},\n\n\tcountVisibleElements: function() {\n\t\tvar dataset = this.getDataset();\n\t\tvar meta = this.getMeta();\n\t\tvar count = 0;\n\n\t\thelpers$1.each(meta.data, function(element, index) {\n\t\t\tif (!isNaN(dataset.data[index]) && !element.hidden) {\n\t\t\t\tcount++;\n\t\t\t}\n\t\t});\n\n\t\treturn count;\n\t},\n\n\t/**\n\t * @protected\n\t */\n\tsetHoverStyle: function(arc) {\n\t\tvar model = arc._model;\n\t\tvar options = arc._options;\n\t\tvar getHoverColor = helpers$1.getHoverColor;\n\t\tvar valueOrDefault = helpers$1.valueOrDefault;\n\n\t\tarc.$previousStyle = {\n\t\t\tbackgroundColor: model.backgroundColor,\n\t\t\tborderColor: model.borderColor,\n\t\t\tborderWidth: model.borderWidth,\n\t\t};\n\n\t\tmodel.backgroundColor = valueOrDefault(options.hoverBackgroundColor, getHoverColor(options.backgroundColor));\n\t\tmodel.borderColor = valueOrDefault(options.hoverBorderColor, getHoverColor(options.borderColor));\n\t\tmodel.borderWidth = valueOrDefault(options.hoverBorderWidth, options.borderWidth);\n\t},\n\n\t/**\n\t * @private\n\t */\n\t_resolveElementOptions: function(arc, index) {\n\t\tvar me = this;\n\t\tvar chart = me.chart;\n\t\tvar dataset = me.getDataset();\n\t\tvar custom = arc.custom || {};\n\t\tvar options = chart.options.elements.arc;\n\t\tvar values = {};\n\t\tvar i, ilen, key;\n\n\t\t// Scriptable options\n\t\tvar context = {\n\t\t\tchart: chart,\n\t\t\tdataIndex: index,\n\t\t\tdataset: dataset,\n\t\t\tdatasetIndex: me.index\n\t\t};\n\n\t\tvar keys = [\n\t\t\t'backgroundColor',\n\t\t\t'borderColor',\n\t\t\t'borderWidth',\n\t\t\t'borderAlign',\n\t\t\t'hoverBackgroundColor',\n\t\t\t'hoverBorderColor',\n\t\t\t'hoverBorderWidth',\n\t\t];\n\n\t\tfor (i = 0, ilen = keys.length; i < ilen; ++i) {\n\t\t\tkey = keys[i];\n\t\t\tvalues[key] = resolve$5([\n\t\t\t\tcustom[key],\n\t\t\t\tdataset[key],\n\t\t\t\toptions[key]\n\t\t\t], context, index);\n\t\t}\n\n\t\treturn values;\n\t},\n\n\t/**\n\t * @private\n\t */\n\t_computeAngle: function(index) {\n\t\tvar me = this;\n\t\tvar count = this.getMeta().count;\n\t\tvar dataset = me.getDataset();\n\t\tvar meta = me.getMeta();\n\n\t\tif (isNaN(dataset.data[index]) || meta.data[index].hidden) {\n\t\t\treturn 0;\n\t\t}\n\n\t\t// Scriptable options\n\t\tvar context = {\n\t\t\tchart: me.chart,\n\t\t\tdataIndex: index,\n\t\t\tdataset: dataset,\n\t\t\tdatasetIndex: me.index\n\t\t};\n\n\t\treturn resolve$5([\n\t\t\tme.chart.options.elements.arc.angle,\n\t\t\t(2 * Math.PI) / count\n\t\t], context, index);\n\t}\n});\n\ncore_defaults._set('pie', helpers$1.clone(core_defaults.doughnut));\ncore_defaults._set('pie', {\n\tcutoutPercentage: 0\n});\n\n// Pie charts are Doughnut chart with different defaults\nvar controller_pie = controller_doughnut;\n\nvar valueOrDefault$6 = helpers$1.valueOrDefault;\nvar resolve$6 = helpers$1.options.resolve;\n\ncore_defaults._set('radar', {\n\tscale: {\n\t\ttype: 'radialLinear'\n\t},\n\telements: {\n\t\tline: {\n\t\t\ttension: 0 // no bezier in radar\n\t\t}\n\t}\n});\n\nvar controller_radar = core_datasetController.extend({\n\n\tdatasetElementType: elements.Line,\n\n\tdataElementType: elements.Point,\n\n\tlinkScales: helpers$1.noop,\n\n\tupdate: function(reset) {\n\t\tvar me = this;\n\t\tvar meta = me.getMeta();\n\t\tvar line = meta.dataset;\n\t\tvar points = meta.data || [];\n\t\tvar scale = me.chart.scale;\n\t\tvar dataset = me.getDataset();\n\t\tvar i, ilen;\n\n\t\t// Compatibility: If the properties are defined with only the old name, use those values\n\t\tif ((dataset.tension !== undefined) && (dataset.lineTension === undefined)) {\n\t\t\tdataset.lineTension = dataset.tension;\n\t\t}\n\n\t\t// Utility\n\t\tline._scale = scale;\n\t\tline._datasetIndex = me.index;\n\t\t// Data\n\t\tline._children = points;\n\t\tline._loop = true;\n\t\t// Model\n\t\tline._model = me._resolveLineOptions(line);\n\n\t\tline.pivot();\n\n\t\t// Update Points\n\t\tfor (i = 0, ilen = points.length; i < ilen; ++i) {\n\t\t\tme.updateElement(points[i], i, reset);\n\t\t}\n\n\t\t// Update bezier control points\n\t\tme.updateBezierControlPoints();\n\n\t\t// Now pivot the point for animation\n\t\tfor (i = 0, ilen = points.length; i < ilen; ++i) {\n\t\t\tpoints[i].pivot();\n\t\t}\n\t},\n\n\tupdateElement: function(point, index, reset) {\n\t\tvar me = this;\n\t\tvar custom = point.custom || {};\n\t\tvar dataset = me.getDataset();\n\t\tvar scale = me.chart.scale;\n\t\tvar pointPosition = scale.getPointPositionForValue(index, dataset.data[index]);\n\t\tvar options = me._resolvePointOptions(point, index);\n\t\tvar lineModel = me.getMeta().dataset._model;\n\t\tvar x = reset ? scale.xCenter : pointPosition.x;\n\t\tvar y = reset ? scale.yCenter : pointPosition.y;\n\n\t\t// Utility\n\t\tpoint._scale = scale;\n\t\tpoint._options = options;\n\t\tpoint._datasetIndex = me.index;\n\t\tpoint._index = index;\n\n\t\t// Desired view properties\n\t\tpoint._model = {\n\t\t\tx: x, // value not used in dataset scale, but we want a consistent API between scales\n\t\t\ty: y,\n\t\t\tskip: custom.skip || isNaN(x) || isNaN(y),\n\t\t\t// Appearance\n\t\t\tradius: options.radius,\n\t\t\tpointStyle: options.pointStyle,\n\t\t\trotation: options.rotation,\n\t\t\tbackgroundColor: options.backgroundColor,\n\t\t\tborderColor: options.borderColor,\n\t\t\tborderWidth: options.borderWidth,\n\t\t\ttension: valueOrDefault$6(custom.tension, lineModel ? lineModel.tension : 0),\n\n\t\t\t// Tooltip\n\t\t\thitRadius: options.hitRadius\n\t\t};\n\t},\n\n\t/**\n\t * @private\n\t */\n\t_resolvePointOptions: function(element, index) {\n\t\tvar me = this;\n\t\tvar chart = me.chart;\n\t\tvar dataset = chart.data.datasets[me.index];\n\t\tvar custom = element.custom || {};\n\t\tvar options = chart.options.elements.point;\n\t\tvar values = {};\n\t\tvar i, ilen, key;\n\n\t\t// Scriptable options\n\t\tvar context = {\n\t\t\tchart: chart,\n\t\t\tdataIndex: index,\n\t\t\tdataset: dataset,\n\t\t\tdatasetIndex: me.index\n\t\t};\n\n\t\tvar ELEMENT_OPTIONS = {\n\t\t\tbackgroundColor: 'pointBackgroundColor',\n\t\t\tborderColor: 'pointBorderColor',\n\t\t\tborderWidth: 'pointBorderWidth',\n\t\t\thitRadius: 'pointHitRadius',\n\t\t\thoverBackgroundColor: 'pointHoverBackgroundColor',\n\t\t\thoverBorderColor: 'pointHoverBorderColor',\n\t\t\thoverBorderWidth: 'pointHoverBorderWidth',\n\t\t\thoverRadius: 'pointHoverRadius',\n\t\t\tpointStyle: 'pointStyle',\n\t\t\tradius: 'pointRadius',\n\t\t\trotation: 'pointRotation'\n\t\t};\n\t\tvar keys = Object.keys(ELEMENT_OPTIONS);\n\n\t\tfor (i = 0, ilen = keys.length; i < ilen; ++i) {\n\t\t\tkey = keys[i];\n\t\t\tvalues[key] = resolve$6([\n\t\t\t\tcustom[key],\n\t\t\t\tdataset[ELEMENT_OPTIONS[key]],\n\t\t\t\tdataset[key],\n\t\t\t\toptions[key]\n\t\t\t], context, index);\n\t\t}\n\n\t\treturn values;\n\t},\n\n\t/**\n\t * @private\n\t */\n\t_resolveLineOptions: function(element) {\n\t\tvar me = this;\n\t\tvar chart = me.chart;\n\t\tvar dataset = chart.data.datasets[me.index];\n\t\tvar custom = element.custom || {};\n\t\tvar options = chart.options.elements.line;\n\t\tvar values = {};\n\t\tvar i, ilen, key;\n\n\t\tvar keys = [\n\t\t\t'backgroundColor',\n\t\t\t'borderWidth',\n\t\t\t'borderColor',\n\t\t\t'borderCapStyle',\n\t\t\t'borderDash',\n\t\t\t'borderDashOffset',\n\t\t\t'borderJoinStyle',\n\t\t\t'fill'\n\t\t];\n\n\t\tfor (i = 0, ilen = keys.length; i < ilen; ++i) {\n\t\t\tkey = keys[i];\n\t\t\tvalues[key] = resolve$6([\n\t\t\t\tcustom[key],\n\t\t\t\tdataset[key],\n\t\t\t\toptions[key]\n\t\t\t]);\n\t\t}\n\n\t\tvalues.tension = valueOrDefault$6(dataset.lineTension, options.tension);\n\n\t\treturn values;\n\t},\n\n\tupdateBezierControlPoints: function() {\n\t\tvar me = this;\n\t\tvar meta = me.getMeta();\n\t\tvar area = me.chart.chartArea;\n\t\tvar points = meta.data || [];\n\t\tvar i, ilen, model, controlPoints;\n\n\t\tfunction capControlPoint(pt, min, max) {\n\t\t\treturn Math.max(Math.min(pt, max), min);\n\t\t}\n\n\t\tfor (i = 0, ilen = points.length; i < ilen; ++i) {\n\t\t\tmodel = points[i]._model;\n\t\t\tcontrolPoints = helpers$1.splineCurve(\n\t\t\t\thelpers$1.previousItem(points, i, true)._model,\n\t\t\t\tmodel,\n\t\t\t\thelpers$1.nextItem(points, i, true)._model,\n\t\t\t\tmodel.tension\n\t\t\t);\n\n\t\t\t// Prevent the bezier going outside of the bounds of the graph\n\t\t\tmodel.controlPointPreviousX = capControlPoint(controlPoints.previous.x, area.left, area.right);\n\t\t\tmodel.controlPointPreviousY = capControlPoint(controlPoints.previous.y, area.top, area.bottom);\n\t\t\tmodel.controlPointNextX = capControlPoint(controlPoints.next.x, area.left, area.right);\n\t\t\tmodel.controlPointNextY = capControlPoint(controlPoints.next.y, area.top, area.bottom);\n\t\t}\n\t},\n\n\tsetHoverStyle: function(point) {\n\t\tvar model = point._model;\n\t\tvar options = point._options;\n\t\tvar getHoverColor = helpers$1.getHoverColor;\n\n\t\tpoint.$previousStyle = {\n\t\t\tbackgroundColor: model.backgroundColor,\n\t\t\tborderColor: model.borderColor,\n\t\t\tborderWidth: model.borderWidth,\n\t\t\tradius: model.radius\n\t\t};\n\n\t\tmodel.backgroundColor = valueOrDefault$6(options.hoverBackgroundColor, getHoverColor(options.backgroundColor));\n\t\tmodel.borderColor = valueOrDefault$6(options.hoverBorderColor, getHoverColor(options.borderColor));\n\t\tmodel.borderWidth = valueOrDefault$6(options.hoverBorderWidth, options.borderWidth);\n\t\tmodel.radius = valueOrDefault$6(options.hoverRadius, options.radius);\n\t}\n});\n\ncore_defaults._set('scatter', {\n\thover: {\n\t\tmode: 'single'\n\t},\n\n\tscales: {\n\t\txAxes: [{\n\t\t\tid: 'x-axis-1', // need an ID so datasets can reference the scale\n\t\t\ttype: 'linear', // scatter should not use a category axis\n\t\t\tposition: 'bottom'\n\t\t}],\n\t\tyAxes: [{\n\t\t\tid: 'y-axis-1',\n\t\t\ttype: 'linear',\n\t\t\tposition: 'left'\n\t\t}]\n\t},\n\n\tshowLines: false,\n\n\ttooltips: {\n\t\tcallbacks: {\n\t\t\ttitle: function() {\n\t\t\t\treturn ''; // doesn't make sense for scatter since data are formatted as a point\n\t\t\t},\n\t\t\tlabel: function(item) {\n\t\t\t\treturn '(' + item.xLabel + ', ' + item.yLabel + ')';\n\t\t\t}\n\t\t}\n\t}\n});\n\n// Scatter charts use line controllers\nvar controller_scatter = controller_line;\n\n// NOTE export a map in which the key represents the controller type, not\n// the class, and so must be CamelCase in order to be correctly retrieved\n// by the controller in core.controller.js (`controllers[meta.type]`).\n\nvar controllers = {\n\tbar: controller_bar,\n\tbubble: controller_bubble,\n\tdoughnut: controller_doughnut,\n\thorizontalBar: controller_horizontalBar,\n\tline: controller_line,\n\tpolarArea: controller_polarArea,\n\tpie: controller_pie,\n\tradar: controller_radar,\n\tscatter: controller_scatter\n};\n\n/**\n * Helper function to get relative position for an event\n * @param {Event|IEvent} event - The event to get the position for\n * @param {Chart} chart - The chart\n * @returns {object} the event position\n */\nfunction getRelativePosition(e, chart) {\n\tif (e.native) {\n\t\treturn {\n\t\t\tx: e.x,\n\t\t\ty: e.y\n\t\t};\n\t}\n\n\treturn helpers$1.getRelativePosition(e, chart);\n}\n\n/**\n * Helper function to traverse all of the visible elements in the chart\n * @param {Chart} chart - the chart\n * @param {function} handler - the callback to execute for each visible item\n */\nfunction parseVisibleItems(chart, handler) {\n\tvar datasets = chart.data.datasets;\n\tvar meta, i, j, ilen, jlen;\n\n\tfor (i = 0, ilen = datasets.length; i < ilen; ++i) {\n\t\tif (!chart.isDatasetVisible(i)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tmeta = chart.getDatasetMeta(i);\n\t\tfor (j = 0, jlen = meta.data.length; j < jlen; ++j) {\n\t\t\tvar element = meta.data[j];\n\t\t\tif (!element._view.skip) {\n\t\t\t\thandler(element);\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * Helper function to get the items that intersect the event position\n * @param {ChartElement[]} items - elements to filter\n * @param {object} position - the point to be nearest to\n * @return {ChartElement[]} the nearest items\n */\nfunction getIntersectItems(chart, position) {\n\tvar elements = [];\n\n\tparseVisibleItems(chart, function(element) {\n\t\tif (element.inRange(position.x, position.y)) {\n\t\t\telements.push(element);\n\t\t}\n\t});\n\n\treturn elements;\n}\n\n/**\n * Helper function to get the items nearest to the event position considering all visible items in teh chart\n * @param {Chart} chart - the chart to look at elements from\n * @param {object} position - the point to be nearest to\n * @param {boolean} intersect - if true, only consider items that intersect the position\n * @param {function} distanceMetric - function to provide the distance between points\n * @return {ChartElement[]} the nearest items\n */\nfunction getNearestItems(chart, position, intersect, distanceMetric) {\n\tvar minDistance = Number.POSITIVE_INFINITY;\n\tvar nearestItems = [];\n\n\tparseVisibleItems(chart, function(element) {\n\t\tif (intersect && !element.inRange(position.x, position.y)) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar center = element.getCenterPoint();\n\t\tvar distance = distanceMetric(position, center);\n\t\tif (distance < minDistance) {\n\t\t\tnearestItems = [element];\n\t\t\tminDistance = distance;\n\t\t} else if (distance === minDistance) {\n\t\t\t// Can have multiple items at the same distance in which case we sort by size\n\t\t\tnearestItems.push(element);\n\t\t}\n\t});\n\n\treturn nearestItems;\n}\n\n/**\n * Get a distance metric function for two points based on the\n * axis mode setting\n * @param {string} axis - the axis mode. x|y|xy\n */\nfunction getDistanceMetricForAxis(axis) {\n\tvar useX = axis.indexOf('x') !== -1;\n\tvar useY = axis.indexOf('y') !== -1;\n\n\treturn function(pt1, pt2) {\n\t\tvar deltaX = useX ? Math.abs(pt1.x - pt2.x) : 0;\n\t\tvar deltaY = useY ? Math.abs(pt1.y - pt2.y) : 0;\n\t\treturn Math.sqrt(Math.pow(deltaX, 2) + Math.pow(deltaY, 2));\n\t};\n}\n\nfunction indexMode(chart, e, options) {\n\tvar position = getRelativePosition(e, chart);\n\t// Default axis for index mode is 'x' to match old behaviour\n\toptions.axis = options.axis || 'x';\n\tvar distanceMetric = getDistanceMetricForAxis(options.axis);\n\tvar items = options.intersect ? getIntersectItems(chart, position) : getNearestItems(chart, position, false, distanceMetric);\n\tvar elements = [];\n\n\tif (!items.length) {\n\t\treturn [];\n\t}\n\n\tchart.data.datasets.forEach(function(dataset, datasetIndex) {\n\t\tif (chart.isDatasetVisible(datasetIndex)) {\n\t\t\tvar meta = chart.getDatasetMeta(datasetIndex);\n\t\t\tvar element = meta.data[items[0]._index];\n\n\t\t\t// don't count items that are skipped (null data)\n\t\t\tif (element && !element._view.skip) {\n\t\t\t\telements.push(element);\n\t\t\t}\n\t\t}\n\t});\n\n\treturn elements;\n}\n\n/**\n * @interface IInteractionOptions\n */\n/**\n * If true, only consider items that intersect the point\n * @name IInterfaceOptions#boolean\n * @type Boolean\n */\n\n/**\n * Contains interaction related functions\n * @namespace Chart.Interaction\n */\nvar core_interaction = {\n\t// Helper function for different modes\n\tmodes: {\n\t\tsingle: function(chart, e) {\n\t\t\tvar position = getRelativePosition(e, chart);\n\t\t\tvar elements = [];\n\n\t\t\tparseVisibleItems(chart, function(element) {\n\t\t\t\tif (element.inRange(position.x, position.y)) {\n\t\t\t\t\telements.push(element);\n\t\t\t\t\treturn elements;\n\t\t\t\t}\n\t\t\t});\n\n\t\t\treturn elements.slice(0, 1);\n\t\t},\n\n\t\t/**\n\t\t * @function Chart.Interaction.modes.label\n\t\t * @deprecated since version 2.4.0\n\t\t * @todo remove at version 3\n\t\t * @private\n\t\t */\n\t\tlabel: indexMode,\n\n\t\t/**\n\t\t * Returns items at the same index. If the options.intersect parameter is true, we only return items if we intersect something\n\t\t * If the options.intersect mode is false, we find the nearest item and return the items at the same index as that item\n\t\t * @function Chart.Interaction.modes.index\n\t\t * @since v2.4.0\n\t\t * @param {Chart} chart - the chart we are returning items from\n\t\t * @param {Event} e - the event we are find things at\n\t\t * @param {IInteractionOptions} options - options to use during interaction\n\t\t * @return {Chart.Element[]} Array of elements that are under the point. If none are found, an empty array is returned\n\t\t */\n\t\tindex: indexMode,\n\n\t\t/**\n\t\t * Returns items in the same dataset. If the options.intersect parameter is true, we only return items if we intersect something\n\t\t * If the options.intersect is false, we find the nearest item and return the items in that dataset\n\t\t * @function Chart.Interaction.modes.dataset\n\t\t * @param {Chart} chart - the chart we are returning items from\n\t\t * @param {Event} e - the event we are find things at\n\t\t * @param {IInteractionOptions} options - options to use during interaction\n\t\t * @return {Chart.Element[]} Array of elements that are under the point. If none are found, an empty array is returned\n\t\t */\n\t\tdataset: function(chart, e, options) {\n\t\t\tvar position = getRelativePosition(e, chart);\n\t\t\toptions.axis = options.axis || 'xy';\n\t\t\tvar distanceMetric = getDistanceMetricForAxis(options.axis);\n\t\t\tvar items = options.intersect ? getIntersectItems(chart, position) : getNearestItems(chart, position, false, distanceMetric);\n\n\t\t\tif (items.length > 0) {\n\t\t\t\titems = chart.getDatasetMeta(items[0]._datasetIndex).data;\n\t\t\t}\n\n\t\t\treturn items;\n\t\t},\n\n\t\t/**\n\t\t * @function Chart.Interaction.modes.x-axis\n\t\t * @deprecated since version 2.4.0. Use index mode and intersect == true\n\t\t * @todo remove at version 3\n\t\t * @private\n\t\t */\n\t\t'x-axis': function(chart, e) {\n\t\t\treturn indexMode(chart, e, {intersect: false});\n\t\t},\n\n\t\t/**\n\t\t * Point mode returns all elements that hit test based on the event position\n\t\t * of the event\n\t\t * @function Chart.Interaction.modes.intersect\n\t\t * @param {Chart} chart - the chart we are returning items from\n\t\t * @param {Event} e - the event we are find things at\n\t\t * @return {Chart.Element[]} Array of elements that are under the point. If none are found, an empty array is returned\n\t\t */\n\t\tpoint: function(chart, e) {\n\t\t\tvar position = getRelativePosition(e, chart);\n\t\t\treturn getIntersectItems(chart, position);\n\t\t},\n\n\t\t/**\n\t\t * nearest mode returns the element closest to the point\n\t\t * @function Chart.Interaction.modes.intersect\n\t\t * @param {Chart} chart - the chart we are returning items from\n\t\t * @param {Event} e - the event we are find things at\n\t\t * @param {IInteractionOptions} options - options to use\n\t\t * @return {Chart.Element[]} Array of elements that are under the point. If none are found, an empty array is returned\n\t\t */\n\t\tnearest: function(chart, e, options) {\n\t\t\tvar position = getRelativePosition(e, chart);\n\t\t\toptions.axis = options.axis || 'xy';\n\t\t\tvar distanceMetric = getDistanceMetricForAxis(options.axis);\n\t\t\treturn getNearestItems(chart, position, options.intersect, distanceMetric);\n\t\t},\n\n\t\t/**\n\t\t * x mode returns the elements that hit-test at the current x coordinate\n\t\t * @function Chart.Interaction.modes.x\n\t\t * @param {Chart} chart - the chart we are returning items from\n\t\t * @param {Event} e - the event we are find things at\n\t\t * @param {IInteractionOptions} options - options to use\n\t\t * @return {Chart.Element[]} Array of elements that are under the point. If none are found, an empty array is returned\n\t\t */\n\t\tx: function(chart, e, options) {\n\t\t\tvar position = getRelativePosition(e, chart);\n\t\t\tvar items = [];\n\t\t\tvar intersectsItem = false;\n\n\t\t\tparseVisibleItems(chart, function(element) {\n\t\t\t\tif (element.inXRange(position.x)) {\n\t\t\t\t\titems.push(element);\n\t\t\t\t}\n\n\t\t\t\tif (element.inRange(position.x, position.y)) {\n\t\t\t\t\tintersectsItem = true;\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t// If we want to trigger on an intersect and we don't have any items\n\t\t\t// that intersect the position, return nothing\n\t\t\tif (options.intersect && !intersectsItem) {\n\t\t\t\titems = [];\n\t\t\t}\n\t\t\treturn items;\n\t\t},\n\n\t\t/**\n\t\t * y mode returns the elements that hit-test at the current y coordinate\n\t\t * @function Chart.Interaction.modes.y\n\t\t * @param {Chart} chart - the chart we are returning items from\n\t\t * @param {Event} e - the event we are find things at\n\t\t * @param {IInteractionOptions} options - options to use\n\t\t * @return {Chart.Element[]} Array of elements that are under the point. If none are found, an empty array is returned\n\t\t */\n\t\ty: function(chart, e, options) {\n\t\t\tvar position = getRelativePosition(e, chart);\n\t\t\tvar items = [];\n\t\t\tvar intersectsItem = false;\n\n\t\t\tparseVisibleItems(chart, function(element) {\n\t\t\t\tif (element.inYRange(position.y)) {\n\t\t\t\t\titems.push(element);\n\t\t\t\t}\n\n\t\t\t\tif (element.inRange(position.x, position.y)) {\n\t\t\t\t\tintersectsItem = true;\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t// If we want to trigger on an intersect and we don't have any items\n\t\t\t// that intersect the position, return nothing\n\t\t\tif (options.intersect && !intersectsItem) {\n\t\t\t\titems = [];\n\t\t\t}\n\t\t\treturn items;\n\t\t}\n\t}\n};\n\nfunction filterByPosition(array, position) {\n\treturn helpers$1.where(array, function(v) {\n\t\treturn v.position === position;\n\t});\n}\n\nfunction sortByWeight(array, reverse) {\n\tarray.forEach(function(v, i) {\n\t\tv._tmpIndex_ = i;\n\t\treturn v;\n\t});\n\tarray.sort(function(a, b) {\n\t\tvar v0 = reverse ? b : a;\n\t\tvar v1 = reverse ? a : b;\n\t\treturn v0.weight === v1.weight ?\n\t\t\tv0._tmpIndex_ - v1._tmpIndex_ :\n\t\t\tv0.weight - v1.weight;\n\t});\n\tarray.forEach(function(v) {\n\t\tdelete v._tmpIndex_;\n\t});\n}\n\nfunction findMaxPadding(boxes) {\n\tvar top = 0;\n\tvar left = 0;\n\tvar bottom = 0;\n\tvar right = 0;\n\thelpers$1.each(boxes, function(box) {\n\t\tif (box.getPadding) {\n\t\t\tvar boxPadding = box.getPadding();\n\t\t\ttop = Math.max(top, boxPadding.top);\n\t\t\tleft = Math.max(left, boxPadding.left);\n\t\t\tbottom = Math.max(bottom, boxPadding.bottom);\n\t\t\tright = Math.max(right, boxPadding.right);\n\t\t}\n\t});\n\treturn {\n\t\ttop: top,\n\t\tleft: left,\n\t\tbottom: bottom,\n\t\tright: right\n\t};\n}\n\nfunction addSizeByPosition(boxes, size) {\n\thelpers$1.each(boxes, function(box) {\n\t\tsize[box.position] += box.isHorizontal() ? box.height : box.width;\n\t});\n}\n\ncore_defaults._set('global', {\n\tlayout: {\n\t\tpadding: {\n\t\t\ttop: 0,\n\t\t\tright: 0,\n\t\t\tbottom: 0,\n\t\t\tleft: 0\n\t\t}\n\t}\n});\n\n/**\n * @interface ILayoutItem\n * @prop {string} position - The position of the item in the chart layout. Possible values are\n * 'left', 'top', 'right', 'bottom', and 'chartArea'\n * @prop {number} weight - The weight used to sort the item. Higher weights are further away from the chart area\n * @prop {boolean} fullWidth - if true, and the item is horizontal, then push vertical boxes down\n * @prop {function} isHorizontal - returns true if the layout item is horizontal (ie. top or bottom)\n * @prop {function} update - Takes two parameters: width and height. Returns size of item\n * @prop {function} getPadding - Returns an object with padding on the edges\n * @prop {number} width - Width of item. Must be valid after update()\n * @prop {number} height - Height of item. Must be valid after update()\n * @prop {number} left - Left edge of the item. Set by layout system and cannot be used in update\n * @prop {number} top - Top edge of the item. Set by layout system and cannot be used in update\n * @prop {number} right - Right edge of the item. Set by layout system and cannot be used in update\n * @prop {number} bottom - Bottom edge of the item. Set by layout system and cannot be used in update\n */\n\n// The layout service is very self explanatory. It's responsible for the layout within a chart.\n// Scales, Legends and Plugins all rely on the layout service and can easily register to be placed anywhere they need\n// It is this service's responsibility of carrying out that layout.\nvar core_layouts = {\n\tdefaults: {},\n\n\t/**\n\t * Register a box to a chart.\n\t * A box is simply a reference to an object that requires layout. eg. Scales, Legend, Title.\n\t * @param {Chart} chart - the chart to use\n\t * @param {ILayoutItem} item - the item to add to be layed out\n\t */\n\taddBox: function(chart, item) {\n\t\tif (!chart.boxes) {\n\t\t\tchart.boxes = [];\n\t\t}\n\n\t\t// initialize item with default values\n\t\titem.fullWidth = item.fullWidth || false;\n\t\titem.position = item.position || 'top';\n\t\titem.weight = item.weight || 0;\n\n\t\tchart.boxes.push(item);\n\t},\n\n\t/**\n\t * Remove a layoutItem from a chart\n\t * @param {Chart} chart - the chart to remove the box from\n\t * @param {ILayoutItem} layoutItem - the item to remove from the layout\n\t */\n\tremoveBox: function(chart, layoutItem) {\n\t\tvar index = chart.boxes ? chart.boxes.indexOf(layoutItem) : -1;\n\t\tif (index !== -1) {\n\t\t\tchart.boxes.splice(index, 1);\n\t\t}\n\t},\n\n\t/**\n\t * Sets (or updates) options on the given `item`.\n\t * @param {Chart} chart - the chart in which the item lives (or will be added to)\n\t * @param {ILayoutItem} item - the item to configure with the given options\n\t * @param {object} options - the new item options.\n\t */\n\tconfigure: function(chart, item, options) {\n\t\tvar props = ['fullWidth', 'position', 'weight'];\n\t\tvar ilen = props.length;\n\t\tvar i = 0;\n\t\tvar prop;\n\n\t\tfor (; i < ilen; ++i) {\n\t\t\tprop = props[i];\n\t\t\tif (options.hasOwnProperty(prop)) {\n\t\t\t\titem[prop] = options[prop];\n\t\t\t}\n\t\t}\n\t},\n\n\t/**\n\t * Fits boxes of the given chart into the given size by having each box measure itself\n\t * then running a fitting algorithm\n\t * @param {Chart} chart - the chart\n\t * @param {number} width - the width to fit into\n\t * @param {number} height - the height to fit into\n\t */\n\tupdate: function(chart, width, height) {\n\t\tif (!chart) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar layoutOptions = chart.options.layout || {};\n\t\tvar padding = helpers$1.options.toPadding(layoutOptions.padding);\n\t\tvar leftPadding = padding.left;\n\t\tvar rightPadding = padding.right;\n\t\tvar topPadding = padding.top;\n\t\tvar bottomPadding = padding.bottom;\n\n\t\tvar leftBoxes = filterByPosition(chart.boxes, 'left');\n\t\tvar rightBoxes = filterByPosition(chart.boxes, 'right');\n\t\tvar topBoxes = filterByPosition(chart.boxes, 'top');\n\t\tvar bottomBoxes = filterByPosition(chart.boxes, 'bottom');\n\t\tvar chartAreaBoxes = filterByPosition(chart.boxes, 'chartArea');\n\n\t\t// Sort boxes by weight. A higher weight is further away from the chart area\n\t\tsortByWeight(leftBoxes, true);\n\t\tsortByWeight(rightBoxes, false);\n\t\tsortByWeight(topBoxes, true);\n\t\tsortByWeight(bottomBoxes, false);\n\n\t\tvar verticalBoxes = leftBoxes.concat(rightBoxes);\n\t\tvar horizontalBoxes = topBoxes.concat(bottomBoxes);\n\t\tvar outerBoxes = verticalBoxes.concat(horizontalBoxes);\n\n\t\t// Essentially we now have any number of boxes on each of the 4 sides.\n\t\t// Our canvas looks like the following.\n\t\t// The areas L1 and L2 are the left axes. R1 is the right axis, T1 is the top axis and\n\t\t// B1 is the bottom axis\n\t\t// There are also 4 quadrant-like locations (left to right instead of clockwise) reserved for chart overlays\n\t\t// These locations are single-box locations only, when trying to register a chartArea location that is already taken,\n\t\t// an error will be thrown.\n\t\t//\n\t\t// |----------------------------------------------------|\n\t\t// | T1 (Full Width) |\n\t\t// |----------------------------------------------------|\n\t\t// | | | T2 | |\n\t\t// | |----|-------------------------------------|----|\n\t\t// | | | C1 | | C2 | |\n\t\t// | | |----| |----| |\n\t\t// | | | | |\n\t\t// | L1 | L2 | ChartArea (C0) | R1 |\n\t\t// | | | | |\n\t\t// | | |----| |----| |\n\t\t// | | | C3 | | C4 | |\n\t\t// | |----|-------------------------------------|----|\n\t\t// | | | B1 | |\n\t\t// |----------------------------------------------------|\n\t\t// | B2 (Full Width) |\n\t\t// |----------------------------------------------------|\n\t\t//\n\t\t// What we do to find the best sizing, we do the following\n\t\t// 1. Determine the minimum size of the chart area.\n\t\t// 2. Split the remaining width equally between each vertical axis\n\t\t// 3. Split the remaining height equally between each horizontal axis\n\t\t// 4. Give each layout the maximum size it can be. The layout will return it's minimum size\n\t\t// 5. Adjust the sizes of each axis based on it's minimum reported size.\n\t\t// 6. Refit each axis\n\t\t// 7. Position each axis in the final location\n\t\t// 8. Tell the chart the final location of the chart area\n\t\t// 9. Tell any axes that overlay the chart area the positions of the chart area\n\n\t\t// Step 1\n\t\tvar chartWidth = width - leftPadding - rightPadding;\n\t\tvar chartHeight = height - topPadding - bottomPadding;\n\t\tvar chartAreaWidth = chartWidth / 2; // min 50%\n\n\t\t// Step 2\n\t\tvar verticalBoxWidth = (width - chartAreaWidth) / verticalBoxes.length;\n\n\t\t// Step 3\n\t\t// TODO re-limit horizontal axis height (this limit has affected only padding calculation since PR 1837)\n\t\t// var horizontalBoxHeight = (height - chartAreaHeight) / horizontalBoxes.length;\n\n\t\t// Step 4\n\t\tvar maxChartAreaWidth = chartWidth;\n\t\tvar maxChartAreaHeight = chartHeight;\n\t\tvar outerBoxSizes = {top: topPadding, left: leftPadding, bottom: bottomPadding, right: rightPadding};\n\t\tvar minBoxSizes = [];\n\t\tvar maxPadding;\n\n\t\tfunction getMinimumBoxSize(box) {\n\t\t\tvar minSize;\n\t\t\tvar isHorizontal = box.isHorizontal();\n\n\t\t\tif (isHorizontal) {\n\t\t\t\tminSize = box.update(box.fullWidth ? chartWidth : maxChartAreaWidth, chartHeight / 2);\n\t\t\t\tmaxChartAreaHeight -= minSize.height;\n\t\t\t} else {\n\t\t\t\tminSize = box.update(verticalBoxWidth, maxChartAreaHeight);\n\t\t\t\tmaxChartAreaWidth -= minSize.width;\n\t\t\t}\n\n\t\t\tminBoxSizes.push({\n\t\t\t\thorizontal: isHorizontal,\n\t\t\t\twidth: minSize.width,\n\t\t\t\tbox: box,\n\t\t\t});\n\t\t}\n\n\t\thelpers$1.each(outerBoxes, getMinimumBoxSize);\n\n\t\t// If a horizontal box has padding, we move the left boxes over to avoid ugly charts (see issue #2478)\n\t\tmaxPadding = findMaxPadding(outerBoxes);\n\n\t\t// At this point, maxChartAreaHeight and maxChartAreaWidth are the size the chart area could\n\t\t// be if the axes are drawn at their minimum sizes.\n\t\t// Steps 5 & 6\n\n\t\t// Function to fit a box\n\t\tfunction fitBox(box) {\n\t\t\tvar minBoxSize = helpers$1.findNextWhere(minBoxSizes, function(minBox) {\n\t\t\t\treturn minBox.box === box;\n\t\t\t});\n\n\t\t\tif (minBoxSize) {\n\t\t\t\tif (minBoxSize.horizontal) {\n\t\t\t\t\tvar scaleMargin = {\n\t\t\t\t\t\tleft: Math.max(outerBoxSizes.left, maxPadding.left),\n\t\t\t\t\t\tright: Math.max(outerBoxSizes.right, maxPadding.right),\n\t\t\t\t\t\ttop: 0,\n\t\t\t\t\t\tbottom: 0\n\t\t\t\t\t};\n\n\t\t\t\t\t// Don't use min size here because of label rotation. When the labels are rotated, their rotation highly depends\n\t\t\t\t\t// on the margin. Sometimes they need to increase in size slightly\n\t\t\t\t\tbox.update(box.fullWidth ? chartWidth : maxChartAreaWidth, chartHeight / 2, scaleMargin);\n\t\t\t\t} else {\n\t\t\t\t\tbox.update(minBoxSize.width, maxChartAreaHeight);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Update, and calculate the left and right margins for the horizontal boxes\n\t\thelpers$1.each(verticalBoxes, fitBox);\n\t\taddSizeByPosition(verticalBoxes, outerBoxSizes);\n\n\t\t// Set the Left and Right margins for the horizontal boxes\n\t\thelpers$1.each(horizontalBoxes, fitBox);\n\t\taddSizeByPosition(horizontalBoxes, outerBoxSizes);\n\n\t\tfunction finalFitVerticalBox(box) {\n\t\t\tvar minBoxSize = helpers$1.findNextWhere(minBoxSizes, function(minSize) {\n\t\t\t\treturn minSize.box === box;\n\t\t\t});\n\n\t\t\tvar scaleMargin = {\n\t\t\t\tleft: 0,\n\t\t\t\tright: 0,\n\t\t\t\ttop: outerBoxSizes.top,\n\t\t\t\tbottom: outerBoxSizes.bottom\n\t\t\t};\n\n\t\t\tif (minBoxSize) {\n\t\t\t\tbox.update(minBoxSize.width, maxChartAreaHeight, scaleMargin);\n\t\t\t}\n\t\t}\n\n\t\t// Let the left layout know the final margin\n\t\thelpers$1.each(verticalBoxes, finalFitVerticalBox);\n\n\t\t// Recalculate because the size of each layout might have changed slightly due to the margins (label rotation for instance)\n\t\touterBoxSizes = {top: topPadding, left: leftPadding, bottom: bottomPadding, right: rightPadding};\n\t\taddSizeByPosition(outerBoxes, outerBoxSizes);\n\n\t\t// We may be adding some padding to account for rotated x axis labels\n\t\tvar leftPaddingAddition = Math.max(maxPadding.left - outerBoxSizes.left, 0);\n\t\touterBoxSizes.left += leftPaddingAddition;\n\t\touterBoxSizes.right += Math.max(maxPadding.right - outerBoxSizes.right, 0);\n\n\t\tvar topPaddingAddition = Math.max(maxPadding.top - outerBoxSizes.top, 0);\n\t\touterBoxSizes.top += topPaddingAddition;\n\t\touterBoxSizes.bottom += Math.max(maxPadding.bottom - outerBoxSizes.bottom, 0);\n\n\t\t// Figure out if our chart area changed. This would occur if the dataset layout label rotation\n\t\t// changed due to the application of the margins in step 6. Since we can only get bigger, this is safe to do\n\t\t// without calling `fit` again\n\t\tvar newMaxChartAreaHeight = height - outerBoxSizes.top - outerBoxSizes.bottom;\n\t\tvar newMaxChartAreaWidth = width - outerBoxSizes.left - outerBoxSizes.right;\n\n\t\tif (newMaxChartAreaWidth !== maxChartAreaWidth || newMaxChartAreaHeight !== maxChartAreaHeight) {\n\t\t\thelpers$1.each(verticalBoxes, function(box) {\n\t\t\t\tbox.height = newMaxChartAreaHeight;\n\t\t\t});\n\n\t\t\thelpers$1.each(horizontalBoxes, function(box) {\n\t\t\t\tif (!box.fullWidth) {\n\t\t\t\t\tbox.width = newMaxChartAreaWidth;\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tmaxChartAreaHeight = newMaxChartAreaHeight;\n\t\t\tmaxChartAreaWidth = newMaxChartAreaWidth;\n\t\t}\n\n\t\t// Step 7 - Position the boxes\n\t\tvar left = leftPadding + leftPaddingAddition;\n\t\tvar top = topPadding + topPaddingAddition;\n\n\t\tfunction placeBox(box) {\n\t\t\tif (box.isHorizontal()) {\n\t\t\t\tbox.left = box.fullWidth ? leftPadding : outerBoxSizes.left;\n\t\t\t\tbox.right = box.fullWidth ? width - rightPadding : outerBoxSizes.left + maxChartAreaWidth;\n\t\t\t\tbox.top = top;\n\t\t\t\tbox.bottom = top + box.height;\n\n\t\t\t\t// Move to next point\n\t\t\t\ttop = box.bottom;\n\n\t\t\t} else {\n\n\t\t\t\tbox.left = left;\n\t\t\t\tbox.right = left + box.width;\n\t\t\t\tbox.top = outerBoxSizes.top;\n\t\t\t\tbox.bottom = outerBoxSizes.top + maxChartAreaHeight;\n\n\t\t\t\t// Move to next point\n\t\t\t\tleft = box.right;\n\t\t\t}\n\t\t}\n\n\t\thelpers$1.each(leftBoxes.concat(topBoxes), placeBox);\n\n\t\t// Account for chart width and height\n\t\tleft += maxChartAreaWidth;\n\t\ttop += maxChartAreaHeight;\n\n\t\thelpers$1.each(rightBoxes, placeBox);\n\t\thelpers$1.each(bottomBoxes, placeBox);\n\n\t\t// Step 8\n\t\tchart.chartArea = {\n\t\t\tleft: outerBoxSizes.left,\n\t\t\ttop: outerBoxSizes.top,\n\t\t\tright: outerBoxSizes.left + maxChartAreaWidth,\n\t\t\tbottom: outerBoxSizes.top + maxChartAreaHeight\n\t\t};\n\n\t\t// Step 9\n\t\thelpers$1.each(chartAreaBoxes, function(box) {\n\t\t\tbox.left = chart.chartArea.left;\n\t\t\tbox.top = chart.chartArea.top;\n\t\t\tbox.right = chart.chartArea.right;\n\t\t\tbox.bottom = chart.chartArea.bottom;\n\n\t\t\tbox.update(maxChartAreaWidth, maxChartAreaHeight);\n\t\t});\n\t}\n};\n\n/**\n * Platform fallback implementation (minimal).\n * @see https://github.com/chartjs/Chart.js/pull/4591#issuecomment-319575939\n */\n\nvar platform_basic = {\n\tacquireContext: function(item) {\n\t\tif (item && item.canvas) {\n\t\t\t// Support for any object associated to a canvas (including a context2d)\n\t\t\titem = item.canvas;\n\t\t}\n\n\t\treturn item && item.getContext('2d') || null;\n\t}\n};\n\nvar platform_dom = \"/*\\n * DOM element rendering detection\\n * https://davidwalsh.name/detect-node-insertion\\n */\\n@keyframes chartjs-render-animation {\\n\\tfrom { opacity: 0.99; }\\n\\tto { opacity: 1; }\\n}\\n\\n.chartjs-render-monitor {\\n\\tanimation: chartjs-render-animation 0.001s;\\n}\\n\\n/*\\n * DOM element resizing detection\\n * https://github.com/marcj/css-element-queries\\n */\\n.chartjs-size-monitor,\\n.chartjs-size-monitor-expand,\\n.chartjs-size-monitor-shrink {\\n\\tposition: absolute;\\n\\tdirection: ltr;\\n\\tleft: 0;\\n\\ttop: 0;\\n\\tright: 0;\\n\\tbottom: 0;\\n\\toverflow: hidden;\\n\\tpointer-events: none;\\n\\tvisibility: hidden;\\n\\tz-index: -1;\\n}\\n\\n.chartjs-size-monitor-expand > div {\\n\\tposition: absolute;\\n\\twidth: 1000000px;\\n\\theight: 1000000px;\\n\\tleft: 0;\\n\\ttop: 0;\\n}\\n\\n.chartjs-size-monitor-shrink > div {\\n\\tposition: absolute;\\n\\twidth: 200%;\\n\\theight: 200%;\\n\\tleft: 0;\\n\\ttop: 0;\\n}\\n\";\n\nvar platform_dom$1 = /*#__PURE__*/Object.freeze({\ndefault: platform_dom\n});\n\nfunction getCjsExportFromNamespace (n) {\n\treturn n && n.default || n;\n}\n\nvar stylesheet = getCjsExportFromNamespace(platform_dom$1);\n\nvar EXPANDO_KEY = '$chartjs';\nvar CSS_PREFIX = 'chartjs-';\nvar CSS_SIZE_MONITOR = CSS_PREFIX + 'size-monitor';\nvar CSS_RENDER_MONITOR = CSS_PREFIX + 'render-monitor';\nvar CSS_RENDER_ANIMATION = CSS_PREFIX + 'render-animation';\nvar ANIMATION_START_EVENTS = ['animationstart', 'webkitAnimationStart'];\n\n/**\n * DOM event types -> Chart.js event types.\n * Note: only events with different types are mapped.\n * @see https://developer.mozilla.org/en-US/docs/Web/Events\n */\nvar EVENT_TYPES = {\n\ttouchstart: 'mousedown',\n\ttouchmove: 'mousemove',\n\ttouchend: 'mouseup',\n\tpointerenter: 'mouseenter',\n\tpointerdown: 'mousedown',\n\tpointermove: 'mousemove',\n\tpointerup: 'mouseup',\n\tpointerleave: 'mouseout',\n\tpointerout: 'mouseout'\n};\n\n/**\n * The \"used\" size is the final value of a dimension property after all calculations have\n * been performed. This method uses the computed style of `element` but returns undefined\n * if the computed style is not expressed in pixels. That can happen in some cases where\n * `element` has a size relative to its parent and this last one is not yet displayed,\n * for example because of `display: none` on a parent node.\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/used_value\n * @returns {number} Size in pixels or undefined if unknown.\n */\nfunction readUsedSize(element, property) {\n\tvar value = helpers$1.getStyle(element, property);\n\tvar matches = value && value.match(/^(\\d+)(\\.\\d+)?px$/);\n\treturn matches ? Number(matches[1]) : undefined;\n}\n\n/**\n * Initializes the canvas style and render size without modifying the canvas display size,\n * since responsiveness is handled by the controller.resize() method. The config is used\n * to determine the aspect ratio to apply in case no explicit height has been specified.\n */\nfunction initCanvas(canvas, config) {\n\tvar style = canvas.style;\n\n\t// NOTE(SB) canvas.getAttribute('width') !== canvas.width: in the first case it\n\t// returns null or '' if no explicit value has been set to the canvas attribute.\n\tvar renderHeight = canvas.getAttribute('height');\n\tvar renderWidth = canvas.getAttribute('width');\n\n\t// Chart.js modifies some canvas values that we want to restore on destroy\n\tcanvas[EXPANDO_KEY] = {\n\t\tinitial: {\n\t\t\theight: renderHeight,\n\t\t\twidth: renderWidth,\n\t\t\tstyle: {\n\t\t\t\tdisplay: style.display,\n\t\t\t\theight: style.height,\n\t\t\t\twidth: style.width\n\t\t\t}\n\t\t}\n\t};\n\n\t// Force canvas to display as block to avoid extra space caused by inline\n\t// elements, which would interfere with the responsive resize process.\n\t// https://github.com/chartjs/Chart.js/issues/2538\n\tstyle.display = style.display || 'block';\n\n\tif (renderWidth === null || renderWidth === '') {\n\t\tvar displayWidth = readUsedSize(canvas, 'width');\n\t\tif (displayWidth !== undefined) {\n\t\t\tcanvas.width = displayWidth;\n\t\t}\n\t}\n\n\tif (renderHeight === null || renderHeight === '') {\n\t\tif (canvas.style.height === '') {\n\t\t\t// If no explicit render height and style height, let's apply the aspect ratio,\n\t\t\t// which one can be specified by the user but also by charts as default option\n\t\t\t// (i.e. options.aspectRatio). If not specified, use canvas aspect ratio of 2.\n\t\t\tcanvas.height = canvas.width / (config.options.aspectRatio || 2);\n\t\t} else {\n\t\t\tvar displayHeight = readUsedSize(canvas, 'height');\n\t\t\tif (displayWidth !== undefined) {\n\t\t\t\tcanvas.height = displayHeight;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn canvas;\n}\n\n/**\n * Detects support for options object argument in addEventListener.\n * https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Safely_detecting_option_support\n * @private\n */\nvar supportsEventListenerOptions = (function() {\n\tvar supports = false;\n\ttry {\n\t\tvar options = Object.defineProperty({}, 'passive', {\n\t\t\t// eslint-disable-next-line getter-return\n\t\t\tget: function() {\n\t\t\t\tsupports = true;\n\t\t\t}\n\t\t});\n\t\twindow.addEventListener('e', null, options);\n\t} catch (e) {\n\t\t// continue regardless of error\n\t}\n\treturn supports;\n}());\n\n// Default passive to true as expected by Chrome for 'touchstart' and 'touchend' events.\n// https://github.com/chartjs/Chart.js/issues/4287\nvar eventListenerOptions = supportsEventListenerOptions ? {passive: true} : false;\n\nfunction addListener(node, type, listener) {\n\tnode.addEventListener(type, listener, eventListenerOptions);\n}\n\nfunction removeListener(node, type, listener) {\n\tnode.removeEventListener(type, listener, eventListenerOptions);\n}\n\nfunction createEvent(type, chart, x, y, nativeEvent) {\n\treturn {\n\t\ttype: type,\n\t\tchart: chart,\n\t\tnative: nativeEvent || null,\n\t\tx: x !== undefined ? x : null,\n\t\ty: y !== undefined ? y : null,\n\t};\n}\n\nfunction fromNativeEvent(event, chart) {\n\tvar type = EVENT_TYPES[event.type] || event.type;\n\tvar pos = helpers$1.getRelativePosition(event, chart);\n\treturn createEvent(type, chart, pos.x, pos.y, event);\n}\n\nfunction throttled(fn, thisArg) {\n\tvar ticking = false;\n\tvar args = [];\n\n\treturn function() {\n\t\targs = Array.prototype.slice.call(arguments);\n\t\tthisArg = thisArg || this;\n\n\t\tif (!ticking) {\n\t\t\tticking = true;\n\t\t\thelpers$1.requestAnimFrame.call(window, function() {\n\t\t\t\tticking = false;\n\t\t\t\tfn.apply(thisArg, args);\n\t\t\t});\n\t\t}\n\t};\n}\n\nfunction createDiv(cls) {\n\tvar el = document.createElement('div');\n\tel.className = cls || '';\n\treturn el;\n}\n\n// Implementation based on https://github.com/marcj/css-element-queries\nfunction createResizer(handler) {\n\tvar maxSize = 1000000;\n\n\t// NOTE(SB) Don't use innerHTML because it could be considered unsafe.\n\t// https://github.com/chartjs/Chart.js/issues/5902\n\tvar resizer = createDiv(CSS_SIZE_MONITOR);\n\tvar expand = createDiv(CSS_SIZE_MONITOR + '-expand');\n\tvar shrink = createDiv(CSS_SIZE_MONITOR + '-shrink');\n\n\texpand.appendChild(createDiv());\n\tshrink.appendChild(createDiv());\n\n\tresizer.appendChild(expand);\n\tresizer.appendChild(shrink);\n\tresizer._reset = function() {\n\t\texpand.scrollLeft = maxSize;\n\t\texpand.scrollTop = maxSize;\n\t\tshrink.scrollLeft = maxSize;\n\t\tshrink.scrollTop = maxSize;\n\t};\n\n\tvar onScroll = function() {\n\t\tresizer._reset();\n\t\thandler();\n\t};\n\n\taddListener(expand, 'scroll', onScroll.bind(expand, 'expand'));\n\taddListener(shrink, 'scroll', onScroll.bind(shrink, 'shrink'));\n\n\treturn resizer;\n}\n\n// https://davidwalsh.name/detect-node-insertion\nfunction watchForRender(node, handler) {\n\tvar expando = node[EXPANDO_KEY] || (node[EXPANDO_KEY] = {});\n\tvar proxy = expando.renderProxy = function(e) {\n\t\tif (e.animationName === CSS_RENDER_ANIMATION) {\n\t\t\thandler();\n\t\t}\n\t};\n\n\thelpers$1.each(ANIMATION_START_EVENTS, function(type) {\n\t\taddListener(node, type, proxy);\n\t});\n\n\t// #4737: Chrome might skip the CSS animation when the CSS_RENDER_MONITOR class\n\t// is removed then added back immediately (same animation frame?). Accessing the\n\t// `offsetParent` property will force a reflow and re-evaluate the CSS animation.\n\t// https://gist.github.com/paulirish/5d52fb081b3570c81e3a#box-metrics\n\t// https://github.com/chartjs/Chart.js/issues/4737\n\texpando.reflow = !!node.offsetParent;\n\n\tnode.classList.add(CSS_RENDER_MONITOR);\n}\n\nfunction unwatchForRender(node) {\n\tvar expando = node[EXPANDO_KEY] || {};\n\tvar proxy = expando.renderProxy;\n\n\tif (proxy) {\n\t\thelpers$1.each(ANIMATION_START_EVENTS, function(type) {\n\t\t\tremoveListener(node, type, proxy);\n\t\t});\n\n\t\tdelete expando.renderProxy;\n\t}\n\n\tnode.classList.remove(CSS_RENDER_MONITOR);\n}\n\nfunction addResizeListener(node, listener, chart) {\n\tvar expando = node[EXPANDO_KEY] || (node[EXPANDO_KEY] = {});\n\n\t// Let's keep track of this added resizer and thus avoid DOM query when removing it.\n\tvar resizer = expando.resizer = createResizer(throttled(function() {\n\t\tif (expando.resizer) {\n\t\t\tvar container = chart.options.maintainAspectRatio && node.parentNode;\n\t\t\tvar w = container ? container.clientWidth : 0;\n\t\t\tlistener(createEvent('resize', chart));\n\t\t\tif (container && container.clientWidth < w && chart.canvas) {\n\t\t\t\t// If the container size shrank during chart resize, let's assume\n\t\t\t\t// scrollbar appeared. So we resize again with the scrollbar visible -\n\t\t\t\t// effectively making chart smaller and the scrollbar hidden again.\n\t\t\t\t// Because we are inside `throttled`, and currently `ticking`, scroll\n\t\t\t\t// events are ignored during this whole 2 resize process.\n\t\t\t\t// If we assumed wrong and something else happened, we are resizing\n\t\t\t\t// twice in a frame (potential performance issue)\n\t\t\t\tlistener(createEvent('resize', chart));\n\t\t\t}\n\t\t}\n\t}));\n\n\t// The resizer needs to be attached to the node parent, so we first need to be\n\t// sure that `node` is attached to the DOM before injecting the resizer element.\n\twatchForRender(node, function() {\n\t\tif (expando.resizer) {\n\t\t\tvar container = node.parentNode;\n\t\t\tif (container && container !== resizer.parentNode) {\n\t\t\t\tcontainer.insertBefore(resizer, container.firstChild);\n\t\t\t}\n\n\t\t\t// The container size might have changed, let's reset the resizer state.\n\t\t\tresizer._reset();\n\t\t}\n\t});\n}\n\nfunction removeResizeListener(node) {\n\tvar expando = node[EXPANDO_KEY] || {};\n\tvar resizer = expando.resizer;\n\n\tdelete expando.resizer;\n\tunwatchForRender(node);\n\n\tif (resizer && resizer.parentNode) {\n\t\tresizer.parentNode.removeChild(resizer);\n\t}\n}\n\nfunction injectCSS(platform, css) {\n\t// https://stackoverflow.com/q/3922139\n\tvar style = platform._style || document.createElement('style');\n\tif (!platform._style) {\n\t\tplatform._style = style;\n\t\tcss = '/* Chart.js */\\n' + css;\n\t\tstyle.setAttribute('type', 'text/css');\n\t\tdocument.getElementsByTagName('head')[0].appendChild(style);\n\t}\n\n\tstyle.appendChild(document.createTextNode(css));\n}\n\nvar platform_dom$2 = {\n\t/**\n\t * When `true`, prevents the automatic injection of the stylesheet required to\n\t * correctly detect when the chart is added to the DOM and then resized. This\n\t * switch has been added to allow external stylesheet (`dist/Chart(.min)?.js`)\n\t * to be manually imported to make this library compatible with any CSP.\n\t * See https://github.com/chartjs/Chart.js/issues/5208\n\t */\n\tdisableCSSInjection: false,\n\n\t/**\n\t * This property holds whether this platform is enabled for the current environment.\n\t * Currently used by platform.js to select the proper implementation.\n\t * @private\n\t */\n\t_enabled: typeof window !== 'undefined' && typeof document !== 'undefined',\n\n\t/**\n\t * @private\n\t */\n\t_ensureLoaded: function() {\n\t\tif (this._loaded) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._loaded = true;\n\n\t\t// https://github.com/chartjs/Chart.js/issues/5208\n\t\tif (!this.disableCSSInjection) {\n\t\t\tinjectCSS(this, stylesheet);\n\t\t}\n\t},\n\n\tacquireContext: function(item, config) {\n\t\tif (typeof item === 'string') {\n\t\t\titem = document.getElementById(item);\n\t\t} else if (item.length) {\n\t\t\t// Support for array based queries (such as jQuery)\n\t\t\titem = item[0];\n\t\t}\n\n\t\tif (item && item.canvas) {\n\t\t\t// Support for any object associated to a canvas (including a context2d)\n\t\t\titem = item.canvas;\n\t\t}\n\n\t\t// To prevent canvas fingerprinting, some add-ons undefine the getContext\n\t\t// method, for example: https://github.com/kkapsner/CanvasBlocker\n\t\t// https://github.com/chartjs/Chart.js/issues/2807\n\t\tvar context = item && item.getContext && item.getContext('2d');\n\n\t\t// Load platform resources on first chart creation, to make possible to change\n\t\t// platform options after importing the library (e.g. `disableCSSInjection`).\n\t\tthis._ensureLoaded();\n\n\t\t// `instanceof HTMLCanvasElement/CanvasRenderingContext2D` fails when the item is\n\t\t// inside an iframe or when running in a protected environment. We could guess the\n\t\t// types from their toString() value but let's keep things flexible and assume it's\n\t\t// a sufficient condition if the item has a context2D which has item as `canvas`.\n\t\t// https://github.com/chartjs/Chart.js/issues/3887\n\t\t// https://github.com/chartjs/Chart.js/issues/4102\n\t\t// https://github.com/chartjs/Chart.js/issues/4152\n\t\tif (context && context.canvas === item) {\n\t\t\tinitCanvas(item, config);\n\t\t\treturn context;\n\t\t}\n\n\t\treturn null;\n\t},\n\n\treleaseContext: function(context) {\n\t\tvar canvas = context.canvas;\n\t\tif (!canvas[EXPANDO_KEY]) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar initial = canvas[EXPANDO_KEY].initial;\n\t\t['height', 'width'].forEach(function(prop) {\n\t\t\tvar value = initial[prop];\n\t\t\tif (helpers$1.isNullOrUndef(value)) {\n\t\t\t\tcanvas.removeAttribute(prop);\n\t\t\t} else {\n\t\t\t\tcanvas.setAttribute(prop, value);\n\t\t\t}\n\t\t});\n\n\t\thelpers$1.each(initial.style || {}, function(value, key) {\n\t\t\tcanvas.style[key] = value;\n\t\t});\n\n\t\t// The canvas render size might have been changed (and thus the state stack discarded),\n\t\t// we can't use save() and restore() to restore the initial state. So make sure that at\n\t\t// least the canvas context is reset to the default state by setting the canvas width.\n\t\t// https://www.w3.org/TR/2011/WD-html5-20110525/the-canvas-element.html\n\t\t// eslint-disable-next-line no-self-assign\n\t\tcanvas.width = canvas.width;\n\n\t\tdelete canvas[EXPANDO_KEY];\n\t},\n\n\taddEventListener: function(chart, type, listener) {\n\t\tvar canvas = chart.canvas;\n\t\tif (type === 'resize') {\n\t\t\t// Note: the resize event is not supported on all browsers.\n\t\t\taddResizeListener(canvas, listener, chart);\n\t\t\treturn;\n\t\t}\n\n\t\tvar expando = listener[EXPANDO_KEY] || (listener[EXPANDO_KEY] = {});\n\t\tvar proxies = expando.proxies || (expando.proxies = {});\n\t\tvar proxy = proxies[chart.id + '_' + type] = function(event) {\n\t\t\tlistener(fromNativeEvent(event, chart));\n\t\t};\n\n\t\taddListener(canvas, type, proxy);\n\t},\n\n\tremoveEventListener: function(chart, type, listener) {\n\t\tvar canvas = chart.canvas;\n\t\tif (type === 'resize') {\n\t\t\t// Note: the resize event is not supported on all browsers.\n\t\t\tremoveResizeListener(canvas);\n\t\t\treturn;\n\t\t}\n\n\t\tvar expando = listener[EXPANDO_KEY] || {};\n\t\tvar proxies = expando.proxies || {};\n\t\tvar proxy = proxies[chart.id + '_' + type];\n\t\tif (!proxy) {\n\t\t\treturn;\n\t\t}\n\n\t\tremoveListener(canvas, type, proxy);\n\t}\n};\n\n// DEPRECATIONS\n\n/**\n * Provided for backward compatibility, use EventTarget.addEventListener instead.\n * EventTarget.addEventListener compatibility: Chrome, Opera 7, Safari, FF1.5+, IE9+\n * @see https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener\n * @function Chart.helpers.addEvent\n * @deprecated since version 2.7.0\n * @todo remove at version 3\n * @private\n */\nhelpers$1.addEvent = addListener;\n\n/**\n * Provided for backward compatibility, use EventTarget.removeEventListener instead.\n * EventTarget.removeEventListener compatibility: Chrome, Opera 7, Safari, FF1.5+, IE9+\n * @see https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/removeEventListener\n * @function Chart.helpers.removeEvent\n * @deprecated since version 2.7.0\n * @todo remove at version 3\n * @private\n */\nhelpers$1.removeEvent = removeListener;\n\n// @TODO Make possible to select another platform at build time.\nvar implementation = platform_dom$2._enabled ? platform_dom$2 : platform_basic;\n\n/**\n * @namespace Chart.platform\n * @see https://chartjs.gitbooks.io/proposals/content/Platform.html\n * @since 2.4.0\n */\nvar platform = helpers$1.extend({\n\t/**\n\t * @since 2.7.0\n\t */\n\tinitialize: function() {},\n\n\t/**\n\t * Called at chart construction time, returns a context2d instance implementing\n\t * the [W3C Canvas 2D Context API standard]{@link https://www.w3.org/TR/2dcontext/}.\n\t * @param {*} item - The native item from which to acquire context (platform specific)\n\t * @param {object} options - The chart options\n\t * @returns {CanvasRenderingContext2D} context2d instance\n\t */\n\tacquireContext: function() {},\n\n\t/**\n\t * Called at chart destruction time, releases any resources associated to the context\n\t * previously returned by the acquireContext() method.\n\t * @param {CanvasRenderingContext2D} context - The context2d instance\n\t * @returns {boolean} true if the method succeeded, else false\n\t */\n\treleaseContext: function() {},\n\n\t/**\n\t * Registers the specified listener on the given chart.\n\t * @param {Chart} chart - Chart from which to listen for event\n\t * @param {string} type - The ({@link IEvent}) type to listen for\n\t * @param {function} listener - Receives a notification (an object that implements\n\t * the {@link IEvent} interface) when an event of the specified type occurs.\n\t */\n\taddEventListener: function() {},\n\n\t/**\n\t * Removes the specified listener previously registered with addEventListener.\n\t * @param {Chart} chart - Chart from which to remove the listener\n\t * @param {string} type - The ({@link IEvent}) type to remove\n\t * @param {function} listener - The listener function to remove from the event target.\n\t */\n\tremoveEventListener: function() {}\n\n}, implementation);\n\ncore_defaults._set('global', {\n\tplugins: {}\n});\n\n/**\n * The plugin service singleton\n * @namespace Chart.plugins\n * @since 2.1.0\n */\nvar core_plugins = {\n\t/**\n\t * Globally registered plugins.\n\t * @private\n\t */\n\t_plugins: [],\n\n\t/**\n\t * This identifier is used to invalidate the descriptors cache attached to each chart\n\t * when a global plugin is registered or unregistered. In this case, the cache ID is\n\t * incremented and descriptors are regenerated during following API calls.\n\t * @private\n\t */\n\t_cacheId: 0,\n\n\t/**\n\t * Registers the given plugin(s) if not already registered.\n\t * @param {IPlugin[]|IPlugin} plugins plugin instance(s).\n\t */\n\tregister: function(plugins) {\n\t\tvar p = this._plugins;\n\t\t([]).concat(plugins).forEach(function(plugin) {\n\t\t\tif (p.indexOf(plugin) === -1) {\n\t\t\t\tp.push(plugin);\n\t\t\t}\n\t\t});\n\n\t\tthis._cacheId++;\n\t},\n\n\t/**\n\t * Unregisters the given plugin(s) only if registered.\n\t * @param {IPlugin[]|IPlugin} plugins plugin instance(s).\n\t */\n\tunregister: function(plugins) {\n\t\tvar p = this._plugins;\n\t\t([]).concat(plugins).forEach(function(plugin) {\n\t\t\tvar idx = p.indexOf(plugin);\n\t\t\tif (idx !== -1) {\n\t\t\t\tp.splice(idx, 1);\n\t\t\t}\n\t\t});\n\n\t\tthis._cacheId++;\n\t},\n\n\t/**\n\t * Remove all registered plugins.\n\t * @since 2.1.5\n\t */\n\tclear: function() {\n\t\tthis._plugins = [];\n\t\tthis._cacheId++;\n\t},\n\n\t/**\n\t * Returns the number of registered plugins?\n\t * @returns {number}\n\t * @since 2.1.5\n\t */\n\tcount: function() {\n\t\treturn this._plugins.length;\n\t},\n\n\t/**\n\t * Returns all registered plugin instances.\n\t * @returns {IPlugin[]} array of plugin objects.\n\t * @since 2.1.5\n\t */\n\tgetAll: function() {\n\t\treturn this._plugins;\n\t},\n\n\t/**\n\t * Calls enabled plugins for `chart` on the specified hook and with the given args.\n\t * This method immediately returns as soon as a plugin explicitly returns false. The\n\t * returned value can be used, for instance, to interrupt the current action.\n\t * @param {Chart} chart - The chart instance for which plugins should be called.\n\t * @param {string} hook - The name of the plugin method to call (e.g. 'beforeUpdate').\n\t * @param {Array} [args] - Extra arguments to apply to the hook call.\n\t * @returns {boolean} false if any of the plugins return false, else returns true.\n\t */\n\tnotify: function(chart, hook, args) {\n\t\tvar descriptors = this.descriptors(chart);\n\t\tvar ilen = descriptors.length;\n\t\tvar i, descriptor, plugin, params, method;\n\n\t\tfor (i = 0; i < ilen; ++i) {\n\t\t\tdescriptor = descriptors[i];\n\t\t\tplugin = descriptor.plugin;\n\t\t\tmethod = plugin[hook];\n\t\t\tif (typeof method === 'function') {\n\t\t\t\tparams = [chart].concat(args || []);\n\t\t\t\tparams.push(descriptor.options);\n\t\t\t\tif (method.apply(plugin, params) === false) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t},\n\n\t/**\n\t * Returns descriptors of enabled plugins for the given chart.\n\t * @returns {object[]} [{ plugin, options }]\n\t * @private\n\t */\n\tdescriptors: function(chart) {\n\t\tvar cache = chart.$plugins || (chart.$plugins = {});\n\t\tif (cache.id === this._cacheId) {\n\t\t\treturn cache.descriptors;\n\t\t}\n\n\t\tvar plugins = [];\n\t\tvar descriptors = [];\n\t\tvar config = (chart && chart.config) || {};\n\t\tvar options = (config.options && config.options.plugins) || {};\n\n\t\tthis._plugins.concat(config.plugins || []).forEach(function(plugin) {\n\t\t\tvar idx = plugins.indexOf(plugin);\n\t\t\tif (idx !== -1) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar id = plugin.id;\n\t\t\tvar opts = options[id];\n\t\t\tif (opts === false) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (opts === true) {\n\t\t\t\topts = helpers$1.clone(core_defaults.global.plugins[id]);\n\t\t\t}\n\n\t\t\tplugins.push(plugin);\n\t\t\tdescriptors.push({\n\t\t\t\tplugin: plugin,\n\t\t\t\toptions: opts || {}\n\t\t\t});\n\t\t});\n\n\t\tcache.descriptors = descriptors;\n\t\tcache.id = this._cacheId;\n\t\treturn descriptors;\n\t},\n\n\t/**\n\t * Invalidates cache for the given chart: descriptors hold a reference on plugin option,\n\t * but in some cases, this reference can be changed by the user when updating options.\n\t * https://github.com/chartjs/Chart.js/issues/5111#issuecomment-355934167\n\t * @private\n\t */\n\t_invalidate: function(chart) {\n\t\tdelete chart.$plugins;\n\t}\n};\n\nvar core_scaleService = {\n\t// Scale registration object. Extensions can register new scale types (such as log or DB scales) and then\n\t// use the new chart options to grab the correct scale\n\tconstructors: {},\n\t// Use a registration function so that we can move to an ES6 map when we no longer need to support\n\t// old browsers\n\n\t// Scale config defaults\n\tdefaults: {},\n\tregisterScaleType: function(type, scaleConstructor, scaleDefaults) {\n\t\tthis.constructors[type] = scaleConstructor;\n\t\tthis.defaults[type] = helpers$1.clone(scaleDefaults);\n\t},\n\tgetScaleConstructor: function(type) {\n\t\treturn this.constructors.hasOwnProperty(type) ? this.constructors[type] : undefined;\n\t},\n\tgetScaleDefaults: function(type) {\n\t\t// Return the scale defaults merged with the global settings so that we always use the latest ones\n\t\treturn this.defaults.hasOwnProperty(type) ? helpers$1.merge({}, [core_defaults.scale, this.defaults[type]]) : {};\n\t},\n\tupdateScaleDefaults: function(type, additions) {\n\t\tvar me = this;\n\t\tif (me.defaults.hasOwnProperty(type)) {\n\t\t\tme.defaults[type] = helpers$1.extend(me.defaults[type], additions);\n\t\t}\n\t},\n\taddScalesToLayout: function(chart) {\n\t\t// Adds each scale to the chart.boxes array to be sized accordingly\n\t\thelpers$1.each(chart.scales, function(scale) {\n\t\t\t// Set ILayoutItem parameters for backwards compatibility\n\t\t\tscale.fullWidth = scale.options.fullWidth;\n\t\t\tscale.position = scale.options.position;\n\t\t\tscale.weight = scale.options.weight;\n\t\t\tcore_layouts.addBox(chart, scale);\n\t\t});\n\t}\n};\n\nvar valueOrDefault$7 = helpers$1.valueOrDefault;\n\ncore_defaults._set('global', {\n\ttooltips: {\n\t\tenabled: true,\n\t\tcustom: null,\n\t\tmode: 'nearest',\n\t\tposition: 'average',\n\t\tintersect: true,\n\t\tbackgroundColor: 'rgba(0,0,0,0.8)',\n\t\ttitleFontStyle: 'bold',\n\t\ttitleSpacing: 2,\n\t\ttitleMarginBottom: 6,\n\t\ttitleFontColor: '#fff',\n\t\ttitleAlign: 'left',\n\t\tbodySpacing: 2,\n\t\tbodyFontColor: '#fff',\n\t\tbodyAlign: 'left',\n\t\tfooterFontStyle: 'bold',\n\t\tfooterSpacing: 2,\n\t\tfooterMarginTop: 6,\n\t\tfooterFontColor: '#fff',\n\t\tfooterAlign: 'left',\n\t\tyPadding: 6,\n\t\txPadding: 6,\n\t\tcaretPadding: 2,\n\t\tcaretSize: 5,\n\t\tcornerRadius: 6,\n\t\tmultiKeyBackground: '#fff',\n\t\tdisplayColors: true,\n\t\tborderColor: 'rgba(0,0,0,0)',\n\t\tborderWidth: 0,\n\t\tcallbacks: {\n\t\t\t// Args are: (tooltipItems, data)\n\t\t\tbeforeTitle: helpers$1.noop,\n\t\t\ttitle: function(tooltipItems, data) {\n\t\t\t\tvar title = '';\n\t\t\t\tvar labels = data.labels;\n\t\t\t\tvar labelCount = labels ? labels.length : 0;\n\n\t\t\t\tif (tooltipItems.length > 0) {\n\t\t\t\t\tvar item = tooltipItems[0];\n\t\t\t\t\tif (item.label) {\n\t\t\t\t\t\ttitle = item.label;\n\t\t\t\t\t} else if (item.xLabel) {\n\t\t\t\t\t\ttitle = item.xLabel;\n\t\t\t\t\t} else if (labelCount > 0 && item.index < labelCount) {\n\t\t\t\t\t\ttitle = labels[item.index];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn title;\n\t\t\t},\n\t\t\tafterTitle: helpers$1.noop,\n\n\t\t\t// Args are: (tooltipItems, data)\n\t\t\tbeforeBody: helpers$1.noop,\n\n\t\t\t// Args are: (tooltipItem, data)\n\t\t\tbeforeLabel: helpers$1.noop,\n\t\t\tlabel: function(tooltipItem, data) {\n\t\t\t\tvar label = data.datasets[tooltipItem.datasetIndex].label || '';\n\n\t\t\t\tif (label) {\n\t\t\t\t\tlabel += ': ';\n\t\t\t\t}\n\t\t\t\tif (!helpers$1.isNullOrUndef(tooltipItem.value)) {\n\t\t\t\t\tlabel += tooltipItem.value;\n\t\t\t\t} else {\n\t\t\t\t\tlabel += tooltipItem.yLabel;\n\t\t\t\t}\n\t\t\t\treturn label;\n\t\t\t},\n\t\t\tlabelColor: function(tooltipItem, chart) {\n\t\t\t\tvar meta = chart.getDatasetMeta(tooltipItem.datasetIndex);\n\t\t\t\tvar activeElement = meta.data[tooltipItem.index];\n\t\t\t\tvar view = activeElement._view;\n\t\t\t\treturn {\n\t\t\t\t\tborderColor: view.borderColor,\n\t\t\t\t\tbackgroundColor: view.backgroundColor\n\t\t\t\t};\n\t\t\t},\n\t\t\tlabelTextColor: function() {\n\t\t\t\treturn this._options.bodyFontColor;\n\t\t\t},\n\t\t\tafterLabel: helpers$1.noop,\n\n\t\t\t// Args are: (tooltipItems, data)\n\t\t\tafterBody: helpers$1.noop,\n\n\t\t\t// Args are: (tooltipItems, data)\n\t\t\tbeforeFooter: helpers$1.noop,\n\t\t\tfooter: helpers$1.noop,\n\t\t\tafterFooter: helpers$1.noop\n\t\t}\n\t}\n});\n\nvar positioners = {\n\t/**\n\t * Average mode places the tooltip at the average position of the elements shown\n\t * @function Chart.Tooltip.positioners.average\n\t * @param elements {ChartElement[]} the elements being displayed in the tooltip\n\t * @returns {object} tooltip position\n\t */\n\taverage: function(elements) {\n\t\tif (!elements.length) {\n\t\t\treturn false;\n\t\t}\n\n\t\tvar i, len;\n\t\tvar x = 0;\n\t\tvar y = 0;\n\t\tvar count = 0;\n\n\t\tfor (i = 0, len = elements.length; i < len; ++i) {\n\t\t\tvar el = elements[i];\n\t\t\tif (el && el.hasValue()) {\n\t\t\t\tvar pos = el.tooltipPosition();\n\t\t\t\tx += pos.x;\n\t\t\t\ty += pos.y;\n\t\t\t\t++count;\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\tx: x / count,\n\t\t\ty: y / count\n\t\t};\n\t},\n\n\t/**\n\t * Gets the tooltip position nearest of the item nearest to the event position\n\t * @function Chart.Tooltip.positioners.nearest\n\t * @param elements {Chart.Element[]} the tooltip elements\n\t * @param eventPosition {object} the position of the event in canvas coordinates\n\t * @returns {object} the tooltip position\n\t */\n\tnearest: function(elements, eventPosition) {\n\t\tvar x = eventPosition.x;\n\t\tvar y = eventPosition.y;\n\t\tvar minDistance = Number.POSITIVE_INFINITY;\n\t\tvar i, len, nearestElement;\n\n\t\tfor (i = 0, len = elements.length; i < len; ++i) {\n\t\t\tvar el = elements[i];\n\t\t\tif (el && el.hasValue()) {\n\t\t\t\tvar center = el.getCenterPoint();\n\t\t\t\tvar d = helpers$1.distanceBetweenPoints(eventPosition, center);\n\n\t\t\t\tif (d < minDistance) {\n\t\t\t\t\tminDistance = d;\n\t\t\t\t\tnearestElement = el;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (nearestElement) {\n\t\t\tvar tp = nearestElement.tooltipPosition();\n\t\t\tx = tp.x;\n\t\t\ty = tp.y;\n\t\t}\n\n\t\treturn {\n\t\t\tx: x,\n\t\t\ty: y\n\t\t};\n\t}\n};\n\n// Helper to push or concat based on if the 2nd parameter is an array or not\nfunction pushOrConcat(base, toPush) {\n\tif (toPush) {\n\t\tif (helpers$1.isArray(toPush)) {\n\t\t\t// base = base.concat(toPush);\n\t\t\tArray.prototype.push.apply(base, toPush);\n\t\t} else {\n\t\t\tbase.push(toPush);\n\t\t}\n\t}\n\n\treturn base;\n}\n\n/**\n * Returns array of strings split by newline\n * @param {string} value - The value to split by newline.\n * @returns {string[]} value if newline present - Returned from String split() method\n * @function\n */\nfunction splitNewlines(str) {\n\tif ((typeof str === 'string' || str instanceof String) && str.indexOf('\\n') > -1) {\n\t\treturn str.split('\\n');\n\t}\n\treturn str;\n}\n\n\n/**\n * Private helper to create a tooltip item model\n * @param element - the chart element (point, arc, bar) to create the tooltip item for\n * @return new tooltip item\n */\nfunction createTooltipItem(element) {\n\tvar xScale = element._xScale;\n\tvar yScale = element._yScale || element._scale; // handle radar || polarArea charts\n\tvar index = element._index;\n\tvar datasetIndex = element._datasetIndex;\n\tvar controller = element._chart.getDatasetMeta(datasetIndex).controller;\n\tvar indexScale = controller._getIndexScale();\n\tvar valueScale = controller._getValueScale();\n\n\treturn {\n\t\txLabel: xScale ? xScale.getLabelForIndex(index, datasetIndex) : '',\n\t\tyLabel: yScale ? yScale.getLabelForIndex(index, datasetIndex) : '',\n\t\tlabel: indexScale ? '' + indexScale.getLabelForIndex(index, datasetIndex) : '',\n\t\tvalue: valueScale ? '' + valueScale.getLabelForIndex(index, datasetIndex) : '',\n\t\tindex: index,\n\t\tdatasetIndex: datasetIndex,\n\t\tx: element._model.x,\n\t\ty: element._model.y\n\t};\n}\n\n/**\n * Helper to get the reset model for the tooltip\n * @param tooltipOpts {object} the tooltip options\n */\nfunction getBaseModel(tooltipOpts) {\n\tvar globalDefaults = core_defaults.global;\n\n\treturn {\n\t\t// Positioning\n\t\txPadding: tooltipOpts.xPadding,\n\t\tyPadding: tooltipOpts.yPadding,\n\t\txAlign: tooltipOpts.xAlign,\n\t\tyAlign: tooltipOpts.yAlign,\n\n\t\t// Body\n\t\tbodyFontColor: tooltipOpts.bodyFontColor,\n\t\t_bodyFontFamily: valueOrDefault$7(tooltipOpts.bodyFontFamily, globalDefaults.defaultFontFamily),\n\t\t_bodyFontStyle: valueOrDefault$7(tooltipOpts.bodyFontStyle, globalDefaults.defaultFontStyle),\n\t\t_bodyAlign: tooltipOpts.bodyAlign,\n\t\tbodyFontSize: valueOrDefault$7(tooltipOpts.bodyFontSize, globalDefaults.defaultFontSize),\n\t\tbodySpacing: tooltipOpts.bodySpacing,\n\n\t\t// Title\n\t\ttitleFontColor: tooltipOpts.titleFontColor,\n\t\t_titleFontFamily: valueOrDefault$7(tooltipOpts.titleFontFamily, globalDefaults.defaultFontFamily),\n\t\t_titleFontStyle: valueOrDefault$7(tooltipOpts.titleFontStyle, globalDefaults.defaultFontStyle),\n\t\ttitleFontSize: valueOrDefault$7(tooltipOpts.titleFontSize, globalDefaults.defaultFontSize),\n\t\t_titleAlign: tooltipOpts.titleAlign,\n\t\ttitleSpacing: tooltipOpts.titleSpacing,\n\t\ttitleMarginBottom: tooltipOpts.titleMarginBottom,\n\n\t\t// Footer\n\t\tfooterFontColor: tooltipOpts.footerFontColor,\n\t\t_footerFontFamily: valueOrDefault$7(tooltipOpts.footerFontFamily, globalDefaults.defaultFontFamily),\n\t\t_footerFontStyle: valueOrDefault$7(tooltipOpts.footerFontStyle, globalDefaults.defaultFontStyle),\n\t\tfooterFontSize: valueOrDefault$7(tooltipOpts.footerFontSize, globalDefaults.defaultFontSize),\n\t\t_footerAlign: tooltipOpts.footerAlign,\n\t\tfooterSpacing: tooltipOpts.footerSpacing,\n\t\tfooterMarginTop: tooltipOpts.footerMarginTop,\n\n\t\t// Appearance\n\t\tcaretSize: tooltipOpts.caretSize,\n\t\tcornerRadius: tooltipOpts.cornerRadius,\n\t\tbackgroundColor: tooltipOpts.backgroundColor,\n\t\topacity: 0,\n\t\tlegendColorBackground: tooltipOpts.multiKeyBackground,\n\t\tdisplayColors: tooltipOpts.displayColors,\n\t\tborderColor: tooltipOpts.borderColor,\n\t\tborderWidth: tooltipOpts.borderWidth\n\t};\n}\n\n/**\n * Get the size of the tooltip\n */\nfunction getTooltipSize(tooltip, model) {\n\tvar ctx = tooltip._chart.ctx;\n\n\tvar height = model.yPadding * 2; // Tooltip Padding\n\tvar width = 0;\n\n\t// Count of all lines in the body\n\tvar body = model.body;\n\tvar combinedBodyLength = body.reduce(function(count, bodyItem) {\n\t\treturn count + bodyItem.before.length + bodyItem.lines.length + bodyItem.after.length;\n\t}, 0);\n\tcombinedBodyLength += model.beforeBody.length + model.afterBody.length;\n\n\tvar titleLineCount = model.title.length;\n\tvar footerLineCount = model.footer.length;\n\tvar titleFontSize = model.titleFontSize;\n\tvar bodyFontSize = model.bodyFontSize;\n\tvar footerFontSize = model.footerFontSize;\n\n\theight += titleLineCount * titleFontSize; // Title Lines\n\theight += titleLineCount ? (titleLineCount - 1) * model.titleSpacing : 0; // Title Line Spacing\n\theight += titleLineCount ? model.titleMarginBottom : 0; // Title's bottom Margin\n\theight += combinedBodyLength * bodyFontSize; // Body Lines\n\theight += combinedBodyLength ? (combinedBodyLength - 1) * model.bodySpacing : 0; // Body Line Spacing\n\theight += footerLineCount ? model.footerMarginTop : 0; // Footer Margin\n\theight += footerLineCount * (footerFontSize); // Footer Lines\n\theight += footerLineCount ? (footerLineCount - 1) * model.footerSpacing : 0; // Footer Line Spacing\n\n\t// Title width\n\tvar widthPadding = 0;\n\tvar maxLineWidth = function(line) {\n\t\twidth = Math.max(width, ctx.measureText(line).width + widthPadding);\n\t};\n\n\tctx.font = helpers$1.fontString(titleFontSize, model._titleFontStyle, model._titleFontFamily);\n\thelpers$1.each(model.title, maxLineWidth);\n\n\t// Body width\n\tctx.font = helpers$1.fontString(bodyFontSize, model._bodyFontStyle, model._bodyFontFamily);\n\thelpers$1.each(model.beforeBody.concat(model.afterBody), maxLineWidth);\n\n\t// Body lines may include some extra width due to the color box\n\twidthPadding = model.displayColors ? (bodyFontSize + 2) : 0;\n\thelpers$1.each(body, function(bodyItem) {\n\t\thelpers$1.each(bodyItem.before, maxLineWidth);\n\t\thelpers$1.each(bodyItem.lines, maxLineWidth);\n\t\thelpers$1.each(bodyItem.after, maxLineWidth);\n\t});\n\n\t// Reset back to 0\n\twidthPadding = 0;\n\n\t// Footer width\n\tctx.font = helpers$1.fontString(footerFontSize, model._footerFontStyle, model._footerFontFamily);\n\thelpers$1.each(model.footer, maxLineWidth);\n\n\t// Add padding\n\twidth += 2 * model.xPadding;\n\n\treturn {\n\t\twidth: width,\n\t\theight: height\n\t};\n}\n\n/**\n * Helper to get the alignment of a tooltip given the size\n */\nfunction determineAlignment(tooltip, size) {\n\tvar model = tooltip._model;\n\tvar chart = tooltip._chart;\n\tvar chartArea = tooltip._chart.chartArea;\n\tvar xAlign = 'center';\n\tvar yAlign = 'center';\n\n\tif (model.y < size.height) {\n\t\tyAlign = 'top';\n\t} else if (model.y > (chart.height - size.height)) {\n\t\tyAlign = 'bottom';\n\t}\n\n\tvar lf, rf; // functions to determine left, right alignment\n\tvar olf, orf; // functions to determine if left/right alignment causes tooltip to go outside chart\n\tvar yf; // function to get the y alignment if the tooltip goes outside of the left or right edges\n\tvar midX = (chartArea.left + chartArea.right) / 2;\n\tvar midY = (chartArea.top + chartArea.bottom) / 2;\n\n\tif (yAlign === 'center') {\n\t\tlf = function(x) {\n\t\t\treturn x <= midX;\n\t\t};\n\t\trf = function(x) {\n\t\t\treturn x > midX;\n\t\t};\n\t} else {\n\t\tlf = function(x) {\n\t\t\treturn x <= (size.width / 2);\n\t\t};\n\t\trf = function(x) {\n\t\t\treturn x >= (chart.width - (size.width / 2));\n\t\t};\n\t}\n\n\tolf = function(x) {\n\t\treturn x + size.width + model.caretSize + model.caretPadding > chart.width;\n\t};\n\torf = function(x) {\n\t\treturn x - size.width - model.caretSize - model.caretPadding < 0;\n\t};\n\tyf = function(y) {\n\t\treturn y <= midY ? 'top' : 'bottom';\n\t};\n\n\tif (lf(model.x)) {\n\t\txAlign = 'left';\n\n\t\t// Is tooltip too wide and goes over the right side of the chart.?\n\t\tif (olf(model.x)) {\n\t\t\txAlign = 'center';\n\t\t\tyAlign = yf(model.y);\n\t\t}\n\t} else if (rf(model.x)) {\n\t\txAlign = 'right';\n\n\t\t// Is tooltip too wide and goes outside left edge of canvas?\n\t\tif (orf(model.x)) {\n\t\t\txAlign = 'center';\n\t\t\tyAlign = yf(model.y);\n\t\t}\n\t}\n\n\tvar opts = tooltip._options;\n\treturn {\n\t\txAlign: opts.xAlign ? opts.xAlign : xAlign,\n\t\tyAlign: opts.yAlign ? opts.yAlign : yAlign\n\t};\n}\n\n/**\n * Helper to get the location a tooltip needs to be placed at given the initial position (via the vm) and the size and alignment\n */\nfunction getBackgroundPoint(vm, size, alignment, chart) {\n\t// Background Position\n\tvar x = vm.x;\n\tvar y = vm.y;\n\n\tvar caretSize = vm.caretSize;\n\tvar caretPadding = vm.caretPadding;\n\tvar cornerRadius = vm.cornerRadius;\n\tvar xAlign = alignment.xAlign;\n\tvar yAlign = alignment.yAlign;\n\tvar paddingAndSize = caretSize + caretPadding;\n\tvar radiusAndPadding = cornerRadius + caretPadding;\n\n\tif (xAlign === 'right') {\n\t\tx -= size.width;\n\t} else if (xAlign === 'center') {\n\t\tx -= (size.width / 2);\n\t\tif (x + size.width > chart.width) {\n\t\t\tx = chart.width - size.width;\n\t\t}\n\t\tif (x < 0) {\n\t\t\tx = 0;\n\t\t}\n\t}\n\n\tif (yAlign === 'top') {\n\t\ty += paddingAndSize;\n\t} else if (yAlign === 'bottom') {\n\t\ty -= size.height + paddingAndSize;\n\t} else {\n\t\ty -= (size.height / 2);\n\t}\n\n\tif (yAlign === 'center') {\n\t\tif (xAlign === 'left') {\n\t\t\tx += paddingAndSize;\n\t\t} else if (xAlign === 'right') {\n\t\t\tx -= paddingAndSize;\n\t\t}\n\t} else if (xAlign === 'left') {\n\t\tx -= radiusAndPadding;\n\t} else if (xAlign === 'right') {\n\t\tx += radiusAndPadding;\n\t}\n\n\treturn {\n\t\tx: x,\n\t\ty: y\n\t};\n}\n\nfunction getAlignedX(vm, align) {\n\treturn align === 'center'\n\t\t? vm.x + vm.width / 2\n\t\t: align === 'right'\n\t\t\t? vm.x + vm.width - vm.xPadding\n\t\t\t: vm.x + vm.xPadding;\n}\n\n/**\n * Helper to build before and after body lines\n */\nfunction getBeforeAfterBodyLines(callback) {\n\treturn pushOrConcat([], splitNewlines(callback));\n}\n\nvar exports$3 = core_element.extend({\n\tinitialize: function() {\n\t\tthis._model = getBaseModel(this._options);\n\t\tthis._lastActive = [];\n\t},\n\n\t// Get the title\n\t// Args are: (tooltipItem, data)\n\tgetTitle: function() {\n\t\tvar me = this;\n\t\tvar opts = me._options;\n\t\tvar callbacks = opts.callbacks;\n\n\t\tvar beforeTitle = callbacks.beforeTitle.apply(me, arguments);\n\t\tvar title = callbacks.title.apply(me, arguments);\n\t\tvar afterTitle = callbacks.afterTitle.apply(me, arguments);\n\n\t\tvar lines = [];\n\t\tlines = pushOrConcat(lines, splitNewlines(beforeTitle));\n\t\tlines = pushOrConcat(lines, splitNewlines(title));\n\t\tlines = pushOrConcat(lines, splitNewlines(afterTitle));\n\n\t\treturn lines;\n\t},\n\n\t// Args are: (tooltipItem, data)\n\tgetBeforeBody: function() {\n\t\treturn getBeforeAfterBodyLines(this._options.callbacks.beforeBody.apply(this, arguments));\n\t},\n\n\t// Args are: (tooltipItem, data)\n\tgetBody: function(tooltipItems, data) {\n\t\tvar me = this;\n\t\tvar callbacks = me._options.callbacks;\n\t\tvar bodyItems = [];\n\n\t\thelpers$1.each(tooltipItems, function(tooltipItem) {\n\t\t\tvar bodyItem = {\n\t\t\t\tbefore: [],\n\t\t\t\tlines: [],\n\t\t\t\tafter: []\n\t\t\t};\n\t\t\tpushOrConcat(bodyItem.before, splitNewlines(callbacks.beforeLabel.call(me, tooltipItem, data)));\n\t\t\tpushOrConcat(bodyItem.lines, callbacks.label.call(me, tooltipItem, data));\n\t\t\tpushOrConcat(bodyItem.after, splitNewlines(callbacks.afterLabel.call(me, tooltipItem, data)));\n\n\t\t\tbodyItems.push(bodyItem);\n\t\t});\n\n\t\treturn bodyItems;\n\t},\n\n\t// Args are: (tooltipItem, data)\n\tgetAfterBody: function() {\n\t\treturn getBeforeAfterBodyLines(this._options.callbacks.afterBody.apply(this, arguments));\n\t},\n\n\t// Get the footer and beforeFooter and afterFooter lines\n\t// Args are: (tooltipItem, data)\n\tgetFooter: function() {\n\t\tvar me = this;\n\t\tvar callbacks = me._options.callbacks;\n\n\t\tvar beforeFooter = callbacks.beforeFooter.apply(me, arguments);\n\t\tvar footer = callbacks.footer.apply(me, arguments);\n\t\tvar afterFooter = callbacks.afterFooter.apply(me, arguments);\n\n\t\tvar lines = [];\n\t\tlines = pushOrConcat(lines, splitNewlines(beforeFooter));\n\t\tlines = pushOrConcat(lines, splitNewlines(footer));\n\t\tlines = pushOrConcat(lines, splitNewlines(afterFooter));\n\n\t\treturn lines;\n\t},\n\n\tupdate: function(changed) {\n\t\tvar me = this;\n\t\tvar opts = me._options;\n\n\t\t// Need to regenerate the model because its faster than using extend and it is necessary due to the optimization in Chart.Element.transition\n\t\t// that does _view = _model if ease === 1. This causes the 2nd tooltip update to set properties in both the view and model at the same time\n\t\t// which breaks any animations.\n\t\tvar existingModel = me._model;\n\t\tvar model = me._model = getBaseModel(opts);\n\t\tvar active = me._active;\n\n\t\tvar data = me._data;\n\n\t\t// In the case where active.length === 0 we need to keep these at existing values for good animations\n\t\tvar alignment = {\n\t\t\txAlign: existingModel.xAlign,\n\t\t\tyAlign: existingModel.yAlign\n\t\t};\n\t\tvar backgroundPoint = {\n\t\t\tx: existingModel.x,\n\t\t\ty: existingModel.y\n\t\t};\n\t\tvar tooltipSize = {\n\t\t\twidth: existingModel.width,\n\t\t\theight: existingModel.height\n\t\t};\n\t\tvar tooltipPosition = {\n\t\t\tx: existingModel.caretX,\n\t\t\ty: existingModel.caretY\n\t\t};\n\n\t\tvar i, len;\n\n\t\tif (active.length) {\n\t\t\tmodel.opacity = 1;\n\n\t\t\tvar labelColors = [];\n\t\t\tvar labelTextColors = [];\n\t\t\ttooltipPosition = positioners[opts.position].call(me, active, me._eventPosition);\n\n\t\t\tvar tooltipItems = [];\n\t\t\tfor (i = 0, len = active.length; i < len; ++i) {\n\t\t\t\ttooltipItems.push(createTooltipItem(active[i]));\n\t\t\t}\n\n\t\t\t// If the user provided a filter function, use it to modify the tooltip items\n\t\t\tif (opts.filter) {\n\t\t\t\ttooltipItems = tooltipItems.filter(function(a) {\n\t\t\t\t\treturn opts.filter(a, data);\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// If the user provided a sorting function, use it to modify the tooltip items\n\t\t\tif (opts.itemSort) {\n\t\t\t\ttooltipItems = tooltipItems.sort(function(a, b) {\n\t\t\t\t\treturn opts.itemSort(a, b, data);\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// Determine colors for boxes\n\t\t\thelpers$1.each(tooltipItems, function(tooltipItem) {\n\t\t\t\tlabelColors.push(opts.callbacks.labelColor.call(me, tooltipItem, me._chart));\n\t\t\t\tlabelTextColors.push(opts.callbacks.labelTextColor.call(me, tooltipItem, me._chart));\n\t\t\t});\n\n\n\t\t\t// Build the Text Lines\n\t\t\tmodel.title = me.getTitle(tooltipItems, data);\n\t\t\tmodel.beforeBody = me.getBeforeBody(tooltipItems, data);\n\t\t\tmodel.body = me.getBody(tooltipItems, data);\n\t\t\tmodel.afterBody = me.getAfterBody(tooltipItems, data);\n\t\t\tmodel.footer = me.getFooter(tooltipItems, data);\n\n\t\t\t// Initial positioning and colors\n\t\t\tmodel.x = tooltipPosition.x;\n\t\t\tmodel.y = tooltipPosition.y;\n\t\t\tmodel.caretPadding = opts.caretPadding;\n\t\t\tmodel.labelColors = labelColors;\n\t\t\tmodel.labelTextColors = labelTextColors;\n\n\t\t\t// data points\n\t\t\tmodel.dataPoints = tooltipItems;\n\n\t\t\t// We need to determine alignment of the tooltip\n\t\t\ttooltipSize = getTooltipSize(this, model);\n\t\t\talignment = determineAlignment(this, tooltipSize);\n\t\t\t// Final Size and Position\n\t\t\tbackgroundPoint = getBackgroundPoint(model, tooltipSize, alignment, me._chart);\n\t\t} else {\n\t\t\tmodel.opacity = 0;\n\t\t}\n\n\t\tmodel.xAlign = alignment.xAlign;\n\t\tmodel.yAlign = alignment.yAlign;\n\t\tmodel.x = backgroundPoint.x;\n\t\tmodel.y = backgroundPoint.y;\n\t\tmodel.width = tooltipSize.width;\n\t\tmodel.height = tooltipSize.height;\n\n\t\t// Point where the caret on the tooltip points to\n\t\tmodel.caretX = tooltipPosition.x;\n\t\tmodel.caretY = tooltipPosition.y;\n\n\t\tme._model = model;\n\n\t\tif (changed && opts.custom) {\n\t\t\topts.custom.call(me, model);\n\t\t}\n\n\t\treturn me;\n\t},\n\n\tdrawCaret: function(tooltipPoint, size) {\n\t\tvar ctx = this._chart.ctx;\n\t\tvar vm = this._view;\n\t\tvar caretPosition = this.getCaretPosition(tooltipPoint, size, vm);\n\n\t\tctx.lineTo(caretPosition.x1, caretPosition.y1);\n\t\tctx.lineTo(caretPosition.x2, caretPosition.y2);\n\t\tctx.lineTo(caretPosition.x3, caretPosition.y3);\n\t},\n\tgetCaretPosition: function(tooltipPoint, size, vm) {\n\t\tvar x1, x2, x3, y1, y2, y3;\n\t\tvar caretSize = vm.caretSize;\n\t\tvar cornerRadius = vm.cornerRadius;\n\t\tvar xAlign = vm.xAlign;\n\t\tvar yAlign = vm.yAlign;\n\t\tvar ptX = tooltipPoint.x;\n\t\tvar ptY = tooltipPoint.y;\n\t\tvar width = size.width;\n\t\tvar height = size.height;\n\n\t\tif (yAlign === 'center') {\n\t\t\ty2 = ptY + (height / 2);\n\n\t\t\tif (xAlign === 'left') {\n\t\t\t\tx1 = ptX;\n\t\t\t\tx2 = x1 - caretSize;\n\t\t\t\tx3 = x1;\n\n\t\t\t\ty1 = y2 + caretSize;\n\t\t\t\ty3 = y2 - caretSize;\n\t\t\t} else {\n\t\t\t\tx1 = ptX + width;\n\t\t\t\tx2 = x1 + caretSize;\n\t\t\t\tx3 = x1;\n\n\t\t\t\ty1 = y2 - caretSize;\n\t\t\t\ty3 = y2 + caretSize;\n\t\t\t}\n\t\t} else {\n\t\t\tif (xAlign === 'left') {\n\t\t\t\tx2 = ptX + cornerRadius + (caretSize);\n\t\t\t\tx1 = x2 - caretSize;\n\t\t\t\tx3 = x2 + caretSize;\n\t\t\t} else if (xAlign === 'right') {\n\t\t\t\tx2 = ptX + width - cornerRadius - caretSize;\n\t\t\t\tx1 = x2 - caretSize;\n\t\t\t\tx3 = x2 + caretSize;\n\t\t\t} else {\n\t\t\t\tx2 = vm.caretX;\n\t\t\t\tx1 = x2 - caretSize;\n\t\t\t\tx3 = x2 + caretSize;\n\t\t\t}\n\t\t\tif (yAlign === 'top') {\n\t\t\t\ty1 = ptY;\n\t\t\t\ty2 = y1 - caretSize;\n\t\t\t\ty3 = y1;\n\t\t\t} else {\n\t\t\t\ty1 = ptY + height;\n\t\t\t\ty2 = y1 + caretSize;\n\t\t\t\ty3 = y1;\n\t\t\t\t// invert drawing order\n\t\t\t\tvar tmp = x3;\n\t\t\t\tx3 = x1;\n\t\t\t\tx1 = tmp;\n\t\t\t}\n\t\t}\n\t\treturn {x1: x1, x2: x2, x3: x3, y1: y1, y2: y2, y3: y3};\n\t},\n\n\tdrawTitle: function(pt, vm, ctx) {\n\t\tvar title = vm.title;\n\n\t\tif (title.length) {\n\t\t\tpt.x = getAlignedX(vm, vm._titleAlign);\n\n\t\t\tctx.textAlign = vm._titleAlign;\n\t\t\tctx.textBaseline = 'top';\n\n\t\t\tvar titleFontSize = vm.titleFontSize;\n\t\t\tvar titleSpacing = vm.titleSpacing;\n\n\t\t\tctx.fillStyle = vm.titleFontColor;\n\t\t\tctx.font = helpers$1.fontString(titleFontSize, vm._titleFontStyle, vm._titleFontFamily);\n\n\t\t\tvar i, len;\n\t\t\tfor (i = 0, len = title.length; i < len; ++i) {\n\t\t\t\tctx.fillText(title[i], pt.x, pt.y);\n\t\t\t\tpt.y += titleFontSize + titleSpacing; // Line Height and spacing\n\n\t\t\t\tif (i + 1 === title.length) {\n\t\t\t\t\tpt.y += vm.titleMarginBottom - titleSpacing; // If Last, add margin, remove spacing\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\n\tdrawBody: function(pt, vm, ctx) {\n\t\tvar bodyFontSize = vm.bodyFontSize;\n\t\tvar bodySpacing = vm.bodySpacing;\n\t\tvar bodyAlign = vm._bodyAlign;\n\t\tvar body = vm.body;\n\t\tvar drawColorBoxes = vm.displayColors;\n\t\tvar labelColors = vm.labelColors;\n\t\tvar xLinePadding = 0;\n\t\tvar colorX = drawColorBoxes ? getAlignedX(vm, 'left') : 0;\n\t\tvar textColor;\n\n\t\tctx.textAlign = bodyAlign;\n\t\tctx.textBaseline = 'top';\n\t\tctx.font = helpers$1.fontString(bodyFontSize, vm._bodyFontStyle, vm._bodyFontFamily);\n\n\t\tpt.x = getAlignedX(vm, bodyAlign);\n\n\t\t// Before Body\n\t\tvar fillLineOfText = function(line) {\n\t\t\tctx.fillText(line, pt.x + xLinePadding, pt.y);\n\t\t\tpt.y += bodyFontSize + bodySpacing;\n\t\t};\n\n\t\t// Before body lines\n\t\tctx.fillStyle = vm.bodyFontColor;\n\t\thelpers$1.each(vm.beforeBody, fillLineOfText);\n\n\t\txLinePadding = drawColorBoxes && bodyAlign !== 'right'\n\t\t\t? bodyAlign === 'center' ? (bodyFontSize / 2 + 1) : (bodyFontSize + 2)\n\t\t\t: 0;\n\n\t\t// Draw body lines now\n\t\thelpers$1.each(body, function(bodyItem, i) {\n\t\t\ttextColor = vm.labelTextColors[i];\n\t\t\tctx.fillStyle = textColor;\n\t\t\thelpers$1.each(bodyItem.before, fillLineOfText);\n\n\t\t\thelpers$1.each(bodyItem.lines, function(line) {\n\t\t\t\t// Draw Legend-like boxes if needed\n\t\t\t\tif (drawColorBoxes) {\n\t\t\t\t\t// Fill a white rect so that colours merge nicely if the opacity is < 1\n\t\t\t\t\tctx.fillStyle = vm.legendColorBackground;\n\t\t\t\t\tctx.fillRect(colorX, pt.y, bodyFontSize, bodyFontSize);\n\n\t\t\t\t\t// Border\n\t\t\t\t\tctx.lineWidth = 1;\n\t\t\t\t\tctx.strokeStyle = labelColors[i].borderColor;\n\t\t\t\t\tctx.strokeRect(colorX, pt.y, bodyFontSize, bodyFontSize);\n\n\t\t\t\t\t// Inner square\n\t\t\t\t\tctx.fillStyle = labelColors[i].backgroundColor;\n\t\t\t\t\tctx.fillRect(colorX + 1, pt.y + 1, bodyFontSize - 2, bodyFontSize - 2);\n\t\t\t\t\tctx.fillStyle = textColor;\n\t\t\t\t}\n\n\t\t\t\tfillLineOfText(line);\n\t\t\t});\n\n\t\t\thelpers$1.each(bodyItem.after, fillLineOfText);\n\t\t});\n\n\t\t// Reset back to 0 for after body\n\t\txLinePadding = 0;\n\n\t\t// After body lines\n\t\thelpers$1.each(vm.afterBody, fillLineOfText);\n\t\tpt.y -= bodySpacing; // Remove last body spacing\n\t},\n\n\tdrawFooter: function(pt, vm, ctx) {\n\t\tvar footer = vm.footer;\n\n\t\tif (footer.length) {\n\t\t\tpt.x = getAlignedX(vm, vm._footerAlign);\n\t\t\tpt.y += vm.footerMarginTop;\n\n\t\t\tctx.textAlign = vm._footerAlign;\n\t\t\tctx.textBaseline = 'top';\n\n\t\t\tctx.fillStyle = vm.footerFontColor;\n\t\t\tctx.font = helpers$1.fontString(vm.footerFontSize, vm._footerFontStyle, vm._footerFontFamily);\n\n\t\t\thelpers$1.each(footer, function(line) {\n\t\t\t\tctx.fillText(line, pt.x, pt.y);\n\t\t\t\tpt.y += vm.footerFontSize + vm.footerSpacing;\n\t\t\t});\n\t\t}\n\t},\n\n\tdrawBackground: function(pt, vm, ctx, tooltipSize) {\n\t\tctx.fillStyle = vm.backgroundColor;\n\t\tctx.strokeStyle = vm.borderColor;\n\t\tctx.lineWidth = vm.borderWidth;\n\t\tvar xAlign = vm.xAlign;\n\t\tvar yAlign = vm.yAlign;\n\t\tvar x = pt.x;\n\t\tvar y = pt.y;\n\t\tvar width = tooltipSize.width;\n\t\tvar height = tooltipSize.height;\n\t\tvar radius = vm.cornerRadius;\n\n\t\tctx.beginPath();\n\t\tctx.moveTo(x + radius, y);\n\t\tif (yAlign === 'top') {\n\t\t\tthis.drawCaret(pt, tooltipSize);\n\t\t}\n\t\tctx.lineTo(x + width - radius, y);\n\t\tctx.quadraticCurveTo(x + width, y, x + width, y + radius);\n\t\tif (yAlign === 'center' && xAlign === 'right') {\n\t\t\tthis.drawCaret(pt, tooltipSize);\n\t\t}\n\t\tctx.lineTo(x + width, y + height - radius);\n\t\tctx.quadraticCurveTo(x + width, y + height, x + width - radius, y + height);\n\t\tif (yAlign === 'bottom') {\n\t\t\tthis.drawCaret(pt, tooltipSize);\n\t\t}\n\t\tctx.lineTo(x + radius, y + height);\n\t\tctx.quadraticCurveTo(x, y + height, x, y + height - radius);\n\t\tif (yAlign === 'center' && xAlign === 'left') {\n\t\t\tthis.drawCaret(pt, tooltipSize);\n\t\t}\n\t\tctx.lineTo(x, y + radius);\n\t\tctx.quadraticCurveTo(x, y, x + radius, y);\n\t\tctx.closePath();\n\n\t\tctx.fill();\n\n\t\tif (vm.borderWidth > 0) {\n\t\t\tctx.stroke();\n\t\t}\n\t},\n\n\tdraw: function() {\n\t\tvar ctx = this._chart.ctx;\n\t\tvar vm = this._view;\n\n\t\tif (vm.opacity === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar tooltipSize = {\n\t\t\twidth: vm.width,\n\t\t\theight: vm.height\n\t\t};\n\t\tvar pt = {\n\t\t\tx: vm.x,\n\t\t\ty: vm.y\n\t\t};\n\n\t\t// IE11/Edge does not like very small opacities, so snap to 0\n\t\tvar opacity = Math.abs(vm.opacity < 1e-3) ? 0 : vm.opacity;\n\n\t\t// Truthy/falsey value for empty tooltip\n\t\tvar hasTooltipContent = vm.title.length || vm.beforeBody.length || vm.body.length || vm.afterBody.length || vm.footer.length;\n\n\t\tif (this._options.enabled && hasTooltipContent) {\n\t\t\tctx.save();\n\t\t\tctx.globalAlpha = opacity;\n\n\t\t\t// Draw Background\n\t\t\tthis.drawBackground(pt, vm, ctx, tooltipSize);\n\n\t\t\t// Draw Title, Body, and Footer\n\t\t\tpt.y += vm.yPadding;\n\n\t\t\t// Titles\n\t\t\tthis.drawTitle(pt, vm, ctx);\n\n\t\t\t// Body\n\t\t\tthis.drawBody(pt, vm, ctx);\n\n\t\t\t// Footer\n\t\t\tthis.drawFooter(pt, vm, ctx);\n\n\t\t\tctx.restore();\n\t\t}\n\t},\n\n\t/**\n\t * Handle an event\n\t * @private\n\t * @param {IEvent} event - The event to handle\n\t * @returns {boolean} true if the tooltip changed\n\t */\n\thandleEvent: function(e) {\n\t\tvar me = this;\n\t\tvar options = me._options;\n\t\tvar changed = false;\n\n\t\tme._lastActive = me._lastActive || [];\n\n\t\t// Find Active Elements for tooltips\n\t\tif (e.type === 'mouseout') {\n\t\t\tme._active = [];\n\t\t} else {\n\t\t\tme._active = me._chart.getElementsAtEventForMode(e, options.mode, options);\n\t\t}\n\n\t\t// Remember Last Actives\n\t\tchanged = !helpers$1.arrayEquals(me._active, me._lastActive);\n\n\t\t// Only handle target event on tooltip change\n\t\tif (changed) {\n\t\t\tme._lastActive = me._active;\n\n\t\t\tif (options.enabled || options.custom) {\n\t\t\t\tme._eventPosition = {\n\t\t\t\t\tx: e.x,\n\t\t\t\t\ty: e.y\n\t\t\t\t};\n\n\t\t\t\tme.update(true);\n\t\t\t\tme.pivot();\n\t\t\t}\n\t\t}\n\n\t\treturn changed;\n\t}\n});\n\n/**\n * @namespace Chart.Tooltip.positioners\n */\nvar positioners_1 = positioners;\n\nvar core_tooltip = exports$3;\ncore_tooltip.positioners = positioners_1;\n\nvar valueOrDefault$8 = helpers$1.valueOrDefault;\n\ncore_defaults._set('global', {\n\telements: {},\n\tevents: [\n\t\t'mousemove',\n\t\t'mouseout',\n\t\t'click',\n\t\t'touchstart',\n\t\t'touchmove'\n\t],\n\thover: {\n\t\tonHover: null,\n\t\tmode: 'nearest',\n\t\tintersect: true,\n\t\tanimationDuration: 400\n\t},\n\tonClick: null,\n\tmaintainAspectRatio: true,\n\tresponsive: true,\n\tresponsiveAnimationDuration: 0\n});\n\n/**\n * Recursively merge the given config objects representing the `scales` option\n * by incorporating scale defaults in `xAxes` and `yAxes` array items, then\n * returns a deep copy of the result, thus doesn't alter inputs.\n */\nfunction mergeScaleConfig(/* config objects ... */) {\n\treturn helpers$1.merge({}, [].slice.call(arguments), {\n\t\tmerger: function(key, target, source, options) {\n\t\t\tif (key === 'xAxes' || key === 'yAxes') {\n\t\t\t\tvar slen = source[key].length;\n\t\t\t\tvar i, type, scale;\n\n\t\t\t\tif (!target[key]) {\n\t\t\t\t\ttarget[key] = [];\n\t\t\t\t}\n\n\t\t\t\tfor (i = 0; i < slen; ++i) {\n\t\t\t\t\tscale = source[key][i];\n\t\t\t\t\ttype = valueOrDefault$8(scale.type, key === 'xAxes' ? 'category' : 'linear');\n\n\t\t\t\t\tif (i >= target[key].length) {\n\t\t\t\t\t\ttarget[key].push({});\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!target[key][i].type || (scale.type && scale.type !== target[key][i].type)) {\n\t\t\t\t\t\t// new/untyped scale or type changed: let's apply the new defaults\n\t\t\t\t\t\t// then merge source scale to correctly overwrite the defaults.\n\t\t\t\t\t\thelpers$1.merge(target[key][i], [core_scaleService.getScaleDefaults(type), scale]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// scales type are the same\n\t\t\t\t\t\thelpers$1.merge(target[key][i], scale);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\thelpers$1._merger(key, target, source, options);\n\t\t\t}\n\t\t}\n\t});\n}\n\n/**\n * Recursively merge the given config objects as the root options by handling\n * default scale options for the `scales` and `scale` properties, then returns\n * a deep copy of the result, thus doesn't alter inputs.\n */\nfunction mergeConfig(/* config objects ... */) {\n\treturn helpers$1.merge({}, [].slice.call(arguments), {\n\t\tmerger: function(key, target, source, options) {\n\t\t\tvar tval = target[key] || {};\n\t\t\tvar sval = source[key];\n\n\t\t\tif (key === 'scales') {\n\t\t\t\t// scale config merging is complex. Add our own function here for that\n\t\t\t\ttarget[key] = mergeScaleConfig(tval, sval);\n\t\t\t} else if (key === 'scale') {\n\t\t\t\t// used in polar area & radar charts since there is only one scale\n\t\t\t\ttarget[key] = helpers$1.merge(tval, [core_scaleService.getScaleDefaults(sval.type), sval]);\n\t\t\t} else {\n\t\t\t\thelpers$1._merger(key, target, source, options);\n\t\t\t}\n\t\t}\n\t});\n}\n\nfunction initConfig(config) {\n\tconfig = config || {};\n\n\t// Do NOT use mergeConfig for the data object because this method merges arrays\n\t// and so would change references to labels and datasets, preventing data updates.\n\tvar data = config.data = config.data || {};\n\tdata.datasets = data.datasets || [];\n\tdata.labels = data.labels || [];\n\n\tconfig.options = mergeConfig(\n\t\tcore_defaults.global,\n\t\tcore_defaults[config.type],\n\t\tconfig.options || {});\n\n\treturn config;\n}\n\nfunction updateConfig(chart) {\n\tvar newOptions = chart.options;\n\n\thelpers$1.each(chart.scales, function(scale) {\n\t\tcore_layouts.removeBox(chart, scale);\n\t});\n\n\tnewOptions = mergeConfig(\n\t\tcore_defaults.global,\n\t\tcore_defaults[chart.config.type],\n\t\tnewOptions);\n\n\tchart.options = chart.config.options = newOptions;\n\tchart.ensureScalesHaveIDs();\n\tchart.buildOrUpdateScales();\n\n\t// Tooltip\n\tchart.tooltip._options = newOptions.tooltips;\n\tchart.tooltip.initialize();\n}\n\nfunction positionIsHorizontal(position) {\n\treturn position === 'top' || position === 'bottom';\n}\n\nvar Chart = function(item, config) {\n\tthis.construct(item, config);\n\treturn this;\n};\n\nhelpers$1.extend(Chart.prototype, /** @lends Chart */ {\n\t/**\n\t * @private\n\t */\n\tconstruct: function(item, config) {\n\t\tvar me = this;\n\n\t\tconfig = initConfig(config);\n\n\t\tvar context = platform.acquireContext(item, config);\n\t\tvar canvas = context && context.canvas;\n\t\tvar height = canvas && canvas.height;\n\t\tvar width = canvas && canvas.width;\n\n\t\tme.id = helpers$1.uid();\n\t\tme.ctx = context;\n\t\tme.canvas = canvas;\n\t\tme.config = config;\n\t\tme.width = width;\n\t\tme.height = height;\n\t\tme.aspectRatio = height ? width / height : null;\n\t\tme.options = config.options;\n\t\tme._bufferedRender = false;\n\n\t\t/**\n\t\t * Provided for backward compatibility, Chart and Chart.Controller have been merged,\n\t\t * the \"instance\" still need to be defined since it might be called from plugins.\n\t\t * @prop Chart#chart\n\t\t * @deprecated since version 2.6.0\n\t\t * @todo remove at version 3\n\t\t * @private\n\t\t */\n\t\tme.chart = me;\n\t\tme.controller = me; // chart.chart.controller #inception\n\n\t\t// Add the chart instance to the global namespace\n\t\tChart.instances[me.id] = me;\n\n\t\t// Define alias to the config data: `chart.data === chart.config.data`\n\t\tObject.defineProperty(me, 'data', {\n\t\t\tget: function() {\n\t\t\t\treturn me.config.data;\n\t\t\t},\n\t\t\tset: function(value) {\n\t\t\t\tme.config.data = value;\n\t\t\t}\n\t\t});\n\n\t\tif (!context || !canvas) {\n\t\t\t// The given item is not a compatible context2d element, let's return before finalizing\n\t\t\t// the chart initialization but after setting basic chart / controller properties that\n\t\t\t// can help to figure out that the chart is not valid (e.g chart.canvas !== null);\n\t\t\t// https://github.com/chartjs/Chart.js/issues/2807\n\t\t\tconsole.error(\"Failed to create chart: can't acquire context from the given item\");\n\t\t\treturn;\n\t\t}\n\n\t\tme.initialize();\n\t\tme.update();\n\t},\n\n\t/**\n\t * @private\n\t */\n\tinitialize: function() {\n\t\tvar me = this;\n\n\t\t// Before init plugin notification\n\t\tcore_plugins.notify(me, 'beforeInit');\n\n\t\thelpers$1.retinaScale(me, me.options.devicePixelRatio);\n\n\t\tme.bindEvents();\n\n\t\tif (me.options.responsive) {\n\t\t\t// Initial resize before chart draws (must be silent to preserve initial animations).\n\t\t\tme.resize(true);\n\t\t}\n\n\t\t// Make sure scales have IDs and are built before we build any controllers.\n\t\tme.ensureScalesHaveIDs();\n\t\tme.buildOrUpdateScales();\n\t\tme.initToolTip();\n\n\t\t// After init plugin notification\n\t\tcore_plugins.notify(me, 'afterInit');\n\n\t\treturn me;\n\t},\n\n\tclear: function() {\n\t\thelpers$1.canvas.clear(this);\n\t\treturn this;\n\t},\n\n\tstop: function() {\n\t\t// Stops any current animation loop occurring\n\t\tcore_animations.cancelAnimation(this);\n\t\treturn this;\n\t},\n\n\tresize: function(silent) {\n\t\tvar me = this;\n\t\tvar options = me.options;\n\t\tvar canvas = me.canvas;\n\t\tvar aspectRatio = (options.maintainAspectRatio && me.aspectRatio) || null;\n\n\t\t// the canvas render width and height will be casted to integers so make sure that\n\t\t// the canvas display style uses the same integer values to avoid blurring effect.\n\n\t\t// Set to 0 instead of canvas.size because the size defaults to 300x150 if the element is collapsed\n\t\tvar newWidth = Math.max(0, Math.floor(helpers$1.getMaximumWidth(canvas)));\n\t\tvar newHeight = Math.max(0, Math.floor(aspectRatio ? newWidth / aspectRatio : helpers$1.getMaximumHeight(canvas)));\n\n\t\tif (me.width === newWidth && me.height === newHeight) {\n\t\t\treturn;\n\t\t}\n\n\t\tcanvas.width = me.width = newWidth;\n\t\tcanvas.height = me.height = newHeight;\n\t\tcanvas.style.width = newWidth + 'px';\n\t\tcanvas.style.height = newHeight + 'px';\n\n\t\thelpers$1.retinaScale(me, options.devicePixelRatio);\n\n\t\tif (!silent) {\n\t\t\t// Notify any plugins about the resize\n\t\t\tvar newSize = {width: newWidth, height: newHeight};\n\t\t\tcore_plugins.notify(me, 'resize', [newSize]);\n\n\t\t\t// Notify of resize\n\t\t\tif (options.onResize) {\n\t\t\t\toptions.onResize(me, newSize);\n\t\t\t}\n\n\t\t\tme.stop();\n\t\t\tme.update({\n\t\t\t\tduration: options.responsiveAnimationDuration\n\t\t\t});\n\t\t}\n\t},\n\n\tensureScalesHaveIDs: function() {\n\t\tvar options = this.options;\n\t\tvar scalesOptions = options.scales || {};\n\t\tvar scaleOptions = options.scale;\n\n\t\thelpers$1.each(scalesOptions.xAxes, function(xAxisOptions, index) {\n\t\t\txAxisOptions.id = xAxisOptions.id || ('x-axis-' + index);\n\t\t});\n\n\t\thelpers$1.each(scalesOptions.yAxes, function(yAxisOptions, index) {\n\t\t\tyAxisOptions.id = yAxisOptions.id || ('y-axis-' + index);\n\t\t});\n\n\t\tif (scaleOptions) {\n\t\t\tscaleOptions.id = scaleOptions.id || 'scale';\n\t\t}\n\t},\n\n\t/**\n\t * Builds a map of scale ID to scale object for future lookup.\n\t */\n\tbuildOrUpdateScales: function() {\n\t\tvar me = this;\n\t\tvar options = me.options;\n\t\tvar scales = me.scales || {};\n\t\tvar items = [];\n\t\tvar updated = Object.keys(scales).reduce(function(obj, id) {\n\t\t\tobj[id] = false;\n\t\t\treturn obj;\n\t\t}, {});\n\n\t\tif (options.scales) {\n\t\t\titems = items.concat(\n\t\t\t\t(options.scales.xAxes || []).map(function(xAxisOptions) {\n\t\t\t\t\treturn {options: xAxisOptions, dtype: 'category', dposition: 'bottom'};\n\t\t\t\t}),\n\t\t\t\t(options.scales.yAxes || []).map(function(yAxisOptions) {\n\t\t\t\t\treturn {options: yAxisOptions, dtype: 'linear', dposition: 'left'};\n\t\t\t\t})\n\t\t\t);\n\t\t}\n\n\t\tif (options.scale) {\n\t\t\titems.push({\n\t\t\t\toptions: options.scale,\n\t\t\t\tdtype: 'radialLinear',\n\t\t\t\tisDefault: true,\n\t\t\t\tdposition: 'chartArea'\n\t\t\t});\n\t\t}\n\n\t\thelpers$1.each(items, function(item) {\n\t\t\tvar scaleOptions = item.options;\n\t\t\tvar id = scaleOptions.id;\n\t\t\tvar scaleType = valueOrDefault$8(scaleOptions.type, item.dtype);\n\n\t\t\tif (positionIsHorizontal(scaleOptions.position) !== positionIsHorizontal(item.dposition)) {\n\t\t\t\tscaleOptions.position = item.dposition;\n\t\t\t}\n\n\t\t\tupdated[id] = true;\n\t\t\tvar scale = null;\n\t\t\tif (id in scales && scales[id].type === scaleType) {\n\t\t\t\tscale = scales[id];\n\t\t\t\tscale.options = scaleOptions;\n\t\t\t\tscale.ctx = me.ctx;\n\t\t\t\tscale.chart = me;\n\t\t\t} else {\n\t\t\t\tvar scaleClass = core_scaleService.getScaleConstructor(scaleType);\n\t\t\t\tif (!scaleClass) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tscale = new scaleClass({\n\t\t\t\t\tid: id,\n\t\t\t\t\ttype: scaleType,\n\t\t\t\t\toptions: scaleOptions,\n\t\t\t\t\tctx: me.ctx,\n\t\t\t\t\tchart: me\n\t\t\t\t});\n\t\t\t\tscales[scale.id] = scale;\n\t\t\t}\n\n\t\t\tscale.mergeTicksOptions();\n\n\t\t\t// TODO(SB): I think we should be able to remove this custom case (options.scale)\n\t\t\t// and consider it as a regular scale part of the \"scales\"\" map only! This would\n\t\t\t// make the logic easier and remove some useless? custom code.\n\t\t\tif (item.isDefault) {\n\t\t\t\tme.scale = scale;\n\t\t\t}\n\t\t});\n\t\t// clear up discarded scales\n\t\thelpers$1.each(updated, function(hasUpdated, id) {\n\t\t\tif (!hasUpdated) {\n\t\t\t\tdelete scales[id];\n\t\t\t}\n\t\t});\n\n\t\tme.scales = scales;\n\n\t\tcore_scaleService.addScalesToLayout(this);\n\t},\n\n\tbuildOrUpdateControllers: function() {\n\t\tvar me = this;\n\t\tvar newControllers = [];\n\n\t\thelpers$1.each(me.data.datasets, function(dataset, datasetIndex) {\n\t\t\tvar meta = me.getDatasetMeta(datasetIndex);\n\t\t\tvar type = dataset.type || me.config.type;\n\n\t\t\tif (meta.type && meta.type !== type) {\n\t\t\t\tme.destroyDatasetMeta(datasetIndex);\n\t\t\t\tmeta = me.getDatasetMeta(datasetIndex);\n\t\t\t}\n\t\t\tmeta.type = type;\n\n\t\t\tif (meta.controller) {\n\t\t\t\tmeta.controller.updateIndex(datasetIndex);\n\t\t\t\tmeta.controller.linkScales();\n\t\t\t} else {\n\t\t\t\tvar ControllerClass = controllers[meta.type];\n\t\t\t\tif (ControllerClass === undefined) {\n\t\t\t\t\tthrow new Error('\"' + meta.type + '\" is not a chart type.');\n\t\t\t\t}\n\n\t\t\t\tmeta.controller = new ControllerClass(me, datasetIndex);\n\t\t\t\tnewControllers.push(meta.controller);\n\t\t\t}\n\t\t}, me);\n\n\t\treturn newControllers;\n\t},\n\n\t/**\n\t * Reset the elements of all datasets\n\t * @private\n\t */\n\tresetElements: function() {\n\t\tvar me = this;\n\t\thelpers$1.each(me.data.datasets, function(dataset, datasetIndex) {\n\t\t\tme.getDatasetMeta(datasetIndex).controller.reset();\n\t\t}, me);\n\t},\n\n\t/**\n\t* Resets the chart back to it's state before the initial animation\n\t*/\n\treset: function() {\n\t\tthis.resetElements();\n\t\tthis.tooltip.initialize();\n\t},\n\n\tupdate: function(config) {\n\t\tvar me = this;\n\n\t\tif (!config || typeof config !== 'object') {\n\t\t\t// backwards compatibility\n\t\t\tconfig = {\n\t\t\t\tduration: config,\n\t\t\t\tlazy: arguments[1]\n\t\t\t};\n\t\t}\n\n\t\tupdateConfig(me);\n\n\t\t// plugins options references might have change, let's invalidate the cache\n\t\t// https://github.com/chartjs/Chart.js/issues/5111#issuecomment-355934167\n\t\tcore_plugins._invalidate(me);\n\n\t\tif (core_plugins.notify(me, 'beforeUpdate') === false) {\n\t\t\treturn;\n\t\t}\n\n\t\t// In case the entire data object changed\n\t\tme.tooltip._data = me.data;\n\n\t\t// Make sure dataset controllers are updated and new controllers are reset\n\t\tvar newControllers = me.buildOrUpdateControllers();\n\n\t\t// Make sure all dataset controllers have correct meta data counts\n\t\thelpers$1.each(me.data.datasets, function(dataset, datasetIndex) {\n\t\t\tme.getDatasetMeta(datasetIndex).controller.buildOrUpdateElements();\n\t\t}, me);\n\n\t\tme.updateLayout();\n\n\t\t// Can only reset the new controllers after the scales have been updated\n\t\tif (me.options.animation && me.options.animation.duration) {\n\t\t\thelpers$1.each(newControllers, function(controller) {\n\t\t\t\tcontroller.reset();\n\t\t\t});\n\t\t}\n\n\t\tme.updateDatasets();\n\n\t\t// Need to reset tooltip in case it is displayed with elements that are removed\n\t\t// after update.\n\t\tme.tooltip.initialize();\n\n\t\t// Last active contains items that were previously in the tooltip.\n\t\t// When we reset the tooltip, we need to clear it\n\t\tme.lastActive = [];\n\n\t\t// Do this before render so that any plugins that need final scale updates can use it\n\t\tcore_plugins.notify(me, 'afterUpdate');\n\n\t\tif (me._bufferedRender) {\n\t\t\tme._bufferedRequest = {\n\t\t\t\tduration: config.duration,\n\t\t\t\teasing: config.easing,\n\t\t\t\tlazy: config.lazy\n\t\t\t};\n\t\t} else {\n\t\t\tme.render(config);\n\t\t}\n\t},\n\n\t/**\n\t * Updates the chart layout unless a plugin returns `false` to the `beforeLayout`\n\t * hook, in which case, plugins will not be called on `afterLayout`.\n\t * @private\n\t */\n\tupdateLayout: function() {\n\t\tvar me = this;\n\n\t\tif (core_plugins.notify(me, 'beforeLayout') === false) {\n\t\t\treturn;\n\t\t}\n\n\t\tcore_layouts.update(this, this.width, this.height);\n\n\t\t/**\n\t\t * Provided for backward compatibility, use `afterLayout` instead.\n\t\t * @method IPlugin#afterScaleUpdate\n\t\t * @deprecated since version 2.5.0\n\t\t * @todo remove at version 3\n\t\t * @private\n\t\t */\n\t\tcore_plugins.notify(me, 'afterScaleUpdate');\n\t\tcore_plugins.notify(me, 'afterLayout');\n\t},\n\n\t/**\n\t * Updates all datasets unless a plugin returns `false` to the `beforeDatasetsUpdate`\n\t * hook, in which case, plugins will not be called on `afterDatasetsUpdate`.\n\t * @private\n\t */\n\tupdateDatasets: function() {\n\t\tvar me = this;\n\n\t\tif (core_plugins.notify(me, 'beforeDatasetsUpdate') === false) {\n\t\t\treturn;\n\t\t}\n\n\t\tfor (var i = 0, ilen = me.data.datasets.length; i < ilen; ++i) {\n\t\t\tme.updateDataset(i);\n\t\t}\n\n\t\tcore_plugins.notify(me, 'afterDatasetsUpdate');\n\t},\n\n\t/**\n\t * Updates dataset at index unless a plugin returns `false` to the `beforeDatasetUpdate`\n\t * hook, in which case, plugins will not be called on `afterDatasetUpdate`.\n\t * @private\n\t */\n\tupdateDataset: function(index) {\n\t\tvar me = this;\n\t\tvar meta = me.getDatasetMeta(index);\n\t\tvar args = {\n\t\t\tmeta: meta,\n\t\t\tindex: index\n\t\t};\n\n\t\tif (core_plugins.notify(me, 'beforeDatasetUpdate', [args]) === false) {\n\t\t\treturn;\n\t\t}\n\n\t\tmeta.controller.update();\n\n\t\tcore_plugins.notify(me, 'afterDatasetUpdate', [args]);\n\t},\n\n\trender: function(config) {\n\t\tvar me = this;\n\n\t\tif (!config || typeof config !== 'object') {\n\t\t\t// backwards compatibility\n\t\t\tconfig = {\n\t\t\t\tduration: config,\n\t\t\t\tlazy: arguments[1]\n\t\t\t};\n\t\t}\n\n\t\tvar animationOptions = me.options.animation;\n\t\tvar duration = valueOrDefault$8(config.duration, animationOptions && animationOptions.duration);\n\t\tvar lazy = config.lazy;\n\n\t\tif (core_plugins.notify(me, 'beforeRender') === false) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar onComplete = function(animation) {\n\t\t\tcore_plugins.notify(me, 'afterRender');\n\t\t\thelpers$1.callback(animationOptions && animationOptions.onComplete, [animation], me);\n\t\t};\n\n\t\tif (animationOptions && duration) {\n\t\t\tvar animation = new core_animation({\n\t\t\t\tnumSteps: duration / 16.66, // 60 fps\n\t\t\t\teasing: config.easing || animationOptions.easing,\n\n\t\t\t\trender: function(chart, animationObject) {\n\t\t\t\t\tvar easingFunction = helpers$1.easing.effects[animationObject.easing];\n\t\t\t\t\tvar currentStep = animationObject.currentStep;\n\t\t\t\t\tvar stepDecimal = currentStep / animationObject.numSteps;\n\n\t\t\t\t\tchart.draw(easingFunction(stepDecimal), stepDecimal, currentStep);\n\t\t\t\t},\n\n\t\t\t\tonAnimationProgress: animationOptions.onProgress,\n\t\t\t\tonAnimationComplete: onComplete\n\t\t\t});\n\n\t\t\tcore_animations.addAnimation(me, animation, duration, lazy);\n\t\t} else {\n\t\t\tme.draw();\n\n\t\t\t// See https://github.com/chartjs/Chart.js/issues/3781\n\t\t\tonComplete(new core_animation({numSteps: 0, chart: me}));\n\t\t}\n\n\t\treturn me;\n\t},\n\n\tdraw: function(easingValue) {\n\t\tvar me = this;\n\n\t\tme.clear();\n\n\t\tif (helpers$1.isNullOrUndef(easingValue)) {\n\t\t\teasingValue = 1;\n\t\t}\n\n\t\tme.transition(easingValue);\n\n\t\tif (me.width <= 0 || me.height <= 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (core_plugins.notify(me, 'beforeDraw', [easingValue]) === false) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Draw all the scales\n\t\thelpers$1.each(me.boxes, function(box) {\n\t\t\tbox.draw(me.chartArea);\n\t\t}, me);\n\n\t\tme.drawDatasets(easingValue);\n\t\tme._drawTooltip(easingValue);\n\n\t\tcore_plugins.notify(me, 'afterDraw', [easingValue]);\n\t},\n\n\t/**\n\t * @private\n\t */\n\ttransition: function(easingValue) {\n\t\tvar me = this;\n\n\t\tfor (var i = 0, ilen = (me.data.datasets || []).length; i < ilen; ++i) {\n\t\t\tif (me.isDatasetVisible(i)) {\n\t\t\t\tme.getDatasetMeta(i).controller.transition(easingValue);\n\t\t\t}\n\t\t}\n\n\t\tme.tooltip.transition(easingValue);\n\t},\n\n\t/**\n\t * Draws all datasets unless a plugin returns `false` to the `beforeDatasetsDraw`\n\t * hook, in which case, plugins will not be called on `afterDatasetsDraw`.\n\t * @private\n\t */\n\tdrawDatasets: function(easingValue) {\n\t\tvar me = this;\n\n\t\tif (core_plugins.notify(me, 'beforeDatasetsDraw', [easingValue]) === false) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Draw datasets reversed to support proper line stacking\n\t\tfor (var i = (me.data.datasets || []).length - 1; i >= 0; --i) {\n\t\t\tif (me.isDatasetVisible(i)) {\n\t\t\t\tme.drawDataset(i, easingValue);\n\t\t\t}\n\t\t}\n\n\t\tcore_plugins.notify(me, 'afterDatasetsDraw', [easingValue]);\n\t},\n\n\t/**\n\t * Draws dataset at index unless a plugin returns `false` to the `beforeDatasetDraw`\n\t * hook, in which case, plugins will not be called on `afterDatasetDraw`.\n\t * @private\n\t */\n\tdrawDataset: function(index, easingValue) {\n\t\tvar me = this;\n\t\tvar meta = me.getDatasetMeta(index);\n\t\tvar args = {\n\t\t\tmeta: meta,\n\t\t\tindex: index,\n\t\t\teasingValue: easingValue\n\t\t};\n\n\t\tif (core_plugins.notify(me, 'beforeDatasetDraw', [args]) === false) {\n\t\t\treturn;\n\t\t}\n\n\t\tmeta.controller.draw(easingValue);\n\n\t\tcore_plugins.notify(me, 'afterDatasetDraw', [args]);\n\t},\n\n\t/**\n\t * Draws tooltip unless a plugin returns `false` to the `beforeTooltipDraw`\n\t * hook, in which case, plugins will not be called on `afterTooltipDraw`.\n\t * @private\n\t */\n\t_drawTooltip: function(easingValue) {\n\t\tvar me = this;\n\t\tvar tooltip = me.tooltip;\n\t\tvar args = {\n\t\t\ttooltip: tooltip,\n\t\t\teasingValue: easingValue\n\t\t};\n\n\t\tif (core_plugins.notify(me, 'beforeTooltipDraw', [args]) === false) {\n\t\t\treturn;\n\t\t}\n\n\t\ttooltip.draw();\n\n\t\tcore_plugins.notify(me, 'afterTooltipDraw', [args]);\n\t},\n\n\t/**\n\t * Get the single element that was clicked on\n\t * @return An object containing the dataset index and element index of the matching element. Also contains the rectangle that was draw\n\t */\n\tgetElementAtEvent: function(e) {\n\t\treturn core_interaction.modes.single(this, e);\n\t},\n\n\tgetElementsAtEvent: function(e) {\n\t\treturn core_interaction.modes.label(this, e, {intersect: true});\n\t},\n\n\tgetElementsAtXAxis: function(e) {\n\t\treturn core_interaction.modes['x-axis'](this, e, {intersect: true});\n\t},\n\n\tgetElementsAtEventForMode: function(e, mode, options) {\n\t\tvar method = core_interaction.modes[mode];\n\t\tif (typeof method === 'function') {\n\t\t\treturn method(this, e, options);\n\t\t}\n\n\t\treturn [];\n\t},\n\n\tgetDatasetAtEvent: function(e) {\n\t\treturn core_interaction.modes.dataset(this, e, {intersect: true});\n\t},\n\n\tgetDatasetMeta: function(datasetIndex) {\n\t\tvar me = this;\n\t\tvar dataset = me.data.datasets[datasetIndex];\n\t\tif (!dataset._meta) {\n\t\t\tdataset._meta = {};\n\t\t}\n\n\t\tvar meta = dataset._meta[me.id];\n\t\tif (!meta) {\n\t\t\tmeta = dataset._meta[me.id] = {\n\t\t\t\ttype: null,\n\t\t\t\tdata: [],\n\t\t\t\tdataset: null,\n\t\t\t\tcontroller: null,\n\t\t\t\thidden: null,\t\t\t// See isDatasetVisible() comment\n\t\t\t\txAxisID: null,\n\t\t\t\tyAxisID: null\n\t\t\t};\n\t\t}\n\n\t\treturn meta;\n\t},\n\n\tgetVisibleDatasetCount: function() {\n\t\tvar count = 0;\n\t\tfor (var i = 0, ilen = this.data.datasets.length; i < ilen; ++i) {\n\t\t\tif (this.isDatasetVisible(i)) {\n\t\t\t\tcount++;\n\t\t\t}\n\t\t}\n\t\treturn count;\n\t},\n\n\tisDatasetVisible: function(datasetIndex) {\n\t\tvar meta = this.getDatasetMeta(datasetIndex);\n\n\t\t// meta.hidden is a per chart dataset hidden flag override with 3 states: if true or false,\n\t\t// the dataset.hidden value is ignored, else if null, the dataset hidden state is returned.\n\t\treturn typeof meta.hidden === 'boolean' ? !meta.hidden : !this.data.datasets[datasetIndex].hidden;\n\t},\n\n\tgenerateLegend: function() {\n\t\treturn this.options.legendCallback(this);\n\t},\n\n\t/**\n\t * @private\n\t */\n\tdestroyDatasetMeta: function(datasetIndex) {\n\t\tvar id = this.id;\n\t\tvar dataset = this.data.datasets[datasetIndex];\n\t\tvar meta = dataset._meta && dataset._meta[id];\n\n\t\tif (meta) {\n\t\t\tmeta.controller.destroy();\n\t\t\tdelete dataset._meta[id];\n\t\t}\n\t},\n\n\tdestroy: function() {\n\t\tvar me = this;\n\t\tvar canvas = me.canvas;\n\t\tvar i, ilen;\n\n\t\tme.stop();\n\n\t\t// dataset controllers need to cleanup associated data\n\t\tfor (i = 0, ilen = me.data.datasets.length; i < ilen; ++i) {\n\t\t\tme.destroyDatasetMeta(i);\n\t\t}\n\n\t\tif (canvas) {\n\t\t\tme.unbindEvents();\n\t\t\thelpers$1.canvas.clear(me);\n\t\t\tplatform.releaseContext(me.ctx);\n\t\t\tme.canvas = null;\n\t\t\tme.ctx = null;\n\t\t}\n\n\t\tcore_plugins.notify(me, 'destroy');\n\n\t\tdelete Chart.instances[me.id];\n\t},\n\n\ttoBase64Image: function() {\n\t\treturn this.canvas.toDataURL.apply(this.canvas, arguments);\n\t},\n\n\tinitToolTip: function() {\n\t\tvar me = this;\n\t\tme.tooltip = new core_tooltip({\n\t\t\t_chart: me,\n\t\t\t_chartInstance: me, // deprecated, backward compatibility\n\t\t\t_data: me.data,\n\t\t\t_options: me.options.tooltips\n\t\t}, me);\n\t},\n\n\t/**\n\t * @private\n\t */\n\tbindEvents: function() {\n\t\tvar me = this;\n\t\tvar listeners = me._listeners = {};\n\t\tvar listener = function() {\n\t\t\tme.eventHandler.apply(me, arguments);\n\t\t};\n\n\t\thelpers$1.each(me.options.events, function(type) {\n\t\t\tplatform.addEventListener(me, type, listener);\n\t\t\tlisteners[type] = listener;\n\t\t});\n\n\t\t// Elements used to detect size change should not be injected for non responsive charts.\n\t\t// See https://github.com/chartjs/Chart.js/issues/2210\n\t\tif (me.options.responsive) {\n\t\t\tlistener = function() {\n\t\t\t\tme.resize();\n\t\t\t};\n\n\t\t\tplatform.addEventListener(me, 'resize', listener);\n\t\t\tlisteners.resize = listener;\n\t\t}\n\t},\n\n\t/**\n\t * @private\n\t */\n\tunbindEvents: function() {\n\t\tvar me = this;\n\t\tvar listeners = me._listeners;\n\t\tif (!listeners) {\n\t\t\treturn;\n\t\t}\n\n\t\tdelete me._listeners;\n\t\thelpers$1.each(listeners, function(listener, type) {\n\t\t\tplatform.removeEventListener(me, type, listener);\n\t\t});\n\t},\n\n\tupdateHoverStyle: function(elements, mode, enabled) {\n\t\tvar method = enabled ? 'setHoverStyle' : 'removeHoverStyle';\n\t\tvar element, i, ilen;\n\n\t\tfor (i = 0, ilen = elements.length; i < ilen; ++i) {\n\t\t\telement = elements[i];\n\t\t\tif (element) {\n\t\t\t\tthis.getDatasetMeta(element._datasetIndex).controller[method](element);\n\t\t\t}\n\t\t}\n\t},\n\n\t/**\n\t * @private\n\t */\n\teventHandler: function(e) {\n\t\tvar me = this;\n\t\tvar tooltip = me.tooltip;\n\n\t\tif (core_plugins.notify(me, 'beforeEvent', [e]) === false) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Buffer any update calls so that renders do not occur\n\t\tme._bufferedRender = true;\n\t\tme._bufferedRequest = null;\n\n\t\tvar changed = me.handleEvent(e);\n\t\t// for smooth tooltip animations issue #4989\n\t\t// the tooltip should be the source of change\n\t\t// Animation check workaround:\n\t\t// tooltip._start will be null when tooltip isn't animating\n\t\tif (tooltip) {\n\t\t\tchanged = tooltip._start\n\t\t\t\t? tooltip.handleEvent(e)\n\t\t\t\t: changed | tooltip.handleEvent(e);\n\t\t}\n\n\t\tcore_plugins.notify(me, 'afterEvent', [e]);\n\n\t\tvar bufferedRequest = me._bufferedRequest;\n\t\tif (bufferedRequest) {\n\t\t\t// If we have an update that was triggered, we need to do a normal render\n\t\t\tme.render(bufferedRequest);\n\t\t} else if (changed && !me.animating) {\n\t\t\t// If entering, leaving, or changing elements, animate the change via pivot\n\t\t\tme.stop();\n\n\t\t\t// We only need to render at this point. Updating will cause scales to be\n\t\t\t// recomputed generating flicker & using more memory than necessary.\n\t\t\tme.render({\n\t\t\t\tduration: me.options.hover.animationDuration,\n\t\t\t\tlazy: true\n\t\t\t});\n\t\t}\n\n\t\tme._bufferedRender = false;\n\t\tme._bufferedRequest = null;\n\n\t\treturn me;\n\t},\n\n\t/**\n\t * Handle an event\n\t * @private\n\t * @param {IEvent} event the event to handle\n\t * @return {boolean} true if the chart needs to re-render\n\t */\n\thandleEvent: function(e) {\n\t\tvar me = this;\n\t\tvar options = me.options || {};\n\t\tvar hoverOptions = options.hover;\n\t\tvar changed = false;\n\n\t\tme.lastActive = me.lastActive || [];\n\n\t\t// Find Active Elements for hover and tooltips\n\t\tif (e.type === 'mouseout') {\n\t\t\tme.active = [];\n\t\t} else {\n\t\t\tme.active = me.getElementsAtEventForMode(e, hoverOptions.mode, hoverOptions);\n\t\t}\n\n\t\t// Invoke onHover hook\n\t\t// Need to call with native event here to not break backwards compatibility\n\t\thelpers$1.callback(options.onHover || options.hover.onHover, [e.native, me.active], me);\n\n\t\tif (e.type === 'mouseup' || e.type === 'click') {\n\t\t\tif (options.onClick) {\n\t\t\t\t// Use e.native here for backwards compatibility\n\t\t\t\toptions.onClick.call(me, e.native, me.active);\n\t\t\t}\n\t\t}\n\n\t\t// Remove styling for last active (even if it may still be active)\n\t\tif (me.lastActive.length) {\n\t\t\tme.updateHoverStyle(me.lastActive, hoverOptions.mode, false);\n\t\t}\n\n\t\t// Built in hover styling\n\t\tif (me.active.length && hoverOptions.mode) {\n\t\t\tme.updateHoverStyle(me.active, hoverOptions.mode, true);\n\t\t}\n\n\t\tchanged = !helpers$1.arrayEquals(me.active, me.lastActive);\n\n\t\t// Remember Last Actives\n\t\tme.lastActive = me.active;\n\n\t\treturn changed;\n\t}\n});\n\n/**\n * NOTE(SB) We actually don't use this container anymore but we need to keep it\n * for backward compatibility. Though, it can still be useful for plugins that\n * would need to work on multiple charts?!\n */\nChart.instances = {};\n\nvar core_controller = Chart;\n\n// DEPRECATIONS\n\n/**\n * Provided for backward compatibility, use Chart instead.\n * @class Chart.Controller\n * @deprecated since version 2.6\n * @todo remove at version 3\n * @private\n */\nChart.Controller = Chart;\n\n/**\n * Provided for backward compatibility, not available anymore.\n * @namespace Chart\n * @deprecated since version 2.8\n * @todo remove at version 3\n * @private\n */\nChart.types = {};\n\n/**\n * Provided for backward compatibility, not available anymore.\n * @namespace Chart.helpers.configMerge\n * @deprecated since version 2.8.0\n * @todo remove at version 3\n * @private\n */\nhelpers$1.configMerge = mergeConfig;\n\n/**\n * Provided for backward compatibility, not available anymore.\n * @namespace Chart.helpers.scaleMerge\n * @deprecated since version 2.8.0\n * @todo remove at version 3\n * @private\n */\nhelpers$1.scaleMerge = mergeScaleConfig;\n\nvar core_helpers = function() {\n\n\t// -- Basic js utility methods\n\n\thelpers$1.where = function(collection, filterCallback) {\n\t\tif (helpers$1.isArray(collection) && Array.prototype.filter) {\n\t\t\treturn collection.filter(filterCallback);\n\t\t}\n\t\tvar filtered = [];\n\n\t\thelpers$1.each(collection, function(item) {\n\t\t\tif (filterCallback(item)) {\n\t\t\t\tfiltered.push(item);\n\t\t\t}\n\t\t});\n\n\t\treturn filtered;\n\t};\n\thelpers$1.findIndex = Array.prototype.findIndex ?\n\t\tfunction(array, callback, scope) {\n\t\t\treturn array.findIndex(callback, scope);\n\t\t} :\n\t\tfunction(array, callback, scope) {\n\t\t\tscope = scope === undefined ? array : scope;\n\t\t\tfor (var i = 0, ilen = array.length; i < ilen; ++i) {\n\t\t\t\tif (callback.call(scope, array[i], i, array)) {\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn -1;\n\t\t};\n\thelpers$1.findNextWhere = function(arrayToSearch, filterCallback, startIndex) {\n\t\t// Default to start of the array\n\t\tif (helpers$1.isNullOrUndef(startIndex)) {\n\t\t\tstartIndex = -1;\n\t\t}\n\t\tfor (var i = startIndex + 1; i < arrayToSearch.length; i++) {\n\t\t\tvar currentItem = arrayToSearch[i];\n\t\t\tif (filterCallback(currentItem)) {\n\t\t\t\treturn currentItem;\n\t\t\t}\n\t\t}\n\t};\n\thelpers$1.findPreviousWhere = function(arrayToSearch, filterCallback, startIndex) {\n\t\t// Default to end of the array\n\t\tif (helpers$1.isNullOrUndef(startIndex)) {\n\t\t\tstartIndex = arrayToSearch.length;\n\t\t}\n\t\tfor (var i = startIndex - 1; i >= 0; i--) {\n\t\t\tvar currentItem = arrayToSearch[i];\n\t\t\tif (filterCallback(currentItem)) {\n\t\t\t\treturn currentItem;\n\t\t\t}\n\t\t}\n\t};\n\n\t// -- Math methods\n\thelpers$1.isNumber = function(n) {\n\t\treturn !isNaN(parseFloat(n)) && isFinite(n);\n\t};\n\thelpers$1.almostEquals = function(x, y, epsilon) {\n\t\treturn Math.abs(x - y) < epsilon;\n\t};\n\thelpers$1.almostWhole = function(x, epsilon) {\n\t\tvar rounded = Math.round(x);\n\t\treturn (((rounded - epsilon) < x) && ((rounded + epsilon) > x));\n\t};\n\thelpers$1.max = function(array) {\n\t\treturn array.reduce(function(max, value) {\n\t\t\tif (!isNaN(value)) {\n\t\t\t\treturn Math.max(max, value);\n\t\t\t}\n\t\t\treturn max;\n\t\t}, Number.NEGATIVE_INFINITY);\n\t};\n\thelpers$1.min = function(array) {\n\t\treturn array.reduce(function(min, value) {\n\t\t\tif (!isNaN(value)) {\n\t\t\t\treturn Math.min(min, value);\n\t\t\t}\n\t\t\treturn min;\n\t\t}, Number.POSITIVE_INFINITY);\n\t};\n\thelpers$1.sign = Math.sign ?\n\t\tfunction(x) {\n\t\t\treturn Math.sign(x);\n\t\t} :\n\t\tfunction(x) {\n\t\t\tx = +x; // convert to a number\n\t\t\tif (x === 0 || isNaN(x)) {\n\t\t\t\treturn x;\n\t\t\t}\n\t\t\treturn x > 0 ? 1 : -1;\n\t\t};\n\thelpers$1.log10 = Math.log10 ?\n\t\tfunction(x) {\n\t\t\treturn Math.log10(x);\n\t\t} :\n\t\tfunction(x) {\n\t\t\tvar exponent = Math.log(x) * Math.LOG10E; // Math.LOG10E = 1 / Math.LN10.\n\t\t\t// Check for whole powers of 10,\n\t\t\t// which due to floating point rounding error should be corrected.\n\t\t\tvar powerOf10 = Math.round(exponent);\n\t\t\tvar isPowerOf10 = x === Math.pow(10, powerOf10);\n\n\t\t\treturn isPowerOf10 ? powerOf10 : exponent;\n\t\t};\n\thelpers$1.toRadians = function(degrees) {\n\t\treturn degrees * (Math.PI / 180);\n\t};\n\thelpers$1.toDegrees = function(radians) {\n\t\treturn radians * (180 / Math.PI);\n\t};\n\n\t/**\n\t * Returns the number of decimal places\n\t * i.e. the number of digits after the decimal point, of the value of this Number.\n\t * @param {number} x - A number.\n\t * @returns {number} The number of decimal places.\n\t * @private\n\t */\n\thelpers$1._decimalPlaces = function(x) {\n\t\tif (!helpers$1.isFinite(x)) {\n\t\t\treturn;\n\t\t}\n\t\tvar e = 1;\n\t\tvar p = 0;\n\t\twhile (Math.round(x * e) / e !== x) {\n\t\t\te *= 10;\n\t\t\tp++;\n\t\t}\n\t\treturn p;\n\t};\n\n\t// Gets the angle from vertical upright to the point about a centre.\n\thelpers$1.getAngleFromPoint = function(centrePoint, anglePoint) {\n\t\tvar distanceFromXCenter = anglePoint.x - centrePoint.x;\n\t\tvar distanceFromYCenter = anglePoint.y - centrePoint.y;\n\t\tvar radialDistanceFromCenter = Math.sqrt(distanceFromXCenter * distanceFromXCenter + distanceFromYCenter * distanceFromYCenter);\n\n\t\tvar angle = Math.atan2(distanceFromYCenter, distanceFromXCenter);\n\n\t\tif (angle < (-0.5 * Math.PI)) {\n\t\t\tangle += 2.0 * Math.PI; // make sure the returned angle is in the range of (-PI/2, 3PI/2]\n\t\t}\n\n\t\treturn {\n\t\t\tangle: angle,\n\t\t\tdistance: radialDistanceFromCenter\n\t\t};\n\t};\n\thelpers$1.distanceBetweenPoints = function(pt1, pt2) {\n\t\treturn Math.sqrt(Math.pow(pt2.x - pt1.x, 2) + Math.pow(pt2.y - pt1.y, 2));\n\t};\n\n\t/**\n\t * Provided for backward compatibility, not available anymore\n\t * @function Chart.helpers.aliasPixel\n\t * @deprecated since version 2.8.0\n\t * @todo remove at version 3\n\t */\n\thelpers$1.aliasPixel = function(pixelWidth) {\n\t\treturn (pixelWidth % 2 === 0) ? 0 : 0.5;\n\t};\n\n\t/**\n\t * Returns the aligned pixel value to avoid anti-aliasing blur\n\t * @param {Chart} chart - The chart instance.\n\t * @param {number} pixel - A pixel value.\n\t * @param {number} width - The width of the element.\n\t * @returns {number} The aligned pixel value.\n\t * @private\n\t */\n\thelpers$1._alignPixel = function(chart, pixel, width) {\n\t\tvar devicePixelRatio = chart.currentDevicePixelRatio;\n\t\tvar halfWidth = width / 2;\n\t\treturn Math.round((pixel - halfWidth) * devicePixelRatio) / devicePixelRatio + halfWidth;\n\t};\n\n\thelpers$1.splineCurve = function(firstPoint, middlePoint, afterPoint, t) {\n\t\t// Props to Rob Spencer at scaled innovation for his post on splining between points\n\t\t// http://scaledinnovation.com/analytics/splines/aboutSplines.html\n\n\t\t// This function must also respect \"skipped\" points\n\n\t\tvar previous = firstPoint.skip ? middlePoint : firstPoint;\n\t\tvar current = middlePoint;\n\t\tvar next = afterPoint.skip ? middlePoint : afterPoint;\n\n\t\tvar d01 = Math.sqrt(Math.pow(current.x - previous.x, 2) + Math.pow(current.y - previous.y, 2));\n\t\tvar d12 = Math.sqrt(Math.pow(next.x - current.x, 2) + Math.pow(next.y - current.y, 2));\n\n\t\tvar s01 = d01 / (d01 + d12);\n\t\tvar s12 = d12 / (d01 + d12);\n\n\t\t// If all points are the same, s01 & s02 will be inf\n\t\ts01 = isNaN(s01) ? 0 : s01;\n\t\ts12 = isNaN(s12) ? 0 : s12;\n\n\t\tvar fa = t * s01; // scaling factor for triangle Ta\n\t\tvar fb = t * s12;\n\n\t\treturn {\n\t\t\tprevious: {\n\t\t\t\tx: current.x - fa * (next.x - previous.x),\n\t\t\t\ty: current.y - fa * (next.y - previous.y)\n\t\t\t},\n\t\t\tnext: {\n\t\t\t\tx: current.x + fb * (next.x - previous.x),\n\t\t\t\ty: current.y + fb * (next.y - previous.y)\n\t\t\t}\n\t\t};\n\t};\n\thelpers$1.EPSILON = Number.EPSILON || 1e-14;\n\thelpers$1.splineCurveMonotone = function(points) {\n\t\t// This function calculates Bézier control points in a similar way than |splineCurve|,\n\t\t// but preserves monotonicity of the provided data and ensures no local extremums are added\n\t\t// between the dataset discrete points due to the interpolation.\n\t\t// See : https://en.wikipedia.org/wiki/Monotone_cubic_interpolation\n\n\t\tvar pointsWithTangents = (points || []).map(function(point) {\n\t\t\treturn {\n\t\t\t\tmodel: point._model,\n\t\t\t\tdeltaK: 0,\n\t\t\t\tmK: 0\n\t\t\t};\n\t\t});\n\n\t\t// Calculate slopes (deltaK) and initialize tangents (mK)\n\t\tvar pointsLen = pointsWithTangents.length;\n\t\tvar i, pointBefore, pointCurrent, pointAfter;\n\t\tfor (i = 0; i < pointsLen; ++i) {\n\t\t\tpointCurrent = pointsWithTangents[i];\n\t\t\tif (pointCurrent.model.skip) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tpointBefore = i > 0 ? pointsWithTangents[i - 1] : null;\n\t\t\tpointAfter = i < pointsLen - 1 ? pointsWithTangents[i + 1] : null;\n\t\t\tif (pointAfter && !pointAfter.model.skip) {\n\t\t\t\tvar slopeDeltaX = (pointAfter.model.x - pointCurrent.model.x);\n\n\t\t\t\t// In the case of two points that appear at the same x pixel, slopeDeltaX is 0\n\t\t\t\tpointCurrent.deltaK = slopeDeltaX !== 0 ? (pointAfter.model.y - pointCurrent.model.y) / slopeDeltaX : 0;\n\t\t\t}\n\n\t\t\tif (!pointBefore || pointBefore.model.skip) {\n\t\t\t\tpointCurrent.mK = pointCurrent.deltaK;\n\t\t\t} else if (!pointAfter || pointAfter.model.skip) {\n\t\t\t\tpointCurrent.mK = pointBefore.deltaK;\n\t\t\t} else if (this.sign(pointBefore.deltaK) !== this.sign(pointCurrent.deltaK)) {\n\t\t\t\tpointCurrent.mK = 0;\n\t\t\t} else {\n\t\t\t\tpointCurrent.mK = (pointBefore.deltaK + pointCurrent.deltaK) / 2;\n\t\t\t}\n\t\t}\n\n\t\t// Adjust tangents to ensure monotonic properties\n\t\tvar alphaK, betaK, tauK, squaredMagnitude;\n\t\tfor (i = 0; i < pointsLen - 1; ++i) {\n\t\t\tpointCurrent = pointsWithTangents[i];\n\t\t\tpointAfter = pointsWithTangents[i + 1];\n\t\t\tif (pointCurrent.model.skip || pointAfter.model.skip) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (helpers$1.almostEquals(pointCurrent.deltaK, 0, this.EPSILON)) {\n\t\t\t\tpointCurrent.mK = pointAfter.mK = 0;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\talphaK = pointCurrent.mK / pointCurrent.deltaK;\n\t\t\tbetaK = pointAfter.mK / pointCurrent.deltaK;\n\t\t\tsquaredMagnitude = Math.pow(alphaK, 2) + Math.pow(betaK, 2);\n\t\t\tif (squaredMagnitude <= 9) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\ttauK = 3 / Math.sqrt(squaredMagnitude);\n\t\t\tpointCurrent.mK = alphaK * tauK * pointCurrent.deltaK;\n\t\t\tpointAfter.mK = betaK * tauK * pointCurrent.deltaK;\n\t\t}\n\n\t\t// Compute control points\n\t\tvar deltaX;\n\t\tfor (i = 0; i < pointsLen; ++i) {\n\t\t\tpointCurrent = pointsWithTangents[i];\n\t\t\tif (pointCurrent.model.skip) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tpointBefore = i > 0 ? pointsWithTangents[i - 1] : null;\n\t\t\tpointAfter = i < pointsLen - 1 ? pointsWithTangents[i + 1] : null;\n\t\t\tif (pointBefore && !pointBefore.model.skip) {\n\t\t\t\tdeltaX = (pointCurrent.model.x - pointBefore.model.x) / 3;\n\t\t\t\tpointCurrent.model.controlPointPreviousX = pointCurrent.model.x - deltaX;\n\t\t\t\tpointCurrent.model.controlPointPreviousY = pointCurrent.model.y - deltaX * pointCurrent.mK;\n\t\t\t}\n\t\t\tif (pointAfter && !pointAfter.model.skip) {\n\t\t\t\tdeltaX = (pointAfter.model.x - pointCurrent.model.x) / 3;\n\t\t\t\tpointCurrent.model.controlPointNextX = pointCurrent.model.x + deltaX;\n\t\t\t\tpointCurrent.model.controlPointNextY = pointCurrent.model.y + deltaX * pointCurrent.mK;\n\t\t\t}\n\t\t}\n\t};\n\thelpers$1.nextItem = function(collection, index, loop) {\n\t\tif (loop) {\n\t\t\treturn index >= collection.length - 1 ? collection[0] : collection[index + 1];\n\t\t}\n\t\treturn index >= collection.length - 1 ? collection[collection.length - 1] : collection[index + 1];\n\t};\n\thelpers$1.previousItem = function(collection, index, loop) {\n\t\tif (loop) {\n\t\t\treturn index <= 0 ? collection[collection.length - 1] : collection[index - 1];\n\t\t}\n\t\treturn index <= 0 ? collection[0] : collection[index - 1];\n\t};\n\t// Implementation of the nice number algorithm used in determining where axis labels will go\n\thelpers$1.niceNum = function(range, round) {\n\t\tvar exponent = Math.floor(helpers$1.log10(range));\n\t\tvar fraction = range / Math.pow(10, exponent);\n\t\tvar niceFraction;\n\n\t\tif (round) {\n\t\t\tif (fraction < 1.5) {\n\t\t\t\tniceFraction = 1;\n\t\t\t} else if (fraction < 3) {\n\t\t\t\tniceFraction = 2;\n\t\t\t} else if (fraction < 7) {\n\t\t\t\tniceFraction = 5;\n\t\t\t} else {\n\t\t\t\tniceFraction = 10;\n\t\t\t}\n\t\t} else if (fraction <= 1.0) {\n\t\t\tniceFraction = 1;\n\t\t} else if (fraction <= 2) {\n\t\t\tniceFraction = 2;\n\t\t} else if (fraction <= 5) {\n\t\t\tniceFraction = 5;\n\t\t} else {\n\t\t\tniceFraction = 10;\n\t\t}\n\n\t\treturn niceFraction * Math.pow(10, exponent);\n\t};\n\t// Request animation polyfill - https://www.paulirish.com/2011/requestanimationframe-for-smart-animating/\n\thelpers$1.requestAnimFrame = (function() {\n\t\tif (typeof window === 'undefined') {\n\t\t\treturn function(callback) {\n\t\t\t\tcallback();\n\t\t\t};\n\t\t}\n\t\treturn window.requestAnimationFrame ||\n\t\t\twindow.webkitRequestAnimationFrame ||\n\t\t\twindow.mozRequestAnimationFrame ||\n\t\t\twindow.oRequestAnimationFrame ||\n\t\t\twindow.msRequestAnimationFrame ||\n\t\t\tfunction(callback) {\n\t\t\t\treturn window.setTimeout(callback, 1000 / 60);\n\t\t\t};\n\t}());\n\t// -- DOM methods\n\thelpers$1.getRelativePosition = function(evt, chart) {\n\t\tvar mouseX, mouseY;\n\t\tvar e = evt.originalEvent || evt;\n\t\tvar canvas = evt.target || evt.srcElement;\n\t\tvar boundingRect = canvas.getBoundingClientRect();\n\n\t\tvar touches = e.touches;\n\t\tif (touches && touches.length > 0) {\n\t\t\tmouseX = touches[0].clientX;\n\t\t\tmouseY = touches[0].clientY;\n\n\t\t} else {\n\t\t\tmouseX = e.clientX;\n\t\t\tmouseY = e.clientY;\n\t\t}\n\n\t\t// Scale mouse coordinates into canvas coordinates\n\t\t// by following the pattern laid out by 'jerryj' in the comments of\n\t\t// https://www.html5canvastutorials.com/advanced/html5-canvas-mouse-coordinates/\n\t\tvar paddingLeft = parseFloat(helpers$1.getStyle(canvas, 'padding-left'));\n\t\tvar paddingTop = parseFloat(helpers$1.getStyle(canvas, 'padding-top'));\n\t\tvar paddingRight = parseFloat(helpers$1.getStyle(canvas, 'padding-right'));\n\t\tvar paddingBottom = parseFloat(helpers$1.getStyle(canvas, 'padding-bottom'));\n\t\tvar width = boundingRect.right - boundingRect.left - paddingLeft - paddingRight;\n\t\tvar height = boundingRect.bottom - boundingRect.top - paddingTop - paddingBottom;\n\n\t\t// We divide by the current device pixel ratio, because the canvas is scaled up by that amount in each direction. However\n\t\t// the backend model is in unscaled coordinates. Since we are going to deal with our model coordinates, we go back here\n\t\tmouseX = Math.round((mouseX - boundingRect.left - paddingLeft) / (width) * canvas.width / chart.currentDevicePixelRatio);\n\t\tmouseY = Math.round((mouseY - boundingRect.top - paddingTop) / (height) * canvas.height / chart.currentDevicePixelRatio);\n\n\t\treturn {\n\t\t\tx: mouseX,\n\t\t\ty: mouseY\n\t\t};\n\n\t};\n\n\t// Private helper function to convert max-width/max-height values that may be percentages into a number\n\tfunction parseMaxStyle(styleValue, node, parentProperty) {\n\t\tvar valueInPixels;\n\t\tif (typeof styleValue === 'string') {\n\t\t\tvalueInPixels = parseInt(styleValue, 10);\n\n\t\t\tif (styleValue.indexOf('%') !== -1) {\n\t\t\t\t// percentage * size in dimension\n\t\t\t\tvalueInPixels = valueInPixels / 100 * node.parentNode[parentProperty];\n\t\t\t}\n\t\t} else {\n\t\t\tvalueInPixels = styleValue;\n\t\t}\n\n\t\treturn valueInPixels;\n\t}\n\n\t/**\n\t * Returns if the given value contains an effective constraint.\n\t * @private\n\t */\n\tfunction isConstrainedValue(value) {\n\t\treturn value !== undefined && value !== null && value !== 'none';\n\t}\n\n\t/**\n\t * Returns the max width or height of the given DOM node in a cross-browser compatible fashion\n\t * @param {HTMLElement} domNode - the node to check the constraint on\n\t * @param {string} maxStyle - the style that defines the maximum for the direction we are using ('max-width' / 'max-height')\n\t * @param {string} percentageProperty - property of parent to use when calculating width as a percentage\n\t * @see {@link https://www.nathanaeljones.com/blog/2013/reading-max-width-cross-browser}\n\t */\n\tfunction getConstraintDimension(domNode, maxStyle, percentageProperty) {\n\t\tvar view = document.defaultView;\n\t\tvar parentNode = helpers$1._getParentNode(domNode);\n\t\tvar constrainedNode = view.getComputedStyle(domNode)[maxStyle];\n\t\tvar constrainedContainer = view.getComputedStyle(parentNode)[maxStyle];\n\t\tvar hasCNode = isConstrainedValue(constrainedNode);\n\t\tvar hasCContainer = isConstrainedValue(constrainedContainer);\n\t\tvar infinity = Number.POSITIVE_INFINITY;\n\n\t\tif (hasCNode || hasCContainer) {\n\t\t\treturn Math.min(\n\t\t\t\thasCNode ? parseMaxStyle(constrainedNode, domNode, percentageProperty) : infinity,\n\t\t\t\thasCContainer ? parseMaxStyle(constrainedContainer, parentNode, percentageProperty) : infinity);\n\t\t}\n\n\t\treturn 'none';\n\t}\n\t// returns Number or undefined if no constraint\n\thelpers$1.getConstraintWidth = function(domNode) {\n\t\treturn getConstraintDimension(domNode, 'max-width', 'clientWidth');\n\t};\n\t// returns Number or undefined if no constraint\n\thelpers$1.getConstraintHeight = function(domNode) {\n\t\treturn getConstraintDimension(domNode, 'max-height', 'clientHeight');\n\t};\n\t/**\n\t * @private\n \t */\n\thelpers$1._calculatePadding = function(container, padding, parentDimension) {\n\t\tpadding = helpers$1.getStyle(container, padding);\n\n\t\treturn padding.indexOf('%') > -1 ? parentDimension * parseInt(padding, 10) / 100 : parseInt(padding, 10);\n\t};\n\t/**\n\t * @private\n\t */\n\thelpers$1._getParentNode = function(domNode) {\n\t\tvar parent = domNode.parentNode;\n\t\tif (parent && parent.toString() === '[object ShadowRoot]') {\n\t\t\tparent = parent.host;\n\t\t}\n\t\treturn parent;\n\t};\n\thelpers$1.getMaximumWidth = function(domNode) {\n\t\tvar container = helpers$1._getParentNode(domNode);\n\t\tif (!container) {\n\t\t\treturn domNode.clientWidth;\n\t\t}\n\n\t\tvar clientWidth = container.clientWidth;\n\t\tvar paddingLeft = helpers$1._calculatePadding(container, 'padding-left', clientWidth);\n\t\tvar paddingRight = helpers$1._calculatePadding(container, 'padding-right', clientWidth);\n\n\t\tvar w = clientWidth - paddingLeft - paddingRight;\n\t\tvar cw = helpers$1.getConstraintWidth(domNode);\n\t\treturn isNaN(cw) ? w : Math.min(w, cw);\n\t};\n\thelpers$1.getMaximumHeight = function(domNode) {\n\t\tvar container = helpers$1._getParentNode(domNode);\n\t\tif (!container) {\n\t\t\treturn domNode.clientHeight;\n\t\t}\n\n\t\tvar clientHeight = container.clientHeight;\n\t\tvar paddingTop = helpers$1._calculatePadding(container, 'padding-top', clientHeight);\n\t\tvar paddingBottom = helpers$1._calculatePadding(container, 'padding-bottom', clientHeight);\n\n\t\tvar h = clientHeight - paddingTop - paddingBottom;\n\t\tvar ch = helpers$1.getConstraintHeight(domNode);\n\t\treturn isNaN(ch) ? h : Math.min(h, ch);\n\t};\n\thelpers$1.getStyle = function(el, property) {\n\t\treturn el.currentStyle ?\n\t\t\tel.currentStyle[property] :\n\t\t\tdocument.defaultView.getComputedStyle(el, null).getPropertyValue(property);\n\t};\n\thelpers$1.retinaScale = function(chart, forceRatio) {\n\t\tvar pixelRatio = chart.currentDevicePixelRatio = forceRatio || (typeof window !== 'undefined' && window.devicePixelRatio) || 1;\n\t\tif (pixelRatio === 1) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar canvas = chart.canvas;\n\t\tvar height = chart.height;\n\t\tvar width = chart.width;\n\n\t\tcanvas.height = height * pixelRatio;\n\t\tcanvas.width = width * pixelRatio;\n\t\tchart.ctx.scale(pixelRatio, pixelRatio);\n\n\t\t// If no style has been set on the canvas, the render size is used as display size,\n\t\t// making the chart visually bigger, so let's enforce it to the \"correct\" values.\n\t\t// See https://github.com/chartjs/Chart.js/issues/3575\n\t\tif (!canvas.style.height && !canvas.style.width) {\n\t\t\tcanvas.style.height = height + 'px';\n\t\t\tcanvas.style.width = width + 'px';\n\t\t}\n\t};\n\t// -- Canvas methods\n\thelpers$1.fontString = function(pixelSize, fontStyle, fontFamily) {\n\t\treturn fontStyle + ' ' + pixelSize + 'px ' + fontFamily;\n\t};\n\thelpers$1.longestText = function(ctx, font, arrayOfThings, cache) {\n\t\tcache = cache || {};\n\t\tvar data = cache.data = cache.data || {};\n\t\tvar gc = cache.garbageCollect = cache.garbageCollect || [];\n\n\t\tif (cache.font !== font) {\n\t\t\tdata = cache.data = {};\n\t\t\tgc = cache.garbageCollect = [];\n\t\t\tcache.font = font;\n\t\t}\n\n\t\tctx.font = font;\n\t\tvar longest = 0;\n\t\thelpers$1.each(arrayOfThings, function(thing) {\n\t\t\t// Undefined strings and arrays should not be measured\n\t\t\tif (thing !== undefined && thing !== null && helpers$1.isArray(thing) !== true) {\n\t\t\t\tlongest = helpers$1.measureText(ctx, data, gc, longest, thing);\n\t\t\t} else if (helpers$1.isArray(thing)) {\n\t\t\t\t// if it is an array lets measure each element\n\t\t\t\t// to do maybe simplify this function a bit so we can do this more recursively?\n\t\t\t\thelpers$1.each(thing, function(nestedThing) {\n\t\t\t\t\t// Undefined strings and arrays should not be measured\n\t\t\t\t\tif (nestedThing !== undefined && nestedThing !== null && !helpers$1.isArray(nestedThing)) {\n\t\t\t\t\t\tlongest = helpers$1.measureText(ctx, data, gc, longest, nestedThing);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\n\t\tvar gcLen = gc.length / 2;\n\t\tif (gcLen > arrayOfThings.length) {\n\t\t\tfor (var i = 0; i < gcLen; i++) {\n\t\t\t\tdelete data[gc[i]];\n\t\t\t}\n\t\t\tgc.splice(0, gcLen);\n\t\t}\n\t\treturn longest;\n\t};\n\thelpers$1.measureText = function(ctx, data, gc, longest, string) {\n\t\tvar textWidth = data[string];\n\t\tif (!textWidth) {\n\t\t\ttextWidth = data[string] = ctx.measureText(string).width;\n\t\t\tgc.push(string);\n\t\t}\n\t\tif (textWidth > longest) {\n\t\t\tlongest = textWidth;\n\t\t}\n\t\treturn longest;\n\t};\n\thelpers$1.numberOfLabelLines = function(arrayOfThings) {\n\t\tvar numberOfLines = 1;\n\t\thelpers$1.each(arrayOfThings, function(thing) {\n\t\t\tif (helpers$1.isArray(thing)) {\n\t\t\t\tif (thing.length > numberOfLines) {\n\t\t\t\t\tnumberOfLines = thing.length;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\treturn numberOfLines;\n\t};\n\n\thelpers$1.color = !chartjsColor ?\n\t\tfunction(value) {\n\t\t\tconsole.error('Color.js not found!');\n\t\t\treturn value;\n\t\t} :\n\t\tfunction(value) {\n\t\t\t/* global CanvasGradient */\n\t\t\tif (value instanceof CanvasGradient) {\n\t\t\t\tvalue = core_defaults.global.defaultColor;\n\t\t\t}\n\n\t\t\treturn chartjsColor(value);\n\t\t};\n\n\thelpers$1.getHoverColor = function(colorValue) {\n\t\t/* global CanvasPattern */\n\t\treturn (colorValue instanceof CanvasPattern || colorValue instanceof CanvasGradient) ?\n\t\t\tcolorValue :\n\t\t\thelpers$1.color(colorValue).saturate(0.5).darken(0.1).rgbString();\n\t};\n};\n\nfunction abstract() {\n\tthrow new Error(\n\t\t'This method is not implemented: either no adapter can ' +\n\t\t'be found or an incomplete integration was provided.'\n\t);\n}\n\n/**\n * Date adapter (current used by the time scale)\n * @namespace Chart._adapters._date\n * @memberof Chart._adapters\n * @private\n */\n\n/**\n * Currently supported unit string values.\n * @typedef {('millisecond'|'second'|'minute'|'hour'|'day'|'week'|'month'|'quarter'|'year')}\n * @memberof Chart._adapters._date\n * @name Unit\n */\n\n/**\n * @class\n */\nfunction DateAdapter(options) {\n\tthis.options = options || {};\n}\n\nhelpers$1.extend(DateAdapter.prototype, /** @lends DateAdapter */ {\n\t/**\n\t * Returns a map of time formats for the supported formatting units defined\n\t * in Unit as well as 'datetime' representing a detailed date/time string.\n\t * @returns {{string: string}}\n\t */\n\tformats: abstract,\n\n\t/**\n\t * Parses the given `value` and return the associated timestamp.\n\t * @param {any} value - the value to parse (usually comes from the data)\n\t * @param {string} [format] - the expected data format\n\t * @returns {(number|null)}\n\t * @function\n\t */\n\tparse: abstract,\n\n\t/**\n\t * Returns the formatted date in the specified `format` for a given `timestamp`.\n\t * @param {number} timestamp - the timestamp to format\n\t * @param {string} format - the date/time token\n\t * @return {string}\n\t * @function\n\t */\n\tformat: abstract,\n\n\t/**\n\t * Adds the specified `amount` of `unit` to the given `timestamp`.\n\t * @param {number} timestamp - the input timestamp\n\t * @param {number} amount - the amount to add\n\t * @param {Unit} unit - the unit as string\n\t * @return {number}\n\t * @function\n\t */\n\tadd: abstract,\n\n\t/**\n\t * Returns the number of `unit` between the given timestamps.\n\t * @param {number} max - the input timestamp (reference)\n\t * @param {number} min - the timestamp to substract\n\t * @param {Unit} unit - the unit as string\n\t * @return {number}\n\t * @function\n\t */\n\tdiff: abstract,\n\n\t/**\n\t * Returns start of `unit` for the given `timestamp`.\n\t * @param {number} timestamp - the input timestamp\n\t * @param {Unit} unit - the unit as string\n\t * @param {number} [weekday] - the ISO day of the week with 1 being Monday\n\t * and 7 being Sunday (only needed if param *unit* is `isoWeek`).\n\t * @function\n\t */\n\tstartOf: abstract,\n\n\t/**\n\t * Returns end of `unit` for the given `timestamp`.\n\t * @param {number} timestamp - the input timestamp\n\t * @param {Unit} unit - the unit as string\n\t * @function\n\t */\n\tendOf: abstract,\n\n\t// DEPRECATIONS\n\n\t/**\n\t * Provided for backward compatibility for scale.getValueForPixel(),\n\t * this method should be overridden only by the moment adapter.\n\t * @deprecated since version 2.8.0\n\t * @todo remove at version 3\n\t * @private\n\t */\n\t_create: function(value) {\n\t\treturn value;\n\t}\n});\n\nDateAdapter.override = function(members) {\n\thelpers$1.extend(DateAdapter.prototype, members);\n};\n\nvar _date = DateAdapter;\n\nvar core_adapters = {\n\t_date: _date\n};\n\n/**\n * Namespace to hold static tick generation functions\n * @namespace Chart.Ticks\n */\nvar core_ticks = {\n\t/**\n\t * Namespace to hold formatters for different types of ticks\n\t * @namespace Chart.Ticks.formatters\n\t */\n\tformatters: {\n\t\t/**\n\t\t * Formatter for value labels\n\t\t * @method Chart.Ticks.formatters.values\n\t\t * @param value the value to display\n\t\t * @return {string|string[]} the label to display\n\t\t */\n\t\tvalues: function(value) {\n\t\t\treturn helpers$1.isArray(value) ? value : '' + value;\n\t\t},\n\n\t\t/**\n\t\t * Formatter for linear numeric ticks\n\t\t * @method Chart.Ticks.formatters.linear\n\t\t * @param tickValue {number} the value to be formatted\n\t\t * @param index {number} the position of the tickValue parameter in the ticks array\n\t\t * @param ticks {number[]} the list of ticks being converted\n\t\t * @return {string} string representation of the tickValue parameter\n\t\t */\n\t\tlinear: function(tickValue, index, ticks) {\n\t\t\t// If we have lots of ticks, don't use the ones\n\t\t\tvar delta = ticks.length > 3 ? ticks[2] - ticks[1] : ticks[1] - ticks[0];\n\n\t\t\t// If we have a number like 2.5 as the delta, figure out how many decimal places we need\n\t\t\tif (Math.abs(delta) > 1) {\n\t\t\t\tif (tickValue !== Math.floor(tickValue)) {\n\t\t\t\t\t// not an integer\n\t\t\t\t\tdelta = tickValue - Math.floor(tickValue);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar logDelta = helpers$1.log10(Math.abs(delta));\n\t\t\tvar tickString = '';\n\n\t\t\tif (tickValue !== 0) {\n\t\t\t\tvar maxTick = Math.max(Math.abs(ticks[0]), Math.abs(ticks[ticks.length - 1]));\n\t\t\t\tif (maxTick < 1e-4) { // all ticks are small numbers; use scientific notation\n\t\t\t\t\tvar logTick = helpers$1.log10(Math.abs(tickValue));\n\t\t\t\t\ttickString = tickValue.toExponential(Math.floor(logTick) - Math.floor(logDelta));\n\t\t\t\t} else {\n\t\t\t\t\tvar numDecimal = -1 * Math.floor(logDelta);\n\t\t\t\t\tnumDecimal = Math.max(Math.min(numDecimal, 20), 0); // toFixed has a max of 20 decimal places\n\t\t\t\t\ttickString = tickValue.toFixed(numDecimal);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\ttickString = '0'; // never show decimal places for 0\n\t\t\t}\n\n\t\t\treturn tickString;\n\t\t},\n\n\t\tlogarithmic: function(tickValue, index, ticks) {\n\t\t\tvar remain = tickValue / (Math.pow(10, Math.floor(helpers$1.log10(tickValue))));\n\n\t\t\tif (tickValue === 0) {\n\t\t\t\treturn '0';\n\t\t\t} else if (remain === 1 || remain === 2 || remain === 5 || index === 0 || index === ticks.length - 1) {\n\t\t\t\treturn tickValue.toExponential();\n\t\t\t}\n\t\t\treturn '';\n\t\t}\n\t}\n};\n\nvar valueOrDefault$9 = helpers$1.valueOrDefault;\nvar valueAtIndexOrDefault = helpers$1.valueAtIndexOrDefault;\n\ncore_defaults._set('scale', {\n\tdisplay: true,\n\tposition: 'left',\n\toffset: false,\n\n\t// grid line settings\n\tgridLines: {\n\t\tdisplay: true,\n\t\tcolor: 'rgba(0, 0, 0, 0.1)',\n\t\tlineWidth: 1,\n\t\tdrawBorder: true,\n\t\tdrawOnChartArea: true,\n\t\tdrawTicks: true,\n\t\ttickMarkLength: 10,\n\t\tzeroLineWidth: 1,\n\t\tzeroLineColor: 'rgba(0,0,0,0.25)',\n\t\tzeroLineBorderDash: [],\n\t\tzeroLineBorderDashOffset: 0.0,\n\t\toffsetGridLines: false,\n\t\tborderDash: [],\n\t\tborderDashOffset: 0.0\n\t},\n\n\t// scale label\n\tscaleLabel: {\n\t\t// display property\n\t\tdisplay: false,\n\n\t\t// actual label\n\t\tlabelString: '',\n\n\t\t// top/bottom padding\n\t\tpadding: {\n\t\t\ttop: 4,\n\t\t\tbottom: 4\n\t\t}\n\t},\n\n\t// label settings\n\tticks: {\n\t\tbeginAtZero: false,\n\t\tminRotation: 0,\n\t\tmaxRotation: 50,\n\t\tmirror: false,\n\t\tpadding: 0,\n\t\treverse: false,\n\t\tdisplay: true,\n\t\tautoSkip: true,\n\t\tautoSkipPadding: 0,\n\t\tlabelOffset: 0,\n\t\t// We pass through arrays to be rendered as multiline labels, we convert Others to strings here.\n\t\tcallback: core_ticks.formatters.values,\n\t\tminor: {},\n\t\tmajor: {}\n\t}\n});\n\nfunction labelsFromTicks(ticks) {\n\tvar labels = [];\n\tvar i, ilen;\n\n\tfor (i = 0, ilen = ticks.length; i < ilen; ++i) {\n\t\tlabels.push(ticks[i].label);\n\t}\n\n\treturn labels;\n}\n\nfunction getPixelForGridLine(scale, index, offsetGridLines) {\n\tvar lineValue = scale.getPixelForTick(index);\n\n\tif (offsetGridLines) {\n\t\tif (scale.getTicks().length === 1) {\n\t\t\tlineValue -= scale.isHorizontal() ?\n\t\t\t\tMath.max(lineValue - scale.left, scale.right - lineValue) :\n\t\t\t\tMath.max(lineValue - scale.top, scale.bottom - lineValue);\n\t\t} else if (index === 0) {\n\t\t\tlineValue -= (scale.getPixelForTick(1) - lineValue) / 2;\n\t\t} else {\n\t\t\tlineValue -= (lineValue - scale.getPixelForTick(index - 1)) / 2;\n\t\t}\n\t}\n\treturn lineValue;\n}\n\nfunction computeTextSize(context, tick, font) {\n\treturn helpers$1.isArray(tick) ?\n\t\thelpers$1.longestText(context, font, tick) :\n\t\tcontext.measureText(tick).width;\n}\n\nvar core_scale = core_element.extend({\n\t/**\n\t * Get the padding needed for the scale\n\t * @method getPadding\n\t * @private\n\t * @returns {Padding} the necessary padding\n\t */\n\tgetPadding: function() {\n\t\tvar me = this;\n\t\treturn {\n\t\t\tleft: me.paddingLeft || 0,\n\t\t\ttop: me.paddingTop || 0,\n\t\t\tright: me.paddingRight || 0,\n\t\t\tbottom: me.paddingBottom || 0\n\t\t};\n\t},\n\n\t/**\n\t * Returns the scale tick objects ({label, major})\n\t * @since 2.7\n\t */\n\tgetTicks: function() {\n\t\treturn this._ticks;\n\t},\n\n\t// These methods are ordered by lifecyle. Utilities then follow.\n\t// Any function defined here is inherited by all scale types.\n\t// Any function can be extended by the scale type\n\n\tmergeTicksOptions: function() {\n\t\tvar ticks = this.options.ticks;\n\t\tif (ticks.minor === false) {\n\t\t\tticks.minor = {\n\t\t\t\tdisplay: false\n\t\t\t};\n\t\t}\n\t\tif (ticks.major === false) {\n\t\t\tticks.major = {\n\t\t\t\tdisplay: false\n\t\t\t};\n\t\t}\n\t\tfor (var key in ticks) {\n\t\t\tif (key !== 'major' && key !== 'minor') {\n\t\t\t\tif (typeof ticks.minor[key] === 'undefined') {\n\t\t\t\t\tticks.minor[key] = ticks[key];\n\t\t\t\t}\n\t\t\t\tif (typeof ticks.major[key] === 'undefined') {\n\t\t\t\t\tticks.major[key] = ticks[key];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\tbeforeUpdate: function() {\n\t\thelpers$1.callback(this.options.beforeUpdate, [this]);\n\t},\n\n\tupdate: function(maxWidth, maxHeight, margins) {\n\t\tvar me = this;\n\t\tvar i, ilen, labels, label, ticks, tick;\n\n\t\t// Update Lifecycle - Probably don't want to ever extend or overwrite this function ;)\n\t\tme.beforeUpdate();\n\n\t\t// Absorb the master measurements\n\t\tme.maxWidth = maxWidth;\n\t\tme.maxHeight = maxHeight;\n\t\tme.margins = helpers$1.extend({\n\t\t\tleft: 0,\n\t\t\tright: 0,\n\t\t\ttop: 0,\n\t\t\tbottom: 0\n\t\t}, margins);\n\n\t\tme._maxLabelLines = 0;\n\t\tme.longestLabelWidth = 0;\n\t\tme.longestTextCache = me.longestTextCache || {};\n\n\t\t// Dimensions\n\t\tme.beforeSetDimensions();\n\t\tme.setDimensions();\n\t\tme.afterSetDimensions();\n\n\t\t// Data min/max\n\t\tme.beforeDataLimits();\n\t\tme.determineDataLimits();\n\t\tme.afterDataLimits();\n\n\t\t// Ticks - `this.ticks` is now DEPRECATED!\n\t\t// Internal ticks are now stored as objects in the PRIVATE `this._ticks` member\n\t\t// and must not be accessed directly from outside this class. `this.ticks` being\n\t\t// around for long time and not marked as private, we can't change its structure\n\t\t// without unexpected breaking changes. If you need to access the scale ticks,\n\t\t// use scale.getTicks() instead.\n\n\t\tme.beforeBuildTicks();\n\n\t\t// New implementations should return an array of objects but for BACKWARD COMPAT,\n\t\t// we still support no return (`this.ticks` internally set by calling this method).\n\t\tticks = me.buildTicks() || [];\n\n\t\t// Allow modification of ticks in callback.\n\t\tticks = me.afterBuildTicks(ticks) || ticks;\n\n\t\tme.beforeTickToLabelConversion();\n\n\t\t// New implementations should return the formatted tick labels but for BACKWARD\n\t\t// COMPAT, we still support no return (`this.ticks` internally changed by calling\n\t\t// this method and supposed to contain only string values).\n\t\tlabels = me.convertTicksToLabels(ticks) || me.ticks;\n\n\t\tme.afterTickToLabelConversion();\n\n\t\tme.ticks = labels; // BACKWARD COMPATIBILITY\n\n\t\t// IMPORTANT: from this point, we consider that `this.ticks` will NEVER change!\n\n\t\t// BACKWARD COMPAT: synchronize `_ticks` with labels (so potentially `this.ticks`)\n\t\tfor (i = 0, ilen = labels.length; i < ilen; ++i) {\n\t\t\tlabel = labels[i];\n\t\t\ttick = ticks[i];\n\t\t\tif (!tick) {\n\t\t\t\tticks.push(tick = {\n\t\t\t\t\tlabel: label,\n\t\t\t\t\tmajor: false\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\ttick.label = label;\n\t\t\t}\n\t\t}\n\n\t\tme._ticks = ticks;\n\n\t\t// Tick Rotation\n\t\tme.beforeCalculateTickRotation();\n\t\tme.calculateTickRotation();\n\t\tme.afterCalculateTickRotation();\n\t\t// Fit\n\t\tme.beforeFit();\n\t\tme.fit();\n\t\tme.afterFit();\n\t\t//\n\t\tme.afterUpdate();\n\n\t\treturn me.minSize;\n\n\t},\n\tafterUpdate: function() {\n\t\thelpers$1.callback(this.options.afterUpdate, [this]);\n\t},\n\n\t//\n\n\tbeforeSetDimensions: function() {\n\t\thelpers$1.callback(this.options.beforeSetDimensions, [this]);\n\t},\n\tsetDimensions: function() {\n\t\tvar me = this;\n\t\t// Set the unconstrained dimension before label rotation\n\t\tif (me.isHorizontal()) {\n\t\t\t// Reset position before calculating rotation\n\t\t\tme.width = me.maxWidth;\n\t\t\tme.left = 0;\n\t\t\tme.right = me.width;\n\t\t} else {\n\t\t\tme.height = me.maxHeight;\n\n\t\t\t// Reset position before calculating rotation\n\t\t\tme.top = 0;\n\t\t\tme.bottom = me.height;\n\t\t}\n\n\t\t// Reset padding\n\t\tme.paddingLeft = 0;\n\t\tme.paddingTop = 0;\n\t\tme.paddingRight = 0;\n\t\tme.paddingBottom = 0;\n\t},\n\tafterSetDimensions: function() {\n\t\thelpers$1.callback(this.options.afterSetDimensions, [this]);\n\t},\n\n\t// Data limits\n\tbeforeDataLimits: function() {\n\t\thelpers$1.callback(this.options.beforeDataLimits, [this]);\n\t},\n\tdetermineDataLimits: helpers$1.noop,\n\tafterDataLimits: function() {\n\t\thelpers$1.callback(this.options.afterDataLimits, [this]);\n\t},\n\n\t//\n\tbeforeBuildTicks: function() {\n\t\thelpers$1.callback(this.options.beforeBuildTicks, [this]);\n\t},\n\tbuildTicks: helpers$1.noop,\n\tafterBuildTicks: function(ticks) {\n\t\tvar me = this;\n\t\t// ticks is empty for old axis implementations here\n\t\tif (helpers$1.isArray(ticks) && ticks.length) {\n\t\t\treturn helpers$1.callback(me.options.afterBuildTicks, [me, ticks]);\n\t\t}\n\t\t// Support old implementations (that modified `this.ticks` directly in buildTicks)\n\t\tme.ticks = helpers$1.callback(me.options.afterBuildTicks, [me, me.ticks]) || me.ticks;\n\t\treturn ticks;\n\t},\n\n\tbeforeTickToLabelConversion: function() {\n\t\thelpers$1.callback(this.options.beforeTickToLabelConversion, [this]);\n\t},\n\tconvertTicksToLabels: function() {\n\t\tvar me = this;\n\t\t// Convert ticks to strings\n\t\tvar tickOpts = me.options.ticks;\n\t\tme.ticks = me.ticks.map(tickOpts.userCallback || tickOpts.callback, this);\n\t},\n\tafterTickToLabelConversion: function() {\n\t\thelpers$1.callback(this.options.afterTickToLabelConversion, [this]);\n\t},\n\n\t//\n\n\tbeforeCalculateTickRotation: function() {\n\t\thelpers$1.callback(this.options.beforeCalculateTickRotation, [this]);\n\t},\n\tcalculateTickRotation: function() {\n\t\tvar me = this;\n\t\tvar context = me.ctx;\n\t\tvar tickOpts = me.options.ticks;\n\t\tvar labels = labelsFromTicks(me._ticks);\n\n\t\t// Get the width of each grid by calculating the difference\n\t\t// between x offsets between 0 and 1.\n\t\tvar tickFont = helpers$1.options._parseFont(tickOpts);\n\t\tcontext.font = tickFont.string;\n\n\t\tvar labelRotation = tickOpts.minRotation || 0;\n\n\t\tif (labels.length && me.options.display && me.isHorizontal()) {\n\t\t\tvar originalLabelWidth = helpers$1.longestText(context, tickFont.string, labels, me.longestTextCache);\n\t\t\tvar labelWidth = originalLabelWidth;\n\t\t\tvar cosRotation, sinRotation;\n\n\t\t\t// Allow 3 pixels x2 padding either side for label readability\n\t\t\tvar tickWidth = me.getPixelForTick(1) - me.getPixelForTick(0) - 6;\n\n\t\t\t// Max label rotation can be set or default to 90 - also act as a loop counter\n\t\t\twhile (labelWidth > tickWidth && labelRotation < tickOpts.maxRotation) {\n\t\t\t\tvar angleRadians = helpers$1.toRadians(labelRotation);\n\t\t\t\tcosRotation = Math.cos(angleRadians);\n\t\t\t\tsinRotation = Math.sin(angleRadians);\n\n\t\t\t\tif (sinRotation * originalLabelWidth > me.maxHeight) {\n\t\t\t\t\t// go back one step\n\t\t\t\t\tlabelRotation--;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tlabelRotation++;\n\t\t\t\tlabelWidth = cosRotation * originalLabelWidth;\n\t\t\t}\n\t\t}\n\n\t\tme.labelRotation = labelRotation;\n\t},\n\tafterCalculateTickRotation: function() {\n\t\thelpers$1.callback(this.options.afterCalculateTickRotation, [this]);\n\t},\n\n\t//\n\n\tbeforeFit: function() {\n\t\thelpers$1.callback(this.options.beforeFit, [this]);\n\t},\n\tfit: function() {\n\t\tvar me = this;\n\t\t// Reset\n\t\tvar minSize = me.minSize = {\n\t\t\twidth: 0,\n\t\t\theight: 0\n\t\t};\n\n\t\tvar labels = labelsFromTicks(me._ticks);\n\n\t\tvar opts = me.options;\n\t\tvar tickOpts = opts.ticks;\n\t\tvar scaleLabelOpts = opts.scaleLabel;\n\t\tvar gridLineOpts = opts.gridLines;\n\t\tvar display = me._isVisible();\n\t\tvar position = opts.position;\n\t\tvar isHorizontal = me.isHorizontal();\n\n\t\tvar parseFont = helpers$1.options._parseFont;\n\t\tvar tickFont = parseFont(tickOpts);\n\t\tvar tickMarkLength = opts.gridLines.tickMarkLength;\n\n\t\t// Width\n\t\tif (isHorizontal) {\n\t\t\t// subtract the margins to line up with the chartArea if we are a full width scale\n\t\t\tminSize.width = me.isFullWidth() ? me.maxWidth - me.margins.left - me.margins.right : me.maxWidth;\n\t\t} else {\n\t\t\tminSize.width = display && gridLineOpts.drawTicks ? tickMarkLength : 0;\n\t\t}\n\n\t\t// height\n\t\tif (isHorizontal) {\n\t\t\tminSize.height = display && gridLineOpts.drawTicks ? tickMarkLength : 0;\n\t\t} else {\n\t\t\tminSize.height = me.maxHeight; // fill all the height\n\t\t}\n\n\t\t// Are we showing a title for the scale?\n\t\tif (scaleLabelOpts.display && display) {\n\t\t\tvar scaleLabelFont = parseFont(scaleLabelOpts);\n\t\t\tvar scaleLabelPadding = helpers$1.options.toPadding(scaleLabelOpts.padding);\n\t\t\tvar deltaHeight = scaleLabelFont.lineHeight + scaleLabelPadding.height;\n\n\t\t\tif (isHorizontal) {\n\t\t\t\tminSize.height += deltaHeight;\n\t\t\t} else {\n\t\t\t\tminSize.width += deltaHeight;\n\t\t\t}\n\t\t}\n\n\t\t// Don't bother fitting the ticks if we are not showing the labels\n\t\tif (tickOpts.display && display) {\n\t\t\tvar largestTextWidth = helpers$1.longestText(me.ctx, tickFont.string, labels, me.longestTextCache);\n\t\t\tvar tallestLabelHeightInLines = helpers$1.numberOfLabelLines(labels);\n\t\t\tvar lineSpace = tickFont.size * 0.5;\n\t\t\tvar tickPadding = me.options.ticks.padding;\n\n\t\t\t// Store max number of lines and widest label for _autoSkip\n\t\t\tme._maxLabelLines = tallestLabelHeightInLines;\n\t\t\tme.longestLabelWidth = largestTextWidth;\n\n\t\t\tif (isHorizontal) {\n\t\t\t\tvar angleRadians = helpers$1.toRadians(me.labelRotation);\n\t\t\t\tvar cosRotation = Math.cos(angleRadians);\n\t\t\t\tvar sinRotation = Math.sin(angleRadians);\n\n\t\t\t\t// TODO - improve this calculation\n\t\t\t\tvar labelHeight = (sinRotation * largestTextWidth)\n\t\t\t\t\t+ (tickFont.lineHeight * tallestLabelHeightInLines)\n\t\t\t\t\t+ lineSpace; // padding\n\n\t\t\t\tminSize.height = Math.min(me.maxHeight, minSize.height + labelHeight + tickPadding);\n\n\t\t\t\tme.ctx.font = tickFont.string;\n\t\t\t\tvar firstLabelWidth = computeTextSize(me.ctx, labels[0], tickFont.string);\n\t\t\t\tvar lastLabelWidth = computeTextSize(me.ctx, labels[labels.length - 1], tickFont.string);\n\t\t\t\tvar offsetLeft = me.getPixelForTick(0) - me.left;\n\t\t\t\tvar offsetRight = me.right - me.getPixelForTick(labels.length - 1);\n\t\t\t\tvar paddingLeft, paddingRight;\n\n\t\t\t\t// Ensure that our ticks are always inside the canvas. When rotated, ticks are right aligned\n\t\t\t\t// which means that the right padding is dominated by the font height\n\t\t\t\tif (me.labelRotation !== 0) {\n\t\t\t\t\tpaddingLeft = position === 'bottom' ? (cosRotation * firstLabelWidth) : (cosRotation * lineSpace);\n\t\t\t\t\tpaddingRight = position === 'bottom' ? (cosRotation * lineSpace) : (cosRotation * lastLabelWidth);\n\t\t\t\t} else {\n\t\t\t\t\tpaddingLeft = firstLabelWidth / 2;\n\t\t\t\t\tpaddingRight = lastLabelWidth / 2;\n\t\t\t\t}\n\t\t\t\tme.paddingLeft = Math.max(paddingLeft - offsetLeft, 0) + 3; // add 3 px to move away from canvas edges\n\t\t\t\tme.paddingRight = Math.max(paddingRight - offsetRight, 0) + 3;\n\t\t\t} else {\n\t\t\t\t// A vertical axis is more constrained by the width. Labels are the\n\t\t\t\t// dominant factor here, so get that length first and account for padding\n\t\t\t\tif (tickOpts.mirror) {\n\t\t\t\t\tlargestTextWidth = 0;\n\t\t\t\t} else {\n\t\t\t\t\t// use lineSpace for consistency with horizontal axis\n\t\t\t\t\t// tickPadding is not implemented for horizontal\n\t\t\t\t\tlargestTextWidth += tickPadding + lineSpace;\n\t\t\t\t}\n\n\t\t\t\tminSize.width = Math.min(me.maxWidth, minSize.width + largestTextWidth);\n\n\t\t\t\tme.paddingTop = tickFont.size / 2;\n\t\t\t\tme.paddingBottom = tickFont.size / 2;\n\t\t\t}\n\t\t}\n\n\t\tme.handleMargins();\n\n\t\tme.width = minSize.width;\n\t\tme.height = minSize.height;\n\t},\n\n\t/**\n\t * Handle margins and padding interactions\n\t * @private\n\t */\n\thandleMargins: function() {\n\t\tvar me = this;\n\t\tif (me.margins) {\n\t\t\tme.paddingLeft = Math.max(me.paddingLeft - me.margins.left, 0);\n\t\t\tme.paddingTop = Math.max(me.paddingTop - me.margins.top, 0);\n\t\t\tme.paddingRight = Math.max(me.paddingRight - me.margins.right, 0);\n\t\t\tme.paddingBottom = Math.max(me.paddingBottom - me.margins.bottom, 0);\n\t\t}\n\t},\n\n\tafterFit: function() {\n\t\thelpers$1.callback(this.options.afterFit, [this]);\n\t},\n\n\t// Shared Methods\n\tisHorizontal: function() {\n\t\treturn this.options.position === 'top' || this.options.position === 'bottom';\n\t},\n\tisFullWidth: function() {\n\t\treturn (this.options.fullWidth);\n\t},\n\n\t// Get the correct value. NaN bad inputs, If the value type is object get the x or y based on whether we are horizontal or not\n\tgetRightValue: function(rawValue) {\n\t\t// Null and undefined values first\n\t\tif (helpers$1.isNullOrUndef(rawValue)) {\n\t\t\treturn NaN;\n\t\t}\n\t\t// isNaN(object) returns true, so make sure NaN is checking for a number; Discard Infinite values\n\t\tif ((typeof rawValue === 'number' || rawValue instanceof Number) && !isFinite(rawValue)) {\n\t\t\treturn NaN;\n\t\t}\n\t\t// If it is in fact an object, dive in one more level\n\t\tif (rawValue) {\n\t\t\tif (this.isHorizontal()) {\n\t\t\t\tif (rawValue.x !== undefined) {\n\t\t\t\t\treturn this.getRightValue(rawValue.x);\n\t\t\t\t}\n\t\t\t} else if (rawValue.y !== undefined) {\n\t\t\t\treturn this.getRightValue(rawValue.y);\n\t\t\t}\n\t\t}\n\n\t\t// Value is good, return it\n\t\treturn rawValue;\n\t},\n\n\t/**\n\t * Used to get the value to display in the tooltip for the data at the given index\n\t * @param index\n\t * @param datasetIndex\n\t */\n\tgetLabelForIndex: helpers$1.noop,\n\n\t/**\n\t * Returns the location of the given data point. Value can either be an index or a numerical value\n\t * The coordinate (0, 0) is at the upper-left corner of the canvas\n\t * @param value\n\t * @param index\n\t * @param datasetIndex\n\t */\n\tgetPixelForValue: helpers$1.noop,\n\n\t/**\n\t * Used to get the data value from a given pixel. This is the inverse of getPixelForValue\n\t * The coordinate (0, 0) is at the upper-left corner of the canvas\n\t * @param pixel\n\t */\n\tgetValueForPixel: helpers$1.noop,\n\n\t/**\n\t * Returns the location of the tick at the given index\n\t * The coordinate (0, 0) is at the upper-left corner of the canvas\n\t */\n\tgetPixelForTick: function(index) {\n\t\tvar me = this;\n\t\tvar offset = me.options.offset;\n\t\tif (me.isHorizontal()) {\n\t\t\tvar innerWidth = me.width - (me.paddingLeft + me.paddingRight);\n\t\t\tvar tickWidth = innerWidth / Math.max((me._ticks.length - (offset ? 0 : 1)), 1);\n\t\t\tvar pixel = (tickWidth * index) + me.paddingLeft;\n\n\t\t\tif (offset) {\n\t\t\t\tpixel += tickWidth / 2;\n\t\t\t}\n\n\t\t\tvar finalVal = me.left + pixel;\n\t\t\tfinalVal += me.isFullWidth() ? me.margins.left : 0;\n\t\t\treturn finalVal;\n\t\t}\n\t\tvar innerHeight = me.height - (me.paddingTop + me.paddingBottom);\n\t\treturn me.top + (index * (innerHeight / (me._ticks.length - 1)));\n\t},\n\n\t/**\n\t * Utility for getting the pixel location of a percentage of scale\n\t * The coordinate (0, 0) is at the upper-left corner of the canvas\n\t */\n\tgetPixelForDecimal: function(decimal) {\n\t\tvar me = this;\n\t\tif (me.isHorizontal()) {\n\t\t\tvar innerWidth = me.width - (me.paddingLeft + me.paddingRight);\n\t\t\tvar valueOffset = (innerWidth * decimal) + me.paddingLeft;\n\n\t\t\tvar finalVal = me.left + valueOffset;\n\t\t\tfinalVal += me.isFullWidth() ? me.margins.left : 0;\n\t\t\treturn finalVal;\n\t\t}\n\t\treturn me.top + (decimal * me.height);\n\t},\n\n\t/**\n\t * Returns the pixel for the minimum chart value\n\t * The coordinate (0, 0) is at the upper-left corner of the canvas\n\t */\n\tgetBasePixel: function() {\n\t\treturn this.getPixelForValue(this.getBaseValue());\n\t},\n\n\tgetBaseValue: function() {\n\t\tvar me = this;\n\t\tvar min = me.min;\n\t\tvar max = me.max;\n\n\t\treturn me.beginAtZero ? 0 :\n\t\t\tmin < 0 && max < 0 ? max :\n\t\t\tmin > 0 && max > 0 ? min :\n\t\t\t0;\n\t},\n\n\t/**\n\t * Returns a subset of ticks to be plotted to avoid overlapping labels.\n\t * @private\n\t */\n\t_autoSkip: function(ticks) {\n\t\tvar me = this;\n\t\tvar isHorizontal = me.isHorizontal();\n\t\tvar optionTicks = me.options.ticks.minor;\n\t\tvar tickCount = ticks.length;\n\t\tvar skipRatio = false;\n\t\tvar maxTicks = optionTicks.maxTicksLimit;\n\n\t\t// Total space needed to display all ticks. First and last ticks are\n\t\t// drawn as their center at end of axis, so tickCount-1\n\t\tvar ticksLength = me._tickSize() * (tickCount - 1);\n\n\t\t// Axis length\n\t\tvar axisLength = isHorizontal\n\t\t\t? me.width - (me.paddingLeft + me.paddingRight)\n\t\t\t: me.height - (me.paddingTop + me.PaddingBottom);\n\n\t\tvar result = [];\n\t\tvar i, tick;\n\n\t\tif (ticksLength > axisLength) {\n\t\t\tskipRatio = 1 + Math.floor(ticksLength / axisLength);\n\t\t}\n\n\t\t// if they defined a max number of optionTicks,\n\t\t// increase skipRatio until that number is met\n\t\tif (tickCount > maxTicks) {\n\t\t\tskipRatio = Math.max(skipRatio, 1 + Math.floor(tickCount / maxTicks));\n\t\t}\n\n\t\tfor (i = 0; i < tickCount; i++) {\n\t\t\ttick = ticks[i];\n\n\t\t\tif (skipRatio > 1 && i % skipRatio > 0) {\n\t\t\t\t// leave tick in place but make sure it's not displayed (#4635)\n\t\t\t\tdelete tick.label;\n\t\t\t}\n\t\t\tresult.push(tick);\n\t\t}\n\t\treturn result;\n\t},\n\n\t/**\n\t * @private\n\t */\n\t_tickSize: function() {\n\t\tvar me = this;\n\t\tvar isHorizontal = me.isHorizontal();\n\t\tvar optionTicks = me.options.ticks.minor;\n\n\t\t// Calculate space needed by label in axis direction.\n\t\tvar rot = helpers$1.toRadians(me.labelRotation);\n\t\tvar cos = Math.abs(Math.cos(rot));\n\t\tvar sin = Math.abs(Math.sin(rot));\n\n\t\tvar padding = optionTicks.autoSkipPadding || 0;\n\t\tvar w = (me.longestLabelWidth + padding) || 0;\n\n\t\tvar tickFont = helpers$1.options._parseFont(optionTicks);\n\t\tvar h = (me._maxLabelLines * tickFont.lineHeight + padding) || 0;\n\n\t\t// Calculate space needed for 1 tick in axis direction.\n\t\treturn isHorizontal\n\t\t\t? h * cos > w * sin ? w / cos : h / sin\n\t\t\t: h * sin < w * cos ? h / cos : w / sin;\n\t},\n\n\t/**\n\t * @private\n\t */\n\t_isVisible: function() {\n\t\tvar me = this;\n\t\tvar chart = me.chart;\n\t\tvar display = me.options.display;\n\t\tvar i, ilen, meta;\n\n\t\tif (display !== 'auto') {\n\t\t\treturn !!display;\n\t\t}\n\n\t\t// When 'auto', the scale is visible if at least one associated dataset is visible.\n\t\tfor (i = 0, ilen = chart.data.datasets.length; i < ilen; ++i) {\n\t\t\tif (chart.isDatasetVisible(i)) {\n\t\t\t\tmeta = chart.getDatasetMeta(i);\n\t\t\t\tif (meta.xAxisID === me.id || meta.yAxisID === me.id) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t},\n\n\t/**\n\t * Actually draw the scale on the canvas\n\t * @param {object} chartArea - the area of the chart to draw full grid lines on\n\t */\n\tdraw: function(chartArea) {\n\t\tvar me = this;\n\t\tvar options = me.options;\n\n\t\tif (!me._isVisible()) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar chart = me.chart;\n\t\tvar context = me.ctx;\n\t\tvar globalDefaults = core_defaults.global;\n\t\tvar defaultFontColor = globalDefaults.defaultFontColor;\n\t\tvar optionTicks = options.ticks.minor;\n\t\tvar optionMajorTicks = options.ticks.major || optionTicks;\n\t\tvar gridLines = options.gridLines;\n\t\tvar scaleLabel = options.scaleLabel;\n\t\tvar position = options.position;\n\n\t\tvar isRotated = me.labelRotation !== 0;\n\t\tvar isMirrored = optionTicks.mirror;\n\t\tvar isHorizontal = me.isHorizontal();\n\n\t\tvar parseFont = helpers$1.options._parseFont;\n\t\tvar ticks = optionTicks.display && optionTicks.autoSkip ? me._autoSkip(me.getTicks()) : me.getTicks();\n\t\tvar tickFontColor = valueOrDefault$9(optionTicks.fontColor, defaultFontColor);\n\t\tvar tickFont = parseFont(optionTicks);\n\t\tvar lineHeight = tickFont.lineHeight;\n\t\tvar majorTickFontColor = valueOrDefault$9(optionMajorTicks.fontColor, defaultFontColor);\n\t\tvar majorTickFont = parseFont(optionMajorTicks);\n\t\tvar tickPadding = optionTicks.padding;\n\t\tvar labelOffset = optionTicks.labelOffset;\n\n\t\tvar tl = gridLines.drawTicks ? gridLines.tickMarkLength : 0;\n\n\t\tvar scaleLabelFontColor = valueOrDefault$9(scaleLabel.fontColor, defaultFontColor);\n\t\tvar scaleLabelFont = parseFont(scaleLabel);\n\t\tvar scaleLabelPadding = helpers$1.options.toPadding(scaleLabel.padding);\n\t\tvar labelRotationRadians = helpers$1.toRadians(me.labelRotation);\n\n\t\tvar itemsToDraw = [];\n\n\t\tvar axisWidth = gridLines.drawBorder ? valueAtIndexOrDefault(gridLines.lineWidth, 0, 0) : 0;\n\t\tvar alignPixel = helpers$1._alignPixel;\n\t\tvar borderValue, tickStart, tickEnd;\n\n\t\tif (position === 'top') {\n\t\t\tborderValue = alignPixel(chart, me.bottom, axisWidth);\n\t\t\ttickStart = me.bottom - tl;\n\t\t\ttickEnd = borderValue - axisWidth / 2;\n\t\t} else if (position === 'bottom') {\n\t\t\tborderValue = alignPixel(chart, me.top, axisWidth);\n\t\t\ttickStart = borderValue + axisWidth / 2;\n\t\t\ttickEnd = me.top + tl;\n\t\t} else if (position === 'left') {\n\t\t\tborderValue = alignPixel(chart, me.right, axisWidth);\n\t\t\ttickStart = me.right - tl;\n\t\t\ttickEnd = borderValue - axisWidth / 2;\n\t\t} else {\n\t\t\tborderValue = alignPixel(chart, me.left, axisWidth);\n\t\t\ttickStart = borderValue + axisWidth / 2;\n\t\t\ttickEnd = me.left + tl;\n\t\t}\n\n\t\tvar epsilon = 0.0000001; // 0.0000001 is margin in pixels for Accumulated error.\n\n\t\thelpers$1.each(ticks, function(tick, index) {\n\t\t\t// autoskipper skipped this tick (#4635)\n\t\t\tif (helpers$1.isNullOrUndef(tick.label)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar label = tick.label;\n\t\t\tvar lineWidth, lineColor, borderDash, borderDashOffset;\n\t\t\tif (index === me.zeroLineIndex && options.offset === gridLines.offsetGridLines) {\n\t\t\t\t// Draw the first index specially\n\t\t\t\tlineWidth = gridLines.zeroLineWidth;\n\t\t\t\tlineColor = gridLines.zeroLineColor;\n\t\t\t\tborderDash = gridLines.zeroLineBorderDash || [];\n\t\t\t\tborderDashOffset = gridLines.zeroLineBorderDashOffset || 0.0;\n\t\t\t} else {\n\t\t\t\tlineWidth = valueAtIndexOrDefault(gridLines.lineWidth, index);\n\t\t\t\tlineColor = valueAtIndexOrDefault(gridLines.color, index);\n\t\t\t\tborderDash = gridLines.borderDash || [];\n\t\t\t\tborderDashOffset = gridLines.borderDashOffset || 0.0;\n\t\t\t}\n\n\t\t\t// Common properties\n\t\t\tvar tx1, ty1, tx2, ty2, x1, y1, x2, y2, labelX, labelY, textOffset, textAlign;\n\t\t\tvar labelCount = helpers$1.isArray(label) ? label.length : 1;\n\t\t\tvar lineValue = getPixelForGridLine(me, index, gridLines.offsetGridLines);\n\n\t\t\tif (isHorizontal) {\n\t\t\t\tvar labelYOffset = tl + tickPadding;\n\n\t\t\t\tif (lineValue < me.left - epsilon) {\n\t\t\t\t\tlineColor = 'rgba(0,0,0,0)';\n\t\t\t\t}\n\n\t\t\t\ttx1 = tx2 = x1 = x2 = alignPixel(chart, lineValue, lineWidth);\n\t\t\t\tty1 = tickStart;\n\t\t\t\tty2 = tickEnd;\n\t\t\t\tlabelX = me.getPixelForTick(index) + labelOffset; // x values for optionTicks (need to consider offsetLabel option)\n\n\t\t\t\tif (position === 'top') {\n\t\t\t\t\ty1 = alignPixel(chart, chartArea.top, axisWidth) + axisWidth / 2;\n\t\t\t\t\ty2 = chartArea.bottom;\n\t\t\t\t\ttextOffset = ((!isRotated ? 0.5 : 1) - labelCount) * lineHeight;\n\t\t\t\t\ttextAlign = !isRotated ? 'center' : 'left';\n\t\t\t\t\tlabelY = me.bottom - labelYOffset;\n\t\t\t\t} else {\n\t\t\t\t\ty1 = chartArea.top;\n\t\t\t\t\ty2 = alignPixel(chart, chartArea.bottom, axisWidth) - axisWidth / 2;\n\t\t\t\t\ttextOffset = (!isRotated ? 0.5 : 0) * lineHeight;\n\t\t\t\t\ttextAlign = !isRotated ? 'center' : 'right';\n\t\t\t\t\tlabelY = me.top + labelYOffset;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tvar labelXOffset = (isMirrored ? 0 : tl) + tickPadding;\n\n\t\t\t\tif (lineValue < me.top - epsilon) {\n\t\t\t\t\tlineColor = 'rgba(0,0,0,0)';\n\t\t\t\t}\n\n\t\t\t\ttx1 = tickStart;\n\t\t\t\ttx2 = tickEnd;\n\t\t\t\tty1 = ty2 = y1 = y2 = alignPixel(chart, lineValue, lineWidth);\n\t\t\t\tlabelY = me.getPixelForTick(index) + labelOffset;\n\t\t\t\ttextOffset = (1 - labelCount) * lineHeight / 2;\n\n\t\t\t\tif (position === 'left') {\n\t\t\t\t\tx1 = alignPixel(chart, chartArea.left, axisWidth) + axisWidth / 2;\n\t\t\t\t\tx2 = chartArea.right;\n\t\t\t\t\ttextAlign = isMirrored ? 'left' : 'right';\n\t\t\t\t\tlabelX = me.right - labelXOffset;\n\t\t\t\t} else {\n\t\t\t\t\tx1 = chartArea.left;\n\t\t\t\t\tx2 = alignPixel(chart, chartArea.right, axisWidth) - axisWidth / 2;\n\t\t\t\t\ttextAlign = isMirrored ? 'right' : 'left';\n\t\t\t\t\tlabelX = me.left + labelXOffset;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\titemsToDraw.push({\n\t\t\t\ttx1: tx1,\n\t\t\t\tty1: ty1,\n\t\t\t\ttx2: tx2,\n\t\t\t\tty2: ty2,\n\t\t\t\tx1: x1,\n\t\t\t\ty1: y1,\n\t\t\t\tx2: x2,\n\t\t\t\ty2: y2,\n\t\t\t\tlabelX: labelX,\n\t\t\t\tlabelY: labelY,\n\t\t\t\tglWidth: lineWidth,\n\t\t\t\tglColor: lineColor,\n\t\t\t\tglBorderDash: borderDash,\n\t\t\t\tglBorderDashOffset: borderDashOffset,\n\t\t\t\trotation: -1 * labelRotationRadians,\n\t\t\t\tlabel: label,\n\t\t\t\tmajor: tick.major,\n\t\t\t\ttextOffset: textOffset,\n\t\t\t\ttextAlign: textAlign\n\t\t\t});\n\t\t});\n\n\t\t// Draw all of the tick labels, tick marks, and grid lines at the correct places\n\t\thelpers$1.each(itemsToDraw, function(itemToDraw) {\n\t\t\tvar glWidth = itemToDraw.glWidth;\n\t\t\tvar glColor = itemToDraw.glColor;\n\n\t\t\tif (gridLines.display && glWidth && glColor) {\n\t\t\t\tcontext.save();\n\t\t\t\tcontext.lineWidth = glWidth;\n\t\t\t\tcontext.strokeStyle = glColor;\n\t\t\t\tif (context.setLineDash) {\n\t\t\t\t\tcontext.setLineDash(itemToDraw.glBorderDash);\n\t\t\t\t\tcontext.lineDashOffset = itemToDraw.glBorderDashOffset;\n\t\t\t\t}\n\n\t\t\t\tcontext.beginPath();\n\n\t\t\t\tif (gridLines.drawTicks) {\n\t\t\t\t\tcontext.moveTo(itemToDraw.tx1, itemToDraw.ty1);\n\t\t\t\t\tcontext.lineTo(itemToDraw.tx2, itemToDraw.ty2);\n\t\t\t\t}\n\n\t\t\t\tif (gridLines.drawOnChartArea) {\n\t\t\t\t\tcontext.moveTo(itemToDraw.x1, itemToDraw.y1);\n\t\t\t\t\tcontext.lineTo(itemToDraw.x2, itemToDraw.y2);\n\t\t\t\t}\n\n\t\t\t\tcontext.stroke();\n\t\t\t\tcontext.restore();\n\t\t\t}\n\n\t\t\tif (optionTicks.display) {\n\t\t\t\t// Make sure we draw text in the correct color and font\n\t\t\t\tcontext.save();\n\t\t\t\tcontext.translate(itemToDraw.labelX, itemToDraw.labelY);\n\t\t\t\tcontext.rotate(itemToDraw.rotation);\n\t\t\t\tcontext.font = itemToDraw.major ? majorTickFont.string : tickFont.string;\n\t\t\t\tcontext.fillStyle = itemToDraw.major ? majorTickFontColor : tickFontColor;\n\t\t\t\tcontext.textBaseline = 'middle';\n\t\t\t\tcontext.textAlign = itemToDraw.textAlign;\n\n\t\t\t\tvar label = itemToDraw.label;\n\t\t\t\tvar y = itemToDraw.textOffset;\n\t\t\t\tif (helpers$1.isArray(label)) {\n\t\t\t\t\tfor (var i = 0; i < label.length; ++i) {\n\t\t\t\t\t\t// We just make sure the multiline element is a string here..\n\t\t\t\t\t\tcontext.fillText('' + label[i], 0, y);\n\t\t\t\t\t\ty += lineHeight;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tcontext.fillText(label, 0, y);\n\t\t\t\t}\n\t\t\t\tcontext.restore();\n\t\t\t}\n\t\t});\n\n\t\tif (scaleLabel.display) {\n\t\t\t// Draw the scale label\n\t\t\tvar scaleLabelX;\n\t\t\tvar scaleLabelY;\n\t\t\tvar rotation = 0;\n\t\t\tvar halfLineHeight = scaleLabelFont.lineHeight / 2;\n\n\t\t\tif (isHorizontal) {\n\t\t\t\tscaleLabelX = me.left + ((me.right - me.left) / 2); // midpoint of the width\n\t\t\t\tscaleLabelY = position === 'bottom'\n\t\t\t\t\t? me.bottom - halfLineHeight - scaleLabelPadding.bottom\n\t\t\t\t\t: me.top + halfLineHeight + scaleLabelPadding.top;\n\t\t\t} else {\n\t\t\t\tvar isLeft = position === 'left';\n\t\t\t\tscaleLabelX = isLeft\n\t\t\t\t\t? me.left + halfLineHeight + scaleLabelPadding.top\n\t\t\t\t\t: me.right - halfLineHeight - scaleLabelPadding.top;\n\t\t\t\tscaleLabelY = me.top + ((me.bottom - me.top) / 2);\n\t\t\t\trotation = isLeft ? -0.5 * Math.PI : 0.5 * Math.PI;\n\t\t\t}\n\n\t\t\tcontext.save();\n\t\t\tcontext.translate(scaleLabelX, scaleLabelY);\n\t\t\tcontext.rotate(rotation);\n\t\t\tcontext.textAlign = 'center';\n\t\t\tcontext.textBaseline = 'middle';\n\t\t\tcontext.fillStyle = scaleLabelFontColor; // render in correct colour\n\t\t\tcontext.font = scaleLabelFont.string;\n\t\t\tcontext.fillText(scaleLabel.labelString, 0, 0);\n\t\t\tcontext.restore();\n\t\t}\n\n\t\tif (axisWidth) {\n\t\t\t// Draw the line at the edge of the axis\n\t\t\tvar firstLineWidth = axisWidth;\n\t\t\tvar lastLineWidth = valueAtIndexOrDefault(gridLines.lineWidth, ticks.length - 1, 0);\n\t\t\tvar x1, x2, y1, y2;\n\n\t\t\tif (isHorizontal) {\n\t\t\t\tx1 = alignPixel(chart, me.left, firstLineWidth) - firstLineWidth / 2;\n\t\t\t\tx2 = alignPixel(chart, me.right, lastLineWidth) + lastLineWidth / 2;\n\t\t\t\ty1 = y2 = borderValue;\n\t\t\t} else {\n\t\t\t\ty1 = alignPixel(chart, me.top, firstLineWidth) - firstLineWidth / 2;\n\t\t\t\ty2 = alignPixel(chart, me.bottom, lastLineWidth) + lastLineWidth / 2;\n\t\t\t\tx1 = x2 = borderValue;\n\t\t\t}\n\n\t\t\tcontext.lineWidth = axisWidth;\n\t\t\tcontext.strokeStyle = valueAtIndexOrDefault(gridLines.color, 0);\n\t\t\tcontext.beginPath();\n\t\t\tcontext.moveTo(x1, y1);\n\t\t\tcontext.lineTo(x2, y2);\n\t\t\tcontext.stroke();\n\t\t}\n\t}\n});\n\nvar defaultConfig = {\n\tposition: 'bottom'\n};\n\nvar scale_category = core_scale.extend({\n\t/**\n\t* Internal function to get the correct labels. If data.xLabels or data.yLabels are defined, use those\n\t* else fall back to data.labels\n\t* @private\n\t*/\n\tgetLabels: function() {\n\t\tvar data = this.chart.data;\n\t\treturn this.options.labels || (this.isHorizontal() ? data.xLabels : data.yLabels) || data.labels;\n\t},\n\n\tdetermineDataLimits: function() {\n\t\tvar me = this;\n\t\tvar labels = me.getLabels();\n\t\tme.minIndex = 0;\n\t\tme.maxIndex = labels.length - 1;\n\t\tvar findIndex;\n\n\t\tif (me.options.ticks.min !== undefined) {\n\t\t\t// user specified min value\n\t\t\tfindIndex = labels.indexOf(me.options.ticks.min);\n\t\t\tme.minIndex = findIndex !== -1 ? findIndex : me.minIndex;\n\t\t}\n\n\t\tif (me.options.ticks.max !== undefined) {\n\t\t\t// user specified max value\n\t\t\tfindIndex = labels.indexOf(me.options.ticks.max);\n\t\t\tme.maxIndex = findIndex !== -1 ? findIndex : me.maxIndex;\n\t\t}\n\n\t\tme.min = labels[me.minIndex];\n\t\tme.max = labels[me.maxIndex];\n\t},\n\n\tbuildTicks: function() {\n\t\tvar me = this;\n\t\tvar labels = me.getLabels();\n\t\t// If we are viewing some subset of labels, slice the original array\n\t\tme.ticks = (me.minIndex === 0 && me.maxIndex === labels.length - 1) ? labels : labels.slice(me.minIndex, me.maxIndex + 1);\n\t},\n\n\tgetLabelForIndex: function(index, datasetIndex) {\n\t\tvar me = this;\n\t\tvar chart = me.chart;\n\n\t\tif (chart.getDatasetMeta(datasetIndex).controller._getValueScaleId() === me.id) {\n\t\t\treturn me.getRightValue(chart.data.datasets[datasetIndex].data[index]);\n\t\t}\n\n\t\treturn me.ticks[index - me.minIndex];\n\t},\n\n\t// Used to get data value locations. Value can either be an index or a numerical value\n\tgetPixelForValue: function(value, index) {\n\t\tvar me = this;\n\t\tvar offset = me.options.offset;\n\t\t// 1 is added because we need the length but we have the indexes\n\t\tvar offsetAmt = Math.max((me.maxIndex + 1 - me.minIndex - (offset ? 0 : 1)), 1);\n\n\t\t// If value is a data object, then index is the index in the data array,\n\t\t// not the index of the scale. We need to change that.\n\t\tvar valueCategory;\n\t\tif (value !== undefined && value !== null) {\n\t\t\tvalueCategory = me.isHorizontal() ? value.x : value.y;\n\t\t}\n\t\tif (valueCategory !== undefined || (value !== undefined && isNaN(index))) {\n\t\t\tvar labels = me.getLabels();\n\t\t\tvalue = valueCategory || value;\n\t\t\tvar idx = labels.indexOf(value);\n\t\t\tindex = idx !== -1 ? idx : index;\n\t\t}\n\n\t\tif (me.isHorizontal()) {\n\t\t\tvar valueWidth = me.width / offsetAmt;\n\t\t\tvar widthOffset = (valueWidth * (index - me.minIndex));\n\n\t\t\tif (offset) {\n\t\t\t\twidthOffset += (valueWidth / 2);\n\t\t\t}\n\n\t\t\treturn me.left + widthOffset;\n\t\t}\n\t\tvar valueHeight = me.height / offsetAmt;\n\t\tvar heightOffset = (valueHeight * (index - me.minIndex));\n\n\t\tif (offset) {\n\t\t\theightOffset += (valueHeight / 2);\n\t\t}\n\n\t\treturn me.top + heightOffset;\n\t},\n\n\tgetPixelForTick: function(index) {\n\t\treturn this.getPixelForValue(this.ticks[index], index + this.minIndex, null);\n\t},\n\n\tgetValueForPixel: function(pixel) {\n\t\tvar me = this;\n\t\tvar offset = me.options.offset;\n\t\tvar value;\n\t\tvar offsetAmt = Math.max((me._ticks.length - (offset ? 0 : 1)), 1);\n\t\tvar horz = me.isHorizontal();\n\t\tvar valueDimension = (horz ? me.width : me.height) / offsetAmt;\n\n\t\tpixel -= horz ? me.left : me.top;\n\n\t\tif (offset) {\n\t\t\tpixel -= (valueDimension / 2);\n\t\t}\n\n\t\tif (pixel <= 0) {\n\t\t\tvalue = 0;\n\t\t} else {\n\t\t\tvalue = Math.round(pixel / valueDimension);\n\t\t}\n\n\t\treturn value + me.minIndex;\n\t},\n\n\tgetBasePixel: function() {\n\t\treturn this.bottom;\n\t}\n});\n\n// INTERNAL: static default options, registered in src/index.js\nvar _defaults = defaultConfig;\nscale_category._defaults = _defaults;\n\nvar noop = helpers$1.noop;\nvar isNullOrUndef = helpers$1.isNullOrUndef;\n\n/**\n * Generate a set of linear ticks\n * @param generationOptions the options used to generate the ticks\n * @param dataRange the range of the data\n * @returns {number[]} array of tick values\n */\nfunction generateTicks(generationOptions, dataRange) {\n\tvar ticks = [];\n\t// To get a \"nice\" value for the tick spacing, we will use the appropriately named\n\t// \"nice number\" algorithm. See https://stackoverflow.com/questions/8506881/nice-label-algorithm-for-charts-with-minimum-ticks\n\t// for details.\n\n\tvar MIN_SPACING = 1e-14;\n\tvar stepSize = generationOptions.stepSize;\n\tvar unit = stepSize || 1;\n\tvar maxNumSpaces = generationOptions.maxTicks - 1;\n\tvar min = generationOptions.min;\n\tvar max = generationOptions.max;\n\tvar precision = generationOptions.precision;\n\tvar rmin = dataRange.min;\n\tvar rmax = dataRange.max;\n\tvar spacing = helpers$1.niceNum((rmax - rmin) / maxNumSpaces / unit) * unit;\n\tvar factor, niceMin, niceMax, numSpaces;\n\n\t// Beyond MIN_SPACING floating point numbers being to lose precision\n\t// such that we can't do the math necessary to generate ticks\n\tif (spacing < MIN_SPACING && isNullOrUndef(min) && isNullOrUndef(max)) {\n\t\treturn [rmin, rmax];\n\t}\n\n\tnumSpaces = Math.ceil(rmax / spacing) - Math.floor(rmin / spacing);\n\tif (numSpaces > maxNumSpaces) {\n\t\t// If the calculated num of spaces exceeds maxNumSpaces, recalculate it\n\t\tspacing = helpers$1.niceNum(numSpaces * spacing / maxNumSpaces / unit) * unit;\n\t}\n\n\tif (stepSize || isNullOrUndef(precision)) {\n\t\t// If a precision is not specified, calculate factor based on spacing\n\t\tfactor = Math.pow(10, helpers$1._decimalPlaces(spacing));\n\t} else {\n\t\t// If the user specified a precision, round to that number of decimal places\n\t\tfactor = Math.pow(10, precision);\n\t\tspacing = Math.ceil(spacing * factor) / factor;\n\t}\n\n\tniceMin = Math.floor(rmin / spacing) * spacing;\n\tniceMax = Math.ceil(rmax / spacing) * spacing;\n\n\t// If min, max and stepSize is set and they make an evenly spaced scale use it.\n\tif (stepSize) {\n\t\t// If very close to our whole number, use it.\n\t\tif (!isNullOrUndef(min) && helpers$1.almostWhole(min / spacing, spacing / 1000)) {\n\t\t\tniceMin = min;\n\t\t}\n\t\tif (!isNullOrUndef(max) && helpers$1.almostWhole(max / spacing, spacing / 1000)) {\n\t\t\tniceMax = max;\n\t\t}\n\t}\n\n\tnumSpaces = (niceMax - niceMin) / spacing;\n\t// If very close to our rounded value, use it.\n\tif (helpers$1.almostEquals(numSpaces, Math.round(numSpaces), spacing / 1000)) {\n\t\tnumSpaces = Math.round(numSpaces);\n\t} else {\n\t\tnumSpaces = Math.ceil(numSpaces);\n\t}\n\n\tniceMin = Math.round(niceMin * factor) / factor;\n\tniceMax = Math.round(niceMax * factor) / factor;\n\tticks.push(isNullOrUndef(min) ? niceMin : min);\n\tfor (var j = 1; j < numSpaces; ++j) {\n\t\tticks.push(Math.round((niceMin + j * spacing) * factor) / factor);\n\t}\n\tticks.push(isNullOrUndef(max) ? niceMax : max);\n\n\treturn ticks;\n}\n\nvar scale_linearbase = core_scale.extend({\n\tgetRightValue: function(value) {\n\t\tif (typeof value === 'string') {\n\t\t\treturn +value;\n\t\t}\n\t\treturn core_scale.prototype.getRightValue.call(this, value);\n\t},\n\n\thandleTickRangeOptions: function() {\n\t\tvar me = this;\n\t\tvar opts = me.options;\n\t\tvar tickOpts = opts.ticks;\n\n\t\t// If we are forcing it to begin at 0, but 0 will already be rendered on the chart,\n\t\t// do nothing since that would make the chart weird. If the user really wants a weird chart\n\t\t// axis, they can manually override it\n\t\tif (tickOpts.beginAtZero) {\n\t\t\tvar minSign = helpers$1.sign(me.min);\n\t\t\tvar maxSign = helpers$1.sign(me.max);\n\n\t\t\tif (minSign < 0 && maxSign < 0) {\n\t\t\t\t// move the top up to 0\n\t\t\t\tme.max = 0;\n\t\t\t} else if (minSign > 0 && maxSign > 0) {\n\t\t\t\t// move the bottom down to 0\n\t\t\t\tme.min = 0;\n\t\t\t}\n\t\t}\n\n\t\tvar setMin = tickOpts.min !== undefined || tickOpts.suggestedMin !== undefined;\n\t\tvar setMax = tickOpts.max !== undefined || tickOpts.suggestedMax !== undefined;\n\n\t\tif (tickOpts.min !== undefined) {\n\t\t\tme.min = tickOpts.min;\n\t\t} else if (tickOpts.suggestedMin !== undefined) {\n\t\t\tif (me.min === null) {\n\t\t\t\tme.min = tickOpts.suggestedMin;\n\t\t\t} else {\n\t\t\t\tme.min = Math.min(me.min, tickOpts.suggestedMin);\n\t\t\t}\n\t\t}\n\n\t\tif (tickOpts.max !== undefined) {\n\t\t\tme.max = tickOpts.max;\n\t\t} else if (tickOpts.suggestedMax !== undefined) {\n\t\t\tif (me.max === null) {\n\t\t\t\tme.max = tickOpts.suggestedMax;\n\t\t\t} else {\n\t\t\t\tme.max = Math.max(me.max, tickOpts.suggestedMax);\n\t\t\t}\n\t\t}\n\n\t\tif (setMin !== setMax) {\n\t\t\t// We set the min or the max but not both.\n\t\t\t// So ensure that our range is good\n\t\t\t// Inverted or 0 length range can happen when\n\t\t\t// ticks.min is set, and no datasets are visible\n\t\t\tif (me.min >= me.max) {\n\t\t\t\tif (setMin) {\n\t\t\t\t\tme.max = me.min + 1;\n\t\t\t\t} else {\n\t\t\t\t\tme.min = me.max - 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (me.min === me.max) {\n\t\t\tme.max++;\n\n\t\t\tif (!tickOpts.beginAtZero) {\n\t\t\t\tme.min--;\n\t\t\t}\n\t\t}\n\t},\n\n\tgetTickLimit: function() {\n\t\tvar me = this;\n\t\tvar tickOpts = me.options.ticks;\n\t\tvar stepSize = tickOpts.stepSize;\n\t\tvar maxTicksLimit = tickOpts.maxTicksLimit;\n\t\tvar maxTicks;\n\n\t\tif (stepSize) {\n\t\t\tmaxTicks = Math.ceil(me.max / stepSize) - Math.floor(me.min / stepSize) + 1;\n\t\t} else {\n\t\t\tmaxTicks = me._computeTickLimit();\n\t\t\tmaxTicksLimit = maxTicksLimit || 11;\n\t\t}\n\n\t\tif (maxTicksLimit) {\n\t\t\tmaxTicks = Math.min(maxTicksLimit, maxTicks);\n\t\t}\n\n\t\treturn maxTicks;\n\t},\n\n\t_computeTickLimit: function() {\n\t\treturn Number.POSITIVE_INFINITY;\n\t},\n\n\thandleDirectionalChanges: noop,\n\n\tbuildTicks: function() {\n\t\tvar me = this;\n\t\tvar opts = me.options;\n\t\tvar tickOpts = opts.ticks;\n\n\t\t// Figure out what the max number of ticks we can support it is based on the size of\n\t\t// the axis area. For now, we say that the minimum tick spacing in pixels must be 40\n\t\t// We also limit the maximum number of ticks to 11 which gives a nice 10 squares on\n\t\t// the graph. Make sure we always have at least 2 ticks\n\t\tvar maxTicks = me.getTickLimit();\n\t\tmaxTicks = Math.max(2, maxTicks);\n\n\t\tvar numericGeneratorOptions = {\n\t\t\tmaxTicks: maxTicks,\n\t\t\tmin: tickOpts.min,\n\t\t\tmax: tickOpts.max,\n\t\t\tprecision: tickOpts.precision,\n\t\t\tstepSize: helpers$1.valueOrDefault(tickOpts.fixedStepSize, tickOpts.stepSize)\n\t\t};\n\t\tvar ticks = me.ticks = generateTicks(numericGeneratorOptions, me);\n\n\t\tme.handleDirectionalChanges();\n\n\t\t// At this point, we need to update our max and min given the tick values since we have expanded the\n\t\t// range of the scale\n\t\tme.max = helpers$1.max(ticks);\n\t\tme.min = helpers$1.min(ticks);\n\n\t\tif (tickOpts.reverse) {\n\t\t\tticks.reverse();\n\n\t\t\tme.start = me.max;\n\t\t\tme.end = me.min;\n\t\t} else {\n\t\t\tme.start = me.min;\n\t\t\tme.end = me.max;\n\t\t}\n\t},\n\n\tconvertTicksToLabels: function() {\n\t\tvar me = this;\n\t\tme.ticksAsNumbers = me.ticks.slice();\n\t\tme.zeroLineIndex = me.ticks.indexOf(0);\n\n\t\tcore_scale.prototype.convertTicksToLabels.call(me);\n\t}\n});\n\nvar defaultConfig$1 = {\n\tposition: 'left',\n\tticks: {\n\t\tcallback: core_ticks.formatters.linear\n\t}\n};\n\nvar scale_linear = scale_linearbase.extend({\n\tdetermineDataLimits: function() {\n\t\tvar me = this;\n\t\tvar opts = me.options;\n\t\tvar chart = me.chart;\n\t\tvar data = chart.data;\n\t\tvar datasets = data.datasets;\n\t\tvar isHorizontal = me.isHorizontal();\n\t\tvar DEFAULT_MIN = 0;\n\t\tvar DEFAULT_MAX = 1;\n\n\t\tfunction IDMatches(meta) {\n\t\t\treturn isHorizontal ? meta.xAxisID === me.id : meta.yAxisID === me.id;\n\t\t}\n\n\t\t// First Calculate the range\n\t\tme.min = null;\n\t\tme.max = null;\n\n\t\tvar hasStacks = opts.stacked;\n\t\tif (hasStacks === undefined) {\n\t\t\thelpers$1.each(datasets, function(dataset, datasetIndex) {\n\t\t\t\tif (hasStacks) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar meta = chart.getDatasetMeta(datasetIndex);\n\t\t\t\tif (chart.isDatasetVisible(datasetIndex) && IDMatches(meta) &&\n\t\t\t\t\tmeta.stack !== undefined) {\n\t\t\t\t\thasStacks = true;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tif (opts.stacked || hasStacks) {\n\t\t\tvar valuesPerStack = {};\n\n\t\t\thelpers$1.each(datasets, function(dataset, datasetIndex) {\n\t\t\t\tvar meta = chart.getDatasetMeta(datasetIndex);\n\t\t\t\tvar key = [\n\t\t\t\t\tmeta.type,\n\t\t\t\t\t// we have a separate stack for stack=undefined datasets when the opts.stacked is undefined\n\t\t\t\t\t((opts.stacked === undefined && meta.stack === undefined) ? datasetIndex : ''),\n\t\t\t\t\tmeta.stack\n\t\t\t\t].join('.');\n\n\t\t\t\tif (valuesPerStack[key] === undefined) {\n\t\t\t\t\tvaluesPerStack[key] = {\n\t\t\t\t\t\tpositiveValues: [],\n\t\t\t\t\t\tnegativeValues: []\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\t// Store these per type\n\t\t\t\tvar positiveValues = valuesPerStack[key].positiveValues;\n\t\t\t\tvar negativeValues = valuesPerStack[key].negativeValues;\n\n\t\t\t\tif (chart.isDatasetVisible(datasetIndex) && IDMatches(meta)) {\n\t\t\t\t\thelpers$1.each(dataset.data, function(rawValue, index) {\n\t\t\t\t\t\tvar value = +me.getRightValue(rawValue);\n\t\t\t\t\t\tif (isNaN(value) || meta.data[index].hidden) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tpositiveValues[index] = positiveValues[index] || 0;\n\t\t\t\t\t\tnegativeValues[index] = negativeValues[index] || 0;\n\n\t\t\t\t\t\tif (opts.relativePoints) {\n\t\t\t\t\t\t\tpositiveValues[index] = 100;\n\t\t\t\t\t\t} else if (value < 0) {\n\t\t\t\t\t\t\tnegativeValues[index] += value;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tpositiveValues[index] += value;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\n\t\t\thelpers$1.each(valuesPerStack, function(valuesForType) {\n\t\t\t\tvar values = valuesForType.positiveValues.concat(valuesForType.negativeValues);\n\t\t\t\tvar minVal = helpers$1.min(values);\n\t\t\t\tvar maxVal = helpers$1.max(values);\n\t\t\t\tme.min = me.min === null ? minVal : Math.min(me.min, minVal);\n\t\t\t\tme.max = me.max === null ? maxVal : Math.max(me.max, maxVal);\n\t\t\t});\n\n\t\t} else {\n\t\t\thelpers$1.each(datasets, function(dataset, datasetIndex) {\n\t\t\t\tvar meta = chart.getDatasetMeta(datasetIndex);\n\t\t\t\tif (chart.isDatasetVisible(datasetIndex) && IDMatches(meta)) {\n\t\t\t\t\thelpers$1.each(dataset.data, function(rawValue, index) {\n\t\t\t\t\t\tvar value = +me.getRightValue(rawValue);\n\t\t\t\t\t\tif (isNaN(value) || meta.data[index].hidden) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (me.min === null) {\n\t\t\t\t\t\t\tme.min = value;\n\t\t\t\t\t\t} else if (value < me.min) {\n\t\t\t\t\t\t\tme.min = value;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (me.max === null) {\n\t\t\t\t\t\t\tme.max = value;\n\t\t\t\t\t\t} else if (value > me.max) {\n\t\t\t\t\t\t\tme.max = value;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tme.min = isFinite(me.min) && !isNaN(me.min) ? me.min : DEFAULT_MIN;\n\t\tme.max = isFinite(me.max) && !isNaN(me.max) ? me.max : DEFAULT_MAX;\n\n\t\t// Common base implementation to handle ticks.min, ticks.max, ticks.beginAtZero\n\t\tthis.handleTickRangeOptions();\n\t},\n\n\t// Returns the maximum number of ticks based on the scale dimension\n\t_computeTickLimit: function() {\n\t\tvar me = this;\n\t\tvar tickFont;\n\n\t\tif (me.isHorizontal()) {\n\t\t\treturn Math.ceil(me.width / 40);\n\t\t}\n\t\ttickFont = helpers$1.options._parseFont(me.options.ticks);\n\t\treturn Math.ceil(me.height / tickFont.lineHeight);\n\t},\n\n\t// Called after the ticks are built. We need\n\thandleDirectionalChanges: function() {\n\t\tif (!this.isHorizontal()) {\n\t\t\t// We are in a vertical orientation. The top value is the highest. So reverse the array\n\t\t\tthis.ticks.reverse();\n\t\t}\n\t},\n\n\tgetLabelForIndex: function(index, datasetIndex) {\n\t\treturn +this.getRightValue(this.chart.data.datasets[datasetIndex].data[index]);\n\t},\n\n\t// Utils\n\tgetPixelForValue: function(value) {\n\t\t// This must be called after fit has been run so that\n\t\t// this.left, this.top, this.right, and this.bottom have been defined\n\t\tvar me = this;\n\t\tvar start = me.start;\n\n\t\tvar rightValue = +me.getRightValue(value);\n\t\tvar pixel;\n\t\tvar range = me.end - start;\n\n\t\tif (me.isHorizontal()) {\n\t\t\tpixel = me.left + (me.width / range * (rightValue - start));\n\t\t} else {\n\t\t\tpixel = me.bottom - (me.height / range * (rightValue - start));\n\t\t}\n\t\treturn pixel;\n\t},\n\n\tgetValueForPixel: function(pixel) {\n\t\tvar me = this;\n\t\tvar isHorizontal = me.isHorizontal();\n\t\tvar innerDimension = isHorizontal ? me.width : me.height;\n\t\tvar offset = (isHorizontal ? pixel - me.left : me.bottom - pixel) / innerDimension;\n\t\treturn me.start + ((me.end - me.start) * offset);\n\t},\n\n\tgetPixelForTick: function(index) {\n\t\treturn this.getPixelForValue(this.ticksAsNumbers[index]);\n\t}\n});\n\n// INTERNAL: static default options, registered in src/index.js\nvar _defaults$1 = defaultConfig$1;\nscale_linear._defaults = _defaults$1;\n\nvar valueOrDefault$a = helpers$1.valueOrDefault;\n\n/**\n * Generate a set of logarithmic ticks\n * @param generationOptions the options used to generate the ticks\n * @param dataRange the range of the data\n * @returns {number[]} array of tick values\n */\nfunction generateTicks$1(generationOptions, dataRange) {\n\tvar ticks = [];\n\n\tvar tickVal = valueOrDefault$a(generationOptions.min, Math.pow(10, Math.floor(helpers$1.log10(dataRange.min))));\n\n\tvar endExp = Math.floor(helpers$1.log10(dataRange.max));\n\tvar endSignificand = Math.ceil(dataRange.max / Math.pow(10, endExp));\n\tvar exp, significand;\n\n\tif (tickVal === 0) {\n\t\texp = Math.floor(helpers$1.log10(dataRange.minNotZero));\n\t\tsignificand = Math.floor(dataRange.minNotZero / Math.pow(10, exp));\n\n\t\tticks.push(tickVal);\n\t\ttickVal = significand * Math.pow(10, exp);\n\t} else {\n\t\texp = Math.floor(helpers$1.log10(tickVal));\n\t\tsignificand = Math.floor(tickVal / Math.pow(10, exp));\n\t}\n\tvar precision = exp < 0 ? Math.pow(10, Math.abs(exp)) : 1;\n\n\tdo {\n\t\tticks.push(tickVal);\n\n\t\t++significand;\n\t\tif (significand === 10) {\n\t\t\tsignificand = 1;\n\t\t\t++exp;\n\t\t\tprecision = exp >= 0 ? 1 : precision;\n\t\t}\n\n\t\ttickVal = Math.round(significand * Math.pow(10, exp) * precision) / precision;\n\t} while (exp < endExp || (exp === endExp && significand < endSignificand));\n\n\tvar lastTick = valueOrDefault$a(generationOptions.max, tickVal);\n\tticks.push(lastTick);\n\n\treturn ticks;\n}\n\nvar defaultConfig$2 = {\n\tposition: 'left',\n\n\t// label settings\n\tticks: {\n\t\tcallback: core_ticks.formatters.logarithmic\n\t}\n};\n\n// TODO(v3): change this to positiveOrDefault\nfunction nonNegativeOrDefault(value, defaultValue) {\n\treturn helpers$1.isFinite(value) && value >= 0 ? value : defaultValue;\n}\n\nvar scale_logarithmic = core_scale.extend({\n\tdetermineDataLimits: function() {\n\t\tvar me = this;\n\t\tvar opts = me.options;\n\t\tvar chart = me.chart;\n\t\tvar data = chart.data;\n\t\tvar datasets = data.datasets;\n\t\tvar isHorizontal = me.isHorizontal();\n\t\tfunction IDMatches(meta) {\n\t\t\treturn isHorizontal ? meta.xAxisID === me.id : meta.yAxisID === me.id;\n\t\t}\n\n\t\t// Calculate Range\n\t\tme.min = null;\n\t\tme.max = null;\n\t\tme.minNotZero = null;\n\n\t\tvar hasStacks = opts.stacked;\n\t\tif (hasStacks === undefined) {\n\t\t\thelpers$1.each(datasets, function(dataset, datasetIndex) {\n\t\t\t\tif (hasStacks) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar meta = chart.getDatasetMeta(datasetIndex);\n\t\t\t\tif (chart.isDatasetVisible(datasetIndex) && IDMatches(meta) &&\n\t\t\t\t\tmeta.stack !== undefined) {\n\t\t\t\t\thasStacks = true;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tif (opts.stacked || hasStacks) {\n\t\t\tvar valuesPerStack = {};\n\n\t\t\thelpers$1.each(datasets, function(dataset, datasetIndex) {\n\t\t\t\tvar meta = chart.getDatasetMeta(datasetIndex);\n\t\t\t\tvar key = [\n\t\t\t\t\tmeta.type,\n\t\t\t\t\t// we have a separate stack for stack=undefined datasets when the opts.stacked is undefined\n\t\t\t\t\t((opts.stacked === undefined && meta.stack === undefined) ? datasetIndex : ''),\n\t\t\t\t\tmeta.stack\n\t\t\t\t].join('.');\n\n\t\t\t\tif (chart.isDatasetVisible(datasetIndex) && IDMatches(meta)) {\n\t\t\t\t\tif (valuesPerStack[key] === undefined) {\n\t\t\t\t\t\tvaluesPerStack[key] = [];\n\t\t\t\t\t}\n\n\t\t\t\t\thelpers$1.each(dataset.data, function(rawValue, index) {\n\t\t\t\t\t\tvar values = valuesPerStack[key];\n\t\t\t\t\t\tvar value = +me.getRightValue(rawValue);\n\t\t\t\t\t\t// invalid, hidden and negative values are ignored\n\t\t\t\t\t\tif (isNaN(value) || meta.data[index].hidden || value < 0) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvalues[index] = values[index] || 0;\n\t\t\t\t\t\tvalues[index] += value;\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\n\t\t\thelpers$1.each(valuesPerStack, function(valuesForType) {\n\t\t\t\tif (valuesForType.length > 0) {\n\t\t\t\t\tvar minVal = helpers$1.min(valuesForType);\n\t\t\t\t\tvar maxVal = helpers$1.max(valuesForType);\n\t\t\t\t\tme.min = me.min === null ? minVal : Math.min(me.min, minVal);\n\t\t\t\t\tme.max = me.max === null ? maxVal : Math.max(me.max, maxVal);\n\t\t\t\t}\n\t\t\t});\n\n\t\t} else {\n\t\t\thelpers$1.each(datasets, function(dataset, datasetIndex) {\n\t\t\t\tvar meta = chart.getDatasetMeta(datasetIndex);\n\t\t\t\tif (chart.isDatasetVisible(datasetIndex) && IDMatches(meta)) {\n\t\t\t\t\thelpers$1.each(dataset.data, function(rawValue, index) {\n\t\t\t\t\t\tvar value = +me.getRightValue(rawValue);\n\t\t\t\t\t\t// invalid, hidden and negative values are ignored\n\t\t\t\t\t\tif (isNaN(value) || meta.data[index].hidden || value < 0) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (me.min === null) {\n\t\t\t\t\t\t\tme.min = value;\n\t\t\t\t\t\t} else if (value < me.min) {\n\t\t\t\t\t\t\tme.min = value;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (me.max === null) {\n\t\t\t\t\t\t\tme.max = value;\n\t\t\t\t\t\t} else if (value > me.max) {\n\t\t\t\t\t\t\tme.max = value;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (value !== 0 && (me.minNotZero === null || value < me.minNotZero)) {\n\t\t\t\t\t\t\tme.minNotZero = value;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\t// Common base implementation to handle ticks.min, ticks.max\n\t\tthis.handleTickRangeOptions();\n\t},\n\n\thandleTickRangeOptions: function() {\n\t\tvar me = this;\n\t\tvar tickOpts = me.options.ticks;\n\t\tvar DEFAULT_MIN = 1;\n\t\tvar DEFAULT_MAX = 10;\n\n\t\tme.min = nonNegativeOrDefault(tickOpts.min, me.min);\n\t\tme.max = nonNegativeOrDefault(tickOpts.max, me.max);\n\n\t\tif (me.min === me.max) {\n\t\t\tif (me.min !== 0 && me.min !== null) {\n\t\t\t\tme.min = Math.pow(10, Math.floor(helpers$1.log10(me.min)) - 1);\n\t\t\t\tme.max = Math.pow(10, Math.floor(helpers$1.log10(me.max)) + 1);\n\t\t\t} else {\n\t\t\t\tme.min = DEFAULT_MIN;\n\t\t\t\tme.max = DEFAULT_MAX;\n\t\t\t}\n\t\t}\n\t\tif (me.min === null) {\n\t\t\tme.min = Math.pow(10, Math.floor(helpers$1.log10(me.max)) - 1);\n\t\t}\n\t\tif (me.max === null) {\n\t\t\tme.max = me.min !== 0\n\t\t\t\t? Math.pow(10, Math.floor(helpers$1.log10(me.min)) + 1)\n\t\t\t\t: DEFAULT_MAX;\n\t\t}\n\t\tif (me.minNotZero === null) {\n\t\t\tif (me.min > 0) {\n\t\t\t\tme.minNotZero = me.min;\n\t\t\t} else if (me.max < 1) {\n\t\t\t\tme.minNotZero = Math.pow(10, Math.floor(helpers$1.log10(me.max)));\n\t\t\t} else {\n\t\t\t\tme.minNotZero = DEFAULT_MIN;\n\t\t\t}\n\t\t}\n\t},\n\n\tbuildTicks: function() {\n\t\tvar me = this;\n\t\tvar tickOpts = me.options.ticks;\n\t\tvar reverse = !me.isHorizontal();\n\n\t\tvar generationOptions = {\n\t\t\tmin: nonNegativeOrDefault(tickOpts.min),\n\t\t\tmax: nonNegativeOrDefault(tickOpts.max)\n\t\t};\n\t\tvar ticks = me.ticks = generateTicks$1(generationOptions, me);\n\n\t\t// At this point, we need to update our max and min given the tick values since we have expanded the\n\t\t// range of the scale\n\t\tme.max = helpers$1.max(ticks);\n\t\tme.min = helpers$1.min(ticks);\n\n\t\tif (tickOpts.reverse) {\n\t\t\treverse = !reverse;\n\t\t\tme.start = me.max;\n\t\t\tme.end = me.min;\n\t\t} else {\n\t\t\tme.start = me.min;\n\t\t\tme.end = me.max;\n\t\t}\n\t\tif (reverse) {\n\t\t\tticks.reverse();\n\t\t}\n\t},\n\n\tconvertTicksToLabels: function() {\n\t\tthis.tickValues = this.ticks.slice();\n\n\t\tcore_scale.prototype.convertTicksToLabels.call(this);\n\t},\n\n\t// Get the correct tooltip label\n\tgetLabelForIndex: function(index, datasetIndex) {\n\t\treturn +this.getRightValue(this.chart.data.datasets[datasetIndex].data[index]);\n\t},\n\n\tgetPixelForTick: function(index) {\n\t\treturn this.getPixelForValue(this.tickValues[index]);\n\t},\n\n\t/**\n\t * Returns the value of the first tick.\n\t * @param {number} value - The minimum not zero value.\n\t * @return {number} The first tick value.\n\t * @private\n\t */\n\t_getFirstTickValue: function(value) {\n\t\tvar exp = Math.floor(helpers$1.log10(value));\n\t\tvar significand = Math.floor(value / Math.pow(10, exp));\n\n\t\treturn significand * Math.pow(10, exp);\n\t},\n\n\tgetPixelForValue: function(value) {\n\t\tvar me = this;\n\t\tvar tickOpts = me.options.ticks;\n\t\tvar reverse = tickOpts.reverse;\n\t\tvar log10 = helpers$1.log10;\n\t\tvar firstTickValue = me._getFirstTickValue(me.minNotZero);\n\t\tvar offset = 0;\n\t\tvar innerDimension, pixel, start, end, sign;\n\n\t\tvalue = +me.getRightValue(value);\n\t\tif (reverse) {\n\t\t\tstart = me.end;\n\t\t\tend = me.start;\n\t\t\tsign = -1;\n\t\t} else {\n\t\t\tstart = me.start;\n\t\t\tend = me.end;\n\t\t\tsign = 1;\n\t\t}\n\t\tif (me.isHorizontal()) {\n\t\t\tinnerDimension = me.width;\n\t\t\tpixel = reverse ? me.right : me.left;\n\t\t} else {\n\t\t\tinnerDimension = me.height;\n\t\t\tsign *= -1; // invert, since the upper-left corner of the canvas is at pixel (0, 0)\n\t\t\tpixel = reverse ? me.top : me.bottom;\n\t\t}\n\t\tif (value !== start) {\n\t\t\tif (start === 0) { // include zero tick\n\t\t\t\toffset = valueOrDefault$a(tickOpts.fontSize, core_defaults.global.defaultFontSize);\n\t\t\t\tinnerDimension -= offset;\n\t\t\t\tstart = firstTickValue;\n\t\t\t}\n\t\t\tif (value !== 0) {\n\t\t\t\toffset += innerDimension / (log10(end) - log10(start)) * (log10(value) - log10(start));\n\t\t\t}\n\t\t\tpixel += sign * offset;\n\t\t}\n\t\treturn pixel;\n\t},\n\n\tgetValueForPixel: function(pixel) {\n\t\tvar me = this;\n\t\tvar tickOpts = me.options.ticks;\n\t\tvar reverse = tickOpts.reverse;\n\t\tvar log10 = helpers$1.log10;\n\t\tvar firstTickValue = me._getFirstTickValue(me.minNotZero);\n\t\tvar innerDimension, start, end, value;\n\n\t\tif (reverse) {\n\t\t\tstart = me.end;\n\t\t\tend = me.start;\n\t\t} else {\n\t\t\tstart = me.start;\n\t\t\tend = me.end;\n\t\t}\n\t\tif (me.isHorizontal()) {\n\t\t\tinnerDimension = me.width;\n\t\t\tvalue = reverse ? me.right - pixel : pixel - me.left;\n\t\t} else {\n\t\t\tinnerDimension = me.height;\n\t\t\tvalue = reverse ? pixel - me.top : me.bottom - pixel;\n\t\t}\n\t\tif (value !== start) {\n\t\t\tif (start === 0) { // include zero tick\n\t\t\t\tvar offset = valueOrDefault$a(tickOpts.fontSize, core_defaults.global.defaultFontSize);\n\t\t\t\tvalue -= offset;\n\t\t\t\tinnerDimension -= offset;\n\t\t\t\tstart = firstTickValue;\n\t\t\t}\n\t\t\tvalue *= log10(end) - log10(start);\n\t\t\tvalue /= innerDimension;\n\t\t\tvalue = Math.pow(10, log10(start) + value);\n\t\t}\n\t\treturn value;\n\t}\n});\n\n// INTERNAL: static default options, registered in src/index.js\nvar _defaults$2 = defaultConfig$2;\nscale_logarithmic._defaults = _defaults$2;\n\nvar valueOrDefault$b = helpers$1.valueOrDefault;\nvar valueAtIndexOrDefault$1 = helpers$1.valueAtIndexOrDefault;\nvar resolve$7 = helpers$1.options.resolve;\n\nvar defaultConfig$3 = {\n\tdisplay: true,\n\n\t// Boolean - Whether to animate scaling the chart from the centre\n\tanimate: true,\n\tposition: 'chartArea',\n\n\tangleLines: {\n\t\tdisplay: true,\n\t\tcolor: 'rgba(0, 0, 0, 0.1)',\n\t\tlineWidth: 1,\n\t\tborderDash: [],\n\t\tborderDashOffset: 0.0\n\t},\n\n\tgridLines: {\n\t\tcircular: false\n\t},\n\n\t// label settings\n\tticks: {\n\t\t// Boolean - Show a backdrop to the scale label\n\t\tshowLabelBackdrop: true,\n\n\t\t// String - The colour of the label backdrop\n\t\tbackdropColor: 'rgba(255,255,255,0.75)',\n\n\t\t// Number - The backdrop padding above & below the label in pixels\n\t\tbackdropPaddingY: 2,\n\n\t\t// Number - The backdrop padding to the side of the label in pixels\n\t\tbackdropPaddingX: 2,\n\n\t\tcallback: core_ticks.formatters.linear\n\t},\n\n\tpointLabels: {\n\t\t// Boolean - if true, show point labels\n\t\tdisplay: true,\n\n\t\t// Number - Point label font size in pixels\n\t\tfontSize: 10,\n\n\t\t// Function - Used to convert point labels\n\t\tcallback: function(label) {\n\t\t\treturn label;\n\t\t}\n\t}\n};\n\nfunction getValueCount(scale) {\n\tvar opts = scale.options;\n\treturn opts.angleLines.display || opts.pointLabels.display ? scale.chart.data.labels.length : 0;\n}\n\nfunction getTickBackdropHeight(opts) {\n\tvar tickOpts = opts.ticks;\n\n\tif (tickOpts.display && opts.display) {\n\t\treturn valueOrDefault$b(tickOpts.fontSize, core_defaults.global.defaultFontSize) + tickOpts.backdropPaddingY * 2;\n\t}\n\treturn 0;\n}\n\nfunction measureLabelSize(ctx, lineHeight, label) {\n\tif (helpers$1.isArray(label)) {\n\t\treturn {\n\t\t\tw: helpers$1.longestText(ctx, ctx.font, label),\n\t\t\th: label.length * lineHeight\n\t\t};\n\t}\n\n\treturn {\n\t\tw: ctx.measureText(label).width,\n\t\th: lineHeight\n\t};\n}\n\nfunction determineLimits(angle, pos, size, min, max) {\n\tif (angle === min || angle === max) {\n\t\treturn {\n\t\t\tstart: pos - (size / 2),\n\t\t\tend: pos + (size / 2)\n\t\t};\n\t} else if (angle < min || angle > max) {\n\t\treturn {\n\t\t\tstart: pos - size,\n\t\t\tend: pos\n\t\t};\n\t}\n\n\treturn {\n\t\tstart: pos,\n\t\tend: pos + size\n\t};\n}\n\n/**\n * Helper function to fit a radial linear scale with point labels\n */\nfunction fitWithPointLabels(scale) {\n\n\t// Right, this is really confusing and there is a lot of maths going on here\n\t// The gist of the problem is here: https://gist.github.com/nnnick/696cc9c55f4b0beb8fe9\n\t//\n\t// Reaction: https://dl.dropboxusercontent.com/u/34601363/toomuchscience.gif\n\t//\n\t// Solution:\n\t//\n\t// We assume the radius of the polygon is half the size of the canvas at first\n\t// at each index we check if the text overlaps.\n\t//\n\t// Where it does, we store that angle and that index.\n\t//\n\t// After finding the largest index and angle we calculate how much we need to remove\n\t// from the shape radius to move the point inwards by that x.\n\t//\n\t// We average the left and right distances to get the maximum shape radius that can fit in the box\n\t// along with labels.\n\t//\n\t// Once we have that, we can find the centre point for the chart, by taking the x text protrusion\n\t// on each side, removing that from the size, halving it and adding the left x protrusion width.\n\t//\n\t// This will mean we have a shape fitted to the canvas, as large as it can be with the labels\n\t// and position it in the most space efficient manner\n\t//\n\t// https://dl.dropboxusercontent.com/u/34601363/yeahscience.gif\n\n\tvar plFont = helpers$1.options._parseFont(scale.options.pointLabels);\n\n\t// Get maximum radius of the polygon. Either half the height (minus the text width) or half the width.\n\t// Use this to calculate the offset + change. - Make sure L/R protrusion is at least 0 to stop issues with centre points\n\tvar furthestLimits = {\n\t\tl: 0,\n\t\tr: scale.width,\n\t\tt: 0,\n\t\tb: scale.height - scale.paddingTop\n\t};\n\tvar furthestAngles = {};\n\tvar i, textSize, pointPosition;\n\n\tscale.ctx.font = plFont.string;\n\tscale._pointLabelSizes = [];\n\n\tvar valueCount = getValueCount(scale);\n\tfor (i = 0; i < valueCount; i++) {\n\t\tpointPosition = scale.getPointPosition(i, scale.drawingArea + 5);\n\t\ttextSize = measureLabelSize(scale.ctx, plFont.lineHeight, scale.pointLabels[i] || '');\n\t\tscale._pointLabelSizes[i] = textSize;\n\n\t\t// Add quarter circle to make degree 0 mean top of circle\n\t\tvar angleRadians = scale.getIndexAngle(i);\n\t\tvar angle = helpers$1.toDegrees(angleRadians) % 360;\n\t\tvar hLimits = determineLimits(angle, pointPosition.x, textSize.w, 0, 180);\n\t\tvar vLimits = determineLimits(angle, pointPosition.y, textSize.h, 90, 270);\n\n\t\tif (hLimits.start < furthestLimits.l) {\n\t\t\tfurthestLimits.l = hLimits.start;\n\t\t\tfurthestAngles.l = angleRadians;\n\t\t}\n\n\t\tif (hLimits.end > furthestLimits.r) {\n\t\t\tfurthestLimits.r = hLimits.end;\n\t\t\tfurthestAngles.r = angleRadians;\n\t\t}\n\n\t\tif (vLimits.start < furthestLimits.t) {\n\t\t\tfurthestLimits.t = vLimits.start;\n\t\t\tfurthestAngles.t = angleRadians;\n\t\t}\n\n\t\tif (vLimits.end > furthestLimits.b) {\n\t\t\tfurthestLimits.b = vLimits.end;\n\t\t\tfurthestAngles.b = angleRadians;\n\t\t}\n\t}\n\n\tscale.setReductions(scale.drawingArea, furthestLimits, furthestAngles);\n}\n\nfunction getTextAlignForAngle(angle) {\n\tif (angle === 0 || angle === 180) {\n\t\treturn 'center';\n\t} else if (angle < 180) {\n\t\treturn 'left';\n\t}\n\n\treturn 'right';\n}\n\nfunction fillText(ctx, text, position, lineHeight) {\n\tvar y = position.y + lineHeight / 2;\n\tvar i, ilen;\n\n\tif (helpers$1.isArray(text)) {\n\t\tfor (i = 0, ilen = text.length; i < ilen; ++i) {\n\t\t\tctx.fillText(text[i], position.x, y);\n\t\t\ty += lineHeight;\n\t\t}\n\t} else {\n\t\tctx.fillText(text, position.x, y);\n\t}\n}\n\nfunction adjustPointPositionForLabelHeight(angle, textSize, position) {\n\tif (angle === 90 || angle === 270) {\n\t\tposition.y -= (textSize.h / 2);\n\t} else if (angle > 270 || angle < 90) {\n\t\tposition.y -= textSize.h;\n\t}\n}\n\nfunction drawPointLabels(scale) {\n\tvar ctx = scale.ctx;\n\tvar opts = scale.options;\n\tvar angleLineOpts = opts.angleLines;\n\tvar gridLineOpts = opts.gridLines;\n\tvar pointLabelOpts = opts.pointLabels;\n\tvar lineWidth = valueOrDefault$b(angleLineOpts.lineWidth, gridLineOpts.lineWidth);\n\tvar lineColor = valueOrDefault$b(angleLineOpts.color, gridLineOpts.color);\n\tvar tickBackdropHeight = getTickBackdropHeight(opts);\n\n\tctx.save();\n\tctx.lineWidth = lineWidth;\n\tctx.strokeStyle = lineColor;\n\tif (ctx.setLineDash) {\n\t\tctx.setLineDash(resolve$7([angleLineOpts.borderDash, gridLineOpts.borderDash, []]));\n\t\tctx.lineDashOffset = resolve$7([angleLineOpts.borderDashOffset, gridLineOpts.borderDashOffset, 0.0]);\n\t}\n\n\tvar outerDistance = scale.getDistanceFromCenterForValue(opts.ticks.reverse ? scale.min : scale.max);\n\n\t// Point Label Font\n\tvar plFont = helpers$1.options._parseFont(pointLabelOpts);\n\n\tctx.font = plFont.string;\n\tctx.textBaseline = 'middle';\n\n\tfor (var i = getValueCount(scale) - 1; i >= 0; i--) {\n\t\tif (angleLineOpts.display && lineWidth && lineColor) {\n\t\t\tvar outerPosition = scale.getPointPosition(i, outerDistance);\n\t\t\tctx.beginPath();\n\t\t\tctx.moveTo(scale.xCenter, scale.yCenter);\n\t\t\tctx.lineTo(outerPosition.x, outerPosition.y);\n\t\t\tctx.stroke();\n\t\t}\n\n\t\tif (pointLabelOpts.display) {\n\t\t\t// Extra pixels out for some label spacing\n\t\t\tvar extra = (i === 0 ? tickBackdropHeight / 2 : 0);\n\t\t\tvar pointLabelPosition = scale.getPointPosition(i, outerDistance + extra + 5);\n\n\t\t\t// Keep this in loop since we may support array properties here\n\t\t\tvar pointLabelFontColor = valueAtIndexOrDefault$1(pointLabelOpts.fontColor, i, core_defaults.global.defaultFontColor);\n\t\t\tctx.fillStyle = pointLabelFontColor;\n\n\t\t\tvar angleRadians = scale.getIndexAngle(i);\n\t\t\tvar angle = helpers$1.toDegrees(angleRadians);\n\t\t\tctx.textAlign = getTextAlignForAngle(angle);\n\t\t\tadjustPointPositionForLabelHeight(angle, scale._pointLabelSizes[i], pointLabelPosition);\n\t\t\tfillText(ctx, scale.pointLabels[i] || '', pointLabelPosition, plFont.lineHeight);\n\t\t}\n\t}\n\tctx.restore();\n}\n\nfunction drawRadiusLine(scale, gridLineOpts, radius, index) {\n\tvar ctx = scale.ctx;\n\tvar circular = gridLineOpts.circular;\n\tvar valueCount = getValueCount(scale);\n\tvar lineColor = valueAtIndexOrDefault$1(gridLineOpts.color, index - 1);\n\tvar lineWidth = valueAtIndexOrDefault$1(gridLineOpts.lineWidth, index - 1);\n\tvar pointPosition;\n\n\tif ((!circular && !valueCount) || !lineColor || !lineWidth) {\n\t\treturn;\n\t}\n\n\tctx.save();\n\tctx.strokeStyle = lineColor;\n\tctx.lineWidth = lineWidth;\n\tif (ctx.setLineDash) {\n\t\tctx.setLineDash(gridLineOpts.borderDash || []);\n\t\tctx.lineDashOffset = gridLineOpts.borderDashOffset || 0.0;\n\t}\n\n\tctx.beginPath();\n\tif (circular) {\n\t\t// Draw circular arcs between the points\n\t\tctx.arc(scale.xCenter, scale.yCenter, radius, 0, Math.PI * 2);\n\t} else {\n\t\t// Draw straight lines connecting each index\n\t\tpointPosition = scale.getPointPosition(0, radius);\n\t\tctx.moveTo(pointPosition.x, pointPosition.y);\n\n\t\tfor (var i = 1; i < valueCount; i++) {\n\t\t\tpointPosition = scale.getPointPosition(i, radius);\n\t\t\tctx.lineTo(pointPosition.x, pointPosition.y);\n\t\t}\n\t}\n\tctx.closePath();\n\tctx.stroke();\n\tctx.restore();\n}\n\nfunction numberOrZero(param) {\n\treturn helpers$1.isNumber(param) ? param : 0;\n}\n\nvar scale_radialLinear = scale_linearbase.extend({\n\tsetDimensions: function() {\n\t\tvar me = this;\n\n\t\t// Set the unconstrained dimension before label rotation\n\t\tme.width = me.maxWidth;\n\t\tme.height = me.maxHeight;\n\t\tme.paddingTop = getTickBackdropHeight(me.options) / 2;\n\t\tme.xCenter = Math.floor(me.width / 2);\n\t\tme.yCenter = Math.floor((me.height - me.paddingTop) / 2);\n\t\tme.drawingArea = Math.min(me.height - me.paddingTop, me.width) / 2;\n\t},\n\n\tdetermineDataLimits: function() {\n\t\tvar me = this;\n\t\tvar chart = me.chart;\n\t\tvar min = Number.POSITIVE_INFINITY;\n\t\tvar max = Number.NEGATIVE_INFINITY;\n\n\t\thelpers$1.each(chart.data.datasets, function(dataset, datasetIndex) {\n\t\t\tif (chart.isDatasetVisible(datasetIndex)) {\n\t\t\t\tvar meta = chart.getDatasetMeta(datasetIndex);\n\n\t\t\t\thelpers$1.each(dataset.data, function(rawValue, index) {\n\t\t\t\t\tvar value = +me.getRightValue(rawValue);\n\t\t\t\t\tif (isNaN(value) || meta.data[index].hidden) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tmin = Math.min(value, min);\n\t\t\t\t\tmax = Math.max(value, max);\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\n\t\tme.min = (min === Number.POSITIVE_INFINITY ? 0 : min);\n\t\tme.max = (max === Number.NEGATIVE_INFINITY ? 0 : max);\n\n\t\t// Common base implementation to handle ticks.min, ticks.max, ticks.beginAtZero\n\t\tme.handleTickRangeOptions();\n\t},\n\n\t// Returns the maximum number of ticks based on the scale dimension\n\t_computeTickLimit: function() {\n\t\treturn Math.ceil(this.drawingArea / getTickBackdropHeight(this.options));\n\t},\n\n\tconvertTicksToLabels: function() {\n\t\tvar me = this;\n\n\t\tscale_linearbase.prototype.convertTicksToLabels.call(me);\n\n\t\t// Point labels\n\t\tme.pointLabels = me.chart.data.labels.map(me.options.pointLabels.callback, me);\n\t},\n\n\tgetLabelForIndex: function(index, datasetIndex) {\n\t\treturn +this.getRightValue(this.chart.data.datasets[datasetIndex].data[index]);\n\t},\n\n\tfit: function() {\n\t\tvar me = this;\n\t\tvar opts = me.options;\n\n\t\tif (opts.display && opts.pointLabels.display) {\n\t\t\tfitWithPointLabels(me);\n\t\t} else {\n\t\t\tme.setCenterPoint(0, 0, 0, 0);\n\t\t}\n\t},\n\n\t/**\n\t * Set radius reductions and determine new radius and center point\n\t * @private\n\t */\n\tsetReductions: function(largestPossibleRadius, furthestLimits, furthestAngles) {\n\t\tvar me = this;\n\t\tvar radiusReductionLeft = furthestLimits.l / Math.sin(furthestAngles.l);\n\t\tvar radiusReductionRight = Math.max(furthestLimits.r - me.width, 0) / Math.sin(furthestAngles.r);\n\t\tvar radiusReductionTop = -furthestLimits.t / Math.cos(furthestAngles.t);\n\t\tvar radiusReductionBottom = -Math.max(furthestLimits.b - (me.height - me.paddingTop), 0) / Math.cos(furthestAngles.b);\n\n\t\tradiusReductionLeft = numberOrZero(radiusReductionLeft);\n\t\tradiusReductionRight = numberOrZero(radiusReductionRight);\n\t\tradiusReductionTop = numberOrZero(radiusReductionTop);\n\t\tradiusReductionBottom = numberOrZero(radiusReductionBottom);\n\n\t\tme.drawingArea = Math.min(\n\t\t\tMath.floor(largestPossibleRadius - (radiusReductionLeft + radiusReductionRight) / 2),\n\t\t\tMath.floor(largestPossibleRadius - (radiusReductionTop + radiusReductionBottom) / 2));\n\t\tme.setCenterPoint(radiusReductionLeft, radiusReductionRight, radiusReductionTop, radiusReductionBottom);\n\t},\n\n\tsetCenterPoint: function(leftMovement, rightMovement, topMovement, bottomMovement) {\n\t\tvar me = this;\n\t\tvar maxRight = me.width - rightMovement - me.drawingArea;\n\t\tvar maxLeft = leftMovement + me.drawingArea;\n\t\tvar maxTop = topMovement + me.drawingArea;\n\t\tvar maxBottom = (me.height - me.paddingTop) - bottomMovement - me.drawingArea;\n\n\t\tme.xCenter = Math.floor(((maxLeft + maxRight) / 2) + me.left);\n\t\tme.yCenter = Math.floor(((maxTop + maxBottom) / 2) + me.top + me.paddingTop);\n\t},\n\n\tgetIndexAngle: function(index) {\n\t\tvar angleMultiplier = (Math.PI * 2) / getValueCount(this);\n\t\tvar startAngle = this.chart.options && this.chart.options.startAngle ?\n\t\t\tthis.chart.options.startAngle :\n\t\t\t0;\n\n\t\tvar startAngleRadians = startAngle * Math.PI * 2 / 360;\n\n\t\t// Start from the top instead of right, so remove a quarter of the circle\n\t\treturn index * angleMultiplier + startAngleRadians;\n\t},\n\n\tgetDistanceFromCenterForValue: function(value) {\n\t\tvar me = this;\n\n\t\tif (value === null) {\n\t\t\treturn 0; // null always in center\n\t\t}\n\n\t\t// Take into account half font size + the yPadding of the top value\n\t\tvar scalingFactor = me.drawingArea / (me.max - me.min);\n\t\tif (me.options.ticks.reverse) {\n\t\t\treturn (me.max - value) * scalingFactor;\n\t\t}\n\t\treturn (value - me.min) * scalingFactor;\n\t},\n\n\tgetPointPosition: function(index, distanceFromCenter) {\n\t\tvar me = this;\n\t\tvar thisAngle = me.getIndexAngle(index) - (Math.PI / 2);\n\t\treturn {\n\t\t\tx: Math.cos(thisAngle) * distanceFromCenter + me.xCenter,\n\t\t\ty: Math.sin(thisAngle) * distanceFromCenter + me.yCenter\n\t\t};\n\t},\n\n\tgetPointPositionForValue: function(index, value) {\n\t\treturn this.getPointPosition(index, this.getDistanceFromCenterForValue(value));\n\t},\n\n\tgetBasePosition: function() {\n\t\tvar me = this;\n\t\tvar min = me.min;\n\t\tvar max = me.max;\n\n\t\treturn me.getPointPositionForValue(0,\n\t\t\tme.beginAtZero ? 0 :\n\t\t\tmin < 0 && max < 0 ? max :\n\t\t\tmin > 0 && max > 0 ? min :\n\t\t\t0);\n\t},\n\n\tdraw: function() {\n\t\tvar me = this;\n\t\tvar opts = me.options;\n\t\tvar gridLineOpts = opts.gridLines;\n\t\tvar tickOpts = opts.ticks;\n\n\t\tif (opts.display) {\n\t\t\tvar ctx = me.ctx;\n\t\t\tvar startAngle = this.getIndexAngle(0);\n\t\t\tvar tickFont = helpers$1.options._parseFont(tickOpts);\n\n\t\t\tif (opts.angleLines.display || opts.pointLabels.display) {\n\t\t\t\tdrawPointLabels(me);\n\t\t\t}\n\n\t\t\thelpers$1.each(me.ticks, function(label, index) {\n\t\t\t\t// Don't draw a centre value (if it is minimum)\n\t\t\t\tif (index > 0 || tickOpts.reverse) {\n\t\t\t\t\tvar yCenterOffset = me.getDistanceFromCenterForValue(me.ticksAsNumbers[index]);\n\n\t\t\t\t\t// Draw circular lines around the scale\n\t\t\t\t\tif (gridLineOpts.display && index !== 0) {\n\t\t\t\t\t\tdrawRadiusLine(me, gridLineOpts, yCenterOffset, index);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (tickOpts.display) {\n\t\t\t\t\t\tvar tickFontColor = valueOrDefault$b(tickOpts.fontColor, core_defaults.global.defaultFontColor);\n\t\t\t\t\t\tctx.font = tickFont.string;\n\n\t\t\t\t\t\tctx.save();\n\t\t\t\t\t\tctx.translate(me.xCenter, me.yCenter);\n\t\t\t\t\t\tctx.rotate(startAngle);\n\n\t\t\t\t\t\tif (tickOpts.showLabelBackdrop) {\n\t\t\t\t\t\t\tvar labelWidth = ctx.measureText(label).width;\n\t\t\t\t\t\t\tctx.fillStyle = tickOpts.backdropColor;\n\t\t\t\t\t\t\tctx.fillRect(\n\t\t\t\t\t\t\t\t-labelWidth / 2 - tickOpts.backdropPaddingX,\n\t\t\t\t\t\t\t\t-yCenterOffset - tickFont.size / 2 - tickOpts.backdropPaddingY,\n\t\t\t\t\t\t\t\tlabelWidth + tickOpts.backdropPaddingX * 2,\n\t\t\t\t\t\t\t\ttickFont.size + tickOpts.backdropPaddingY * 2\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tctx.textAlign = 'center';\n\t\t\t\t\t\tctx.textBaseline = 'middle';\n\t\t\t\t\t\tctx.fillStyle = tickFontColor;\n\t\t\t\t\t\tctx.fillText(label, 0, -yCenterOffset);\n\t\t\t\t\t\tctx.restore();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n});\n\n// INTERNAL: static default options, registered in src/index.js\nvar _defaults$3 = defaultConfig$3;\nscale_radialLinear._defaults = _defaults$3;\n\nvar valueOrDefault$c = helpers$1.valueOrDefault;\n\n// Integer constants are from the ES6 spec.\nvar MIN_INTEGER = Number.MIN_SAFE_INTEGER || -9007199254740991;\nvar MAX_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991;\n\nvar INTERVALS = {\n\tmillisecond: {\n\t\tcommon: true,\n\t\tsize: 1,\n\t\tsteps: [1, 2, 5, 10, 20, 50, 100, 250, 500]\n\t},\n\tsecond: {\n\t\tcommon: true,\n\t\tsize: 1000,\n\t\tsteps: [1, 2, 5, 10, 15, 30]\n\t},\n\tminute: {\n\t\tcommon: true,\n\t\tsize: 60000,\n\t\tsteps: [1, 2, 5, 10, 15, 30]\n\t},\n\thour: {\n\t\tcommon: true,\n\t\tsize: 3600000,\n\t\tsteps: [1, 2, 3, 6, 12]\n\t},\n\tday: {\n\t\tcommon: true,\n\t\tsize: 86400000,\n\t\tsteps: [1, 2, 5]\n\t},\n\tweek: {\n\t\tcommon: false,\n\t\tsize: 604800000,\n\t\tsteps: [1, 2, 3, 4]\n\t},\n\tmonth: {\n\t\tcommon: true,\n\t\tsize: 2.628e9,\n\t\tsteps: [1, 2, 3]\n\t},\n\tquarter: {\n\t\tcommon: false,\n\t\tsize: 7.884e9,\n\t\tsteps: [1, 2, 3, 4]\n\t},\n\tyear: {\n\t\tcommon: true,\n\t\tsize: 3.154e10\n\t}\n};\n\nvar UNITS = Object.keys(INTERVALS);\n\nfunction sorter(a, b) {\n\treturn a - b;\n}\n\nfunction arrayUnique(items) {\n\tvar hash = {};\n\tvar out = [];\n\tvar i, ilen, item;\n\n\tfor (i = 0, ilen = items.length; i < ilen; ++i) {\n\t\titem = items[i];\n\t\tif (!hash[item]) {\n\t\t\thash[item] = true;\n\t\t\tout.push(item);\n\t\t}\n\t}\n\n\treturn out;\n}\n\n/**\n * Returns an array of {time, pos} objects used to interpolate a specific `time` or position\n * (`pos`) on the scale, by searching entries before and after the requested value. `pos` is\n * a decimal between 0 and 1: 0 being the start of the scale (left or top) and 1 the other\n * extremity (left + width or top + height). Note that it would be more optimized to directly\n * store pre-computed pixels, but the scale dimensions are not guaranteed at the time we need\n * to create the lookup table. The table ALWAYS contains at least two items: min and max.\n *\n * @param {number[]} timestamps - timestamps sorted from lowest to highest.\n * @param {string} distribution - If 'linear', timestamps will be spread linearly along the min\n * and max range, so basically, the table will contains only two items: {min, 0} and {max, 1}.\n * If 'series', timestamps will be positioned at the same distance from each other. In this\n * case, only timestamps that break the time linearity are registered, meaning that in the\n * best case, all timestamps are linear, the table contains only min and max.\n */\nfunction buildLookupTable(timestamps, min, max, distribution) {\n\tif (distribution === 'linear' || !timestamps.length) {\n\t\treturn [\n\t\t\t{time: min, pos: 0},\n\t\t\t{time: max, pos: 1}\n\t\t];\n\t}\n\n\tvar table = [];\n\tvar items = [min];\n\tvar i, ilen, prev, curr, next;\n\n\tfor (i = 0, ilen = timestamps.length; i < ilen; ++i) {\n\t\tcurr = timestamps[i];\n\t\tif (curr > min && curr < max) {\n\t\t\titems.push(curr);\n\t\t}\n\t}\n\n\titems.push(max);\n\n\tfor (i = 0, ilen = items.length; i < ilen; ++i) {\n\t\tnext = items[i + 1];\n\t\tprev = items[i - 1];\n\t\tcurr = items[i];\n\n\t\t// only add points that breaks the scale linearity\n\t\tif (prev === undefined || next === undefined || Math.round((next + prev) / 2) !== curr) {\n\t\t\ttable.push({time: curr, pos: i / (ilen - 1)});\n\t\t}\n\t}\n\n\treturn table;\n}\n\n// @see adapted from https://www.anujgakhar.com/2014/03/01/binary-search-in-javascript/\nfunction lookup(table, key, value) {\n\tvar lo = 0;\n\tvar hi = table.length - 1;\n\tvar mid, i0, i1;\n\n\twhile (lo >= 0 && lo <= hi) {\n\t\tmid = (lo + hi) >> 1;\n\t\ti0 = table[mid - 1] || null;\n\t\ti1 = table[mid];\n\n\t\tif (!i0) {\n\t\t\t// given value is outside table (before first item)\n\t\t\treturn {lo: null, hi: i1};\n\t\t} else if (i1[key] < value) {\n\t\t\tlo = mid + 1;\n\t\t} else if (i0[key] > value) {\n\t\t\thi = mid - 1;\n\t\t} else {\n\t\t\treturn {lo: i0, hi: i1};\n\t\t}\n\t}\n\n\t// given value is outside table (after last item)\n\treturn {lo: i1, hi: null};\n}\n\n/**\n * Linearly interpolates the given source `value` using the table items `skey` values and\n * returns the associated `tkey` value. For example, interpolate(table, 'time', 42, 'pos')\n * returns the position for a timestamp equal to 42. If value is out of bounds, values at\n * index [0, 1] or [n - 1, n] are used for the interpolation.\n */\nfunction interpolate$1(table, skey, sval, tkey) {\n\tvar range = lookup(table, skey, sval);\n\n\t// Note: the lookup table ALWAYS contains at least 2 items (min and max)\n\tvar prev = !range.lo ? table[0] : !range.hi ? table[table.length - 2] : range.lo;\n\tvar next = !range.lo ? table[1] : !range.hi ? table[table.length - 1] : range.hi;\n\n\tvar span = next[skey] - prev[skey];\n\tvar ratio = span ? (sval - prev[skey]) / span : 0;\n\tvar offset = (next[tkey] - prev[tkey]) * ratio;\n\n\treturn prev[tkey] + offset;\n}\n\nfunction toTimestamp(scale, input) {\n\tvar adapter = scale._adapter;\n\tvar options = scale.options.time;\n\tvar parser = options.parser;\n\tvar format = parser || options.format;\n\tvar value = input;\n\n\tif (typeof parser === 'function') {\n\t\tvalue = parser(value);\n\t}\n\n\t// Only parse if its not a timestamp already\n\tif (!helpers$1.isFinite(value)) {\n\t\tvalue = typeof format === 'string'\n\t\t\t? adapter.parse(value, format)\n\t\t\t: adapter.parse(value);\n\t}\n\n\tif (value !== null) {\n\t\treturn +value;\n\t}\n\n\t// Labels are in an incompatible format and no `parser` has been provided.\n\t// The user might still use the deprecated `format` option for parsing.\n\tif (!parser && typeof format === 'function') {\n\t\tvalue = format(input);\n\n\t\t// `format` could return something else than a timestamp, if so, parse it\n\t\tif (!helpers$1.isFinite(value)) {\n\t\t\tvalue = adapter.parse(value);\n\t\t}\n\t}\n\n\treturn value;\n}\n\nfunction parse(scale, input) {\n\tif (helpers$1.isNullOrUndef(input)) {\n\t\treturn null;\n\t}\n\n\tvar options = scale.options.time;\n\tvar value = toTimestamp(scale, scale.getRightValue(input));\n\tif (value === null) {\n\t\treturn value;\n\t}\n\n\tif (options.round) {\n\t\tvalue = +scale._adapter.startOf(value, options.round);\n\t}\n\n\treturn value;\n}\n\n/**\n * Returns the number of unit to skip to be able to display up to `capacity` number of ticks\n * in `unit` for the given `min` / `max` range and respecting the interval steps constraints.\n */\nfunction determineStepSize(min, max, unit, capacity) {\n\tvar range = max - min;\n\tvar interval = INTERVALS[unit];\n\tvar milliseconds = interval.size;\n\tvar steps = interval.steps;\n\tvar i, ilen, factor;\n\n\tif (!steps) {\n\t\treturn Math.ceil(range / (capacity * milliseconds));\n\t}\n\n\tfor (i = 0, ilen = steps.length; i < ilen; ++i) {\n\t\tfactor = steps[i];\n\t\tif (Math.ceil(range / (milliseconds * factor)) <= capacity) {\n\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn factor;\n}\n\n/**\n * Figures out what unit results in an appropriate number of auto-generated ticks\n */\nfunction determineUnitForAutoTicks(minUnit, min, max, capacity) {\n\tvar ilen = UNITS.length;\n\tvar i, interval, factor;\n\n\tfor (i = UNITS.indexOf(minUnit); i < ilen - 1; ++i) {\n\t\tinterval = INTERVALS[UNITS[i]];\n\t\tfactor = interval.steps ? interval.steps[interval.steps.length - 1] : MAX_INTEGER;\n\n\t\tif (interval.common && Math.ceil((max - min) / (factor * interval.size)) <= capacity) {\n\t\t\treturn UNITS[i];\n\t\t}\n\t}\n\n\treturn UNITS[ilen - 1];\n}\n\n/**\n * Figures out what unit to format a set of ticks with\n */\nfunction determineUnitForFormatting(scale, ticks, minUnit, min, max) {\n\tvar ilen = UNITS.length;\n\tvar i, unit;\n\n\tfor (i = ilen - 1; i >= UNITS.indexOf(minUnit); i--) {\n\t\tunit = UNITS[i];\n\t\tif (INTERVALS[unit].common && scale._adapter.diff(max, min, unit) >= ticks.length) {\n\t\t\treturn unit;\n\t\t}\n\t}\n\n\treturn UNITS[minUnit ? UNITS.indexOf(minUnit) : 0];\n}\n\nfunction determineMajorUnit(unit) {\n\tfor (var i = UNITS.indexOf(unit) + 1, ilen = UNITS.length; i < ilen; ++i) {\n\t\tif (INTERVALS[UNITS[i]].common) {\n\t\t\treturn UNITS[i];\n\t\t}\n\t}\n}\n\n/**\n * Generates a maximum of `capacity` timestamps between min and max, rounded to the\n * `minor` unit, aligned on the `major` unit and using the given scale time `options`.\n * Important: this method can return ticks outside the min and max range, it's the\n * responsibility of the calling code to clamp values if needed.\n */\nfunction generate(scale, min, max, capacity) {\n\tvar adapter = scale._adapter;\n\tvar options = scale.options;\n\tvar timeOpts = options.time;\n\tvar minor = timeOpts.unit || determineUnitForAutoTicks(timeOpts.minUnit, min, max, capacity);\n\tvar major = determineMajorUnit(minor);\n\tvar stepSize = valueOrDefault$c(timeOpts.stepSize, timeOpts.unitStepSize);\n\tvar weekday = minor === 'week' ? timeOpts.isoWeekday : false;\n\tvar majorTicksEnabled = options.ticks.major.enabled;\n\tvar interval = INTERVALS[minor];\n\tvar first = min;\n\tvar last = max;\n\tvar ticks = [];\n\tvar time;\n\n\tif (!stepSize) {\n\t\tstepSize = determineStepSize(min, max, minor, capacity);\n\t}\n\n\t// For 'week' unit, handle the first day of week option\n\tif (weekday) {\n\t\tfirst = +adapter.startOf(first, 'isoWeek', weekday);\n\t\tlast = +adapter.startOf(last, 'isoWeek', weekday);\n\t}\n\n\t// Align first/last ticks on unit\n\tfirst = +adapter.startOf(first, weekday ? 'day' : minor);\n\tlast = +adapter.startOf(last, weekday ? 'day' : minor);\n\n\t// Make sure that the last tick include max\n\tif (last < max) {\n\t\tlast = +adapter.add(last, 1, minor);\n\t}\n\n\ttime = first;\n\n\tif (majorTicksEnabled && major && !weekday && !timeOpts.round) {\n\t\t// Align the first tick on the previous `minor` unit aligned on the `major` unit:\n\t\t// we first aligned time on the previous `major` unit then add the number of full\n\t\t// stepSize there is between first and the previous major time.\n\t\ttime = +adapter.startOf(time, major);\n\t\ttime = +adapter.add(time, ~~((first - time) / (interval.size * stepSize)) * stepSize, minor);\n\t}\n\n\tfor (; time < last; time = +adapter.add(time, stepSize, minor)) {\n\t\tticks.push(+time);\n\t}\n\n\tticks.push(+time);\n\n\treturn ticks;\n}\n\n/**\n * Returns the start and end offsets from edges in the form of {start, end}\n * where each value is a relative width to the scale and ranges between 0 and 1.\n * They add extra margins on the both sides by scaling down the original scale.\n * Offsets are added when the `offset` option is true.\n */\nfunction computeOffsets(table, ticks, min, max, options) {\n\tvar start = 0;\n\tvar end = 0;\n\tvar first, last;\n\n\tif (options.offset && ticks.length) {\n\t\tif (!options.time.min) {\n\t\t\tfirst = interpolate$1(table, 'time', ticks[0], 'pos');\n\t\t\tif (ticks.length === 1) {\n\t\t\t\tstart = 1 - first;\n\t\t\t} else {\n\t\t\t\tstart = (interpolate$1(table, 'time', ticks[1], 'pos') - first) / 2;\n\t\t\t}\n\t\t}\n\t\tif (!options.time.max) {\n\t\t\tlast = interpolate$1(table, 'time', ticks[ticks.length - 1], 'pos');\n\t\t\tif (ticks.length === 1) {\n\t\t\t\tend = last;\n\t\t\t} else {\n\t\t\t\tend = (last - interpolate$1(table, 'time', ticks[ticks.length - 2], 'pos')) / 2;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn {start: start, end: end};\n}\n\nfunction ticksFromTimestamps(scale, values, majorUnit) {\n\tvar ticks = [];\n\tvar i, ilen, value, major;\n\n\tfor (i = 0, ilen = values.length; i < ilen; ++i) {\n\t\tvalue = values[i];\n\t\tmajor = majorUnit ? value === +scale._adapter.startOf(value, majorUnit) : false;\n\n\t\tticks.push({\n\t\t\tvalue: value,\n\t\t\tmajor: major\n\t\t});\n\t}\n\n\treturn ticks;\n}\n\nvar defaultConfig$4 = {\n\tposition: 'bottom',\n\n\t/**\n\t * Data distribution along the scale:\n\t * - 'linear': data are spread according to their time (distances can vary),\n\t * - 'series': data are spread at the same distance from each other.\n\t * @see https://github.com/chartjs/Chart.js/pull/4507\n\t * @since 2.7.0\n\t */\n\tdistribution: 'linear',\n\n\t/**\n\t * Scale boundary strategy (bypassed by min/max time options)\n\t * - `data`: make sure data are fully visible, ticks outside are removed\n\t * - `ticks`: make sure ticks are fully visible, data outside are truncated\n\t * @see https://github.com/chartjs/Chart.js/pull/4556\n\t * @since 2.7.0\n\t */\n\tbounds: 'data',\n\n\tadapters: {},\n\ttime: {\n\t\tparser: false, // false == a pattern string from https://momentjs.com/docs/#/parsing/string-format/ or a custom callback that converts its argument to a moment\n\t\tformat: false, // DEPRECATED false == date objects, moment object, callback or a pattern string from https://momentjs.com/docs/#/parsing/string-format/\n\t\tunit: false, // false == automatic or override with week, month, year, etc.\n\t\tround: false, // none, or override with week, month, year, etc.\n\t\tdisplayFormat: false, // DEPRECATED\n\t\tisoWeekday: false, // override week start day - see https://momentjs.com/docs/#/get-set/iso-weekday/\n\t\tminUnit: 'millisecond',\n\t\tdisplayFormats: {}\n\t},\n\tticks: {\n\t\tautoSkip: false,\n\n\t\t/**\n\t\t * Ticks generation input values:\n\t\t * - 'auto': generates \"optimal\" ticks based on scale size and time options.\n\t\t * - 'data': generates ticks from data (including labels from data {t|x|y} objects).\n\t\t * - 'labels': generates ticks from user given `data.labels` values ONLY.\n\t\t * @see https://github.com/chartjs/Chart.js/pull/4507\n\t\t * @since 2.7.0\n\t\t */\n\t\tsource: 'auto',\n\n\t\tmajor: {\n\t\t\tenabled: false\n\t\t}\n\t}\n};\n\nvar scale_time = core_scale.extend({\n\tinitialize: function() {\n\t\tthis.mergeTicksOptions();\n\t\tcore_scale.prototype.initialize.call(this);\n\t},\n\n\tupdate: function() {\n\t\tvar me = this;\n\t\tvar options = me.options;\n\t\tvar time = options.time || (options.time = {});\n\t\tvar adapter = me._adapter = new core_adapters._date(options.adapters.date);\n\n\t\t// DEPRECATIONS: output a message only one time per update\n\t\tif (time.format) {\n\t\t\tconsole.warn('options.time.format is deprecated and replaced by options.time.parser.');\n\t\t}\n\n\t\t// Backward compatibility: before introducing adapter, `displayFormats` was\n\t\t// supposed to contain *all* unit/string pairs but this can't be resolved\n\t\t// when loading the scale (adapters are loaded afterward), so let's populate\n\t\t// missing formats on update\n\t\thelpers$1.mergeIf(time.displayFormats, adapter.formats());\n\n\t\treturn core_scale.prototype.update.apply(me, arguments);\n\t},\n\n\t/**\n\t * Allows data to be referenced via 't' attribute\n\t */\n\tgetRightValue: function(rawValue) {\n\t\tif (rawValue && rawValue.t !== undefined) {\n\t\t\trawValue = rawValue.t;\n\t\t}\n\t\treturn core_scale.prototype.getRightValue.call(this, rawValue);\n\t},\n\n\tdetermineDataLimits: function() {\n\t\tvar me = this;\n\t\tvar chart = me.chart;\n\t\tvar adapter = me._adapter;\n\t\tvar timeOpts = me.options.time;\n\t\tvar unit = timeOpts.unit || 'day';\n\t\tvar min = MAX_INTEGER;\n\t\tvar max = MIN_INTEGER;\n\t\tvar timestamps = [];\n\t\tvar datasets = [];\n\t\tvar labels = [];\n\t\tvar i, j, ilen, jlen, data, timestamp;\n\t\tvar dataLabels = chart.data.labels || [];\n\n\t\t// Convert labels to timestamps\n\t\tfor (i = 0, ilen = dataLabels.length; i < ilen; ++i) {\n\t\t\tlabels.push(parse(me, dataLabels[i]));\n\t\t}\n\n\t\t// Convert data to timestamps\n\t\tfor (i = 0, ilen = (chart.data.datasets || []).length; i < ilen; ++i) {\n\t\t\tif (chart.isDatasetVisible(i)) {\n\t\t\t\tdata = chart.data.datasets[i].data;\n\n\t\t\t\t// Let's consider that all data have the same format.\n\t\t\t\tif (helpers$1.isObject(data[0])) {\n\t\t\t\t\tdatasets[i] = [];\n\n\t\t\t\t\tfor (j = 0, jlen = data.length; j < jlen; ++j) {\n\t\t\t\t\t\ttimestamp = parse(me, data[j]);\n\t\t\t\t\t\ttimestamps.push(timestamp);\n\t\t\t\t\t\tdatasets[i][j] = timestamp;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tfor (j = 0, jlen = labels.length; j < jlen; ++j) {\n\t\t\t\t\t\ttimestamps.push(labels[j]);\n\t\t\t\t\t}\n\t\t\t\t\tdatasets[i] = labels.slice(0);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tdatasets[i] = [];\n\t\t\t}\n\t\t}\n\n\t\tif (labels.length) {\n\t\t\t// Sort labels **after** data have been converted\n\t\t\tlabels = arrayUnique(labels).sort(sorter);\n\t\t\tmin = Math.min(min, labels[0]);\n\t\t\tmax = Math.max(max, labels[labels.length - 1]);\n\t\t}\n\n\t\tif (timestamps.length) {\n\t\t\ttimestamps = arrayUnique(timestamps).sort(sorter);\n\t\t\tmin = Math.min(min, timestamps[0]);\n\t\t\tmax = Math.max(max, timestamps[timestamps.length - 1]);\n\t\t}\n\n\t\tmin = parse(me, timeOpts.min) || min;\n\t\tmax = parse(me, timeOpts.max) || max;\n\n\t\t// In case there is no valid min/max, set limits based on unit time option\n\t\tmin = min === MAX_INTEGER ? +adapter.startOf(Date.now(), unit) : min;\n\t\tmax = max === MIN_INTEGER ? +adapter.endOf(Date.now(), unit) + 1 : max;\n\n\t\t// Make sure that max is strictly higher than min (required by the lookup table)\n\t\tme.min = Math.min(min, max);\n\t\tme.max = Math.max(min + 1, max);\n\n\t\t// PRIVATE\n\t\tme._horizontal = me.isHorizontal();\n\t\tme._table = [];\n\t\tme._timestamps = {\n\t\t\tdata: timestamps,\n\t\t\tdatasets: datasets,\n\t\t\tlabels: labels\n\t\t};\n\t},\n\n\tbuildTicks: function() {\n\t\tvar me = this;\n\t\tvar min = me.min;\n\t\tvar max = me.max;\n\t\tvar options = me.options;\n\t\tvar timeOpts = options.time;\n\t\tvar timestamps = [];\n\t\tvar ticks = [];\n\t\tvar i, ilen, timestamp;\n\n\t\tswitch (options.ticks.source) {\n\t\tcase 'data':\n\t\t\ttimestamps = me._timestamps.data;\n\t\t\tbreak;\n\t\tcase 'labels':\n\t\t\ttimestamps = me._timestamps.labels;\n\t\t\tbreak;\n\t\tcase 'auto':\n\t\tdefault:\n\t\t\ttimestamps = generate(me, min, max, me.getLabelCapacity(min), options);\n\t\t}\n\n\t\tif (options.bounds === 'ticks' && timestamps.length) {\n\t\t\tmin = timestamps[0];\n\t\t\tmax = timestamps[timestamps.length - 1];\n\t\t}\n\n\t\t// Enforce limits with user min/max options\n\t\tmin = parse(me, timeOpts.min) || min;\n\t\tmax = parse(me, timeOpts.max) || max;\n\n\t\t// Remove ticks outside the min/max range\n\t\tfor (i = 0, ilen = timestamps.length; i < ilen; ++i) {\n\t\t\ttimestamp = timestamps[i];\n\t\t\tif (timestamp >= min && timestamp <= max) {\n\t\t\t\tticks.push(timestamp);\n\t\t\t}\n\t\t}\n\n\t\tme.min = min;\n\t\tme.max = max;\n\n\t\t// PRIVATE\n\t\tme._unit = timeOpts.unit || determineUnitForFormatting(me, ticks, timeOpts.minUnit, me.min, me.max);\n\t\tme._majorUnit = determineMajorUnit(me._unit);\n\t\tme._table = buildLookupTable(me._timestamps.data, min, max, options.distribution);\n\t\tme._offsets = computeOffsets(me._table, ticks, min, max, options);\n\n\t\tif (options.ticks.reverse) {\n\t\t\tticks.reverse();\n\t\t}\n\n\t\treturn ticksFromTimestamps(me, ticks, me._majorUnit);\n\t},\n\n\tgetLabelForIndex: function(index, datasetIndex) {\n\t\tvar me = this;\n\t\tvar adapter = me._adapter;\n\t\tvar data = me.chart.data;\n\t\tvar timeOpts = me.options.time;\n\t\tvar label = data.labels && index < data.labels.length ? data.labels[index] : '';\n\t\tvar value = data.datasets[datasetIndex].data[index];\n\n\t\tif (helpers$1.isObject(value)) {\n\t\t\tlabel = me.getRightValue(value);\n\t\t}\n\t\tif (timeOpts.tooltipFormat) {\n\t\t\treturn adapter.format(toTimestamp(me, label), timeOpts.tooltipFormat);\n\t\t}\n\t\tif (typeof label === 'string') {\n\t\t\treturn label;\n\t\t}\n\t\treturn adapter.format(toTimestamp(me, label), timeOpts.displayFormats.datetime);\n\t},\n\n\t/**\n\t * Function to format an individual tick mark\n\t * @private\n\t */\n\ttickFormatFunction: function(time, index, ticks, format) {\n\t\tvar me = this;\n\t\tvar adapter = me._adapter;\n\t\tvar options = me.options;\n\t\tvar formats = options.time.displayFormats;\n\t\tvar minorFormat = formats[me._unit];\n\t\tvar majorUnit = me._majorUnit;\n\t\tvar majorFormat = formats[majorUnit];\n\t\tvar majorTime = +adapter.startOf(time, majorUnit);\n\t\tvar majorTickOpts = options.ticks.major;\n\t\tvar major = majorTickOpts.enabled && majorUnit && majorFormat && time === majorTime;\n\t\tvar label = adapter.format(time, format ? format : major ? majorFormat : minorFormat);\n\t\tvar tickOpts = major ? majorTickOpts : options.ticks.minor;\n\t\tvar formatter = valueOrDefault$c(tickOpts.callback, tickOpts.userCallback);\n\n\t\treturn formatter ? formatter(label, index, ticks) : label;\n\t},\n\n\tconvertTicksToLabels: function(ticks) {\n\t\tvar labels = [];\n\t\tvar i, ilen;\n\n\t\tfor (i = 0, ilen = ticks.length; i < ilen; ++i) {\n\t\t\tlabels.push(this.tickFormatFunction(ticks[i].value, i, ticks));\n\t\t}\n\n\t\treturn labels;\n\t},\n\n\t/**\n\t * @private\n\t */\n\tgetPixelForOffset: function(time) {\n\t\tvar me = this;\n\t\tvar isReverse = me.options.ticks.reverse;\n\t\tvar size = me._horizontal ? me.width : me.height;\n\t\tvar start = me._horizontal ? isReverse ? me.right : me.left : isReverse ? me.bottom : me.top;\n\t\tvar pos = interpolate$1(me._table, 'time', time, 'pos');\n\t\tvar offset = size * (me._offsets.start + pos) / (me._offsets.start + 1 + me._offsets.end);\n\n\t\treturn isReverse ? start - offset : start + offset;\n\t},\n\n\tgetPixelForValue: function(value, index, datasetIndex) {\n\t\tvar me = this;\n\t\tvar time = null;\n\n\t\tif (index !== undefined && datasetIndex !== undefined) {\n\t\t\ttime = me._timestamps.datasets[datasetIndex][index];\n\t\t}\n\n\t\tif (time === null) {\n\t\t\ttime = parse(me, value);\n\t\t}\n\n\t\tif (time !== null) {\n\t\t\treturn me.getPixelForOffset(time);\n\t\t}\n\t},\n\n\tgetPixelForTick: function(index) {\n\t\tvar ticks = this.getTicks();\n\t\treturn index >= 0 && index < ticks.length ?\n\t\t\tthis.getPixelForOffset(ticks[index].value) :\n\t\t\tnull;\n\t},\n\n\tgetValueForPixel: function(pixel) {\n\t\tvar me = this;\n\t\tvar size = me._horizontal ? me.width : me.height;\n\t\tvar start = me._horizontal ? me.left : me.top;\n\t\tvar pos = (size ? (pixel - start) / size : 0) * (me._offsets.start + 1 + me._offsets.start) - me._offsets.end;\n\t\tvar time = interpolate$1(me._table, 'pos', pos, 'time');\n\n\t\t// DEPRECATION, we should return time directly\n\t\treturn me._adapter._create(time);\n\t},\n\n\t/**\n\t * Crude approximation of what the label width might be\n\t * @private\n\t */\n\tgetLabelWidth: function(label) {\n\t\tvar me = this;\n\t\tvar ticksOpts = me.options.ticks;\n\t\tvar tickLabelWidth = me.ctx.measureText(label).width;\n\t\tvar angle = helpers$1.toRadians(ticksOpts.maxRotation);\n\t\tvar cosRotation = Math.cos(angle);\n\t\tvar sinRotation = Math.sin(angle);\n\t\tvar tickFontSize = valueOrDefault$c(ticksOpts.fontSize, core_defaults.global.defaultFontSize);\n\n\t\treturn (tickLabelWidth * cosRotation) + (tickFontSize * sinRotation);\n\t},\n\n\t/**\n\t * @private\n\t */\n\tgetLabelCapacity: function(exampleTime) {\n\t\tvar me = this;\n\n\t\t// pick the longest format (milliseconds) for guestimation\n\t\tvar format = me.options.time.displayFormats.millisecond;\n\t\tvar exampleLabel = me.tickFormatFunction(exampleTime, 0, [], format);\n\t\tvar tickLabelWidth = me.getLabelWidth(exampleLabel);\n\t\tvar innerWidth = me.isHorizontal() ? me.width : me.height;\n\t\tvar capacity = Math.floor(innerWidth / tickLabelWidth);\n\n\t\treturn capacity > 0 ? capacity : 1;\n\t}\n});\n\n// INTERNAL: static default options, registered in src/index.js\nvar _defaults$4 = defaultConfig$4;\nscale_time._defaults = _defaults$4;\n\nvar scales = {\n\tcategory: scale_category,\n\tlinear: scale_linear,\n\tlogarithmic: scale_logarithmic,\n\tradialLinear: scale_radialLinear,\n\ttime: scale_time\n};\n\nvar FORMATS = {\n\tdatetime: 'MMM D, YYYY, h:mm:ss a',\n\tmillisecond: 'h:mm:ss.SSS a',\n\tsecond: 'h:mm:ss a',\n\tminute: 'h:mm a',\n\thour: 'hA',\n\tday: 'MMM D',\n\tweek: 'll',\n\tmonth: 'MMM YYYY',\n\tquarter: '[Q]Q - YYYY',\n\tyear: 'YYYY'\n};\n\ncore_adapters._date.override(typeof moment === 'function' ? {\n\t_id: 'moment', // DEBUG ONLY\n\n\tformats: function() {\n\t\treturn FORMATS;\n\t},\n\n\tparse: function(value, format) {\n\t\tif (typeof value === 'string' && typeof format === 'string') {\n\t\t\tvalue = moment(value, format);\n\t\t} else if (!(value instanceof moment)) {\n\t\t\tvalue = moment(value);\n\t\t}\n\t\treturn value.isValid() ? value.valueOf() : null;\n\t},\n\n\tformat: function(time, format) {\n\t\treturn moment(time).format(format);\n\t},\n\n\tadd: function(time, amount, unit) {\n\t\treturn moment(time).add(amount, unit).valueOf();\n\t},\n\n\tdiff: function(max, min, unit) {\n\t\treturn moment.duration(moment(max).diff(moment(min))).as(unit);\n\t},\n\n\tstartOf: function(time, unit, weekday) {\n\t\ttime = moment(time);\n\t\tif (unit === 'isoWeek') {\n\t\t\treturn time.isoWeekday(weekday).valueOf();\n\t\t}\n\t\treturn time.startOf(unit).valueOf();\n\t},\n\n\tendOf: function(time, unit) {\n\t\treturn moment(time).endOf(unit).valueOf();\n\t},\n\n\t// DEPRECATIONS\n\n\t/**\n\t * Provided for backward compatibility with scale.getValueForPixel().\n\t * @deprecated since version 2.8.0\n\t * @todo remove at version 3\n\t * @private\n\t */\n\t_create: function(time) {\n\t\treturn moment(time);\n\t},\n} : {});\n\ncore_defaults._set('global', {\n\tplugins: {\n\t\tfiller: {\n\t\t\tpropagate: true\n\t\t}\n\t}\n});\n\nvar mappers = {\n\tdataset: function(source) {\n\t\tvar index = source.fill;\n\t\tvar chart = source.chart;\n\t\tvar meta = chart.getDatasetMeta(index);\n\t\tvar visible = meta && chart.isDatasetVisible(index);\n\t\tvar points = (visible && meta.dataset._children) || [];\n\t\tvar length = points.length || 0;\n\n\t\treturn !length ? null : function(point, i) {\n\t\t\treturn (i < length && points[i]._view) || null;\n\t\t};\n\t},\n\n\tboundary: function(source) {\n\t\tvar boundary = source.boundary;\n\t\tvar x = boundary ? boundary.x : null;\n\t\tvar y = boundary ? boundary.y : null;\n\n\t\treturn function(point) {\n\t\t\treturn {\n\t\t\t\tx: x === null ? point.x : x,\n\t\t\t\ty: y === null ? point.y : y,\n\t\t\t};\n\t\t};\n\t}\n};\n\n// @todo if (fill[0] === '#')\nfunction decodeFill(el, index, count) {\n\tvar model = el._model || {};\n\tvar fill = model.fill;\n\tvar target;\n\n\tif (fill === undefined) {\n\t\tfill = !!model.backgroundColor;\n\t}\n\n\tif (fill === false || fill === null) {\n\t\treturn false;\n\t}\n\n\tif (fill === true) {\n\t\treturn 'origin';\n\t}\n\n\ttarget = parseFloat(fill, 10);\n\tif (isFinite(target) && Math.floor(target) === target) {\n\t\tif (fill[0] === '-' || fill[0] === '+') {\n\t\t\ttarget = index + target;\n\t\t}\n\n\t\tif (target === index || target < 0 || target >= count) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn target;\n\t}\n\n\tswitch (fill) {\n\t// compatibility\n\tcase 'bottom':\n\t\treturn 'start';\n\tcase 'top':\n\t\treturn 'end';\n\tcase 'zero':\n\t\treturn 'origin';\n\t// supported boundaries\n\tcase 'origin':\n\tcase 'start':\n\tcase 'end':\n\t\treturn fill;\n\t// invalid fill values\n\tdefault:\n\t\treturn false;\n\t}\n}\n\nfunction computeBoundary(source) {\n\tvar model = source.el._model || {};\n\tvar scale = source.el._scale || {};\n\tvar fill = source.fill;\n\tvar target = null;\n\tvar horizontal;\n\n\tif (isFinite(fill)) {\n\t\treturn null;\n\t}\n\n\t// Backward compatibility: until v3, we still need to support boundary values set on\n\t// the model (scaleTop, scaleBottom and scaleZero) because some external plugins and\n\t// controllers might still use it (e.g. the Smith chart).\n\n\tif (fill === 'start') {\n\t\ttarget = model.scaleBottom === undefined ? scale.bottom : model.scaleBottom;\n\t} else if (fill === 'end') {\n\t\ttarget = model.scaleTop === undefined ? scale.top : model.scaleTop;\n\t} else if (model.scaleZero !== undefined) {\n\t\ttarget = model.scaleZero;\n\t} else if (scale.getBasePosition) {\n\t\ttarget = scale.getBasePosition();\n\t} else if (scale.getBasePixel) {\n\t\ttarget = scale.getBasePixel();\n\t}\n\n\tif (target !== undefined && target !== null) {\n\t\tif (target.x !== undefined && target.y !== undefined) {\n\t\t\treturn target;\n\t\t}\n\n\t\tif (helpers$1.isFinite(target)) {\n\t\t\thorizontal = scale.isHorizontal();\n\t\t\treturn {\n\t\t\t\tx: horizontal ? target : null,\n\t\t\t\ty: horizontal ? null : target\n\t\t\t};\n\t\t}\n\t}\n\n\treturn null;\n}\n\nfunction resolveTarget(sources, index, propagate) {\n\tvar source = sources[index];\n\tvar fill = source.fill;\n\tvar visited = [index];\n\tvar target;\n\n\tif (!propagate) {\n\t\treturn fill;\n\t}\n\n\twhile (fill !== false && visited.indexOf(fill) === -1) {\n\t\tif (!isFinite(fill)) {\n\t\t\treturn fill;\n\t\t}\n\n\t\ttarget = sources[fill];\n\t\tif (!target) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (target.visible) {\n\t\t\treturn fill;\n\t\t}\n\n\t\tvisited.push(fill);\n\t\tfill = target.fill;\n\t}\n\n\treturn false;\n}\n\nfunction createMapper(source) {\n\tvar fill = source.fill;\n\tvar type = 'dataset';\n\n\tif (fill === false) {\n\t\treturn null;\n\t}\n\n\tif (!isFinite(fill)) {\n\t\ttype = 'boundary';\n\t}\n\n\treturn mappers[type](source);\n}\n\nfunction isDrawable(point) {\n\treturn point && !point.skip;\n}\n\nfunction drawArea(ctx, curve0, curve1, len0, len1) {\n\tvar i;\n\n\tif (!len0 || !len1) {\n\t\treturn;\n\t}\n\n\t// building first area curve (normal)\n\tctx.moveTo(curve0[0].x, curve0[0].y);\n\tfor (i = 1; i < len0; ++i) {\n\t\thelpers$1.canvas.lineTo(ctx, curve0[i - 1], curve0[i]);\n\t}\n\n\t// joining the two area curves\n\tctx.lineTo(curve1[len1 - 1].x, curve1[len1 - 1].y);\n\n\t// building opposite area curve (reverse)\n\tfor (i = len1 - 1; i > 0; --i) {\n\t\thelpers$1.canvas.lineTo(ctx, curve1[i], curve1[i - 1], true);\n\t}\n}\n\nfunction doFill(ctx, points, mapper, view, color, loop) {\n\tvar count = points.length;\n\tvar span = view.spanGaps;\n\tvar curve0 = [];\n\tvar curve1 = [];\n\tvar len0 = 0;\n\tvar len1 = 0;\n\tvar i, ilen, index, p0, p1, d0, d1;\n\n\tctx.beginPath();\n\n\tfor (i = 0, ilen = (count + !!loop); i < ilen; ++i) {\n\t\tindex = i % count;\n\t\tp0 = points[index]._view;\n\t\tp1 = mapper(p0, index, view);\n\t\td0 = isDrawable(p0);\n\t\td1 = isDrawable(p1);\n\n\t\tif (d0 && d1) {\n\t\t\tlen0 = curve0.push(p0);\n\t\t\tlen1 = curve1.push(p1);\n\t\t} else if (len0 && len1) {\n\t\t\tif (!span) {\n\t\t\t\tdrawArea(ctx, curve0, curve1, len0, len1);\n\t\t\t\tlen0 = len1 = 0;\n\t\t\t\tcurve0 = [];\n\t\t\t\tcurve1 = [];\n\t\t\t} else {\n\t\t\t\tif (d0) {\n\t\t\t\t\tcurve0.push(p0);\n\t\t\t\t}\n\t\t\t\tif (d1) {\n\t\t\t\t\tcurve1.push(p1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tdrawArea(ctx, curve0, curve1, len0, len1);\n\n\tctx.closePath();\n\tctx.fillStyle = color;\n\tctx.fill();\n}\n\nvar plugin_filler = {\n\tid: 'filler',\n\n\tafterDatasetsUpdate: function(chart, options) {\n\t\tvar count = (chart.data.datasets || []).length;\n\t\tvar propagate = options.propagate;\n\t\tvar sources = [];\n\t\tvar meta, i, el, source;\n\n\t\tfor (i = 0; i < count; ++i) {\n\t\t\tmeta = chart.getDatasetMeta(i);\n\t\t\tel = meta.dataset;\n\t\t\tsource = null;\n\n\t\t\tif (el && el._model && el instanceof elements.Line) {\n\t\t\t\tsource = {\n\t\t\t\t\tvisible: chart.isDatasetVisible(i),\n\t\t\t\t\tfill: decodeFill(el, i, count),\n\t\t\t\t\tchart: chart,\n\t\t\t\t\tel: el\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tmeta.$filler = source;\n\t\t\tsources.push(source);\n\t\t}\n\n\t\tfor (i = 0; i < count; ++i) {\n\t\t\tsource = sources[i];\n\t\t\tif (!source) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tsource.fill = resolveTarget(sources, i, propagate);\n\t\t\tsource.boundary = computeBoundary(source);\n\t\t\tsource.mapper = createMapper(source);\n\t\t}\n\t},\n\n\tbeforeDatasetDraw: function(chart, args) {\n\t\tvar meta = args.meta.$filler;\n\t\tif (!meta) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar ctx = chart.ctx;\n\t\tvar el = meta.el;\n\t\tvar view = el._view;\n\t\tvar points = el._children || [];\n\t\tvar mapper = meta.mapper;\n\t\tvar color = view.backgroundColor || core_defaults.global.defaultColor;\n\n\t\tif (mapper && color && points.length) {\n\t\t\thelpers$1.canvas.clipArea(ctx, chart.chartArea);\n\t\t\tdoFill(ctx, points, mapper, view, color, el._loop);\n\t\t\thelpers$1.canvas.unclipArea(ctx);\n\t\t}\n\t}\n};\n\nvar noop$1 = helpers$1.noop;\nvar valueOrDefault$d = helpers$1.valueOrDefault;\n\ncore_defaults._set('global', {\n\tlegend: {\n\t\tdisplay: true,\n\t\tposition: 'top',\n\t\tfullWidth: true,\n\t\treverse: false,\n\t\tweight: 1000,\n\n\t\t// a callback that will handle\n\t\tonClick: function(e, legendItem) {\n\t\t\tvar index = legendItem.datasetIndex;\n\t\t\tvar ci = this.chart;\n\t\t\tvar meta = ci.getDatasetMeta(index);\n\n\t\t\t// See controller.isDatasetVisible comment\n\t\t\tmeta.hidden = meta.hidden === null ? !ci.data.datasets[index].hidden : null;\n\n\t\t\t// We hid a dataset ... rerender the chart\n\t\t\tci.update();\n\t\t},\n\n\t\tonHover: null,\n\t\tonLeave: null,\n\n\t\tlabels: {\n\t\t\tboxWidth: 40,\n\t\t\tpadding: 10,\n\t\t\t// Generates labels shown in the legend\n\t\t\t// Valid properties to return:\n\t\t\t// text : text to display\n\t\t\t// fillStyle : fill of coloured box\n\t\t\t// strokeStyle: stroke of coloured box\n\t\t\t// hidden : if this legend item refers to a hidden item\n\t\t\t// lineCap : cap style for line\n\t\t\t// lineDash\n\t\t\t// lineDashOffset :\n\t\t\t// lineJoin :\n\t\t\t// lineWidth :\n\t\t\tgenerateLabels: function(chart) {\n\t\t\t\tvar data = chart.data;\n\t\t\t\treturn helpers$1.isArray(data.datasets) ? data.datasets.map(function(dataset, i) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\ttext: dataset.label,\n\t\t\t\t\t\tfillStyle: (!helpers$1.isArray(dataset.backgroundColor) ? dataset.backgroundColor : dataset.backgroundColor[0]),\n\t\t\t\t\t\thidden: !chart.isDatasetVisible(i),\n\t\t\t\t\t\tlineCap: dataset.borderCapStyle,\n\t\t\t\t\t\tlineDash: dataset.borderDash,\n\t\t\t\t\t\tlineDashOffset: dataset.borderDashOffset,\n\t\t\t\t\t\tlineJoin: dataset.borderJoinStyle,\n\t\t\t\t\t\tlineWidth: dataset.borderWidth,\n\t\t\t\t\t\tstrokeStyle: dataset.borderColor,\n\t\t\t\t\t\tpointStyle: dataset.pointStyle,\n\n\t\t\t\t\t\t// Below is extra data used for toggling the datasets\n\t\t\t\t\t\tdatasetIndex: i\n\t\t\t\t\t};\n\t\t\t\t}, this) : [];\n\t\t\t}\n\t\t}\n\t},\n\n\tlegendCallback: function(chart) {\n\t\tvar text = [];\n\t\ttext.push('');\n\t\treturn text.join('');\n\t}\n});\n\n/**\n * Helper function to get the box width based on the usePointStyle option\n * @param {object} labelopts - the label options on the legend\n * @param {number} fontSize - the label font size\n * @return {number} width of the color box area\n */\nfunction getBoxWidth(labelOpts, fontSize) {\n\treturn labelOpts.usePointStyle && labelOpts.boxWidth > fontSize ?\n\t\tfontSize :\n\t\tlabelOpts.boxWidth;\n}\n\n/**\n * IMPORTANT: this class is exposed publicly as Chart.Legend, backward compatibility required!\n */\nvar Legend = core_element.extend({\n\n\tinitialize: function(config) {\n\t\thelpers$1.extend(this, config);\n\n\t\t// Contains hit boxes for each dataset (in dataset order)\n\t\tthis.legendHitBoxes = [];\n\n\t\t/**\n \t\t * @private\n \t\t */\n\t\tthis._hoveredItem = null;\n\n\t\t// Are we in doughnut mode which has a different data type\n\t\tthis.doughnutMode = false;\n\t},\n\n\t// These methods are ordered by lifecycle. Utilities then follow.\n\t// Any function defined here is inherited by all legend types.\n\t// Any function can be extended by the legend type\n\n\tbeforeUpdate: noop$1,\n\tupdate: function(maxWidth, maxHeight, margins) {\n\t\tvar me = this;\n\n\t\t// Update Lifecycle - Probably don't want to ever extend or overwrite this function ;)\n\t\tme.beforeUpdate();\n\n\t\t// Absorb the master measurements\n\t\tme.maxWidth = maxWidth;\n\t\tme.maxHeight = maxHeight;\n\t\tme.margins = margins;\n\n\t\t// Dimensions\n\t\tme.beforeSetDimensions();\n\t\tme.setDimensions();\n\t\tme.afterSetDimensions();\n\t\t// Labels\n\t\tme.beforeBuildLabels();\n\t\tme.buildLabels();\n\t\tme.afterBuildLabels();\n\n\t\t// Fit\n\t\tme.beforeFit();\n\t\tme.fit();\n\t\tme.afterFit();\n\t\t//\n\t\tme.afterUpdate();\n\n\t\treturn me.minSize;\n\t},\n\tafterUpdate: noop$1,\n\n\t//\n\n\tbeforeSetDimensions: noop$1,\n\tsetDimensions: function() {\n\t\tvar me = this;\n\t\t// Set the unconstrained dimension before label rotation\n\t\tif (me.isHorizontal()) {\n\t\t\t// Reset position before calculating rotation\n\t\t\tme.width = me.maxWidth;\n\t\t\tme.left = 0;\n\t\t\tme.right = me.width;\n\t\t} else {\n\t\t\tme.height = me.maxHeight;\n\n\t\t\t// Reset position before calculating rotation\n\t\t\tme.top = 0;\n\t\t\tme.bottom = me.height;\n\t\t}\n\n\t\t// Reset padding\n\t\tme.paddingLeft = 0;\n\t\tme.paddingTop = 0;\n\t\tme.paddingRight = 0;\n\t\tme.paddingBottom = 0;\n\n\t\t// Reset minSize\n\t\tme.minSize = {\n\t\t\twidth: 0,\n\t\t\theight: 0\n\t\t};\n\t},\n\tafterSetDimensions: noop$1,\n\n\t//\n\n\tbeforeBuildLabels: noop$1,\n\tbuildLabels: function() {\n\t\tvar me = this;\n\t\tvar labelOpts = me.options.labels || {};\n\t\tvar legendItems = helpers$1.callback(labelOpts.generateLabels, [me.chart], me) || [];\n\n\t\tif (labelOpts.filter) {\n\t\t\tlegendItems = legendItems.filter(function(item) {\n\t\t\t\treturn labelOpts.filter(item, me.chart.data);\n\t\t\t});\n\t\t}\n\n\t\tif (me.options.reverse) {\n\t\t\tlegendItems.reverse();\n\t\t}\n\n\t\tme.legendItems = legendItems;\n\t},\n\tafterBuildLabels: noop$1,\n\n\t//\n\n\tbeforeFit: noop$1,\n\tfit: function() {\n\t\tvar me = this;\n\t\tvar opts = me.options;\n\t\tvar labelOpts = opts.labels;\n\t\tvar display = opts.display;\n\n\t\tvar ctx = me.ctx;\n\n\t\tvar labelFont = helpers$1.options._parseFont(labelOpts);\n\t\tvar fontSize = labelFont.size;\n\n\t\t// Reset hit boxes\n\t\tvar hitboxes = me.legendHitBoxes = [];\n\n\t\tvar minSize = me.minSize;\n\t\tvar isHorizontal = me.isHorizontal();\n\n\t\tif (isHorizontal) {\n\t\t\tminSize.width = me.maxWidth; // fill all the width\n\t\t\tminSize.height = display ? 10 : 0;\n\t\t} else {\n\t\t\tminSize.width = display ? 10 : 0;\n\t\t\tminSize.height = me.maxHeight; // fill all the height\n\t\t}\n\n\t\t// Increase sizes here\n\t\tif (display) {\n\t\t\tctx.font = labelFont.string;\n\n\t\t\tif (isHorizontal) {\n\t\t\t\t// Labels\n\n\t\t\t\t// Width of each line of legend boxes. Labels wrap onto multiple lines when there are too many to fit on one\n\t\t\t\tvar lineWidths = me.lineWidths = [0];\n\t\t\t\tvar totalHeight = 0;\n\n\t\t\t\tctx.textAlign = 'left';\n\t\t\t\tctx.textBaseline = 'top';\n\n\t\t\t\thelpers$1.each(me.legendItems, function(legendItem, i) {\n\t\t\t\t\tvar boxWidth = getBoxWidth(labelOpts, fontSize);\n\t\t\t\t\tvar width = boxWidth + (fontSize / 2) + ctx.measureText(legendItem.text).width;\n\n\t\t\t\t\tif (i === 0 || lineWidths[lineWidths.length - 1] + width + labelOpts.padding > minSize.width) {\n\t\t\t\t\t\ttotalHeight += fontSize + labelOpts.padding;\n\t\t\t\t\t\tlineWidths[lineWidths.length - (i > 0 ? 0 : 1)] = labelOpts.padding;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Store the hitbox width and height here. Final position will be updated in `draw`\n\t\t\t\t\thitboxes[i] = {\n\t\t\t\t\t\tleft: 0,\n\t\t\t\t\t\ttop: 0,\n\t\t\t\t\t\twidth: width,\n\t\t\t\t\t\theight: fontSize\n\t\t\t\t\t};\n\n\t\t\t\t\tlineWidths[lineWidths.length - 1] += width + labelOpts.padding;\n\t\t\t\t});\n\n\t\t\t\tminSize.height += totalHeight;\n\n\t\t\t} else {\n\t\t\t\tvar vPadding = labelOpts.padding;\n\t\t\t\tvar columnWidths = me.columnWidths = [];\n\t\t\t\tvar totalWidth = labelOpts.padding;\n\t\t\t\tvar currentColWidth = 0;\n\t\t\t\tvar currentColHeight = 0;\n\t\t\t\tvar itemHeight = fontSize + vPadding;\n\n\t\t\t\thelpers$1.each(me.legendItems, function(legendItem, i) {\n\t\t\t\t\tvar boxWidth = getBoxWidth(labelOpts, fontSize);\n\t\t\t\t\tvar itemWidth = boxWidth + (fontSize / 2) + ctx.measureText(legendItem.text).width;\n\n\t\t\t\t\t// If too tall, go to new column\n\t\t\t\t\tif (i > 0 && currentColHeight + itemHeight > minSize.height - vPadding) {\n\t\t\t\t\t\ttotalWidth += currentColWidth + labelOpts.padding;\n\t\t\t\t\t\tcolumnWidths.push(currentColWidth); // previous column width\n\n\t\t\t\t\t\tcurrentColWidth = 0;\n\t\t\t\t\t\tcurrentColHeight = 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Get max width\n\t\t\t\t\tcurrentColWidth = Math.max(currentColWidth, itemWidth);\n\t\t\t\t\tcurrentColHeight += itemHeight;\n\n\t\t\t\t\t// Store the hitbox width and height here. Final position will be updated in `draw`\n\t\t\t\t\thitboxes[i] = {\n\t\t\t\t\t\tleft: 0,\n\t\t\t\t\t\ttop: 0,\n\t\t\t\t\t\twidth: itemWidth,\n\t\t\t\t\t\theight: fontSize\n\t\t\t\t\t};\n\t\t\t\t});\n\n\t\t\t\ttotalWidth += currentColWidth;\n\t\t\t\tcolumnWidths.push(currentColWidth);\n\t\t\t\tminSize.width += totalWidth;\n\t\t\t}\n\t\t}\n\n\t\tme.width = minSize.width;\n\t\tme.height = minSize.height;\n\t},\n\tafterFit: noop$1,\n\n\t// Shared Methods\n\tisHorizontal: function() {\n\t\treturn this.options.position === 'top' || this.options.position === 'bottom';\n\t},\n\n\t// Actually draw the legend on the canvas\n\tdraw: function() {\n\t\tvar me = this;\n\t\tvar opts = me.options;\n\t\tvar labelOpts = opts.labels;\n\t\tvar globalDefaults = core_defaults.global;\n\t\tvar defaultColor = globalDefaults.defaultColor;\n\t\tvar lineDefault = globalDefaults.elements.line;\n\t\tvar legendWidth = me.width;\n\t\tvar lineWidths = me.lineWidths;\n\n\t\tif (opts.display) {\n\t\t\tvar ctx = me.ctx;\n\t\t\tvar fontColor = valueOrDefault$d(labelOpts.fontColor, globalDefaults.defaultFontColor);\n\t\t\tvar labelFont = helpers$1.options._parseFont(labelOpts);\n\t\t\tvar fontSize = labelFont.size;\n\t\t\tvar cursor;\n\n\t\t\t// Canvas setup\n\t\t\tctx.textAlign = 'left';\n\t\t\tctx.textBaseline = 'middle';\n\t\t\tctx.lineWidth = 0.5;\n\t\t\tctx.strokeStyle = fontColor; // for strikethrough effect\n\t\t\tctx.fillStyle = fontColor; // render in correct colour\n\t\t\tctx.font = labelFont.string;\n\n\t\t\tvar boxWidth = getBoxWidth(labelOpts, fontSize);\n\t\t\tvar hitboxes = me.legendHitBoxes;\n\n\t\t\t// current position\n\t\t\tvar drawLegendBox = function(x, y, legendItem) {\n\t\t\t\tif (isNaN(boxWidth) || boxWidth <= 0) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Set the ctx for the box\n\t\t\t\tctx.save();\n\n\t\t\t\tvar lineWidth = valueOrDefault$d(legendItem.lineWidth, lineDefault.borderWidth);\n\t\t\t\tctx.fillStyle = valueOrDefault$d(legendItem.fillStyle, defaultColor);\n\t\t\t\tctx.lineCap = valueOrDefault$d(legendItem.lineCap, lineDefault.borderCapStyle);\n\t\t\t\tctx.lineDashOffset = valueOrDefault$d(legendItem.lineDashOffset, lineDefault.borderDashOffset);\n\t\t\t\tctx.lineJoin = valueOrDefault$d(legendItem.lineJoin, lineDefault.borderJoinStyle);\n\t\t\t\tctx.lineWidth = lineWidth;\n\t\t\t\tctx.strokeStyle = valueOrDefault$d(legendItem.strokeStyle, defaultColor);\n\n\t\t\t\tif (ctx.setLineDash) {\n\t\t\t\t\t// IE 9 and 10 do not support line dash\n\t\t\t\t\tctx.setLineDash(valueOrDefault$d(legendItem.lineDash, lineDefault.borderDash));\n\t\t\t\t}\n\n\t\t\t\tif (opts.labels && opts.labels.usePointStyle) {\n\t\t\t\t\t// Recalculate x and y for drawPoint() because its expecting\n\t\t\t\t\t// x and y to be center of figure (instead of top left)\n\t\t\t\t\tvar radius = boxWidth * Math.SQRT2 / 2;\n\t\t\t\t\tvar centerX = x + boxWidth / 2;\n\t\t\t\t\tvar centerY = y + fontSize / 2;\n\n\t\t\t\t\t// Draw pointStyle as legend symbol\n\t\t\t\t\thelpers$1.canvas.drawPoint(ctx, legendItem.pointStyle, radius, centerX, centerY);\n\t\t\t\t} else {\n\t\t\t\t\t// Draw box as legend symbol\n\t\t\t\t\tif (lineWidth !== 0) {\n\t\t\t\t\t\tctx.strokeRect(x, y, boxWidth, fontSize);\n\t\t\t\t\t}\n\t\t\t\t\tctx.fillRect(x, y, boxWidth, fontSize);\n\t\t\t\t}\n\n\t\t\t\tctx.restore();\n\t\t\t};\n\t\t\tvar fillText = function(x, y, legendItem, textWidth) {\n\t\t\t\tvar halfFontSize = fontSize / 2;\n\t\t\t\tvar xLeft = boxWidth + halfFontSize + x;\n\t\t\t\tvar yMiddle = y + halfFontSize;\n\n\t\t\t\tctx.fillText(legendItem.text, xLeft, yMiddle);\n\n\t\t\t\tif (legendItem.hidden) {\n\t\t\t\t\t// Strikethrough the text if hidden\n\t\t\t\t\tctx.beginPath();\n\t\t\t\t\tctx.lineWidth = 2;\n\t\t\t\t\tctx.moveTo(xLeft, yMiddle);\n\t\t\t\t\tctx.lineTo(xLeft + textWidth, yMiddle);\n\t\t\t\t\tctx.stroke();\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t// Horizontal\n\t\t\tvar isHorizontal = me.isHorizontal();\n\t\t\tif (isHorizontal) {\n\t\t\t\tcursor = {\n\t\t\t\t\tx: me.left + ((legendWidth - lineWidths[0]) / 2) + labelOpts.padding,\n\t\t\t\t\ty: me.top + labelOpts.padding,\n\t\t\t\t\tline: 0\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\tcursor = {\n\t\t\t\t\tx: me.left + labelOpts.padding,\n\t\t\t\t\ty: me.top + labelOpts.padding,\n\t\t\t\t\tline: 0\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tvar itemHeight = fontSize + labelOpts.padding;\n\t\t\thelpers$1.each(me.legendItems, function(legendItem, i) {\n\t\t\t\tvar textWidth = ctx.measureText(legendItem.text).width;\n\t\t\t\tvar width = boxWidth + (fontSize / 2) + textWidth;\n\t\t\t\tvar x = cursor.x;\n\t\t\t\tvar y = cursor.y;\n\n\t\t\t\t// Use (me.left + me.minSize.width) and (me.top + me.minSize.height)\n\t\t\t\t// instead of me.right and me.bottom because me.width and me.height\n\t\t\t\t// may have been changed since me.minSize was calculated\n\t\t\t\tif (isHorizontal) {\n\t\t\t\t\tif (i > 0 && x + width + labelOpts.padding > me.left + me.minSize.width) {\n\t\t\t\t\t\ty = cursor.y += itemHeight;\n\t\t\t\t\t\tcursor.line++;\n\t\t\t\t\t\tx = cursor.x = me.left + ((legendWidth - lineWidths[cursor.line]) / 2) + labelOpts.padding;\n\t\t\t\t\t}\n\t\t\t\t} else if (i > 0 && y + itemHeight > me.top + me.minSize.height) {\n\t\t\t\t\tx = cursor.x = x + me.columnWidths[cursor.line] + labelOpts.padding;\n\t\t\t\t\ty = cursor.y = me.top + labelOpts.padding;\n\t\t\t\t\tcursor.line++;\n\t\t\t\t}\n\n\t\t\t\tdrawLegendBox(x, y, legendItem);\n\n\t\t\t\thitboxes[i].left = x;\n\t\t\t\thitboxes[i].top = y;\n\n\t\t\t\t// Fill the actual label\n\t\t\t\tfillText(x, y, legendItem, textWidth);\n\n\t\t\t\tif (isHorizontal) {\n\t\t\t\t\tcursor.x += width + labelOpts.padding;\n\t\t\t\t} else {\n\t\t\t\t\tcursor.y += itemHeight;\n\t\t\t\t}\n\n\t\t\t});\n\t\t}\n\t},\n\n\t/**\n\t * @private\n\t */\n\t_getLegendItemAt: function(x, y) {\n\t\tvar me = this;\n\t\tvar i, hitBox, lh;\n\n\t\tif (x >= me.left && x <= me.right && y >= me.top && y <= me.bottom) {\n\t\t\t// See if we are touching one of the dataset boxes\n\t\t\tlh = me.legendHitBoxes;\n\t\t\tfor (i = 0; i < lh.length; ++i) {\n\t\t\t\thitBox = lh[i];\n\n\t\t\t\tif (x >= hitBox.left && x <= hitBox.left + hitBox.width && y >= hitBox.top && y <= hitBox.top + hitBox.height) {\n\t\t\t\t\t// Touching an element\n\t\t\t\t\treturn me.legendItems[i];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t},\n\n\t/**\n\t * Handle an event\n\t * @private\n\t * @param {IEvent} event - The event to handle\n\t */\n\thandleEvent: function(e) {\n\t\tvar me = this;\n\t\tvar opts = me.options;\n\t\tvar type = e.type === 'mouseup' ? 'click' : e.type;\n\t\tvar hoveredItem;\n\n\t\tif (type === 'mousemove') {\n\t\t\tif (!opts.onHover && !opts.onLeave) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t} else if (type === 'click') {\n\t\t\tif (!opts.onClick) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t} else {\n\t\t\treturn;\n\t\t}\n\n\t\t// Chart event already has relative position in it\n\t\thoveredItem = me._getLegendItemAt(e.x, e.y);\n\n\t\tif (type === 'click') {\n\t\t\tif (hoveredItem && opts.onClick) {\n\t\t\t\t// use e.native for backwards compatibility\n\t\t\t\topts.onClick.call(me, e.native, hoveredItem);\n\t\t\t}\n\t\t} else {\n\t\t\tif (opts.onLeave && hoveredItem !== me._hoveredItem) {\n\t\t\t\tif (me._hoveredItem) {\n\t\t\t\t\topts.onLeave.call(me, e.native, me._hoveredItem);\n\t\t\t\t}\n\t\t\t\tme._hoveredItem = hoveredItem;\n\t\t\t}\n\n\t\t\tif (opts.onHover && hoveredItem) {\n\t\t\t\t// use e.native for backwards compatibility\n\t\t\t\topts.onHover.call(me, e.native, hoveredItem);\n\t\t\t}\n\t\t}\n\t}\n});\n\nfunction createNewLegendAndAttach(chart, legendOpts) {\n\tvar legend = new Legend({\n\t\tctx: chart.ctx,\n\t\toptions: legendOpts,\n\t\tchart: chart\n\t});\n\n\tcore_layouts.configure(chart, legend, legendOpts);\n\tcore_layouts.addBox(chart, legend);\n\tchart.legend = legend;\n}\n\nvar plugin_legend = {\n\tid: 'legend',\n\n\t/**\n\t * Backward compatibility: since 2.1.5, the legend is registered as a plugin, making\n\t * Chart.Legend obsolete. To avoid a breaking change, we export the Legend as part of\n\t * the plugin, which one will be re-exposed in the chart.js file.\n\t * https://github.com/chartjs/Chart.js/pull/2640\n\t * @private\n\t */\n\t_element: Legend,\n\n\tbeforeInit: function(chart) {\n\t\tvar legendOpts = chart.options.legend;\n\n\t\tif (legendOpts) {\n\t\t\tcreateNewLegendAndAttach(chart, legendOpts);\n\t\t}\n\t},\n\n\tbeforeUpdate: function(chart) {\n\t\tvar legendOpts = chart.options.legend;\n\t\tvar legend = chart.legend;\n\n\t\tif (legendOpts) {\n\t\t\thelpers$1.mergeIf(legendOpts, core_defaults.global.legend);\n\n\t\t\tif (legend) {\n\t\t\t\tcore_layouts.configure(chart, legend, legendOpts);\n\t\t\t\tlegend.options = legendOpts;\n\t\t\t} else {\n\t\t\t\tcreateNewLegendAndAttach(chart, legendOpts);\n\t\t\t}\n\t\t} else if (legend) {\n\t\t\tcore_layouts.removeBox(chart, legend);\n\t\t\tdelete chart.legend;\n\t\t}\n\t},\n\n\tafterEvent: function(chart, e) {\n\t\tvar legend = chart.legend;\n\t\tif (legend) {\n\t\t\tlegend.handleEvent(e);\n\t\t}\n\t}\n};\n\nvar noop$2 = helpers$1.noop;\n\ncore_defaults._set('global', {\n\ttitle: {\n\t\tdisplay: false,\n\t\tfontStyle: 'bold',\n\t\tfullWidth: true,\n\t\tpadding: 10,\n\t\tposition: 'top',\n\t\ttext: '',\n\t\tweight: 2000 // by default greater than legend (1000) to be above\n\t}\n});\n\n/**\n * IMPORTANT: this class is exposed publicly as Chart.Legend, backward compatibility required!\n */\nvar Title = core_element.extend({\n\tinitialize: function(config) {\n\t\tvar me = this;\n\t\thelpers$1.extend(me, config);\n\n\t\t// Contains hit boxes for each dataset (in dataset order)\n\t\tme.legendHitBoxes = [];\n\t},\n\n\t// These methods are ordered by lifecycle. Utilities then follow.\n\n\tbeforeUpdate: noop$2,\n\tupdate: function(maxWidth, maxHeight, margins) {\n\t\tvar me = this;\n\n\t\t// Update Lifecycle - Probably don't want to ever extend or overwrite this function ;)\n\t\tme.beforeUpdate();\n\n\t\t// Absorb the master measurements\n\t\tme.maxWidth = maxWidth;\n\t\tme.maxHeight = maxHeight;\n\t\tme.margins = margins;\n\n\t\t// Dimensions\n\t\tme.beforeSetDimensions();\n\t\tme.setDimensions();\n\t\tme.afterSetDimensions();\n\t\t// Labels\n\t\tme.beforeBuildLabels();\n\t\tme.buildLabels();\n\t\tme.afterBuildLabels();\n\n\t\t// Fit\n\t\tme.beforeFit();\n\t\tme.fit();\n\t\tme.afterFit();\n\t\t//\n\t\tme.afterUpdate();\n\n\t\treturn me.minSize;\n\n\t},\n\tafterUpdate: noop$2,\n\n\t//\n\n\tbeforeSetDimensions: noop$2,\n\tsetDimensions: function() {\n\t\tvar me = this;\n\t\t// Set the unconstrained dimension before label rotation\n\t\tif (me.isHorizontal()) {\n\t\t\t// Reset position before calculating rotation\n\t\t\tme.width = me.maxWidth;\n\t\t\tme.left = 0;\n\t\t\tme.right = me.width;\n\t\t} else {\n\t\t\tme.height = me.maxHeight;\n\n\t\t\t// Reset position before calculating rotation\n\t\t\tme.top = 0;\n\t\t\tme.bottom = me.height;\n\t\t}\n\n\t\t// Reset padding\n\t\tme.paddingLeft = 0;\n\t\tme.paddingTop = 0;\n\t\tme.paddingRight = 0;\n\t\tme.paddingBottom = 0;\n\n\t\t// Reset minSize\n\t\tme.minSize = {\n\t\t\twidth: 0,\n\t\t\theight: 0\n\t\t};\n\t},\n\tafterSetDimensions: noop$2,\n\n\t//\n\n\tbeforeBuildLabels: noop$2,\n\tbuildLabels: noop$2,\n\tafterBuildLabels: noop$2,\n\n\t//\n\n\tbeforeFit: noop$2,\n\tfit: function() {\n\t\tvar me = this;\n\t\tvar opts = me.options;\n\t\tvar display = opts.display;\n\t\tvar minSize = me.minSize;\n\t\tvar lineCount = helpers$1.isArray(opts.text) ? opts.text.length : 1;\n\t\tvar fontOpts = helpers$1.options._parseFont(opts);\n\t\tvar textSize = display ? (lineCount * fontOpts.lineHeight) + (opts.padding * 2) : 0;\n\n\t\tif (me.isHorizontal()) {\n\t\t\tminSize.width = me.maxWidth; // fill all the width\n\t\t\tminSize.height = textSize;\n\t\t} else {\n\t\t\tminSize.width = textSize;\n\t\t\tminSize.height = me.maxHeight; // fill all the height\n\t\t}\n\n\t\tme.width = minSize.width;\n\t\tme.height = minSize.height;\n\n\t},\n\tafterFit: noop$2,\n\n\t// Shared Methods\n\tisHorizontal: function() {\n\t\tvar pos = this.options.position;\n\t\treturn pos === 'top' || pos === 'bottom';\n\t},\n\n\t// Actually draw the title block on the canvas\n\tdraw: function() {\n\t\tvar me = this;\n\t\tvar ctx = me.ctx;\n\t\tvar opts = me.options;\n\n\t\tif (opts.display) {\n\t\t\tvar fontOpts = helpers$1.options._parseFont(opts);\n\t\t\tvar lineHeight = fontOpts.lineHeight;\n\t\t\tvar offset = lineHeight / 2 + opts.padding;\n\t\t\tvar rotation = 0;\n\t\t\tvar top = me.top;\n\t\t\tvar left = me.left;\n\t\t\tvar bottom = me.bottom;\n\t\t\tvar right = me.right;\n\t\t\tvar maxWidth, titleX, titleY;\n\n\t\t\tctx.fillStyle = helpers$1.valueOrDefault(opts.fontColor, core_defaults.global.defaultFontColor); // render in correct colour\n\t\t\tctx.font = fontOpts.string;\n\n\t\t\t// Horizontal\n\t\t\tif (me.isHorizontal()) {\n\t\t\t\ttitleX = left + ((right - left) / 2); // midpoint of the width\n\t\t\t\ttitleY = top + offset;\n\t\t\t\tmaxWidth = right - left;\n\t\t\t} else {\n\t\t\t\ttitleX = opts.position === 'left' ? left + offset : right - offset;\n\t\t\t\ttitleY = top + ((bottom - top) / 2);\n\t\t\t\tmaxWidth = bottom - top;\n\t\t\t\trotation = Math.PI * (opts.position === 'left' ? -0.5 : 0.5);\n\t\t\t}\n\n\t\t\tctx.save();\n\t\t\tctx.translate(titleX, titleY);\n\t\t\tctx.rotate(rotation);\n\t\t\tctx.textAlign = 'center';\n\t\t\tctx.textBaseline = 'middle';\n\n\t\t\tvar text = opts.text;\n\t\t\tif (helpers$1.isArray(text)) {\n\t\t\t\tvar y = 0;\n\t\t\t\tfor (var i = 0; i < text.length; ++i) {\n\t\t\t\t\tctx.fillText(text[i], 0, y, maxWidth);\n\t\t\t\t\ty += lineHeight;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tctx.fillText(text, 0, 0, maxWidth);\n\t\t\t}\n\n\t\t\tctx.restore();\n\t\t}\n\t}\n});\n\nfunction createNewTitleBlockAndAttach(chart, titleOpts) {\n\tvar title = new Title({\n\t\tctx: chart.ctx,\n\t\toptions: titleOpts,\n\t\tchart: chart\n\t});\n\n\tcore_layouts.configure(chart, title, titleOpts);\n\tcore_layouts.addBox(chart, title);\n\tchart.titleBlock = title;\n}\n\nvar plugin_title = {\n\tid: 'title',\n\n\t/**\n\t * Backward compatibility: since 2.1.5, the title is registered as a plugin, making\n\t * Chart.Title obsolete. To avoid a breaking change, we export the Title as part of\n\t * the plugin, which one will be re-exposed in the chart.js file.\n\t * https://github.com/chartjs/Chart.js/pull/2640\n\t * @private\n\t */\n\t_element: Title,\n\n\tbeforeInit: function(chart) {\n\t\tvar titleOpts = chart.options.title;\n\n\t\tif (titleOpts) {\n\t\t\tcreateNewTitleBlockAndAttach(chart, titleOpts);\n\t\t}\n\t},\n\n\tbeforeUpdate: function(chart) {\n\t\tvar titleOpts = chart.options.title;\n\t\tvar titleBlock = chart.titleBlock;\n\n\t\tif (titleOpts) {\n\t\t\thelpers$1.mergeIf(titleOpts, core_defaults.global.title);\n\n\t\t\tif (titleBlock) {\n\t\t\t\tcore_layouts.configure(chart, titleBlock, titleOpts);\n\t\t\t\ttitleBlock.options = titleOpts;\n\t\t\t} else {\n\t\t\t\tcreateNewTitleBlockAndAttach(chart, titleOpts);\n\t\t\t}\n\t\t} else if (titleBlock) {\n\t\t\tcore_layouts.removeBox(chart, titleBlock);\n\t\t\tdelete chart.titleBlock;\n\t\t}\n\t}\n};\n\nvar plugins = {};\nvar filler = plugin_filler;\nvar legend = plugin_legend;\nvar title = plugin_title;\nplugins.filler = filler;\nplugins.legend = legend;\nplugins.title = title;\n\n/**\n * @namespace Chart\n */\n\n\ncore_controller.helpers = helpers$1;\n\n// @todo dispatch these helpers into appropriated helpers/helpers.* file and write unit tests!\ncore_helpers(core_controller);\n\ncore_controller._adapters = core_adapters;\ncore_controller.Animation = core_animation;\ncore_controller.animationService = core_animations;\ncore_controller.controllers = controllers;\ncore_controller.DatasetController = core_datasetController;\ncore_controller.defaults = core_defaults;\ncore_controller.Element = core_element;\ncore_controller.elements = elements;\ncore_controller.Interaction = core_interaction;\ncore_controller.layouts = core_layouts;\ncore_controller.platform = platform;\ncore_controller.plugins = core_plugins;\ncore_controller.Scale = core_scale;\ncore_controller.scaleService = core_scaleService;\ncore_controller.Ticks = core_ticks;\ncore_controller.Tooltip = core_tooltip;\n\n// Register built-in scales\n\ncore_controller.helpers.each(scales, function(scale, type) {\n\tcore_controller.scaleService.registerScaleType(type, scale, scale._defaults);\n});\n\n// Load to register built-in adapters (as side effects)\n\n\n// Loading built-in plugins\n\nfor (var k in plugins) {\n\tif (plugins.hasOwnProperty(k)) {\n\t\tcore_controller.plugins.register(plugins[k]);\n\t}\n}\n\ncore_controller.platform.initialize();\n\nvar src = core_controller;\nif (typeof window !== 'undefined') {\n\twindow.Chart = core_controller;\n}\n\n// DEPRECATIONS\n\n/**\n * Provided for backward compatibility, not available anymore\n * @namespace Chart.Chart\n * @deprecated since version 2.8.0\n * @todo remove at version 3\n * @private\n */\ncore_controller.Chart = core_controller;\n\n/**\n * Provided for backward compatibility, not available anymore\n * @namespace Chart.Legend\n * @deprecated since version 2.1.5\n * @todo remove at version 3\n * @private\n */\ncore_controller.Legend = plugins.legend._element;\n\n/**\n * Provided for backward compatibility, not available anymore\n * @namespace Chart.Title\n * @deprecated since version 2.1.5\n * @todo remove at version 3\n * @private\n */\ncore_controller.Title = plugins.title._element;\n\n/**\n * Provided for backward compatibility, use Chart.plugins instead\n * @namespace Chart.pluginService\n * @deprecated since version 2.1.5\n * @todo remove at version 3\n * @private\n */\ncore_controller.pluginService = core_controller.plugins;\n\n/**\n * Provided for backward compatibility, inheriting from Chart.PlugingBase has no\n * effect, instead simply create/register plugins via plain JavaScript objects.\n * @interface Chart.PluginBase\n * @deprecated since version 2.5.0\n * @todo remove at version 3\n * @private\n */\ncore_controller.PluginBase = core_controller.Element.extend({});\n\n/**\n * Provided for backward compatibility, use Chart.helpers.canvas instead.\n * @namespace Chart.canvasHelpers\n * @deprecated since version 2.6.0\n * @todo remove at version 3\n * @private\n */\ncore_controller.canvasHelpers = core_controller.helpers.canvas;\n\n/**\n * Provided for backward compatibility, use Chart.layouts instead.\n * @namespace Chart.layoutService\n * @deprecated since version 2.7.3\n * @todo remove at version 3\n * @private\n */\ncore_controller.layoutService = core_controller.layouts;\n\n/**\n * Provided for backward compatibility, not available anymore.\n * @namespace Chart.LinearScaleBase\n * @deprecated since version 2.8\n * @todo remove at version 3\n * @private\n */\ncore_controller.LinearScaleBase = scale_linearbase;\n\n/**\n * Provided for backward compatibility, instead we should create a new Chart\n * by setting the type in the config (`new Chart(id, {type: '{chart-type}'}`).\n * @deprecated since version 2.8.0\n * @todo remove at version 3\n */\ncore_controller.helpers.each(\n\t[\n\t\t'Bar',\n\t\t'Bubble',\n\t\t'Doughnut',\n\t\t'Line',\n\t\t'PolarArea',\n\t\t'Radar',\n\t\t'Scatter'\n\t],\n\tfunction(klass) {\n\t\tcore_controller[klass] = function(ctx, cfg) {\n\t\t\treturn new core_controller(ctx, core_controller.helpers.merge(cfg || {}, {\n\t\t\t\ttype: klass.charAt(0).toLowerCase() + klass.slice(1)\n\t\t\t}));\n\t\t};\n\t}\n);\n\nreturn src;\n\n})));\n"],"sourceRoot":""}