{"version":3,"file":"app/vendors-node_modules_ag-grid-enterprise_dist_ag-grid-enterprise_auto_esm_js.3d007a59.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AAC2lC;AACzjC;;AAElC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,eAAe;AACpC;AACA;AACA;AACA;AACA,oBAAoB,cAAc;AAClC;AACA;AACA;AACA;AACA;AACA,wBAAwB,QAAQ;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0FAA0F;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,QAAQ;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,cAAc;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,iBAAiB,MAA6B;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,kBAAkB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,wDAAwD,2BAA2B;AACnF,wDAAwD,kCAAkC,yBAAyB,iCAAiC;AACpJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,2DAAY;AACpB;AACA;AACA,QAAQ,uDAAI;AACZ;AACA;AACA,CAAC,CAAC,uDAAQ;;AAEV,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,8CAA8C;AAC1F,4CAA4C,mCAAmC;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,4DAAa;AACrB;AACA;AACA,CAAC,CAAC,wDAAS;;AAEX;AACA;;AAEA;AACA;AACA,gBAAgB,0DAAW;AAC3B;AACA;AACA,UAAU;AACV;AACA;;AAEA,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA,iBAAiB,MAA6B;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,uBAAuB,MAAoC;AAC3D,qDAAqD,QAAQ;AAC7D;AACA;AACA;AACA,kBAAkB,MAA+B;AACjD;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,sCAAsC;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,gDAAC;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,qBAAqB;AAClD,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,eAAe,gDAAC;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,kBAAkB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC;AACA,0CAA0C;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,2BAA2B;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,qDAAM;AACxB;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,8BAA8B,0DAAW;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,wCAAwC,0BAA0B;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,qDAAM;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0EAA0E,0DAA0D;AACpI;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kFAAkF,0DAA0D;AAC5I;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,gDAAC;AACxB;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,gDAAC;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,qDAAM;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uEAAuE,gEAAgE;AACvI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAiE,0DAA0D;AAC3H;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA;AACA,iCAAiC;AACjC,iCAAiC;AACjC;AACA;AACA;AACA;AACA,kBAAkB,qDAAM;AACxB;AACA;AACA;AACA;AACA;AACA,kBAAkB,qDAAM;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,MAAM,qDAAM,wCAAwC;AAC9F;AACA,yDAAyD,qCAAqC;AAC9F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,MAAM,qDAAM,sCAAsC;AAC5F;AACA;AACA;AACA;AACA;AACA;AACA,0FAA0F,oBAAoB;AAC9G;AACA;AACA,8GAA8G,mBAAmB;AACjI;AACA;AACA;AACA;AACA,gCAAgC,QAAQ;AACxC;AACA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA;AACA;AACA,wBAAwB,QAAQ;AAChC;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,qGAAqG;AAC5J;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,6BAA6B;AAChF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0EAA0E,0DAA0D;AACpI;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,wCAAwC;AACxC;AACA;AACA,iCAAiC;AACjC;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD,+CAA+C;AACxG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wDAAwD,QAAQ,sIAAsI;AACtM,sDAAsD;AACtD,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,qDAAM;AAC5B;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wDAAwD,QAAQ,uLAAuL;AACvP,sDAAsD;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,YAAY;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,gDAAC;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC;AACzC;AACA,4BAA4B,qBAAqB;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,qBAAqB;AAClE;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,2DAAQ;AAChB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAa;AACrB;AACA;AACA,QAAQ,uDAAI;AACZ;AACA;AACA,CAAC,CAAC,uDAAQ;;AAEV;AACA;;AAEA;AACA;AACA,gBAAgB,0DAAW;AAC3B;AACA;AACA;AACA,QAAQ,8DAAe;AACvB;AACA;;AAEA,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,kCAAkC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,sDAAO;AACjC;AACA;AACA;AACA,SAAS;AACT;AACA,0DAA0D,qCAAqC;AAC/F;AACA,mDAAmD,qDAAM;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wDAAwD,gDAAC;AACzD,0DAA0D,gDAAC;AAC3D,8DAA8D,gDAAC;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,gDAAC;AACT,QAAQ,gDAAC;AACT,QAAQ,gDAAC;AACT;AACA;AACA;AACA;AACA,gDAAgD,gDAAC;AACjD;AACA,sCAAsC,+CAA+C;AACrF,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,sBAAsB,sDAAO;AAC7B;AACA;AACA,qCAAqC,iCAAiC;AACtE;AACA;AACA;AACA,6BAA6B,sDAAsD;AACnF;AACA;AACA,6BAA6B,+EAA+E;AAC5G;AACA;AACA;AACA,QAAQ,gDAAC;AACT,QAAQ,gDAAC;AACT,QAAQ,gDAAC;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,4DAAa;AACrB;AACA;AACA,CAAC,CAAC,wDAAS;;AAEX;AACA;AACA,gCAAgC;AAChC,gCAAgC,2DAAY;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD;AACtD,6DAA6D;AAC7D,6DAA6D;AAC7D,wDAAwD;AACxD,sDAAsD;AACtD,yDAAyD;AACzD,0DAA0D;AAC1D,6DAA6D;AAC7D;AACA;AACA;AACA;AACA;AACA,0CAA0C,8CAA8C;AACxF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA,iBAAiB,MAA6B;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,uBAAuB,MAAoC;AAC3D,qDAAqD,QAAQ;AAC7D;AACA;AACA;AACA,kBAAkB,MAA+B;AACjD;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,qDAAM;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,kEAAmB;AACjD;AACA;AACA;AACA;AACA;AACA,gEAAgE,kDAAkD;AAClH,8DAA8D,+CAA+C;AAC7G,kGAAkG,+CAA+C;AACjJ;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,kDAAkD;AAChG,6CAA6C,gCAAgC;AAC7E,yCAAyC,yEAAyE;AAClH,2CAA2C,8EAA8E;AACzH;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,SAAS;AACT;AACA,8CAA8C,+CAA+C;AAC7F,6CAA6C,6BAA6B;AAC1E,yCAAyC,uGAAuG;AAChJ,2CAA2C,iHAAiH;AAC5J;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,SAAS;AACT;AACA,8CAA8C,kFAAkF;AAChI,6CAA6C,6BAA6B;AAC1E,yCAAyC,uGAAuG;AAChJ,2CAA2C,iHAAiH;AAC5J;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,SAAS;AACT;AACA;AACA,sGAAsG,wCAAwC;AAC9I;AACA;AACA;AACA,kDAAkD,2CAA2C;AAC7F;AACA;AACA;AACA;AACA,2CAA2C,yDAAU;AACrD;AACA;AACA;AACA;AACA;AACA,8CAA8C,kEAAmB;AACjE;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,4CAA4C,yDAAyD;AACrG;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kEAAkE,8DAA8D;AAChI,gEAAgE,6DAA6D;AAC7H;AACA;AACA;AACA,0BAA0B,gDAAC;AAC3B,0CAA0C;AAC1C,iBAAiB;AACjB;AACA;AACA;AACA;AACA,0BAA0B,gDAAC;AAC3B,0CAA0C;AAC1C,iBAAiB;AACjB;AACA;AACA;AACA;AACA,iFAAiF,UAAU;AAC3F;AACA;AACA;AACA;AACA,wBAAwB,QAAQ;AAChC;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAa;AACrB;AACA;AACA,CAAC,CAAC,wDAAS;;AAEX,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,gDAAC;AAC5B;AACA;AACA;AACA;AACA;AACA,YAAY,gDAAC;AACb;AACA;AACA;AACA;AACA;AACA,mDAAmD,qDAAM;AACzD;AACA,+CAA+C,yDAAU;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,8DAAe;AACrC,uCAAuC,4CAA4C;AACnF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,qDAAM;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,sDAAO;AACxB;AACA;AACA;AACA,iBAAiB,sDAAO;AACxB;AACA;AACA;AACA,iBAAiB,sDAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,6CAA6C,qDAAM;AACnD,6CAA6C,qDAAM;AACnD,6CAA6C,qDAAM;AACnD,6CAA6C,qDAAM;AACnD,SAAS;AACT;AACA;AACA;AACA;AACA,YAAY,gDAAC;AACb;AACA;AACA;AACA;AACA,kBAAkB,6DAAc;AAChC;AACA;AACA,gDAAgD,iEAAkB,aAAa,iEAAkB;AACjG,uCAAuC,gCAAgC;AACvE;AACA;AACA,0BAA0B,qDAAM;AAChC;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,0BAA0B,qDAAM;AAChC;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,+DAA+D;AACzG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,gDAAC;AAC3C,0CAA0C,gDAAC;AAC3C;AACA;AACA,gCAAgC,4DAAa;AAC7C,+CAA+C,4DAAa;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,gDAAC;AACT;AACA,QAAQ,gDAAC;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,gDAAC;AACT,QAAQ,gDAAC;AACT;AACA;AACA,QAAQ,gDAAC;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,4DAAa;AACrB;AACA;AACA,CAAC,CAAC,wDAAS;;AAEX,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,qDAAM;AACzD,mDAAmD,qDAAM;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,8CAA8C,gBAAgB,6DAAc,aAAa;AACzF,uCAAuC,OAAO,iEAAkB,yDAAyD;AACzH,wCAAwC,6BAA6B;AACrE,uCAAuC,6BAA6B;AACpE,sCAAsC,4BAA4B;AAClE,uCAAuC;AACvC;AACA;AACA;AACA;AACA;AACA,qCAAqC,gEAAiB;AACtD;AACA;AACA,+CAA+C,kCAAkC;AACjF,uDAAuD;AACvD,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,gDAAC;AACT,QAAQ,gDAAC;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,kEAAmB;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAa;AACrB;AACA;AACA,CAAC,CAAC,uDAAQ;;AAEV,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,gDAAC;AAC5B;AACA;AACA;AACA;AACA;AACA,mCAAmC,gDAAC;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,qDAAM;AACzD,6CAA6C,qDAAM;AACnD,6CAA6C,qDAAM;AACnD,6CAA6C,qDAAM;AACnD,6CAA6C,qDAAM;AACnD;AACA;AACA;AACA,+CAA+C,yDAAU;AACzD;AACA;AACA;AACA;AACA,sBAAsB,8DAAe;AACrC,uCAAuC,4CAA4C;AACnF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,qDAAM;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,sBAAsB,sDAAO;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,gDAAC;AACT;AACA,QAAQ,gDAAC;AACT;AACA;AACA;AACA;AACA,YAAY,gDAAC;AACb;AACA;AACA;AACA;AACA,kBAAkB,6DAAc;AAChC;AACA;AACA,gDAAgD,iEAAkB,aAAa,iEAAkB;AACjG,uCAAuC,gCAAgC;AACvE;AACA;AACA,0BAA0B,qDAAM;AAChC;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,0BAA0B,qDAAM;AAChC;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,+DAA+D;AACzG;AACA;AACA;AACA;AACA,mCAAmC;AACnC,iCAAiC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,4DAAa;AACrB;AACA;AACA,CAAC,CAAC,wDAAS;;AAEX,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D,aAAa;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,qDAAM;AAC7D;AACA,mDAAmD,qDAAM;AACzD;AACA,YAAY,qDAAM;AAClB,YAAY,qDAAM;AAClB,YAAY,qDAAM;AAClB,YAAY,qDAAM;AAClB,YAAY,qDAAM;AAClB,YAAY,qDAAM;AAClB;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,sDAAsD,0DAAW;AACjE;AACA;AACA,YAAY,gDAAC;AACb;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,kEAAmB;AACxD;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,wEAAwE,QAAQ,gDAAC,uCAAuC;AACxH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,gDAAC;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,gDAAC;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,mDAAmD,6CAA6C;AAChG;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,2CAA2C;AACxE;AACA;AACA;AACA,6BAA6B,iDAAiD;AAC9E;AACA;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,yDAAU;AAClB;AACA;AACA,CAAC,CAAC,wDAAS;;AAEX,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,yDAAU;AAC5D,mDAAmD,qDAAM;AACzD,mDAAmD,qDAAM;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,2DAAY;AACpB;AACA;AACA,CAAC,CAAC,wDAAS;;AAEX,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8FAA8F,oEAAoE;AAClK;AACA,2FAA2F,iEAAiE;AAC5J;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,gDAAC;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,gDAAC;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,iBAAiB,gDAAC;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,sCAAsC,4DAA4D;AAClG;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,2CAA2C,yBAAyB;AACpE;AACA;AACA;AACA,wBAAwB,cAAc;AACtC;AACA,4BAA4B,sBAAsB;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAa;AACrB;AACA;AACA,QAAQ,uDAAI;AACZ;AACA;AACA,CAAC,CAAC,uDAAQ;;AAEV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4FAA4F,6DAA6D;AACzJ,sFAAsF,0DAA0D;AAChJ;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,CAAC;;AAED,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA,iBAAiB,MAA6B;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,uBAAuB,MAAoC;AAC3D,qDAAqD,QAAQ;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,6DAAc;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,gDAAC;AACjB;AACA;AACA,gBAAgB,gDAAC;AACjB;AACA;AACA,gBAAgB,gDAAC;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,gDAAC;AAC3B;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,gDAAC;AACb;AACA;AACA;AACA,yBAAyB,gDAAC;AAC1B;AACA;AACA;AACA,0EAA0E,oBAAoB,4BAA4B,IAAI;AAC9H,0EAA0E,kCAAkC;AAC5G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD;AACpD;AACA;AACA,oCAAoC,gDAAC;AACrC;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD,2DAA2D;AACjH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8DAA8D,kBAAkB;AAChF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+EAA+E,yCAAyC;AACxH;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,4CAA4C;AAChG;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,gDAAC;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gDAAC;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oEAAoE,6BAA6B;AACjG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,mBAAmB;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kEAAkE,oCAAoC;AACtG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,sDAAO;AACnC;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,sDAAO;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,gDAAC,sBAAsB,uGAAuG;AAC1I;AACA,+CAA+C,UAAU,6CAA6C;AACtG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAa;AACrB;AACA;AACA,QAAQ,uDAAI;AACZ;AACA;AACA,CAAC,CAAC,uDAAQ;;AAEV,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,kBAAkB,MAA+B;AACjD;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA,iBAAiB,MAA6B;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,uBAAuB,MAAoC;AAC3D,qDAAqD,QAAQ;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2EAA2E,OAAO,gDAAC,uBAAuB;AAC1G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,gDAAC;AACb;AACA,wDAAwD,+DAA+D,yBAAyB;AAChJ,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,QAAQ,gDAAC;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,4DAA4D,yBAAyB;AAChI,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,2EAA2E,wBAAwB;AACnG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D,+BAA+B;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,wBAAwB,sBAAsB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA,sCAAsC;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,QAAQ;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,qBAAqB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,gFAAgF,wBAAwB;AACxG;AACA;AACA;AACA,gFAAgF,wBAAwB;AACxG;AACA;AACA;AACA;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,uDAAI;AACZ;AACA;AACA,CAAC,CAAC,uDAAQ;;AAEV,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gFAAgF,8DAA8D;AAC9I,8EAA8E,wCAAwC;AACtH;AACA;AACA;AACA;AACA,6FAA6F,wBAAwB;AACrH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,gDAAC;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,gDAAC;AACb;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,uDAAI;AACZ;AACA;AACA,CAAC,CAAC,uDAAQ;;AAEV,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,gDAAC;AACvB,yBAAyB,gDAAC;AAC1B;AACA;AACA;AACA;AACA,YAAY,gDAAC;AACb;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gDAAC;AAChB;AACA;AACA,QAAQ,gDAAC;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,4DAAa;AACrB;AACA;AACA,QAAQ,uDAAI;AACZ;AACA;AACA,CAAC,CAAC,uDAAQ;AACV;AACA;AACA,uBAAuB;AACvB;AACA,oBAAoB,mBAAmB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,gDAAC;AACvC;AACA;AACA;AACA;AACA;AACA,oBAAoB,mBAAmB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,mBAAmB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,mBAAmB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,oBAAoB,mBAAmB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;;AAEA,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,gDAAC;AACtC,iCAAiC,gDAAC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,qDAAM;AACzD;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,gBAAgB;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,gDAAC;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,qDAAM;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,sDAAO;AAC/C;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,kBAAkB,6DAAc;AAChC;AACA,6BAA6B,iEAAkB;AAC/C,uCAAuC,gCAAgC;AACvE;AACA;AACA;AACA;AACA,0CAA0C,+DAA+D;AACzG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,gDAAC;AACT,wBAAwB;AACxB;AACA,oCAAoC,sDAAO;AAC3C,qCAAqC,sDAAO;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT,gCAAgC,4DAAa;AAC7C,+CAA+C,4DAAa;AAC5D;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,oCAAoC,gDAAC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,0DAAW;AACzC;AACA;AACA;AACA;AACA,uCAAuC,qBAAqB;AAC5D,uCAAuC;AACvC,SAAS;AACT;AACA,qBAAqB,gDAAC;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,0BAA0B,sDAAO,oBAAoB,sDAAO;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,uDAAuD,yCAAyC;AAChG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,qDAAM;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,2DAAQ;AAChB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,4DAAa;AACrB;AACA;AACA,CAAC,CAAC,wDAAS;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAAC,wDAAS;;AAEX,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA,iBAAiB,MAA6B;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,uBAAuB,MAAoC;AAC3D,qDAAqD,QAAQ;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,gDAAC;AACT;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D,eAAe;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D,gBAAgB;AAC3E;AACA;AACA,QAAQ,gDAAC;AACT,QAAQ,gDAAC;AACT;AACA;AACA;AACA,mCAAmC,kEAAmB;AACtD;AACA,SAAS;AACT,yDAAyD,qDAAM;AAC/D;AACA;AACA,uCAAuC,kEAAmB,kBAAkB,gBAAgB;AAC5F;AACA;AACA;AACA;AACA;AACA,QAAQ,gDAAC;AACT;AACA;AACA;AACA,+BAA+B,sDAAO;AACtC,mCAAmC,sDAAO;AAC1C;AACA;AACA,0CAA0C,sDAAO,+BAA+B,sDAAO;AACvF,8CAA8C,sDAAO,8BAA8B,sDAAO;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,6DAAc,wBAAwB,6DAAc;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yEAAyE,gDAAgD;AACzH;AACA,kEAAkE,oJAAoJ;AACtN;AACA;AACA;AACA;AACA,4DAA4D,yEAAyE;AACrI;AACA;AACA;AACA;AACA,6DAA6D,qEAAqE;AAClI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA,4DAA4D,oCAAoC;AAChG;AACA;AACA;AACA;AACA,eAAe,gDAAC;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8EAA8E,QAAQ,gDAAC,kCAAkC;AACzH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yEAAyE,wCAAwC;AACjH,QAAQ,gDAAC;AACT;AACA;AACA;AACA;AACA,QAAQ,gDAAC;AACT,YAAY,gDAAC;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8DAA8D,QAAQ,gDAAC,+CAA+C;AACtH;AACA;AACA;AACA;AACA;AACA;AACA,sEAAsE,sDAAsD;AAC5H;AACA,8EAA8E,qDAAqD;AACnI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,gDAAC;AACb,YAAY,gDAAC;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,4CAA4C;AAChG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,gDAAC;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,gDAAC;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,CAAC,CAAC,wDAAS;;AAEX,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,6BAA6B,iEAAkB;AAC/C,kBAAkB,gDAAC;AACnB;AACA;AACA,SAAS;AACT,mDAAmD,qDAAM;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,qDAAM;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,iEAAkB,cAAc,iEAAkB;AAChG;AACA;AACA;AACA;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAa;AACrB;AACA;AACA,CAAC;;AAED,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,6BAA6B,iEAAkB;AAC/C,kBAAkB,gDAAC;AACnB;AACA;AACA,SAAS;AACT,mDAAmD,qDAAM;AACzD,mDAAmD,qDAAM;AACzD,mDAAmD,qDAAM;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,qDAAM;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,iEAAkB,cAAc,iEAAkB;AAChG;AACA;AACA;AACA;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAa;AACrB;AACA;AACA,CAAC;;AAED,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,qDAAM;AACzD,mDAAmD,qDAAM;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,gDAAC;AACT;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,wDAAS;AAC5D,gDAAgD,wDAAS;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAa;AACrB;AACA;AACA,CAAC,CAAC,wDAAS;;AAEX,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gEAAgE;AAChE;AACA,mEAAmE,+BAA+B;AAClG;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA,2EAA2E,4CAA4C;AACvH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0DAA0D,aAAa;AACvE;AACA,+FAA+F,gBAAgB;AAC/G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,uDAAI;AACZ;AACA;AACA,CAAC,CAAC,uDAAQ;;AAEV;AACA;;AAEA,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD,qDAAM,+CAA+C,yCAAyC;AACvJ,SAAS;AACT;AACA;AACA;AACA;AACA,YAAY,gDAAC,sBAAsB,qIAAqI;AACxK;AACA;AACA,YAAY,gDAAC,sBAAsB,iJAAiJ;AACpL;AACA;AACA,YAAY,gDAAC,sBAAsB,4IAA4I;AAC/K;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,gDAAC,sBAAsB,iJAAiJ;AACpL;AACA;AACA;AACA;AACA,YAAY,gDAAC,sBAAsB,kHAAkH;AACrJ;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,gDAAC;AACT;AACA;AACA;AACA;AACA,8EAA8E,wCAAwC;AACtH;AACA;AACA,YAAY,gDAAC;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,gDAAC;AACb;AACA;AACA;AACA,gFAAgF,yDAAyD;AACzI;AACA;AACA;AACA;AACA,yCAAyC,gDAAC;AAC1C,YAAY,gDAAC;AACb;AACA;AACA;AACA;AACA;AACA,4DAA4D,uDAAQ;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA,mEAAmE,8CAA8C;AACjH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,wDAAS;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,SAAS;AACT,eAAe,wDAAS;AACxB;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,QAAQ,gDAAC;AACT;AACA,mBAAmB,wDAAS;AAC5B;AACA;AACA;AACA,mBAAmB,wDAAS;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,wDAAS;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,gDAAC;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,4DAAa;AACrB;AACA;AACA,CAAC,CAAC,2DAAY;;AAEd,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,wDAAS;AAC5B;AACA;AACA;AACA,oFAAoF,mBAAmB;AACvG;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,0HAA0H,yCAAyC;AACnK,2HAA2H,yCAAyC;AACpK,SAAS;AACT;AACA;AACA;AACA;AACA,kEAAkE,+DAAgB;AAClF;AACA;AACA;AACA;AACA;AACA,4DAA4D,yCAAyC;AACrG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,gDAAC;AACT;AACA;AACA;AACA;AACA;AACA;AACA,wFAAwF,qDAAM;AAC9F;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,eAAe,wDAAS;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,CAAC,CAAC,wDAAS;;AAEX;AACA;AACA,gBAAgB,0DAAW;AAC3B;AACA;AACA,UAAU;AACV;AACA;AACA,UAAU,mEAAmE;AAC7E,UAAU,uFAAuF;AACjG;AACA;AACA;AACA;AACA;;AAEA,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,6BAA6B,iEAAkB;AAC/C,kBAAkB,gDAAC;AACnB;AACA;AACA,SAAS;AACT,mDAAmD,qDAAM;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,iEAAkB,kBAAkB,iEAAkB;AACpG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,qDAAM;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAa;AACrB;AACA;AACA,CAAC;;AAED,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,kEAAmB,kBAAkB,gBAAgB;AAC5F;AACA;AACA;AACA,4DAA4D,eAAe;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,CAAC,CAAC,wDAAS;;AAEX,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,kBAAkB,MAA+B;AACjD;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD,6BAA6B,0CAA0C;AAChI;AACA;AACA;AACA,sDAAsD,iDAAiD;AACvG;AACA;AACA;AACA;AACA,kDAAkD,mDAAmD;AACrG;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0DAA0D,wDAAwD;AAClH;AACA;AACA;AACA;AACA;AACA,0DAA0D,sDAAsD;AAChH;AACA;AACA;AACA;AACA;AACA,0DAA0D,qDAAqD;AAC/G;AACA;AACA;AACA,iFAAiF,qDAAM;AACvF;AACA;AACA,aAAa;AACb,sDAAsD,+BAA+B;AACrF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD,iDAAiD;AACvG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,oDAAoD,4DAA4D;AAChH;AACA,0BAA0B,gDAAC;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,qBAAqB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,6DAAc,oBAAoB,0DAAW;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD,gBAAgB;AACzE;AACA,QAAQ,gDAAC;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,CAAC,CAAC,wDAAS;;AAEX,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,kBAAkB,qDAAM;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAa;AACrB;AACA;AACA,CAAC,CAAC,wDAAS;;AAEX,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8DAA8D,gDAAC;AAC/D;AACA;AACA,6BAA6B,qDAAqD;AAClF;AACA;AACA;AACA,QAAQ,gDAAC;AACT;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,4DAAa;AACrB;AACA;AACA,CAAC,CAAC,wDAAS;;AAEX,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,sDAAO;AAC7B;AACA;AACA,yBAAyB,gDAAC;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA,QAAQ,gDAAC;AACT;AACA;AACA;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAa;AACrB;AACA;AACA,QAAQ,yDAAU;AAClB;AACA;AACA,CAAC,CAAC,wDAAS;;AAEX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAa;AACrB;AACA;AACA,CAAC,CAAC,wDAAS;;AAEX,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA,kBAAkB,MAA+B;AACjD;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,mCAAmC,kEAAmB;AACtD;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+DAA+D,wCAAwC;AACvG;AACA;AACA,iBAAiB,sDAAO;AACxB,iBAAiB,sDAAO;AACxB;AACA;AACA,iBAAiB,sDAAO;AACxB,iBAAiB,sDAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mEAAmE;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,0EAA0E,gBAAgB;AAC1F;AACA;AACA;AACA;AACA,wBAAwB,QAAQ;AAChC;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,6DAAc,oBAAoB,0DAAW;AAC9E;AACA;AACA;AACA;AACA;AACA,iCAAiC,6DAAc,oBAAoB,0DAAW;AAC9E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,gDAAC;AACT;AACA;AACA,4DAA4D,2BAA2B;AACvF;AACA;AACA,iCAAiC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oFAAoF,4CAA4C;AAChI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,qDAAM;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,qDAAM;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,YAAY,gDAAC;AACb;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,4DAAa;AACrB;AACA;AACA,CAAC,CAAC,wDAAS;;AAEX,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,kEAAmB;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,kEAAmB;AACnD;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,0DAA0D,+CAA+C;AACzG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6DAA6D,wCAAwC;AACrG;AACA;AACA;AACA;AACA;AACA,wBAAwB,2BAA2B;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,gDAAC;AAC3C,4BAA4B,gDAAC;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,gDAAC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D,6DAA6D;AACzH;AACA;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,uDAAI;AACZ;AACA;AACA,CAAC,CAAC,uDAAQ;;AAEV;AACA;;AAEA;AACA;AACA,gBAAgB,0DAAW;AAC3B;AACA;AACA,UAAU,2EAA2E;AACrF,UAAU,yDAAyD;AACnE,UAAU,uEAAuE;AACjF;AACA;AACA;AACA;AACA;;AAEA,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,SAAS;AACT;AACA,gDAAgD,sBAAsB;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,gDAAC;AACjB;AACA;AACA;AACA,gBAAgB,gDAAC;AACjB;AACA;AACA;AACA,gBAAgB,gDAAC;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,qDAAM;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,qDAAM;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,qDAAM;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,gDAAgD,sBAAsB;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,4CAA4C,cAAc;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,uDAAI;AACZ;AACA;AACA,CAAC;;AAED;AACA;;AAEA;AACA;AACA,gBAAgB,0DAAW;AAC3B;AACA;AACA,UAAU,8EAA8E;AACxF,UAAU,0EAA0E;AACpF,UAAU;AACV;AACA;AACA,UAAU,sEAAsE;AAChF;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B,qBAAqB;AACrB;AACA,iBAAiB;AACjB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,gDAAgD,8BAA8B;AAC9E;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,4CAA4C,gCAAgC;AAC5E,yCAAyC,6BAA6B;AACtE;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA,aAAa;AACb;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,yDAAU,oCAAoC,6BAA6B;AACxG;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,4BAA4B,oBAAoB;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0DAA0D,mCAAmC;AAC7F;AACA;AACA;AACA,uBAAuB,gDAAC;AACxB,+BAA+B,wCAAwC,oBAAoB;AAC3F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,+DAAgB;AAClD;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ,YAAY;AACZ,cAAc;AACd,cAAc;AACd;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;AACA;AACA;AACA;AACA;AACA,mCAAmC,oBAAoB;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,0BAA0B;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,mBAAmB;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,yDAAU;AAC3B;AACA;AACA,KAAK;AACL,kBAAkB,yDAAU;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,kBAAkB,MAA+B;AACjD;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,MAA6B;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,uBAAuB,MAAoC;AAC3D,qDAAqD,QAAQ;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC;AACvC;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,0DAA0D,SAAS,sDAAO,sFAAsF;AAChK,0DAA0D,4GAA4G,sCAAsC;AAC5M;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,gDAAC;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D,4CAA4C;AACxG;AACA;AACA;AACA,4DAA4D,qCAAqC;AACjG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA,qBAAqB,qBAAqB,8BAA8B;AACxE;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD,SAAS,sDAAO,gEAAgE;AACtI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD,SAAS,sDAAO,4EAA4E;AAClJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,gDAAC,2BAA2B,gDAAC;AACjD;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAAC,yEAA0B;;AAE5B,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,gDAAC;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,aAAa;AACb;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA,iBAAiB;AACjB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,iBAAiB,MAA6B;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,uBAAuB,MAAoC;AAC3D,qDAAqD,QAAQ;AAC7D;AACA;AACA;AACA;AACA;AACA,mFAAmF;AACnF;AACA;AACA;AACA,SAAS,IAAI;AACb;AACA;AACA;AACA;AACA,SAAS;AACT,0FAA0F;AAC1F;AACA;AACA;AACA,SAAS,IAAI;AACb,4EAA4E;AAC5E;AACA;AACA;AACA,SAAS,IAAI;AACb;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,qDAAqD;AAC7F;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;;AAEA,+CAA+C;AAC/C;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,2BAA2B,qCAAqC;AAChE;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,oCAAoC,qCAAqC;AACzE;AACA;AACA;AACA,iBAAiB;AACjB,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,qCAAqC;AACpE;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,iBAAiB;AACjB,SAAS;AACT,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,aAAa;AACb,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,mBAAmB;AACvD;AACA;AACA,+CAA+C,gBAAgB,IAAI,4CAA4C;AAC/G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,aAAa;AACb;AACA;AACA;AACA,qBAAqB;AACrB,aAAa;AACb,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,qBAAqB,iBAAiB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;;AAEA,iBAAiB,MAA6B;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,iBAAiB,MAA6B;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,gDAAC;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;;AAEA,iBAAiB,MAA6B;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,sDAAsD;AACtD;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,aAAa;AACb;AACA;AACA,8CAA8C;AAC9C;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B;AAC1B,aAAa;AACb;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,mCAAmC;AACnC;AACA,aAAa,sBAAsB,qBAAqB,IAAI;AAC5D;AACA;AACA,qCAAqC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,qCAAqC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,uCAAuC;AACvC;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,uCAAuC;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;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;AACA;AACA;AACA;AACA,yBAAyB;AACzB,qBAAqB;AACrB;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,gDAAC,aAAa,gDAAC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;;AAEA;AACA;AACA,oBAAoB,kBAAkB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,gDAAC;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,kEAAkE,uDAAuD;AACzH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc,0BAA0B,UAAU,eAAe;AACjE,cAAc,6BAA6B,UAAU,mCAAmC;AACxF,cAAc,4BAA4B,UAAU;AACpD;AACA;AACA,4BAA4B,8BAA8B,UAAU,iBAAiB;AACrF;AACA;AACA,4BAA4B,8BAA8B,UAAU,iBAAiB;AACrF;AACA;AACA,4BAA4B,WAAW;AACvC;AACA;AACA,4BAA4B,WAAW;AACvC;AACA;AACA,4BAA4B,gBAAgB;AAC5C;AACA;AACA,4BAA4B,iBAAiB;AAC7C;AACA;AACA,4BAA4B,gBAAgB;AAC5C;AACA;AACA,4BAA4B,yBAAyB,UAAU,oBAAoB;AACnF;AACA;AACA,4BAA4B,iCAAiC,UAAU,wBAAwB;AAC/F;AACA,iBAAiB;AACjB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,kDAAkD,uCAAuC;AACzF;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,kDAAkD,uCAAuC;AACzF;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;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,UAAU,6BAA6B;AACzE;AACA,iBAAiB;AACjB;AACA,kCAAkC,UAAU,+BAA+B;AAC3E;AACA,iBAAiB;AACjB;AACA,kCAAkC,UAAU,2BAA2B;AACvE;AACA,iBAAiB;AACjB;AACA,kCAAkC,UAAU,iCAAiC;AAC7E;AACA,iBAAiB;AACjB;AACA,kCAAkC,UAAU,qCAAqC;AACjF;AACA,iBAAiB;AACjB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,sDAAsD,6CAA6C;AACnG;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;;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,8CAA8C,mCAAmC;AACjF;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,8CAA8C,mCAAmC;AACjF;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,aAAa;AACb,4DAA4D,8CAA8C;AAC1G;AACA;AACA;;AAEA,kBAAkB,MAA+B;AACjD;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA,yBAAyB,oEAAoE;AAC7F,yBAAyB,sBAAsB,IAAI,wBAAwB;AAC3E,2BAA2B,2FAA2F;AACtH,gCAAgC,gDAAgD;AAChF,2BAA2B,yDAAyD;AACpF,8BAA8B,uCAAuC;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,+BAA+B,wFAAwF;AACvH;AACA;AACA;AACA;AACA,aAAa,gDAAC;AACd;AACA;AACA;AACA,wEAAwE,6CAA6C;AACrH;AACA;AACA,oCAAoC,mCAAmC;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B,4BAA4B;AAC5B,0BAA0B;AAC1B,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,0BAA0B,gDAAC;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,mFAAmF,gCAAgC,WAAW,uDAAuD,KAAK;AAC1L;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,wDAAwD,8CAA8C;AACtG;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB,qBAAqB;AACrB;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;;AAEA;AACA,2CAA2C;AAC3C;AACA;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;AACA;AACA;AACA,2BAA2B,4BAA4B;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,gDAAC,cAAc,gDAAC;AAC9C,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,gDAAC,cAAc,gDAAC;AACtD,yBAAyB;AACzB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,+BAA+B,SAAS,oBAAoB;AAC5D;AACA;;AAEA,iBAAiB,MAA6B;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,uBAAuB,MAAoC;AAC3D,qDAAqD,QAAQ;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,kBAAkB;AACtC;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,0CAA0C,QAAQ;AAClD;AACA;AACA,4BAA4B,uBAAuB;AACnD;AACA;AACA;AACA,4BAA4B;AAC5B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,QAAQ;AAClD;AACA;AACA;AACA;AACA,kFAAkF,0DAA0D;AAC5I;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,gDAAgD,oDAAoD;AACpG;AACA;AACA;AACA;AACA;AACA,gCAAgC,YAAY;AAC5C,SAAS;AACT;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0DAA0D,2CAA2C;AACrG,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD,uDAAuD;AAChH,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,iEAAiE,kDAAkD;AACnH,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,gDAAC;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,MAAM;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B;AACA,8BAA8B;AAC9B;AACA;AACA,8BAA8B;AAC9B;AACA;AACA,8BAA8B;AAC9B;AACA;AACA,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD;AACvD,6BAA6B,gDAAC;AAC9B,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,gDAAC;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA,iBAAiB;AACjB;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,8DAA8D;AAC9D;AACA;AACA;AACA,sCAAsC,gDAAC;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,uDAAuD,uDAAuD;AAC9G;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;;AAEA,iBAAiB,MAA6B;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,uBAAuB,MAAoC;AAC3D,qDAAqD,QAAQ;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C;AAC7C;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,oFAAoF,oDAAoD;AACxI;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,mDAAmD,sDAAsD;AACzG,4DAA4D,oEAAoE;AAChI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,iCAAiC;AACjF;AACA;AACA;AACA;AACA,oDAAoD,wDAAwD;AAC5G;AACA;AACA;AACA;AACA,mBAAmB,gDAAC;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,+DAAgB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,mFAAmF;AACnF;AACA;AACA;AACA,SAAS,IAAI;AACb;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0DAA0D,wBAAwB;AAClF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,+DAAgB;AACnD;AACA,CAAC;;AAED,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,kBAAkB,MAA+B;AACjD;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA,IAAI,2DAAY;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,2DAAY;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,2DAAY;AACxB,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,2DAAY;AACpB;AACA;AACA;AACA,KAAK;AACL,IAAI,2DAAY;AAChB,IAAI,2DAAY;AAChB,IAAI,2DAAY;AAChB,IAAI,2DAAY;AAChB,IAAI,2DAAY;AAChB,IAAI,2DAAY;AAChB,IAAI,2DAAY;AAChB,IAAI,2DAAY;AAChB;AACA;AACA,WAAW,2DAAY;AACvB;AACA;AACA;AACA;AACA;AACA,QAAQ,yDAAU;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,2DAAY;AAChB,IAAI,2DAAY;AAChB,IAAI,2DAAY;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,+BAA+B;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,yDAAU;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,gDAAC;AACzB;AACA,6CAA6C,aAAa,oXAAoX;AAC9a;AACA;AACA;AACA;AACA,mCAAmC,sDAAO;AAC1C,wCAAwC,sDAAO;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,8DAAe;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0DAA0D,gBAAgB;AAC1E;AACA;AACA;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAa;AACrB;AACA;AACA,QAAQ,uDAAI;AACZ;AACA;AACA,CAAC,CAAC,0DAAW;;AAEb;AACA;;AAEA;AACA;AACA,gBAAgB,0DAAW;AAC3B;AACA;AACA;AACA;AACA,QAAQ,6DAAc,EAAE,yDAAU;AAClC;AACA;AACA,QAAQ,8DAAe;AACvB;AACA;AACA;;AAEA,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,oCAAoC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,qDAAM;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,gDAAC;AACxD,yDAAyD,gDAAC;AAC1D,6DAA6D,gDAAC;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD;AACpD;AACA,QAAQ,gDAAC;AACT,QAAQ,gDAAC;AACT;AACA;AACA;AACA;AACA,gDAAgD,gDAAC;AACjD,sCAAsC,sEAAsE;AAC5G,aAAa;AACb;AACA;AACA;AACA;AACA,0EAA0E,sBAAsB,IAAI;AACpG;AACA;AACA;AACA;AACA,QAAQ,gDAAC;AACT,QAAQ,gDAAC;AACT,QAAQ,gDAAC;AACT;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,2DAAY;AACpB;AACA;AACA,QAAQ,4DAAa;AACrB;AACA;AACA,CAAC,CAAC,wDAAS;;AAEX,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA,qCAAqC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,gDAAC;AAC/B,gCAAgC,gDAAC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,sDAAO;AACjC;AACA;AACA,SAAS;AACT,mDAAmD,qDAAM;AACzD;AACA,QAAQ,gDAAC,yDAAyD,sBAAsB;AACxF,QAAQ,gDAAC;AACT;AACA,YAAY,gDAAC;AACb;AACA;AACA;AACA;AACA;AACA,6CAA6C,qDAAM;AACnD,mDAAmD,qDAAM;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,gDAAC;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,gDAAC,yDAAyD,sBAAsB;AACxF,6BAA6B,MAAM,qDAAM,uBAAuB;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,gDAAC;AACT,QAAQ,gDAAC;AACT,QAAQ,gDAAC;AACT;AACA;AACA;AACA;AACA,iCAAiC,gDAAC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,wBAAwB;AACtE;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,gDAAC;AACT;AACA,QAAQ,gDAAC;AACT,QAAQ,gDAAC;AACT;AACA;AACA;AACA,QAAQ,gDAAC;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAa;AACrB;AACA;AACA,CAAC,CAAC,wDAAS;;AAEX,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8DAA8D,8BAA8B;AAC5F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,qDAAM;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,2CAA2C,kEAAmB;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,0BAA0B,mCAAmC;AAC7D,0BAA0B,iEAAiE,6BAA6B;AACxH;AACA,0BAA0B,mCAAmC;AAC7D,0BAA0B,iEAAiE,+BAA+B;AAC1H,sDAAsD,+DAAgB;AACtE,sDAAsD,+DAAgB;AACtE;AACA;AACA,wCAAwC,kEAAmB;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,qDAAM,qCAAqC,oCAAoC;AAC5H,SAAS;AACT,0CAA0C,kEAAmB;AAC7D,uDAAuD,qDAAM;AAC7D;AACA;AACA;AACA;AACA,kDAAkD,qCAAqC,8BAA8B;AACrH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D,kEAAmB;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,gDAAC;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,2DAAY;AACpB;AACA;AACA,QAAQ,4DAAa;AACrB;AACA;AACA,CAAC,CAAC,wDAAS;;AAEX,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,gDAAC;AACT;AACA;AACA,uDAAuD,qDAAM,mCAAmC,kCAAkC;AAClI;AACA,mDAAmD,qDAAM,yCAAyC,kCAAkC;AACpI,mDAAmD,qDAAM;AACzD;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D,iCAAiC;AAC7F;AACA;AACA;AACA,YAAY,gDAAC;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gDAAC;AAChB,iCAAiC,kEAAmB;AACpD,uBAAuB,gDAAC;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,gDAAC;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,kEAAmB;AACpD;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD,gDAAC;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,4EAA4E,8CAA8C;AAC1H;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,qDAAqD,gDAAC;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sEAAsE,0CAA0C;AAChH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,qCAAqC;AAClE;AACA;AACA,gCAAgC,gDAAC;AACjC;AACA;AACA;AACA;AACA,oBAAoB,gDAAC;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,qBAAqB;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,mEAAmE,qDAAqD;AACxH;AACA;AACA;AACA,QAAQ,gDAAC;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,CAAC,CAAC,wDAAS;;AAEX,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,kBAAkB,MAA+B;AACjD;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gEAAgE,gBAAgB;AAChF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD,6BAA6B,0CAA0C;AAChI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,CAAC,CAAC,wDAAS;;AAEX;AACA;;AAEA;AACA;AACA,gBAAgB,0DAAW;AAC3B;AACA;AACA,UAAU,wFAAwF;AAClG,UAAU;AACV;AACA;AACA,UAAU,uEAAuE;AACjF;AACA;AACA;AACA;AACA;AACA;;AAEA,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,SAAS;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uEAAuE;AACvE;AACA;AACA;AACA;AACA;AACA,qCAAqC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;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;;AAEA;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;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;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;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;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;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA,mCAAmC,2BAA2B;AAC9D;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC;AACtC;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA,4DAA4D;AAC5D;AACA,4BAA4B;AAC5B;AACA,kBAAkB,MAA+B;AACjD;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,MAA6B;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,CAAC;;AAED,iBAAiB,MAA6B;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,uBAAuB,MAAoC;AAC3D,qDAAqD,QAAQ;AAC7D;AACA;AACA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,gCAAgC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD;AACzD;AACA;AACA;AACA,6FAA6F,mCAAmC,8CAA8C,6EAA6E,8FAA8F;AACzV,mCAAmC,wBAAwB,uCAAuC;AAClG;AACA,mCAAmC,wBAAwB,uCAAuC;AAClG,4BAA4B;AAC5B,0EAA0E,sCAAsC;AAChH;AACA,gEAAgE;AAChE;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,yDAAyD;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA,kBAAkB,MAA+B;AACjD;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,iBAAiB,MAA6B;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,uBAAuB,MAAoC;AAC3D,qDAAqD,QAAQ;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,sCAAsC;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,sEAAsE,UAAU;AAChF;AACA;AACA;AACA;AACA,wBAAwB,QAAQ;AAChC;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA,6EAA6E,UAAU;AACvF;AACA;AACA;AACA;AACA,wBAAwB,QAAQ;AAChC;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iFAAiF,UAAU;AAC3F;AACA;AACA;AACA;AACA,4BAA4B,QAAQ;AACpC;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,oBAAoB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8EAA8E,iBAAiB;AAC/F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,QAAQ;AAChC;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8DAA8D;AAC9D;AACA;AACA,8CAA8C,QAAQ;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,QAAQ;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qEAAqE,UAAU;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,QAAQ;AAChC;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B,qCAAqC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA,6DAA6D;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA,iFAAiF,UAAU;AAC3F;AACA,sCAAsC,cAAc;AACpD;AACA;AACA,4BAA4B,QAAQ;AACpC;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;AACA,0EAA0E,UAAU;AACpF;AACA,sCAAsC,cAAc;AACpD;AACA;AACA,4BAA4B,QAAQ;AACpC;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0EAA0E,UAAU;AACpF;AACA;AACA;AACA;AACA,4BAA4B,QAAQ;AACpC;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA,iFAAiF,UAAU;AAC3F;AACA;AACA;AACA;AACA,4BAA4B,QAAQ;AACpC;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA,qBAAqB;AACrB,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,+BAA+B,mBAAmB;AAClD;AACA;AACA,+BAA+B,mBAAmB;AAClD;AACA;AACA,+BAA+B,mBAAmB;AAClD;AACA;AACA,+BAA+B,mBAAmB;AAClD;AACA;AACA,+BAA+B,mBAAmB;AAClD;AACA;AACA,+BAA+B,mBAAmB;AAClD;AACA;AACA,+BAA+B,mBAAmB;AAClD;AACA;AACA,+BAA+B,mBAAmB;AAClD;AACA;AACA,+BAA+B,mBAAmB;AAClD;AACA;AACA,+BAA+B,mDAAmD,iCAAiC;AACnH;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,iBAAiB,MAA6B;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,uBAAuB,MAAoC;AAC3D,qDAAqD,QAAQ;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,uBAAuB;AAChD;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,yBAAyB,uBAAuB;AAChD;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,yBAAyB,uBAAuB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,yBAAyB,uBAAuB;AAChD;AACA;AACA,+BAA+B,sFAAsF;AACrH,KAAK;AACL;AACA;AACA,yBAAyB,uBAAuB;AAChD;AACA;AACA,+BAA+B,uFAAuF;AACtH,KAAK;AACL;;AAEA,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,kBAAkB,MAA+B;AACjD;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA,kBAAkB,MAA+B;AACjD;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,iBAAiB,MAA6B;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,uBAAuB,MAAoC;AAC3D,qDAAqD,QAAQ;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,uEAAuE;AAC/G;AACA;AACA;AACA,6DAA6D;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yEAAyE;AACzE,mDAAmD;AACnD,8CAA8C;AAC9C,0CAA0C,oIAAoI;AAC9K;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD;AACpD,sDAAsD;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0FAA0F,oBAAoB;AAC9G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,QAAQ;AAChC;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA,2BAA2B,uJAAuJ;AAClL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,mFAAmF;AAClH;AACA;AACA;AACA;AACA;AACA,6BAA6B,kBAAkB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,qGAAqG;AACxI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,qGAAqG;AACpI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gFAAgF,gBAAgB,wDAAwD;AACxJ;AACA;AACA;AACA,0FAA0F,oBAAoB;AAC9G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,QAAQ;AAChC;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gFAAgF,UAAU;AAC1F;AACA,sCAAsC,sBAAsB;AAC5D;AACA;AACA,4BAA4B,QAAQ;AACpC;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,qGAAqG;AAChI;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,qCAAqC;AAC3E,SAAS;AACT;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC,0CAA0C;;AAE3C,kBAAkB,MAA+B;AACjD;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,MAAgC;AACnD,4BAA4B,+DAA+D,iBAAiB;AAC5G,0BAA0B,OAAO;AACjC,oCAAoC,MAAM,+BAA+B,YAAY;AACrF,mCAAmC,MAAM,mCAAmC,YAAY;AACxF,gCAAgC;AAChC;AACA,KAAK;AACL;AACA,qBAAqB,MAAkC;AACvD,cAAc,6BAA6B,0BAA0B,cAAc,qBAAqB;AACxG,iBAAiB,oDAAoD,qEAAqE,cAAc;AACxJ,uBAAuB,sBAAsB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC,mCAAmC,SAAS;AAC5C,mCAAmC,WAAW,UAAU;AACxD,0CAA0C,cAAc;AACxD;AACA,8GAA8G,OAAO;AACrH,iFAAiF,iBAAiB;AAClG,yDAAyD,gBAAgB,QAAQ;AACjF,+CAA+C,gBAAgB,gBAAgB;AAC/E;AACA,kCAAkC;AAClC;AACA;AACA,UAAU,YAAY,aAAa,SAAS,UAAU;AACtD,oCAAoC,SAAS;AAC7C;AACA;AACA,iBAAiB,MAA6B;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,uBAAuB,MAAoC;AAC3D,qDAAqD,QAAQ;AAC7D;AACA;AACA;AACA,kBAAkB,MAA+B;AACjD;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,sGAAsG;AAC7I;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,kBAAkB;AACtD,uCAAuC,iCAAiC;AACxE,qEAAqE,sBAAsB;AAC3F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD,6BAA6B;AACtF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,6BAA6B;AACjF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,8BAA8B;AAC9E;AACA;AACA,yCAAyC,uBAAuB;AAChE;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA,yCAAyC,uBAAuB;AAChE;AACA;AACA;AACA,qBAAqB;AACrB,6CAA6C,2BAA2B;AACxE;AACA,mDAAmD,iBAAiB,0DAA0D;AAC9H,iBAAiB;AACjB;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,kFAAkF,kBAAkB;AACpG;AACA;AACA;AACA;AACA;AACA,wBAAwB,QAAQ;AAChC;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,mCAAmC;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAiE,qJAAqJ;AACtN;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC;AAClC;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAiE,oCAAoC;AACrG;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA,0CAA0C;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+FAA+F;AAC/F;AACA,uCAAuC,4DAA4D;AACnG,uCAAuC,mBAAmB;AAC1D;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,0BAA0B;AAC1B;AACA;AACA;AACA;AACA;AACA,oCAAoC,mBAAmB;AACvD,qDAAqD,kDAAkD;AACvG;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,kGAAkG,qBAAqB;AACvH;AACA;AACA;AACA;AACA;AACA,4BAA4B,QAAQ;AACpC;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD;AACA;AACA;AACA;AACA;AACA,iDAAiD;AACjD;AACA;AACA;AACA;AACA;AACA;AACA,kIAAkI,8BAA8B;AAChK;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sGAAsG,iBAAiB;AACvH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,QAAQ;AACxC;AACA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA;AACA;AACA,wBAAwB,QAAQ;AAChC;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA,kFAAkF,UAAU;AAC5F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,QAAQ;AAChC;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,uDAAuD;AAC9F;AACA;AACA;AACA;AACA,gBAAgB;AAChB,gCAAgC,4BAA4B;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,uDAAuD;AACnG;AACA;AACA;AACA,uCAAuC,aAAa;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,IAAI;AACb;AACA;AACA;AACA;AACA;AACA,qBAAqB,aAAa;AAClC;AACA,iEAAiE,iCAAiC,wBAAwB,4BAA4B;AACtJ;AACA;AACA;AACA;AACA,oCAAoC,iBAAiB;AACrD,0CAA0C,qBAAqB;AAC/D,oCAAoC,wBAAwB;AAC5D;AACA,oCAAoC,uDAAuD;AAC3F,oCAAoC,qBAAqB;AACzD,uCAAuC,+BAA+B;AACtE;AACA;AACA;AACA;AACA,aAAa,IAAI;AACjB;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;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,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,OAAO;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,+BAA+B,0BAA0B;AACzD;AACA;AACA,+BAA+B,0BAA0B;AACzD;AACA;AACA,+BAA+B,mDAAmD,8BAA8B;AAChH;AACA;AACA,+BAA+B,0BAA0B;AACzD;AACA;AACA,+BAA+B,0BAA0B;AACzD;AACA;AACA,+BAA+B,0BAA0B;AACzD;AACA;AACA,+BAA+B,0BAA0B;AACzD;AACA;AACA,+BAA+B,0BAA0B;AACzD;AACA;AACA,+BAA+B,0BAA0B;AACzD;AACA;AACA;AACA;AACA,sCAAsC,qCAAqC;AAC3E,SAAS;AACT;AACA;AACA,+BAA+B,wDAAwD;AACvF;AACA;AACA,CAAC;;AAED,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA,kBAAkB,MAA+B;AACjD;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD;AACzD,kCAAkC,kDAAkD;AACpF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,kCAAkC;AACvF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,oCAAoC;AACzF;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D,mCAAmC;AAC9F,+DAA+D,eAAe;AAC9E;AACA,wBAAwB,kBAAkB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8EAA8E,iBAAiB;AAC/F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,QAAQ;AAChC;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,sBAAsB;AAC1E,iBAAiB;AACjB;AACA;AACA;AACA,iDAAiD;AACjD;AACA;AACA;AACA;AACA,wBAAwB,iBAAiB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kFAAkF,kBAAkB;AACpG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,QAAQ;AAChC;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA,wBAAwB,kBAAkB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,kBAAkB;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,+DAA+D,iCAAiC;AAChG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8EAA8E,iBAAiB;AAC/F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,QAAQ;AAChC;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC;AACzC;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,mDAAmD;AACnD;AACA,+BAA+B,0BAA0B;AACzD;AACA;AACA,+BAA+B,0BAA0B;AACzD;AACA;AACA,+BAA+B,mDAAmD,yBAAyB;AAC3G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,0BAA0B;AACzD;AACA;AACA,+BAA+B,0BAA0B;AACzD;AACA;AACA,+BAA+B,0BAA0B;AACzD;AACA;AACA,CAAC;AACD;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,kBAAkB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,kBAAkB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sGAAsG,yBAAyB;AAC/H;AACA;AACA,CAAC;;AAED,gCAAgC;AAChC;AACA;AACA;AACA,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC;;AAEhC,iBAAiB,MAA6B;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,kBAAkB;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,yBAAyB;AACjE,wCAAwC,oBAAoB;AAC5D;AACA;AACA;AACA,2CAA2C,gBAAgB;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,gBAAgB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,kBAAkB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC;;AAED,kBAAkB,MAA+B;AACjD;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,WAAW;AAC/D;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6KAA6K,UAAU;AACvL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,QAAQ;AAChC;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,sBAAsB;AAC9D;AACA;AACA;AACA;AACA,sFAAsF,mBAAmB;AACzG;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,QAAQ;AAChC;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,2BAA2B,gBAAgB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0HAA0H;AAC1H;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,2BAA2B;AAC3E,KAAK;AACL;AACA;AACA,oDAAoD,yCAAyC;AAC7F;AACA;AACA;AACA,qBAAqB,uBAAuB;AAC5C;AACA;AACA,oDAAoD,uCAAuC,mBAAmB,IAAI;AAClH,4BAA4B,mBAAmB;AAC/C,+BAA+B,mBAAmB;AAClD;AACA;AACA;AACA;AACA,qBAAqB,uBAAuB;AAC5C;AACA;AACA,oDAAoD,sCAAsC,mBAAmB,IAAI;AACjH,4BAA4B,mBAAmB;AAC/C,+BAA+B,mBAAmB;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,mDAAmD,iCAAiC;AACpF,4DAA4D,oCAAoC;AAChG,kDAAkD,mCAAmC;AACrF,2DAA2D,mCAAmC;AAC9F,iDAAiD,+BAA+B;AAChF,0DAA0D,kCAAkC;AAC5F,+CAA+C,yCAAyC;AACxF,wDAAwD,gCAAgC;AACxF;AACA;AACA,+DAA+D,uCAAuC;AACtG;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,gEAAgE,wCAAwC;AACxG;AACA,sEAAsE,8CAA8C;AACpH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,oDAAoD,4CAA4C;AAChG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,gEAAgE,wCAAwC;AACxG;AACA,yCAAyC,wCAAwC;AACjF;AACA;AACA,qBAAqB,uBAAuB;AAC5C;AACA;AACA;AACA,+CAA+C,yDAAyD;AACxG;AACA;AACA,yCAAyC,yCAAyC;AAClF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,6DAA6D;AAClH,8DAA8D,sCAAsC;AACpG,sDAAsD,kCAAkC;AACxF,+DAA+D,uCAAuC;AACtG;AACA,6DAA6D,qCAAqC;AAClG;AACA,mDAAmD,+BAA+B;AAClF,yCAAyC,oCAAoC;AAC7E;AACA,oDAAoD,gCAAgC;AACpF,yCAAyC,qCAAqC;AAC9E;AACA,mDAAmD,+BAA+B;AAClF;AACA,4DAA4D,yFAAyF;AACrJ;AACA,oDAAoD,gCAAgC;;AAEpF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,wBAAwB;;AAEzB;AACA;AACA;AACA;AACA,CAAC,gDAAgD;;AAEjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,kBAAkB,MAA+B;AACjD;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA,8EAA8E,kBAAkB;AAChG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,QAAQ;AAC5B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA,kBAAkB,MAA+B;AACjD;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,MAA6B;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,kBAAkB,MAA+B;AACjD;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,uBAAuB,MAAoC;AAC3D,qDAAqD,QAAQ;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8EAA8E,iBAAiB;AAC/F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,QAAQ;AAChC;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA,iCAAiC,mBAAmB;AACpD;AACA,qCAAqC,4BAA4B;AACjE,yCAAyC,gCAAgC,UAAU,0BAA0B,KAAK;AAClH;AACA,qCAAqC,8BAA8B;AACnE,yCAAyC,gCAAgC,UAAU,0BAA0B,KAAK;AAClH;AACA,qCAAqC,kCAAkC;AACvE,yCAAyC,gCAAgC,UAAU,cAAc,KAAK;AACtG;AACA,qCAAqC,8CAA8C;AACnF,yCAAyC,gCAAgC,UAAU,cAAc,KAAK;AACtG;AACA,qCAAqC,iDAAiD;AACtF,yCAAyC,gCAAgC,UAAU,cAAc,KAAK;AACtG;AACA,qCAAqC,gCAAgC;AACrE,yCAAyC,gCAAgC,UAAU,cAAc,KAAK;AACtG;AACA,qCAAqC,kCAAkC;AACvE,yCAAyC,gCAAgC,UAAU,cAAc,KAAK;AACtG;AACA,mEAAmE,UAAU;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,QAAQ;AAChC;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA,wDAAwD,sCAAsC;AAC9F;AACA;AACA;AACA;AACA,mIAAmI,UAAU;AAC7I;AACA;AACA;AACA;AACA,4BAA4B,QAAQ;AACpC;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA,wDAAwD,QAAQ,wFAAwF;AACxJ;AACA;AACA;AACA;AACA,6HAA6H,UAAU;AACvI;AACA;AACA;AACA;AACA,4BAA4B,QAAQ;AACpC;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA,wDAAwD,4BAA4B;AACpF;AACA;AACA;AACA;AACA,oHAAoH,UAAU;AAC9H;AACA;AACA;AACA;AACA,4BAA4B,QAAQ;AACpC;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA;AACA,yJAAyJ,UAAU;AACnK;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,QAAQ;AAChC;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA,+BAA+B;AAC/B,mHAAmH;AACnH,iBAAiB;AACjB;AACA;AACA,+BAA+B;AAC/B;AACA;AACA,sBAAsB,oCAAoC;AAC1D,SAAS;AACT;AACA;AACA,+BAA+B;AAC/B;AACA;AACA;AACA;AACA,+BAA+B;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sFAAsF,mBAAmB;AACzG;AACA,gHAAgH,UAAU,4BAA4B,IAAI;AAC1J;AACA;AACA,wBAAwB,QAAQ;AAChC;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wEAAwE,UAAU;AAClF;AACA;AACA;AACA;AACA,wBAAwB,QAAQ;AAChC;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0IAA0I,UAAU;AACpJ;AACA;AACA;AACA;AACA,wBAAwB,QAAQ;AAChC;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0IAA0I,UAAU;AACpJ;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,SAAS;AAClC;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,UAAU,wBAAwB,IAAI;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uFAAuF,QAAQ,+EAA+E;AAC9K;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uGAAuG,4BAA4B;AACnI;AACA;AACA,4DAA4D,yDAAyD;AACrH;AACA;AACA,4DAA4D,sDAAsD;AAClH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0EAA0E,gBAAgB;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA,+GAA+G,mBAAmB;AAClI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,SAAS;AAC1C;AACA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uHAAuH,qBAAqB;AAC5I;AACA;AACA;AACA;AACA;AACA;AACA,sJAAsJ,UAAU;AAChK;AACA;AACA;AACA;AACA,6CAA6C,SAAS;AACtD;AACA;AACA;AACA;AACA,0CAA0C;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,SAAS;AAC1C;AACA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,SAAS;AAClC;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,6BAA6B;AAChF,uDAAuD,6BAA6B;AACpF,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAiE,UAAU;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gEAAgE,qBAAqB;AACrF;AACA;AACA;AACA;AACA,4CAA4C,oIAAoI;AAChL;AACA;AACA;AACA;AACA;AACA,kDAAkD,yEAAyE;AAC3H;AACA;AACA;AACA,yBAAyB,SAAS;AAClC;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA,+EAA+E,UAAU;AACzF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,SAAS;AAClC;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA,uCAAuC,WAAW,mEAAmE,kBAAkB,sBAAsB,GAAG;AAChK;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wDAAwD,+BAA+B;AACvF,iEAAiE,wCAAwC;AACzG,wDAAwD,+BAA+B;AACvF,6DAA6D,oCAAoC;AACjG,0DAA0D,2BAA2B;AACrF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mKAAmK,iCAAiC;AACpM;AACA,qIAAqI,QAAQ,0GAA0G,kBAAkB,IAAI;AAC7Q;AACA;AACA;AACA;AACA;AACA;AACA,4EAA4E,kCAAkC;AAC9G;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+GAA+G,kBAAkB;AACjI;AACA;AACA;AACA;AACA,qCAAqC,SAAS;AAC9C;AACA;AACA;AACA;AACA,kCAAkC;AAClC;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,6BAA6B,SAAS;AACtC;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA;AACA,0EAA0E,UAAU;AACpF;AACA;AACA;AACA;AACA,yBAAyB,SAAS;AAClC;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sHAAsH,2BAA2B;AACjJ;AACA;AACA;AACA;AACA;AACA,+GAA+G,mBAAmB;AAClI;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,SAAS;AAC1C;AACA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA;AACA;AACA,yBAAyB,SAAS;AAClC;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA,0HAA0H,2BAA2B;AACrJ;AACA;AACA;AACA;AACA,6BAA6B,SAAS;AACtC;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA;AACA,0EAA0E,UAAU;AACpF;AACA;AACA;AACA,gIAAgI,QAAQ,iGAAiG,kBAAkB,IAAI;AAC/P;AACA;AACA;AACA;AACA,gLAAgL,mBAAmB;AACnM;AACA;AACA,qGAAqG,UAAU;AAC/G;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,SAAS;AAClD;AACA;AACA;AACA;AACA,sCAAsC;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+IAA+I,2BAA2B;AAC1K;AACA;AACA;AACA;AACA,iCAAiC,SAAS;AAC1C;AACA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA;AACA;AACA,iGAAiG,UAAU;AAC3G;AACA;AACA;AACA;AACA,qCAAqC,SAAS;AAC9C;AACA;AACA;AACA;AACA,kCAAkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,SAAS;AAClC;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA,kHAAkH,0BAA0B;AAC5I;AACA;AACA;AACA;AACA,yBAAyB,SAAS;AAClC;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kIAAkI,8BAA8B;AAChK;AACA;AACA;AACA;AACA,yBAAyB,SAAS;AAClC;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD,oBAAoB;AAC1E,wDAAwD,uBAAuB;AAC/E,yDAAyD,0BAA0B;AACnF;AACA;AACA;AACA;AACA,+GAA+G,oBAAoB;AACnI;AACA,gIAAgI,QAAQ,gGAAgG,kBAAkB,IAAI;AAC9P;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,SAAS;AACtC;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA;AACA,0EAA0E,UAAU;AACpF;AACA;AACA;AACA;AACA,yBAAyB,SAAS;AAClC;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA,6BAA6B,2BAA2B;AACxD,qGAAqG;AACrG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8GAA8G,yBAAyB;AACvI;AACA,yGAAyG;AACzG;AACA;AACA;AACA,yBAAyB,SAAS;AAClC;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8FAA8F,qBAAqB;AACnH;AACA;AACA,2IAA2I,UAAU;AACrJ;AACA;AACA;AACA;AACA,iCAAiC,SAAS;AAC1C;AACA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA;AACA;AACA,yBAAyB,SAAS;AAClC;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,+CAA+C;AAC5F,+CAA+C,+CAA+C;AAC9F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,yBAAyB,uBAAuB;AAChD;AACA;AACA;AACA;AACA,0EAA0E,gBAAgB;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA,+DAA+D;AAC/D;AACA;AACA,gEAAgE;AAChE;AACA;AACA;AACA;AACA,yBAAyB,SAAS;AAClC;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA,oCAAoC,QAAQ;AAC5C;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,mBAAmB;AAC1E,kHAAkH,mBAAmB;AACrI,gGAAgG,0MAA0M;AAC1S;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA,2FAA2F,mBAAmB;AAC9G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;;AAEA,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA,kBAAkB,MAA+B;AACjD;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA,6DAA6D,sCAAsC,qBAAqB,sBAAsB,gBAAgB,eAAe,0BAA0B,qBAAqB,qCAAqC,mBAAmB,qCAAqC,yBAAyB,kFAAkF,GAAG,mDAAmD,2BAA2B,wBAAwB,GAAG,iDAAiD,kCAAkC,GAAG,2CAA2C,yBAAyB,GAAG,0CAA0C,wBAAwB,mBAAmB,kCAAkC,mCAAmC,mBAAmB,gCAAgC,kCAAkC,mCAAmC,GAAG,4CAA4C,mBAAmB,yBAAyB,qCAAqC,sCAAsC,uBAAuB,GAAG,kDAAkD,iBAAiB,kBAAkB,GAAG,kDAAkD,oBAAoB,2BAA2B,gBAAgB,gBAAgB,kCAAkC,kCAAkC,uCAAuC,sCAAsC,gCAAgC,uCAAuC,iBAAiB,gBAAgB,uBAAuB,GAAG,iDAAiD,oBAAoB,2BAA2B,gBAAgB,gBAAgB,kCAAkC,gCAAgC,uCAAuC,sCAAsC,2CAA2C,uCAAuC,iBAAiB,gBAAgB,uBAAuB,GAAG,uBAAuB,6BAA6B,uBAAuB,GAAG;AACrlE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qGAAqG;AACrG;AACA;AACA;AACA;AACA,wDAAwD,oCAAoC;AAC5F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8FAA8F,mBAAmB;AACjH;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,QAAQ;AACxC;AACA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA,aAAa,IAAI,wBAAwB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+DAA+D;AAC/D,2DAA2D;AAC3D,yCAAyC;AACzC,2CAA2C;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sEAAsE,kHAAkH;AACxL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D,uCAAuC;AAClG;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,kBAAkB,MAA+B;AACjD;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC;AAClC;AACA,8EAA8E,kBAAkB;AAChG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,QAAQ;AAC5B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,2BAA2B;AAC1E;AACA;AACA,kCAAkC;AAClC;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,gBAAgB;AACzD;AACA;AACA,kCAAkC;AAClC;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,2BAA2B;AAC1E;AACA;AACA,kCAAkC;AAClC;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,kCAAkC;AAClC;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC;AACvC;AACA,sEAAsE,sBAAsB;AAC5F,SAAS;AACT;AACA;AACA;AACA;AACA;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;;AAEA,iBAAiB,MAA6B;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,uBAAuB,MAAoC;AAC3D,qDAAqD,QAAQ;AAC7D;AACA;AACA;AACA,kBAAkB,MAA+B;AACjD;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,cAAc;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,qBAAqB;AAC9C;AACA;AACA;AACA,0GAA0G,wBAAwB;AAClI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,QAAQ;AAChC;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA,0GAA0G,wBAAwB;AAClI;AACA;AACA;AACA;AACA,wBAAwB,QAAQ;AAChC;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;AACA,uBAAuB,sCAAsC;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kEAAkE,UAAU;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA,8HAA8H,uBAAuB;AACrJ;AACA;AACA;AACA;AACA,gCAAgC,QAAQ;AACxC;AACA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA;AACA;AACA,wBAAwB,QAAQ;AAChC;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,kEAAkE;AACzF;AACA;AACA;AACA,yBAAyB,qBAAqB;AAC9C;AACA;AACA;AACA;AACA,0GAA0G,wBAAwB;AAClI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,QAAQ;AAChC;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kHAAkH,wBAAwB;AAC1I;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,QAAQ;AACxC;AACA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,2BAA2B;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,mEAAmE;AAC/F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2EAA2E,oBAAoB;AAC/F,+EAA+E,oBAAoB;AACnG,+EAA+E,oBAAoB;AACnG;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,cAAc;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,kBAAkB,MAA+B;AACjD;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA,gBAAgB,MAA6B;AAC7C;AACA;AACA;AACA;AACA,6DAA6D,cAAc;AAC3E;AACA;AACA;AACA;AACA;AACA,kBAAkB,MAA+B;AACjD;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,iBAAiB,MAA6B;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,uBAAuB,MAAoC;AAC3D,qDAAqD,QAAQ;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,gDAAgD;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B,8BAA8B,qMAAqM;AACnO;AACA;AACA;AACA,2BAA2B;AAC3B,8BAA8B,uMAAuM;AACrO;AACA;AACA;AACA,2BAA2B;AAC3B;AACA,wBAAwB,qJAAqJ;AAC7K;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA,2BAA2B;AAC3B,yCAAyC,uDAAuD,+BAA+B;AAC/H;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,qCAAqC;AAC3E,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sQAAsQ,0EAA0E;AAChV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,2EAA2E,uBAAuB;AAClG,4EAA4E,wBAAwB;AACpG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,2DAA2D,oBAAoB;AAC/E;AACA;AACA,yDAAyD,4DAA4D;AACrH;AACA;AACA;AACA;AACA;AACA,sDAAsD,4CAA4C;AAClG;AACA;AACA,SAAS;AACT;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,uBAAuB;AACpD;AACA;AACA;AACA,kFAAkF,iBAAiB;AACnG;AACA;AACA;AACA;AACA,4BAA4B,QAAQ;AACpC;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iGAAiG;AACjG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8FAA8F,qBAAqB;AACnH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA,wBAAwB,QAAQ;AAChC;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,CAAC;;AAED,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA,8BAA8B;AAC9B,gCAAgC;AAChC,iCAAiC;AACjC,+BAA+B;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,kBAAkB,MAA+B;AACjD;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8FAA8F,mBAAmB;AACjH;AACA;AACA;AACA;AACA;AACA,gCAAgC,QAAQ;AACxC;AACA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,QAAQ;AAC7C;AACA,wCAAwC,QAAQ;AAChD;AACA;AACA,kCAAkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA,mCAAmC,wCAAwC,qCAAqC,IAAI;AACpH,oBAAoB,iBAAiB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,yDAAyD;AAC1G,aAAa;AACb;AACA;AACA;AACA,gEAAgE,kCAAkC,iDAAiD,IAAI;AACvJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,2CAA2C,QAAQ;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,oBAAoB,iBAAiB;AACrC;AACA;AACA;AACA;AACA;AACA;;AAEA,mBAAmB,MAAgC;AACnD,4BAA4B,+DAA+D,iBAAiB;AAC5G,0BAA0B,OAAO;AACjC,oCAAoC,MAAM,+BAA+B,YAAY;AACrF,mCAAmC,MAAM,mCAAmC,YAAY;AACxF,gCAAgC;AAChC;AACA,KAAK;AACL;AACA,qBAAqB,MAAkC;AACvD,cAAc,6BAA6B,0BAA0B,cAAc,qBAAqB;AACxG,iBAAiB,oDAAoD,qEAAqE,cAAc;AACxJ,uBAAuB,sBAAsB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC,mCAAmC,SAAS;AAC5C,mCAAmC,WAAW,UAAU;AACxD,0CAA0C,cAAc;AACxD;AACA,8GAA8G,OAAO;AACrH,iFAAiF,iBAAiB;AAClG,yDAAyD,gBAAgB,QAAQ;AACjF,+CAA+C,gBAAgB,gBAAgB;AAC/E;AACA,kCAAkC;AAClC;AACA;AACA,UAAU,YAAY,aAAa,SAAS,UAAU;AACtD,oCAAoC,SAAS;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,mCAAmC;AACvF;AACA;AACA;AACA,kCAAkC;AAClC;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,cAAc;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD,OAAO;AAC7D;AACA,iCAAiC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT;AACA;;AAEA;AACA,eAAe,OAAO;AACtB,iCAAiC,4BAA4B;AAC7D,KAAK;AACL;;AAEA,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,kBAAkB,MAA+B;AACjD;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,MAA6B;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,uBAAuB,MAAoC;AAC3D,qDAAqD,QAAQ;AAC7D;AACA;AACA;AACA,kBAAkB,MAA+B;AACjD;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D,QAAQ,mGAAmG;AACtK;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sFAAsF,oBAAoB;AAC1G;AACA;AACA;AACA;AACA,oBAAoB,QAAQ;AAC5B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,qBAAqB;AACjE,sCAAsC,uBAAuB;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,gDAAgD,2CAA2C,2BAA2B,qBAAqB;AAC3I;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,mCAAmC,6BAA6B;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,qBAAqB;AACnE;AACA,sCAAsC,oBAAoB;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0EAA0E,iBAAiB;AAC3F;AACA;AACA;AACA;AACA,oBAAoB,QAAQ;AAC5B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B,oSAAoS,yJAAyJ;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+EAA+E,aAAa,uEAAuE;AACnK,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8EAA8E,aAAa,sEAAsE;AACjK;AACA;AACA,iGAAiG,aAAa,sEAAsE;AACpL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yJAAyJ;AACzJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,uBAAuB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA,0JAA0J,wDAAwD;AAClN,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iGAAiG,2DAA2D;AAC5J;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,kBAAkB,MAA+B;AACjD;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,gBAAgB,MAA6B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,uBAAuB,MAAoC;AAC3D,qDAAqD,QAAQ;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6FAA6F,6BAA6B;AAC1H;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,uBAAuB;AAChD;AACA;AACA;AACA;AACA;AACA,8FAA8F,qBAAqB;AACnH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,QAAQ;AAChC;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,uBAAuB;AAChD;AACA;AACA;AACA;AACA;AACA,8FAA8F,qBAAqB;AACnH;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,QAAQ;AAChC;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,uBAAuB;AAChD;AACA;AACA;AACA;AACA;AACA,8FAA8F,qBAAqB;AACnH;AACA;AACA;AACA;AACA;AACA,wBAAwB,QAAQ;AAChC;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA,qHAAqH,yCAAyC;AAC9J;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA,0BAA0B;AAC1B;;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,qCAAqC;;AAE7E,kBAAkB,MAA+B;AACjD;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,gCAAgC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,oBAAoB;AAC5C,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,WAAW;AACzD;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,kBAAkB,MAA+B;AACjD;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,MAA6B;AAC7C;AACA;AACA;AACA;AACA,6DAA6D,cAAc;AAC3E;AACA;AACA;AACA;AACA;AACA,kBAAkB,MAA+B;AACjD;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,gBAAgB,MAA6B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,WAAW,sGAAsG;AACjK;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD,iBAAiB;AACvE;AACA;AACA;AACA;AACA,gDAAgD,mBAAmB;AACnE;AACA;AACA;AACA;AACA,0CAA0C;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8EAA8E,iBAAiB;AAC/F;AACA;AACA,0EAA0E,kBAAkB,mFAAmF;AAC/K;AACA;AACA;AACA,wBAAwB,QAAQ;AAChC;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mEAAmE,WAAW,gBAAgB;AAC9F;AACA;AACA;AACA,gDAAgD,WAAW,+BAA+B;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,sCAAsC;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6DAA6D,qCAAqC;AAClG;AACA;AACA,0CAA0C,OAAO;AACjD;AACA,aAAa;AACb,0DAA0D,2CAA2C;AACrG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,gBAAgB,MAA6B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,OAAO;AAC7C;AACA,SAAS;AACT;AACA;AACA;AACA,CAAC;;AAED,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,gBAAgB,MAA6B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,OAAO;AAC7C;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,kBAAkB,MAA+B;AACjD;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,MAAgC;AACnD,4BAA4B,+DAA+D,iBAAiB;AAC5G,0BAA0B,OAAO;AACjC,oCAAoC,MAAM,+BAA+B,YAAY;AACrF,mCAAmC,MAAM,mCAAmC,YAAY;AACxF,gCAAgC;AAChC;AACA,KAAK;AACL;AACA,qBAAqB,MAAkC;AACvD,cAAc,6BAA6B,0BAA0B,cAAc,qBAAqB;AACxG,iBAAiB,oDAAoD,qEAAqE,cAAc;AACxJ,uBAAuB,sBAAsB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC,mCAAmC,SAAS;AAC5C,mCAAmC,WAAW,UAAU;AACxD,0CAA0C,cAAc;AACxD;AACA,8GAA8G,OAAO;AACrH,iFAAiF,iBAAiB;AAClG,yDAAyD,gBAAgB,QAAQ;AACjF,+CAA+C,gBAAgB,gBAAgB;AAC/E;AACA,kCAAkC;AAClC;AACA;AACA,UAAU,YAAY,aAAa,SAAS,UAAU;AACtD,oCAAoC,SAAS;AAC7C;AACA;AACA,kBAAkB,MAA+B;AACjD;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,yBAAyB,GAAG;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA,gDAAgD;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kHAAkH,0BAA0B;AAC5I;AACA;AACA,yEAAyE,eAAe;AACxF;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,QAAQ;AAChC;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA,8IAA8I,iCAAiC;AAC/K;AACA;AACA,wEAAwE,gBAAgB;AACxF;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,QAAQ;AAChC;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8IAA8I,iCAAiC;AAC/K;AACA;AACA;AACA;AACA,wBAAwB,QAAQ;AAChC;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA,kHAAkH,0BAA0B;AAC5I;AACA;AACA;AACA;AACA,wBAAwB,QAAQ;AAChC;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA,2DAA2D,yBAAyB;AACpF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kEAAkE,6BAA6B;AAC/F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qFAAqF,cAAc,aAAa,YAAY;AAC5H,6EAA6E,mCAAmC;AAChH;AACA;AACA;AACA,kFAAkF,iBAAiB;AACnG;AACA;AACA;AACA;AACA,gCAAgC,QAAQ;AACxC;AACA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,oGAAoG;AAChJ;AACA;AACA;AACA;AACA,2CAA2C,qCAAqC,gEAAgE;AAChJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,sCAAsC;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,kBAAkB,MAA+B;AACjD;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,gBAAgB,MAA6B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8EAA8E,sCAAsC;AACpH,2CAA2C,qDAAqD;AAChG;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uEAAuE,UAAU;AACjF;AACA;AACA;AACA;AACA,wBAAwB,QAAQ;AAChC;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA,2FAA2F,UAAU;AACrG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,QAAQ;AAChC;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gFAAgF;AAChF;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA;AACA,CAAC;;AAED,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,kBAAkB,MAA+B;AACjD;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,MAA+B;AACjD;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,gBAAgB,MAA6B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iFAAiF,UAAU;AAC3F;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,QAAQ;AAChC;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,4BAA4B;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iFAAiF,UAAU;AAC3F;AACA;AACA;AACA;AACA,wBAAwB,QAAQ;AAChC;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA,4CAA4C,qBAAqB,oEAAoE,MAAM,YAAY;AACvJ;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA,CAAC;;AAED,kBAAkB,MAA+B;AACjD;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,UAAU,wBAAwB;AAC9E,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,0CAA0C;;AAE3C;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B,oCAAoC;AACpC,oCAAoC,4CAA4C;AAChF;AACA;AACA,CAAC;;AAED,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,kBAAkB,MAA+B;AACjD;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,gBAAgB,MAA6B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA,4CAA4C;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;AACA;AACA,4CAA4C;AAC5C;AACA;AACA;AACA,iDAAiD,sCAAsC;AACvF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,kFAAkF,UAAU;AAC5F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,QAAQ;AACpC;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,iBAAiB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,0HAA0H,4BAA4B;AACtJ;AACA;AACA;AACA;AACA,wBAAwB,QAAQ;AAChC;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D,+BAA+B;AAC1F;AACA;AACA,2DAA2D,0BAA0B;AACrF;AACA;AACA;AACA;AACA;AACA,6CAA6C,+BAA+B;AAC5E;AACA;AACA,6CAA6C,0BAA0B;AACvE;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD;AACzD,sCAAsC;AACtC;AACA;AACA;AACA;AACA,gDAAgD;AAChD;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,kBAAkB,MAA+B;AACjD;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC;AACnC,mCAAmC;AACnC,mCAAmC;AACnC,uCAAuC;AACvC;AACA;AACA;AACA,0EAA0E,iBAAiB;AAC3F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,YAAY;AACjD;AACA;AACA;AACA,oBAAoB,QAAQ;AAC5B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,YAAY;AAC7C;AACA,KAAK;AACL;AACA;;AAEA,kBAAkB,MAA+B;AACjD;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,0BAA0B;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,0BAA0B;AAClD;AACA;AACA;AACA;AACA,wBAAwB,wBAAwB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0FAA0F,oBAAoB;AAC9G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,QAAQ;AAChC;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,sBAAsB;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,SAAS;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA,yDAAyD;AACzD,kCAAkC,wEAAwE;AAC1G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sFAAsF;AACtF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA,kBAAkB,MAA+B;AACjD;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8EAA8E,iBAAiB;AAC/F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,QAAQ;AAChC;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,qBAAqB;AACxD;AACA;AACA,CAAC;;AAED,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA,wCAAwC,0BAA0B;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU,wBAAwB;AAClC,UAAU,cAAc;AACxB,UAAU,cAAc;AACxB,UAAU,cAAc;AACxB,UAAU,cAAc;AACxB,UAAU,cAAc;AACxB,UAAU,cAAc;AACxB,UAAU,cAAc;AACxB,UAAU,cAAc;AACxB,UAAU,cAAc;AACxB,UAAU,cAAc;AACxB,UAAU,cAAc;AACxB;AACA;AACA,CAAC;;AAED,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU,wBAAwB;AAClC,UAAU,cAAc;AACxB,UAAU,cAAc;AACxB,UAAU,cAAc;AACxB,UAAU,cAAc;AACxB;AACA;AACA,CAAC;;AAED,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU,6BAA6B;AACvC,UAAU,aAAa;AACvB,UAAU,aAAa;AACvB,UAAU,aAAa;AACvB,UAAU,aAAa;AACvB,UAAU,aAAa;AACvB,UAAU,aAAa;AACvB,UAAU,aAAa;AACvB,UAAU,aAAa;AACvB,UAAU,aAAa;AACvB,UAAU,aAAa;AACvB,UAAU,aAAa;AACvB;AACA;AACA,CAAC;;AAED,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU,2BAA2B;AACrC,UAAU,iBAAiB;AAC3B,UAAU,aAAa;AACvB;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,kBAAkB,MAA+B;AACjD;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,kBAAkB,iBAAiB,kBAAkB;AAC7F;AACA;AACA;AACA;AACA,yCAAyC,kBAAkB,iBAAiB,kBAAkB;AAC9F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,mBAAmB;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6EAA6E;AAC7E,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,2BAA2B;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wEAAwE,oBAAoB;AAC5F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,2DAA2D,UAAU;AACrE;AACA;AACA;AACA;AACA,oBAAoB,QAAQ;AAC5B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,4BAA4B,eAAe;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,oBAAoB;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wEAAwE,wCAAwC;AAChH,wEAAwE,4CAA4C;AACpH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA,gBAAgB,MAA6B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,uBAAuB,MAAoC;AAC3D,qDAAqD,QAAQ;AAC7D;AACA;AACA;AACA,kBAAkB,MAA+B;AACjD;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA,+DAA+D,uCAAuC,kCAAkC,IAAI;AAC5I;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,2DAA2D;AAC5F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D,wCAAwC,oBAAoB,sCAAsC;AAC7J;AACA;AACA;AACA,uEAAuE,mCAAmC;AAC1G,0EAA0E,yCAAyC;AACnH,uEAAuE,wCAAwC;AAC/G;AACA;AACA,yEAAyE,4CAA4C;AACrH;AACA,mJAAmJ,qBAAqB,qDAAqD,iDAAiD,qBAAqB,gDAAgD,oBAAoB,8BAA8B;AACrY;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,aAAa;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,YAAY;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kGAAkG,qBAAqB;AACvH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,QAAQ;AACpC;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D,qCAAqC;AACjG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV,iBAAiB;AACjB;AACA;AACA,qCAAqC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,+BAA+B;AAC/B;AACA,2EAA2E,UAAU;AACrF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,QAAQ;AAChC;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,qBAAqB;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,sEAAsE,4BAA4B;AAClG,4FAA4F,yEAAyE;AACrK;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,qBAAqB;AAC1E;AACA;AACA;AACA;AACA;AACA,mEAAmE,2GAA2G,qCAAqC,MAAM;AACzN;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,6DAA6D,wDAAwD;AACrH;AACA;AACA,sEAAsE,4BAA4B;AAClG,8GAA8G,sEAAsE;AACpL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uFAAuF,gFAAgF;AACvK;AACA;AACA,6DAA6D,gGAAgG,oBAAoB,oBAAoB;AACrM;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,gBAAgB,MAA6B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,uBAAuB,MAAoC;AAC3D,qDAAqD,QAAQ;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,uBAAuB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,kBAAkB,MAA+B;AACjD;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,MAAgC;AACnD,4BAA4B,+DAA+D,iBAAiB;AAC5G,0BAA0B,OAAO;AACjC,oCAAoC,MAAM,+BAA+B,YAAY;AACrF,mCAAmC,MAAM,mCAAmC,YAAY;AACxF,gCAAgC;AAChC;AACA,KAAK;AACL;AACA,qBAAqB,MAAkC;AACvD,cAAc,6BAA6B,0BAA0B,cAAc,qBAAqB;AACxG,iBAAiB,oDAAoD,qEAAqE,cAAc;AACxJ,uBAAuB,sBAAsB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC,mCAAmC,SAAS;AAC5C,mCAAmC,WAAW,UAAU;AACxD,0CAA0C,cAAc;AACxD;AACA,8GAA8G,OAAO;AACrH,iFAAiF,iBAAiB;AAClG,yDAAyD,gBAAgB,QAAQ;AACjF,+CAA+C,gBAAgB,gBAAgB;AAC/E;AACA,kCAAkC;AAClC;AACA;AACA,UAAU,YAAY,aAAa,SAAS,UAAU;AACtD,oCAAoC,SAAS;AAC7C;AACA;AACA,kBAAkB,MAA+B;AACjD;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,gBAAgB,MAA6B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,uBAAuB,MAAoC;AAC3D,qDAAqD,QAAQ;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,OAAO;AACjD;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB,qBAAqB;AACrB,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8DAA8D,YAAY,wDAAwD,IAAI;AACtI;AACA;AACA;AACA;AACA;AACA,4DAA4D,kEAAkE;AAC9H;AACA;AACA;AACA,wDAAwD,mBAAmB;AAC3E;AACA;AACA;AACA;AACA,sFAAsF,kBAAkB;AACxG;AACA;AACA;AACA;AACA,gCAAgC,QAAQ;AACxC;AACA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,0BAA0B;AACjE,oCAAoC,oBAAoB;AACxD,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,cAAc;AACzD;AACA;AACA;AACA,8EAA8E,UAAU;AACxF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,QAAQ;AAC5C;AACA;AACA;AACA;AACA,kCAAkC;AAClC;AACA;AACA,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,sEAAsE,UAAU;AAChF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,QAAQ;AAChC;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,oBAAoB;AAC3E;AACA,sFAAsF,qBAAqB;AAC3G,qBAAqB,GAAG;AACxB,aAAa;AACb;AACA,4BAA4B,uBAAuB;AACnD;AACA;AACA;AACA,yCAAyC,QAAQ;AACjD;AACA,CAAC;;AAED,gBAAgB,MAA6B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,uBAAuB,MAAoC;AAC3D,qDAAqD,QAAQ;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uFAAuF;AACvF,kCAAkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,oIAAoI;AACpI;AACA,sCAAsC,OAAO;AAC7C;AACA,SAAS;AACT;AACA,sCAAsC,OAAO;AAC7C;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,6CAA6C,eAAe;AAC5D,iBAAiB;AACjB;AACA;AACA,CAAC;;AAED,kBAAkB,MAA+B;AACjD;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4FAA4F;AAC5F;AACA;AACA;AACA,uFAAuF;AACvF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA,4BAA4B;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4FAA4F;AAC5F;AACA;AACA;AACA;AACA;AACA,gCAAgC,uEAAuE;AACvG;AACA;AACA;AACA;AACA;AACA;AACA,4FAA4F;AAC5F;AACA;AACA;AACA;AACA;AACA,4EAA4E,kBAAkB;AAC9F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kFAAkF,UAAU;AAC5F;AACA;AACA,qGAAqG,UAAU;AAC/G;AACA;AACA;AACA;AACA,gCAAgC,QAAQ;AACxC;AACA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA;AACA;AACA,wBAAwB,QAAQ;AAChC;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,kBAAkB,MAA+B;AACjD;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA,mBAAmB,MAAgC;AACnD,4BAA4B,+DAA+D,iBAAiB;AAC5G,0BAA0B,OAAO;AACjC,oCAAoC,MAAM,+BAA+B,YAAY;AACrF,mCAAmC,MAAM,mCAAmC,YAAY;AACxF,gCAAgC;AAChC;AACA,KAAK;AACL;AACA,qBAAqB,MAAkC;AACvD,cAAc,6BAA6B,0BAA0B,cAAc,qBAAqB;AACxG,iBAAiB,oDAAoD,qEAAqE,cAAc;AACxJ,uBAAuB,sBAAsB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC,mCAAmC,SAAS;AAC5C,mCAAmC,WAAW,UAAU;AACxD,0CAA0C,cAAc;AACxD;AACA,8GAA8G,OAAO;AACrH,iFAAiF,iBAAiB;AAClG,yDAAyD,gBAAgB,QAAQ;AACjF,+CAA+C,gBAAgB,gBAAgB;AAC/E;AACA,kCAAkC;AAClC;AACA;AACA,UAAU,YAAY,aAAa,SAAS,UAAU;AACtD,oCAAoC,SAAS;AAC7C;AACA;AACA,gBAAgB,MAA6B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,kBAAkB,MAA+B;AACjD;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,uBAAuB,MAAoC;AAC3D,qDAAqD,QAAQ;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,iCAAiC;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,+DAA+D,YAAY,yBAAyB;AACpG;AACA;AACA;AACA,mCAAmC,sBAAsB;AACzD,aAAa;AACb;AACA;AACA;AACA,gEAAgE,YAAY,+BAA+B;AAC3G;AACA;AACA;AACA;AACA;AACA,+BAA+B,cAAc;AAC7C;AACA;AACA;AACA;AACA,sCAAsC,uDAAuD;AAC7F;AACA;AACA;AACA;AACA,+EAA+E,wEAAwE;AACvJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0DAA0D,sBAAsB;AAChF;AACA;AACA,mCAAmC;AACnC;AACA,wCAAwC,4CAA4C;AACpF,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,uEAAuE,6CAA6C;AACpH,uEAAuE,8CAA8C;AACrH;AACA,yEAAyE,8BAA8B;AACvG,4EAA4E,oCAAoC;AAChH,yEAAyE,kCAAkC;AAC3G,yEAAyE,8BAA8B;AACvG,wEAAwE,yBAAyB;AACjG,oEAAoE,gCAAgC;AACpG;AACA;AACA,SAAS;AACT,kFAAkF,2CAA2C;AAC7H;AACA,gEAAgE,4BAA4B;AAC5F,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,4CAA4C;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oFAAoF,UAAU;AAC9F;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,QAAQ;AAChC;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,qBAAqB;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,uBAAuB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0DAA0D,6BAA6B;AACvF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA,+BAA+B;AAC/B,6DAA6D;AAC7D;AACA,oDAAoD,oCAAoC;AACxF;AACA;AACA,kHAAkH,0BAA0B;AAC5I;AACA;AACA;AACA;AACA,wBAAwB,QAAQ;AAChC;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mHAAmH,uBAAuB,0BAA0B,IAAI;AACxK;AACA,6CAA6C,OAAO;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qEAAqE,2DAA2D;AAChI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,sDAAsD,qBAAqB,sCAAsC,oBAAoB;AACrI;AACA;AACA;AACA,aAAa;AACb;AACA,kDAAkD,wBAAwB;AAC1E,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,+CAA+C,iCAAiC;AAChF,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,sFAAsF;AACtF;AACA;AACA;AACA;AACA;AACA,mHAAmH;AACnH;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA,8GAA8G,yBAAyB;AACvI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sIAAsI,yBAAyB;AAC/J;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,QAAQ;AACxC;AACA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA;AACA;AACA,wBAAwB,QAAQ;AAChC;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,8BAA8B;AACnE;AACA;AACA;AACA;AACA,0DAA0D,4BAA4B;AACtF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wEAAwE,uCAAuC;AAC/G;AACA;AACA;AACA,6CAA6C,OAAO;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,mEAAmE,UAAU;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,QAAQ;AAChC;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA,kCAAkC,gEAAgE;AAClG;AACA,oDAAoD,+BAA+B;AACnF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,wBAAwB;AACnE;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oEAAoE,6BAA6B;AACjG;AACA;AACA;AACA,yHAAyH;AACzH;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yFAAyF,wBAAwB;AACjH,0FAA0F,wBAAwB;AAClH;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8GAA8G,yBAAyB;AACvI;AACA;AACA;AACA;AACA,qGAAqG;AACrG;AACA;AACA;AACA;AACA,+BAA+B;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,QAAQ;AAChC;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,wBAAwB;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,4IAA4I;AACxL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,gDAAgD,oCAAoC;AACpF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,oCAAoC;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,WAAW,yLAAyL;AAC/O;AACA;AACA;AACA;AACA;AACA;AACA,kFAAkF;AAClF,mFAAmF;AACnF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,gCAAgC;AACnF;AACA;AACA;AACA;AACA;AACA,yDAAyD,gCAAgC;AACzF;AACA;AACA;AACA,oCAAoC;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,0EAA0E,qBAAqB;AAC/F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,uGAAuG,+BAA+B;AACtI,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,gBAAgB,MAA6B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,cAAc;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sEAAsE,+BAA+B;AACrG;AACA;AACA,mDAAmD,qCAAqC;AACxF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,iBAAiB;AACjB;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,qDAAqD,wBAAwB;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+DAA+D,wBAAwB;AACvF;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,WAAW;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC;AACzC;AACA;AACA,KAAK;AACL;AACA,+BAA+B,0BAA0B;AACzD;AACA;AACA,+BAA+B,0BAA0B;AACzD;AACA;AACA,+BAA+B,0BAA0B;AACzD;AACA;AACA,+BAA+B,0BAA0B;AACzD;AACA;AACA,CAAC;;AAED,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA,0EAA0E,0CAA0C;AACpH;;AAEA,gBAAgB,MAA6B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD,4BAA4B;AACrF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD,4BAA4B;AACrF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sEAAsE,+BAA+B;AACrG;AACA;AACA,mDAAmD,qCAAqC;AACxF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B,+BAA+B;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,KAAK;AACL,gCAAgC,2BAA2B;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,QAAQ;AAC5B;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,kCAAkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,yCAAyC;AAC/D,sBAAsB,oCAAoC;AAC1D,sBAAsB,6CAA6C;AACnE,sBAAsB,wCAAwC;AAC9D;AACA,yBAAyB,mEAAmE;AAC5F;AACA,yBAAyB,kFAAkF;AAC3G,yBAAyB,oEAAoE;AAC7F;AACA;AACA;AACA,KAAK;AACL,yBAAyB,wEAAwE;AACjG,yBAAyB,wEAAwE;AACjG,yBAAyB,sEAAsE;AAC/F,yBAAyB,2EAA2E;AACpG,sBAAsB,2CAA2C;AACjE,sBAAsB,6BAA6B;AACnD,sBAAsB,gDAAgD;AACtE,yBAAyB,sEAAsE;AAC/F;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,yBAAyB,6EAA6E;AACtG,yBAAyB,wEAAwE;AACjG,yBAAyB,kEAAkE;AAC3F,yBAAyB,6EAA6E;AACtG;AACA;AACA,yBAAyB,6EAA6E;AACtG,yBAAyB,uEAAuE;AAChG,sBAAsB,qBAAqB;AAC3C,uBAAuB,aAAa;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,kEAAkE;AAChH;AACA;;AAEA,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,kBAAkB,MAA+B;AACjD;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,gBAAgB,MAA6B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,uBAAuB,MAAoC;AAC3D,qDAAqD,QAAQ;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,gDAAgD;AACjD,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8EAA8E,iBAAiB;AAC/F;AACA;AACA;AACA;AACA;AACA,wBAAwB,QAAQ;AAChC;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,qBAAqB;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,qBAAqB;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,kEAAkE;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,qEAAqE;AAC5G,8CAA8C,0BAA0B;AACxE;AACA;AACA;AACA;AACA,mCAAmC,iDAAiD;AACpF,0CAA0C,0BAA0B;AACpE;AACA;AACA;AACA,2EAA2E,6CAA6C;AACxH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,+BAA+B;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,iBAAiB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,gBAAgB,MAA6B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,uBAAuB,MAAoC;AAC3D,qDAAqD,QAAQ;AAC7D;AACA;AACA;AACA;AACA,iCAAiC;AACjC,yCAAyC;AACzC,6CAA6C;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,gDAAgD,yBAAyB;AACzE,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA,sBAAsB,iCAAiC;AACvD,sBAAsB,gCAAgC;AACtD,sBAAsB,4CAA4C;AAClE,sBAAsB,iCAAiC;AACvD,sBAAsB,kCAAkC;AACxD,sBAAsB,yCAAyC;AAC/D,sBAAsB,2BAA2B;AACjD,wBAAwB,2CAA2C;AACnE;AACA;AACA,yBAAyB,sCAAsC;AAC/D,yBAAyB,4CAA4C;AACrE,yBAAyB,gCAAgC;AACzD,yBAAyB,4CAA4C;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,yBAAyB,4CAA4C;AACrE,yBAAyB,8BAA8B;AACvD,yBAAyB,oCAAoC;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL,2BAA2B,oCAAoC;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,OAAO;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B,4BAA4B;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,0BAA0B;AAC1B;;AAEA,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA,gBAAgB,MAA6B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,uBAAuB,MAAoC;AAC3D,qDAAqD,QAAQ;AAC7D;AACA;AACA;AACA,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,sBAAsB;AAC1D,uCAAuC,4BAA4B;AACnE,wCAAwC,4DAA4D;AACpG;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8EAA8E,sBAAsB;AACpG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,SAAS;AAClC;AACA,4BAA4B,UAAU;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,YAAY;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,sBAAsB;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA,+BAA+B;AAC/B;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,gBAAgB;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,cAAc,kBAAkB,uBAAuB;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA,0DAA0D,wDAAwD;AAClH,8DAA8D,sCAAsC;AACpG,iEAAiE,4CAA4C,qEAAqE,IAAI;AACtL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,QAAQ;AAC/C;AACA,CAAC;;AAED,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,kBAAkB,MAA+B;AACjD;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA,gBAAgB,MAA6B;AAC7C;AACA;AACA;AACA;AACA,6DAA6D,cAAc;AAC3E;AACA;AACA;AACA;AACA;AACA,kBAAkB,MAA+B;AACjD;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,gBAAgB,MAA6B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,uBAAuB,MAAoC;AAC3D,qDAAqD,QAAQ;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,oBAAoB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,gDAAgD;AACjD;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,iDAAiD,0BAA0B;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,qDAAqD;AAC1F;AACA,oEAAoE,gEAAgE;AACpI,qEAAqE,iEAAiE;AACtI,0CAA0C,+BAA+B;AACzE,qCAAqC,8BAA8B;AACnE;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,kBAAkB;AACtC;AACA;AACA;AACA;AACA;AACA,iCAAiC,iBAAiB;AAClD,8BAA8B,iBAAiB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+FAA+F,iCAAiC;AAChI,2CAA2C,sEAAsE;AACjH;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,qCAAqC;AACnF,qBAAqB;AACrB,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA;AACA,8CAA8C,qCAAqC;AACnF,qBAAqB;AACrB,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA;AACA,kDAAkD,wCAAwC;AAC1F,qBAAqB;AACrB,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,2GAA2G,0CAA0C;AACrJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oFAAoF,UAAU;AAC9F;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,QAAQ;AAChC;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA,+CAA+C,aAAa;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC;AAChC,oCAAoC;AACpC;AACA;AACA;AACA,gCAAgC;AAChC,oCAAoC;AACpC;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA,sBAAsB;AACtB;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kFAAkF,2BAA2B;AAC7G;AACA;AACA;AACA;AACA,8BAA8B,wCAAwC;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,2BAA2B,+DAA+D;AAC1F,gCAAgC,8HAA8H;AAC9J;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0DAA0D,4CAA4C;AACtG;AACA,sIAAsI,0BAA0B;AAChK;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,yIAAyI,gBAAgB,sBAAsB;AAC/K;AACA;AACA,4BAA4B,QAAQ;AACpC;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0FAA0F,oBAAoB;AAC9G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,QAAQ;AAChC;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,qBAAqB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,iFAAiF;AAC1G;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,8CAA8C,6BAA6B;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kEAAkE,kDAAkD;AACpH;AACA,kHAAkH,yBAAyB;AAC3I;AACA;AACA;AACA;AACA,4BAA4B,QAAQ;AACpC;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,qBAAqB,sBAAsB;AACpD;AACA;AACA;AACA;AACA,SAAS,qBAAqB,sBAAsB;AACpD;AACA;AACA;AACA;AACA,SAAS,qBAAqB,sBAAsB;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD;AACpD;AACA,uEAAuE;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,wDAAwD;AAC5G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,mBAAmB;AACjD;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,8HAA8H;AAC1J;AACA;AACA;AACA;AACA;AACA,oCAAoC,oCAAoC;AACxE;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,wDAAwD,gBAAgB,qGAAqG,sBAAsB,gDAAgD;AACnP,0CAA0C,QAAQ,yEAAyE;AAC3H,2CAA2C,kCAAkC;AAC7E,0CAA0C,gBAAgB,kJAAkJ;AAC5M;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oFAAoF,qBAAqB,0BAA0B;AACnI,4CAA4C;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,0BAA0B;AAC1B,wBAAwB;AACxB;AACA;AACA;AACA;AACA,0BAA0B;AAC1B,wBAAwB;AACxB;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,eAAe;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,0BAA0B;AACzD;AACA;AACA;AACA,+BAA+B,0BAA0B;AACzD;AACA;AACA;AACA,+BAA+B,0BAA0B;AACzD;AACA;AACA;AACA,+BAA+B,0BAA0B;AACzD;AACA;AACA;AACA,+BAA+B,0BAA0B;AACzD;AACA;AACA,CAAC;;AAED,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,gBAAgB,MAA6B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mGAAmG,sBAAsB;AACzH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,qCAAqC;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,iBAAiB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD;AAClD;AACA;AACA,2DAA2D;AAC3D;AACA,6EAA6E;AAC7E;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;AACA;AACA,uBAAuB;AACvB,qBAAqB;AACrB;AACA,YAAY;AACZ,YAAY;AACZ;AACA,YAAY;AACZ,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB,qBAAqB;AACrB,uBAAuB;AACvB,wBAAwB;AACxB,iCAAiC,+BAA+B;AAChE,6BAA6B,qCAAqC;AAClE;;AAEA,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,gGAAgG;AACnJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA,oCAAoC;AACpC;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,kBAAkB,MAA+B;AACjD;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA,mBAAmB,MAAgC;AACnD,4BAA4B,+DAA+D,iBAAiB;AAC5G,0BAA0B,OAAO;AACjC,oCAAoC,MAAM,+BAA+B,YAAY;AACrF,mCAAmC,MAAM,mCAAmC,YAAY;AACxF,gCAAgC;AAChC;AACA,KAAK;AACL;AACA,qBAAqB,MAAkC;AACvD,cAAc,6BAA6B,0BAA0B,cAAc,qBAAqB;AACxG,iBAAiB,oDAAoD,qEAAqE,cAAc;AACxJ,uBAAuB,sBAAsB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC,mCAAmC,SAAS;AAC5C,mCAAmC,WAAW,UAAU;AACxD,0CAA0C,cAAc;AACxD;AACA,8GAA8G,OAAO;AACrH,iFAAiF,iBAAiB;AAClG,yDAAyD,gBAAgB,QAAQ;AACjF,+CAA+C,gBAAgB,gBAAgB;AAC/E;AACA,kCAAkC;AAClC;AACA;AACA,UAAU,YAAY,aAAa,SAAS,UAAU;AACtD,oCAAoC,SAAS;AAC7C;AACA;AACA,gBAAgB,MAA6B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,uBAAuB,MAAoC;AAC3D,qDAAqD,QAAQ;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC,gCAAgC;AACjC;AACA;AACA;AACA;AACA,0BAA0B;AAC1B,4BAA4B;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,wCAAwC,2CAA2C;AACnF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4EAA4E,6BAA6B;AACzG;AACA;AACA;AACA;AACA,SAAS;AACT,2CAA2C,0BAA0B;AACrE,0CAA0C,yBAAyB;AACnE,sCAAsC,qBAAqB;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,yCAAyC;AACvF,qBAAqB;AACrB,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA;AACA,8CAA8C,yCAAyC;AACvF,qBAAqB;AACrB,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,sIAAsI,wCAAwC;AAC9K;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0GAA0G,iBAAiB;AAC3H;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,0CAA0C,iBAAiB;AACxF,wDAAwD,mBAAmB;AAC3E;AACA;AACA;AACA,0FAA0F,yBAAyB;AACnH;AACA;AACA,yFAAyF,wBAAwB;AACjH;AACA;AACA,wFAAwF,uBAAuB;AAC/G;AACA;AACA;AACA,yFAAyF,cAAc;AACvG,yBAAyB;AACzB;AACA;AACA,sFAAsF,kBAAkB;AACxG,0EAA0E,gBAAgB;AAC1F,gEAAgE,kBAAkB;AAClF;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA,0FAA0F;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,kTAAkT;AAClV,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD;AAClD;AACA,sDAAsD,sCAAsC,2GAA2G;AACvM;AACA,gBAAgB,iCAAiC,eAAe,0BAA0B,IAAI;AAC9F,gBAAgB,cAAc;AAC9B,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,6CAA6C;AAC3D,cAAc,2CAA2C;AACzD,cAAc,8CAA8C;AAC5D,cAAc,4CAA4C;AAC1D;AACA;AACA;AACA,gDAAgD;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD,wDAAwD;AAC9G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,6BAA6B;AAC7B,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA,cAAc,8BAA8B;AAC5C,cAAc,0CAA0C;AACxD,cAAc,uDAAuD;AACrE,cAAc,2CAA2C;AACzD;AACA;AACA,gDAAgD,8DAA8D;AAC9G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,wBAAwB;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,oDAAoD,sBAAsB,yBAAyB,6BAA6B;AAChI,qDAAqD,uBAAuB,yBAAyB,6BAA6B;AAClI;AACA,mCAAmC,QAAQ,gHAAgH;AAC3J,oCAAoC,6BAA6B;AACjE;AACA,mCAAmC,QAAQ,iHAAiH;AAC5J,oCAAoC,6BAA6B;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAiE,iDAAiD;AAClH;AACA,uCAAuC,QAAQ;AAC/C;AACA;AACA;AACA;AACA,uCAAuC,mBAAmB;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA,sEAAsE,mDAAmD;AACzH,sDAAsD,4BAA4B;AAClF,yDAAyD,0CAA0C;AACnG;AACA,4BAA4B,mDAAmD;AAC/E;AACA,oCAAoC,mBAAmB;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB,aAAa;AACb;AACA,wDAAwD,wCAAwC;AAChG,aAAa;AACb;AACA;AACA;AACA;AACA,uCAAuC,+CAA+C;AACtF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,+HAA+H;AAC3J;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC;AACvC;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,8CAA8C;AAC9C,iDAAiD;AACjD;AACA;AACA,SAAS;AACT,4GAA4G,oBAAoB;AAChI;AACA;AACA;AACA;AACA,iDAAiD,uBAAuB;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uMAAuM;AACvM;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,mCAAmC;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yJAAyJ,0BAA0B;AACnL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,sCAAsC;AACxD,kBAAkB,oCAAoC;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oKAAoK,4BAA4B;AAChM;AACA,mBAAmB;AACnB,SAAS;AACT;AACA;AACA,oKAAoK,4BAA4B;AAChM;AACA,mBAAmB;AACnB,SAAS;AACT;AACA;AACA,oKAAoK,4BAA4B;AAChM;AACA,mBAAmB;AACnB,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,kBAAkB,MAA+B;AACjD;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,8CAA8C;AAC9C;AACA,mCAAmC;AACnC;AACA;;AAEA;AACA,WAAW,qDAAqD;AAChE,cAAc,oDAAoD;AAClE,YAAY,qDAAqD;AACjE,aAAa,oDAAoD;AACjE,eAAe,qDAAqD;AACpE,gBAAgB,sDAAsD;AACtE,kBAAkB,oDAAoD;AACtE,mBAAmB,qDAAqD;AACxE,cAAc,oDAAoD;AAClE,kBAAkB,oDAAoD;AACtE,mBAAmB,qDAAqD;AACxE,iBAAiB,oDAAoD;AACrE,oBAAoB,qDAAqD;AACzE,qBAAqB,oDAAoD;AACzE,wBAAwB,qDAAqD;AAC7E,sBAAsB,qDAAqD;AAC3E,yBAAyB,sDAAsD;AAC/E;AACA;AACA,WAAW,oDAAoD;AAC/D,cAAc,qDAAqD;AACnE,YAAY,qDAAqD;AACjE,aAAa,oDAAoD;AACjE,eAAe,sDAAsD;AACrE,gBAAgB,qDAAqD;AACrE,kBAAkB,qDAAqD;AACvE,mBAAmB,oDAAoD;AACvE,cAAc,oDAAoD;AAClE,kBAAkB,oDAAoD;AACtE,mBAAmB,qDAAqD;AACxE,iBAAiB,qDAAqD;AACtE,oBAAoB,oDAAoD;AACxE,qBAAqB,qDAAqD;AAC1E,wBAAwB,oDAAoD;AAC5E,sBAAsB,sDAAsD;AAC5E,yBAAyB,qDAAqD;AAC9E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,WAAW,6BAA6B;AACxC,cAAc,gCAAgC;AAC9C,YAAY,8BAA8B;AAC1C,aAAa,+BAA+B;AAC5C,eAAe,kCAAkC;AACjD,gBAAgB,mCAAmC;AACnD,kBAAkB,qCAAqC;AACvD,mBAAmB,sCAAsC;AACzD,cAAc,gCAAgC;AAC9C,kBAAkB,8BAA8B;AAChD,mBAAmB,+BAA+B;AAClD,iBAAiB,6BAA6B;AAC9C,oBAAoB,gCAAgC;AACpD,qBAAqB,kCAAkC;AACvD,wBAAwB,qCAAqC;AAC7D,sBAAsB,mCAAmC;AACzD,yBAAyB,sCAAsC;AAC/D;;AAEA,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,kBAAkB,MAA+B;AACjD;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,0BAA0B,gBAAgB;AAC5F;AACA,+BAA+B,0BAA0B;AACzD;AACA;AACA,+BAA+B,0BAA0B;AACzD;AACA;AACA,+BAA+B,0BAA0B;AACzD;AACA;AACA,+BAA+B,0BAA0B;AACzD;AACA;AACA,+BAA+B,0BAA0B;AACzD;AACA;AACA,+BAA+B,0BAA0B;AACzD;AACA;AACA,+BAA+B,0BAA0B;AACzD;AACA;AACA,CAAC;;AAED,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA,gBAAgB,MAA6B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,uBAAuB,MAAoC;AAC3D,qDAAqD,QAAQ;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4EAA4E,uCAAuC,+CAA+C,IAAI;AACtK,kEAAkE,uCAAuC,uCAAuC,IAAI;AACpJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,+EAA+E;AAChH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,eAAe;AAC1D,kCAAkC,eAAe;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kGAAkG;AAClG,yBAAyB,8FAA8F;AACvH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uGAAuG;AACvG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,0EAA0E;AACvH;AACA;AACA;AACA;AACA,kCAAkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,kBAAkB,MAA+B;AACjD;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,oDAAoD,yBAAyB;AACpH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA,kBAAkB,MAA+B;AACjD;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,gBAAgB,MAA6B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,uBAAuB,MAAoC;AAC3D,qDAAqD,QAAQ;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8DAA8D,aAAa;AAC3E;AACA;AACA;AACA;AACA,wBAAwB,QAAQ;AAChC;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA,0DAA0D,QAAQ,sFAAsF,wBAAwB,mBAAmB;AACnM;AACA,wHAAwH,iBAAiB;AACzI,wHAAwH,iBAAiB;AACzI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC;AAChC,iCAAiC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2EAA2E,4BAA4B;AACvG;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA;AACA,wCAAwC,uDAAuD;AAC/F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,mDAAmD;AACnD;AACA;AACA;AACA,4DAA4D,kCAAkC;AAC9F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,QAAQ;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,sCAAsC,0CAA0C;AAChF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,UAAU,sBAAsB,IAAI;AAC3F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC,iCAAiC;AACjC,gCAAgC;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D,UAAU,kCAAkC,IAAI;AAC5G,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;;AAED,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA,gBAAgB,MAA6B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,uBAAuB,MAAoC;AAC3D,qDAAqD,QAAQ;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,mBAAmB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,8BAA8B;AACnF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mPAAmP,oEAAoE,yBAAyB;AAChV;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,wCAAwC;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,uBAAuB;AAC3E,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,uBAAuB;AACvE,qBAAqB;AACrB;AACA;AACA,SAAS;AACT;AACA;AACA,6CAA6C,uCAAuC;AACpF;AACA;AACA;AACA;AACA,oCAAoC,sCAAsC;AAC1E,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,wBAAwB,eAAe;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,kBAAkB,MAA+B;AACjD;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,MAAgC;AACnD,4BAA4B,+DAA+D,iBAAiB;AAC5G,0BAA0B,OAAO;AACjC,oCAAoC,MAAM,+BAA+B,YAAY;AACrF,mCAAmC,MAAM,mCAAmC,YAAY;AACxF,gCAAgC;AAChC;AACA,KAAK;AACL;AACA,qBAAqB,MAAkC;AACvD,cAAc,6BAA6B,0BAA0B,cAAc,qBAAqB;AACxG,iBAAiB,oDAAoD,qEAAqE,cAAc;AACxJ,uBAAuB,sBAAsB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC,mCAAmC,SAAS;AAC5C,mCAAmC,WAAW,UAAU;AACxD,0CAA0C,cAAc;AACxD;AACA,8GAA8G,OAAO;AACrH,iFAAiF,iBAAiB;AAClG,yDAAyD,gBAAgB,QAAQ;AACjF,+CAA+C,gBAAgB,gBAAgB;AAC/E;AACA,kCAAkC;AAClC;AACA;AACA,UAAU,YAAY,aAAa,SAAS,UAAU;AACtD,oCAAoC,SAAS;AAC7C;AACA;AACA,kBAAkB,MAA+B;AACjD;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,gBAAgB,MAA6B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA,qCAAqC,oDAAoD;AACzF,sCAAsC,kGAAkG;AACxI,kEAAkE,qBAAqB,aAAa,4BAA4B;AAChI,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC;AACtC,sCAAsC;AACtC;AACA;AACA,mEAAmE,oBAAoB;AACvF;AACA,+EAA+E,UAAU;AACzF;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,QAAQ;AAChC;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA,iEAAiE,+BAA+B;AAChG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,IAAI;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,SAAS;AACT;AACA;AACA,wFAAwF,UAAU;AAClG;AACA;AACA;AACA;AACA,wBAAwB,QAAQ;AAChC;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D,+BAA+B;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6DAA6D;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,0EAA0E;AACxG;AACA;AACA;AACA;AACA,CAAC;;AAED,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,mBAAmB,MAAgC;AACnD,4BAA4B,+DAA+D,iBAAiB;AAC5G,0BAA0B,OAAO;AACjC,oCAAoC,MAAM,+BAA+B,YAAY;AACrF,mCAAmC,MAAM,mCAAmC,YAAY;AACxF,gCAAgC;AAChC;AACA,KAAK;AACL;AACA,qBAAqB,MAAkC;AACvD,cAAc,6BAA6B,0BAA0B,cAAc,qBAAqB;AACxG,iBAAiB,oDAAoD,qEAAqE,cAAc;AACxJ,uBAAuB,sBAAsB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC,mCAAmC,SAAS;AAC5C,mCAAmC,WAAW,UAAU;AACxD,0CAA0C,cAAc;AACxD;AACA,8GAA8G,OAAO;AACrH,iFAAiF,iBAAiB;AAClG,yDAAyD,gBAAgB,QAAQ;AACjF,+CAA+C,gBAAgB,gBAAgB;AAC/E;AACA,kCAAkC;AAClC;AACA;AACA,UAAU,YAAY,aAAa,SAAS,UAAU;AACtD,oCAAoC,SAAS;AAC7C;AACA;AACA,gBAAgB,MAA6B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,uBAAuB,MAAoC;AAC3D,qDAAqD,QAAQ;AAC7D;AACA;AACA;AACA,kBAAkB,MAA+B;AACjD;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D,uBAAuB;AACnF;AACA;AACA;AACA;AACA;AACA,qCAAqC,oDAAoD;AACzF,sCAAsC,mFAAmF;AACzH;AACA,yBAAyB;AACzB;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,yDAAyD,iDAAiD;AAC1G;AACA,iKAAiK,8BAA8B;AAC/L;AACA,sCAAsC,mCAAmC;AACzE,uCAAuC,oCAAoC;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,mEAAmE,qCAAqC;AACxG;AACA;AACA;AACA;AACA,6BAA6B;AAC7B,iBAAiB;AACjB,4CAA4C,uCAAuC;AACnF;AACA,gCAAgC,2BAA2B;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA,4IAA4I,UAAU;AACtJ;AACA,yDAAyD,sCAAsC;AAC/F;AACA;AACA;AACA;AACA;AACA,4BAA4B,QAAQ;AACpC;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,iBAAiB;AACjB,iBAAiB;AACjB,gBAAgB,yBAAyB,GAAG;AAC5C,gBAAgB,yBAAyB,GAAG;AAC5C,iBAAiB;AACjB;AACA;AACA,kCAAkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,mBAAmB,MAAgC;AACnD,4BAA4B,+DAA+D,iBAAiB;AAC5G,0BAA0B,OAAO;AACjC,oCAAoC,MAAM,+BAA+B,YAAY;AACrF,mCAAmC,MAAM,mCAAmC,YAAY;AACxF,gCAAgC;AAChC;AACA,KAAK;AACL;AACA,qBAAqB,MAAkC;AACvD,cAAc,6BAA6B,0BAA0B,cAAc,qBAAqB;AACxG,iBAAiB,oDAAoD,qEAAqE,cAAc;AACxJ,uBAAuB,sBAAsB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC,mCAAmC,SAAS;AAC5C,mCAAmC,WAAW,UAAU;AACxD,0CAA0C,cAAc;AACxD;AACA,8GAA8G,OAAO;AACrH,iFAAiF,iBAAiB;AAClG,yDAAyD,gBAAgB,QAAQ;AACjF,+CAA+C,gBAAgB,gBAAgB;AAC/E;AACA,kCAAkC;AAClC;AACA;AACA,UAAU,YAAY,aAAa,SAAS,UAAU;AACtD,oCAAoC,SAAS;AAC7C;AACA;AACA;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,OAAO,yCAAyC;AAC7F;AACA;AACA,qFAAqF,wBAAwB;AAC7G;AACA,uDAAuD;AACvD;AACA;AACA,iCAAiC;AACjC,6BAA6B,IAAI;AACjC;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,oDAAoD;AACzF,sCAAsC,mFAAmF;AACzH;AACA,yBAAyB;AACzB;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,WAAW;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA,gBAAgB,MAA6B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,gCAAgC;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA,+CAA+C,0CAA0C;AACzF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mGAAmG,qBAAqB;AACxH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0DAA0D,cAAc;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA,kCAAkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA,uDAAuD,0EAA0E;AACjI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,0BAA0B;AACzD;AACA;AACA;AACA,+BAA+B,0BAA0B;AACzD;AACA;AACA;AACA,+BAA+B,0BAA0B;AACzD;AACA;AACA;AACA,+BAA+B,0BAA0B;AACzD;AACA;AACA;AACA,+BAA+B,0BAA0B;AACzD;AACA;AACA;AACA,+BAA+B,0BAA0B;AACzD;AACA;AACA;AACA,+BAA+B,0BAA0B;AACzD;AACA;AACA;AACA,+BAA+B,0BAA0B;AACzD;AACA;AACA;AACA,+BAA+B,0BAA0B;AACzD;AACA;AACA;AACA,+BAA+B,0BAA0B;AACzD;AACA;AACA,CAAC;;AAED,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,kBAAkB,MAA+B;AACjD;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA,mBAAmB,MAAgC;AACnD,4BAA4B,+DAA+D,iBAAiB;AAC5G,0BAA0B,OAAO;AACjC,oCAAoC,MAAM,+BAA+B,YAAY;AACrF,mCAAmC,MAAM,mCAAmC,YAAY;AACxF,gCAAgC;AAChC;AACA,KAAK;AACL;AACA,qBAAqB,MAAkC;AACvD,cAAc,6BAA6B,0BAA0B,cAAc,qBAAqB;AACxG,iBAAiB,oDAAoD,qEAAqE,cAAc;AACxJ,uBAAuB,sBAAsB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC,mCAAmC,SAAS;AAC5C,mCAAmC,WAAW,UAAU;AACxD,0CAA0C,cAAc;AACxD;AACA,8GAA8G,OAAO;AACrH,iFAAiF,iBAAiB;AAClG,yDAAyD,gBAAgB,QAAQ;AACjF,+CAA+C,gBAAgB,gBAAgB;AAC/E;AACA,kCAAkC;AAClC;AACA;AACA,UAAU,YAAY,aAAa,SAAS,UAAU;AACtD,oCAAoC,SAAS;AAC7C;AACA;AACA,kBAAkB,MAA+B;AACjD;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,gBAAgB,MAA6B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA,qCAAqC;AACrC;AACA;AACA;AACA,sCAAsC;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,8DAA8D,WAAW,2GAA2G;AACpL;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA,kDAAkD,6CAA6C;AAC/F,qBAAqB;AACrB,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA;AACA,+CAA+C;AAC/C,qBAAqB;AACrB;AACA;AACA,kDAAkD,wCAAwC;AAC1F,qBAAqB;AACrB;AACA;AACA,kDAAkD,2CAA2C;AAC7F,qBAAqB;AACrB;AACA;AACA,kDAAkD,kDAAkD;AACpG,qBAAqB;AACrB;AACA;AACA,kDAAkD,wCAAwC;AAC1F,qBAAqB;AACrB,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA;AACA,kDAAkD,+CAA+C;AACjG,qBAAqB;AACrB,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,sIAAsI,wCAAwC;AAC9K;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0KAA0K;AAC1K;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA;AACA;AACA,iCAAiC;AACjC,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA,yBAAyB;AACzB;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,OAAO,0CAA0C,iDAAiD;AACnJ;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yEAAyE,0EAA0E;AACnJ;AACA;AACA;AACA,yEAAyE,4EAA4E;AACrJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8FAA8F,iBAAiB;AAC/G;AACA;AACA;AACA;AACA,wCAAwC,QAAQ;AAChD;AACA;AACA;AACA;AACA,sCAAsC;AACtC;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,wBAAwB;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sFAAsF,6BAA6B;AACnH,mGAAmG,+BAA+B;AAClI,qBAAqB;AACrB;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA,0CAA0C;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD,gBAAgB;AACtE,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA,yEAAyE,sEAAsE;AAC/I;AACA;AACA;AACA;AACA;AACA;AACA,qEAAqE,wDAAwD;AAC7H;AACA;AACA;AACA,iDAAiD,OAAO,yDAAyD;AACjH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0GAA0G,iBAAiB;AAC3H;AACA;AACA;AACA;AACA;AACA,wDAAwD,QAAQ;AAChE;AACA;AACA;AACA;AACA,sDAAsD;AACtD;AACA;AACA;AACA;AACA,qFAAqF,0EAA0E;AAC/J;AACA;AACA,qFAAqF,sDAAsD;AAC3I;AACA;AACA;AACA,sFAAsF,4EAA4E;AAClK;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B,yBAAyB,IAAI;AAC7B;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iFAAiF,oDAAoD;AACrI;AACA;AACA;AACA;AACA;AACA,sIAAsI,2BAA2B;AACjK;AACA,+EAA+E,2DAA2D;AAC1I;AACA;AACA;AACA;AACA;AACA,4CAA4C,QAAQ;AACpD;AACA;AACA;AACA;AACA,0CAA0C;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sEAAsE,UAAU;AAChF;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA,wBAAwB,QAAQ;AAChC;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sHAAsH,2BAA2B;AACjJ;AACA;AACA,gGAAgG,UAAU;AAC1G;AACA,sEAAsE;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,QAAQ;AACxC;AACA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA;AACA;AACA,wBAAwB,QAAQ;AAChC;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,mCAAmC;AACtE,gCAAgC,qBAAqB;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sHAAsH,2BAA2B;AACjJ;AACA;AACA,gGAAgG,UAAU;AAC1G;AACA,sEAAsE;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,oBAAoB;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,QAAQ;AACxC;AACA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA;AACA;AACA,wBAAwB,QAAQ;AAChC;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wFAAwF,eAAe;AACvG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uEAAuE,qEAAqE;AAC5I;AACA;AACA,sEAAsE,uEAAuE;AAC7I;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kEAAkE,8EAA8E;AAChJ,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,0BAA0B;AACzD;AACA;AACA,CAAC;;AAED,gBAAgB,MAA6B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,8BAA8B,OAAO;AACrC;AACA;AACA;AACA,yBAAyB,uBAAuB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,kBAAkB,MAA+B;AACjD;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA,mBAAmB,MAAgC;AACnD,4BAA4B,+DAA+D,iBAAiB;AAC5G,0BAA0B,OAAO;AACjC,oCAAoC,MAAM,+BAA+B,YAAY;AACrF,mCAAmC,MAAM,mCAAmC,YAAY;AACxF,gCAAgC;AAChC;AACA,KAAK;AACL;AACA,qBAAqB,MAAkC;AACvD,cAAc,6BAA6B,0BAA0B,cAAc,qBAAqB;AACxG,iBAAiB,oDAAoD,qEAAqE,cAAc;AACxJ,uBAAuB,sBAAsB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC,mCAAmC,SAAS;AAC5C,mCAAmC,WAAW,UAAU;AACxD,0CAA0C,cAAc;AACxD;AACA,8GAA8G,OAAO;AACrH,iFAAiF,iBAAiB;AAClG,yDAAyD,gBAAgB,QAAQ;AACjF,+CAA+C,gBAAgB,gBAAgB;AAC/E;AACA,kCAAkC;AAClC;AACA;AACA,UAAU,YAAY,aAAa,SAAS,UAAU;AACtD,oCAAoC,SAAS;AAC7C;AACA;AACA,gBAAgB,MAA6B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,uBAAuB,MAAoC;AAC3D,qDAAqD,QAAQ;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,sCAAsC;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yMAAyM;AACzM;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6EAA6E,cAAc;AAC3F,+EAA+E,sCAAsC;AACrH;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0GAA0G;AAC1G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qEAAqE,eAAe;AACpF,iEAAiE,eAAe;AAChF;AACA,0BAA0B,6CAA6C;AACvE,0BAA0B,6CAA6C;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,eAAe;AACnE,6BAA6B;AAC7B;AACA;AACA;AACA,wCAAwC;AACxC,sCAAsC;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,wBAAwB;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA,wFAAwF,sCAAsC;AAC9H;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA,wDAAwD,wBAAwB;AAChF;AACA;AACA;AACA,6DAA6D,wBAAwB;AACrF;AACA;AACA;AACA,2DAA2D,wBAAwB;AACnF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,gBAAgB,GAAG;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB,uDAAuD,QAAQ;AAC/D;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,oBAAoB;AAC1D;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+EAA+E,gBAAgB;AAC/F;AACA;AACA;AACA,gLAAgL,uBAAuB;AACvM,4CAA4C,oBAAoB;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8KAA8K,uBAAuB;AACrM,0CAA0C,oBAAoB;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,yKAAyK,uBAAuB;AAChM;AACA,uBAAuB;AACvB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2EAA2E,gBAAgB;AAC3F;AACA;AACA;AACA,gCAAgC,oBAAoB;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,oBAAoB;AAClD;AACA;AACA,aAAa;AACb;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,oBAAoB;AACzC,2BAA2B,oBAAoB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,oBAAoB;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,kBAAkB,MAA+B;AACjD;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,MAA6B;AAC7C;AACA;AACA;AACA;AACA,6DAA6D,cAAc;AAC3E;AACA;AACA;AACA;AACA;AACA,gBAAgB,MAA6B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D,kMAAkM;AAC9P;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC;AACnC;AACA;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,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA,mBAAmB,MAAgC;AACnD,4BAA4B,+DAA+D,iBAAiB;AAC5G,0BAA0B,OAAO;AACjC,oCAAoC,MAAM,+BAA+B,YAAY;AACrF,mCAAmC,MAAM,mCAAmC,YAAY;AACxF,gCAAgC;AAChC;AACA,KAAK;AACL;AACA,qBAAqB,MAAkC;AACvD,cAAc,6BAA6B,0BAA0B,cAAc,qBAAqB;AACxG,iBAAiB,oDAAoD,qEAAqE,cAAc;AACxJ,uBAAuB,sBAAsB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC,mCAAmC,SAAS;AAC5C,mCAAmC,WAAW,UAAU;AACxD,0CAA0C,cAAc;AACxD;AACA,8GAA8G,OAAO;AACrH,iFAAiF,iBAAiB;AAClG,yDAAyD,gBAAgB,QAAQ;AACjF,+CAA+C,gBAAgB,gBAAgB;AAC/E;AACA,kCAAkC;AAClC;AACA;AACA,UAAU,YAAY,aAAa,SAAS,UAAU;AACtD,oCAAoC,SAAS;AAC7C;AACA;AACA,gBAAgB,MAA6B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,uBAAuB,MAAoC;AAC3D,qDAAqD,QAAQ;AAC7D;AACA;AACA;AACA;AACA;AACA,2CAA2C,0CAA0C;AACrF;AACA;AACA;AACA;AACA;AACA,CAAC,4CAA4C;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mJAAmJ;AACnJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6EAA6E,cAAc;AAC3F,+EAA+E,sCAAsC;AACrH;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,yEAAyE;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,8BAA8B;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,eAAe;AACnE,0DAA0D,eAAe;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,8HAA8H;AAC7K;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD;AAChD,wFAAwF,2CAA2C;AACnI,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA,iCAAiC,4BAA4B;AAC7D,iBAAiB;AACjB;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,6EAA6E;AAC/G,iBAAiB;AACjB;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,6BAA6B;AACnD,sBAAsB,qCAAqC;AAC3D,sBAAsB,6BAA6B;AACnD,sBAAsB,uCAAuC;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,2BAA2B;AACjD,sBAAsB,mCAAmC;AACzD,sBAAsB,2BAA2B;AACjD,sBAAsB,qCAAqC;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,6BAA6B;AACvD,0BAA0B,qCAAqC;AAC/D,0BAA0B,6BAA6B;AACvD,0BAA0B,uCAAuC;AACjE;AACA;AACA;AACA;AACA;AACA,0BAA0B,6BAA6B;AACvD,0BAA0B,qCAAqC;AAC/D,0BAA0B,6BAA6B;AACvD,0BAA0B,uCAAuC;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA,mBAAmB,MAAgC;AACnD,4BAA4B,+DAA+D,iBAAiB;AAC5G,0BAA0B,OAAO;AACjC,oCAAoC,MAAM,+BAA+B,YAAY;AACrF,mCAAmC,MAAM,mCAAmC,YAAY;AACxF,gCAAgC;AAChC;AACA,KAAK;AACL;AACA,qBAAqB,MAAkC;AACvD,cAAc,6BAA6B,0BAA0B,cAAc,qBAAqB;AACxG,iBAAiB,oDAAoD,qEAAqE,cAAc;AACxJ,uBAAuB,sBAAsB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC,mCAAmC,SAAS;AAC5C,mCAAmC,WAAW,UAAU;AACxD,0CAA0C,cAAc;AACxD;AACA,8GAA8G,OAAO;AACrH,iFAAiF,iBAAiB;AAClG,yDAAyD,gBAAgB,QAAQ;AACjF,+CAA+C,gBAAgB,gBAAgB;AAC/E;AACA,kCAAkC;AAClC;AACA;AACA,UAAU,YAAY,aAAa,SAAS,UAAU;AACtD,oCAAoC,SAAS;AAC7C;AACA;AACA,gBAAgB,MAA6B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,uBAAuB,MAAoC;AAC3D,qDAAqD,QAAQ;AAC7D;AACA;AACA;AACA;AACA,gEAAgE,4CAA4C;AAC5G;AACA;AACA;AACA;AACA,CAAC,wDAAwD;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,wCAAwC,yEAAyE;AACjH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,WAAW;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yEAAyE,yBAAyB;AAClG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD;AACrD;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,cAAc;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6EAA6E,kCAAkC;AAC/G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB,yCAAyC,4GAA4G;AACrJ,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,qBAAqB,gCAAgC;AAC1E,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD;AACrD,iBAAiB;AACjB;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA,sBAAsB,8BAA8B;AACpD,sBAAsB,2BAA2B;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,sBAAsB,2BAA2B;AACjD,sBAAsB,mCAAmC;AACzD,sBAAsB,2BAA2B;AACjD,sBAAsB,qCAAqC;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,4BAA4B;AACtD,0BAA0B,oCAAoC;AAC9D,0BAA0B,6BAA6B;AACvD,0BAA0B,uCAAuC;AACjE;AACA;AACA;AACA;AACA;AACA,0BAA0B,2BAA2B;AACrD,0BAA0B,mCAAmC;AAC7D,0BAA0B,6BAA6B;AACvD,0BAA0B,uCAAuC;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,kBAAkB,MAA+B;AACjD;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA,mBAAmB,MAAgC;AACnD,4BAA4B,+DAA+D,iBAAiB;AAC5G,0BAA0B,OAAO;AACjC,oCAAoC,MAAM,+BAA+B,YAAY;AACrF,mCAAmC,MAAM,mCAAmC,YAAY;AACxF,gCAAgC;AAChC;AACA,KAAK;AACL;AACA,qBAAqB,MAAkC;AACvD,cAAc,6BAA6B,0BAA0B,cAAc,qBAAqB;AACxG,iBAAiB,oDAAoD,qEAAqE,cAAc;AACxJ,uBAAuB,sBAAsB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC,mCAAmC,SAAS;AAC5C,mCAAmC,WAAW,UAAU;AACxD,0CAA0C,cAAc;AACxD;AACA,8GAA8G,OAAO;AACrH,iFAAiF,iBAAiB;AAClG,yDAAyD,gBAAgB,QAAQ;AACjF,+CAA+C,gBAAgB,gBAAgB;AAC/E;AACA,kCAAkC;AAClC;AACA;AACA,UAAU,YAAY,aAAa,SAAS,UAAU;AACtD,oCAAoC,SAAS;AAC7C;AACA;AACA,gBAAgB,MAA6B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+EAA+E,cAAc;AAC7F,+EAA+E,uCAAuC;AACtH;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,+BAA+B;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8EAA8E,mCAAmC;AACjH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,wCAAwC;AAC7E,4CAA4C,YAAY;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,uDAAuD;AAChG,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,oBAAoB;AAC1D;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wJAAwJ,uBAAuB;AAC/K,qCAAqC,oBAAoB;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA,yKAAyK,uBAAuB;AAChM;AACA,uBAAuB;AACvB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,oBAAoB;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA,yDAAyD,6BAA6B;AACtF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,mBAAmB;AAC3C;AACA;AACA;AACA;AACA,8CAA8C,eAAe;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,mBAAmB;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD,6BAA6B;AACtF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,2BAA2B;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,kBAAkB,MAA+B;AACjD;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA,mBAAmB,MAAgC;AACnD,4BAA4B,+DAA+D,iBAAiB;AAC5G,0BAA0B,OAAO;AACjC,oCAAoC,MAAM,+BAA+B,YAAY;AACrF,mCAAmC,MAAM,mCAAmC,YAAY;AACxF,gCAAgC;AAChC;AACA,KAAK;AACL;AACA,qBAAqB,MAAkC;AACvD,cAAc,6BAA6B,0BAA0B,cAAc,qBAAqB;AACxG,iBAAiB,oDAAoD,qEAAqE,cAAc;AACxJ,uBAAuB,sBAAsB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC,mCAAmC,SAAS;AAC5C,mCAAmC,WAAW,UAAU;AACxD,0CAA0C,cAAc;AACxD;AACA,8GAA8G,OAAO;AACrH,iFAAiF,iBAAiB;AAClG,yDAAyD,gBAAgB,QAAQ;AACjF,+CAA+C,gBAAgB,gBAAgB;AAC/E;AACA,kCAAkC;AAClC;AACA;AACA,UAAU,YAAY,aAAa,SAAS,UAAU;AACtD,oCAAoC,SAAS;AAC7C;AACA;AACA,gBAAgB,MAA6B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,uBAAuB,MAAoC;AAC3D,qDAAqD,QAAQ;AAC7D;AACA;AACA;AACA,kBAAkB,MAA+B;AACjD;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+EAA+E,cAAc;AAC7F,+EAA+E,cAAc;AAC7F,6FAA6F,iBAAiB,wEAAwE,kBAAkB,yEAAyE,kBAAkB;AACnS;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yHAAyH,UAAU;AACnI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yEAAyE,iDAAiD;AAC1H;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,8BAA8B;AACnE,4CAA4C,YAAY;AACxD;AACA,gDAAgD,YAAY;AAC5D;AACA;AACA;AACA,gCAAgC,QAAQ;AACxC;AACA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA;AACA,yCAAyC,4GAA4G;AACrJ,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,4GAA4G,+BAA+B;AAC3I;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,oBAAoB;AAC1D;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kEAAkE,gCAAgC,cAAc;AAChH;AACA;AACA;AACA,uBAAuB,KAAK;AAC5B;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,mCAAmC,yEAAyE;AAC5G;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,kBAAkB,MAA+B;AACjD;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA,mBAAmB,MAAgC;AACnD,4BAA4B,+DAA+D,iBAAiB;AAC5G,0BAA0B,OAAO;AACjC,oCAAoC,MAAM,+BAA+B,YAAY;AACrF,mCAAmC,MAAM,mCAAmC,YAAY;AACxF,gCAAgC;AAChC;AACA,KAAK;AACL;AACA,qBAAqB,MAAkC;AACvD,cAAc,6BAA6B,0BAA0B,cAAc,qBAAqB;AACxG,iBAAiB,oDAAoD,qEAAqE,cAAc;AACxJ,uBAAuB,sBAAsB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC,mCAAmC,SAAS;AAC5C,mCAAmC,WAAW,UAAU;AACxD,0CAA0C,cAAc;AACxD;AACA,8GAA8G,OAAO;AACrH,iFAAiF,iBAAiB;AAClG,yDAAyD,gBAAgB,QAAQ;AACjF,+CAA+C,gBAAgB,gBAAgB;AAC/E;AACA,kCAAkC;AAClC;AACA;AACA,UAAU,YAAY,aAAa,SAAS,UAAU;AACtD,oCAAoC,SAAS;AAC7C;AACA;AACA,kBAAkB,MAA+B;AACjD;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,CAAC,kCAAkC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C;AAC3C;AACA;AACA;AACA;AACA,uCAAuC;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,qBAAqB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,OAAO;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,qBAAqB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C;AAC5C;AACA;AACA,+EAA+E,cAAc;AAC7F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kFAAkF,+CAA+C;AACjI;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,yDAAyD;AACxG;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,+CAA+C,yDAAyD;AACxG;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kFAAkF,oBAAoB;AACtG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kHAAkH,uBAAuB;AACzI;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC;AACzC;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC;AACzC;AACA;AACA;AACA,oCAAoC,QAAQ;AAC5C;AACA;AACA;AACA;AACA,kCAAkC;AAClC;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA,6BAA6B;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;AACA;AACA;AACA;AACA;AACA,oCAAoC,mDAAmD;AACvF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAiE,cAAc;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,sDAAsD,8BAA8B;AACpF,KAAK;AACL;AACA;AACA,sDAAsD,0BAA0B;AAChF,KAAK;AACL;AACA;AACA,sDAAsD,8BAA8B;AACpF,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,mGAAmG;AACnG;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;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;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,kBAAkB,MAA+B;AACjD;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,MAA6B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,kBAAkB,MAA+B;AACjD;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,uDAAuD;AACvF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD;AACrD;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB,qBAAqB;AACrB,sBAAsB;AACtB,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA;AACA,uCAAuC,+BAA+B;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA,uCAAuC,qBAAqB,iCAAiC,6BAA6B;AAC1H;AACA,mBAAmB,GAAG;AACtB;AACA;AACA;AACA,uCAAuC,qBAAqB,4DAA4D,6BAA6B;AACrJ;AACA,mBAAmB,GAAG;AACtB;AACA;AACA;AACA,uCAAuC,qBAAqB,iCAAiC,6BAA6B;AAC1H;AACA,mBAAmB,GAAG;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA,qBAAqB;AACrB;AACA;AACA,qBAAqB;AACrB;AACA;AACA,qBAAqB;AACrB;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD;AAClD;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA,qCAAqC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,IAAI;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,IAAI;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gFAAgF,UAAU;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,QAAQ;AACpC;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA,SAAS,IAAI;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D,oCAAoC;AAC/F,iCAAiC;AACjC,yCAAyC,mCAAmC,UAAU;AACtF,8CAA8C,mCAAmC,uDAAuD,yCAAyC,kBAAkB,GAAG;AACtM,0CAA0C;AAC1C,+BAA+B;AAC/B,SAAS;AACT,iCAAiC;AACjC,8BAA8B;AAC9B,0CAA0C,yCAAyC,sHAAsH,oDAAoD,kCAAkC;AAC/R;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB,6CAA6C,4CAA4C,2DAA2D;AACpJ;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB,0CAA0C,yCAAyC;AACnF;AACA;AACA;AACA;AACA;AACA,iBAAiB,kCAAkC,oDAAoD,kDAAkD;AACzJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB,+CAA+C,qCAAqC;AACpF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB,WAAW;AACX,uDAAuD,oCAAoC;AAC3F,yCAAyC,qCAAqC;AAC9E;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB,WAAW;AACX,2DAA2D,oCAAoC;AAC/F,6CAA6C,qCAAqC;AAClF;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB,qBAAqB;AACrB,mBAAmB;AACnB,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,kBAAkB,MAA+B;AACjD;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,qCAAqC;AACrC,uCAAuC;AACvC,mCAAmC;AACnC,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA,qBAAqB;AACrB;AACA;AACA,qBAAqB;AACrB;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,IAAI;AACjB;AACA;AACA,0DAA0D,wCAAwC,qBAAqB,mBAAmB,0CAA0C,6CAA6C,gDAAgD,wBAAwB,mDAAmD;AAC5V,gEAAgE,wCAAwC,qBAAqB,kBAAkB,6CAA6C,gDAAgD,wBAAwB,mDAAmD;AACvT,2CAA2C,oBAAoB,qBAAqB;AACpF;AACA;AACA,yBAAyB;AACzB;AACA;AACA,yBAAyB;AACzB;AACA;AACA,yBAAyB;AACzB;AACA;AACA,yBAAyB;AACzB,uBAAuB,+CAA+C;AACtE,+CAA+C,oBAAoB,qBAAqB;AACxF;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA,6BAA6B;AAC7B;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA,iCAAiC;AACjC,6BAA6B;AAC7B,yBAAyB;AACzB,uBAAuB,mDAAmD;AAC1E,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;;AAED,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,kBAAkB,MAA+B;AACjD;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B,8BAA8B;AAC9B;AACA;AACA;AACA;AACA,iCAAiC,6BAA6B;AAC9D,+BAA+B,2BAA2B;AAC1D,8BAA8B,0BAA0B;AACxD,8BAA8B,0BAA0B;AACxD;AACA;AACA;AACA;AACA;AACA,sCAAsC,4BAA4B;AAClE,oCAAoC,0BAA0B;AAC9D,mCAAmC,yBAAyB;AAC5D,mCAAmC,yBAAyB;AAC5D;AACA,uCAAuC;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iFAAiF;AACjF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,mDAAmD,eAAe,mBAAmB,IAAI;AAC/H;AACA;AACA;AACA;AACA;AACA;;AAEA,kBAAkB,MAA+B;AACjD;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,MAA+B;AACjD;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,gBAAgB,MAA6B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,uBAAuB,MAAoC;AAC3D,qDAAqD,QAAQ;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0GAA0G,yBAAyB;AACnI;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,8BAA8B;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,mBAAmB;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA,kHAAkH,yBAAyB;AAC3I;AACA;AACA;AACA;AACA;AACA,kHAAkH,yBAAyB;AAC3I;AACA;AACA;AACA;AACA;AACA,8BAA8B,8BAA8B;AAC5D;AACA;AACA;AACA,oBAAoB,QAAQ;AAC5B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA,uDAAuD,WAAW;AAClE;AACA;AACA;AACA,4EAA4E,UAAU;AACtF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,QAAQ;AAC5B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,aAAa,sEAAsE;AAC9H;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,IAAI;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sEAAsE,UAAU;AAChF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,QAAQ;AACpC;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;AACA;AACA,sEAAsE,UAAU;AAChF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,QAAQ;AACpC;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;AACA,sEAAsE,UAAU;AAChF;AACA;AACA;AACA;AACA,4BAA4B,QAAQ;AACpC;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kFAAkF,mBAAmB;AACrG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,QAAQ;AAC5B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA,kBAAkB,MAA+B;AACjD;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,MAA+B;AACjD;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,gBAAgB,MAA6B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,uBAAuB,MAAoC;AAC3D,qDAAqD,QAAQ;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0EAA0E,iBAAiB;AAC3F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,QAAQ;AAC5B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA,wBAAwB,kBAAkB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4EAA4E;AAC5E;AACA;AACA;AACA;AACA,6GAA6G,UAAU;AACvH;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,QAAQ;AAC5B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA,sCAAsC,cAAc,YAAY;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,sBAAsB,mCAAmC;AAC9D;AACA;AACA;AACA,0EAA0E;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA,qHAAqH,UAAU;AAC/H;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,QAAQ;AAChC;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oJAAoJ;AACpJ;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8FAA8F,4BAA4B;AAC1H;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,wDAAwD;AACxD;AACA,qEAAqE;AACrE,gCAAgC,aAAa,6CAA6C,qBAAqB,iCAAiC,GAAG;AACnJ;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,IAAI;AACT;AACA;AACA,kFAAkF;AAClF;AACA,gDAAgD,8BAA8B;AAC9E;AACA;AACA;AACA;AACA,qBAAqB,uBAAuB;AAC5C;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,UAAU;AACvB,CAAC;AACD;AACA;AACA;AACA;AACA,kBAAkB,4BAA4B;AAC9C;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6GAA6G;AAC7G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qEAAqE,mDAAmD;AACxH;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,KAAK,IAAI,yBAAyB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2FAA2F;AAC3F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,IAAI,yBAAyB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,IAAI,yBAAyB;AAClC;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;;AAEA,kBAAkB,MAA+B;AACjD;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uEAAuE,UAAU;AACjF;AACA;AACA;AACA;AACA,wBAAwB,QAAQ;AAChC;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,kBAAkB,MAA+B;AACjD;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,4BAA4B;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,gBAAgB,oCAAoC;AACzG;AACA;AACA,SAAS;AACT,yBAAyB,aAAa;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC;;AAED,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mEAAmE,KAAK,wCAAwC;AAChH;AACA;AACA,gFAAgF,kCAAkC;AAClH,0EAA0E,6BAA6B;AACvG,2EAA2E,6BAA6B;AACxG,yEAAyE,4BAA4B;AACrG,iCAAiC,2CAA2C,kDAAkD,IAAI;AAClI;AACA,8EAA8E,6BAA6B;AAC3G,gFAAgF,qCAAqC;AACrH,iCAAiC,2CAA2C,6CAA6C,IAAI;AAC7H;AACA,4CAA4C,QAAQ,6FAA6F;AACjJ,4CAA4C,uDAAuD;AACnG;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,2DAA2D,KAAK,sCAAsC;AACtG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;;AAEA,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,oBAAoB;AACrD;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,QAAQ,+FAA+F;AACnJ;AACA,4CAA4C,wDAAwD;AACpG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,kBAAkB,MAA+B;AACjD;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8HAA8H,8BAA8B;AAC5J;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gGAAgG,UAAU;AAC1G;AACA;AACA;AACA;AACA,oCAAoC,QAAQ;AAC5C;AACA;AACA;AACA;AACA,kCAAkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+FAA+F,UAAU;AACzG;AACA;AACA;AACA;AACA,oCAAoC,QAAQ;AAC5C;AACA;AACA;AACA;AACA,kCAAkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,QAAQ;AAC5B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;;AAEA,kBAAkB,MAA+B;AACjD;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,MAAgC;AACjD,4BAA4B,+DAA+D,iBAAiB;AAC5G,0BAA0B,OAAO;AACjC,oCAAoC,MAAM,+BAA+B,YAAY;AACrF,mCAAmC,MAAM,mCAAmC,YAAY;AACxF,gCAAgC;AAChC;AACA,KAAK;AACL;AACA,mBAAmB,MAAkC;AACrD,cAAc,6BAA6B,0BAA0B,cAAc,qBAAqB;AACxG,iBAAiB,oDAAoD,qEAAqE,cAAc;AACxJ,uBAAuB,sBAAsB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC,mCAAmC,SAAS;AAC5C,mCAAmC,WAAW,UAAU;AACxD,0CAA0C,cAAc;AACxD;AACA,8GAA8G,OAAO;AACrH,iFAAiF,iBAAiB;AAClG,yDAAyD,gBAAgB,QAAQ;AACjF,+CAA+C,gBAAgB,gBAAgB;AAC/E;AACA,kCAAkC;AAClC;AACA;AACA,UAAU,YAAY,aAAa,SAAS,UAAU;AACtD,oCAAoC,SAAS;AAC7C;AACA;AACA,gBAAgB,MAA6B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,uBAAuB,MAAoC;AAC3D,qDAAqD,QAAQ;AAC7D;AACA;AACA;AACA,kBAAkB,MAA+B;AACjD;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS,IAAI;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,6CAA6C,6BAA6B;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yEAAyE;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0DAA0D,wBAAwB,sHAAsH;AACxM;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,0GAA0G,iCAAiC;AAC3I;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uEAAuE,uBAAuB,yGAAyG;AACvM;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA,0CAA0C,QAAQ;AAClD;AACA;AACA,CAAC;AACD;AACA;AACA,qBAAqB,uBAAuB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sGAAsG;AACtG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,YAAY;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8IAA8I,wBAAwB;AACtK;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+FAA+F;AAC/F;AACA;AACA;AACA,+BAA+B,4CAA4C;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+DAA+D,2BAA2B;AAC1F;AACA,kGAAkG,uBAAuB;AACzH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,QAAQ;AAC5B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yGAAyG,QAAQ,uFAAuF;AACxM;AACA;AACA;AACA;AACA;AACA,2GAA2G;AAC3G;AACA;AACA;AACA;AACA,+CAA+C,qCAAqC;AACpF;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mGAAmG,oCAAoC;AACvI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,wBAAwB;AACzE,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2FAA2F,IAAI,YAAY;AAC3G;AACA,oKAAoK;AACpK;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yGAAyG,UAAU;AACnH;AACA;AACA;AACA,+DAA+D,0BAA0B;AACzF;AACA;AACA;AACA,oBAAoB,QAAQ;AAC5B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yGAAyG,UAAU;AACnH;AACA;AACA;AACA;AACA,mDAAmD,wBAAwB;AAC3E;AACA;AACA;AACA,oBAAoB,QAAQ;AAC5B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA,+DAA+D,kCAAkC;AACjG;AACA,kGAAkG,uBAAuB;AACzH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,QAAQ;AAC5B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC;AAChC,uDAAuD,4BAA4B,YAAY,aAAa,aAAa,IAAI;AAC7H;AACA;AACA;AACA;AACA,gCAAgC;AAChC;AACA;AACA;AACA;AACA,8CAA8C,WAAW,yDAAyD;AAClH;AACA,6EAA6E,6CAA6C,oGAAoG,aAAa,aAAa,IAAI,MAAM,sDAAsD;AACxT;AACA;AACA;AACA;AACA;AACA;AACA,kFAAkF;AAClF;AACA,uEAAuE,mEAAmE;AAC1I;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,0BAA0B;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,oBAAoB;AAClC,cAAc,qBAAqB;AACnC,cAAc,qBAAqB;AACnC;AACA,sBAAsB,oBAAoB;AAC1C,YAAY,uBAAuB;AACnC;AACA,qFAAqF;AACrF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,0BAA0B;AACzD;AACA;AACA,+BAA+B,0BAA0B;AACzD;AACA;AACA,+BAA+B,0BAA0B;AACzD;AACA;AACA,+BAA+B,0BAA0B;AACzD;AACA;AACA,+BAA+B,0BAA0B;AACzD;AACA;AACA,CAAC;;AAED,gBAAgB,MAA6B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,IAAI;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,kBAAkB,MAA+B;AACjD;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,kGAAkG;AAClJ;AACA;AACA;AACA;AACA;AACA,0DAA0D,OAAO,gDAAC,yCAAyC;AAC3G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,aAAa;AAC5C,kCAAkC;AAClC;AACA;AACA,KAAK,IAAI;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,uBAAuB;AACnE;AACA;AACA;AACA;AACA;AACA,WAAW,gDAAC;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B,iBAAiB;AACjB,aAAa;AACb;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,sCAAsC,uDAAuD;AAC7F,aAAa;AACb;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,oCAAoC,cAAc,YAAY,SAAS,2BAA2B;AAClG,CAAC,IAAI;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,yBAAyB,yBAAyB;AAClD,gCAAgC,yBAAyB;AACzD;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS,gDAAC;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,gBAAgB,MAA6B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,uBAAuB,MAAoC;AAC3D,qDAAqD,QAAQ;AAC7D;AACA;AACA;AACA,kBAAkB,MAA+B;AACjD;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC,mCAAmC;AACnC,gDAAgD;AAChD;AACA,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,8FAA8F;AAC/I;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sGAAsG,uBAAuB;AAC7H;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,QAAQ;AAChC;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA,UAAU,oGAAoG;AAC9G;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT,UAAU,4GAA4G;AACtH;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;;AAED,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,kBAAkB,MAA+B;AACjD;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,qDAAM;AACzD;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,mDAAmD,qDAAM;AACzD,mDAAmD,qDAAM;AACzD,mDAAmD,qDAAM;AACzD,mDAAmD,qDAAM;AACzD,mDAAmD,qDAAM;AACzD,mDAAmD,qDAAM;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+FAA+F;AAC/F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,UAAU,4CAA4C,IAAI;AAC/G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,oDAAoD,UAAU,4BAA4B,IAAI;AAC9F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,8DAA8D,qBAAqB;AACnF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iCAAiC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gDAAC;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8FAA8F,2BAA2B;AACzH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,gFAAgF,iBAAiB;AACjG,gEAAgE,0CAA0C;AAC1G;AACA;AACA;AACA;AACA;AACA;AACA,gGAAgG,WAAW;AAC3G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,8DAA8D;AACvG,yCAAyC,8BAA8B;AACvE,gDAAgD;AAChD;AACA,sFAAsF,8BAA8B;AACpH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mEAAmE,uDAAuD,mBAAmB,KAAK;AAClJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,qDAAM;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,qDAAM;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAa;AACrB;AACA;AACA,CAAC,CAAC,uDAAQ;;AAEV,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA,gBAAgB,MAA6B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,uBAAuB,MAAoC;AAC3D,qDAAqD,QAAQ;AAC7D;AACA;AACA;AACA,kBAAkB,MAA+B;AACjD;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,UAAU,kCAAkC;AAC5C,UAAU,8BAA8B;AACxC,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD,iBAAiB,sCAAsC,iBAAiB;AAC9H;AACA;AACA,YAAY,gDAAC,UAAU,gDAAC;AACxB;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,YAAY,gDAAC;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,yDAAyD;AACvE,cAAc,iDAAiD;AAC/D,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,qCAAqC,gEAAiB;AACtD;AACA;AACA,+CAA+C,wBAAwB;AACvE,uDAAuD;AACvD,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,8DAAe;AAC1D;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,uDAAuD,+DAAgB;AACvE;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,uEAAuE,4DAAa;AACpF,0BAA0B,gDAAC;AAC3B;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,0DAA0D,+DAAgB;AAC1E;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,8EAA8E,6DAAc;AAC5F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,mEAAmE,yDAAU;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,uCAAuC,OAAO,iEAAkB,aAAa;AAC7E,wCAAwC,wBAAwB;AAChE,4CAA4C,kCAAkC;AAC9E,uCAAuC,6BAA6B;AACpE;AACA;AACA;AACA;AACA,0CAA0C,+DAA+D;AACzG;AACA;AACA;AACA;AACA;AACA;AACA,mEAAmE,+DAAgB;AACnF;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,yEAAyE,+BAA+B;AACxG;AACA;AACA;AACA,uFAAuF,+DAAgB;AACvG;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,uCAAuC,yDAAU;AACjD;AACA;AACA;AACA;AACA,oDAAoD,oFAAoF;AACxI;AACA;AACA;AACA;AACA;AACA,kBAAkB,gDAAgD;AAClE,kBAAkB,gDAAgD;AAClE,kBAAkB,qEAAqE;AACvF,kBAAkB,4EAA4E;AAC9F,kBAAkB,4EAA4E;AAC9F;AACA,sEAAsE,uDAAQ;AAC9E;AACA;AACA;AACA;AACA;AACA,sDAAsD,2EAA2E;AACjI;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,gDAAC;AAC3B;AACA;AACA;AACA,kBAAkB,6DAAc;AAChC;AACA;AACA,uCAAuC,UAAU,uBAAuB,IAAI;AAC5E,yCAAyC;AACzC;AACA;AACA,0CAA0C,+DAA+D;AACzG;AACA;AACA;AACA,oCAAoC,OAAO,gDAAC;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,gDAAC;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,gDAAC;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C;AAC3C;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA;AACA;AACA;AACA,YAAY,gDAAC;AACb;AACA;AACA;AACA;AACA,iFAAiF,UAAU;AAC3F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA,wBAAwB,QAAQ;AAChC;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gJAAgJ,kDAAkD;AAClM;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,wBAAwB,6DAAc;AACtC;AACA;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAa;AACrB;AACA;AACA,CAAC,CAAC,wDAAS;;AAEX,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,wBAAwB;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8DAA8D,yBAAyB;AACvF;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,gDAAC;AAC5C;AACA;AACA;AACA;AACA,6DAA6D,UAAU,2BAA2B,IAAI;AACtG;AACA;AACA;AACA,iDAAiD,8BAA8B,kBAAkB,IAAI;AACrG;AACA;AACA;AACA;AACA;AACA,aAAa,gDAAC;AACd;AACA;AACA,mDAAmD,eAAe,yBAAyB,UAAU,qCAAqC,IAAI;AAC9I;AACA;AACA;AACA,iDAAiD,8BAA8B,8BAA8B,IAAI;AACjH;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,mDAAmD;AACjE,cAAc,+CAA+C;AAC7D,cAAc,mDAAmD;AACjE,cAAc;AACd;AACA,8DAA8D,kDAAkD;AAChH;AACA,+BAA+B;AAC/B;AACA;AACA,uDAAuD;AACvD;AACA;AACA,SAAS,IAAI;AACb;AACA;AACA;AACA;AACA,uEAAuE,6BAA6B;AACpG,mCAAmC,sEAAsE;AACzG,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,8BAA8B,iBAAiB,IAAI;AACpG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,gDAAC;AACb;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAa;AACrB;AACA;AACA,CAAC,CAAC,wDAAS;;AAEX,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,0BAA0B;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D;AAC5D;AACA;AACA,SAAS,IAAI;AACb;AACA,iDAAiD,+EAA+E;AAChI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,8EAA8E;AAC/H;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,gDAAC;AACb;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAa;AACrB;AACA;AACA,CAAC,CAAC,wDAAS;;AAEX,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,6BAA6B;AACjF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,2EAA2E;AAC5H;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,yEAAyE;AAC9H;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAa;AACrB;AACA;AACA,CAAC,CAAC,wDAAS;;AAEX,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,uCAAuC,qCAAqC;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,YAAY,gDAAC;AACb;AACA;AACA,sCAAsC,8DAAe;AACrD;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,8DAAe;AACrD;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,MAAM,8DAAe,gBAAgB;AACtE;AACA;AACA;AACA;AACA,QAAQ,gDAAC;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,CAAC,CAAC,8DAAe;;AAEjB,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,wBAAwB;AACvE;AACA;AACA;AACA,qDAAqD,4DAA4D,gBAAgB;AACjI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,2EAA2E;AAC5H;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,2EAA2E;AAC5H;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,yDAAU;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,wEAAwE;AAC7H;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,uDAAQ;AAC7D;AACA;AACA;AACA;AACA;AACA,iDAAiD,8EAA8E;AAC/H;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,gDAAC;AACb;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAa;AACrB;AACA;AACA,CAAC,CAAC,wDAAS;;AAEX,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,6BAA6B;AACjF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,8EAA8E;AAC7H;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAa;AACrB;AACA;AACA,CAAC,CAAC,wDAAS;;AAEX,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,gCAAgC;AAClF,mDAAmD,qDAAM;AACzD;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,mFAAmF;AACxI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAa;AACrB;AACA;AACA,CAAC,CAAC,wDAAS;;AAEX,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,mCAAmC;AACxF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,iFAAiF;AAClI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,+EAA+E;AAChI;AACA;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAa;AACrB;AACA;AACA,CAAC,CAAC,wDAAS;;AAEX,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,gDAAgD,uDAAQ;AACxD;AACA;AACA;AACA;AACA;AACA,iDAAiD,6EAA6E;AAC9H;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,QAAQ,mHAAmH;AACvK;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,gDAAC;AACb;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAa;AACrB;AACA;AACA,CAAC,CAAC,wDAAS;;AAEX,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,yBAAyB;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,gDAAC;AACb;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAa;AACrB;AACA;AACA,CAAC,CAAC,wDAAS;;AAEX,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,0BAA0B;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,0GAA0G;AAC5J;AACA;AACA;AACA;AACA;AACA,iDAAiD,wGAAwG;AACzJ;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,8GAA8G;AACnK;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAa;AACrB;AACA;AACA,CAAC,CAAC,wDAAS;;AAEX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,2CAA2C;AACpF;AACA;AACA;AACA;AACA;AACA;;AAEA,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,qBAAqB,MAAiC;AACtD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,iCAAiC;AACnF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,sDAAsD;AACpG;AACA;AACA,wCAAwC,gDAAC;AACzC;AACA;AACA;AACA;AACA;AACA,kDAAkD,2DAA2D;AAC7G;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,qDAAqD;AAC1G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAa;AACrB;AACA;AACA,CAAC,CAAC,wDAAS;;AAEX,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,oBAAoB,MAAiC;AACrD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,2BAA2B;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,oGAAoG;AACzJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAa;AACrB;AACA;AACA,CAAC,CAAC,wDAAS;;AAEX,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,oBAAoB,MAAiC;AACrD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,+BAA+B;AACtE,yCAAyC,iCAAiC;AAC1E,sCAAsC,8BAA8B;AACpE,yCAAyC,iCAAiC;AAC1E,yCAAyC,iCAAiC;AAC1E,qCAAqC,6BAA6B;AAClE,oCAAoC,4BAA4B;AAChE,oCAAoC,4BAA4B;AAChE,sCAAsC,8BAA8B;AACpE,kCAAkC,0BAA0B;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,0BAA0B;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gFAAgF,gCAAgC;AAChH,SAAS;AACT,kCAAkC,8DAA8D;AAChG;AACA;AACA;AACA,kEAAkE,uDAAQ;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,uDAAuD,6DAAc;AACrE;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,4DAA4D;AAC7G;AACA;AACA;AACA;AACA;AACA,0DAA0D,uDAAQ;AAClE;AACA;AACA;AACA;AACA;AACA,iDAAiD,wDAAwD;AACzG;AACA;AACA;AACA;AACA;AACA,wDAAwD,uDAAQ;AAChE;AACA;AACA;AACA;AACA;AACA,iDAAiD,wDAAwD;AACzG;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,uDAAQ;AAC/D;AACA;AACA;AACA;AACA;AACA,iDAAiD,uDAAuD;AACxG;AACA;AACA;AACA;AACA;AACA,0DAA0D,uDAAQ;AAClE;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,0DAA0D;AAC3G;AACA;AACA;AACA;AACA;AACA,0DAA0D,uDAAQ;AAClE;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,wDAAwD;AACzG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,0BAA0B;AACvE;AACA,SAAS;AACT;AACA;AACA,4GAA4G,0BAA0B;AACtI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,0BAA0B;AAC3E;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAiE,uDAAQ;AACzE;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,2FAA2F;AAC5I;AACA;AACA;AACA,sGAAsG,0BAA0B;AAChI;AACA;AACA;AACA;AACA,wGAAwG,0BAA0B;AAClI;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,uDAAQ;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,qDAAqD;AACtG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,qDAAqD;AAChF,0BAA0B,kDAAkD;AAC5E,6BAA6B,2DAA2D;AACxF,2BAA2B,qDAAqD;AAChF,8BAA8B,8DAA8D;AAC5F,gCAAgC,oEAAoE;AACpG,0BAA0B,kDAAkD;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,mGAAmG,oCAAoC;AACvI;AACA;AACA,mDAAmD;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,gDAAC;AACb;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAa;AACrB;AACA;AACA,CAAC,CAAC,wDAAS;;AAEX,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,oBAAoB,MAAiC;AACrD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU,eAAe;AACzB,UAAU,gBAAgB;AAC1B,UAAU,gBAAgB;AAC1B,UAAU,cAAc;AACxB,UAAU,mBAAmB;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yGAAyG,kCAAkC;AAC3I,4GAA4G,mCAAmC;AAC/I;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,gDAAC;AACb;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,4DAAa;AACrB;AACA;AACA,CAAC,CAAC,wDAAS;;AAEX,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,oBAAoB,MAAiC;AACrD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,kEAAkE;AAClG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,2DAA2D;AAC7F;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAa;AACrB;AACA;AACA,CAAC,CAAC,wDAAS;;AAEX,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,oBAAoB,MAAiC;AACrD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,4DAAa;AACrB;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,8CAA8C,uCAAuC;AACrF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,CAAC;;AAED,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,+BAA+B;AAC/B,uCAAuC;AACvC,sCAAsC;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,CAAC;;AAED,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,+BAA+B;AAC/B,uCAAuC;AACvC,sCAAsC;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,gBAAgB,MAA6B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C;AAC7C,sCAAsC;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,CAAC;;AAED,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,CAAC;;AAED,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,gBAAgB,MAA6B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,CAAC;;AAED,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,gBAAgB,MAA6B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,CAAC;;AAED,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,+BAA+B;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,6DAA6D;AAC9G;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,+BAA+B;AAC/B,sCAAsC;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,iDAAiD,6DAA6D;AAC9G;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,+BAA+B;AAC/B;AACA;AACA;AACA;AACA,iDAAiD,eAAe;AAChE,wCAAwC,sBAAsB;AAC9D,KAAK;AACL;AACA,CAAC;;AAED,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,gBAAgB,MAA6B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0DAA0D,wBAAwB;AAClF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,CAAC;;AAED,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,CAAC;;AAED,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B;AAC9B,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,iDAAiD,6DAA6D;AAC9G;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,CAAC;;AAED,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,kBAAkB,MAA+B;AACjD;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAiC;AACrD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,cAAc,mEAAoB;AACxE;AACA;AACA;AACA;AACA;AACA,yCAAyC;AACzC;AACA;AACA;AACA;AACA;AACA;AACA,gHAAgH,qCAAqC;AACrJ;AACA;AACA;AACA;AACA,sDAAsD,+DAAgB;AACtE;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,wBAAwB,gDAAC,sBAAsB,mGAAmG;AAClJ;AACA;AACA,wBAAwB,gDAAC,sBAAsB,iFAAiF;AAChI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,aAAa;AACb;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAa;AACrB;AACA;AACA,CAAC,CAAC,wDAAS;;AAEX,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,oBAAoB,MAAiC;AACrD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0DAA0D,gDAAC;AAC3D,0DAA0D,gDAAC;AAC3D,sEAAsE,yDAAyD;AAC/H,sEAAsE,0DAA0D;AAChI;AACA,8GAA8G,mCAAmC;AACjJ,4GAA4G,mCAAmC;AAC/I;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,gDAAC;AACd;AACA;AACA;AACA;AACA,0EAA0E,4DAA4D;AACtI;AACA,QAAQ,gDAAC;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,QAAQ,gDAAC;AACT,QAAQ,gDAAC;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,gDAAC;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,gDAAC;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,QAAQ,gDAAC;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,4DAAa;AACrB;AACA;AACA,CAAC,CAAC,wDAAS;;AAEX,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,oBAAoB,MAAiC;AACrD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,iCAAiC;AAChF,SAAS;AACT,gCAAgC,2DAAY;AAC5C;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,wDAAS;AACtC;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAa;AACrB;AACA;AACA,CAAC,CAAC,wDAAS;;AAEX,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,oBAAoB,MAAiC;AACrD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA,gBAAgB,MAA6B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,uBAAuB,MAAoC;AAC3D,qDAAqD,QAAQ;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,4CAA4C;AAC9F,8CAA8C,qCAAqC;AACnF,gDAAgD,uCAAuC;AACvF,iDAAiD,iCAAiC;AAClF,qDAAqD,iCAAiC;AACtF,kDAAkD,2BAA2B;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,qDAAM;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,+CAA+C;AACxF;AACA;AACA,2CAA2C,+CAA+C;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,uEAAwB;AACjD,kCAAkC,0EAA2B;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iCAAiC,4EAA6B;AAC9D;AACA;AACA;AACA;AACA,aAAa,4BAA4B,wBAAwB;AACjE;AACA;AACA,gCAAgC,4EAA6B;AAC7D;AACA;AACA,oEAAoE,+BAA+B;AACnG;AACA;AACA,qDAAqD,4EAA6B;AAClF;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mEAAmE,uEAAwB;AAC3F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,0EAA2B;AAC9E;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,mDAAmD,0EAA2B;AAC9E;AACA;AACA;AACA;AACA,mEAAmE,gCAAgC;AACnG;AACA;AACA,gEAAgE,gDAAgD;AAChH;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mEAAmE,gBAAgB;AACnF;AACA;AACA;AACA,QAAQ,gDAAC;AACT;AACA;AACA;AACA,2BAA2B,gDAAC;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA,6DAA6D,sDAAO;AACpE;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,2CAA2C,wDAAS,gCAAgC,6CAA6C;AACjI,mBAAmB,wDAAS;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,4DAAa;AACrB;AACA;AACA,CAAC,CAAC,wDAAS;;AAEX,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,kBAAkB,MAA+B;AACjD;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAiC;AACrD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA,kBAAkB,MAA+B;AACjD;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT,qEAAqE,4BAA4B;AACjG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sFAAsF,UAAU;AAChG;AACA;AACA;AACA;AACA,wBAAwB,QAAQ;AAChC;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D;AAC3D;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sEAAsE,4BAA4B;AAClG;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,wBAAwB;AACvE,SAAS;AACT;AACA,iHAAiH,aAAa,kBAAkB,eAAe,oBAAoB,aAAa;AAChM;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAa;AACrB;AACA;AACA,CAAC,CAAC,wDAAS;;AAEX,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,oBAAoB,MAAiC;AACrD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yEAAyE,aAAa;AACtF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,aAAa;AACrC;AACA;AACA;AACA,yCAAyC,gDAAC;AAC1C,sDAAsD,wBAAwB,gDAAC;AAC/E;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,gDAAC;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,YAAY,6DAAc,oBAAoB,0DAAW;AACzD,0DAA0D;AAC1D;AACA;AACA;AACA;AACA;AACA,uDAAuD,6CAA6C;AACpG,oDAAoD,sBAAsB;AAC1E;AACA;AACA;AACA;AACA;AACA,uDAAuD,wDAAwD;AAC/G,oDAAoD,iCAAiC;AACrF;AACA;AACA,qBAAqB;AACrB;AACA;AACA,gFAAgF,4BAA4B;AAC5G;AACA,wBAAwB,6DAAc,oBAAoB,0DAAW;AACrE;AACA;AACA;AACA;AACA,aAAa,IAAI;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,2DAAQ;AAChB;AACA;AACA,CAAC,CAAC,uDAAQ;;AAEV,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,oBAAoB,MAAiC;AACrD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,gDAAgD,8BAA8B;AAC9E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,gCAAgC;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,uDAAI;AACZ;AACA;AACA,CAAC,CAAC,uDAAQ;;AAEV,oBAAoB,MAAgC;AACpD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,oBAAoB,MAAiC;AACrD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,gGAAgG,oCAAoC;AACpI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gEAAgE,qBAAqB;AACrF;AACA;AACA;AACA,qBAAqB;AACrB,SAAS;AACT;AACA;AACA;AACA,QAAQ,4DAAa;AACrB;AACA;AACA,CAAC,CAAC,uDAAQ;;AAEV,mBAAmB,MAAgC;AACnD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,kBAAkB,MAA+B;AACjD;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAiC;AACrD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA,gBAAgB,MAA6B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,uBAAuB,MAAoC;AAC3D,qDAAqD,QAAQ;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,gDAAC;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6EAA6E,wBAAwB,uBAAuB,sBAAsB;AAClJ;AACA;AACA;AACA,yDAAyD,qBAAqB,sBAAsB,mBAAmB;AACvH;AACA;AACA,6DAA6D,qBAAqB;AAClF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,uBAAuB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,4DAAa;AAC/C;AACA;AACA;AACA;AACA;AACA,mBAAmB,gDAAC;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gDAAC;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kEAAkE;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mGAAmG,0BAA0B;AAC7H;AACA;AACA,kCAAkC,gDAAC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,uCAAuC;AACvC;AACA;AACA;AACA,sDAAsD,oCAAoC;AAC1F;AACA;AACA;AACA,mEAAmE,2CAA2C;AAC9G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,iDAAiD;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAiE,4DAAa;AAC9E,aAAa;AACb;AACA;AACA;AACA;AACA,wEAAwE;AACxE,sFAAsF,oDAAoD;AAC1I;AACA;AACA,sFAAsF,qBAAqB;AAC3G;AACA;AACA,2DAA2D,4DAAa;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,wEAAwE,iBAAiB;AACzF;AACA;AACA,mDAAmD,4CAA4C;AAC/F;AACA,qDAAqD,uFAAuF;AAC5I,oFAAoF,4DAAa;AACjG;AACA;AACA;AACA,+DAA+D,2BAA2B;AAC1F;AACA,8EAA8E,sCAAsC;AACpH,kFAAkF,gCAAgC,eAAe,kDAAkD,KAAK;AACxL;AACA;AACA;AACA;AACA,2DAA2D,4DAAa;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAa;AACrB;AACA;AACA,CAAC,CAAC,uDAAQ;;AAEV;AACA;AACA;AACA;AACA;AACA;;AAEA,kBAAkB,MAA+B;AACjD;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC,kCAAkC,+EAA+E;AACjH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,SAAS,mBAAmB,qBAAqB,gBAAgB,SAAS;AACpH;AACA;AACA;AACA,eAAe,gDAAC;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC;AACzC,uCAAuC,iDAAiD;AACxF;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D;AAC5D;AACA,cAAc,sDAAsD;AACpE;AACA,uCAAuC,sBAAsB,+BAA+B,0EAA0E,8BAA8B,kGAAkG;AACtS;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,mBAAmB,MAAgC;AACnD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,kBAAkB,MAA+B;AACjD;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,0DAA0D,8EAA8E;AACtL;AACA;AACA;AACA;AACA;AACA;AACA,8DAA8D,kCAAkC;AAChG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+DAA+D;AAC/D;AACA;AACA,6BAA6B;AAC7B,6BAA6B;AAC7B;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA,mBAAmB,MAAgC;AACnD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,kBAAkB,MAA+B;AACjD;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,uDAAuD,uBAAuB,+BAA+B,0CAA0C;AACvJ;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,gDAAC;AACjD,sDAAsD;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,IAAI;AACb;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,oBAAoB,kBAAkB,QAAQ,mBAAmB;AAC5G;AACA,mBAAmB;AACnB;AACA;AACA;AACA,2CAA2C,cAAc,qBAAqB,6HAA6H;AAC3M;AACA;AACA,wBAAwB,mBAAmB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,gDAAC;AACxC;AACA;AACA,CAAC;;AAED,mBAAmB,MAAgC;AACnD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,kBAAkB,MAA+B;AACjD;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,uDAAuD,uBAAuB,+BAA+B,0CAA0C;AACvJ;AACA;AACA;AACA;AACA;AACA,sDAAsD;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,IAAI;AACb;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,mBAAmB,MAAgC;AACnD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,sDAAsD;AACtD;AACA;AACA;AACA;AACA;AACA,SAAS,IAAI;AACb;AACA;AACA;AACA,CAAC;;AAED,mBAAmB,MAAgC;AACnD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,kBAAkB,MAA+B;AACjD;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,0DAA0D,qIAAqI;AAC7O;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,kDAAkD;AAC/E,kBAAkB;AAClB;AACA,qEAAqE,cAAc,4EAA4E,aAAa;AAC5K;AACA,uBAAuB;AACvB;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC;AACrC,yCAAyC;AACzC;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,2CAA2C,oBAAoB,gBAAgB,gBAAgB,oBAAoB,QAAQ,mBAAmB;AAC9I;AACA,mBAAmB;AACnB;AACA;AACA;AACA,2CAA2C,cAAc,mBAAmB,8QAA8Q;AAC1V;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,mBAAmB,MAAgC;AACnD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,kBAAkB,MAA+B;AACjD;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,MAA+B;AACjD;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,gBAAgB,MAA6B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,uBAAuB,MAAoC;AAC3D,qDAAqD,QAAQ;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yEAAyE;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,IAAI;AACb;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA,kFAAkF,gBAAgB;AAClG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,QAAQ;AACxC;AACA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,oBAAoB,kDAAkD;AACvH,2CAA2C,aAAa,kCAAkC,QAAQ,kBAAkB,qCAAqC,uBAAuB,sCAAsC,GAAG;AACzN;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,aAAa,wFAAwF,oBAAoB,sCAAsC,6EAA6E,uBAAuB;AAC9S;AACA;AACA;AACA;AACA,sEAAsE,QAAQ,2CAA2C,oBAAoB,0BAA0B;AACvK;AACA,uBAAuB,GAAG;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gEAAgE;AAChE;AACA;AACA;AACA,iBAAiB,WAAW,wBAAwB,sCAAsC;AAC1F;AACA,4DAA4D;AAC5D;AACA;AACA,aAAa,WAAW,wBAAwB,uBAAuB;AACvE;AACA;AACA;AACA;AACA,4CAA4C;AAC5C;AACA;AACA;AACA,aAAa,WAAW;AACxB,uCAAuC,0BAA0B;AACjE;AACA,mDAAmD,eAAe,0BAA0B,UAAU,gCAAgC,IAAI;AAC1I;AACA;AACA,CAAC;;AAED,mBAAmB,MAAgC;AACnD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,CAAC;;AAED,mBAAmB,MAAgC;AACnD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gDAAC;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,gBAAgB;AACjE,kCAAkC,2DAA2D;AAC7F;AACA;AACA;AACA,eAAe,gDAAC;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,eAAe,gDAAC;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gEAAgE,6DAA6D;AAC7H,eAAe,gDAAC;AAChB;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,gDAAC;AACT;AACA;AACA;AACA;AACA;AACA,kBAAkB,qDAAM;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAAC,uDAAQ;;AAEV,mBAAmB,MAAgC;AACnD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,kBAAkB,MAA+B;AACjD;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0DAA0D,sBAAsB;AAChF;AACA;AACA;AACA;AACA;AACA,8BAA8B,mBAAmB;AACjD,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8EAA8E,sCAAsC;AACpH;AACA;AACA;AACA,wDAAwD,mBAAmB;AAC3E;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,uEAAuE,iCAAiC;AACxG;AACA;AACA;AACA,8CAA8C,gBAAgB;AAC9D,oCAAoC,+JAA+J;AACnM;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,uEAAuE,2BAA2B;AAClG;AACA;AACA;AACA,SAAS;AACT,iBAAiB;AACjB;AACA;AACA,CAAC;;AAED,mBAAmB,MAAgC;AACnD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,oBAAoB,MAAiC;AACrD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA,gBAAgB,MAA6B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,gDAAC;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kGAAkG,+BAA+B;AACjI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,gDAAC;AACb,qBAAqB,gDAAC;AACtB;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD,yBAAyB;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6DAA6D,mDAAmD;AAChH,qDAAqD,YAAY,+IAA+I;AAChN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6DAA6D,2EAA2E;AACxI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,uDAAQ;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,0CAA0C,uDAAQ,gCAAgC,yBAAyB;AAC3G;AACA;AACA;AACA,uBAAuB,gDAAC;AACxB,wBAAwB,gDAAC;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,UAAU,4CAA4C,IAAI;AAC/G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,gDAAC;AACb,YAAY,gDAAC;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,4EAA6B;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,qDAAM;AACxB;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,kBAAkB,qDAAM;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,gDAAC;AACT;AACA,QAAQ,gDAAC;AACT;AACA;AACA;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAa;AACrB;AACA;AACA,CAAC,CAAC,wDAAS;;AAEX;AACA;;AAEA,kBAAkB,MAA+B;AACjD;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,MAA6B;AAC7C;AACA;AACA;AACA;AACA,6DAA6D,cAAc;AAC3E;AACA;AACA;AACA;AACA;AACA,gBAAgB,MAA6B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,kBAAkB,MAA+B;AACjD;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6DAA6D,WAAW;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wGAAwG,qBAAqB,YAAY,gCAAgC;AACzK,wBAAwB,gKAAgK,mBAAmB,wCAAwC,GAAG;AACtP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,iCAAiC,UAAU,2BAA2B,IAAI;AAClH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,8BAA8B,gBAAgB,cAAc,iBAAiB,IAAI;AAC9G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oFAAoF,WAAW;AAC/F;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,OAAO,YAAY,UAAU;AAC3D;AACA;AACA;AACA;AACA,2BAA2B;AAC3B,mDAAmD;AACnD;AACA,SAAS;AACT,6BAA6B;AAC7B,6CAA6C,kCAAkC;AAC/E,4CAA4C;AAC5C,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB,uDAAuD,qBAAqB,wBAAwB;AACpG;AACA,KAAK;AACL,yBAAyB;AACzB,oCAAoC,sBAAsB,yDAAyD;AACnH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC;AAClC;AACA,yFAAyF,iBAAiB;AAC1G;AACA;AACA;AACA,yFAAyF,cAAc;AACvG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,uBAAuB;AAChD;AACA;AACA,oCAAoC,sBAAsB,0BAA0B;AACpF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,OAAO;AACzC;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oFAAoF,mBAAmB;AACvG,wDAAwD,kBAAkB;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gHAAgH;AAChH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,0EAA0E,6BAA6B;AACvG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC;AAClC;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA,0CAA0C;AAC1C,qFAAqF;AACrF;AACA,sGAAsG,uBAAuB;AAC7H;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,QAAQ;AAChC;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA,iEAAiE,uDAAuD;AACxH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,gCAAgC;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,mBAAmB,MAAgC;AACnD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,kBAAkB,MAA+B;AACjD;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAiC;AACrD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA,gBAAgB,MAA6B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,uBAAuB,MAAoC;AAC3D,qDAAqD,QAAQ;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yGAAyG,mDAAmD;AAC5J;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,QAAQ,oBAAoB;AACvE;AACA,qDAAqD,wDAAwD;AAC7G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,8EAA8E,2CAA2C;AACzH;AACA;AACA;AACA,8EAA8E,2CAA2C;AACzH;AACA;AACA;AACA,8EAA8E,oCAAoC;AAClH;AACA;AACA;AACA,oCAAoC;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yFAAyF,wBAAwB;AACjH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oFAAoF,wBAAwB;AAC5G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC;AACrC,8CAA8C;AAC9C,sCAAsC;AACtC,yCAAyC;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,qDAAqD,iCAAiC;AAC7I;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,8BAA8B;AACnF;AACA;AACA;AACA,QAAQ,2DAAQ;AAChB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,yDAAU;AAClB;AACA;AACA,QAAQ,uDAAI;AACZ;AACA;AACA,CAAC,CAAC,uDAAQ;;AAEV,mBAAmB,MAAgC;AACnD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,oBAAoB,MAAiC;AACrD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,uDAAI;AACZ;AACA;AACA,CAAC,CAAC,uDAAQ;;AAEV,mBAAmB,MAAgC;AACnD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,oBAAoB,MAAiC;AACrD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,gDAAC;AACtC;AACA;AACA,yEAAyE,6BAA6B;AACtG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,4CAA4C,0CAA0C;AAC3G;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gDAAC;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,uDAAI;AACZ;AACA;AACA,CAAC,CAAC,uDAAQ;;AAEV,mBAAmB,MAAgC;AACnD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,kBAAkB,MAA+B;AACjD;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAiC;AACrD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA,gBAAgB,MAA6B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,uBAAuB,MAAoC;AAC3D,qDAAqD,QAAQ;AAC7D;AACA;AACA;AACA,kBAAkB,MAA+B;AACjD;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC;AACzC;AACA;AACA;AACA;AACA,mDAAmD,qDAAM,yCAAyC,kCAAkC;AACpI,mDAAmD,qDAAM;AACzD,mDAAmD,qDAAM;AACzD,mDAAmD,qDAAM,gDAAgD,qCAAqC;AAC9I,mDAAmD,qDAAM,+CAA+C,qCAAqC;AAC7I,mDAAmD,qDAAM,2CAA2C,qCAAqC;AACzI,mDAAmD,qDAAM;AACzD,mDAAmD,qDAAM;AACzD,mDAAmD,qDAAM;AACzD;AACA;AACA,0CAA0C,gEAAiB;AAC3D;AACA;AACA,mDAAmD,kEAAkE;AACrH,2DAA2D,6EAA6E;AACxI,qDAAqD,mEAAmE;AACxH,6DAA6D,+EAA+E;AAC5I,wDAAwD,yDAAyD;AACjH,0DAA0D;AAC1D,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0EAA0E,2DAA2D;AACrI,sCAAsC,gDAAC;AACvC;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,oEAAoE,kCAAkC;AACtG;AACA;AACA;AACA;AACA;AACA,wBAAwB,gDAAC;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D,+BAA+B,yBAAyB,eAAe;AAClI,eAAe,gDAAC;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D,gDAAC;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,gDAAC;AACzB;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sEAAsE,2BAA2B;AACjG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,gDAAC;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,+BAA+B;AAC/D,mCAAmC,gBAAgB;AACnD,oCAAoC,eAAe;AACnD;AACA;AACA,8BAA8B,gDAAC;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,gDAAC;AACzB;AACA;AACA,sBAAsB,gDAAC;AACvB;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,gDAAC;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,qDAAM;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,8BAA8B;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,sBAAsB,qDAAM;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wDAAwD,sDAAsD,wBAAwB,WAAW;AACjJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,4CAA4C,gDAAC;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4EAA4E,qBAAqB;AACjG;AACA,qFAAqF,qCAAqC;AAC1H;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,+EAA+E,UAAU;AACzF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,QAAQ;AAChC;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD,gDAAC;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,gDAAC;AACpC;AACA;AACA;AACA;AACA;AACA;AACA,gEAAgE,+BAA+B,yBAAyB,eAAe;AACvI;AACA;AACA,gEAAgE,gDAAC;AACjE,8DAA8D,gDAAC,8BAA8B,gDAAC;AAC9F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6DAA6D,sDAAsD;AACnH;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,gDAAC;AACvC,+CAA+C,gDAAC,QAAQ,gDAAC;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,gDAAC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,gDAAC;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6DAA6D,+CAA+C;AAC5G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,gDAAC;AAClC,0EAA0E,sCAAsC;AAChH,wEAAwE,oCAAoC;AAC5G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC;AACzC,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,gDAAC,6DAA6D,uDAAQ;AAC7F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,qDAAM;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,gBAAgB;AACjD;AACA;AACA;AACA;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAa;AACrB;AACA;AACA,QAAQ,uDAAI;AACZ;AACA;AACA,CAAC,CAAC,uDAAQ;;AAEV,mBAAmB,MAAgC;AACnD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,oBAAoB,MAAiC;AACrD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,kEAAmB;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,gDAAC;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,gDAAC;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,gDAAC;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAa;AACrB;AACA;AACA,CAAC,CAAC,wDAAS;;AAEX;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,mBAAmB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,SAAS;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,UAAU;AAC9B;AACA;AACA;AACA;;AAEA,mBAAmB,MAAgC;AACnD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,kBAAkB,MAA+B;AACjD;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAiC;AACrD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA,gBAAgB,MAA6B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,uBAAuB,MAAoC;AAC3D,qDAAqD,QAAQ;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,kEAAmB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,gDAAC,sBAAsB,+GAA+G;AAClJ;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,qDAAM;AACxB;AACA;AACA;AACA;AACA;AACA,kBAAkB,qDAAM;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+DAA+D,6CAA6C;AAC5G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,qDAAqD,sDAAsD,yDAAyD,gDAAC,+BAA+B,IAAI;AACxM;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,gDAAC;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,yBAAyB;AAC9E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,kBAAkB,gDAAC;AAC5C;AACA;AACA,qBAAqB;AACrB;AACA,iBAAiB,OAAO,gDAAC;AACzB;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,YAAY;AACxC;AACA,+BAA+B;AAC/B,sDAAsD,aAAa,gBAAgB;AACnF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,YAAY;AACxC,+BAA+B;AAC/B,qDAAqD,aAAa,8BAA8B;AAChG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2FAA2F,gDAAC;AAC5F;AACA;AACA;AACA,cAAc;AACd,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,CAAC;;AAED,mBAAmB,MAAgC;AACnD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,kBAAkB,MAA+B;AACjD;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,kEAAmB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,gDAAC;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8DAA8D,4DAAa,iCAAiC,4DAAa;AACzH;AACA;AACA;AACA,wFAAwF,uBAAuB,kCAAkC;AACjJ;AACA;AACA;AACA;AACA;AACA,wBAAwB,gDAAC;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,mBAAmB,MAAgC;AACnD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,oBAAoB,MAAiC;AACrD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,kEAAmB;AAC3D;AACA;AACA,QAAQ,uDAAI;AACZ;AACA;AACA,CAAC,CAAC,uDAAQ;;AAEV;AACA;;AAEA;AACA;AACA,gBAAgB,0DAAW;AAC3B;AACA;AACA,UAAU,2DAA2D;AACrE,UAAU;AACV;AACA;AACA;AACA;AACA;;AAEA,mBAAmB,MAAgC;AACnD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,oBAAoB,MAAiC;AACrD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA,gBAAgB,MAA6B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,qBAAqB;AACrB,qBAAqB;AACrB,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6GAA6G,aAAa,aAAa;AACvI,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,gDAAC;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qEAAqE,mCAAmC;AACxG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,4DAAa;AACrB;AACA;AACA,CAAC,CAAC,wDAAS;;AAEX,mBAAmB,MAAgC;AACnD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,uDAAQ;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,QAAQ,gDAAC;AACT,4DAA4D,cAAc;AAC1E;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,gDAAC;AACjB;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAAC,4DAAa;;AAEf,gBAAgB,MAA6B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0DAA0D,+EAA+E;AACzI;AACA;AACA;AACA;AACA;AACA,0DAA0D,6EAA6E;AACvI;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0DAA0D,8EAA8E;AACxI;AACA;AACA;AACA;AACA,sDAAsD,yEAAyE;AAC/H;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL,gBAAgB,0DAAW;AAC3B;AACA;AACA;AACA;AACA,UAAU,+DAA+D;AACzE,UAAU,+DAA+D;AACzE;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,mBAAmB,MAAgC;AACnD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,kBAAkB,MAA+B;AACjD;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAiC;AACrD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,qDAAM;AACzD;AACA;AACA;AACA,oBAAoB;AACpB,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,gDAAC;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD;AACvD,2CAA2C;AAC3C,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,CAAC,CAAC,uDAAQ;;AAEV,mBAAmB,MAAgC;AACnD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,oBAAoB,MAAiC;AACrD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+DAA+D,qDAAqD;AACpH,yEAAyE,8DAA8D;AACvI,oDAAoD,0CAA0C;AAC9F,6CAA6C,mCAAmC;AAChF,kCAAkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,gDAAC;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,gDAAC;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,mDAAI;AAChB;AACA;AACA;AACA;AACA,aAAa;AACb,qBAAqB,6DAAc;AACnC,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,CAAC,CAAC,wDAAS;;AAEX;AACA;;AAEA;AACA;AACA,gBAAgB,0DAAW;AAC3B;AACA;AACA,UAAU;AACV;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;;AAEA,mBAAmB,MAAgC;AACnD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,oBAAoB,MAAiC;AACrD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,cAAc;AACjE,aAAa;AACb,kDAAkD,6CAA6C,IAAI,0BAA0B,aAAa;AAC1I;AACA;AACA,2DAA2D,iCAAiC;AAC5F;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,8BAA8B,uDAAQ;AACtC;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,gDAAC;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+DAA+D,gDAAC;AAChE;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,uDAAI;AACZ;AACA;AACA,CAAC,CAAC,uDAAQ;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wEAAwE;AACxE,uEAAuE;AACvE,wEAAwE;AACxE;AACA;AACA;AACA;AACA;AACA,gEAAgE,+BAA+B;AAC/F,gCAAgC,2DAAY;AAC5C;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,0CAA0C,+CAA+C;AACzF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,2CAA2C;AACpF,yCAAyC,wCAAwC;AACjF,yCAAyC,uCAAuC;AAChF;AACA;AACA;AACA,mBAAmB,6DAAc,gBAAgB,0DAAW;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,gDAAC;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,yDAAU;AACjE;AACA;AACA;AACA,2CAA2C,kEAAmB;AAC9D;AACA,mBAAmB,gDAAC;AACpB;AACA,yBAAyB,wDAAS;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,8BAA8B;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,sHAAsH;AACrK;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,kDAAkD,QAAQ,yKAAyK,QAAQ,6IAA6I;AACxX;AACA,mBAAmB,gDAAC;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,gDAAC;AACpB;AACA,yBAAyB,wDAAS;AAClC;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,4CAA4C;AAC/F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAa;AACrB;AACA;AACA,CAAC,CAAC,uDAAQ;;AAEV,mBAAmB,MAAgC;AACnD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,kBAAkB,MAA+B;AACjD;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAiC;AACrD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,gDAAC,iBAAiB,6DAAc,gBAAgB,0DAAW;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0DAA0D,6DAAc,gBAAgB,0DAAW;AACnG;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,gDAAC;AACb;AACA,oCAAoC,6DAAc,gBAAgB,0DAAW;AAC7E,sCAAsC,6DAAc,gBAAgB,0DAAW;AAC/E;AACA;AACA,yBAAyB,gDAAC;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,gDAAC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,wFAAwF,qBAAqB,qDAAqD;AAClK,aAAa;AACb;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,oCAAoC,2DAA2D;AAC/F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,uDAAQ;AACtC;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,kCAAkC,kEAAmB;AACrD;AACA;AACA;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,2DAAQ;AAChB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,uDAAI;AACZ;AACA;AACA,CAAC,CAAC,uDAAQ;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,yDAAU;AAC5D;AACA;AACA;AACA;AACA,kCAAkC,kEAAmB,0CAA0C,gCAAgC;AAC/H;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,mFAAmF;AACtI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAa;AACrB;AACA;AACA,CAAC,CAAC,wDAAS;;AAEX,mBAAmB,MAAgC;AACnD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,kBAAkB,MAA+B;AACjD;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAiC;AACrD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,gDAAC;AAC3B;AACA;AACA;AACA;AACA;AACA,0CAA0C,0EAA0E;AACpH;AACA;AACA;AACA;AACA;AACA,0CAA0C,2EAA2E;AACrH;AACA;AACA;AACA;AACA;AACA,0CAA0C,wEAAwE;AAClH;AACA;AACA;AACA,oBAAoB,6DAAc,oBAAoB,0DAAW;AACjE;AACA;AACA;AACA;AACA;AACA,8BAA8B,gDAAC;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C;AAC1C;AACA;AACA;AACA;AACA,0CAA0C;AAC1C;AACA;AACA;AACA,wEAAwE,gDAAC;AACzE;AACA,0CAA0C,oEAAoE;AAC9G,0BAA0B,gDAAC;AAC3B;AACA;AACA;AACA,6EAA6E,gDAAC;AAC9E;AACA,0CAA0C,uEAAuE;AACjH,0BAA0B,gDAAC;AAC3B;AACA;AACA;AACA;AACA,0CAA0C;AAC1C;AACA;AACA;AACA;AACA,0CAA0C;AAC1C;AACA;AACA;AACA;AACA,0CAA0C;AAC1C;AACA;AACA,oBAAoB,6DAAc,oBAAoB,0DAAW;AACjE;AACA;AACA;AACA,8BAA8B,gDAAC;AAC/B,8CAA8C;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,6DAAc,oBAAoB,0DAAW;AACjE;AACA;AACA;AACA,8BAA8B,gDAAC;AAC/B,8CAA8C,gDAAgD,sBAAsB;AACpH;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,6DAAc,oBAAoB,0DAAW;AACjE;AACA;AACA;AACA,8BAA8B,gDAAC;AAC/B,8CAA8C,gDAAgD,iDAAiD;AAC/I;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,6DAAc,oBAAoB,0DAAW;AACjE;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,gDAAC;AAC/B;AACA,8CAA8C;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,6DAAc,oBAAoB,0DAAW;AACjE;AACA;AACA;AACA;AACA,8BAA8B,gDAAC;AAC/B,8CAA8C;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,6DAAc,gBAAgB,0DAAW;AAC/E,wCAAwC,6DAAc,gBAAgB,0DAAW;AACjF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,gDAAC;AAC3B;AACA;AACA;AACA;AACA,0BAA0B,gDAAC;AAC3B,0CAA0C,uCAAuC;AACjF;AACA;AACA;AACA;AACA,0BAA0B,gDAAC;AAC3B,0CAA0C;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,gDAAC;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,aAAa;AACb;AACA;AACA,mDAAmD,gDAAC;AACpD;AACA;AACA;AACA,qBAAqB;AACrB;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,2DAAQ;AAChB;AACA;AACA,QAAQ,2DAAQ;AAChB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,uDAAI;AACZ;AACA;AACA,CAAC,CAAC,uDAAQ;;AAEV;AACA;;AAEA,mBAAmB,MAAgC;AACnD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,kBAAkB,MAA+B;AACjD;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAiC;AACrD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA,gBAAgB,MAA6B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,6DAAc,oBAAoB,0DAAW;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kIAAkI,sBAAsB;AACxJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,oBAAoB;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD,uBAAuB,aAAa;AAC7F;AACA;AACA;AACA;AACA;AACA,gBAAgB,gDAAC,sBAAsB,iFAAiF;AACxH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,gDAAC,sBAAsB,mGAAmG;AACtJ;AACA;AACA;AACA,qBAAqB,wBAAwB,yBAAyB;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,2DAAQ;AAChB;AACA;AACA,QAAQ,uDAAI;AACZ;AACA;AACA,CAAC,CAAC,uDAAQ;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,6CAA6C,sBAAsB,IAAI;AAC7G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kEAAkE;AAClE,kEAAkE;AAClE,0EAA0E;AAC1E;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,+DAA+D;AAC/D,+DAA+D;AAC/D,uEAAuE;AACvE;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,oDAAoD;AACpD,8DAA8D;AAC9D;AACA,iBAAiB;AACjB,8CAA8C;AAC9C;AACA;AACA;AACA;AACA,4DAA4D;AAC5D,0DAA0D;AAC1D;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,sDAAsD;AACtD,gEAAgE;AAChE,wEAAwE;AACxE;AACA,iBAAiB;AACjB,6DAA6D;AAC7D;AACA;AACA;AACA;AACA,0EAA0E;AAC1E,0EAA0E;AAC1E;AACA;AACA;AACA,kBAAkB,gDAAC;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,mEAAmE;AACzG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kEAAkE;AAClE,kEAAkE;AAClE,0EAA0E;AAC1E;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,+DAA+D;AAC/D,+DAA+D;AAC/D,uEAAuE;AACvE;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,oDAAoD;AACpD,8DAA8D;AAC9D;AACA;AACA,iBAAiB;AACjB,8CAA8C;AAC9C;AACA;AACA;AACA,4DAA4D;AAC5D,0DAA0D;AAC1D;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,sDAAsD;AACtD,gEAAgE;AAChE,wEAAwE;AACxE;AACA;AACA,iBAAiB;AACjB,6DAA6D;AAC7D;AACA;AACA;AACA,0EAA0E;AAC1E,0EAA0E;AAC1E;AACA;AACA;AACA;AACA,kBAAkB,gDAAC;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA,gBAAgB,0DAAW;AAC3B;AACA;AACA;AACA;AACA;;AAEA,mBAAmB,MAAgC;AACnD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,kBAAkB,MAA+B;AACjD;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAiC;AACrD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC;AACtC,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,eAAe,8BAA8B,IAAI,6BAA6B;AAC9E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,eAAe,wDAAS;AACxB;AACA;AACA;AACA;AACA,gEAAgE,aAAa;AAC7E;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,gDAAC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,gBAAgB;AACvE;AACA;AACA;AACA;AACA,2CAA2C,kEAAmB;AAC9D;AACA;AACA;AACA;AACA,gDAAgD,eAAe;AAC/D,SAAS;AACT;AACA,gDAAgD,qCAAqC;AACrF,0CAA0C,kEAAmB;AAC7D;AACA;AACA;AACA;AACA,SAAS;AACT,8DAA8D,6BAA6B;AAC3F;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,wCAAwC,+DAAgB;AACxD;AACA;AACA,SAAS;AACT,gDAAgD,kCAAkC;AAClF;AACA;AACA;AACA,4CAA4C,+DAAgB,+BAA+B;AAC3F;AACA;AACA;AACA,aAAa,IAAI;AACjB;AACA;AACA;AACA;AACA,qDAAqD,iCAAiC;AACtF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,wDAAS;AAChC;AACA,qDAAqD,mBAAmB;AACxE,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,aAAa;AACb;AACA,eAAe,wDAAS,mCAAmC;AAC3D;AACA;AACA,iCAAiC;AACjC;AACA;AACA,kCAAkC,6DAAc;AAChD;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wEAAwE,uDAAuD;AAC/H,iFAAiF,cAAc,KAAK,8BAA8B;AAClI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,uBAAuB;AAChD;AACA;AACA;AACA;AACA,QAAQ,gDAAC;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,mDAAmD,kFAAkF;AACrI,+DAA+D,+DAA+D;AAC9H,aAAa;AACb,8EAA8E,6BAA6B;AAC3G,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,iCAAiC;AACpF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,gDAAC;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAa;AACrB;AACA;AACA,CAAC,CAAC,2DAAY;;AAEd,mBAAmB,MAAgC;AACnD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,kBAAkB,MAA+B;AACjD;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAiC;AACrD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+DAA+D;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,mBAAmB;AACnB,YAAY,gDAAC;AACb;AACA;AACA;AACA;AACA,SAAS;AACT,eAAe,wDAAS;AACxB;AACA;AACA;AACA;AACA;AACA,oBAAoB,gDAAC;AACrB;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,gDAAC;AACrB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,gDAAC;AACrB,iBAAiB;AACjB;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yHAAyH,2EAA2E;AACpM;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,CAAC,CAAC,wDAAS;;AAEX;AACA;;AAEA;AACA;AACA,gBAAgB,0DAAW;AAC3B;AACA;AACA,UAAU,mEAAmE;AAC7E,UAAU,uFAAuF;AACjG;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,8BAA8B;AACzC,WAAW,aAAa;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA,mBAAmB,MAAgC;AACnD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,oBAAoB,MAAiC;AACrD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,gDAAC;AACb;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,CAAC,CAAC,wDAAS;;AAEX,mBAAmB,MAAgC;AACnD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,oBAAoB,MAAiC;AACrD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,gDAAC;AACpB;AACA;AACA,sDAAsD,0DAAW;AACjE;AACA;AACA,YAAY,gDAAC;AACb;AACA;AACA;AACA,YAAY,gDAAC;AACb;AACA;AACA;AACA;AACA;AACA,uCAAuC,uBAAuB;AAC9D,uCAAuC;AACvC,SAAS;AACT;AACA;AACA;AACA;AACA,4BAA4B,gDAAC;AAC7B,iCAAiC,gDAAC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,sDAAO;AACxB;AACA;AACA,iBAAiB,sDAAO;AACxB;AACA;AACA,iBAAiB,sDAAO;AACxB,iBAAiB,sDAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,sDAAO;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,sDAAO;AACrC;AACA;AACA;AACA,sBAAsB,gDAAC;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD,qCAAqC;AAC3F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,4BAA4B,gDAAC;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,mDAAmD,kDAAkD;AACrG,aAAa;AACb;AACA;AACA,gBAAgB,gDAAC;AACjB;AACA;AACA;AACA,gBAAgB,gDAAC;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,CAAC,CAAC,6DAAc;;AAEhB;AACA;;AAEA;AACA;AACA,gBAAgB,0DAAW;AAC3B;AACA;AACA,UAAU,qEAAqE;AAC/E,UAAU;AACV;AACA;AACA;AACA;AACA;;AAEA,mBAAmB,MAAgC;AACnD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,oBAAoB,MAAiC;AACrD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,6DAAc;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,qDAAqD;AAC/F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC;AACrC;AACA,wBAAwB,sBAAsB;AAC9C;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,YAAY,gDAAC;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,gDAAC,sBAAsB,yCAAyC;AAC5E;AACA;AACA;AACA,4CAA4C,gDAAC;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,2DAA2D;AACnG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6EAA6E,+CAA+C,kBAAkB,IAAI;AAClJ;AACA;AACA;AACA;AACA;AACA,sDAAsD,qDAAqD;AAC3G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,mCAAmC,eAAe,6DAAc;AAChE;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,mCAAmC,eAAe,6DAAc;AAChE;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,mCAAmC,eAAe,6DAAc;AAChE;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,gCAAgC;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD,0CAA0C;AACnG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD,wCAAwC;AACjG;AACA;AACA;AACA;AACA,iBAAiB,2DAAY;AAC7B,yBAAyB,QAAQ,gFAAiC;AAClE,iBAAiB,2DAAY;AAC7B,yBAAyB,QAAQ,gFAAiC;AAClE,iBAAiB,2DAAY;AAC7B,yBAAyB,QAAQ,gFAAiC;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,QAAQ,gFAAiC;AAClE;AACA;AACA;AACA,oBAAoB,gFAAiC;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,sBAAsB,qDAAM;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,gDAAC;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,wEAAwE,oCAAoC;AAC5G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wEAAwE,sCAAsC;AAC9G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,8DAA8D,2CAA2C;AACzG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,2DAAY;AAC5C;AACA;AACA;AACA,yDAAyD,4BAA4B;AACrF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,qDAAM;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,2DAAY;AAC9C;AACA;AACA;AACA;AACA;AACA,YAAY,gDAAC;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAa;AACrB;AACA;AACA,QAAQ,yDAAU;AAClB;AACA;AACA,CAAC,CAAC,2DAAY;;AAEd,mBAAmB,MAAgC;AACnD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,oBAAoB,MAAiC;AACrD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA,gBAAgB,MAA6B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD,iEAAkB,mCAAmC,iCAAiC;AAC/I;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,wBAAwB;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,uBAAuB;AACnD;AACA;AACA;AACA;AACA,4BAA4B,uBAAuB;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D,iBAAiB,sCAAsC,IAAI;AACvH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAa;AACrB;AACA;AACA,CAAC,CAAC,uDAAQ;;AAEV;AACA;AACA;AACA,yBAAyB,uBAAuB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA,gEAAgE,4BAA4B;AAC5F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,2CAA2C,qBAAqB;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,mBAAmB,MAAgC;AACnD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,oBAAoB,MAAiC;AACrD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA,gBAAgB,MAA6B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,uBAAuB,MAAoC;AAC3D,qDAAqD,QAAQ;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,oDAAoD;AACnG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kGAAkG,YAAY,2IAA2I;AACzP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yEAAyE,yDAAyD;AAClI;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8EAA8E,OAAO;AACrF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,gCAAgC;AAClF;AACA,wBAAwB,yDAAyD;AACjF;AACA,qCAAqC,4BAA4B;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mFAAmF,8CAA8C;AACjI,iEAAiE,iDAAiD;AAClH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,oEAAoE;AACxG,iGAAiG;AACjG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,gEAAgE,gCAAgC;AAChG;AACA,kDAAkD,wCAAwC;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA,uEAAuE,qEAAqE;AAC5I;AACA;AACA;AACA,+CAA+C,gCAAgC;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oFAAoF,gCAAgC;AACpH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,+CAA+C;AACnG;AACA;AACA;AACA;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAa;AACrB;AACA;AACA,QAAQ,yDAAU;AAClB;AACA;AACA,CAAC,CAAC,uDAAQ;;AAEV,mBAAmB,MAAgC;AACnD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,oBAAoB,MAAiC;AACrD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA,gBAAgB,MAA6B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,uBAAuB,MAAoC;AAC3D,qDAAqD,QAAQ;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,6DAAc;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,gFAAiC;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,QAAQ,gFAAiC;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0EAA0E,iBAAiB,gFAAgF,KAAK;AAChL;AACA;AACA;AACA;AACA;AACA,oBAAoB,gFAAiC;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D,2DAA2D;AACvH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,eAAe,6DAAc;AAChE;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,eAAe,6DAAc;AAChE;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,eAAe,6DAAc;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,yDAAyD,4BAA4B;AACrF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sHAAsH;AACtH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6EAA6E,kCAAkC;AAC/G;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD,wCAAwC;AACjG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD,0CAA0C;AACnG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,gDAAC;AACb;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,8DAA8D,2CAA2C;AACzG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,qDAAM;AACxB;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,qDAAM;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAa;AACrB;AACA;AACA,QAAQ,yDAAU;AAClB;AACA;AACA,CAAC,CAAC,uDAAQ;;AAEV,mBAAmB,MAAgC;AACnD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,oBAAoB,MAAiC;AACrD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA,gBAAgB,MAA6B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,gDAAC;AAC9C;AACA;AACA;AACA;AACA;AACA,uEAAuE;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,qDAAM;AACzD,mDAAmD,qDAAM;AACzD;AACA,mDAAmD,qDAAM;AACzD,mDAAmD,qDAAM;AACzD,mDAAmD,qDAAM;AACzD,mDAAmD,qDAAM;AACzD;AACA;AACA;AACA;AACA;AACA,YAAY,gDAAC,sBAAsB,iCAAiC;AACpE;AACA;AACA;AACA,YAAY,gDAAC,sBAAsB,iCAAiC;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,kCAAkC;AACtF;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,kCAAkC,gDAAC;AACnC;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,sDAAO;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,qDAAM;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C;AAC5C;AACA;AACA;AACA;AACA,SAAS,IAAI;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,6DAAc;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC;AAChC;AACA,kBAAkB,qDAAM;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,6DAAc,MAAM,UAAU;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA,sDAAsD,kDAAkD;AACxG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,gDAAC;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wEAAwE,eAAe;AACvF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,yDAAU;AAClB;AACA;AACA,QAAQ,4DAAa;AACrB;AACA;AACA,QAAQ,yDAAU;AAClB;AACA;AACA,QAAQ,uDAAI;AACZ;AACA;AACA,CAAC,CAAC,uDAAQ;;AAEV,mBAAmB,MAAgC;AACnD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,oBAAoB,MAAiC;AACrD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,YAAY,gDAAC;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,qFAAqF;AAC1H,kCAAkC,sCAAsC;AACxE;AACA,qCAAqC,oDAAoD;AACzF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,gDAAC,sBAAsB,8GAA8G;AACjJ;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,gDAAC,sBAAsB,mGAAmG;AACtI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,uDAAI;AACZ;AACA;AACA,CAAC,CAAC,uDAAQ;;AAEV,mBAAmB,MAAgC;AACnD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,oBAAoB,MAAiC;AACrD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,sDAAO;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,mCAAmC;AACjF;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,gDAAC;AACb;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,gDAAC;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,gDAAC;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,qDAAqD,gDAAC;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,gDAAC;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,gDAAC,wBAAwB,gDAAC;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D;AAC3D;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,yDAAyD,gDAAC;AAC1D;AACA;AACA;AACA;AACA;AACA,uDAAuD,gDAAC;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD,gDAAC;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,mCAAmC;AAC/E;AACA;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAa;AACrB;AACA;AACA,QAAQ,uDAAI;AACZ;AACA;AACA,CAAC,CAAC,uDAAQ;;AAEV,oBAAoB,MAAiC;AACrD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,yDAAU;AAClB;AACA;AACA,QAAQ,uDAAI;AACZ;AACA;AACA,CAAC;;AAED,mBAAmB,MAAgC;AACnD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,oBAAoB,MAAiC;AACrD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,8CAA8C;AACpF;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,2BAA2B,QAAQ,gFAAiC;AACpE;AACA;AACA,oDAAoD,gFAAiC;AACrF;AACA;AACA;AACA;AACA;AACA,+CAA+C,oCAAoC;AACnF;AACA,kCAAkC,gFAAiC;AACnE;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,sDAAsD,gBAAgB;AACtE,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,MAAM,qDAAM,sBAAsB;AAChF;AACA;AACA;AACA,sBAAsB,qDAAM;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,oEAAoE,gBAAgB;AACpF;AACA;AACA,8CAA8C,MAAM,qDAAM,sBAAsB;AAChF;AACA;AACA;AACA,qBAAqB,QAAQ,gFAAiC;AAC9D;AACA;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAa;AACrB;AACA;AACA,QAAQ,uDAAI;AACZ;AACA;AACA,CAAC,CAAC,uDAAQ;;AAEV,mBAAmB,MAAgC;AACnD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,oBAAoB,MAAiC;AACrD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,qDAAM;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,gDAAC;AACtB;AACA;AACA;AACA;AACA,sEAAsE,gDAAC;AACvE;AACA;AACA,kCAAkC,MAAM,qDAAM;AAC9C;AACA;AACA;AACA,YAAY,gDAAC;AACb;AACA;AACA,6BAA6B,sDAAO;AACpC;AACA;AACA;AACA,YAAY,gDAAC;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAa;AACrB;AACA;AACA,QAAQ,uDAAI;AACZ;AACA;AACA,CAAC,CAAC,uDAAQ;;AAEV,mBAAmB,MAAgC;AACnD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,oBAAoB,MAAiC;AACrD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,qDAAM;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,mEAAoB;AACxD,4BAA4B,sBAAsB;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gEAAgE,mBAAmB,mEAAoB,GAAG;AAC1G;AACA;AACA;AACA;AACA,YAAY,gDAAC;AACb,oDAAoD,wCAAwC,qCAAqC;AACjI,wDAAwD,UAAU,mDAAmD;AACrH;AACA;AACA;AACA,YAAY,gDAAC;AACb;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wDAAwD,kBAAkB;AAC1E;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gEAAgE,4BAA4B;AAC5F,gEAAgE,4BAA4B;AAC5F;AACA,SAAS;AACT;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAa;AACrB;AACA;AACA,QAAQ,uDAAI;AACZ;AACA;AACA,CAAC,CAAC,uDAAQ;;AAEV,mBAAmB,MAAgC;AACnD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,oBAAoB,MAAiC;AACrD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,qDAAM;AACzD;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,mCAAmC;AAC1F,uDAAuD,mCAAmC;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAa;AACrB;AACA;AACA,QAAQ,uDAAI;AACZ;AACA;AACA,CAAC,CAAC,uDAAQ;;AAEV,oBAAoB,MAAiC;AACrD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,gDAAC,sBAAsB,iCAAiC;AACpE;AACA;AACA;AACA;AACA;AACA,YAAY,gDAAC,sBAAsB,iCAAiC;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,uDAAI;AACZ;AACA;AACA,CAAC;;AAED,oBAAoB,MAAiC;AACrD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA,kFAAkF,wBAAwB;AAC1G,wBAAwB,iCAAiC;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0FAA0F,wBAAwB;AAClH,wBAAwB,iCAAiC;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,uDAAI;AACZ;AACA;AACA,CAAC;;AAED,mBAAmB,MAAgC;AACnD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,oBAAoB,MAAiC;AACrD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA,gBAAgB,MAA6B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,uBAAuB,MAAoC;AAC3D,qDAAqD,QAAQ;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6DAA6D,mBAAmB;AAChF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,kBAAkB,qDAAM;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B;AACA;AACA;AACA;AACA,+BAA+B;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAa;AACrB;AACA;AACA,CAAC,CAAC,uDAAQ;;AAEV,mBAAmB,MAAgC;AACnD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,kBAAkB,MAA+B;AACjD;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAiC;AACrD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA,cAAc,MAA6B;AAC3C;AACA;AACA;AACA;AACA,6DAA6D,cAAc;AAC3E;AACA;AACA;AACA;AACA;AACA,gBAAgB,MAA6B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,uBAAuB,MAAoC;AAC3D,qDAAqD,QAAQ;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC;AAChC;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,qDAAM,oCAAoC,sCAAsC;AACnI;AACA,mDAAmD,qDAAM,+CAA+C,wCAAwC;AAChJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4FAA4F,6GAA6G;AACzM;AACA;AACA;AACA;AACA;AACA,4IAA4I,4FAA4F;AACxO;AACA,0CAA0C,OAAO;AACjD;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sFAAsF,6BAA6B;AACnH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,qCAAqC;AACrF,qFAAqF,cAAc;AACnG,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,mGAAmG,YAAY,YAAY;AAC3H,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C;AAC5C,oCAAoC;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,6DAA6D,mBAAmB;AAChF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B;AACA;AACA,+BAA+B;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAa;AACrB;AACA;AACA,CAAC,CAAC,uDAAQ;;AAEV,mBAAmB,MAAgC;AACnD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,oBAAoB,MAAiC;AACrD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,qDAAM;AAC5B;AACA;AACA;AACA,SAAS;AACT;AACA,gFAAgF,sDAAsD;AACtI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,qDAAM;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,qDAAM;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,qDAAM;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,eAAe;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,kBAAkB,qDAAM;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,kBAAkB,qDAAM;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAa;AACrB;AACA;AACA,QAAQ,uDAAI;AACZ;AACA;AACA,CAAC,CAAC,uDAAQ;;AAEV;AACA;;AAEA;AACA;AACA,gBAAgB,0DAAW;AAC3B;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;AACA;AACA;AACA,iCAAiC,gDAAC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,gDAAC,gBAAgB,gDAAC;AACtD;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6DAA6D,0DAA0D;AACvH;AACA;AACA;AACA,yDAAyD,OAAO,gDAAC,gBAAgB,gDAAC,sBAAsB;AACxG;AACA,mGAAmG,yBAAyB;AAC5H;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,0BAA0B;AACnE;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,kBAAkB,MAA+B;AACjD;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8GAA8G,yBAAyB;AACvI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,QAAQ;AAChC;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,gBAAgB,MAA6B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,qBAAqB,MAAoC;AACzD,qDAAqD,QAAQ;AAC7D;AACA;AACA;AACA,kBAAkB,MAA+B;AACjD;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wDAAwD,QAAQ,oKAAoK;AACpO;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,sFAAsF,mBAAmB;AACzG;AACA;AACA;AACA;AACA,wBAAwB,QAAQ;AAChC;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC;AACtC;AACA;AACA;AACA;AACA,8GAA8G,yBAAyB;AACvI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,QAAQ;AAChC;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA,QAAQ,gDAAC,sBAAsB,qJAAqJ;AACpL,kCAAkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,6DAA6D,oCAAoC;AACjG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6DAA6D,6EAA6E;AAC1I;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,iCAAiC;AACnF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,gEAAgE,0CAA0C;AAC1G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oEAAoE,uCAAuC;AAC3G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kFAAkF,iBAAiB;AACnG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,QAAQ;AACpC;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C;AAC5C,6DAA6D,yEAAyE;AACtI;AACA,4EAA4E;AAC5E;AACA,CAAC;;AAED,cAAc,MAA6B;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,4DAA4D;AAC7D;AACA;AACA;AACA;AACA;AACA,qCAAqC,2DAAY;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,yDAAU;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,OAAO;AAC/C,wCAAwC,OAAO;AAC/C,uBAAuB,gDAAC;AACxB;AACA;AACA;AACA;AACA,wCAAwC,OAAO;AAC/C,wCAAwC,OAAO;AAC/C;AACA;AACA;AACA,mFAAmF,gDAAC;AACpF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6DAA6D,sDAAsD;AACnH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,wDAAS;AAC5B;AACA;AACA;AACA;AACA,yDAAyD,mBAAmB;AAC5E,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,eAAe,wDAAS;AACxB;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,wDAAS;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,8BAA8B;AAClF;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,uDAAuD,2DAA2D,qBAAqB,kCAAkC;AACzK;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,gDAAC,sBAAsB,6SAA6S;AACxV;AACA;AACA,oBAAoB,gDAAC,sBAAsB,8KAA8K;AACzN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,oDAAoD;AACnG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,0DAA0D,mBAAmB;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD;AAClD;AACA;AACA;AACA;AACA,0CAA0C;AAC1C;AACA;AACA;AACA;AACA,gBAAgB,gDAAC;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wFAAwF,6BAA6B;AACrH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uFAAuF,6BAA6B;AACpH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wEAAwE,qCAAqC;AAC7G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wEAAwE,wCAAwC;AAChH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wEAAwE,kCAAkC;AAC1G;AACA;AACA;AACA,wEAAwE,iCAAiC;AACzG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,gDAAC;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,OAAO;AAC3C,oCAAoC,OAAO;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,mBAAmB;AAC/C;AACA;AACA;AACA,2BAA2B,gDAAC;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,mBAAmB,MAAgC;AACnD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,oBAAoB,MAAiC;AACrD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,QAAQ,uGAAuG;AACzJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,gDAAC;AACb;AACA;AACA;AACA;AACA;AACA,wDAAwD,0CAA0C;AAClG;AACA;AACA,0CAA0C,gDAAC;AAC3C,0CAA0C,gDAAC;AAC3C;AACA;AACA;AACA,qDAAqD,gDAAC;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,gDAAC;AACT;AACA;AACA,QAAQ,gDAAC;AACT,QAAQ,gDAAC;AACT;AACA,YAAY,gDAAC;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,gDAAC;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,gDAAC;AACT,QAAQ,gDAAC;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,gDAAC;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yEAAyE,gDAAC;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mEAAmE;AACnE;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,YAAY,gDAAC,sBAAsB,oUAAoU;AACvW;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,4DAAa;AACrB;AACA;AACA,CAAC,CAAC,wDAAS;;AAEX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,yDAAyD;AACzD;AACA;AACA;AACA;AACA,yDAAyD,sCAAsC;AAC/F;AACA,8EAA8E,0CAA0C;AACxH;AACA;AACA;AACA,CAAC;;AAED,mBAAmB,MAAgC;AACnD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,oBAAoB,MAAiC;AACrD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,sDAAO;AACxB;AACA;AACA,iBAAiB,sDAAO;AACxB;AACA;AACA,iBAAiB,sDAAO;AACxB;AACA;AACA,iBAAiB,sDAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uFAAuF;AACvF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,wDAAS;AAC5B;AACA;AACA;AACA;AACA;AACA,qFAAqF,yBAAyB,IAAI,wDAAS;AAC3H;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,gDAAC;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0DAA0D,mEAAoB;AAC9E;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,qCAAqC;AACpF;AACA,wCAAwC,0CAA0C;AAClF,uCAAuC,6BAA6B;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,OAAO,gDAAC;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC;AACvC;AACA,uBAAuB,gDAAC;AACxB;AACA;AACA;AACA;AACA,sCAAsC,sCAAsC,gDAAC,UAAU,gDAAC;AACxF;AACA;AACA,sCAAsC,OAAO,gDAAC,UAAU,gDAAC;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,gDAAC;AACrB;AACA;AACA,+CAA+C,gDAAC;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,gDAAC,sBAAsB,2JAA2J;AAC9L;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,qDAAM;AACzD;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,QAAQ,gDAAC;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAiE,0DAAW;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kEAAkE;AAClE;AACA,4DAA4D;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA,iFAAiF,qCAAqC;AACtH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC;AACtC;AACA;AACA,kDAAkD;AAClD,kDAAkD;AAClD;AACA;AACA;AACA;AACA;AACA,kDAAkD;AAClD,kDAAkD;AAClD;AACA;AACA;AACA;AACA,kDAAkD;AAClD;AACA;AACA;AACA;AACA,sCAAsC;AACtC,kDAAkD;AAClD;AACA;AACA;AACA,kDAAkD;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,mDAAmD;AACpG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,mCAAmC;AACnF;AACA,yFAAyF,sCAAsC;AAC/H;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,0DAA0D;AACvG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,mCAAmC;AAC9E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uFAAuF,0DAA0D;AACjJ;AACA;AACA;AACA;AACA;AACA,yDAAyD,OAAO,gDAAC,gBAAgB,gDAAC,sBAAsB;AACxG;AACA,mGAAmG,yBAAyB;AAC5H;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,qBAAqB;AAC9D;AACA,SAAS;AACT;AACA;AACA,+BAA+B;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,gDAAC;AACT,QAAQ,gDAAC;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C;AAC3C,sBAAsB,sDAAO;AAC7B;AACA;AACA;AACA;AACA,2CAA2C;AAC3C,kDAAkD;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0DAA0D,4CAA4C;AACtG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0DAA0D,uCAAuC;AACjG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8DAA8D,wCAAwC;AACtG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,CAAC,CAAC,6DAAc;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,mBAAmB,MAAgC;AACnD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,oBAAoB,MAAiC;AACrD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wDAAwD,mCAAmC;AAC3F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gHAAgH,0CAA0C;AAC1J,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,CAAC,CAAC,wDAAS;;AAEX;AACA;;AAEA;AACA;AACA,gBAAgB,0DAAW;AAC3B;AACA;AACA,UAAU,+DAA+D;AACzE,UAAU,mFAAmF;AAC7F;AACA;AACA;AACA;AACA;;AAEA,mBAAmB,MAAgC;AACnD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,oBAAoB,MAAiC;AACrD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,uDAAI;AACZ;AACA;AACA,CAAC,CAAC,uDAAQ;;AAEV,mBAAmB,MAAgC;AACnD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,oBAAoB,MAAiC;AACrD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,0CAA0C;AAC/F;AACA;AACA,qDAAqD,4CAA4C;AACjG;AACA;AACA,qDAAqD,uEAAuE;AAC5H;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,QAAQ,wDAAS,+CAA+C,yBAAyB;AACzF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,4DAAa;AACrB;AACA;AACA,CAAC,CAAC,wDAAS;;AAEX,mBAAmB,MAAgC;AACnD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,oBAAoB,MAAiC;AACrD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mHAAmH;AACnH;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,CAAC,CAAC,wDAAS;;AAEX,mBAAmB,MAAgC;AACnD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,oBAAoB,MAAiC;AACrD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,qDAAM;AACzD;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,gDAAC;AACxB,4BAA4B,gDAAC;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAa;AACrB;AACA;AACA,CAAC;;AAED,mBAAmB,MAAgC;AACnD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,oBAAoB,MAAiC;AACrD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,qDAAM;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,gDAAC;AACvB;AACA;AACA;AACA;AACA,mDAAmD,4BAA4B;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAa;AACrB;AACA;AACA,CAAC;;AAED,mBAAmB,MAAgC;AACnD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,oBAAoB,MAAiC;AACrD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,qDAAM;AACzD;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,gDAAC;AACvB;AACA;AACA;AACA,uDAAuD,4BAA4B;AACnF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAa;AACrB;AACA;AACA,CAAC;;AAED,mBAAmB,MAAgC;AACnD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,oBAAoB,MAAiC;AACrD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,qDAAM;AACzD,mDAAmD,qDAAM;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,gDAAC;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAa;AACrB;AACA;AACA,CAAC;;AAED,mBAAmB,MAAgC;AACnD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,oBAAoB,MAAiC;AACrD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,qDAAM;AACzD,mDAAmD,qDAAM;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,gDAAC;AACb;AACA;AACA;AACA,6CAA6C,gDAAC;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,gDAAC,iFAAiF,wDAAwD;AAC/K,YAAY,gDAAC;AACb;AACA,iBAAiB,gDAAC;AAClB,iBAAiB,gDAAC;AAClB,oBAAoB,gDAAC;AACrB,oBAAoB,gDAAC,iFAAiF,8BAA8B;AACpI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,gDAAC;AAC5B;AACA;AACA;AACA;AACA,0CAA0C,gDAAC;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA,4BAA4B,gDAAC;AAC7B;AACA;AACA;AACA;AACA,4BAA4B,gDAAC;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,qBAAqB;AACrB;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,2DAAQ;AAChB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,4DAAa;AACrB;AACA;AACA,CAAC,CAAC,wDAAS;;AAEX;AACA;;AAEA;AACA;AACA,gBAAgB,0DAAW;AAC3B;AACA;AACA,UAAU,yDAAyD;AACnE,UAAU,6DAA6D;AACvE;AACA;AACA,UAAU,0EAA0E;AACpF,UAAU,gFAAgF;AAC1F,UAAU,0EAA0E;AACpF,UAAU,gFAAgF;AAC1F,UAAU;AACV;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,mBAAmB,MAAgC;AACnD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,oBAAoB,MAAiC;AACrD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yHAAyH;AACzH;AACA;AACA,mDAAmD,qDAAM;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gDAAC;AAChB;AACA;AACA,eAAe,gDAAC;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,gDAAC;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,eAAe;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,QAAQ,gDAAC;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,gDAAC;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,0BAA0B,sDAAO;AACjC;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C;AAC3C;AACA;AACA;AACA;AACA;AACA,kBAAkB,qDAAM;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAa;AACrB;AACA;AACA,QAAQ,yDAAU;AAClB;AACA;AACA,QAAQ,uDAAI;AACZ;AACA;AACA,CAAC,CAAC,uDAAQ;;AAEV;AACA;AACA,gBAAgB,0DAAW;AAC3B;AACA;AACA;AACA;AACA;AACA;;AAEA,0DAA0D,yBAAyB,wBAAwB,2BAA2B,GAAG,2BAA2B,yBAAyB,kCAAkC,yBAAyB,yEAAyE,yBAAyB,uBAAuB,0BAA0B,qBAAqB,2CAA2C,+BAA+B,GAAG,mCAAmC,qBAAqB,iBAAiB,GAAG,iCAAiC,wBAAwB,iBAAiB,GAAG,0CAA0C,+BAA+B,GAAG,2BAA2B,6BAA6B,uBAAuB,GAAG;;AAEpyB,gBAAgB,MAA+B;AAC/C;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,8BAA8B;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,oBAAoB;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,8DAA8D;AACnH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,8DAA8D;AAC/G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,OAAO;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,OAAO;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,OAAO;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wEAAwE,gBAAgB;AACxF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,QAAQ;AAChC;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,wBAAwB;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,8DAA8D;AAC/G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,qBAAqB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qEAAqE;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,+BAA+B;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,mBAAmB,MAAgC;AACnD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8EAA8E,+BAA+B;AAC7G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,OAAO;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,sBAAsB;AACrD,yBAAyB,YAAY;AACrC,aAAa;AACb;AACA;AACA;AACA,gCAAgC,iCAAiC,0BAA0B;AAC3F;AACA,oCAAoC,iCAAiC,sBAAsB;AAC3F;AACA;AACA;AACA;AACA,mCAAmC,sBAAsB;AACzD,6BAA6B,YAAY;AACzC,iBAAiB;AACjB;AACA;AACA,mCAAmC,sBAAsB;AACzD,6BAA6B,YAAY;AACzC,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,iCAAiC,2BAA2B,IAAI,iCAAiC,4BAA4B;AACrJ,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,OAAO;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,OAAO;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,mBAAmB,MAAgC;AACnD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8EAA8E,+BAA+B;AAC7G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,kBAAkB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,sBAAsB;AACrD,yBAAyB,YAAY;AACrC,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,OAAO;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,mBAAmB,MAAgC;AACnD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC,4CAA4C;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,0DAA0D;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B;AAC9B,wFAAwF;AACxF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,mBAAmB,MAAgC;AACnD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,OAAO;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,eAAe;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,iDAAiD;AAChF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,mBAAmB,MAAgC;AACnD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,OAAO;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,eAAe;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,iDAAiD;AAChF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,UAAU;AACrB,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,+BAA+B;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,mBAAmB,MAAgC;AACnD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,gBAAgB,MAA+B;AAC/C;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAiC;AACrD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC;AACzC;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,iCAAiC;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,8DAAW;AACnB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA,CAAC,CAAC,wDAAS;;AAEX,iBAAiB,MAAgC;AACjD;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD,kBAAkB,MAAiC;AACnD;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,4DAAa;AACrB;AACA;AACA,QAAQ,yDAAU;AAClB;AACA;AACA,QAAQ,uDAAI;AACZ;AACA;AACA,CAAC,CAAC,uDAAQ;;AAEV;AACA;;AAEA;AACA;AACA,gBAAgB,0DAAW;AAC3B;AACA,uBAAuB,iFAAiF;AACxG;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,kEAAmB;;AAEtC,6DAAc;;AAEipB","sources":["webpack://@agentx/agentx/../../node_modules/ag-grid-enterprise/dist/ag-grid-enterprise.auto.esm.js"],"sourcesContent":["/**\n * @ag-grid-enterprise/all-modules - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v30.0.6\n * @link https://www.ag-grid.com/\n * @license Commercial\n */\nimport { PreConstruct, Bean, BeanStub, Autowired, RefSelector, PostConstruct, Component, ModuleNames, _, Events, ChangedPath, Optional, CsvExportModule, KeyCode, EventService, Column, ProvidedColumnGroup, AgMenuList, AgMenuItemComponent, AgCheckbox, CssClassApplier, DragSourceType, DragAndDropService, TouchListener, AutoScrollService, VirtualList, PreDestroy, NumberSequence, RowNode, ManagedFocusFeature, PositionableFeature, AgSelect, AgPromise, TabGuardComp, AgInputTextField, ModuleRegistry, ExcelFactoryMode, XmlFactory, RowType, BaseGridSerializingSession, Downloader, BaseCreator, ZipContainer, GridSerializer, CsvCreator, AgGroupComponent, AgAbstractField, AgRadioButton, AgToggleButton, AgAbstractLabel, AgSlider, DEFAULT_CHART_GROUPS, TabbedLayout, CHART_TOOLBAR_ALLOW_LIST, CHART_TOOL_PANEL_ALLOW_LIST, CHART_TOOL_PANEL_MENU_OPTIONS, AgPanel, CellRangeType, AgDialog, CellCtrl, SelectionHandleType, AgPickerField, Grid, ProvidedFilter, PopupComponent, RowNodeBlock, ServerSideTransactionResultStatus, RowNodeBlockLoader, GROUP_AUTO_COLUMN_ID, TextFilter, AllCommunityModules } from 'ag-grid-community';\nexport * from 'ag-grid-community';\n\nvar MD5 = /** @class */ (function () {\n function MD5() {\n this.ieCompatibility = false;\n }\n MD5.prototype.init = function () {\n this.ieCompatibility = (this.md5('hello') != '5d41402abc4b2a76b9719d911017c592');\n };\n MD5.prototype.md5cycle = function (x, k) {\n var a = x[0], b = x[1], c = x[2], d = x[3];\n a = this.ff(a, b, c, d, k[0], 7, -680876936);\n d = this.ff(d, a, b, c, k[1], 12, -389564586);\n c = this.ff(c, d, a, b, k[2], 17, 606105819);\n b = this.ff(b, c, d, a, k[3], 22, -1044525330);\n a = this.ff(a, b, c, d, k[4], 7, -176418897);\n d = this.ff(d, a, b, c, k[5], 12, 1200080426);\n c = this.ff(c, d, a, b, k[6], 17, -1473231341);\n b = this.ff(b, c, d, a, k[7], 22, -45705983);\n a = this.ff(a, b, c, d, k[8], 7, 1770035416);\n d = this.ff(d, a, b, c, k[9], 12, -1958414417);\n c = this.ff(c, d, a, b, k[10], 17, -42063);\n b = this.ff(b, c, d, a, k[11], 22, -1990404162);\n a = this.ff(a, b, c, d, k[12], 7, 1804603682);\n d = this.ff(d, a, b, c, k[13], 12, -40341101);\n c = this.ff(c, d, a, b, k[14], 17, -1502002290);\n b = this.ff(b, c, d, a, k[15], 22, 1236535329);\n a = this.gg(a, b, c, d, k[1], 5, -165796510);\n d = this.gg(d, a, b, c, k[6], 9, -1069501632);\n c = this.gg(c, d, a, b, k[11], 14, 643717713);\n b = this.gg(b, c, d, a, k[0], 20, -373897302);\n a = this.gg(a, b, c, d, k[5], 5, -701558691);\n d = this.gg(d, a, b, c, k[10], 9, 38016083);\n c = this.gg(c, d, a, b, k[15], 14, -660478335);\n b = this.gg(b, c, d, a, k[4], 20, -405537848);\n a = this.gg(a, b, c, d, k[9], 5, 568446438);\n d = this.gg(d, a, b, c, k[14], 9, -1019803690);\n c = this.gg(c, d, a, b, k[3], 14, -187363961);\n b = this.gg(b, c, d, a, k[8], 20, 1163531501);\n a = this.gg(a, b, c, d, k[13], 5, -1444681467);\n d = this.gg(d, a, b, c, k[2], 9, -51403784);\n c = this.gg(c, d, a, b, k[7], 14, 1735328473);\n b = this.gg(b, c, d, a, k[12], 20, -1926607734);\n a = this.hh(a, b, c, d, k[5], 4, -378558);\n d = this.hh(d, a, b, c, k[8], 11, -2022574463);\n c = this.hh(c, d, a, b, k[11], 16, 1839030562);\n b = this.hh(b, c, d, a, k[14], 23, -35309556);\n a = this.hh(a, b, c, d, k[1], 4, -1530992060);\n d = this.hh(d, a, b, c, k[4], 11, 1272893353);\n c = this.hh(c, d, a, b, k[7], 16, -155497632);\n b = this.hh(b, c, d, a, k[10], 23, -1094730640);\n a = this.hh(a, b, c, d, k[13], 4, 681279174);\n d = this.hh(d, a, b, c, k[0], 11, -358537222);\n c = this.hh(c, d, a, b, k[3], 16, -722521979);\n b = this.hh(b, c, d, a, k[6], 23, 76029189);\n a = this.hh(a, b, c, d, k[9], 4, -640364487);\n d = this.hh(d, a, b, c, k[12], 11, -421815835);\n c = this.hh(c, d, a, b, k[15], 16, 530742520);\n b = this.hh(b, c, d, a, k[2], 23, -995338651);\n a = this.ii(a, b, c, d, k[0], 6, -198630844);\n d = this.ii(d, a, b, c, k[7], 10, 1126891415);\n c = this.ii(c, d, a, b, k[14], 15, -1416354905);\n b = this.ii(b, c, d, a, k[5], 21, -57434055);\n a = this.ii(a, b, c, d, k[12], 6, 1700485571);\n d = this.ii(d, a, b, c, k[3], 10, -1894986606);\n c = this.ii(c, d, a, b, k[10], 15, -1051523);\n b = this.ii(b, c, d, a, k[1], 21, -2054922799);\n a = this.ii(a, b, c, d, k[8], 6, 1873313359);\n d = this.ii(d, a, b, c, k[15], 10, -30611744);\n c = this.ii(c, d, a, b, k[6], 15, -1560198380);\n b = this.ii(b, c, d, a, k[13], 21, 1309151649);\n a = this.ii(a, b, c, d, k[4], 6, -145523070);\n d = this.ii(d, a, b, c, k[11], 10, -1120210379);\n c = this.ii(c, d, a, b, k[2], 15, 718787259);\n b = this.ii(b, c, d, a, k[9], 21, -343485551);\n x[0] = this.add32(a, x[0]);\n x[1] = this.add32(b, x[1]);\n x[2] = this.add32(c, x[2]);\n x[3] = this.add32(d, x[3]);\n };\n MD5.prototype.cmn = function (q, a, b, x, s, t) {\n a = this.add32(this.add32(a, q), this.add32(x, t));\n return this.add32((a << s) | (a >>> (32 - s)), b);\n };\n MD5.prototype.ff = function (a, b, c, d, x, s, t) {\n return this.cmn((b & c) | ((~b) & d), a, b, x, s, t);\n };\n MD5.prototype.gg = function (a, b, c, d, x, s, t) {\n return this.cmn((b & d) | (c & (~d)), a, b, x, s, t);\n };\n MD5.prototype.hh = function (a, b, c, d, x, s, t) {\n return this.cmn(b ^ c ^ d, a, b, x, s, t);\n };\n MD5.prototype.ii = function (a, b, c, d, x, s, t) {\n return this.cmn(c ^ (b | (~d)), a, b, x, s, t);\n };\n MD5.prototype.md51 = function (s) {\n var n = s.length;\n var state = [1732584193, -271733879, -1732584194, 271733878];\n var i;\n for (i = 64; i <= s.length; i += 64) {\n this.md5cycle(state, this.md5blk(s.substring(i - 64, i)));\n }\n s = s.substring(i - 64);\n var tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];\n for (i = 0; i < s.length; i++) {\n tail[i >> 2] |= s.charCodeAt(i) << ((i % 4) << 3);\n }\n tail[i >> 2] |= 0x80 << ((i % 4) << 3);\n if (i > 55) {\n this.md5cycle(state, tail);\n for (i = 0; i < 16; i++) {\n tail[i] = 0;\n }\n }\n tail[14] = n * 8;\n this.md5cycle(state, tail);\n return state;\n };\n /* there needs to be support for Unicode here, * unless we pretend that we can redefine the MD-5\n * algorithm for multi-byte characters (perhaps by adding every four 16-bit characters and\n * shortening the sum to 32 bits). Otherwise I suthis.ggest performing MD-5 as if every character\n * was two bytes--e.g., 0040 0025 = @%--but then how will an ordinary MD-5 sum be matched?\n * There is no way to standardize text to something like UTF-8 before transformation; speed cost is\n * utterly prohibitive. The JavaScript standard itself needs to look at this: it should start\n * providing access to strings as preformed UTF-8 8-bit unsigned value arrays.\n */\n MD5.prototype.md5blk = function (s) {\n var md5blks = [];\n /* Andy King said do it this way. */\n for (var i = 0; i < 64; i += 4) {\n md5blks[i >> 2] = s.charCodeAt(i)\n + (s.charCodeAt(i + 1) << 8)\n + (s.charCodeAt(i + 2) << 16)\n + (s.charCodeAt(i + 3) << 24);\n }\n return md5blks;\n };\n MD5.prototype.rhex = function (n) {\n var hex_chr = '0123456789abcdef'.split('');\n var s = '', j = 0;\n for (; j < 4; j++) {\n s += hex_chr[(n >> (j * 8 + 4)) & 0x0F]\n + hex_chr[(n >> (j * 8)) & 0x0F];\n }\n return s;\n };\n MD5.prototype.hex = function (x) {\n for (var i = 0; i < x.length; i++) {\n x[i] = this.rhex(x[i]);\n }\n return x.join('');\n };\n MD5.prototype.md5 = function (s) {\n return this.hex(this.md51(s));\n };\n MD5.prototype.add32 = function (a, b) {\n return this.ieCompatibility ? this.add32Compat(a, b) : this.add32Std(a, b);\n };\n /* this function is much faster, so if possible we use it. Some IEs are the only ones I know of that\n need the idiotic second function, generated by an if clause. */\n MD5.prototype.add32Std = function (a, b) {\n return (a + b) & 0xFFFFFFFF;\n };\n MD5.prototype.add32Compat = function (x, y) {\n var lsw = (x & 0xFFFF) + (y & 0xFFFF), msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return (msw << 16) | (lsw & 0xFFFF);\n };\n return MD5;\n}());\n\nvar __read$1n = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\n// move to general utils\nfunction missingOrEmpty(value) {\n return value == null || value.length === 0;\n}\nfunction exists(value, allowEmptyString) {\n if (allowEmptyString === void 0) { allowEmptyString = false; }\n return value != null && (value !== '' || allowEmptyString);\n}\nvar LicenseManager = /** @class */ (function () {\n function LicenseManager(document) {\n this.watermarkMessage = undefined;\n this.document = document;\n this.md5 = new MD5();\n this.md5.init();\n }\n LicenseManager.prototype.validateLicense = function () {\n if (missingOrEmpty(LicenseManager.licenseKey)) {\n if (!this.isWebsiteUrl() || this.isForceWatermark()) {\n this.outputMissingLicenseKey();\n }\n }\n else if (LicenseManager.licenseKey.length > 32) {\n if (LicenseManager.licenseKey.indexOf(\"For_Trialing_ag-Grid_Only\") !== -1) {\n this.outputInvalidLicenseKey();\n }\n else {\n var _a = LicenseManager.extractLicenseComponents(LicenseManager.licenseKey), md5 = _a.md5, license = _a.license, version = _a.version, isTrial = _a.isTrial;\n if (md5 === this.md5.md5(license)) {\n if (exists(version) && version) {\n this.validateLicenseKeyForVersion(version, !!isTrial, license);\n }\n else {\n this.validateLegacyKey(license);\n }\n }\n else {\n this.outputInvalidLicenseKey();\n }\n }\n }\n else {\n this.outputInvalidLicenseKey();\n }\n };\n LicenseManager.extractExpiry = function (license) {\n var restrictionHashed = license.substring(license.lastIndexOf('_') + 1, license.length);\n return new Date(parseInt(LicenseManager.decode(restrictionHashed), 10));\n };\n LicenseManager.extractLicenseComponents = function (licenseKey) {\n // when users copy the license key from a PDF extra zero width characters are sometimes copied too\n // carriage returns and line feeds are problematic too\n // all of which causes license key validation to fail - strip these out\n var cleanedLicenseKey = licenseKey.replace(/[\\u200B-\\u200D\\uFEFF]/g, '');\n cleanedLicenseKey = cleanedLicenseKey.replace(/\\r?\\n|\\r/g, '');\n var hashStart = cleanedLicenseKey.length - 32;\n var md5 = cleanedLicenseKey.substring(hashStart);\n var license = cleanedLicenseKey.substring(0, hashStart);\n var _a = __read$1n(LicenseManager.extractBracketedInformation(cleanedLicenseKey), 2), version = _a[0], isTrial = _a[1];\n return { md5: md5, license: license, version: version, isTrial: isTrial };\n };\n LicenseManager.prototype.getLicenseDetails = function (licenseKey) {\n var _a = LicenseManager.extractLicenseComponents(licenseKey), md5 = _a.md5, license = _a.license, version = _a.version, isTrial = _a.isTrial;\n var valid = (md5 === this.md5.md5(license)) && licenseKey.indexOf(\"For_Trialing_ag-Grid_Only\") === -1;\n var trialExpired = null;\n var expiry = null;\n if (valid) {\n expiry = LicenseManager.extractExpiry(license);\n valid = !isNaN(expiry.getTime());\n if (isTrial) {\n var now = new Date();\n trialExpired = (expiry < now);\n }\n }\n return {\n licenseKey: licenseKey,\n valid: valid,\n expiry: valid ? LicenseManager.formatDate(expiry) : null,\n version: version ? version : 'legacy',\n isTrial: isTrial,\n trialExpired: trialExpired\n };\n };\n LicenseManager.prototype.isDisplayWatermark = function () {\n return this.isForceWatermark() || (!this.isLocalhost() && !this.isWebsiteUrl() && !missingOrEmpty(this.watermarkMessage));\n };\n LicenseManager.prototype.getWatermarkMessage = function () {\n return this.watermarkMessage || '';\n };\n LicenseManager.prototype.getHostname = function () {\n var win = (this.document.defaultView || window);\n var loc = win.location;\n var _a = loc.hostname, hostname = _a === void 0 ? '' : _a;\n return hostname;\n };\n LicenseManager.prototype.isForceWatermark = function () {\n var win = (this.document.defaultView || window);\n var loc = win.location;\n var pathname = loc.pathname;\n return pathname ? pathname.indexOf('forceWatermark') !== -1 : false;\n };\n LicenseManager.prototype.isWebsiteUrl = function () {\n var hostname = this.getHostname();\n return hostname.match(/^((?:\\w+\\.)?ag-grid\\.com)$/) !== null;\n };\n LicenseManager.prototype.isLocalhost = function () {\n var hostname = this.getHostname();\n return hostname.match(/^(?:127\\.0\\.0\\.1|localhost)$/) !== null;\n };\n LicenseManager.formatDate = function (date) {\n var monthNames = [\n 'January', 'February', 'March',\n 'April', 'May', 'June', 'July',\n 'August', 'September', 'October',\n 'November', 'December'\n ];\n var day = date.getDate();\n var monthIndex = date.getMonth();\n var year = date.getFullYear();\n return day + ' ' + monthNames[monthIndex] + ' ' + year;\n };\n LicenseManager.getGridReleaseDate = function () {\n return new Date(parseInt(LicenseManager.decode(LicenseManager.RELEASE_INFORMATION), 10));\n };\n LicenseManager.decode = function (input) {\n var keystr = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n var t = '';\n var n, r, i;\n var s, o, u, a;\n var f = 0;\n var e = input.replace(/[^A-Za-z0-9+/=]/g, '');\n while (f < e.length) {\n s = keystr.indexOf(e.charAt(f++));\n o = keystr.indexOf(e.charAt(f++));\n u = keystr.indexOf(e.charAt(f++));\n a = keystr.indexOf(e.charAt(f++));\n n = s << 2 | o >> 4;\n r = (o & 15) << 4 | u >> 2;\n i = (u & 3) << 6 | a;\n t = t + String.fromCharCode(n);\n if (u != 64) {\n t = t + String.fromCharCode(r);\n }\n if (a != 64) {\n t = t + String.fromCharCode(i);\n }\n }\n t = LicenseManager.utf8_decode(t);\n return t;\n };\n LicenseManager.utf8_decode = function (input) {\n input = input.replace(/rn/g, 'n');\n var t = '';\n for (var n = 0; n < input.length; n++) {\n var r = input.charCodeAt(n);\n if (r < 128) {\n t += String.fromCharCode(r);\n }\n else if (r > 127 && r < 2048) {\n t += String.fromCharCode(r >> 6 | 192);\n t += String.fromCharCode(r & 63 | 128);\n }\n else {\n t += String.fromCharCode(r >> 12 | 224);\n t += String.fromCharCode(r >> 6 & 63 | 128);\n t += String.fromCharCode(r & 63 | 128);\n }\n }\n return t;\n };\n LicenseManager.setLicenseKey = function (licenseKey) {\n this.licenseKey = licenseKey;\n };\n LicenseManager.extractBracketedInformation = function (licenseKey) {\n var matches = licenseKey.split('[')\n .filter(function (v) {\n return v.indexOf(']') > -1;\n })\n .map(function (value) {\n return value.split(']')[0];\n });\n if (!matches || matches.length === 0) {\n return [null, null];\n }\n var isTrial = matches.filter(function (match) { return match === 'TRIAL'; }).length === 1;\n var version = matches.filter(function (match) { return match.indexOf(\"v\") === 0; }).map(function (match) { return match.replace(/^v/, \"\"); })[0];\n return [version, isTrial];\n };\n LicenseManager.prototype.validateLicenseKeyForVersion = function (version, isTrial, license) {\n if (version !== '2') {\n return;\n }\n if (isTrial) {\n this.validateForTrial(license);\n }\n else {\n this.validateLegacyKey(license);\n }\n };\n LicenseManager.prototype.validateLegacyKey = function (license) {\n var gridReleaseDate = LicenseManager.getGridReleaseDate();\n var expiry = LicenseManager.extractExpiry(license);\n var valid = false;\n var current = false;\n if (!isNaN(expiry.getTime())) {\n valid = true;\n current = (gridReleaseDate < expiry);\n }\n if (!valid) {\n this.outputInvalidLicenseKey();\n }\n else if (!current) {\n var formattedExpiryDate = LicenseManager.formatDate(expiry);\n var formattedReleaseDate = LicenseManager.formatDate(gridReleaseDate);\n this.outputIncompatibleVersion(formattedExpiryDate, formattedReleaseDate);\n }\n };\n LicenseManager.prototype.validateForTrial = function (license) {\n var expiry = LicenseManager.extractExpiry(license);\n var now = new Date();\n var valid = false;\n var current = false;\n if (!isNaN(expiry.getTime())) {\n valid = true;\n current = (expiry > now);\n }\n if (!valid) {\n this.outputInvalidLicenseKey();\n }\n else if (!current) {\n var formattedExpiryDate = LicenseManager.formatDate(expiry);\n this.outputExpiredTrialKey(formattedExpiryDate);\n }\n };\n LicenseManager.prototype.outputInvalidLicenseKey = function () {\n console.error('*****************************************************************************************************************');\n console.error('***************************************** AG Grid Enterprise License ********************************************');\n console.error('********************************************* Invalid License ***************************************************');\n console.error('* Your license for AG Grid Enterprise is not valid - please contact info@ag-grid.com to obtain a valid license. *');\n console.error('*****************************************************************************************************************');\n console.error('*****************************************************************************************************************');\n this.watermarkMessage = \"Invalid License\";\n };\n LicenseManager.prototype.outputExpiredTrialKey = function (formattedExpiryDate) {\n console.error('****************************************************************************************************************');\n console.error('***************************************** AG Grid Enterprise License *******************************************');\n console.error('***************************************** Trial Period Expired. *******************************************');\n console.error(\"* Your license for AG Grid Enterprise expired on \" + formattedExpiryDate + \". *\");\n console.error('* Please email info@ag-grid.com to purchase a license. *');\n console.error('****************************************************************************************************************');\n console.error('****************************************************************************************************************');\n this.watermarkMessage = \"Trial Period Expired\";\n };\n LicenseManager.prototype.outputMissingLicenseKey = function () {\n console.error('****************************************************************************************************************');\n console.error('***************************************** AG Grid Enterprise License *******************************************');\n console.error('****************************************** License Key Not Found ***********************************************');\n console.error('* All AG Grid Enterprise features are unlocked. *');\n console.error('* This is an evaluation only version, it is not licensed for development projects intended for production. *');\n console.error('* If you want to hide the watermark, please email info@ag-grid.com for a trial license. *');\n console.error('****************************************************************************************************************');\n console.error('****************************************************************************************************************');\n this.watermarkMessage = \"For Trial Use Only\";\n };\n LicenseManager.prototype.outputIncompatibleVersion = function (formattedExpiryDate, formattedReleaseDate) {\n console.error('****************************************************************************************************************************');\n console.error('****************************************************************************************************************************');\n console.error('* AG Grid Enterprise License *');\n console.error('* License not compatible with installed version of AG Grid Enterprise. *');\n console.error('* *');\n console.error(\"* Your AG Grid License entitles you to all versions of AG Grid that we release within the time covered by your license *\");\n console.error(\"* - typically we provide one year licenses which entitles you to all releases / updates of AG Grid within that year. *\");\n console.error(\"* Your license has an end (expiry) date which stops the license key working with versions of AG Grid released after the *\");\n console.error(\"* license end date. The license key that you have expires on \" + formattedExpiryDate + \", however the version of AG Grid you *\");\n console.error(\"* are trying to use was released on \" + formattedReleaseDate + \". *\");\n console.error('* *');\n console.error('* Please contact info@ag-grid.com to renew your subscription to new versions and get a new license key to work with this *');\n console.error('* version of AG Grid. *');\n console.error('****************************************************************************************************************************');\n console.error('****************************************************************************************************************************');\n this.watermarkMessage = \"License Expired\";\n };\n LicenseManager.RELEASE_INFORMATION = 'MTY5MDI5NDc3MDg0Mg==';\n return LicenseManager;\n}());\n\nvar __extends$3r = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$2C = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar GridLicenseManager = /** @class */ (function (_super) {\n __extends$3r(GridLicenseManager, _super);\n function GridLicenseManager() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n GridLicenseManager.prototype.validateLicense = function () {\n this.licenseManager = new LicenseManager(this.gridOptionsService.getDocument());\n this.licenseManager.validateLicense();\n };\n GridLicenseManager.getLicenseDetails = function (licenseKey) {\n return new LicenseManager(null).getLicenseDetails(licenseKey);\n };\n GridLicenseManager.prototype.isDisplayWatermark = function () {\n return this.licenseManager.isDisplayWatermark();\n };\n GridLicenseManager.prototype.getWatermarkMessage = function () {\n return this.licenseManager.getWatermarkMessage();\n };\n GridLicenseManager.setLicenseKey = function (licenseKey) {\n LicenseManager.setLicenseKey(licenseKey);\n };\n __decorate$2C([\n PreConstruct\n ], GridLicenseManager.prototype, \"validateLicense\", null);\n GridLicenseManager = __decorate$2C([\n Bean('licenseManager')\n ], GridLicenseManager);\n return GridLicenseManager;\n}(BeanStub));\n\nvar __extends$3q = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$2B = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar WatermarkComp = /** @class */ (function (_super) {\n __extends$3q(WatermarkComp, _super);\n function WatermarkComp() {\n return _super.call(this, /* html*/ \"
\\n
\\n
\") || this;\n }\n WatermarkComp.prototype.postConstruct = function () {\n var _this = this;\n var show = this.shouldDisplayWatermark();\n this.setDisplayed(show);\n if (show) {\n this.eLicenseTextRef.innerText = this.licenseManager.getWatermarkMessage();\n window.setTimeout(function () { return _this.addCssClass('ag-opacity-zero'); }, 0);\n window.setTimeout(function () { return _this.setDisplayed(false); }, 5000);\n }\n };\n WatermarkComp.prototype.shouldDisplayWatermark = function () {\n return this.licenseManager.isDisplayWatermark();\n };\n __decorate$2B([\n Autowired('licenseManager')\n ], WatermarkComp.prototype, \"licenseManager\", void 0);\n __decorate$2B([\n RefSelector('eLicenseTextRef')\n ], WatermarkComp.prototype, \"eLicenseTextRef\", void 0);\n __decorate$2B([\n PostConstruct\n ], WatermarkComp.prototype, \"postConstruct\", null);\n return WatermarkComp;\n}(Component));\n\n// DO NOT UPDATE MANUALLY: Generated from script during build time\nvar VERSION$i = '30.0.6';\n\nvar EnterpriseCoreModule = {\n version: VERSION$i,\n moduleName: ModuleNames.EnterpriseCoreModule,\n beans: [GridLicenseManager],\n agStackComponents: [\n { componentName: 'AgWatermark', componentClass: WatermarkComp }\n ]\n};\n\nvar __extends$3p = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$2A = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __read$1m = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray$Q = (undefined && undefined.__spreadArray) || function (to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\n to[j] = from[i];\n return to;\n};\nvar __values$Q = (undefined && undefined.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\n// Matches value in changeDetectionService\nvar SOURCE_PASTE = 'paste';\nvar EXPORT_TYPE_DRAG_COPY = 'dragCopy';\nvar EXPORT_TYPE_CLIPBOARD = 'clipboard';\nvar CellClearType;\n(function (CellClearType) {\n CellClearType[CellClearType[\"CellRange\"] = 0] = \"CellRange\";\n CellClearType[CellClearType[\"SelectedRows\"] = 1] = \"SelectedRows\";\n CellClearType[CellClearType[\"FocusedCell\"] = 2] = \"FocusedCell\";\n})(CellClearType || (CellClearType = {}));\nvar ClipboardService = /** @class */ (function (_super) {\n __extends$3p(ClipboardService, _super);\n function ClipboardService() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.lastPasteOperationTime = 0;\n _this.navigatorApiFailed = false;\n return _this;\n }\n ClipboardService_1 = ClipboardService;\n ClipboardService.prototype.init = function () {\n var _this = this;\n this.logger = this.loggerFactory.create('ClipboardService');\n if (this.rowModel.getType() === 'clientSide') {\n this.clientSideRowModel = this.rowModel;\n }\n this.ctrlsService.whenReady(function (p) {\n _this.gridCtrl = p.gridCtrl;\n });\n };\n ClipboardService.prototype.pasteFromClipboard = function () {\n var _this = this;\n this.logger.log('pasteFromClipboard');\n // Method 1 - native clipboard API, available in modern chrome browsers\n var allowNavigator = !this.gridOptionsService.is('suppressClipboardApi');\n // Some browsers (Firefox) do not allow Web Applications to read from\n // the clipboard so verify if not only the ClipboardAPI is available,\n // but also if the `readText` method is public.\n if (allowNavigator && !this.navigatorApiFailed && navigator.clipboard && navigator.clipboard.readText) {\n navigator.clipboard.readText()\n .then(this.processClipboardData.bind(this))\n .catch(function (e) {\n _.doOnce(function () {\n console.warn(e);\n console.warn('AG Grid: Unable to use the Clipboard API (navigator.clipboard.readText()). ' +\n 'The reason why it could not be used has been logged in the previous line. ' +\n 'For this reason the grid has defaulted to using a workaround which doesn\\'t perform as well. ' +\n 'Either fix why Clipboard API is blocked, OR stop this message from appearing by setting grid ' +\n 'property suppressClipboardApi=true (which will default the grid to using the workaround rather than the API');\n }, 'clipboardApiError');\n _this.navigatorApiFailed = true;\n _this.pasteFromClipboardLegacy();\n });\n }\n else {\n this.pasteFromClipboardLegacy();\n }\n };\n ClipboardService.prototype.pasteFromClipboardLegacy = function () {\n var _this = this;\n // Method 2 - if modern API fails, the old school hack\n var defaultPrevented = false;\n var handlePasteEvent = function (e) {\n var currentPastOperationTime = (new Date()).getTime();\n if (currentPastOperationTime - _this.lastPasteOperationTime < 50) {\n defaultPrevented = true;\n e.preventDefault();\n }\n _this.lastPasteOperationTime = currentPastOperationTime;\n };\n this.executeOnTempElement(function (textArea) {\n textArea.addEventListener('paste', handlePasteEvent);\n textArea.focus({ preventScroll: true });\n }, function (element) {\n var data = element.value;\n if (!defaultPrevented) {\n _this.processClipboardData(data);\n }\n else {\n _this.refocusLastFocusedCell();\n }\n element.removeEventListener('paste', handlePasteEvent);\n });\n };\n ClipboardService.prototype.refocusLastFocusedCell = function () {\n var focusedCell = this.focusService.getFocusedCell();\n if (focusedCell) {\n this.focusService.setFocusedCell({\n rowIndex: focusedCell.rowIndex,\n column: focusedCell.column,\n rowPinned: focusedCell.rowPinned,\n forceBrowserFocus: true\n });\n }\n };\n ClipboardService.prototype.getClipboardDelimiter = function () {\n var delimiter = this.gridOptionsService.get('clipboardDelimiter');\n return _.exists(delimiter) ? delimiter : '\\t';\n };\n ClipboardService.prototype.processClipboardData = function (data) {\n var _this = this;\n if (data == null) {\n return;\n }\n var parsedData = ClipboardService_1.stringToArray(data, this.getClipboardDelimiter());\n var userFunc = this.gridOptionsService.getCallback('processDataFromClipboard');\n if (userFunc) {\n parsedData = userFunc({ data: parsedData });\n }\n if (parsedData == null) {\n return;\n }\n if (this.gridOptionsService.is('suppressLastEmptyLineOnPaste')) {\n this.removeLastLineIfBlank(parsedData);\n }\n var pasteOperation = function (cellsToFlash, updatedRowNodes, focusedCell, changedPath) {\n var rangeActive = _this.rangeService && _this.rangeService.isMoreThanOneCell();\n var pasteIntoRange = rangeActive && !_this.hasOnlyOneValueToPaste(parsedData);\n if (pasteIntoRange) {\n _this.pasteIntoActiveRange(parsedData, cellsToFlash, updatedRowNodes, changedPath);\n }\n else {\n _this.pasteStartingFromFocusedCell(parsedData, cellsToFlash, updatedRowNodes, focusedCell, changedPath);\n }\n };\n this.doPasteOperation(pasteOperation);\n };\n // This will parse a delimited string into an array of arrays.\n ClipboardService.stringToArray = function (strData, delimiter) {\n if (delimiter === void 0) { delimiter = ','; }\n var data = [];\n var isNewline = function (char) { return char === '\\r' || char === '\\n'; };\n var insideQuotedField = false;\n if (strData === '') {\n return [['']];\n }\n var _loop_1 = function (row, column, position) {\n var previousChar = strData[position - 1];\n var currentChar = strData[position];\n var nextChar = strData[position + 1];\n var ensureDataExists = function () {\n if (!data[row]) {\n // create row if it doesn't exist\n data[row] = [];\n }\n if (!data[row][column]) {\n // create column if it doesn't exist\n data[row][column] = '';\n }\n };\n ensureDataExists();\n if (currentChar === '\"') {\n if (insideQuotedField) {\n if (nextChar === '\"') {\n // unescape double quote\n data[row][column] += '\"';\n position++;\n }\n else {\n // exit quoted field\n insideQuotedField = false;\n }\n // continue;\n }\n else if (previousChar === undefined || previousChar === delimiter || isNewline(previousChar)) {\n // enter quoted field\n insideQuotedField = true;\n // continue;\n }\n }\n if (!insideQuotedField && currentChar !== '\"') {\n if (currentChar === delimiter) {\n // move to next column\n column++;\n ensureDataExists();\n return out_row_1 = row, out_column_1 = column, out_position_1 = position, \"continue\";\n }\n else if (isNewline(currentChar)) {\n // move to next row\n column = 0;\n row++;\n ensureDataExists();\n if (currentChar === '\\r' && nextChar === '\\n') {\n // skip over second newline character if it exists\n position++;\n }\n return out_row_1 = row, out_column_1 = column, out_position_1 = position, \"continue\";\n }\n }\n // add current character to current column\n data[row][column] += currentChar;\n out_row_1 = row;\n out_column_1 = column;\n out_position_1 = position;\n };\n var out_row_1, out_column_1, out_position_1;\n // iterate over each character, keep track of current row and column (of the returned array)\n for (var row = 0, column = 0, position = 0; position < strData.length; position++) {\n _loop_1(row, column, position);\n row = out_row_1;\n column = out_column_1;\n position = out_position_1;\n }\n return data;\n };\n // common code to paste operations, e.g. paste to cell, paste to range, and copy range down\n ClipboardService.prototype.doPasteOperation = function (pasteOperationFunc) {\n var api = this.gridOptionsService.api;\n var columnApi = this.gridOptionsService.columnApi;\n var source = 'clipboard';\n this.eventService.dispatchEvent({\n type: Events.EVENT_PASTE_START,\n api: api,\n columnApi: columnApi,\n source: source\n });\n var changedPath;\n if (this.clientSideRowModel) {\n var onlyChangedColumns = this.gridOptionsService.is('aggregateOnlyChangedColumns');\n changedPath = new ChangedPath(onlyChangedColumns, this.clientSideRowModel.getRootNode());\n }\n var cellsToFlash = {};\n var updatedRowNodes = [];\n var focusedCell = this.focusService.getFocusedCell();\n pasteOperationFunc(cellsToFlash, updatedRowNodes, focusedCell, changedPath);\n var nodesToRefresh = __spreadArray$Q([], __read$1m(updatedRowNodes));\n if (changedPath) {\n this.clientSideRowModel.doAggregate(changedPath);\n // add all nodes impacted by aggregation, as they need refreshed also.\n changedPath.forEachChangedNodeDepthFirst(function (rowNode) {\n nodesToRefresh.push(rowNode);\n });\n }\n // clipboardService has to do changeDetection itself, to prevent repeat logic in favour of batching.\n // changeDetectionService is disabled for this action.\n this.rowRenderer.refreshCells({ rowNodes: nodesToRefresh });\n this.dispatchFlashCells(cellsToFlash);\n this.fireRowChanged(updatedRowNodes);\n // if using the clipboard hack with a temp element, then the focus has been lost,\n // so need to put it back. otherwise paste operation loosed focus on cell and keyboard\n // navigation stops.\n this.refocusLastFocusedCell();\n var event = {\n type: Events.EVENT_PASTE_END,\n source: source\n };\n this.eventService.dispatchEvent(event);\n };\n ClipboardService.prototype.pasteIntoActiveRange = function (clipboardData, cellsToFlash, updatedRowNodes, changedPath) {\n var _this = this;\n // true if clipboard data can be evenly pasted into range, otherwise false\n var abortRepeatingPasteIntoRows = this.getRangeSize() % clipboardData.length != 0;\n var indexOffset = 0;\n var dataRowIndex = 0;\n var rowCallback = function (currentRow, rowNode, columns, index) {\n var atEndOfClipboardData = index - indexOffset >= clipboardData.length;\n if (atEndOfClipboardData) {\n if (abortRepeatingPasteIntoRows) {\n return;\n }\n // increment offset and reset data index to repeat paste of data\n indexOffset += dataRowIndex;\n dataRowIndex = 0;\n }\n var currentRowData = clipboardData[index - indexOffset];\n // otherwise we are not the first row, so copy\n updatedRowNodes.push(rowNode);\n var processCellFromClipboardFunc = _this.gridOptionsService.getCallback('processCellFromClipboard');\n columns.forEach(function (column, idx) {\n if (!column.isCellEditable(rowNode) || column.isSuppressPaste(rowNode)) {\n return;\n }\n // repeat data for columns we don't have data for - happens when to range is bigger than copied data range\n if (idx >= currentRowData.length) {\n idx = idx % currentRowData.length;\n }\n var newValue = _this.processCell(rowNode, column, currentRowData[idx], EXPORT_TYPE_DRAG_COPY, processCellFromClipboardFunc, true);\n rowNode.setDataValue(column, newValue, SOURCE_PASTE);\n if (changedPath) {\n changedPath.addParentNode(rowNode.parent, [column]);\n }\n var rowIndex = currentRow.rowIndex, rowPinned = currentRow.rowPinned;\n var cellId = _this.cellPositionUtils.createIdFromValues({ rowIndex: rowIndex, column: column, rowPinned: rowPinned });\n cellsToFlash[cellId] = true;\n });\n dataRowIndex++;\n };\n this.iterateActiveRanges(false, rowCallback);\n };\n ClipboardService.prototype.pasteStartingFromFocusedCell = function (parsedData, cellsToFlash, updatedRowNodes, focusedCell, changedPath) {\n if (!focusedCell) {\n return;\n }\n var currentRow = { rowIndex: focusedCell.rowIndex, rowPinned: focusedCell.rowPinned };\n var columnsToPasteInto = this.columnModel.getDisplayedColumnsStartingAt(focusedCell.column);\n if (this.isPasteSingleValueIntoRange(parsedData)) {\n this.pasteSingleValueIntoRange(parsedData, updatedRowNodes, cellsToFlash, changedPath);\n }\n else {\n this.pasteMultipleValues(parsedData, currentRow, updatedRowNodes, columnsToPasteInto, cellsToFlash, EXPORT_TYPE_CLIPBOARD, changedPath);\n }\n };\n // if range is active, and only one cell, then we paste this cell into all cells in the active range.\n ClipboardService.prototype.isPasteSingleValueIntoRange = function (parsedData) {\n return this.hasOnlyOneValueToPaste(parsedData)\n && this.rangeService != null\n && !this.rangeService.isEmpty();\n };\n ClipboardService.prototype.pasteSingleValueIntoRange = function (parsedData, updatedRowNodes, cellsToFlash, changedPath) {\n var _this = this;\n var value = parsedData[0][0];\n var rowCallback = function (currentRow, rowNode, columns) {\n updatedRowNodes.push(rowNode);\n columns.forEach(function (column) {\n return _this.updateCellValue(rowNode, column, value, cellsToFlash, EXPORT_TYPE_CLIPBOARD, changedPath);\n });\n };\n this.iterateActiveRanges(false, rowCallback);\n };\n ClipboardService.prototype.hasOnlyOneValueToPaste = function (parsedData) {\n return parsedData.length === 1 && parsedData[0].length === 1;\n };\n ClipboardService.prototype.copyRangeDown = function () {\n var _this = this;\n if (!this.rangeService || this.rangeService.isEmpty()) {\n return;\n }\n var firstRowValues = [];\n var pasteOperation = function (cellsToFlash, updatedRowNodes, focusedCell, changedPath) {\n var processCellForClipboardFunc = _this.gridOptionsService.getCallback('processCellForClipboard');\n var processCellFromClipboardFunc = _this.gridOptionsService.getCallback('processCellFromClipboard');\n var rowCallback = function (currentRow, rowNode, columns) {\n // take reference of first row, this is the one we will be using to copy from\n if (!firstRowValues.length) {\n // two reasons for looping through columns\n columns.forEach(function (column) {\n // get the initial values to copy down\n var value = _this.processCell(rowNode, column, _this.valueService.getValue(column, rowNode), EXPORT_TYPE_DRAG_COPY, processCellForClipboardFunc, false, true);\n firstRowValues.push(value);\n });\n }\n else {\n // otherwise we are not the first row, so copy\n updatedRowNodes.push(rowNode);\n columns.forEach(function (column, index) {\n if (!column.isCellEditable(rowNode) || column.isSuppressPaste(rowNode)) {\n return;\n }\n var firstRowValue = _this.processCell(rowNode, column, firstRowValues[index], EXPORT_TYPE_DRAG_COPY, processCellFromClipboardFunc, true);\n rowNode.setDataValue(column, firstRowValue, SOURCE_PASTE);\n if (changedPath) {\n changedPath.addParentNode(rowNode.parent, [column]);\n }\n var rowIndex = currentRow.rowIndex, rowPinned = currentRow.rowPinned;\n var cellId = _this.cellPositionUtils.createIdFromValues({ rowIndex: rowIndex, column: column, rowPinned: rowPinned });\n cellsToFlash[cellId] = true;\n });\n }\n };\n _this.iterateActiveRanges(true, rowCallback);\n };\n this.doPasteOperation(pasteOperation);\n };\n ClipboardService.prototype.removeLastLineIfBlank = function (parsedData) {\n // remove last row if empty, excel puts empty last row in\n var lastLine = _.last(parsedData);\n var lastLineIsBlank = lastLine && lastLine.length === 1 && lastLine[0] === '';\n if (lastLineIsBlank) {\n // do not remove the last empty line when that is the only line pasted\n if (parsedData.length === 1) {\n return;\n }\n _.removeFromArray(parsedData, lastLine);\n }\n };\n ClipboardService.prototype.fireRowChanged = function (rowNodes) {\n var _this = this;\n if (this.gridOptionsService.get('editType') !== 'fullRow') {\n return;\n }\n rowNodes.forEach(function (rowNode) {\n var event = {\n type: Events.EVENT_ROW_VALUE_CHANGED,\n node: rowNode,\n data: rowNode.data,\n rowIndex: rowNode.rowIndex,\n rowPinned: rowNode.rowPinned\n };\n _this.eventService.dispatchEvent(event);\n });\n };\n ClipboardService.prototype.pasteMultipleValues = function (clipboardGridData, currentRow, updatedRowNodes, columnsToPasteInto, cellsToFlash, type, changedPath) {\n var _this = this;\n var rowPointer = currentRow;\n // if doing CSRM and NOT tree data, then it means groups are aggregates, which are read only,\n // so we should skip them when doing paste operations.\n var skipGroupRows = this.clientSideRowModel != null && !this.gridOptionsService.is('enableGroupEdit') && !this.gridOptionsService.isTreeData();\n var getNextGoodRowNode = function () {\n while (true) {\n if (!rowPointer) {\n return null;\n }\n var res = _this.rowPositionUtils.getRowNode(rowPointer);\n // move to next row down for next set of values\n rowPointer = _this.cellNavigationService.getRowBelow({ rowPinned: rowPointer.rowPinned, rowIndex: rowPointer.rowIndex });\n // if no more rows, return null\n if (res == null) {\n return null;\n }\n // skip details rows and footer rows, never paste into them as they don't hold data\n var skipRow = res.detail || res.footer || (skipGroupRows && res.group);\n // skipping row means we go into the next iteration of the while loop\n if (!skipRow) {\n return res;\n }\n }\n };\n clipboardGridData.forEach(function (clipboardRowData) {\n var rowNode = getNextGoodRowNode();\n // if we have come to end of rows in grid, then skip\n if (!rowNode) {\n return;\n }\n clipboardRowData.forEach(function (value, index) {\n return _this.updateCellValue(rowNode, columnsToPasteInto[index], value, cellsToFlash, type, changedPath);\n });\n updatedRowNodes.push(rowNode);\n });\n };\n ClipboardService.prototype.updateCellValue = function (rowNode, column, value, cellsToFlash, type, changedPath) {\n if (!rowNode ||\n !column ||\n !column.isCellEditable(rowNode) ||\n column.isSuppressPaste(rowNode)) {\n return;\n }\n // if the cell is a group and the col is an aggregation, skip the cell.\n if (rowNode.group && column.isValueActive()) {\n return;\n }\n var processedValue = this.processCell(rowNode, column, value, type, this.gridOptionsService.getCallback('processCellFromClipboard'), true);\n rowNode.setDataValue(column, processedValue, SOURCE_PASTE);\n var rowIndex = rowNode.rowIndex, rowPinned = rowNode.rowPinned;\n var cellId = this.cellPositionUtils.createIdFromValues({ rowIndex: rowIndex, column: column, rowPinned: rowPinned });\n cellsToFlash[cellId] = true;\n if (changedPath) {\n changedPath.addParentNode(rowNode.parent, [column]);\n }\n };\n ClipboardService.prototype.copyToClipboard = function (params) {\n if (params === void 0) { params = {}; }\n this.copyOrCutToClipboard(params);\n };\n ClipboardService.prototype.cutToClipboard = function (params, source) {\n if (params === void 0) { params = {}; }\n if (source === void 0) { source = 'api'; }\n if (this.gridOptionsService.is('suppressCutToClipboard')) {\n return;\n }\n var startEvent = {\n type: Events.EVENT_CUT_START,\n source: source\n };\n this.eventService.dispatchEvent(startEvent);\n this.copyOrCutToClipboard(params, true);\n var endEvent = {\n type: Events.EVENT_CUT_END,\n source: source\n };\n this.eventService.dispatchEvent(endEvent);\n };\n ClipboardService.prototype.copyOrCutToClipboard = function (params, cut) {\n var includeHeaders = params.includeHeaders, includeGroupHeaders = params.includeGroupHeaders;\n this.logger.log(\"copyToClipboard: includeHeaders = \" + includeHeaders);\n // don't override 'includeHeaders' if it has been explicitly set to 'false'\n if (includeHeaders == null) {\n includeHeaders = this.gridOptionsService.is('copyHeadersToClipboard');\n }\n if (includeGroupHeaders == null) {\n includeGroupHeaders = this.gridOptionsService.is('copyGroupHeadersToClipboard');\n }\n var copyParams = { includeHeaders: includeHeaders, includeGroupHeaders: includeGroupHeaders };\n var shouldCopyRows = !this.gridOptionsService.is('suppressCopyRowsToClipboard');\n var cellClearType = null;\n // Copy priority is Range > Row > Focus\n if (this.rangeService && !this.rangeService.isEmpty() && !this.shouldSkipSingleCellRange()) {\n this.copySelectedRangeToClipboard(copyParams);\n cellClearType = CellClearType.CellRange;\n }\n else if (shouldCopyRows && !this.selectionService.isEmpty()) {\n this.copySelectedRowsToClipboard(copyParams);\n cellClearType = CellClearType.SelectedRows;\n }\n else if (this.focusService.isAnyCellFocused()) {\n this.copyFocusedCellToClipboard(copyParams);\n cellClearType = CellClearType.FocusedCell;\n }\n if (cut && cellClearType !== null) {\n this.clearCellsAfterCopy(cellClearType);\n }\n };\n ClipboardService.prototype.clearCellsAfterCopy = function (type) {\n this.eventService.dispatchEvent({ type: Events.EVENT_KEY_SHORTCUT_CHANGED_CELL_START });\n if (type === CellClearType.CellRange) {\n this.rangeService.clearCellRangeCellValues({ cellEventSource: 'clipboardService' });\n }\n else if (type === CellClearType.SelectedRows) {\n this.clearSelectedRows();\n }\n else {\n var focusedCell = this.focusService.getFocusedCell();\n if (focusedCell == null) {\n return;\n }\n var rowNode = this.rowPositionUtils.getRowNode(focusedCell);\n if (rowNode) {\n this.clearCellValue(rowNode, focusedCell.column);\n }\n }\n this.eventService.dispatchEvent({ type: Events.EVENT_KEY_SHORTCUT_CHANGED_CELL_END });\n };\n ClipboardService.prototype.clearSelectedRows = function () {\n var e_1, _a, e_2, _b;\n var selected = this.selectionService.getSelectedNodes();\n var columns = this.columnModel.getAllDisplayedColumns();\n try {\n for (var selected_1 = __values$Q(selected), selected_1_1 = selected_1.next(); !selected_1_1.done; selected_1_1 = selected_1.next()) {\n var row = selected_1_1.value;\n try {\n for (var columns_1 = (e_2 = void 0, __values$Q(columns)), columns_1_1 = columns_1.next(); !columns_1_1.done; columns_1_1 = columns_1.next()) {\n var col = columns_1_1.value;\n this.clearCellValue(row, col);\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (columns_1_1 && !columns_1_1.done && (_b = columns_1.return)) _b.call(columns_1);\n }\n finally { if (e_2) throw e_2.error; }\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (selected_1_1 && !selected_1_1.done && (_a = selected_1.return)) _a.call(selected_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n };\n ClipboardService.prototype.clearCellValue = function (rowNode, column) {\n if (!column.isCellEditable(rowNode)) {\n return;\n }\n rowNode.setDataValue(column, null, 'clipboardService');\n };\n ClipboardService.prototype.shouldSkipSingleCellRange = function () {\n return this.gridOptionsService.is('suppressCopySingleCellRanges') && !this.rangeService.isMoreThanOneCell();\n };\n ClipboardService.prototype.iterateActiveRanges = function (onlyFirst, rowCallback, columnCallback) {\n var _this = this;\n if (!this.rangeService || this.rangeService.isEmpty()) {\n return;\n }\n var cellRanges = this.rangeService.getCellRanges();\n if (onlyFirst) {\n this.iterateActiveRange(cellRanges[0], rowCallback, columnCallback, true);\n }\n else {\n cellRanges.forEach(function (range, idx) { return _this.iterateActiveRange(range, rowCallback, columnCallback, idx === cellRanges.length - 1); });\n }\n };\n ClipboardService.prototype.iterateActiveRange = function (range, rowCallback, columnCallback, isLastRange) {\n if (!this.rangeService) {\n return;\n }\n var currentRow = this.rangeService.getRangeStartRow(range);\n var lastRow = this.rangeService.getRangeEndRow(range);\n if (columnCallback && range.columns) {\n columnCallback(range.columns);\n }\n var rangeIndex = 0;\n var isLastRow = false;\n // the currentRow could be missing if the user sets the active range manually, and sets a range\n // that is outside of the grid (eg. sets range rows 0 to 100, but grid has only 20 rows).\n while (!isLastRow && currentRow != null) {\n var rowNode = this.rowPositionUtils.getRowNode(currentRow);\n isLastRow = this.rowPositionUtils.sameRow(currentRow, lastRow);\n rowCallback(currentRow, rowNode, range.columns, rangeIndex++, isLastRow && isLastRange);\n currentRow = this.cellNavigationService.getRowBelow(currentRow);\n }\n };\n ClipboardService.prototype.copySelectedRangeToClipboard = function (params) {\n if (params === void 0) { params = {}; }\n if (!this.rangeService || this.rangeService.isEmpty()) {\n return;\n }\n var allRangesMerge = this.rangeService.areAllRangesAbleToMerge();\n var _a = allRangesMerge ? this.buildDataFromMergedRanges(params) : this.buildDataFromRanges(params), data = _a.data, cellsToFlash = _a.cellsToFlash;\n this.copyDataToClipboard(data);\n this.dispatchFlashCells(cellsToFlash);\n };\n ClipboardService.prototype.buildDataFromMergedRanges = function (params) {\n var _this = this;\n var columnsSet = new Set();\n var ranges = this.rangeService.getCellRanges();\n var rowPositionsMap = new Map();\n var allRowPositions = [];\n var allCellsToFlash = {};\n ranges.forEach(function (range) {\n range.columns.forEach(function (col) { return columnsSet.add(col); });\n var _a = _this.getRangeRowPositionsAndCellsToFlash(range), rowPositions = _a.rowPositions, cellsToFlash = _a.cellsToFlash;\n rowPositions.forEach(function (rowPosition) {\n var rowPositionAsString = rowPosition.rowIndex + \"-\" + (rowPosition.rowPinned || 'null');\n if (!rowPositionsMap.get(rowPositionAsString)) {\n rowPositionsMap.set(rowPositionAsString, true);\n allRowPositions.push(rowPosition);\n }\n });\n Object.assign(allCellsToFlash, cellsToFlash);\n });\n var allColumns = this.columnModel.getAllDisplayedColumns();\n var exportedColumns = Array.from(columnsSet);\n exportedColumns.sort(function (a, b) {\n var posA = allColumns.indexOf(a);\n var posB = allColumns.indexOf(b);\n return posA - posB;\n });\n var data = this.buildExportParams({\n columns: exportedColumns,\n rowPositions: allRowPositions,\n includeHeaders: params.includeHeaders,\n includeGroupHeaders: params.includeGroupHeaders,\n });\n return { data: data, cellsToFlash: allCellsToFlash };\n };\n ClipboardService.prototype.buildDataFromRanges = function (params) {\n var _this = this;\n var ranges = this.rangeService.getCellRanges();\n var data = [];\n var allCellsToFlash = {};\n ranges.forEach(function (range) {\n var _a = _this.getRangeRowPositionsAndCellsToFlash(range), rowPositions = _a.rowPositions, cellsToFlash = _a.cellsToFlash;\n Object.assign(allCellsToFlash, cellsToFlash);\n data.push(_this.buildExportParams({\n columns: range.columns,\n rowPositions: rowPositions,\n includeHeaders: params.includeHeaders,\n includeGroupHeaders: params.includeGroupHeaders,\n }));\n });\n return { data: data.join('\\n'), cellsToFlash: allCellsToFlash };\n };\n ClipboardService.prototype.getRangeRowPositionsAndCellsToFlash = function (range) {\n var _this = this;\n var rowPositions = [];\n var cellsToFlash = {};\n var startRow = this.rangeService.getRangeStartRow(range);\n var lastRow = this.rangeService.getRangeEndRow(range);\n var node = startRow;\n while (node) {\n rowPositions.push(node);\n range.columns.forEach(function (column) {\n var _a = node, rowIndex = _a.rowIndex, rowPinned = _a.rowPinned;\n var cellId = _this.cellPositionUtils.createIdFromValues({ rowIndex: rowIndex, column: column, rowPinned: rowPinned });\n cellsToFlash[cellId] = true;\n });\n if (this.rowPositionUtils.sameRow(node, lastRow)) {\n break;\n }\n node = this.cellNavigationService.getRowBelow(node);\n }\n return { rowPositions: rowPositions, cellsToFlash: cellsToFlash };\n };\n ClipboardService.prototype.copyFocusedCellToClipboard = function (params) {\n var _a;\n if (params === void 0) { params = {}; }\n var focusedCell = this.focusService.getFocusedCell();\n if (focusedCell == null) {\n return;\n }\n var cellId = this.cellPositionUtils.createId(focusedCell);\n var currentRow = { rowPinned: focusedCell.rowPinned, rowIndex: focusedCell.rowIndex };\n var column = focusedCell.column;\n var data = this.buildExportParams({\n columns: [column],\n rowPositions: [currentRow],\n includeHeaders: params.includeHeaders,\n includeGroupHeaders: params.includeGroupHeaders\n });\n this.copyDataToClipboard(data);\n this.dispatchFlashCells((_a = {}, _a[cellId] = true, _a));\n };\n ClipboardService.prototype.copySelectedRowsToClipboard = function (params) {\n if (params === void 0) { params = {}; }\n var columnKeys = params.columnKeys, includeHeaders = params.includeHeaders, includeGroupHeaders = params.includeGroupHeaders;\n var data = this.buildExportParams({\n columns: columnKeys,\n includeHeaders: includeHeaders,\n includeGroupHeaders: includeGroupHeaders\n });\n this.copyDataToClipboard(data);\n };\n ClipboardService.prototype.buildExportParams = function (params) {\n var _this = this;\n var columns = params.columns, rowPositions = params.rowPositions, _a = params.includeHeaders, includeHeaders = _a === void 0 ? false : _a, _b = params.includeGroupHeaders, includeGroupHeaders = _b === void 0 ? false : _b;\n var exportParams = {\n columnKeys: columns,\n rowPositions: rowPositions,\n skipColumnHeaders: !includeHeaders,\n skipColumnGroupHeaders: !includeGroupHeaders,\n suppressQuotes: true,\n columnSeparator: this.getClipboardDelimiter(),\n onlySelected: !rowPositions,\n processCellCallback: this.gridOptionsService.getCallback('processCellForClipboard'),\n processRowGroupCallback: function (params) { return _this.processRowGroupCallback(params); },\n processHeaderCallback: this.gridOptionsService.getCallback('processHeaderForClipboard'),\n processGroupHeaderCallback: this.gridOptionsService.getCallback('processGroupHeaderForClipboard')\n };\n return this.csvCreator.getDataAsCsv(exportParams, true);\n };\n ClipboardService.prototype.processRowGroupCallback = function (params) {\n var _this = this;\n var node = params.node;\n var key = node.key;\n var value = key != null ? key : '';\n if (params.node.footer) {\n var suffix = '';\n if (key && key.length) {\n suffix = \" \" + key;\n }\n value = \"Total\" + suffix;\n }\n var processCellForClipboard = this.gridOptionsService.getCallback('processCellForClipboard');\n if (processCellForClipboard) {\n var column_1 = node.rowGroupColumn;\n if (!column_1 && node.footer && node.level === -1) {\n column_1 = this.columnModel.getRowGroupColumns()[0];\n }\n return processCellForClipboard({\n value: value,\n node: node,\n column: column_1,\n type: 'clipboard',\n formatValue: function (valueToFormat) { var _a; return (_a = _this.valueFormatterService.formatValue(column_1, node, valueToFormat)) !== null && _a !== void 0 ? _a : valueToFormat; },\n parseValue: function (valueToParse) { return _this.valueParserService.parseValue(column_1, node, valueToParse, _this.valueService.getValue(column_1, node)); }\n });\n }\n return value;\n };\n ClipboardService.prototype.dispatchFlashCells = function (cellsToFlash) {\n var _this = this;\n window.setTimeout(function () {\n var event = {\n type: Events.EVENT_FLASH_CELLS,\n cells: cellsToFlash\n };\n _this.eventService.dispatchEvent(event);\n }, 0);\n };\n ClipboardService.prototype.processCell = function (rowNode, column, value, type, func, canParse, canFormat) {\n var _this = this;\n var _a;\n if (func) {\n var params = {\n column: column,\n node: rowNode,\n value: value,\n type: type,\n formatValue: function (valueToFormat) { var _a; return (_a = _this.valueFormatterService.formatValue(column, rowNode !== null && rowNode !== void 0 ? rowNode : null, valueToFormat)) !== null && _a !== void 0 ? _a : valueToFormat; },\n parseValue: function (valueToParse) { return _this.valueParserService.parseValue(column, rowNode !== null && rowNode !== void 0 ? rowNode : null, valueToParse, _this.valueService.getValue(column, rowNode)); }\n };\n return func(params);\n }\n if (canParse && column.getColDef().useValueParserForImport) {\n return this.valueParserService.parseValue(column, rowNode !== null && rowNode !== void 0 ? rowNode : null, value, this.valueService.getValue(column, rowNode));\n }\n else if (canFormat && column.getColDef().useValueFormatterForExport) {\n return (_a = this.valueFormatterService.formatValue(column, rowNode !== null && rowNode !== void 0 ? rowNode : null, value)) !== null && _a !== void 0 ? _a : value;\n }\n return value;\n };\n ClipboardService.prototype.copyDataToClipboard = function (data) {\n var _this = this;\n var userProvidedFunc = this.gridOptionsService.getCallback('sendToClipboard');\n // method 1 - user provided func\n if (userProvidedFunc) {\n userProvidedFunc({ data: data });\n return;\n }\n // method 2 - native clipboard API, available in modern chrome browsers\n var allowNavigator = !this.gridOptionsService.is('suppressClipboardApi');\n if (allowNavigator && navigator.clipboard) {\n navigator.clipboard.writeText(data).catch(function (e) {\n _.doOnce(function () {\n console.warn(e);\n console.warn('AG Grid: Unable to use the Clipboard API (navigator.clipboard.writeText()). ' +\n 'The reason why it could not be used has been logged in the previous line. ' +\n 'For this reason the grid has defaulted to using a workaround which doesn\\'t perform as well. ' +\n 'Either fix why Clipboard API is blocked, OR stop this message from appearing by setting grid ' +\n 'property suppressClipboardApi=true (which will default the grid to using the workaround rather than the API.');\n }, 'clipboardApiError');\n _this.copyDataToClipboardLegacy(data);\n });\n return;\n }\n this.copyDataToClipboardLegacy(data);\n };\n ClipboardService.prototype.copyDataToClipboardLegacy = function (data) {\n var _this = this;\n // method 3 - if all else fails, the old school hack\n this.executeOnTempElement(function (element) {\n var eDocument = _this.gridOptionsService.getDocument();\n var focusedElementBefore = eDocument.activeElement;\n element.value = data || ' '; // has to be non-empty value or execCommand will not do anything\n element.select();\n element.focus({ preventScroll: true });\n var result = eDocument.execCommand('copy');\n if (!result) {\n console.warn('AG Grid: Browser did not allow document.execCommand(\\'copy\\'). Ensure ' +\n 'api.copySelectedRowsToClipboard() is invoked via a user event, i.e. button click, otherwise ' +\n 'the browser will prevent it for security reasons.');\n }\n if (focusedElementBefore != null && focusedElementBefore.focus != null) {\n focusedElementBefore.focus({ preventScroll: true });\n }\n });\n };\n ClipboardService.prototype.executeOnTempElement = function (callbackNow, callbackAfter) {\n var eDoc = this.gridOptionsService.getDocument();\n var eTempInput = eDoc.createElement('textarea');\n eTempInput.style.width = '1px';\n eTempInput.style.height = '1px';\n // removing items from the DOM causes the document element to scroll to the\n // position where the element was positioned. Here we set scrollTop / scrollLeft\n // to prevent the document element from scrolling when we remove it from the DOM.\n eTempInput.style.top = eDoc.documentElement.scrollTop + 'px';\n eTempInput.style.left = eDoc.documentElement.scrollLeft + 'px';\n eTempInput.style.position = 'absolute';\n eTempInput.style.opacity = '0';\n var guiRoot = this.gridCtrl.getGui();\n guiRoot.appendChild(eTempInput);\n try {\n callbackNow(eTempInput);\n }\n catch (err) {\n console.warn('AG Grid: Browser does not support document.execCommand(\\'copy\\') for clipboard operations');\n }\n //It needs 100 otherwise OS X seemed to not always be able to paste... Go figure...\n if (callbackAfter) {\n window.setTimeout(function () {\n callbackAfter(eTempInput);\n guiRoot.removeChild(eTempInput);\n }, 100);\n }\n else {\n guiRoot.removeChild(eTempInput);\n }\n };\n ClipboardService.prototype.getRangeSize = function () {\n var ranges = this.rangeService.getCellRanges();\n var startRangeIndex = 0;\n var endRangeIndex = 0;\n if (ranges.length > 0) {\n startRangeIndex = this.rangeService.getRangeStartRow(ranges[0]).rowIndex;\n endRangeIndex = this.rangeService.getRangeEndRow(ranges[0]).rowIndex;\n }\n return startRangeIndex - endRangeIndex + 1;\n };\n var ClipboardService_1;\n __decorate$2A([\n Autowired('csvCreator')\n ], ClipboardService.prototype, \"csvCreator\", void 0);\n __decorate$2A([\n Autowired('loggerFactory')\n ], ClipboardService.prototype, \"loggerFactory\", void 0);\n __decorate$2A([\n Autowired('selectionService')\n ], ClipboardService.prototype, \"selectionService\", void 0);\n __decorate$2A([\n Optional('rangeService')\n ], ClipboardService.prototype, \"rangeService\", void 0);\n __decorate$2A([\n Autowired('rowModel')\n ], ClipboardService.prototype, \"rowModel\", void 0);\n __decorate$2A([\n Autowired('ctrlsService')\n ], ClipboardService.prototype, \"ctrlsService\", void 0);\n __decorate$2A([\n Autowired('valueService')\n ], ClipboardService.prototype, \"valueService\", void 0);\n __decorate$2A([\n Autowired('focusService')\n ], ClipboardService.prototype, \"focusService\", void 0);\n __decorate$2A([\n Autowired('rowRenderer')\n ], ClipboardService.prototype, \"rowRenderer\", void 0);\n __decorate$2A([\n Autowired('columnModel')\n ], ClipboardService.prototype, \"columnModel\", void 0);\n __decorate$2A([\n Autowired('cellNavigationService')\n ], ClipboardService.prototype, \"cellNavigationService\", void 0);\n __decorate$2A([\n Autowired('cellPositionUtils')\n ], ClipboardService.prototype, \"cellPositionUtils\", void 0);\n __decorate$2A([\n Autowired('rowPositionUtils')\n ], ClipboardService.prototype, \"rowPositionUtils\", void 0);\n __decorate$2A([\n Autowired('valueFormatterService')\n ], ClipboardService.prototype, \"valueFormatterService\", void 0);\n __decorate$2A([\n Autowired('valueParserService')\n ], ClipboardService.prototype, \"valueParserService\", void 0);\n __decorate$2A([\n PostConstruct\n ], ClipboardService.prototype, \"init\", null);\n ClipboardService = ClipboardService_1 = __decorate$2A([\n Bean('clipboardService')\n ], ClipboardService);\n return ClipboardService;\n}(BeanStub));\n\n// DO NOT UPDATE MANUALLY: Generated from script during build time\nvar VERSION$h = '30.0.6';\n\nvar ClipboardModule = {\n version: VERSION$h,\n moduleName: ModuleNames.ClipboardModule,\n beans: [ClipboardService],\n dependantModules: [\n EnterpriseCoreModule,\n CsvExportModule\n ]\n};\n\nvar __extends$3o = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$2z = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar ExpandState;\n(function (ExpandState) {\n ExpandState[ExpandState[\"EXPANDED\"] = 0] = \"EXPANDED\";\n ExpandState[ExpandState[\"COLLAPSED\"] = 1] = \"COLLAPSED\";\n ExpandState[ExpandState[\"INDETERMINATE\"] = 2] = \"INDETERMINATE\";\n})(ExpandState || (ExpandState = {}));\nvar PrimaryColsHeaderPanel = /** @class */ (function (_super) {\n __extends$3o(PrimaryColsHeaderPanel, _super);\n function PrimaryColsHeaderPanel() {\n return _super.call(this, PrimaryColsHeaderPanel.TEMPLATE) || this;\n }\n PrimaryColsHeaderPanel.prototype.postConstruct = function () {\n var _this = this;\n this.createExpandIcons();\n this.addManagedListener(this.eExpand, 'click', this.onExpandClicked.bind(this));\n this.addManagedListener(this.eExpand, 'keydown', function (e) {\n if (e.key === KeyCode.SPACE) {\n e.preventDefault();\n _this.onExpandClicked();\n }\n });\n this.addManagedListener(this.eSelect.getInputElement(), 'click', this.onSelectClicked.bind(this));\n this.eFilterTextField.onValueChange(function () { return _this.onFilterTextChanged(); });\n this.addManagedListener(this.eFilterTextField.getInputElement(), 'keydown', this.onMiniFilterKeyDown.bind(this));\n this.addManagedListener(this.eventService, Events.EVENT_NEW_COLUMNS_LOADED, this.showOrHideOptions.bind(this));\n var translate = this.localeService.getLocaleTextFunc();\n this.eSelect.setInputAriaLabel(translate('ariaColumnSelectAll', 'Toggle Select All Columns'));\n this.eFilterTextField.setInputAriaLabel(translate('ariaFilterColumnsInput', 'Filter Columns Input'));\n this.activateTabIndex([this.eExpand]);\n };\n PrimaryColsHeaderPanel.prototype.init = function (params) {\n this.params = params;\n if (this.columnModel.isReady()) {\n this.showOrHideOptions();\n }\n };\n PrimaryColsHeaderPanel.prototype.createExpandIcons = function () {\n this.eExpand.appendChild((this.eExpandChecked = _.createIconNoSpan('columnSelectOpen', this.gridOptionsService)));\n this.eExpand.appendChild((this.eExpandUnchecked = _.createIconNoSpan('columnSelectClosed', this.gridOptionsService)));\n this.eExpand.appendChild((this.eExpandIndeterminate = _.createIconNoSpan('columnSelectIndeterminate', this.gridOptionsService)));\n this.setExpandState(ExpandState.EXPANDED);\n };\n // we only show expand / collapse if we are showing columns\n PrimaryColsHeaderPanel.prototype.showOrHideOptions = function () {\n var showFilter = !this.params.suppressColumnFilter;\n var showSelect = !this.params.suppressColumnSelectAll;\n var showExpand = !this.params.suppressColumnExpandAll;\n var groupsPresent = this.columnModel.isPrimaryColumnGroupsPresent();\n var translate = this.localeService.getLocaleTextFunc();\n this.eFilterTextField.setInputPlaceholder(translate('searchOoo', 'Search...'));\n _.setDisplayed(this.eFilterTextField.getGui(), showFilter);\n _.setDisplayed(this.eSelect.getGui(), showSelect);\n _.setDisplayed(this.eExpand, showExpand && groupsPresent);\n };\n PrimaryColsHeaderPanel.prototype.onFilterTextChanged = function () {\n var _this = this;\n if (!this.onFilterTextChangedDebounced) {\n this.onFilterTextChangedDebounced = _.debounce(function () {\n var filterText = _this.eFilterTextField.getValue();\n _this.dispatchEvent({ type: \"filterChanged\", filterText: filterText });\n }, PrimaryColsHeaderPanel.DEBOUNCE_DELAY);\n }\n this.onFilterTextChangedDebounced();\n };\n PrimaryColsHeaderPanel.prototype.onMiniFilterKeyDown = function (e) {\n var _this = this;\n if (e.key === KeyCode.ENTER) {\n // we need to add a delay that corresponds to the filter text debounce delay to ensure\n // the text filtering has happened, otherwise all columns will be deselected\n setTimeout(function () { return _this.onSelectClicked(); }, PrimaryColsHeaderPanel.DEBOUNCE_DELAY);\n }\n };\n PrimaryColsHeaderPanel.prototype.onSelectClicked = function () {\n this.dispatchEvent({ type: this.selectState ? 'unselectAll' : 'selectAll' });\n };\n PrimaryColsHeaderPanel.prototype.onExpandClicked = function () {\n this.dispatchEvent({ type: this.expandState === ExpandState.EXPANDED ? 'collapseAll' : 'expandAll' });\n };\n PrimaryColsHeaderPanel.prototype.setExpandState = function (state) {\n this.expandState = state;\n _.setDisplayed(this.eExpandChecked, this.expandState === ExpandState.EXPANDED);\n _.setDisplayed(this.eExpandUnchecked, this.expandState === ExpandState.COLLAPSED);\n _.setDisplayed(this.eExpandIndeterminate, this.expandState === ExpandState.INDETERMINATE);\n };\n PrimaryColsHeaderPanel.prototype.setSelectionState = function (state) {\n this.selectState = state;\n this.eSelect.setValue(this.selectState);\n };\n PrimaryColsHeaderPanel.DEBOUNCE_DELAY = 300;\n PrimaryColsHeaderPanel.TEMPLATE = \"
\\n
\\n \\n \\n
\";\n __decorate$2z([\n Autowired('columnModel')\n ], PrimaryColsHeaderPanel.prototype, \"columnModel\", void 0);\n __decorate$2z([\n RefSelector('eExpand')\n ], PrimaryColsHeaderPanel.prototype, \"eExpand\", void 0);\n __decorate$2z([\n RefSelector('eSelect')\n ], PrimaryColsHeaderPanel.prototype, \"eSelect\", void 0);\n __decorate$2z([\n RefSelector('eFilterTextField')\n ], PrimaryColsHeaderPanel.prototype, \"eFilterTextField\", void 0);\n __decorate$2z([\n PostConstruct\n ], PrimaryColsHeaderPanel.prototype, \"postConstruct\", null);\n return PrimaryColsHeaderPanel;\n}(Component));\n\nvar ColumnModelItem = /** @class */ (function () {\n function ColumnModelItem(displayName, columnOrGroup, dept, group, expanded) {\n if (group === void 0) { group = false; }\n this.eventService = new EventService();\n this.displayName = displayName;\n this.dept = dept;\n this.group = group;\n if (group) {\n this.columnGroup = columnOrGroup;\n this.expanded = expanded;\n this.children = [];\n }\n else {\n this.column = columnOrGroup;\n }\n }\n ColumnModelItem.prototype.isGroup = function () { return this.group; };\n ColumnModelItem.prototype.getDisplayName = function () { return this.displayName; };\n ColumnModelItem.prototype.getColumnGroup = function () { return this.columnGroup; };\n ColumnModelItem.prototype.getColumn = function () { return this.column; };\n ColumnModelItem.prototype.getDept = function () { return this.dept; };\n ColumnModelItem.prototype.isExpanded = function () { return !!this.expanded; };\n ColumnModelItem.prototype.getChildren = function () { return this.children; };\n ColumnModelItem.prototype.isPassesFilter = function () { return this.passesFilter; };\n ColumnModelItem.prototype.setExpanded = function (expanded) {\n if (expanded === this.expanded) {\n return;\n }\n this.expanded = expanded;\n this.eventService.dispatchEvent({ type: ColumnModelItem.EVENT_EXPANDED_CHANGED });\n };\n ColumnModelItem.prototype.setPassesFilter = function (passesFilter) {\n this.passesFilter = passesFilter;\n };\n ColumnModelItem.prototype.addEventListener = function (eventType, listener) {\n this.eventService.addEventListener(eventType, listener);\n };\n ColumnModelItem.prototype.removeEventListener = function (eventType, listener) {\n this.eventService.removeEventListener(eventType, listener);\n };\n ColumnModelItem.EVENT_EXPANDED_CHANGED = 'expandedChanged';\n return ColumnModelItem;\n}());\n\nvar __extends$3n = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$2y = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __read$1l = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray$P = (undefined && undefined.__spreadArray) || function (to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\n to[j] = from[i];\n return to;\n};\nvar __values$P = (undefined && undefined.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nvar ToolPanelContextMenu = /** @class */ (function (_super) {\n __extends$3n(ToolPanelContextMenu, _super);\n function ToolPanelContextMenu(column, mouseEvent, parentEl) {\n var _this = _super.call(this, /* html */ \"
\") || this;\n _this.column = column;\n _this.mouseEvent = mouseEvent;\n _this.parentEl = parentEl;\n _this.displayName = null;\n return _this;\n }\n ToolPanelContextMenu.prototype.postConstruct = function () {\n this.initializeProperties(this.column);\n this.buildMenuItemMap();\n if (this.column instanceof Column) {\n this.displayName = this.columnModel.getDisplayNameForColumn(this.column, 'columnToolPanel');\n }\n else {\n this.displayName = this.columnModel.getDisplayNameForProvidedColumnGroup(null, this.column, 'columnToolPanel');\n }\n if (this.isActive()) {\n this.mouseEvent.preventDefault();\n this.displayContextMenu();\n }\n };\n ToolPanelContextMenu.prototype.initializeProperties = function (column) {\n if (column instanceof ProvidedColumnGroup) {\n this.columns = column.getLeafColumns();\n }\n else {\n this.columns = [column];\n }\n this.allowGrouping = this.columns.some(function (col) { return col.isPrimary() && col.isAllowRowGroup(); });\n this.allowValues = this.columns.some(function (col) { return col.isPrimary() && col.isAllowValue(); });\n this.allowPivoting = this.columnModel.isPivotMode() && this.columns.some(function (col) { return col.isPrimary() && col.isAllowPivot(); });\n };\n ToolPanelContextMenu.prototype.buildMenuItemMap = function () {\n var _this = this;\n var localeTextFunc = this.localeService.getLocaleTextFunc();\n this.menuItemMap = new Map();\n this.menuItemMap.set('rowGroup', {\n allowedFunction: function (col) { return col.isPrimary() && col.isAllowRowGroup(); },\n activeFunction: function (col) { return col.isRowGroupActive(); },\n activateLabel: function () { return localeTextFunc('groupBy', 'Group by') + \" \" + _this.displayName; },\n deactivateLabel: function () { return localeTextFunc('ungroupBy', 'Un-Group by') + \" \" + _this.displayName; },\n activateFunction: function () {\n var groupedColumns = _this.columnModel.getRowGroupColumns();\n _this.columnModel.setRowGroupColumns(_this.addColumnsToList(groupedColumns), \"toolPanelUi\");\n },\n deActivateFunction: function () {\n var groupedColumns = _this.columnModel.getRowGroupColumns();\n _this.columnModel.setRowGroupColumns(_this.removeColumnsFromList(groupedColumns), \"toolPanelUi\");\n },\n addIcon: 'menuAddRowGroup',\n removeIcon: 'menuRemoveRowGroup'\n });\n this.menuItemMap.set('value', {\n allowedFunction: function (col) { return col.isPrimary() && col.isAllowValue(); },\n activeFunction: function (col) { return col.isValueActive(); },\n activateLabel: function () { return localeTextFunc('addToValues', \"Add \" + _this.displayName + \" to values\", [_this.displayName]); },\n deactivateLabel: function () { return localeTextFunc('removeFromValues', \"Remove \" + _this.displayName + \" from values\", [_this.displayName]); },\n activateFunction: function () {\n var valueColumns = _this.columnModel.getValueColumns();\n _this.columnModel.setValueColumns(_this.addColumnsToList(valueColumns), \"toolPanelUi\");\n },\n deActivateFunction: function () {\n var valueColumns = _this.columnModel.getValueColumns();\n _this.columnModel.setValueColumns(_this.removeColumnsFromList(valueColumns), \"toolPanelUi\");\n },\n addIcon: 'valuePanel',\n removeIcon: 'valuePanel'\n });\n this.menuItemMap.set('pivot', {\n allowedFunction: function (col) { return _this.columnModel.isPivotMode() && col.isPrimary() && col.isAllowPivot(); },\n activeFunction: function (col) { return col.isPivotActive(); },\n activateLabel: function () { return localeTextFunc('addToLabels', \"Add \" + _this.displayName + \" to labels\", [_this.displayName]); },\n deactivateLabel: function () { return localeTextFunc('removeFromLabels', \"Remove \" + _this.displayName + \" from labels\", [_this.displayName]); },\n activateFunction: function () {\n var pivotColumns = _this.columnModel.getPivotColumns();\n _this.columnModel.setPivotColumns(_this.addColumnsToList(pivotColumns), \"toolPanelUi\");\n },\n deActivateFunction: function () {\n var pivotColumns = _this.columnModel.getPivotColumns();\n _this.columnModel.setPivotColumns(_this.removeColumnsFromList(pivotColumns), \"toolPanelUi\");\n },\n addIcon: 'pivotPanel',\n removeIcon: 'pivotPanel'\n });\n };\n ToolPanelContextMenu.prototype.addColumnsToList = function (columnList) {\n return __spreadArray$P([], __read$1l(columnList)).concat(this.columns.filter(function (col) { return columnList.indexOf(col) === -1; }));\n };\n ToolPanelContextMenu.prototype.removeColumnsFromList = function (columnList) {\n var _this = this;\n return columnList.filter(function (col) { return _this.columns.indexOf(col) === -1; });\n };\n ToolPanelContextMenu.prototype.displayContextMenu = function () {\n var _this = this;\n var eGui = this.getGui();\n var menuList = this.createBean(new AgMenuList());\n var menuItemsMapped = this.getMappedMenuItems();\n var localeTextFunc = this.localeService.getLocaleTextFunc();\n var hideFunc = function () { };\n eGui.appendChild(menuList.getGui());\n menuList.addMenuItems(menuItemsMapped);\n menuList.addManagedListener(menuList, AgMenuItemComponent.EVENT_MENU_ITEM_SELECTED, function () {\n _this.parentEl.focus();\n hideFunc();\n });\n var addPopupRes = this.popupService.addPopup({\n modal: true,\n eChild: eGui,\n closeOnEsc: true,\n afterGuiAttached: function () { return _this.focusService.focusInto(menuList.getGui()); },\n ariaLabel: localeTextFunc('ariaLabelContextMenu', 'Context Menu'),\n closedCallback: function (e) {\n if (e instanceof KeyboardEvent) {\n _this.parentEl.focus();\n }\n _this.destroyBean(menuList);\n }\n });\n if (addPopupRes) {\n hideFunc = addPopupRes.hideFunc;\n }\n this.popupService.positionPopupUnderMouseEvent({\n type: 'columnContextMenu',\n mouseEvent: this.mouseEvent,\n ePopup: eGui\n });\n };\n ToolPanelContextMenu.prototype.isActive = function () {\n return this.allowGrouping || this.allowValues || this.allowPivoting;\n };\n ToolPanelContextMenu.prototype.getMappedMenuItems = function () {\n var e_1, _a;\n var ret = [];\n var _loop_1 = function (val) {\n var isInactive = this_1.columns.some(function (col) { return val.allowedFunction(col) && !val.activeFunction(col); });\n var isActive = this_1.columns.some(function (col) { return val.allowedFunction(col) && val.activeFunction(col); });\n if (isInactive) {\n ret.push({\n name: val.activateLabel(this_1.displayName),\n icon: _.createIconNoSpan(val.addIcon, this_1.gridOptionsService, null),\n action: function () { return val.activateFunction(); }\n });\n }\n if (isActive) {\n ret.push({\n name: val.deactivateLabel(this_1.displayName),\n icon: _.createIconNoSpan(val.removeIcon, this_1.gridOptionsService, null),\n action: function () { return val.deActivateFunction(); }\n });\n }\n };\n var this_1 = this;\n try {\n for (var _b = __values$P(this.menuItemMap.values()), _c = _b.next(); !_c.done; _c = _b.next()) {\n var val = _c.value;\n _loop_1(val);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_1) throw e_1.error; }\n }\n return ret;\n };\n __decorate$2y([\n Autowired('columnModel')\n ], ToolPanelContextMenu.prototype, \"columnModel\", void 0);\n __decorate$2y([\n Autowired('popupService')\n ], ToolPanelContextMenu.prototype, \"popupService\", void 0);\n __decorate$2y([\n Autowired('focusService')\n ], ToolPanelContextMenu.prototype, \"focusService\", void 0);\n __decorate$2y([\n PostConstruct\n ], ToolPanelContextMenu.prototype, \"postConstruct\", null);\n return ToolPanelContextMenu;\n}(Component));\n\nvar __extends$3m = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$2x = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar ToolPanelColumnGroupComp = /** @class */ (function (_super) {\n __extends$3m(ToolPanelColumnGroupComp, _super);\n function ToolPanelColumnGroupComp(modelItem, allowDragging, eventType, focusWrapper) {\n var _this = _super.call(this) || this;\n _this.modelItem = modelItem;\n _this.allowDragging = allowDragging;\n _this.eventType = eventType;\n _this.focusWrapper = focusWrapper;\n _this.processingColumnStateChange = false;\n _this.modelItem = modelItem;\n _this.columnGroup = modelItem.getColumnGroup();\n _this.columnDept = modelItem.getDept();\n _this.displayName = modelItem.getDisplayName();\n _this.allowDragging = allowDragging;\n return _this;\n }\n ToolPanelColumnGroupComp.prototype.init = function () {\n var _this = this;\n this.setTemplate(ToolPanelColumnGroupComp.TEMPLATE);\n this.eDragHandle = _.createIconNoSpan('columnDrag', this.gridOptionsService);\n this.eDragHandle.classList.add('ag-drag-handle', 'ag-column-select-column-group-drag-handle');\n var checkboxGui = this.cbSelect.getGui();\n var checkboxInput = this.cbSelect.getInputElement();\n checkboxGui.insertAdjacentElement('afterend', this.eDragHandle);\n checkboxInput.setAttribute('tabindex', '-1');\n if (_.missing(this.displayName)) {\n this.displayName = '>>';\n }\n this.eLabel.innerHTML = this.displayName ? this.displayName : '';\n this.setupExpandContract();\n this.addCssClass('ag-column-select-indent-' + this.columnDept);\n this.addManagedListener(this.eventService, Events.EVENT_COLUMN_PIVOT_MODE_CHANGED, this.onColumnStateChanged.bind(this));\n this.addManagedListener(this.eLabel, 'click', this.onLabelClicked.bind(this));\n this.addManagedListener(this.cbSelect, AgCheckbox.EVENT_CHANGED, this.onCheckboxChanged.bind(this));\n this.addManagedListener(this.modelItem, ColumnModelItem.EVENT_EXPANDED_CHANGED, this.onExpandChanged.bind(this));\n this.addManagedListener(this.focusWrapper, 'keydown', this.handleKeyDown.bind(this));\n this.addManagedListener(this.focusWrapper, 'contextmenu', this.onContextMenu.bind(this));\n this.setOpenClosedIcons();\n this.setupDragging();\n this.onColumnStateChanged();\n this.addVisibilityListenersToAllChildren();\n this.refreshAriaExpanded();\n this.refreshAriaLabel();\n this.setupTooltip();\n var classes = CssClassApplier.getToolPanelClassesFromColDef(this.columnGroup.getColGroupDef(), this.gridOptionsService, null, this.columnGroup);\n classes.forEach(function (c) { return _this.addOrRemoveCssClass(c, true); });\n };\n ToolPanelColumnGroupComp.prototype.getColumns = function () {\n return this.columnGroup.getLeafColumns();\n };\n ToolPanelColumnGroupComp.prototype.setupTooltip = function () {\n var _this = this;\n var colGroupDef = this.columnGroup.getColGroupDef();\n if (!colGroupDef) {\n return;\n }\n var refresh = function () {\n var newTooltipText = colGroupDef.headerTooltip;\n _this.setTooltip(newTooltipText);\n };\n refresh();\n this.addManagedListener(this.eventService, Events.EVENT_NEW_COLUMNS_LOADED, refresh);\n };\n ToolPanelColumnGroupComp.prototype.getTooltipParams = function () {\n var res = _super.prototype.getTooltipParams.call(this);\n res.location = 'columnToolPanelColumnGroup';\n return res;\n };\n ToolPanelColumnGroupComp.prototype.handleKeyDown = function (e) {\n switch (e.key) {\n case KeyCode.LEFT:\n e.preventDefault();\n this.modelItem.setExpanded(false);\n break;\n case KeyCode.RIGHT:\n e.preventDefault();\n this.modelItem.setExpanded(true);\n break;\n case KeyCode.SPACE:\n e.preventDefault();\n if (this.isSelectable()) {\n this.onSelectAllChanged(!this.isSelected());\n }\n break;\n }\n };\n ToolPanelColumnGroupComp.prototype.onContextMenu = function (e) {\n var _this = this;\n var _a = this, columnGroup = _a.columnGroup, gridOptionsService = _a.gridOptionsService;\n if (gridOptionsService.is('functionsReadOnly')) {\n return;\n }\n var contextMenu = this.createBean(new ToolPanelContextMenu(columnGroup, e, this.focusWrapper));\n this.addDestroyFunc(function () {\n if (contextMenu.isAlive()) {\n _this.destroyBean(contextMenu);\n }\n });\n };\n ToolPanelColumnGroupComp.prototype.addVisibilityListenersToAllChildren = function () {\n var _this = this;\n this.columnGroup.getLeafColumns().forEach(function (column) {\n _this.addManagedListener(column, Column.EVENT_VISIBLE_CHANGED, _this.onColumnStateChanged.bind(_this));\n _this.addManagedListener(column, Column.EVENT_VALUE_CHANGED, _this.onColumnStateChanged.bind(_this));\n _this.addManagedListener(column, Column.EVENT_PIVOT_CHANGED, _this.onColumnStateChanged.bind(_this));\n _this.addManagedListener(column, Column.EVENT_ROW_GROUP_CHANGED, _this.onColumnStateChanged.bind(_this));\n });\n };\n ToolPanelColumnGroupComp.prototype.setupDragging = function () {\n var _this = this;\n if (!this.allowDragging) {\n _.setDisplayed(this.eDragHandle, false);\n return;\n }\n var hideColumnOnExit = !this.gridOptionsService.is('suppressDragLeaveHidesColumns');\n var dragSource = {\n type: DragSourceType.ToolPanel,\n eElement: this.eDragHandle,\n dragItemName: this.displayName,\n defaultIconName: hideColumnOnExit ? DragAndDropService.ICON_HIDE : DragAndDropService.ICON_NOT_ALLOWED,\n getDragItem: function () { return _this.createDragItem(); },\n onDragStarted: function () {\n var event = {\n type: Events.EVENT_COLUMN_PANEL_ITEM_DRAG_START,\n column: _this.columnGroup\n };\n _this.eventService.dispatchEvent(event);\n },\n onDragStopped: function () {\n var event = {\n type: Events.EVENT_COLUMN_PANEL_ITEM_DRAG_END\n };\n _this.eventService.dispatchEvent(event);\n },\n onGridEnter: function (dragItem) {\n if (hideColumnOnExit) {\n // when dragged into the grid, restore the state that was active pre-drag\n _this.modelItemUtils.updateColumns({\n columns: _this.columnGroup.getLeafColumns(),\n visibleState: dragItem === null || dragItem === void 0 ? void 0 : dragItem.visibleState,\n pivotState: dragItem === null || dragItem === void 0 ? void 0 : dragItem.pivotState,\n eventType: _this.eventType\n });\n }\n },\n onGridExit: function () {\n if (hideColumnOnExit) {\n // when dragged outside of the grid, mimic what happens when checkbox is disabled\n // this handles the behaviour for pivot which is different to just hiding a column.\n _this.onChangeCommon(false);\n }\n }\n };\n this.dragAndDropService.addDragSource(dragSource, true);\n this.addDestroyFunc(function () { return _this.dragAndDropService.removeDragSource(dragSource); });\n };\n ToolPanelColumnGroupComp.prototype.createDragItem = function () {\n var _this = this;\n var columns = this.columnGroup.getLeafColumns();\n var visibleState = {};\n var pivotState = {};\n columns.forEach(function (col) {\n var colId = col.getId();\n visibleState[colId] = col.isVisible();\n pivotState[colId] = _this.modelItemUtils.createPivotState(col);\n });\n return {\n columns: columns,\n visibleState: visibleState,\n pivotState: pivotState\n };\n };\n ToolPanelColumnGroupComp.prototype.setupExpandContract = function () {\n this.eGroupClosedIcon.appendChild(_.createIcon('columnSelectClosed', this.gridOptionsService, null));\n this.eGroupOpenedIcon.appendChild(_.createIcon('columnSelectOpen', this.gridOptionsService, null));\n this.addManagedListener(this.eGroupClosedIcon, 'click', this.onExpandOrContractClicked.bind(this));\n this.addManagedListener(this.eGroupOpenedIcon, 'click', this.onExpandOrContractClicked.bind(this));\n var touchListener = new TouchListener(this.eColumnGroupIcons, true);\n this.addManagedListener(touchListener, TouchListener.EVENT_TAP, this.onExpandOrContractClicked.bind(this));\n this.addDestroyFunc(touchListener.destroy.bind(touchListener));\n };\n ToolPanelColumnGroupComp.prototype.onLabelClicked = function () {\n var nextState = !this.cbSelect.getValue();\n this.onChangeCommon(nextState);\n };\n ToolPanelColumnGroupComp.prototype.onCheckboxChanged = function (event) {\n this.onChangeCommon(event.selected);\n };\n ToolPanelColumnGroupComp.prototype.getVisibleLeafColumns = function () {\n var childColumns = [];\n var extractCols = function (children) {\n children.forEach(function (child) {\n if (!child.isPassesFilter()) {\n return;\n }\n if (child.isGroup()) {\n extractCols(child.getChildren());\n }\n else {\n childColumns.push(child.getColumn());\n }\n });\n };\n extractCols(this.modelItem.getChildren());\n return childColumns;\n };\n ToolPanelColumnGroupComp.prototype.onChangeCommon = function (nextState) {\n this.refreshAriaLabel();\n if (this.processingColumnStateChange) {\n return;\n }\n this.modelItemUtils.selectAllChildren(this.modelItem.getChildren(), nextState, this.eventType);\n };\n ToolPanelColumnGroupComp.prototype.refreshAriaLabel = function () {\n var translate = this.localeService.getLocaleTextFunc();\n var columnLabel = translate('ariaColumnGroup', 'Column Group');\n var checkboxValue = this.cbSelect.getValue();\n var state = checkboxValue === undefined ?\n translate('ariaIndeterminate', 'indeterminate') :\n (checkboxValue ? translate('ariaVisible', 'visible') : translate('ariaHidden', 'hidden'));\n var visibilityLabel = translate('ariaToggleVisibility', 'Press SPACE to toggle visibility');\n _.setAriaLabel(this.focusWrapper, this.displayName + \" \" + columnLabel);\n this.cbSelect.setInputAriaLabel(visibilityLabel + \" (\" + state + \")\");\n _.setAriaDescribedBy(this.focusWrapper, this.cbSelect.getInputElement().id);\n };\n ToolPanelColumnGroupComp.prototype.onColumnStateChanged = function () {\n var selectedValue = this.workOutSelectedValue();\n var readOnlyValue = this.workOutReadOnlyValue();\n this.processingColumnStateChange = true;\n this.cbSelect.setValue(selectedValue);\n this.cbSelect.setReadOnly(readOnlyValue);\n this.addOrRemoveCssClass('ag-column-select-column-group-readonly', readOnlyValue);\n this.processingColumnStateChange = false;\n };\n ToolPanelColumnGroupComp.prototype.workOutSelectedValue = function () {\n var _this = this;\n var pivotMode = this.columnModel.isPivotMode();\n var visibleLeafColumns = this.getVisibleLeafColumns();\n var checkedCount = 0;\n var uncheckedCount = 0;\n visibleLeafColumns.forEach(function (column) {\n if (!pivotMode && column.getColDef().lockVisible) {\n return;\n }\n if (_this.isColumnChecked(column, pivotMode)) {\n checkedCount++;\n }\n else {\n uncheckedCount++;\n }\n });\n if (checkedCount > 0 && uncheckedCount > 0) {\n return undefined;\n }\n return checkedCount > 0;\n };\n ToolPanelColumnGroupComp.prototype.workOutReadOnlyValue = function () {\n var pivotMode = this.columnModel.isPivotMode();\n var colsThatCanAction = 0;\n this.columnGroup.getLeafColumns().forEach(function (col) {\n if (pivotMode) {\n if (col.isAnyFunctionAllowed()) {\n colsThatCanAction++;\n }\n }\n else {\n if (!col.getColDef().lockVisible) {\n colsThatCanAction++;\n }\n }\n });\n return colsThatCanAction === 0;\n };\n ToolPanelColumnGroupComp.prototype.isColumnChecked = function (column, pivotMode) {\n if (pivotMode) {\n var pivoted = column.isPivotActive();\n var grouped = column.isRowGroupActive();\n var aggregated = column.isValueActive();\n return pivoted || grouped || aggregated;\n }\n return column.isVisible();\n };\n ToolPanelColumnGroupComp.prototype.onExpandOrContractClicked = function () {\n var oldState = this.modelItem.isExpanded();\n this.modelItem.setExpanded(!oldState);\n };\n ToolPanelColumnGroupComp.prototype.onExpandChanged = function () {\n this.setOpenClosedIcons();\n this.refreshAriaExpanded();\n };\n ToolPanelColumnGroupComp.prototype.setOpenClosedIcons = function () {\n var folderOpen = this.modelItem.isExpanded();\n _.setDisplayed(this.eGroupClosedIcon, !folderOpen);\n _.setDisplayed(this.eGroupOpenedIcon, folderOpen);\n };\n ToolPanelColumnGroupComp.prototype.refreshAriaExpanded = function () {\n _.setAriaExpanded(this.focusWrapper, this.modelItem.isExpanded());\n };\n ToolPanelColumnGroupComp.prototype.getDisplayName = function () {\n return this.displayName;\n };\n ToolPanelColumnGroupComp.prototype.onSelectAllChanged = function (value) {\n var cbValue = this.cbSelect.getValue();\n var readOnly = this.cbSelect.isReadOnly();\n if (!readOnly && ((value && !cbValue) || (!value && cbValue))) {\n this.cbSelect.toggle();\n }\n };\n ToolPanelColumnGroupComp.prototype.isSelected = function () {\n return this.cbSelect.getValue();\n };\n ToolPanelColumnGroupComp.prototype.isSelectable = function () {\n return !this.cbSelect.isReadOnly();\n };\n ToolPanelColumnGroupComp.prototype.setSelected = function (selected) {\n this.cbSelect.setValue(selected, true);\n };\n ToolPanelColumnGroupComp.TEMPLATE = \"
\\n \\n \\n \\n \\n \\n \\n
\";\n __decorate$2x([\n Autowired('columnModel')\n ], ToolPanelColumnGroupComp.prototype, \"columnModel\", void 0);\n __decorate$2x([\n Autowired('dragAndDropService')\n ], ToolPanelColumnGroupComp.prototype, \"dragAndDropService\", void 0);\n __decorate$2x([\n Autowired('modelItemUtils')\n ], ToolPanelColumnGroupComp.prototype, \"modelItemUtils\", void 0);\n __decorate$2x([\n RefSelector('cbSelect')\n ], ToolPanelColumnGroupComp.prototype, \"cbSelect\", void 0);\n __decorate$2x([\n RefSelector('eLabel')\n ], ToolPanelColumnGroupComp.prototype, \"eLabel\", void 0);\n __decorate$2x([\n RefSelector('eGroupOpenedIcon')\n ], ToolPanelColumnGroupComp.prototype, \"eGroupOpenedIcon\", void 0);\n __decorate$2x([\n RefSelector('eGroupClosedIcon')\n ], ToolPanelColumnGroupComp.prototype, \"eGroupClosedIcon\", void 0);\n __decorate$2x([\n RefSelector('eColumnGroupIcons')\n ], ToolPanelColumnGroupComp.prototype, \"eColumnGroupIcons\", void 0);\n __decorate$2x([\n PostConstruct\n ], ToolPanelColumnGroupComp.prototype, \"init\", null);\n return ToolPanelColumnGroupComp;\n}(Component));\n\nvar __extends$3l = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$2w = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar PRIMARY_COLS_LIST_ITEM_HOVERED = 'ag-list-item-hovered';\nvar PrimaryColsListPanelItemDragFeature = /** @class */ (function (_super) {\n __extends$3l(PrimaryColsListPanelItemDragFeature, _super);\n function PrimaryColsListPanelItemDragFeature(comp, virtualList) {\n var _this = _super.call(this) || this;\n _this.comp = comp;\n _this.virtualList = virtualList;\n _this.currentDragColumn = null;\n _this.lastHoveredColumnItem = null;\n return _this;\n }\n PrimaryColsListPanelItemDragFeature.prototype.postConstruct = function () {\n this.addManagedListener(this.eventService, Events.EVENT_COLUMN_PANEL_ITEM_DRAG_START, this.columnPanelItemDragStart.bind(this));\n this.addManagedListener(this.eventService, Events.EVENT_COLUMN_PANEL_ITEM_DRAG_END, this.columnPanelItemDragEnd.bind(this));\n this.createDropTarget();\n this.createAutoScrollService();\n };\n PrimaryColsListPanelItemDragFeature.prototype.columnPanelItemDragStart = function (_a) {\n var column = _a.column;\n this.currentDragColumn = column;\n var currentColumns = this.getCurrentColumns();\n var hasNotMovable = currentColumns.find(function (col) {\n var colDef = col.getColDef();\n return !!colDef.suppressMovable || !!colDef.lockPosition;\n });\n if (hasNotMovable) {\n this.moveBlocked = true;\n }\n };\n PrimaryColsListPanelItemDragFeature.prototype.columnPanelItemDragEnd = function () {\n var _this = this;\n window.setTimeout(function () {\n _this.currentDragColumn = null;\n _this.moveBlocked = false;\n }, 10);\n };\n PrimaryColsListPanelItemDragFeature.prototype.createDropTarget = function () {\n var _this = this;\n var dropTarget = {\n isInterestedIn: function (type) { return type === DragSourceType.ToolPanel; },\n getIconName: function () { return DragAndDropService[_this.moveBlocked ? 'ICON_NOT_ALLOWED' : 'ICON_MOVE']; },\n getContainer: function () { return _this.comp.getGui(); },\n onDragging: function (e) { return _this.onDragging(e); },\n onDragStop: function () { return _this.onDragStop(); },\n onDragLeave: function () { return _this.onDragLeave(); }\n };\n this.dragAndDropService.addDropTarget(dropTarget);\n };\n PrimaryColsListPanelItemDragFeature.prototype.createAutoScrollService = function () {\n var virtualListGui = this.virtualList.getGui();\n this.autoScrollService = new AutoScrollService({\n scrollContainer: virtualListGui,\n scrollAxis: 'y',\n getVerticalPosition: function () { return virtualListGui.scrollTop; },\n setVerticalPosition: function (position) { return virtualListGui.scrollTop = position; }\n });\n };\n PrimaryColsListPanelItemDragFeature.prototype.onDragging = function (e) {\n if (!this.currentDragColumn || this.moveBlocked) {\n return;\n }\n var hoveredColumnItem = this.getDragColumnItem(e);\n var comp = this.virtualList.getComponentAt(hoveredColumnItem.rowIndex);\n if (!comp) {\n return;\n }\n var el = comp.getGui().parentElement;\n if (this.lastHoveredColumnItem &&\n this.lastHoveredColumnItem.rowIndex === hoveredColumnItem.rowIndex &&\n this.lastHoveredColumnItem.position === hoveredColumnItem.position) {\n return;\n }\n this.autoScrollService.check(e.event);\n this.clearHoveredItems();\n this.lastHoveredColumnItem = hoveredColumnItem;\n _.radioCssClass(el, \"\" + PRIMARY_COLS_LIST_ITEM_HOVERED);\n _.radioCssClass(el, \"ag-item-highlight-\" + hoveredColumnItem.position);\n };\n PrimaryColsListPanelItemDragFeature.prototype.getDragColumnItem = function (e) {\n var virtualListGui = this.virtualList.getGui();\n var paddingTop = parseFloat(window.getComputedStyle(virtualListGui).paddingTop);\n var rowHeight = this.virtualList.getRowHeight();\n var scrollTop = this.virtualList.getScrollTop();\n var rowIndex = Math.max(0, (e.y - paddingTop + scrollTop) / rowHeight);\n var maxLen = this.comp.getDisplayedColsList().length - 1;\n var normalizedRowIndex = Math.min(maxLen, rowIndex) | 0;\n return {\n rowIndex: normalizedRowIndex,\n position: (Math.round(rowIndex) > rowIndex || rowIndex > maxLen) ? 'bottom' : 'top',\n component: this.virtualList.getComponentAt(normalizedRowIndex)\n };\n };\n PrimaryColsListPanelItemDragFeature.prototype.onDragStop = function () {\n if (this.moveBlocked) {\n return;\n }\n var targetIndex = this.getTargetIndex();\n var columnsToMove = this.getCurrentColumns();\n if (targetIndex != null) {\n this.columnModel.moveColumns(columnsToMove, targetIndex, 'toolPanelUi');\n }\n this.clearHoveredItems();\n this.autoScrollService.ensureCleared();\n };\n PrimaryColsListPanelItemDragFeature.prototype.getMoveDiff = function (end) {\n var allColumns = this.columnModel.getAllGridColumns();\n var currentColumns = this.getCurrentColumns();\n var currentColumn = currentColumns[0];\n var span = currentColumns.length;\n var currentIndex = allColumns.indexOf(currentColumn);\n if (currentIndex < end) {\n return span;\n }\n return 0;\n };\n PrimaryColsListPanelItemDragFeature.prototype.getCurrentColumns = function () {\n if (this.currentDragColumn instanceof ProvidedColumnGroup) {\n return this.currentDragColumn.getLeafColumns();\n }\n return [this.currentDragColumn];\n };\n PrimaryColsListPanelItemDragFeature.prototype.getTargetIndex = function () {\n if (!this.lastHoveredColumnItem) {\n return null;\n }\n var columnItemComponent = this.lastHoveredColumnItem.component;\n var isBefore = this.lastHoveredColumnItem.position === 'top';\n var targetColumn;\n if (columnItemComponent instanceof ToolPanelColumnGroupComp) {\n var columns = columnItemComponent.getColumns();\n targetColumn = columns[0];\n isBefore = true;\n }\n else {\n targetColumn = columnItemComponent.getColumn();\n }\n var targetColumnIndex = this.columnModel.getAllGridColumns().indexOf(targetColumn);\n var adjustedTarget = isBefore ? targetColumnIndex : targetColumnIndex + 1;\n var diff = this.getMoveDiff(adjustedTarget);\n return adjustedTarget - diff;\n };\n PrimaryColsListPanelItemDragFeature.prototype.onDragLeave = function () {\n this.clearHoveredItems();\n this.autoScrollService.ensureCleared();\n };\n PrimaryColsListPanelItemDragFeature.prototype.clearHoveredItems = function () {\n var virtualListGui = this.virtualList.getGui();\n virtualListGui.querySelectorAll(\".\" + PRIMARY_COLS_LIST_ITEM_HOVERED).forEach(function (el) {\n [\n PRIMARY_COLS_LIST_ITEM_HOVERED,\n 'ag-item-highlight-top',\n 'ag-item-highlight-bottom'\n ].forEach(function (cls) {\n el.classList.remove(cls);\n });\n });\n this.lastHoveredColumnItem = null;\n };\n __decorate$2w([\n Autowired('columnModel')\n ], PrimaryColsListPanelItemDragFeature.prototype, \"columnModel\", void 0);\n __decorate$2w([\n Autowired('dragAndDropService')\n ], PrimaryColsListPanelItemDragFeature.prototype, \"dragAndDropService\", void 0);\n __decorate$2w([\n PostConstruct\n ], PrimaryColsListPanelItemDragFeature.prototype, \"postConstruct\", null);\n return PrimaryColsListPanelItemDragFeature;\n}(BeanStub));\n\nvar __extends$3k = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$2v = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar ToolPanelColumnComp = /** @class */ (function (_super) {\n __extends$3k(ToolPanelColumnComp, _super);\n function ToolPanelColumnComp(modelItem, allowDragging, groupsExist, focusWrapper) {\n var _this = _super.call(this) || this;\n _this.allowDragging = allowDragging;\n _this.groupsExist = groupsExist;\n _this.focusWrapper = focusWrapper;\n _this.processingColumnStateChange = false;\n _this.column = modelItem.getColumn();\n _this.columnDept = modelItem.getDept();\n _this.displayName = modelItem.getDisplayName();\n return _this;\n }\n ToolPanelColumnComp.prototype.init = function () {\n var _this = this;\n this.setTemplate(ToolPanelColumnComp.TEMPLATE);\n this.eDragHandle = _.createIconNoSpan('columnDrag', this.gridOptionsService);\n this.eDragHandle.classList.add('ag-drag-handle', 'ag-column-select-column-drag-handle');\n var checkboxGui = this.cbSelect.getGui();\n var checkboxInput = this.cbSelect.getInputElement();\n checkboxGui.insertAdjacentElement('afterend', this.eDragHandle);\n checkboxInput.setAttribute('tabindex', '-1');\n var displayNameSanitised = _.escapeString(this.displayName);\n this.eLabel.innerHTML = displayNameSanitised;\n // if grouping, we add an extra level of indent, to cater for expand/contract icons we need to indent for\n var indent = this.columnDept;\n if (this.groupsExist) {\n this.addCssClass('ag-column-select-add-group-indent');\n }\n this.addCssClass(\"ag-column-select-indent-\" + indent);\n this.setupDragging();\n this.addManagedListener(this.eventService, Events.EVENT_COLUMN_PIVOT_MODE_CHANGED, this.onColumnStateChanged.bind(this));\n this.addManagedListener(this.column, Column.EVENT_VALUE_CHANGED, this.onColumnStateChanged.bind(this));\n this.addManagedListener(this.column, Column.EVENT_PIVOT_CHANGED, this.onColumnStateChanged.bind(this));\n this.addManagedListener(this.column, Column.EVENT_ROW_GROUP_CHANGED, this.onColumnStateChanged.bind(this));\n this.addManagedListener(this.column, Column.EVENT_VISIBLE_CHANGED, this.onColumnStateChanged.bind(this));\n this.addManagedListener(this.focusWrapper, 'keydown', this.handleKeyDown.bind(this));\n this.addManagedListener(this.focusWrapper, 'contextmenu', this.onContextMenu.bind(this));\n this.addManagedPropertyListener('functionsReadOnly', this.onColumnStateChanged.bind(this));\n this.addManagedListener(this.cbSelect, AgCheckbox.EVENT_CHANGED, this.onCheckboxChanged.bind(this));\n this.addManagedListener(this.eLabel, 'click', this.onLabelClicked.bind(this));\n this.onColumnStateChanged();\n this.refreshAriaLabel();\n this.setupTooltip();\n var classes = CssClassApplier.getToolPanelClassesFromColDef(this.column.getColDef(), this.gridOptionsService, this.column, null);\n classes.forEach(function (c) { return _this.addOrRemoveCssClass(c, true); });\n };\n ToolPanelColumnComp.prototype.getColumn = function () {\n return this.column;\n };\n ToolPanelColumnComp.prototype.setupTooltip = function () {\n var _this = this;\n var refresh = function () {\n var newTooltipText = _this.column.getColDef().headerTooltip;\n _this.setTooltip(newTooltipText);\n };\n refresh();\n this.addManagedListener(this.eventService, Events.EVENT_NEW_COLUMNS_LOADED, refresh);\n };\n ToolPanelColumnComp.prototype.getTooltipParams = function () {\n var res = _super.prototype.getTooltipParams.call(this);\n res.location = 'columnToolPanelColumn';\n res.colDef = this.column.getColDef();\n return res;\n };\n ToolPanelColumnComp.prototype.onContextMenu = function (e) {\n var _this = this;\n var _a = this, column = _a.column, gridOptionsService = _a.gridOptionsService;\n if (gridOptionsService.is('functionsReadOnly')) {\n return;\n }\n var contextMenu = this.createBean(new ToolPanelContextMenu(column, e, this.focusWrapper));\n this.addDestroyFunc(function () {\n if (contextMenu.isAlive()) {\n _this.destroyBean(contextMenu);\n }\n });\n };\n ToolPanelColumnComp.prototype.handleKeyDown = function (e) {\n if (e.key === KeyCode.SPACE) {\n e.preventDefault();\n if (this.isSelectable()) {\n this.onSelectAllChanged(!this.isSelected());\n }\n }\n };\n ToolPanelColumnComp.prototype.onLabelClicked = function () {\n if (this.gridOptionsService.is('functionsReadOnly')) {\n return;\n }\n var nextState = !this.cbSelect.getValue();\n this.onChangeCommon(nextState);\n };\n ToolPanelColumnComp.prototype.onCheckboxChanged = function (event) {\n this.onChangeCommon(event.selected);\n };\n ToolPanelColumnComp.prototype.onChangeCommon = function (nextState) {\n // ignore lock visible columns\n if (this.cbSelect.isReadOnly()) {\n return;\n }\n this.refreshAriaLabel();\n // only want to action if the user clicked the checkbox, not if we are setting the checkbox because\n // of a change in the model\n if (this.processingColumnStateChange) {\n return;\n }\n this.modelItemUtils.setColumn(this.column, nextState, 'toolPanelUi');\n };\n ToolPanelColumnComp.prototype.refreshAriaLabel = function () {\n var translate = this.localeService.getLocaleTextFunc();\n var columnLabel = translate('ariaColumn', 'Column');\n var state = this.cbSelect.getValue() ? translate('ariaVisible', 'visible') : translate('ariaHidden', 'hidden');\n var visibilityLabel = translate('ariaToggleVisibility', 'Press SPACE to toggle visibility');\n _.setAriaLabel(this.focusWrapper, this.displayName + \" \" + columnLabel);\n this.cbSelect.setInputAriaLabel(visibilityLabel + \" (\" + state + \")\");\n _.setAriaDescribedBy(this.focusWrapper, this.cbSelect.getInputElement().id);\n };\n ToolPanelColumnComp.prototype.setupDragging = function () {\n var _this = this;\n if (!this.allowDragging) {\n _.setDisplayed(this.eDragHandle, false);\n return;\n }\n var hideColumnOnExit = !this.gridOptionsService.is('suppressDragLeaveHidesColumns');\n var dragSource = {\n type: DragSourceType.ToolPanel,\n eElement: this.eDragHandle,\n dragItemName: this.displayName,\n defaultIconName: hideColumnOnExit ? DragAndDropService.ICON_HIDE : DragAndDropService.ICON_NOT_ALLOWED,\n getDragItem: function () { return _this.createDragItem(); },\n onDragStarted: function () {\n var event = {\n type: Events.EVENT_COLUMN_PANEL_ITEM_DRAG_START,\n column: _this.column\n };\n _this.eventService.dispatchEvent(event);\n },\n onDragStopped: function () {\n var event = {\n type: Events.EVENT_COLUMN_PANEL_ITEM_DRAG_END\n };\n _this.eventService.dispatchEvent(event);\n },\n onGridEnter: function (dragItem) {\n if (hideColumnOnExit) {\n // when dragged into the grid, restore the state that was active pre-drag\n _this.modelItemUtils.updateColumns({\n columns: [_this.column],\n visibleState: dragItem === null || dragItem === void 0 ? void 0 : dragItem.visibleState,\n pivotState: dragItem === null || dragItem === void 0 ? void 0 : dragItem.pivotState,\n eventType: 'toolPanelUi'\n });\n }\n },\n onGridExit: function () {\n if (hideColumnOnExit) {\n // when dragged outside of the grid, mimic what happens when checkbox is disabled\n // this handles the behaviour for pivot which is different to just hiding a column.\n _this.onChangeCommon(false);\n }\n }\n };\n this.dragAndDropService.addDragSource(dragSource, true);\n this.addDestroyFunc(function () { return _this.dragAndDropService.removeDragSource(dragSource); });\n };\n ToolPanelColumnComp.prototype.createDragItem = function () {\n var _a, _b;\n var colId = this.column.getColId();\n var visibleState = (_a = {}, _a[colId] = this.column.isVisible(), _a);\n var pivotState = (_b = {}, _b[colId] = this.modelItemUtils.createPivotState(this.column), _b);\n return {\n columns: [this.column],\n visibleState: visibleState,\n pivotState: pivotState\n };\n };\n ToolPanelColumnComp.prototype.onColumnStateChanged = function () {\n this.processingColumnStateChange = true;\n var isPivotMode = this.columnModel.isPivotMode();\n if (isPivotMode) {\n // if reducing, checkbox means column is one of pivot, value or group\n var anyFunctionActive = this.column.isAnyFunctionActive();\n this.cbSelect.setValue(anyFunctionActive);\n }\n else {\n // if not reducing, the checkbox tells us if column is visible or not\n this.cbSelect.setValue(this.column.isVisible());\n }\n var canBeToggled = true;\n var canBeDragged = true;\n if (isPivotMode) {\n // when in pivot mode, the item should be read only if:\n // a) gui is not allowed make any changes\n var functionsReadOnly = this.gridOptionsService.is('functionsReadOnly');\n // b) column is not allow any functions on it\n var noFunctionsAllowed = !this.column.isAnyFunctionAllowed();\n canBeToggled = !functionsReadOnly && !noFunctionsAllowed;\n canBeDragged = canBeToggled;\n }\n else {\n var _a = this.column.getColDef(), enableRowGroup = _a.enableRowGroup, enableValue = _a.enableValue, lockPosition = _a.lockPosition, suppressMovable = _a.suppressMovable, lockVisible = _a.lockVisible;\n var forceDraggable = !!enableRowGroup || !!enableValue;\n var disableDraggable = !!lockPosition || !!suppressMovable;\n canBeToggled = !lockVisible;\n canBeDragged = forceDraggable || !disableDraggable;\n }\n this.cbSelect.setReadOnly(!canBeToggled);\n this.eDragHandle.classList.toggle('ag-column-select-column-readonly', !canBeDragged);\n this.addOrRemoveCssClass('ag-column-select-column-readonly', !canBeDragged && !canBeToggled);\n var checkboxPassive = isPivotMode && this.gridOptionsService.is('functionsPassive');\n this.cbSelect.setPassive(checkboxPassive);\n this.processingColumnStateChange = false;\n };\n ToolPanelColumnComp.prototype.getDisplayName = function () {\n return this.displayName;\n };\n ToolPanelColumnComp.prototype.onSelectAllChanged = function (value) {\n if (value !== this.cbSelect.getValue()) {\n if (!this.cbSelect.isReadOnly()) {\n this.cbSelect.toggle();\n }\n }\n };\n ToolPanelColumnComp.prototype.isSelected = function () {\n return this.cbSelect.getValue();\n };\n ToolPanelColumnComp.prototype.isSelectable = function () {\n return !this.cbSelect.isReadOnly();\n };\n ToolPanelColumnComp.prototype.isExpandable = function () {\n return false;\n };\n ToolPanelColumnComp.prototype.setExpanded = function (value) {\n console.warn('AG Grid: can not expand a column item that does not represent a column group header');\n };\n ToolPanelColumnComp.TEMPLATE = \"
\\n \\n \\n
\";\n __decorate$2v([\n Autowired('columnModel')\n ], ToolPanelColumnComp.prototype, \"columnModel\", void 0);\n __decorate$2v([\n Autowired('dragAndDropService')\n ], ToolPanelColumnComp.prototype, \"dragAndDropService\", void 0);\n __decorate$2v([\n Autowired('modelItemUtils')\n ], ToolPanelColumnComp.prototype, \"modelItemUtils\", void 0);\n __decorate$2v([\n RefSelector('eLabel')\n ], ToolPanelColumnComp.prototype, \"eLabel\", void 0);\n __decorate$2v([\n RefSelector('cbSelect')\n ], ToolPanelColumnComp.prototype, \"cbSelect\", void 0);\n __decorate$2v([\n PostConstruct\n ], ToolPanelColumnComp.prototype, \"init\", null);\n return ToolPanelColumnComp;\n}(Component));\n\nvar __extends$3j = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$2u = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar UIColumnModel = /** @class */ (function () {\n function UIColumnModel(items) {\n this.items = items;\n }\n UIColumnModel.prototype.getRowCount = function () {\n return this.items.length;\n };\n UIColumnModel.prototype.getRow = function (index) {\n return this.items[index];\n };\n return UIColumnModel;\n}());\nvar PRIMARY_COLS_LIST_PANEL_CLASS = 'ag-column-select-list';\nvar PrimaryColsListPanel = /** @class */ (function (_super) {\n __extends$3j(PrimaryColsListPanel, _super);\n function PrimaryColsListPanel() {\n var _this = _super.call(this, PrimaryColsListPanel.TEMPLATE) || this;\n _this.destroyColumnItemFuncs = [];\n return _this;\n }\n PrimaryColsListPanel.prototype.destroyColumnTree = function () {\n this.allColsTree = [];\n this.destroyColumnItemFuncs.forEach(function (f) { return f(); });\n this.destroyColumnItemFuncs = [];\n };\n PrimaryColsListPanel.prototype.init = function (params, allowDragging, eventType) {\n var _this = this;\n this.params = params;\n this.allowDragging = allowDragging;\n this.eventType = eventType;\n if (!this.params.suppressSyncLayoutWithGrid) {\n this.addManagedListener(this.eventService, Events.EVENT_COLUMN_MOVED, this.onColumnsChanged.bind(this));\n }\n this.addManagedListener(this.eventService, Events.EVENT_NEW_COLUMNS_LOADED, this.onColumnsChanged.bind(this));\n var eventsImpactingCheckedState = [\n Events.EVENT_COLUMN_PIVOT_CHANGED,\n Events.EVENT_COLUMN_PIVOT_MODE_CHANGED,\n Events.EVENT_COLUMN_ROW_GROUP_CHANGED,\n Events.EVENT_COLUMN_VALUE_CHANGED,\n Events.EVENT_COLUMN_VISIBLE,\n Events.EVENT_NEW_COLUMNS_LOADED\n ];\n eventsImpactingCheckedState.forEach(function (event) {\n // update header select all checkbox with current selection state\n _this.addManagedListener(_this.eventService, event, _this.fireSelectionChangedEvent.bind(_this));\n });\n this.expandGroupsByDefault = !this.params.contractColumnSelection;\n var translate = this.localeService.getLocaleTextFunc();\n var columnListName = translate('ariaColumnList', 'Column List');\n this.virtualList = this.createManagedBean(new VirtualList('column-select', 'tree', columnListName));\n this.appendChild(this.virtualList.getGui());\n this.virtualList.setComponentCreator(function (item, listItemElement) {\n _.setAriaLevel(listItemElement, (item.getDept() + 1));\n return _this.createComponentFromItem(item, listItemElement);\n });\n if (this.columnModel.isReady()) {\n this.onColumnsChanged();\n }\n if (!params.suppressColumnMove && !this.gridOptionsService.is('suppressMovableColumns')) {\n this.createManagedBean(new PrimaryColsListPanelItemDragFeature(this, this.virtualList));\n }\n };\n PrimaryColsListPanel.prototype.createComponentFromItem = function (item, listItemElement) {\n if (item.isGroup()) {\n var renderedGroup = new ToolPanelColumnGroupComp(item, this.allowDragging, this.eventType, listItemElement);\n this.getContext().createBean(renderedGroup);\n return renderedGroup;\n }\n var columnComp = new ToolPanelColumnComp(item, this.allowDragging, this.groupsExist, listItemElement);\n this.getContext().createBean(columnComp);\n return columnComp;\n };\n PrimaryColsListPanel.prototype.onColumnsChanged = function () {\n var expandedStates = this.getExpandedStates();\n var pivotModeActive = this.columnModel.isPivotMode();\n var shouldSyncColumnLayoutWithGrid = !this.params.suppressSyncLayoutWithGrid && !pivotModeActive;\n if (shouldSyncColumnLayoutWithGrid) {\n this.buildTreeFromWhatGridIsDisplaying();\n }\n else {\n this.buildTreeFromProvidedColumnDefs();\n }\n this.setExpandedStates(expandedStates);\n this.markFilteredColumns();\n this.flattenAndFilterModel();\n };\n PrimaryColsListPanel.prototype.getDisplayedColsList = function () {\n return this.displayedColsList;\n };\n PrimaryColsListPanel.prototype.getExpandedStates = function () {\n if (!this.allColsTree) {\n return {};\n }\n var res = {};\n this.forEachItem(function (item) {\n if (!item.isGroup()) {\n return;\n }\n var colGroup = item.getColumnGroup();\n if (colGroup) { // group should always exist, this is defensive\n res[colGroup.getId()] = item.isExpanded();\n }\n });\n return res;\n };\n PrimaryColsListPanel.prototype.setExpandedStates = function (states) {\n if (!this.allColsTree) {\n return;\n }\n this.forEachItem(function (item) {\n if (!item.isGroup()) {\n return;\n }\n var colGroup = item.getColumnGroup();\n if (colGroup) { // group should always exist, this is defensive\n var expanded = states[colGroup.getId()];\n var groupExistedLastTime = expanded != null;\n if (groupExistedLastTime) {\n item.setExpanded(expanded);\n }\n }\n });\n };\n PrimaryColsListPanel.prototype.buildTreeFromWhatGridIsDisplaying = function () {\n this.colDefService.syncLayoutWithGrid(this.setColumnLayout.bind(this));\n };\n PrimaryColsListPanel.prototype.setColumnLayout = function (colDefs) {\n var columnTree = this.colDefService.createColumnTree(colDefs);\n this.buildListModel(columnTree);\n // using col defs to check if groups exist as it could be a custom layout\n this.groupsExist = colDefs.some(function (colDef) {\n return colDef && typeof colDef.children !== 'undefined';\n });\n this.markFilteredColumns();\n this.flattenAndFilterModel();\n };\n PrimaryColsListPanel.prototype.buildTreeFromProvidedColumnDefs = function () {\n // add column / group comps to tool panel\n this.buildListModel(this.columnModel.getPrimaryColumnTree());\n this.groupsExist = this.columnModel.isPrimaryColumnGroupsPresent();\n };\n PrimaryColsListPanel.prototype.buildListModel = function (columnTree) {\n var _this = this;\n var columnExpandedListener = this.onColumnExpanded.bind(this);\n var addListeners = function (item) {\n item.addEventListener(ColumnModelItem.EVENT_EXPANDED_CHANGED, columnExpandedListener);\n var removeFunc = item.removeEventListener.bind(item, ColumnModelItem.EVENT_EXPANDED_CHANGED, columnExpandedListener);\n _this.destroyColumnItemFuncs.push(removeFunc);\n };\n var recursivelyBuild = function (tree, dept, parentList) {\n tree.forEach(function (child) {\n if (child instanceof ProvidedColumnGroup) {\n createGroupItem(child, dept, parentList);\n }\n else {\n createColumnItem(child, dept, parentList);\n }\n });\n };\n var createGroupItem = function (columnGroup, dept, parentList) {\n var columnGroupDef = columnGroup.getColGroupDef();\n var skipThisGroup = columnGroupDef && columnGroupDef.suppressColumnsToolPanel;\n if (skipThisGroup) {\n return;\n }\n if (columnGroup.isPadding()) {\n recursivelyBuild(columnGroup.getChildren(), dept, parentList);\n return;\n }\n var displayName = _this.columnModel.getDisplayNameForProvidedColumnGroup(null, columnGroup, 'columnToolPanel');\n var item = new ColumnModelItem(displayName, columnGroup, dept, true, _this.expandGroupsByDefault);\n parentList.push(item);\n addListeners(item);\n recursivelyBuild(columnGroup.getChildren(), dept + 1, item.getChildren());\n };\n var createColumnItem = function (column, dept, parentList) {\n var skipThisColumn = column.getColDef() && column.getColDef().suppressColumnsToolPanel;\n if (skipThisColumn) {\n return;\n }\n var displayName = _this.columnModel.getDisplayNameForColumn(column, 'columnToolPanel');\n parentList.push(new ColumnModelItem(displayName, column, dept));\n };\n this.destroyColumnTree();\n recursivelyBuild(columnTree, 0, this.allColsTree);\n };\n PrimaryColsListPanel.prototype.onColumnExpanded = function () {\n this.flattenAndFilterModel();\n };\n PrimaryColsListPanel.prototype.flattenAndFilterModel = function () {\n var _this = this;\n this.displayedColsList = [];\n var recursiveFunc = function (item) {\n if (!item.isPassesFilter()) {\n return;\n }\n _this.displayedColsList.push(item);\n if (item.isGroup() && item.isExpanded()) {\n item.getChildren().forEach(recursiveFunc);\n }\n };\n this.allColsTree.forEach(recursiveFunc);\n this.virtualList.setModel(new UIColumnModel(this.displayedColsList));\n var focusedRow = this.virtualList.getLastFocusedRow();\n this.virtualList.refresh();\n if (focusedRow != null) {\n this.focusRowIfAlive(focusedRow);\n }\n this.notifyListeners();\n };\n PrimaryColsListPanel.prototype.focusRowIfAlive = function (rowIndex) {\n var _this = this;\n window.setTimeout(function () {\n if (_this.isAlive()) {\n _this.virtualList.focusRow(rowIndex);\n }\n }, 0);\n };\n PrimaryColsListPanel.prototype.forEachItem = function (callback) {\n var recursiveFunc = function (items) {\n items.forEach(function (item) {\n callback(item);\n if (item.isGroup()) {\n recursiveFunc(item.getChildren());\n }\n });\n };\n recursiveFunc(this.allColsTree);\n };\n PrimaryColsListPanel.prototype.doSetExpandedAll = function (value) {\n this.forEachItem(function (item) {\n if (item.isGroup()) {\n item.setExpanded(value);\n }\n });\n };\n PrimaryColsListPanel.prototype.setGroupsExpanded = function (expand, groupIds) {\n if (!groupIds) {\n this.doSetExpandedAll(expand);\n return;\n }\n var expandedGroupIds = [];\n this.forEachItem(function (item) {\n if (!item.isGroup()) {\n return;\n }\n var groupId = item.getColumnGroup().getId();\n if (groupIds.indexOf(groupId) >= 0) {\n item.setExpanded(expand);\n expandedGroupIds.push(groupId);\n }\n });\n var unrecognisedGroupIds = groupIds.filter(function (groupId) { return !_.includes(expandedGroupIds, groupId); });\n if (unrecognisedGroupIds.length > 0) {\n console.warn('AG Grid: unable to find group(s) for supplied groupIds:', unrecognisedGroupIds);\n }\n };\n PrimaryColsListPanel.prototype.getExpandState = function () {\n var expandedCount = 0;\n var notExpandedCount = 0;\n this.forEachItem(function (item) {\n if (!item.isGroup()) {\n return;\n }\n if (item.isExpanded()) {\n expandedCount++;\n }\n else {\n notExpandedCount++;\n }\n });\n if (expandedCount > 0 && notExpandedCount > 0) {\n return ExpandState.INDETERMINATE;\n }\n if (notExpandedCount > 0) {\n return ExpandState.COLLAPSED;\n }\n return ExpandState.EXPANDED;\n };\n PrimaryColsListPanel.prototype.doSetSelectedAll = function (selectAllChecked) {\n this.modelItemUtils.selectAllChildren(this.allColsTree, selectAllChecked, this.eventType);\n };\n PrimaryColsListPanel.prototype.getSelectionState = function () {\n var checkedCount = 0;\n var uncheckedCount = 0;\n var pivotMode = this.columnModel.isPivotMode();\n this.forEachItem(function (item) {\n if (item.isGroup()) {\n return;\n }\n if (!item.isPassesFilter()) {\n return;\n }\n var column = item.getColumn();\n var colDef = column.getColDef();\n var checked;\n if (pivotMode) {\n var noPivotModeOptionsAllowed = !column.isAllowPivot() && !column.isAllowRowGroup() && !column.isAllowValue();\n if (noPivotModeOptionsAllowed) {\n return;\n }\n checked = column.isValueActive() || column.isPivotActive() || column.isRowGroupActive();\n }\n else {\n if (colDef.lockVisible) {\n return;\n }\n checked = column.isVisible();\n }\n checked ? checkedCount++ : uncheckedCount++;\n });\n if (checkedCount > 0 && uncheckedCount > 0) {\n return undefined;\n }\n return !(checkedCount === 0 || uncheckedCount > 0);\n };\n PrimaryColsListPanel.prototype.setFilterText = function (filterText) {\n this.filterText = _.exists(filterText) ? filterText.toLowerCase() : null;\n this.markFilteredColumns();\n this.flattenAndFilterModel();\n };\n PrimaryColsListPanel.prototype.markFilteredColumns = function () {\n var _this = this;\n var passesFilter = function (item) {\n if (!_.exists(_this.filterText)) {\n return true;\n }\n var displayName = item.getDisplayName();\n return displayName == null || displayName.toLowerCase().indexOf(_this.filterText) !== -1;\n };\n var recursivelyCheckFilter = function (item, parentPasses) {\n var atLeastOneChildPassed = false;\n if (item.isGroup()) {\n var groupPasses_1 = passesFilter(item);\n item.getChildren().forEach(function (child) {\n var childPasses = recursivelyCheckFilter(child, groupPasses_1 || parentPasses);\n if (childPasses) {\n atLeastOneChildPassed = childPasses;\n }\n });\n }\n var filterPasses = (parentPasses || atLeastOneChildPassed) ? true : passesFilter(item);\n item.setPassesFilter(filterPasses);\n return filterPasses;\n };\n this.allColsTree.forEach(function (item) { return recursivelyCheckFilter(item, false); });\n };\n PrimaryColsListPanel.prototype.notifyListeners = function () {\n this.fireGroupExpandedEvent();\n this.fireSelectionChangedEvent();\n };\n PrimaryColsListPanel.prototype.fireGroupExpandedEvent = function () {\n var expandState = this.getExpandState();\n this.dispatchEvent({ type: 'groupExpanded', state: expandState });\n };\n PrimaryColsListPanel.prototype.fireSelectionChangedEvent = function () {\n var selectionState = this.getSelectionState();\n this.dispatchEvent({ type: 'selectionChanged', state: selectionState });\n };\n PrimaryColsListPanel.TEMPLATE = \"
\";\n __decorate$2u([\n Autowired('columnModel')\n ], PrimaryColsListPanel.prototype, \"columnModel\", void 0);\n __decorate$2u([\n Autowired('toolPanelColDefService')\n ], PrimaryColsListPanel.prototype, \"colDefService\", void 0);\n __decorate$2u([\n Autowired('modelItemUtils')\n ], PrimaryColsListPanel.prototype, \"modelItemUtils\", void 0);\n __decorate$2u([\n PreDestroy\n ], PrimaryColsListPanel.prototype, \"destroyColumnTree\", null);\n return PrimaryColsListPanel;\n}(Component));\n\nvar __extends$3i = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$2t = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar PivotModePanel = /** @class */ (function (_super) {\n __extends$3i(PivotModePanel, _super);\n function PivotModePanel() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n PivotModePanel.prototype.createTemplate = function () {\n return /* html */ \"
\\n \\n
\";\n };\n PivotModePanel.prototype.init = function () {\n this.setTemplate(this.createTemplate());\n this.cbPivotMode.setValue(this.columnModel.isPivotMode());\n var localeTextFunc = this.localeService.getLocaleTextFunc();\n this.cbPivotMode.setLabel(localeTextFunc('pivotMode', 'Pivot Mode'));\n this.addManagedListener(this.cbPivotMode, AgCheckbox.EVENT_CHANGED, this.onBtPivotMode.bind(this));\n this.addManagedListener(this.eventService, Events.EVENT_NEW_COLUMNS_LOADED, this.onPivotModeChanged.bind(this));\n this.addManagedListener(this.eventService, Events.EVENT_COLUMN_PIVOT_MODE_CHANGED, this.onPivotModeChanged.bind(this));\n };\n PivotModePanel.prototype.onBtPivotMode = function () {\n var newValue = !!this.cbPivotMode.getValue();\n if (newValue !== this.columnModel.isPivotMode()) {\n this.columnModel.setPivotMode(newValue, \"toolPanelUi\");\n var api = this.gridOptionsService.api;\n if (api) {\n api.refreshHeader();\n }\n }\n };\n PivotModePanel.prototype.onPivotModeChanged = function () {\n var pivotModeActive = this.columnModel.isPivotMode();\n this.cbPivotMode.setValue(pivotModeActive);\n };\n __decorate$2t([\n Autowired('columnModel')\n ], PivotModePanel.prototype, \"columnModel\", void 0);\n __decorate$2t([\n RefSelector('cbPivotMode')\n ], PivotModePanel.prototype, \"cbPivotMode\", void 0);\n __decorate$2t([\n PreConstruct\n ], PivotModePanel.prototype, \"init\", null);\n return PivotModePanel;\n}(Component));\n\nvar __extends$3h = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$2s = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar AggregationStage = /** @class */ (function (_super) {\n __extends$3h(AggregationStage, _super);\n function AggregationStage() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n AggregationStage.prototype.init = function () {\n var _this = this;\n this.alwaysAggregateAtRootLevel = this.gridOptionsService.is('alwaysAggregateAtRootLevel');\n this.addManagedPropertyListener('alwaysAggregateAtRootLevel', function (propChange) { return _this.alwaysAggregateAtRootLevel = propChange.currentValue; });\n this.groupIncludeTotalFooter = this.gridOptionsService.is('groupIncludeTotalFooter');\n this.addManagedPropertyListener('groupIncludeTotalFooter', function (propChange) { return _this.groupIncludeTotalFooter = propChange.currentValue; });\n };\n // it's possible to recompute the aggregate without doing the other parts\n // + api.refreshClientSideRowModel('aggregate')\n AggregationStage.prototype.execute = function (params) {\n // if changed path is active, it means we came from a) change detection or b) transaction update.\n // for both of these, if no value columns are present, it means there is nothing to aggregate now\n // and there is no cleanup to be done (as value columns don't change between transactions or change\n // detections). if no value columns and no changed path, means we have to go through all nodes in\n // case we need to clean up agg data from before.\n var noValueColumns = _.missingOrEmpty(this.columnModel.getValueColumns());\n var noUserAgg = !this.gridOptionsService.getCallback('getGroupRowAgg');\n var changedPathActive = params.changedPath && params.changedPath.isActive();\n if (noValueColumns && noUserAgg && changedPathActive) {\n return;\n }\n var aggDetails = this.createAggDetails(params);\n this.recursivelyCreateAggData(aggDetails);\n };\n AggregationStage.prototype.createAggDetails = function (params) {\n var pivotActive = this.columnModel.isPivotActive();\n var measureColumns = this.columnModel.getValueColumns();\n var pivotColumns = pivotActive ? this.columnModel.getPivotColumns() : [];\n var aggDetails = {\n changedPath: params.changedPath,\n valueColumns: measureColumns,\n pivotColumns: pivotColumns\n };\n return aggDetails;\n };\n AggregationStage.prototype.isSuppressAggFilteredOnly = function () {\n var isGroupAggFiltering = this.gridOptionsService.getGroupAggFiltering() !== undefined;\n return isGroupAggFiltering || this.gridOptionsService.is('suppressAggFilteredOnly');\n };\n AggregationStage.prototype.recursivelyCreateAggData = function (aggDetails) {\n var _this = this;\n // update prop, in case changed since last time\n this.filteredOnly = !this.isSuppressAggFilteredOnly();\n var callback = function (rowNode) {\n var hasNoChildren = !rowNode.hasChildren();\n if (hasNoChildren) {\n // this check is needed for TreeData, in case the node is no longer a child,\n // but it was a child previously.\n if (rowNode.aggData) {\n rowNode.setAggData(null);\n }\n // never agg data for leaf nodes\n return;\n }\n //Optionally enable the aggregation at the root Node\n var isRootNode = rowNode.level === -1;\n // if total footer is displayed, the value is in use\n if (isRootNode && !_this.groupIncludeTotalFooter) {\n var notPivoting = !_this.columnModel.isPivotMode();\n if (!_this.alwaysAggregateAtRootLevel && notPivoting) {\n return;\n }\n }\n _this.aggregateRowNode(rowNode, aggDetails);\n };\n aggDetails.changedPath.forEachChangedNodeDepthFirst(callback, true);\n };\n AggregationStage.prototype.aggregateRowNode = function (rowNode, aggDetails) {\n var measureColumnsMissing = aggDetails.valueColumns.length === 0;\n var pivotColumnsMissing = aggDetails.pivotColumns.length === 0;\n var userFunc = this.gridOptionsService.getCallback('getGroupRowAgg');\n var aggResult;\n if (userFunc) {\n var params = { nodes: rowNode.childrenAfterFilter };\n aggResult = userFunc(params);\n }\n else if (measureColumnsMissing) {\n aggResult = null;\n }\n else if (pivotColumnsMissing) {\n aggResult = this.aggregateRowNodeUsingValuesOnly(rowNode, aggDetails);\n }\n else {\n aggResult = this.aggregateRowNodeUsingValuesAndPivot(rowNode);\n }\n rowNode.setAggData(aggResult);\n // if we are grouping, then it's possible there is a sibling footer\n // to the group, so update the data here also if there is one\n if (rowNode.sibling) {\n rowNode.sibling.setAggData(aggResult);\n }\n };\n AggregationStage.prototype.aggregateRowNodeUsingValuesAndPivot = function (rowNode) {\n var _this = this;\n var _a;\n var result = {};\n var secondaryColumns = (_a = this.columnModel.getSecondaryColumns()) !== null && _a !== void 0 ? _a : [];\n secondaryColumns.forEach(function (secondaryCol) {\n var _a = secondaryCol.getColDef(), pivotValueColumn = _a.pivotValueColumn, pivotTotalColumnIds = _a.pivotTotalColumnIds, colId = _a.colId, pivotKeys = _a.pivotKeys;\n if (_.exists(pivotTotalColumnIds)) {\n return;\n }\n var keys = pivotKeys !== null && pivotKeys !== void 0 ? pivotKeys : [];\n var values;\n if (rowNode.leafGroup) {\n // lowest level group, get the values from the mapped set\n values = _this.getValuesFromMappedSet(rowNode.childrenMapped, keys, pivotValueColumn);\n }\n else {\n // value columns and pivot columns, non-leaf group\n values = _this.getValuesPivotNonLeaf(rowNode, colId);\n }\n result[colId] = _this.aggregateValues(values, pivotValueColumn.getAggFunc(), pivotValueColumn, rowNode, secondaryCol);\n });\n secondaryColumns.forEach(function (secondaryCol) {\n var _a = secondaryCol.getColDef(), pivotValueColumn = _a.pivotValueColumn, pivotTotalColumnIds = _a.pivotTotalColumnIds, colId = _a.colId;\n if (!_.exists(pivotTotalColumnIds)) {\n return;\n }\n var aggResults = [];\n //retrieve results for colIds associated with this pivot total column\n if (!pivotTotalColumnIds || !pivotTotalColumnIds.length) {\n return;\n }\n pivotTotalColumnIds.forEach(function (currentColId) {\n aggResults.push(result[currentColId]);\n });\n result[colId] = _this.aggregateValues(aggResults, pivotValueColumn.getAggFunc(), pivotValueColumn, rowNode, secondaryCol);\n });\n return result;\n };\n AggregationStage.prototype.aggregateRowNodeUsingValuesOnly = function (rowNode, aggDetails) {\n var _this = this;\n var result = {};\n var changedValueColumns = aggDetails.changedPath.isActive() ?\n aggDetails.changedPath.getValueColumnsForNode(rowNode, aggDetails.valueColumns)\n : aggDetails.valueColumns;\n var notChangedValueColumns = aggDetails.changedPath.isActive() ?\n aggDetails.changedPath.getNotValueColumnsForNode(rowNode, aggDetails.valueColumns)\n : null;\n var values2d = this.getValuesNormal(rowNode, changedValueColumns);\n var oldValues = rowNode.aggData;\n changedValueColumns.forEach(function (valueColumn, index) {\n result[valueColumn.getId()] = _this.aggregateValues(values2d[index], valueColumn.getAggFunc(), valueColumn, rowNode);\n });\n if (notChangedValueColumns && oldValues) {\n notChangedValueColumns.forEach(function (valueColumn) {\n result[valueColumn.getId()] = oldValues[valueColumn.getId()];\n });\n }\n return result;\n };\n AggregationStage.prototype.getValuesPivotNonLeaf = function (rowNode, colId) {\n var values = [];\n rowNode.childrenAfterFilter.forEach(function (node) {\n var value = node.aggData[colId];\n values.push(value);\n });\n return values;\n };\n AggregationStage.prototype.getValuesFromMappedSet = function (mappedSet, keys, valueColumn) {\n var _this = this;\n var mapPointer = mappedSet;\n keys.forEach(function (key) { return (mapPointer = mapPointer ? mapPointer[key] : null); });\n if (!mapPointer) {\n return [];\n }\n var values = [];\n mapPointer.forEach(function (rowNode) {\n var value = _this.valueService.getValue(valueColumn, rowNode);\n values.push(value);\n });\n return values;\n };\n AggregationStage.prototype.getValuesNormal = function (rowNode, valueColumns) {\n // create 2d array, of all values for all valueColumns\n var values = [];\n valueColumns.forEach(function () { return values.push([]); });\n var valueColumnCount = valueColumns.length;\n var nodeList = this.filteredOnly ? rowNode.childrenAfterFilter : rowNode.childrenAfterGroup;\n var rowCount = nodeList.length;\n for (var i = 0; i < rowCount; i++) {\n var childNode = nodeList[i];\n for (var j = 0; j < valueColumnCount; j++) {\n var valueColumn = valueColumns[j];\n // if the row is a group, then it will only have an agg result value,\n // which means valueGetter is never used.\n var value = this.valueService.getValue(valueColumn, childNode);\n values[j].push(value);\n }\n }\n return values;\n };\n AggregationStage.prototype.aggregateValues = function (values, aggFuncOrString, column, rowNode, pivotResultColumn) {\n var aggFunc = typeof aggFuncOrString === 'string' ?\n this.aggFuncService.getAggFunc(aggFuncOrString) :\n aggFuncOrString;\n if (typeof aggFunc !== 'function') {\n console.error(\"AG Grid: unrecognised aggregation function \" + aggFuncOrString);\n return null;\n }\n var aggFuncAny = aggFunc;\n var params = {\n values: values,\n column: column,\n colDef: column ? column.getColDef() : undefined,\n pivotResultColumn: pivotResultColumn,\n rowNode: rowNode,\n data: rowNode ? rowNode.data : undefined,\n api: this.gridApi,\n columnApi: this.columnApi,\n context: this.gridOptionsService.context,\n }; // the \"as any\" is needed to allow the deprecation warning messages\n return aggFuncAny(params);\n };\n __decorate$2s([\n Autowired('columnModel')\n ], AggregationStage.prototype, \"columnModel\", void 0);\n __decorate$2s([\n Autowired('valueService')\n ], AggregationStage.prototype, \"valueService\", void 0);\n __decorate$2s([\n Autowired('aggFuncService')\n ], AggregationStage.prototype, \"aggFuncService\", void 0);\n __decorate$2s([\n Autowired('gridApi')\n ], AggregationStage.prototype, \"gridApi\", void 0);\n __decorate$2s([\n Autowired('columnApi')\n ], AggregationStage.prototype, \"columnApi\", void 0);\n __decorate$2s([\n PostConstruct\n ], AggregationStage.prototype, \"init\", null);\n AggregationStage = __decorate$2s([\n Bean('aggregationStage')\n ], AggregationStage);\n return AggregationStage;\n}(BeanStub));\n\nvar BatchRemover = /** @class */ (function () {\n function BatchRemover() {\n this.allSets = {};\n this.allParents = [];\n }\n BatchRemover.prototype.removeFromChildrenAfterGroup = function (parent, child) {\n var set = this.getSet(parent);\n set.removeFromChildrenAfterGroup[child.id] = true;\n };\n BatchRemover.prototype.isRemoveFromAllLeafChildren = function (parent, child) {\n var set = this.getSet(parent);\n return !!set.removeFromAllLeafChildren[child.id];\n };\n BatchRemover.prototype.preventRemoveFromAllLeafChildren = function (parent, child) {\n var set = this.getSet(parent);\n delete set.removeFromAllLeafChildren[child.id];\n };\n BatchRemover.prototype.removeFromAllLeafChildren = function (parent, child) {\n var set = this.getSet(parent);\n set.removeFromAllLeafChildren[child.id] = true;\n };\n BatchRemover.prototype.getSet = function (parent) {\n if (!this.allSets[parent.id]) {\n this.allSets[parent.id] = {\n removeFromAllLeafChildren: {},\n removeFromChildrenAfterGroup: {}\n };\n this.allParents.push(parent);\n }\n return this.allSets[parent.id];\n };\n BatchRemover.prototype.getAllParents = function () {\n return this.allParents;\n };\n BatchRemover.prototype.flush = function () {\n var _this = this;\n this.allParents.forEach(function (parent) {\n var nodeDetails = _this.allSets[parent.id];\n parent.childrenAfterGroup = parent.childrenAfterGroup.filter(function (child) { return !nodeDetails.removeFromChildrenAfterGroup[child.id]; });\n parent.allLeafChildren = parent.allLeafChildren.filter(function (child) { return !nodeDetails.removeFromAllLeafChildren[child.id]; });\n parent.updateHasChildren();\n if (parent.sibling) {\n parent.sibling.childrenAfterGroup = parent.childrenAfterGroup;\n parent.sibling.allLeafChildren = parent.allLeafChildren;\n }\n });\n this.allSets = {};\n this.allParents.length = 0;\n };\n return BatchRemover;\n}());\n\nvar __extends$3g = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$2r = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __read$1k = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray$O = (undefined && undefined.__spreadArray) || function (to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\n to[j] = from[i];\n return to;\n};\nvar GroupStage = /** @class */ (function (_super) {\n __extends$3g(GroupStage, _super);\n function GroupStage() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n // we use a sequence variable so that each time we do a grouping, we don't\n // reuse the ids - otherwise the rowRenderer will confuse rowNodes between redraws\n // when it tries to animate between rows.\n _this.groupIdSequence = new NumberSequence();\n return _this;\n }\n GroupStage.prototype.postConstruct = function () {\n this.usingTreeData = this.gridOptionsService.isTreeData();\n if (this.usingTreeData) {\n this.getDataPath = this.gridOptionsService.get('getDataPath');\n }\n };\n GroupStage.prototype.execute = function (params) {\n var details = this.createGroupingDetails(params);\n if (details.transactions) {\n this.handleTransaction(details);\n }\n else {\n var afterColsChanged = params.afterColumnsChanged === true;\n this.shotgunResetEverything(details, afterColsChanged);\n }\n this.positionLeafsAndGroups(params.changedPath);\n this.orderGroups(details.rootNode);\n this.selectableService.updateSelectableAfterGrouping(details.rootNode);\n };\n GroupStage.prototype.positionLeafsAndGroups = function (changedPath) {\n // we don't do group sorting for tree data\n if (this.usingTreeData) {\n return;\n }\n changedPath.forEachChangedNodeDepthFirst(function (group) {\n if (group.childrenAfterGroup) {\n var leafNodes_1 = [];\n var groupNodes_1 = [];\n var unbalancedNode_1;\n group.childrenAfterGroup.forEach(function (row) {\n var _a;\n if (!((_a = row.childrenAfterGroup) === null || _a === void 0 ? void 0 : _a.length)) {\n leafNodes_1.push(row);\n }\n else {\n if (row.key === '' && !unbalancedNode_1) {\n unbalancedNode_1 = row;\n }\n else {\n groupNodes_1.push(row);\n }\n }\n });\n if (unbalancedNode_1) {\n groupNodes_1.push(unbalancedNode_1);\n }\n group.childrenAfterGroup = __spreadArray$O(__spreadArray$O([], __read$1k(leafNodes_1)), __read$1k(groupNodes_1));\n }\n }, false);\n };\n GroupStage.prototype.createGroupingDetails = function (params) {\n var rowNode = params.rowNode, changedPath = params.changedPath, rowNodeTransactions = params.rowNodeTransactions, rowNodeOrder = params.rowNodeOrder;\n var groupedCols = this.usingTreeData ? null : this.columnModel.getRowGroupColumns();\n var details = {\n // someone complained that the parent attribute was causing some change detection\n // to break is some angular add-on - which i never used. taking the parent out breaks\n // a cyclic dependency, hence this flag got introduced.\n includeParents: !this.gridOptionsService.is('suppressParentsInRowNodes'),\n expandByDefault: this.gridOptionsService.getNum('groupDefaultExpanded'),\n groupedCols: groupedCols,\n rootNode: rowNode,\n pivotMode: this.columnModel.isPivotMode(),\n groupedColCount: this.usingTreeData || !groupedCols ? 0 : groupedCols.length,\n rowNodeOrder: rowNodeOrder,\n transactions: rowNodeTransactions,\n // if no transaction, then it's shotgun, changed path would be 'not active' at this point anyway\n changedPath: changedPath\n };\n return details;\n };\n GroupStage.prototype.handleTransaction = function (details) {\n var _this = this;\n details.transactions.forEach(function (tran) {\n // we don't allow batch remover for tree data as tree data uses Filler Nodes,\n // and creating/deleting filler nodes needs to be done alongside the node deleting\n // and moving. if we want to Batch Remover working with tree data then would need\n // to consider how Filler Nodes would be impacted (it's possible that it can be easily\n // modified to work, however for now I don't have the brain energy to work it all out).\n var batchRemover = !_this.usingTreeData ? new BatchRemover() : undefined;\n // the order here of [add, remove, update] needs to be the same as in ClientSideNodeManager,\n // as the order is important when a record with the same id is added and removed in the same\n // transaction.\n if (_.existsAndNotEmpty(tran.remove)) {\n _this.removeNodes(tran.remove, details, batchRemover);\n }\n if (_.existsAndNotEmpty(tran.update)) {\n _this.moveNodesInWrongPath(tran.update, details, batchRemover);\n }\n if (_.existsAndNotEmpty(tran.add)) {\n _this.insertNodes(tran.add, details, false);\n }\n // must flush here, and not allow another transaction to be applied,\n // as each transaction must finish leaving the data in a consistent state.\n if (batchRemover) {\n var parentsWithChildrenRemoved = batchRemover.getAllParents().slice();\n batchRemover.flush();\n _this.removeEmptyGroups(parentsWithChildrenRemoved, details);\n }\n });\n if (details.rowNodeOrder) {\n this.sortChildren(details);\n }\n };\n // this is used when doing delta updates, eg Redux, keeps nodes in right order\n GroupStage.prototype.sortChildren = function (details) {\n details.changedPath.forEachChangedNodeDepthFirst(function (node) {\n if (!node.childrenAfterGroup) {\n return;\n }\n var didSort = _.sortRowNodesByOrder(node.childrenAfterGroup, details.rowNodeOrder);\n if (didSort) {\n details.changedPath.addParentNode(node);\n }\n }, false, true);\n };\n GroupStage.prototype.orderGroups = function (rootNode) {\n // we don't do group sorting for tree data\n if (this.usingTreeData) {\n return;\n }\n var comparator = this.gridOptionsService.getCallback('initialGroupOrderComparator');\n if (_.exists(comparator)) {\n recursiveSort(rootNode);\n }\n function recursiveSort(rowNode) {\n var doSort = _.exists(rowNode.childrenAfterGroup) &&\n // we only want to sort groups, so we do not sort leafs (a leaf group has leafs as children)\n !rowNode.leafGroup;\n if (doSort) {\n rowNode.childrenAfterGroup.sort(function (nodeA, nodeB) { return comparator({ nodeA: nodeA, nodeB: nodeB }); });\n rowNode.childrenAfterGroup.forEach(function (childNode) { return recursiveSort(childNode); });\n }\n }\n };\n GroupStage.prototype.getExistingPathForNode = function (node, details) {\n var res = [];\n // when doing tree data, the node is part of the path,\n // but when doing grid grouping, the node is not part of the path so we start with the parent.\n var pointer = this.usingTreeData ? node : node.parent;\n while (pointer && pointer !== details.rootNode) {\n res.push({\n key: pointer.key,\n rowGroupColumn: pointer.rowGroupColumn,\n field: pointer.field\n });\n pointer = pointer.parent;\n }\n res.reverse();\n return res;\n };\n GroupStage.prototype.moveNodesInWrongPath = function (childNodes, details, batchRemover) {\n var _this = this;\n childNodes.forEach(function (childNode) {\n // we add node, even if parent has not changed, as the data could have\n // changed, hence aggregations will be wrong\n if (details.changedPath.isActive()) {\n details.changedPath.addParentNode(childNode.parent);\n }\n var infoToKeyMapper = function (item) { return item.key; };\n var oldPath = _this.getExistingPathForNode(childNode, details).map(infoToKeyMapper);\n var newPath = _this.getGroupInfo(childNode, details).map(infoToKeyMapper);\n var nodeInCorrectPath = _.areEqual(oldPath, newPath);\n if (!nodeInCorrectPath) {\n _this.moveNode(childNode, details, batchRemover);\n }\n });\n };\n GroupStage.prototype.moveNode = function (childNode, details, batchRemover) {\n this.removeNodesInStages([childNode], details, batchRemover);\n this.insertOneNode(childNode, details, true, batchRemover);\n // hack - if we didn't do this, then renaming a tree item (ie changing rowNode.key) wouldn't get\n // refreshed into the gui.\n // this is needed to kick off the event that rowComp listens to for refresh. this in turn\n // then will get each cell in the row to refresh - which is what we need as we don't know which\n // columns will be displaying the rowNode.key info.\n childNode.setData(childNode.data);\n // we add both old and new parents to changed path, as both will need to be refreshed.\n // we already added the old parent (in calling method), so just add the new parent here\n if (details.changedPath.isActive()) {\n var newParent = childNode.parent;\n details.changedPath.addParentNode(newParent);\n }\n };\n GroupStage.prototype.removeNodes = function (leafRowNodes, details, batchRemover) {\n this.removeNodesInStages(leafRowNodes, details, batchRemover);\n if (details.changedPath.isActive()) {\n leafRowNodes.forEach(function (rowNode) { return details.changedPath.addParentNode(rowNode.parent); });\n }\n };\n GroupStage.prototype.removeNodesInStages = function (leafRowNodes, details, batchRemover) {\n this.removeNodesFromParents(leafRowNodes, details, batchRemover);\n if (this.usingTreeData) {\n this.postRemoveCreateFillerNodes(leafRowNodes, details);\n // When not TreeData, then removeEmptyGroups is called just before the BatchRemover is flushed.\n // However for TreeData, there is no BatchRemover, so we have to call removeEmptyGroups here.\n var nodeParents = leafRowNodes.map(function (n) { return n.parent; });\n this.removeEmptyGroups(nodeParents, details);\n }\n };\n GroupStage.prototype.forEachParentGroup = function (details, group, callback) {\n var pointer = group;\n while (pointer && pointer !== details.rootNode) {\n callback(pointer);\n pointer = pointer.parent;\n }\n };\n GroupStage.prototype.removeNodesFromParents = function (nodesToRemove, details, provided) {\n var _this = this;\n // this method can be called with BatchRemover as optional. if it is missed, we created a local version\n // and flush it at the end. if one is provided, we add to the provided one and it gets flushed elsewhere.\n var batchRemoverIsLocal = provided == null;\n var batchRemoverToUse = provided ? provided : new BatchRemover();\n nodesToRemove.forEach(function (nodeToRemove) {\n _this.removeFromParent(nodeToRemove, batchRemoverToUse);\n // remove from allLeafChildren. we clear down all parents EXCEPT the Root Node, as\n // the ClientSideNodeManager is responsible for the Root Node.\n _this.forEachParentGroup(details, nodeToRemove.parent, function (parentNode) {\n batchRemoverToUse.removeFromAllLeafChildren(parentNode, nodeToRemove);\n });\n });\n if (batchRemoverIsLocal) {\n batchRemoverToUse.flush();\n }\n };\n GroupStage.prototype.postRemoveCreateFillerNodes = function (nodesToRemove, details) {\n var _this = this;\n nodesToRemove.forEach(function (nodeToRemove) {\n // if not group, and children are present, need to move children to a group.\n // otherwise if no children, we can just remove without replacing.\n var replaceWithGroup = nodeToRemove.hasChildren();\n if (replaceWithGroup) {\n var oldPath = _this.getExistingPathForNode(nodeToRemove, details);\n // because we just removed the userGroup, this will always return new support group\n var newGroupNode_1 = _this.findParentForNode(nodeToRemove, oldPath, details);\n // these properties are the ones that will be incorrect in the newly created group,\n // so copy them from the old childNode\n newGroupNode_1.expanded = nodeToRemove.expanded;\n newGroupNode_1.allLeafChildren = nodeToRemove.allLeafChildren;\n newGroupNode_1.childrenAfterGroup = nodeToRemove.childrenAfterGroup;\n newGroupNode_1.childrenMapped = nodeToRemove.childrenMapped;\n newGroupNode_1.updateHasChildren();\n newGroupNode_1.childrenAfterGroup.forEach(function (rowNode) { return rowNode.parent = newGroupNode_1; });\n }\n });\n };\n GroupStage.prototype.removeEmptyGroups = function (possibleEmptyGroups, details) {\n var _this = this;\n // we do this multiple times, as when we remove groups, that means the parent of just removed\n // group can then be empty. to get around this, if we remove, then we check everything again for\n // newly emptied groups. the max number of times this will execute is the depth of the group tree.\n var checkAgain = true;\n var groupShouldBeRemoved = function (rowNode) {\n // because of the while loop below, it's possible we already moved the node,\n // so double check before trying to remove again.\n var mapKey = _this.getChildrenMappedKey(rowNode.key, rowNode.rowGroupColumn);\n var parentRowNode = rowNode.parent;\n var groupAlreadyRemoved = (parentRowNode && parentRowNode.childrenMapped) ?\n !parentRowNode.childrenMapped[mapKey] : true;\n if (groupAlreadyRemoved) {\n // if not linked, then group was already removed\n return false;\n }\n // if still not removed, then we remove if this group is empty\n return !!rowNode.isEmptyRowGroupNode();\n };\n var _loop_1 = function () {\n checkAgain = false;\n var batchRemover = new BatchRemover();\n possibleEmptyGroups.forEach(function (possibleEmptyGroup) {\n // remove empty groups\n _this.forEachParentGroup(details, possibleEmptyGroup, function (rowNode) {\n if (groupShouldBeRemoved(rowNode)) {\n checkAgain = true;\n _this.removeFromParent(rowNode, batchRemover);\n // we remove selection on filler nodes here, as the selection would not be removed\n // from the RowNodeManager, as filler nodes don't exist on the RowNodeManager\n rowNode.setSelectedParams({ newValue: false, source: 'rowGroupChanged' });\n }\n });\n });\n batchRemover.flush();\n };\n while (checkAgain) {\n _loop_1();\n }\n };\n // removes the node from the parent by:\n // a) removing from childrenAfterGroup (using batchRemover if present, otherwise immediately)\n // b) removing from childrenMapped (immediately)\n // c) setRowTop(null) - as the rowRenderer uses this to know the RowNode is no longer needed\n // d) setRowIndex(null) - as the rowNode will no longer be displayed.\n GroupStage.prototype.removeFromParent = function (child, batchRemover) {\n if (child.parent) {\n if (batchRemover) {\n batchRemover.removeFromChildrenAfterGroup(child.parent, child);\n }\n else {\n _.removeFromArray(child.parent.childrenAfterGroup, child);\n child.parent.updateHasChildren();\n }\n }\n var mapKey = this.getChildrenMappedKey(child.key, child.rowGroupColumn);\n if (child.parent && child.parent.childrenMapped) {\n child.parent.childrenMapped[mapKey] = undefined;\n }\n // this is important for transition, see rowComp removeFirstPassFuncs. when doing animation and\n // remove, if rowTop is still present, the rowComp thinks it's just moved position.\n child.setRowTop(null);\n child.setRowIndex(null);\n };\n GroupStage.prototype.addToParent = function (child, parent) {\n var mapKey = this.getChildrenMappedKey(child.key, child.rowGroupColumn);\n if (parent) {\n var children = parent.childrenMapped != null;\n if (children) {\n parent.childrenMapped[mapKey] = child;\n }\n parent.childrenAfterGroup.push(child);\n parent.updateHasChildren();\n }\n };\n GroupStage.prototype.areGroupColsEqual = function (d1, d2) {\n if (d1 == null || d2 == null || d1.pivotMode !== d2.pivotMode) {\n return false;\n }\n return _.areEqual(d1.groupedCols, d2.groupedCols);\n };\n GroupStage.prototype.checkAllGroupDataAfterColsChanged = function (details) {\n var _this = this;\n var recurse = function (rowNodes) {\n if (!rowNodes) {\n return;\n }\n rowNodes.forEach(function (rowNode) {\n var isLeafNode = !_this.usingTreeData && !rowNode.group;\n if (isLeafNode) {\n return;\n }\n var groupInfo = {\n field: rowNode.field,\n key: rowNode.key,\n rowGroupColumn: rowNode.rowGroupColumn\n };\n _this.setGroupData(rowNode, groupInfo);\n recurse(rowNode.childrenAfterGroup);\n });\n };\n recurse(details.rootNode.childrenAfterGroup);\n };\n GroupStage.prototype.shotgunResetEverything = function (details, afterColumnsChanged) {\n if (this.noChangeInGroupingColumns(details, afterColumnsChanged)) {\n return;\n }\n // groups are about to get disposed, so need to deselect any that are selected\n this.selectionService.filterFromSelection(function (node) { return node && !node.group; });\n var rootNode = details.rootNode, groupedCols = details.groupedCols;\n // because we are not creating the root node each time, we have the logic\n // here to change leafGroup once.\n // we set .leafGroup to false for tree data, as .leafGroup is only used when pivoting, and pivoting\n // isn't allowed with treeData, so the grid never actually use .leafGroup when doing treeData.\n rootNode.leafGroup = this.usingTreeData ? false : groupedCols.length === 0;\n // we are doing everything from scratch, so reset childrenAfterGroup and childrenMapped from the rootNode\n rootNode.childrenAfterGroup = [];\n rootNode.childrenMapped = {};\n rootNode.updateHasChildren();\n var sibling = rootNode.sibling;\n if (sibling) {\n sibling.childrenAfterGroup = rootNode.childrenAfterGroup;\n sibling.childrenMapped = rootNode.childrenMapped;\n }\n this.insertNodes(rootNode.allLeafChildren, details, false);\n };\n GroupStage.prototype.noChangeInGroupingColumns = function (details, afterColumnsChanged) {\n var noFurtherProcessingNeeded = false;\n var groupDisplayColumns = this.columnModel.getGroupDisplayColumns();\n var newGroupDisplayColIds = groupDisplayColumns ?\n groupDisplayColumns.map(function (c) { return c.getId(); }).join('-') : '';\n if (afterColumnsChanged) {\n // we only need to redo grouping if doing normal grouping (ie not tree data)\n // and the group cols have changed.\n noFurtherProcessingNeeded = this.usingTreeData || this.areGroupColsEqual(details, this.oldGroupingDetails);\n // if the group display cols have changed, then we need to update rowNode.groupData\n // (regardless of tree data or row grouping)\n if (this.oldGroupDisplayColIds !== newGroupDisplayColIds) {\n this.checkAllGroupDataAfterColsChanged(details);\n }\n }\n this.oldGroupingDetails = details;\n this.oldGroupDisplayColIds = newGroupDisplayColIds;\n return noFurtherProcessingNeeded;\n };\n GroupStage.prototype.insertNodes = function (newRowNodes, details, isMove) {\n var _this = this;\n newRowNodes.forEach(function (rowNode) {\n _this.insertOneNode(rowNode, details, isMove);\n if (details.changedPath.isActive()) {\n details.changedPath.addParentNode(rowNode.parent);\n }\n });\n };\n GroupStage.prototype.insertOneNode = function (childNode, details, isMove, batchRemover) {\n var path = this.getGroupInfo(childNode, details);\n var parentGroup = this.findParentForNode(childNode, path, details, batchRemover);\n if (!parentGroup.group) {\n console.warn(\"AG Grid: duplicate group keys for row data, keys should be unique\", [parentGroup.data, childNode.data]);\n }\n if (this.usingTreeData) {\n this.swapGroupWithUserNode(parentGroup, childNode, isMove);\n }\n else {\n childNode.parent = parentGroup;\n childNode.level = path.length;\n parentGroup.childrenAfterGroup.push(childNode);\n parentGroup.updateHasChildren();\n }\n };\n GroupStage.prototype.findParentForNode = function (childNode, path, details, batchRemover) {\n var _this = this;\n var nextNode = details.rootNode;\n path.forEach(function (groupInfo, level) {\n nextNode = _this.getOrCreateNextNode(nextNode, groupInfo, level, details);\n // node gets added to all group nodes.\n // note: we do not add to rootNode here, as the rootNode is the master list of rowNodes\n if (!(batchRemover === null || batchRemover === void 0 ? void 0 : batchRemover.isRemoveFromAllLeafChildren(nextNode, childNode))) {\n nextNode.allLeafChildren.push(childNode);\n }\n else {\n // if this node is about to be removed, prevent that\n batchRemover === null || batchRemover === void 0 ? void 0 : batchRemover.preventRemoveFromAllLeafChildren(nextNode, childNode);\n }\n });\n return nextNode;\n };\n GroupStage.prototype.swapGroupWithUserNode = function (fillerGroup, userGroup, isMove) {\n userGroup.parent = fillerGroup.parent;\n userGroup.key = fillerGroup.key;\n userGroup.field = fillerGroup.field;\n userGroup.groupData = fillerGroup.groupData;\n userGroup.level = fillerGroup.level;\n // AG-3441 - preserve the existing expanded status of the node if we're moving it, so that\n // you can drag a sub tree from one parent to another without changing its expansion\n if (!isMove) {\n userGroup.expanded = fillerGroup.expanded;\n }\n // we set .leafGroup to false for tree data, as .leafGroup is only used when pivoting, and pivoting\n // isn't allowed with treeData, so the grid never actually use .leafGroup when doing treeData.\n userGroup.leafGroup = fillerGroup.leafGroup;\n // always null for userGroups, as row grouping is not allowed when doing tree data\n userGroup.rowGroupIndex = fillerGroup.rowGroupIndex;\n userGroup.allLeafChildren = fillerGroup.allLeafChildren;\n userGroup.childrenAfterGroup = fillerGroup.childrenAfterGroup;\n userGroup.childrenMapped = fillerGroup.childrenMapped;\n userGroup.sibling = fillerGroup.sibling;\n userGroup.updateHasChildren();\n this.removeFromParent(fillerGroup);\n userGroup.childrenAfterGroup.forEach(function (rowNode) { return rowNode.parent = userGroup; });\n this.addToParent(userGroup, fillerGroup.parent);\n };\n GroupStage.prototype.getOrCreateNextNode = function (parentGroup, groupInfo, level, details) {\n var key = this.getChildrenMappedKey(groupInfo.key, groupInfo.rowGroupColumn);\n var nextNode = parentGroup.childrenMapped ? parentGroup.childrenMapped[key] : undefined;\n if (!nextNode) {\n nextNode = this.createGroup(groupInfo, parentGroup, level, details);\n // attach the new group to the parent\n this.addToParent(nextNode, parentGroup);\n }\n return nextNode;\n };\n GroupStage.prototype.createGroup = function (groupInfo, parent, level, details) {\n var groupNode = new RowNode(this.beans);\n groupNode.group = true;\n groupNode.field = groupInfo.field;\n groupNode.rowGroupColumn = groupInfo.rowGroupColumn;\n this.setGroupData(groupNode, groupInfo);\n // we put 'row-group-' before the group id, so it doesn't clash with standard row id's. we also use 't-' and 'b-'\n // for top pinned and bottom pinned rows.\n groupNode.id = RowNode.ID_PREFIX_ROW_GROUP + this.groupIdSequence.next();\n groupNode.key = groupInfo.key;\n groupNode.level = level;\n groupNode.leafGroup = this.usingTreeData ? false : level === (details.groupedColCount - 1);\n groupNode.allLeafChildren = [];\n // why is this done here? we are not updating the children count as we go,\n // i suspect this is updated in the filter stage\n groupNode.setAllChildrenCount(0);\n groupNode.rowGroupIndex = this.usingTreeData ? null : level;\n groupNode.childrenAfterGroup = [];\n groupNode.childrenMapped = {};\n groupNode.updateHasChildren();\n groupNode.parent = details.includeParents ? parent : null;\n this.setExpandedInitialValue(details, groupNode);\n if (this.gridOptionsService.is('groupIncludeFooter')) {\n groupNode.createFooter();\n }\n return groupNode;\n };\n GroupStage.prototype.setGroupData = function (groupNode, groupInfo) {\n var _this = this;\n groupNode.groupData = {};\n var groupDisplayCols = this.columnModel.getGroupDisplayColumns();\n groupDisplayCols.forEach(function (col) {\n // newGroup.rowGroupColumn=null when working off GroupInfo, and we always display the group in the group column\n // if rowGroupColumn is present, then it's grid row grouping and we only include if configuration says so\n var displayGroupForCol = _this.usingTreeData || (groupNode.rowGroupColumn ? col.isRowGroupDisplayed(groupNode.rowGroupColumn.getId()) : false);\n if (displayGroupForCol) {\n groupNode.groupData[col.getColId()] = groupInfo.key;\n }\n });\n };\n GroupStage.prototype.getChildrenMappedKey = function (key, rowGroupColumn) {\n if (rowGroupColumn) {\n // grouping by columns\n return rowGroupColumn.getId() + '-' + key;\n }\n // tree data - we don't have rowGroupColumns\n return key;\n };\n GroupStage.prototype.setExpandedInitialValue = function (details, groupNode) {\n // if pivoting the leaf group is never expanded as we do not show leaf rows\n if (details.pivotMode && groupNode.leafGroup) {\n groupNode.expanded = false;\n return;\n }\n // use callback if exists\n var userCallback = this.gridOptionsService.getCallback('isGroupOpenByDefault');\n if (userCallback) {\n var params = {\n rowNode: groupNode,\n field: groupNode.field,\n key: groupNode.key,\n level: groupNode.level,\n rowGroupColumn: groupNode.rowGroupColumn\n };\n groupNode.expanded = userCallback(params) == true;\n return;\n }\n // use expandByDefault if exists\n var expandByDefault = details.expandByDefault;\n if (details.expandByDefault === -1) {\n groupNode.expanded = true;\n return;\n }\n // otherwise\n groupNode.expanded = groupNode.level < expandByDefault;\n };\n GroupStage.prototype.getGroupInfo = function (rowNode, details) {\n if (this.usingTreeData) {\n return this.getGroupInfoFromCallback(rowNode);\n }\n return this.getGroupInfoFromGroupColumns(rowNode, details);\n };\n GroupStage.prototype.getGroupInfoFromCallback = function (rowNode) {\n var keys = this.getDataPath ? this.getDataPath(rowNode.data) : null;\n if (keys === null || keys === undefined || keys.length === 0) {\n _.doOnce(function () { return console.warn(\"AG Grid: getDataPath() should not return an empty path for data\", rowNode.data); }, 'groupStage.getGroupInfoFromCallback');\n }\n var groupInfoMapper = function (key) { return ({ key: key, field: null, rowGroupColumn: null }); };\n return keys ? keys.map(groupInfoMapper) : [];\n };\n GroupStage.prototype.getGroupInfoFromGroupColumns = function (rowNode, details) {\n var _this = this;\n var res = [];\n details.groupedCols.forEach(function (groupCol) {\n var key = _this.valueService.getKeyForNode(groupCol, rowNode);\n var keyExists = key !== null && key !== undefined && key !== '';\n // unbalanced tree and pivot mode don't work together - not because of the grid, it doesn't make\n // mathematical sense as you are building up a cube. so if pivot mode, we put in a blank key where missing.\n // this keeps the tree balanced and hence can be represented as a group.\n var createGroupForEmpty = details.pivotMode || !_this.gridOptionsService.is('groupAllowUnbalanced');\n if (createGroupForEmpty && !keyExists) {\n key = '';\n keyExists = true;\n }\n if (keyExists) {\n var item = {\n key: key,\n field: groupCol.getColDef().field,\n rowGroupColumn: groupCol\n };\n res.push(item);\n }\n });\n return res;\n };\n __decorate$2r([\n Autowired('columnModel')\n ], GroupStage.prototype, \"columnModel\", void 0);\n __decorate$2r([\n Autowired('selectableService')\n ], GroupStage.prototype, \"selectableService\", void 0);\n __decorate$2r([\n Autowired('valueService')\n ], GroupStage.prototype, \"valueService\", void 0);\n __decorate$2r([\n Autowired('beans')\n ], GroupStage.prototype, \"beans\", void 0);\n __decorate$2r([\n Autowired('selectionService')\n ], GroupStage.prototype, \"selectionService\", void 0);\n __decorate$2r([\n PostConstruct\n ], GroupStage.prototype, \"postConstruct\", null);\n GroupStage = __decorate$2r([\n Bean('groupStage')\n ], GroupStage);\n return GroupStage;\n}(BeanStub));\n\nvar __extends$3f = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign$_ = (undefined && undefined.__assign) || function () {\n __assign$_ = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$_.apply(this, arguments);\n};\nvar __decorate$2q = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __read$1j = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray$N = (undefined && undefined.__spreadArray) || function (to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\n to[j] = from[i];\n return to;\n};\nvar PivotColDefService = /** @class */ (function (_super) {\n __extends$3f(PivotColDefService, _super);\n function PivotColDefService() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n PivotColDefService_1 = PivotColDefService;\n PivotColDefService.prototype.createPivotColumnDefs = function (uniqueValues) {\n // this is passed to the columnModel, to configure the columns and groups we show\n var pivotColumns = this.columnModel.getPivotColumns();\n var valueColumns = this.columnModel.getValueColumns();\n var levelsDeep = pivotColumns.length;\n var pivotColumnGroupDefs = this.recursiveBuildGroup(0, uniqueValues, [], levelsDeep, pivotColumns);\n function extractColDefs(input, arr) {\n if (arr === void 0) { arr = []; }\n input.forEach(function (def) {\n if (def.children !== undefined) {\n extractColDefs(def.children, arr);\n }\n else {\n arr.push(def);\n }\n });\n return arr;\n }\n var pivotColumnDefs = extractColDefs(pivotColumnGroupDefs);\n // additional columns that contain the aggregated total for each value column per row\n this.addRowGroupTotals(pivotColumnGroupDefs, pivotColumnDefs, valueColumns);\n // additional group columns that contain child totals for each collapsed child column / group\n this.addExpandablePivotGroups(pivotColumnGroupDefs, pivotColumnDefs);\n // additional group columns that contain an aggregated total across all child columns\n this.addPivotTotalsToGroups(pivotColumnGroupDefs, pivotColumnDefs);\n // we clone, so the colDefs in pivotColumnsGroupDefs and pivotColumnDefs are not shared. this is so that\n // any changes the user makes (via processSecondaryColumnDefinitions) don't impact the internal aggregations,\n // as these use the col defs also\n var pivotColumnDefsClone = pivotColumnDefs.map(function (colDef) { return _.cloneObject(colDef); });\n return {\n pivotColumnGroupDefs: pivotColumnGroupDefs,\n pivotColumnDefs: pivotColumnDefsClone\n };\n };\n PivotColDefService.prototype.recursiveBuildGroup = function (index, uniqueValue, pivotKeys, maxDepth, primaryPivotColumns) {\n var _this = this;\n var measureColumns = this.columnModel.getValueColumns();\n if (index >= maxDepth) { // Base case - build the measure columns\n return this.buildMeasureCols(pivotKeys);\n }\n // sort by either user provided comparator, or our own one\n var primaryPivotColumnDefs = primaryPivotColumns[index].getColDef();\n var comparator = this.headerNameComparator.bind(this, primaryPivotColumnDefs.pivotComparator);\n // Base case for the compact layout, instead of recursing build the last layer of groups as measure columns instead\n if (measureColumns.length === 1 && this.gridOptionsService.is('removePivotHeaderRowWhenSingleValueColumn') && index === maxDepth - 1) {\n var leafCols_1 = [];\n _.iterateObject(uniqueValue, function (key) {\n var newPivotKeys = __spreadArray$N(__spreadArray$N([], __read$1j(pivotKeys)), [key]);\n leafCols_1.push(__assign$_(__assign$_({}, _this.createColDef(measureColumns[0], key, newPivotKeys)), { columnGroupShow: 'open' }));\n });\n leafCols_1.sort(comparator);\n return leafCols_1;\n }\n // Recursive case\n var groups = [];\n _.iterateObject(uniqueValue, function (key, value) {\n var newPivotKeys = __spreadArray$N(__spreadArray$N([], __read$1j(pivotKeys)), [key]);\n groups.push({\n children: _this.recursiveBuildGroup(index + 1, value, newPivotKeys, maxDepth, primaryPivotColumns),\n headerName: key,\n pivotKeys: newPivotKeys,\n columnGroupShow: 'open',\n groupId: _this.generateColumnGroupId(newPivotKeys),\n });\n });\n groups.sort(comparator);\n return groups;\n };\n PivotColDefService.prototype.buildMeasureCols = function (pivotKeys) {\n var _this = this;\n var measureColumns = this.columnModel.getValueColumns();\n if (measureColumns.length === 0) {\n // if no value columns selected, then we insert one blank column, so the user at least sees columns\n // rendered. otherwise the grid would render with no columns (just empty groups) which would give the\n // impression that the grid is broken\n return [this.createColDef(null, '-', pivotKeys)];\n }\n return measureColumns.map(function (measureCol) {\n var columnName = _this.columnModel.getDisplayNameForColumn(measureCol, 'header');\n return __assign$_(__assign$_({}, _this.createColDef(measureCol, columnName, pivotKeys)), { columnGroupShow: 'open' });\n });\n };\n PivotColDefService.prototype.addExpandablePivotGroups = function (pivotColumnGroupDefs, pivotColumnDefs) {\n var _this = this;\n if (this.gridOptionsService.is('suppressExpandablePivotGroups') ||\n this.gridOptionsService.get('pivotColumnGroupTotals')) {\n return;\n }\n var recursivelyAddSubTotals = function (groupDef, currentPivotColumnDefs, acc) {\n var group = groupDef;\n if (group.children) {\n var childAcc_1 = new Map();\n group.children.forEach(function (grp) {\n recursivelyAddSubTotals(grp, currentPivotColumnDefs, childAcc_1);\n });\n var firstGroup_1 = !group.children.some(function (child) { return child.children; });\n _this.columnModel.getValueColumns().forEach(function (valueColumn) {\n var columnName = _this.columnModel.getDisplayNameForColumn(valueColumn, 'header');\n var totalColDef = _this.createColDef(valueColumn, columnName, groupDef.pivotKeys);\n totalColDef.pivotTotalColumnIds = childAcc_1.get(valueColumn.getColId());\n totalColDef.columnGroupShow = 'closed';\n totalColDef.aggFunc = valueColumn.getAggFunc();\n if (!firstGroup_1) {\n // add total colDef to group and pivot colDefs array\n var children = groupDef.children;\n children.push(totalColDef);\n currentPivotColumnDefs.push(totalColDef);\n }\n });\n _this.merge(acc, childAcc_1);\n }\n else {\n var def = groupDef;\n // check that value column exists, i.e. aggFunc is supplied\n if (!def.pivotValueColumn) {\n return;\n }\n var pivotValueColId = def.pivotValueColumn.getColId();\n var arr = acc.has(pivotValueColId) ? acc.get(pivotValueColId) : [];\n arr.push(def.colId);\n acc.set(pivotValueColId, arr);\n }\n };\n pivotColumnGroupDefs.forEach(function (groupDef) {\n recursivelyAddSubTotals(groupDef, pivotColumnDefs, new Map());\n });\n };\n PivotColDefService.prototype.addPivotTotalsToGroups = function (pivotColumnGroupDefs, pivotColumnDefs) {\n var _this = this;\n if (!this.gridOptionsService.get('pivotColumnGroupTotals')) {\n return;\n }\n var insertAfter = this.gridOptionsService.get('pivotColumnGroupTotals') === 'after';\n var valueCols = this.columnModel.getValueColumns();\n var aggFuncs = valueCols.map(function (valueCol) { return valueCol.getAggFunc(); });\n // don't add pivot totals if there is less than 1 aggFunc or they are not all the same\n if (!aggFuncs || aggFuncs.length < 1 || !this.sameAggFuncs(aggFuncs)) {\n // console.warn('AG Grid: aborting adding pivot total columns - value columns require same aggFunc');\n return;\n }\n // arbitrarily select a value column to use as a template for pivot columns\n var valueColumn = valueCols[0];\n pivotColumnGroupDefs.forEach(function (groupDef) {\n _this.recursivelyAddPivotTotal(groupDef, pivotColumnDefs, valueColumn, insertAfter);\n });\n };\n PivotColDefService.prototype.recursivelyAddPivotTotal = function (groupDef, pivotColumnDefs, valueColumn, insertAfter) {\n var _this = this;\n var group = groupDef;\n if (!group.children) {\n var def = groupDef;\n return def.colId ? [def.colId] : null;\n }\n var colIds = [];\n // need to recurse children first to obtain colIds used in the aggregation stage\n group.children\n .forEach(function (grp) {\n var childColIds = _this.recursivelyAddPivotTotal(grp, pivotColumnDefs, valueColumn, insertAfter);\n if (childColIds) {\n colIds = colIds.concat(childColIds);\n }\n });\n // only add total colDef if there is more than 1 child node\n if (group.children.length > 1) {\n var localeTextFunc = this.localeService.getLocaleTextFunc();\n var headerName = localeTextFunc('pivotColumnGroupTotals', 'Total');\n //create total colDef using an arbitrary value column as a template\n var totalColDef = this.createColDef(valueColumn, headerName, groupDef.pivotKeys, true);\n totalColDef.pivotTotalColumnIds = colIds;\n totalColDef.aggFunc = valueColumn.getAggFunc();\n // add total colDef to group and pivot colDefs array\n var children = groupDef.children;\n insertAfter ? children.push(totalColDef) : children.unshift(totalColDef);\n pivotColumnDefs.push(totalColDef);\n }\n return colIds;\n };\n PivotColDefService.prototype.addRowGroupTotals = function (pivotColumnGroupDefs, pivotColumnDefs, valueColumns) {\n var _this = this;\n if (!this.gridOptionsService.get('pivotRowTotals')) {\n return;\n }\n var insertAfter = this.gridOptionsService.get('pivotRowTotals') === 'after';\n // order of row group totals depends on position\n var valueCols = insertAfter ? valueColumns.slice() : valueColumns.slice().reverse();\n var _loop_1 = function (i) {\n var valueCol = valueCols[i];\n var colIds = [];\n pivotColumnGroupDefs.forEach(function (groupDef) {\n colIds = colIds.concat(_this.extractColIdsForValueColumn(groupDef, valueCol));\n });\n var withGroup = valueCols.length > 1 || !this_1.gridOptionsService.is('removePivotHeaderRowWhenSingleValueColumn');\n this_1.createRowGroupTotal(pivotColumnGroupDefs, pivotColumnDefs, valueCol, colIds, insertAfter, withGroup);\n };\n var this_1 = this;\n for (var i = 0; i < valueCols.length; i++) {\n _loop_1(i);\n }\n };\n PivotColDefService.prototype.extractColIdsForValueColumn = function (groupDef, valueColumn) {\n var _this = this;\n var group = groupDef;\n if (!group.children) {\n var colDef = group;\n return colDef.pivotValueColumn === valueColumn && colDef.colId ? [colDef.colId] : [];\n }\n var colIds = [];\n group.children\n .forEach(function (grp) {\n _this.extractColIdsForValueColumn(grp, valueColumn);\n var childColIds = _this.extractColIdsForValueColumn(grp, valueColumn);\n colIds = colIds.concat(childColIds);\n });\n return colIds;\n };\n PivotColDefService.prototype.createRowGroupTotal = function (parentChildren, pivotColumnDefs, valueColumn, colIds, insertAfter, addGroup) {\n var measureColumns = this.columnModel.getValueColumns();\n var colDef;\n if (measureColumns.length === 0) {\n colDef = this.createColDef(null, '-', []);\n }\n else {\n var columnName = this.columnModel.getDisplayNameForColumn(valueColumn, 'header');\n colDef = this.createColDef(valueColumn, columnName, []);\n colDef.pivotTotalColumnIds = colIds;\n }\n colDef.colId = PivotColDefService_1.PIVOT_ROW_TOTAL_PREFIX + colDef.colId;\n pivotColumnDefs.push(colDef);\n var valueGroup = addGroup ? {\n children: [colDef],\n pivotKeys: [],\n groupId: PivotColDefService_1.PIVOT_ROW_TOTAL_PREFIX + \"_pivotGroup_\" + valueColumn.getColId(),\n } : colDef;\n insertAfter ? parentChildren.push(valueGroup) : parentChildren.unshift(valueGroup);\n };\n PivotColDefService.prototype.createColDef = function (valueColumn, headerName, pivotKeys, totalColumn) {\n if (totalColumn === void 0) { totalColumn = false; }\n var colDef = {};\n // This is null when there are no measure columns and we're creating placeholder columns\n if (valueColumn) {\n var colDefToCopy = valueColumn.getColDef();\n Object.assign(colDef, colDefToCopy);\n // even if original column was hidden, we always show the pivot value column, otherwise it would be\n // very confusing for people thinking the pivot is broken\n colDef.hide = false;\n }\n colDef.headerName = headerName;\n colDef.colId = this.generateColumnId(pivotKeys || [], valueColumn && !totalColumn ? valueColumn.getColId() : '');\n // pivot columns repeat over field, so it makes sense to use the unique id instead. For example if you want to\n // assign values to pinned bottom rows using setPinnedBottomRowData the value service will use this colId.\n colDef.field = colDef.colId;\n // this is to support using pinned rows, normally the data will be extracted from the aggData object using the colId\n // however pinned rows still access the data object by field, this prevents values with dots from being treated as complex objects\n colDef.valueGetter = function (params) { var _a; return (_a = params.data) === null || _a === void 0 ? void 0 : _a[params.colDef.field]; };\n colDef.pivotKeys = pivotKeys;\n colDef.pivotValueColumn = valueColumn;\n if (colDef.filter === true) {\n colDef.filter = 'agNumberColumnFilter';\n }\n return colDef;\n };\n PivotColDefService.prototype.sameAggFuncs = function (aggFuncs) {\n if (aggFuncs.length == 1) {\n return true;\n }\n //check if all aggFunc's match\n for (var i = 1; i < aggFuncs.length; i++) {\n if (aggFuncs[i] !== aggFuncs[0]) {\n return false;\n }\n }\n return true;\n };\n PivotColDefService.prototype.headerNameComparator = function (userComparator, a, b) {\n if (userComparator) {\n return userComparator(a.headerName, b.headerName);\n }\n else {\n if (a.headerName && !b.headerName) {\n return 1;\n }\n else if (!a.headerName && b.headerName) {\n return -1;\n }\n // slightly naff here - just to satify typescript\n // really should be &&, but if so ts complains\n // the above if/else checks would deal with either being falsy, so at this stage if either are falsy, both are\n // ..still naff though\n if (!a.headerName || !b.headerName) {\n return 0;\n }\n if (a.headerName < b.headerName) {\n return -1;\n }\n if (a.headerName > b.headerName) {\n return 1;\n }\n return 0;\n }\n };\n PivotColDefService.prototype.merge = function (m1, m2) {\n m2.forEach(function (value, key, map) {\n var existingList = m1.has(key) ? m1.get(key) : [];\n var updatedList = __spreadArray$N(__spreadArray$N([], __read$1j(existingList)), __read$1j(value));\n m1.set(key, updatedList);\n });\n };\n PivotColDefService.prototype.generateColumnGroupId = function (pivotKeys) {\n var pivotCols = this.columnModel.getPivotColumns().map(function (col) { return col.getColId(); });\n return \"pivotGroup_\" + pivotCols.join('-') + \"_\" + pivotKeys.join('-');\n };\n PivotColDefService.prototype.generateColumnId = function (pivotKeys, measureColumnId) {\n var pivotCols = this.columnModel.getPivotColumns().map(function (col) { return col.getColId(); });\n return \"pivot_\" + pivotCols.join('-') + \"_\" + pivotKeys.join('-') + \"_\" + measureColumnId;\n };\n var PivotColDefService_1;\n PivotColDefService.PIVOT_ROW_TOTAL_PREFIX = 'PivotRowTotal_';\n __decorate$2q([\n Autowired('columnModel')\n ], PivotColDefService.prototype, \"columnModel\", void 0);\n PivotColDefService = PivotColDefService_1 = __decorate$2q([\n Bean('pivotColDefService')\n ], PivotColDefService);\n return PivotColDefService;\n}(BeanStub));\n\nvar __extends$3e = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$2p = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar PivotStage = /** @class */ (function (_super) {\n __extends$3e(PivotStage, _super);\n function PivotStage() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.uniqueValues = {};\n return _this;\n }\n PivotStage.prototype.execute = function (params) {\n var changedPath = params.changedPath;\n if (this.columnModel.isPivotActive()) {\n this.executePivotOn(changedPath);\n }\n else {\n this.executePivotOff(changedPath);\n }\n };\n PivotStage.prototype.executePivotOff = function (changedPath) {\n this.aggregationColumnsHashLastTime = null;\n this.uniqueValues = {};\n if (this.columnModel.isSecondaryColumnsPresent()) {\n this.columnModel.setSecondaryColumns(null, \"rowModelUpdated\");\n if (changedPath) {\n changedPath.setInactive();\n }\n }\n };\n PivotStage.prototype.executePivotOn = function (changedPath) {\n var uniqueValues = this.bucketUpRowNodes(changedPath);\n var uniqueValuesChanged = this.setUniqueValues(uniqueValues);\n var aggregationColumns = this.columnModel.getValueColumns();\n var aggregationColumnsHash = aggregationColumns.map(function (column) { return column.getId() + \"-\" + column.getColDef().headerName; }).join('#');\n var aggregationFuncsHash = aggregationColumns.map(function (column) { return column.getAggFunc().toString(); }).join('#');\n var aggregationColumnsChanged = this.aggregationColumnsHashLastTime !== aggregationColumnsHash;\n var aggregationFuncsChanged = this.aggregationFuncsHashLastTime !== aggregationFuncsHash;\n this.aggregationColumnsHashLastTime = aggregationColumnsHash;\n this.aggregationFuncsHashLastTime = aggregationFuncsHash;\n var groupColumnsHash = this.columnModel.getRowGroupColumns().map(function (column) { return column.getId(); }).join('#');\n var groupColumnsChanged = groupColumnsHash !== this.groupColumnsHashLastTime;\n this.groupColumnsHashLastTime = groupColumnsHash;\n if (uniqueValuesChanged || aggregationColumnsChanged || groupColumnsChanged || aggregationFuncsChanged) {\n var _a = this.pivotColDefService.createPivotColumnDefs(this.uniqueValues), pivotColumnGroupDefs = _a.pivotColumnGroupDefs, pivotColumnDefs = _a.pivotColumnDefs;\n this.pivotColumnDefs = pivotColumnDefs;\n this.columnModel.setSecondaryColumns(pivotColumnGroupDefs, \"rowModelUpdated\");\n // because the secondary columns have changed, then the aggregation needs to visit the whole\n // tree again, so we make the changedPath not active, to force aggregation to visit all paths.\n if (changedPath) {\n changedPath.setInactive();\n }\n }\n };\n PivotStage.prototype.setUniqueValues = function (newValues) {\n var json1 = JSON.stringify(newValues);\n var json2 = JSON.stringify(this.uniqueValues);\n var uniqueValuesChanged = json1 !== json2;\n // we only continue the below if the unique values are different, as otherwise\n // the result will be the same as the last time we did it\n if (uniqueValuesChanged) {\n this.uniqueValues = newValues;\n return true;\n }\n else {\n return false;\n }\n };\n PivotStage.prototype.bucketUpRowNodes = function (changedPath) {\n var _this = this;\n // accessed from inside inner function\n var uniqueValues = {};\n // ensure childrenMapped is cleared, as if a node has been filtered out it should not have mapped children.\n changedPath.forEachChangedNodeDepthFirst(function (node) {\n if (node.leafGroup) {\n node.childrenMapped = null;\n }\n });\n var recursivelyBucketFilteredChildren = function (node) {\n var _a;\n if (node.leafGroup) {\n _this.bucketRowNode(node, uniqueValues);\n }\n else {\n (_a = node.childrenAfterFilter) === null || _a === void 0 ? void 0 : _a.forEach(recursivelyBucketFilteredChildren);\n }\n };\n changedPath.executeFromRootNode(recursivelyBucketFilteredChildren);\n return uniqueValues;\n };\n PivotStage.prototype.bucketRowNode = function (rowNode, uniqueValues) {\n var pivotColumns = this.columnModel.getPivotColumns();\n if (pivotColumns.length === 0) {\n rowNode.childrenMapped = null;\n }\n else {\n rowNode.childrenMapped = this.bucketChildren(rowNode.childrenAfterFilter, pivotColumns, 0, uniqueValues);\n }\n if (rowNode.sibling) {\n rowNode.sibling.childrenMapped = rowNode.childrenMapped;\n }\n };\n PivotStage.prototype.bucketChildren = function (children, pivotColumns, pivotIndex, uniqueValues) {\n var _this = this;\n var mappedChildren = {};\n var pivotColumn = pivotColumns[pivotIndex];\n // map the children out based on the pivot column\n children.forEach(function (child) {\n var key = _this.valueService.getKeyForNode(pivotColumn, child);\n if (_.missing(key)) {\n key = '';\n }\n if (!uniqueValues[key]) {\n uniqueValues[key] = {};\n }\n if (!mappedChildren[key]) {\n mappedChildren[key] = [];\n }\n mappedChildren[key].push(child);\n });\n // if it's the last pivot column, return as is, otherwise go one level further in the map\n if (pivotIndex === pivotColumns.length - 1) {\n return mappedChildren;\n }\n else {\n var result_1 = {};\n _.iterateObject(mappedChildren, function (key, value) {\n result_1[key] = _this.bucketChildren(value, pivotColumns, pivotIndex + 1, uniqueValues[key]);\n });\n return result_1;\n }\n };\n PivotStage.prototype.getPivotColumnDefs = function () {\n return this.pivotColumnDefs;\n };\n __decorate$2p([\n Autowired('valueService')\n ], PivotStage.prototype, \"valueService\", void 0);\n __decorate$2p([\n Autowired('columnModel')\n ], PivotStage.prototype, \"columnModel\", void 0);\n __decorate$2p([\n Autowired('pivotColDefService')\n ], PivotStage.prototype, \"pivotColDefService\", void 0);\n PivotStage = __decorate$2p([\n Bean('pivotStage')\n ], PivotStage);\n return PivotStage;\n}(BeanStub));\n\nvar __extends$3d = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$2o = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\n// @ts-ignore\nvar AGBigInt = typeof BigInt === 'undefined' ? null : BigInt;\nvar AggFuncService = /** @class */ (function (_super) {\n __extends$3d(AggFuncService, _super);\n function AggFuncService() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.aggFuncsMap = {};\n _this.initialised = false;\n return _this;\n }\n AggFuncService_1 = AggFuncService;\n AggFuncService.prototype.init = function () {\n if (this.initialised) {\n return;\n }\n this.initialiseWithDefaultAggregations();\n this.addAggFuncs(this.gridOptionsService.get('aggFuncs'));\n };\n AggFuncService.prototype.initialiseWithDefaultAggregations = function () {\n this.aggFuncsMap[AggFuncService_1.AGG_SUM] = aggSum;\n this.aggFuncsMap[AggFuncService_1.AGG_FIRST] = aggFirst;\n this.aggFuncsMap[AggFuncService_1.AGG_LAST] = aggLast;\n this.aggFuncsMap[AggFuncService_1.AGG_MIN] = aggMin;\n this.aggFuncsMap[AggFuncService_1.AGG_MAX] = aggMax;\n this.aggFuncsMap[AggFuncService_1.AGG_COUNT] = aggCount;\n this.aggFuncsMap[AggFuncService_1.AGG_AVG] = aggAvg;\n this.initialised = true;\n };\n AggFuncService.prototype.isAggFuncPossible = function (column, func) {\n var allKeys = this.getFuncNames(column);\n var allowed = _.includes(allKeys, func);\n var funcExists = _.exists(this.aggFuncsMap[func]);\n return allowed && funcExists;\n };\n AggFuncService.prototype.getDefaultAggFunc = function (column) {\n var defaultAgg = column.getColDef().defaultAggFunc;\n if (_.exists(defaultAgg) && this.isAggFuncPossible(column, defaultAgg)) {\n return defaultAgg;\n }\n if (this.isAggFuncPossible(column, AggFuncService_1.AGG_SUM)) {\n return AggFuncService_1.AGG_SUM;\n }\n var allKeys = this.getFuncNames(column);\n return _.existsAndNotEmpty(allKeys) ? allKeys[0] : null;\n };\n AggFuncService.prototype.addAggFuncs = function (aggFuncs) {\n _.iterateObject(aggFuncs, this.addAggFunc.bind(this));\n };\n AggFuncService.prototype.addAggFunc = function (key, aggFunc) {\n this.init();\n this.aggFuncsMap[key] = aggFunc;\n };\n AggFuncService.prototype.getAggFunc = function (name) {\n this.init();\n return this.aggFuncsMap[name];\n };\n AggFuncService.prototype.getFuncNames = function (column) {\n var userAllowedFuncs = column.getColDef().allowedAggFuncs;\n return userAllowedFuncs == null ? Object.keys(this.aggFuncsMap).sort() : userAllowedFuncs;\n };\n AggFuncService.prototype.clear = function () {\n this.aggFuncsMap = {};\n };\n var AggFuncService_1;\n AggFuncService.AGG_SUM = 'sum';\n AggFuncService.AGG_FIRST = 'first';\n AggFuncService.AGG_LAST = 'last';\n AggFuncService.AGG_MIN = 'min';\n AggFuncService.AGG_MAX = 'max';\n AggFuncService.AGG_COUNT = 'count';\n AggFuncService.AGG_AVG = 'avg';\n __decorate$2o([\n PostConstruct\n ], AggFuncService.prototype, \"init\", null);\n AggFuncService = AggFuncService_1 = __decorate$2o([\n Bean('aggFuncService')\n ], AggFuncService);\n return AggFuncService;\n}(BeanStub));\nfunction aggSum(params) {\n var values = params.values;\n var result = null; // the logic ensures that we never combine bigint arithmetic with numbers, but TS is hard to please\n // for optimum performance, we use a for loop here rather than calling any helper methods or using functional code\n for (var i = 0; i < values.length; i++) {\n var value = values[i];\n if (typeof value === 'number') {\n if (result === null) {\n result = value;\n }\n else {\n if (AGBigInt) {\n result += typeof result === 'number' ? value : AGBigInt(value);\n }\n else {\n result += value;\n }\n }\n }\n else if (typeof value === 'bigint') {\n if (result === null) {\n result = value;\n }\n else {\n result = (typeof result === 'bigint' ? result : AGBigInt(result)) + value;\n }\n }\n }\n return result;\n}\nfunction aggFirst(params) {\n return params.values.length > 0 ? params.values[0] : null;\n}\nfunction aggLast(params) {\n return params.values.length > 0 ? _.last(params.values) : null;\n}\nfunction aggMin(params) {\n var values = params.values;\n var result = null;\n // for optimum performance, we use a for loop here rather than calling any helper methods or using functional code\n for (var i = 0; i < values.length; i++) {\n var value = values[i];\n if ((typeof value === 'number' || typeof value === 'bigint') && (result === null || result > value)) {\n result = value;\n }\n }\n return result;\n}\nfunction aggMax(params) {\n var values = params.values;\n var result = null;\n // for optimum performance, we use a for loop here rather than calling any helper methods or using functional code\n for (var i = 0; i < values.length; i++) {\n var value = values[i];\n if ((typeof value === 'number' || typeof value === 'bigint') && (result === null || result < value)) {\n result = value;\n }\n }\n return result;\n}\nfunction aggCount(params) {\n var _a, _b;\n var values = params.values;\n var result = 0;\n // for optimum performance, we use a for loop here rather than calling any helper methods or using functional code\n for (var i = 0; i < values.length; i++) {\n var value = values[i];\n // check if the value is from a group, in which case use the group's count\n result += value != null && typeof value.value === 'number' ? value.value : 1;\n }\n // the previous aggregation data\n var existingAggData = (_b = (_a = params.rowNode) === null || _a === void 0 ? void 0 : _a.aggData) === null || _b === void 0 ? void 0 : _b[params.column.getColId()];\n if (existingAggData && existingAggData.value === result) {\n // the underlying values haven't changed, return the old object to avoid triggering change detection\n return existingAggData;\n }\n // it's important to wrap it in the object so we can determine if this is a group level\n return {\n value: result,\n toString: function () {\n return this.value.toString();\n },\n // used for sorting\n toNumber: function () {\n return this.value;\n }\n };\n}\n// the average function is tricky as the multiple levels require weighted averages\n// for the non-leaf node aggregations.\nfunction aggAvg(params) {\n var _a, _b, _c;\n var values = params.values;\n var sum = 0; // the logic ensures that we never combine bigint arithmetic with numbers, but TS is hard to please\n var count = 0;\n // for optimum performance, we use a for loop here rather than calling any helper methods or using functional code\n for (var i = 0; i < values.length; i++) {\n var currentValue = values[i];\n var valueToAdd = null;\n if (typeof currentValue === 'number' || typeof currentValue === 'bigint') {\n valueToAdd = currentValue;\n count++;\n }\n else if (currentValue != null && (typeof currentValue.value === 'number' || typeof currentValue.value === 'bigint') && typeof currentValue.count === 'number') {\n // we are aggregating groups, so we take the aggregated values to calculated a weighted average\n if (AGBigInt) {\n valueToAdd = currentValue.value * (typeof currentValue.value === 'number' ? currentValue.count : AGBigInt(currentValue.count));\n }\n else {\n valueToAdd = currentValue.value * currentValue.count;\n }\n count += currentValue.count;\n }\n if (typeof valueToAdd === 'number') {\n if (AGBigInt) {\n sum += typeof sum === 'number' ? valueToAdd : AGBigInt(valueToAdd);\n }\n else {\n sum += valueToAdd;\n }\n }\n else if (typeof valueToAdd === 'bigint') {\n sum = (typeof sum === 'bigint' ? sum : AGBigInt(sum)) + valueToAdd;\n }\n }\n var value = null;\n // avoid divide by zero error\n if (count > 0) {\n if (AGBigInt) {\n value = sum / (typeof sum === 'number' ? count : AGBigInt(count));\n }\n else {\n value = sum / count;\n }\n }\n // the previous aggregation data\n var existingAggData = (_b = (_a = params.rowNode) === null || _a === void 0 ? void 0 : _a.aggData) === null || _b === void 0 ? void 0 : _b[(_c = params.column) === null || _c === void 0 ? void 0 : _c.getColId()];\n if (existingAggData && existingAggData.count === count && existingAggData.value === value) {\n // the underlying values haven't changed, return the old object to avoid triggering change detection\n return existingAggData;\n }\n // the result will be an object. when this cell is rendered, only the avg is shown.\n // however when this cell is part of another aggregation, the count is also needed\n // to create a weighted average for the next level.\n return {\n count: count,\n value: value,\n // the grid by default uses toString to render values for an object, so this\n // is a trick to get the default cellRenderer to display the avg value\n toString: function () {\n return typeof this.value === 'number' || typeof this.value === 'bigint' ? this.value.toString() : '';\n },\n // used for sorting\n toNumber: function () {\n return this.value;\n }\n };\n}\n\nvar __extends$3c = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$2n = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar DropZoneColumnComp = /** @class */ (function (_super) {\n __extends$3c(DropZoneColumnComp, _super);\n function DropZoneColumnComp(column, dragSourceDropTarget, ghost, dropZonePurpose, horizontal) {\n var _this = _super.call(this) || this;\n _this.column = column;\n _this.dragSourceDropTarget = dragSourceDropTarget;\n _this.ghost = ghost;\n _this.dropZonePurpose = dropZonePurpose;\n _this.horizontal = horizontal;\n _this.popupShowing = false;\n return _this;\n }\n DropZoneColumnComp.prototype.init = function () {\n var _this = this;\n this.setTemplate(DropZoneColumnComp.TEMPLATE);\n var eGui = this.getGui();\n var isFunctionsReadOnly = this.gridOptionsService.is('functionsReadOnly');\n this.addElementClasses(eGui);\n this.addElementClasses(this.eDragHandle, 'drag-handle');\n this.addElementClasses(this.eText, 'text');\n this.addElementClasses(this.eButton, 'button');\n this.eDragHandle.appendChild(_.createIconNoSpan('columnDrag', this.gridOptionsService));\n this.eButton.appendChild(_.createIconNoSpan('cancel', this.gridOptionsService));\n this.setupSort();\n this.displayName = this.columnModel.getDisplayNameForColumn(this.column, 'columnDrop');\n this.setupComponents();\n if (!this.ghost && !isFunctionsReadOnly) {\n this.addDragSource();\n }\n this.setupAria();\n this.addManagedListener(this.eventService, Column.EVENT_SORT_CHANGED, function () {\n _this.setupAria();\n });\n this.setupTooltip();\n this.activateTabIndex();\n };\n DropZoneColumnComp.prototype.setupAria = function () {\n var translate = this.localeService.getLocaleTextFunc();\n var _a = this.getColumnAndAggFuncName(), name = _a.name, aggFuncName = _a.aggFuncName;\n var aggSeparator = translate('ariaDropZoneColumnComponentAggFuncSeparator', ' of ');\n var sortDirection = {\n asc: translate('ariaDropZoneColumnComponentSortAscending', 'ascending'),\n desc: translate('ariaDropZoneColumnComponentSortDescending', 'descending'),\n };\n var columnSort = this.column.getSort();\n var isSortSuppressed = this.gridOptionsService.is('rowGroupPanelSuppressSort');\n var ariaInstructions = [\n [\n aggFuncName && \"\" + aggFuncName + aggSeparator,\n name,\n this.isGroupingZone() && !isSortSuppressed && columnSort && \", \" + sortDirection[columnSort]\n ].filter(function (part) { return !!part; }).join(''),\n ];\n var isFunctionsReadOnly = this.gridOptionsService.is('functionsReadOnly');\n if (this.isAggregationZone() && !isFunctionsReadOnly) {\n var aggregationMenuAria = translate('ariaDropZoneColumnValueItemDescription', 'Press ENTER to change the aggregation type');\n ariaInstructions.push(aggregationMenuAria);\n }\n if (this.isGroupingZone() && this.column.getColDef().sortable && !isSortSuppressed) {\n var sortProgressAria = translate('ariaDropZoneColumnGroupItemDescription', 'Press ENTER to sort');\n ariaInstructions.push(sortProgressAria);\n }\n var deleteAria = translate('ariaDropZoneColumnComponentDescription', 'Press DELETE to remove');\n ariaInstructions.push(deleteAria);\n _.setAriaLabel(this.getGui(), ariaInstructions.join('. '));\n };\n DropZoneColumnComp.prototype.setupTooltip = function () {\n var _this = this;\n var refresh = function () {\n var newTooltipText = _this.column.getColDef().headerTooltip;\n _this.setTooltip(newTooltipText);\n };\n refresh();\n this.addManagedListener(this.eventService, Events.EVENT_NEW_COLUMNS_LOADED, refresh);\n };\n DropZoneColumnComp.prototype.setupSort = function () {\n var _this = this;\n var canSort = this.column.getColDef().sortable;\n var isGroupingZone = this.isGroupingZone();\n if (!canSort || !isGroupingZone) {\n return;\n }\n if (!this.gridOptionsService.is('rowGroupPanelSuppressSort')) {\n this.eSortIndicator.setupSort(this.column, true);\n var performSort_1 = function (event) {\n event.preventDefault();\n var sortUsingCtrl = _this.gridOptionsService.get('multiSortKey') === 'ctrl';\n var multiSort = sortUsingCtrl ? (event.ctrlKey || event.metaKey) : event.shiftKey;\n _this.sortController.progressSort(_this.column, multiSort, 'uiColumnSorted');\n };\n this.addGuiEventListener('click', performSort_1);\n this.addGuiEventListener('keydown', function (e) {\n var isEnter = e.key === KeyCode.ENTER;\n if (isEnter && _this.isGroupingZone()) {\n performSort_1(e);\n }\n });\n }\n };\n DropZoneColumnComp.prototype.addDragSource = function () {\n var _this = this;\n var dragSource = {\n type: DragSourceType.ToolPanel,\n eElement: this.eDragHandle,\n defaultIconName: DragAndDropService.ICON_HIDE,\n getDragItem: function () { return _this.createDragItem(); },\n dragItemName: this.displayName,\n dragSourceDropTarget: this.dragSourceDropTarget\n };\n this.dragAndDropService.addDragSource(dragSource, true);\n this.addDestroyFunc(function () { return _this.dragAndDropService.removeDragSource(dragSource); });\n };\n DropZoneColumnComp.prototype.createDragItem = function () {\n var visibleState = {};\n visibleState[this.column.getId()] = this.column.isVisible();\n return {\n columns: [this.column],\n visibleState: visibleState\n };\n };\n DropZoneColumnComp.prototype.setupComponents = function () {\n this.setTextValue();\n this.setupRemove();\n if (this.ghost) {\n this.addCssClass('ag-column-drop-cell-ghost');\n }\n if (this.isAggregationZone() && !this.gridOptionsService.is('functionsReadOnly')) {\n this.addGuiEventListener('click', this.onShowAggFuncSelection.bind(this));\n }\n };\n DropZoneColumnComp.prototype.setupRemove = function () {\n var _this = this;\n _.setDisplayed(this.eButton, !this.gridOptionsService.is('functionsReadOnly'));\n var agEvent = { type: DropZoneColumnComp.EVENT_COLUMN_REMOVE };\n this.addGuiEventListener('keydown', function (e) {\n var isEnter = e.key === KeyCode.ENTER;\n var isDelete = e.key === KeyCode.DELETE;\n if (isDelete) {\n e.preventDefault();\n _this.dispatchEvent(agEvent);\n }\n if (isEnter && _this.isAggregationZone() && !_this.gridOptionsService.is('functionsReadOnly')) {\n e.preventDefault();\n _this.onShowAggFuncSelection();\n }\n });\n this.addManagedListener(this.eButton, 'click', function (mouseEvent) {\n _this.dispatchEvent(agEvent);\n mouseEvent.stopPropagation();\n });\n var touchListener = new TouchListener(this.eButton);\n this.addManagedListener(touchListener, TouchListener.EVENT_TAP, function () {\n _this.dispatchEvent(agEvent);\n });\n this.addDestroyFunc(touchListener.destroy.bind(touchListener));\n };\n DropZoneColumnComp.prototype.getColumnAndAggFuncName = function () {\n var name = this.displayName;\n var aggFuncName = '';\n if (this.isAggregationZone()) {\n var aggFunc = this.column.getAggFunc();\n // if aggFunc is a string, we can use it, but if it's a function, then we swap with 'func'\n var aggFuncString = typeof aggFunc === 'string' ? aggFunc : 'agg';\n var localeTextFunc = this.localeService.getLocaleTextFunc();\n aggFuncName = localeTextFunc(aggFuncString, aggFuncString);\n }\n return { name: name, aggFuncName: aggFuncName };\n };\n DropZoneColumnComp.prototype.setTextValue = function () {\n var _a = this.getColumnAndAggFuncName(), name = _a.name, aggFuncName = _a.aggFuncName;\n var displayValue = this.isAggregationZone() ? aggFuncName + \"(\" + name + \")\" : name;\n var displayValueSanitised = _.escapeString(displayValue);\n this.eText.innerHTML = displayValueSanitised;\n };\n DropZoneColumnComp.prototype.onShowAggFuncSelection = function () {\n var _this = this;\n if (this.popupShowing) {\n return;\n }\n this.popupShowing = true;\n var virtualList = new VirtualList('select-agg-func');\n var rows = this.aggFuncService.getFuncNames(this.column);\n var eGui = this.getGui();\n var virtualListGui = virtualList.getGui();\n virtualList.setModel({\n getRow: function (index) { return rows[index]; },\n getRowCount: function () { return rows.length; }\n });\n this.getContext().createBean(virtualList);\n var ePopup = _.loadTemplate(/* html*/ \"
\");\n ePopup.style.top = '0px';\n ePopup.style.left = '0px';\n ePopup.appendChild(virtualListGui);\n ePopup.style.width = eGui.clientWidth + \"px\";\n var focusoutListener = this.addManagedListener(ePopup, 'focusout', function (e) {\n if (!ePopup.contains(e.relatedTarget) && addPopupRes) {\n addPopupRes.hideFunc();\n }\n });\n var popupHiddenFunc = function (callbackEvent) {\n _this.destroyBean(virtualList);\n _this.popupShowing = false;\n if ((callbackEvent === null || callbackEvent === void 0 ? void 0 : callbackEvent.key) === 'Escape') {\n eGui.focus();\n }\n if (focusoutListener) {\n focusoutListener();\n }\n };\n var translate = this.localeService.getLocaleTextFunc();\n var addPopupRes = this.popupService.addPopup({\n modal: true,\n eChild: ePopup,\n closeOnEsc: true,\n closedCallback: popupHiddenFunc,\n ariaLabel: translate('ariaLabelAggregationFunction', 'Aggregation Function')\n });\n if (addPopupRes) {\n virtualList.setComponentCreator(this.createAggSelect.bind(this, addPopupRes.hideFunc));\n }\n virtualList.addGuiEventListener('keydown', function (e) {\n if (e.key === KeyCode.ENTER || e.key === KeyCode.SPACE) {\n var row = virtualList.getLastFocusedRow();\n if (row == null) {\n return;\n }\n var comp = virtualList.getComponentAt(row);\n if (comp) {\n comp.selectItem();\n }\n }\n });\n this.popupService.positionPopupByComponent({\n type: 'aggFuncSelect',\n eventSource: eGui,\n ePopup: ePopup,\n keepWithinBounds: true,\n column: this.column,\n position: 'under'\n });\n virtualList.refresh();\n var rowToFocus = rows.findIndex(function (r) { return r === _this.column.getAggFunc(); });\n if (rowToFocus === -1) {\n rowToFocus = 0;\n }\n virtualList.focusRow(rowToFocus);\n };\n DropZoneColumnComp.prototype.createAggSelect = function (hidePopup, value) {\n var _this = this;\n var itemSelected = function () {\n hidePopup();\n if (_this.gridOptionsService.is('functionsPassive')) {\n var event_1 = {\n type: Events.EVENT_COLUMN_AGG_FUNC_CHANGE_REQUEST,\n columns: [_this.column],\n aggFunc: value\n };\n _this.eventService.dispatchEvent(event_1);\n }\n else {\n _this.columnModel.setColumnAggFunc(_this.column, value, \"toolPanelDragAndDrop\");\n }\n };\n var localeTextFunc = this.localeService.getLocaleTextFunc();\n var aggFuncString = value.toString();\n var aggFuncStringTranslated = localeTextFunc(aggFuncString, aggFuncString);\n var comp = new AggItemComp(itemSelected, aggFuncStringTranslated);\n return comp;\n };\n DropZoneColumnComp.prototype.addElementClasses = function (el, suffix) {\n suffix = suffix ? \"-\" + suffix : '';\n var direction = this.horizontal ? 'horizontal' : 'vertical';\n el.classList.add(\"ag-column-drop-cell\" + suffix, \"ag-column-drop-\" + direction + \"-cell\" + suffix);\n };\n DropZoneColumnComp.prototype.isAggregationZone = function () {\n return this.dropZonePurpose === 'aggregation';\n };\n DropZoneColumnComp.prototype.isGroupingZone = function () {\n return this.dropZonePurpose === 'rowGroup';\n };\n DropZoneColumnComp.EVENT_COLUMN_REMOVE = 'columnRemove';\n DropZoneColumnComp.TEMPLATE = \"\\n \\n \\n \\n \\n \";\n __decorate$2n([\n Autowired('dragAndDropService')\n ], DropZoneColumnComp.prototype, \"dragAndDropService\", void 0);\n __decorate$2n([\n Autowired('columnModel')\n ], DropZoneColumnComp.prototype, \"columnModel\", void 0);\n __decorate$2n([\n Autowired('popupService')\n ], DropZoneColumnComp.prototype, \"popupService\", void 0);\n __decorate$2n([\n Optional('aggFuncService')\n ], DropZoneColumnComp.prototype, \"aggFuncService\", void 0);\n __decorate$2n([\n Autowired('sortController')\n ], DropZoneColumnComp.prototype, \"sortController\", void 0);\n __decorate$2n([\n RefSelector('eText')\n ], DropZoneColumnComp.prototype, \"eText\", void 0);\n __decorate$2n([\n RefSelector('eDragHandle')\n ], DropZoneColumnComp.prototype, \"eDragHandle\", void 0);\n __decorate$2n([\n RefSelector('eButton')\n ], DropZoneColumnComp.prototype, \"eButton\", void 0);\n __decorate$2n([\n RefSelector('eSortIndicator')\n ], DropZoneColumnComp.prototype, \"eSortIndicator\", void 0);\n __decorate$2n([\n PostConstruct\n ], DropZoneColumnComp.prototype, \"init\", null);\n return DropZoneColumnComp;\n}(Component));\nvar AggItemComp = /** @class */ (function (_super) {\n __extends$3c(AggItemComp, _super);\n function AggItemComp(itemSelected, value) {\n var _this = _super.call(this, /* html */ \"
\") || this;\n _this.selectItem = itemSelected;\n _this.getGui().innerText = value;\n _this.addGuiEventListener('click', _this.selectItem);\n return _this;\n }\n return AggItemComp;\n}(Component));\n\nvar __extends$3b = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$2m = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __read$1i = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray$M = (undefined && undefined.__spreadArray) || function (to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\n to[j] = from[i];\n return to;\n};\nvar BaseDropZonePanel = /** @class */ (function (_super) {\n __extends$3b(BaseDropZonePanel, _super);\n function BaseDropZonePanel(horizontal, dropZonePurpose) {\n var _this = _super.call(this, /* html */ \"
\") || this;\n _this.horizontal = horizontal;\n _this.dropZonePurpose = dropZonePurpose;\n _this.state = BaseDropZonePanel.STATE_NOT_DRAGGING;\n _this.guiDestroyFunctions = [];\n _this.childColumnComponents = [];\n _this.resizeEnabled = false;\n _this.addElementClasses(_this.getGui());\n _this.eColumnDropList = document.createElement('div');\n _this.addElementClasses(_this.eColumnDropList, 'list');\n _.setAriaRole(_this.eColumnDropList, 'listbox');\n return _this;\n }\n BaseDropZonePanel.prototype.isHorizontal = function () {\n return this.horizontal;\n };\n BaseDropZonePanel.prototype.toggleResizable = function (resizable) {\n this.positionableFeature.setResizable(resizable ? { bottom: true } : false);\n this.resizeEnabled = resizable;\n };\n BaseDropZonePanel.prototype.setBeans = function (beans) {\n this.beans = beans;\n };\n BaseDropZonePanel.prototype.destroy = function () {\n this.destroyGui();\n _super.prototype.destroy.call(this);\n };\n BaseDropZonePanel.prototype.destroyGui = function () {\n this.guiDestroyFunctions.forEach(function (func) { return func(); });\n this.guiDestroyFunctions.length = 0;\n this.childColumnComponents.length = 0;\n _.clearElement(this.getGui());\n _.clearElement(this.eColumnDropList);\n };\n BaseDropZonePanel.prototype.init = function (params) {\n this.params = params;\n this.createManagedBean(new ManagedFocusFeature(this.getFocusableElement(), {\n handleKeyDown: this.handleKeyDown.bind(this)\n }));\n this.addManagedListener(this.beans.eventService, Events.EVENT_NEW_COLUMNS_LOADED, this.refreshGui.bind(this));\n this.addManagedPropertyListener('functionsReadOnly', this.refreshGui.bind(this));\n this.setupDropTarget();\n this.positionableFeature = new PositionableFeature(this.getGui(), { minHeight: 100 });\n this.createManagedBean(this.positionableFeature);\n // we don't know if this bean will be initialised before columnModel.\n // if columnModel first, then below will work\n // if columnModel second, then below will put blank in, and then above event gets first when columnModel is set up\n this.refreshGui();\n _.setAriaLabel(this.eColumnDropList, this.getAriaLabel());\n };\n BaseDropZonePanel.prototype.handleKeyDown = function (e) {\n var isVertical = !this.horizontal;\n var isNext = e.key === KeyCode.DOWN;\n var isPrevious = e.key === KeyCode.UP;\n if (!isVertical) {\n var isRtl = this.gridOptionsService.is('enableRtl');\n isNext = (!isRtl && e.key === KeyCode.RIGHT) || (isRtl && e.key === KeyCode.LEFT);\n isPrevious = (!isRtl && e.key === KeyCode.LEFT) || (isRtl && e.key === KeyCode.RIGHT);\n }\n if (!isNext && !isPrevious) {\n return;\n }\n var el = this.focusService.findNextFocusableElement(this.getFocusableElement(), false, isPrevious);\n if (el) {\n e.preventDefault();\n el.focus();\n }\n };\n BaseDropZonePanel.prototype.addElementClasses = function (el, suffix) {\n suffix = suffix ? \"-\" + suffix : '';\n var direction = this.horizontal ? 'horizontal' : 'vertical';\n el.classList.add(\"ag-column-drop\" + suffix, \"ag-column-drop-\" + direction + suffix);\n };\n BaseDropZonePanel.prototype.setupDropTarget = function () {\n this.dropTarget = {\n getContainer: this.getGui.bind(this),\n getIconName: this.getIconName.bind(this),\n onDragging: this.onDragging.bind(this),\n onDragEnter: this.onDragEnter.bind(this),\n onDragLeave: this.onDragLeave.bind(this),\n onDragStop: this.onDragStop.bind(this),\n isInterestedIn: this.isInterestedIn.bind(this)\n };\n this.beans.dragAndDropService.addDropTarget(this.dropTarget);\n };\n BaseDropZonePanel.prototype.isInterestedIn = function (type) {\n // not interested in row drags\n return type === DragSourceType.HeaderCell || type === DragSourceType.ToolPanel;\n };\n BaseDropZonePanel.prototype.checkInsertIndex = function (draggingEvent) {\n var newIndex = this.getNewInsertIndex(draggingEvent);\n // <0 happens when drag is no a direction we are interested in, eg drag is up/down but in horizontal panel\n if (newIndex < 0) {\n return false;\n }\n var changed = newIndex !== this.insertIndex;\n if (changed) {\n this.insertIndex = newIndex;\n }\n return changed;\n };\n BaseDropZonePanel.prototype.getNewInsertIndex = function (draggingEvent) {\n var _this = this;\n var mouseEvent = draggingEvent.event;\n var mouseLocation = this.horizontal ? mouseEvent.clientX : mouseEvent.clientY;\n var boundsList = this.childColumnComponents.map(function (col) { return (col.getGui().getBoundingClientRect()); });\n // find the non-ghost component we're hovering\n var hoveredIndex = boundsList.findIndex(function (rect) { return (_this.horizontal ? (rect.right > mouseLocation && rect.left < mouseLocation) : (rect.top < mouseLocation && rect.bottom > mouseLocation)); });\n // not hovering a non-ghost component\n if (hoveredIndex === -1) {\n var enableRtl = this.beans.gridOptionsService.is('enableRtl');\n // if mouse is below or right of all components then new index should be placed last\n var isLast = boundsList.every(function (rect) { return (mouseLocation > (_this.horizontal ? rect.right : rect.bottom)); });\n if (isLast) {\n return enableRtl && this.horizontal ? 0 : this.childColumnComponents.length;\n }\n // if mouse is above or left of all components, new index is first\n var isFirst = boundsList.every(function (rect) { return (mouseLocation < (_this.horizontal ? rect.left : rect.top)); });\n if (isFirst) {\n return enableRtl && this.horizontal ? this.childColumnComponents.length : 0;\n }\n // must be hovering a ghost, don't change the index\n return this.insertIndex;\n }\n // if the old index is equal to or less than the index of our new target\n // we need to shift right, to insert after rather than before\n if (this.insertIndex <= hoveredIndex) {\n return hoveredIndex + 1;\n }\n return hoveredIndex;\n };\n BaseDropZonePanel.prototype.checkDragStartedBySelf = function (draggingEvent) {\n if (this.state !== BaseDropZonePanel.STATE_NOT_DRAGGING) {\n return;\n }\n this.state = BaseDropZonePanel.STATE_REARRANGE_COLUMNS;\n this.potentialDndColumns = draggingEvent.dragSource.getDragItem().columns || [];\n this.refreshGui();\n this.checkInsertIndex(draggingEvent);\n this.refreshGui();\n };\n BaseDropZonePanel.prototype.onDragging = function (draggingEvent) {\n this.checkDragStartedBySelf(draggingEvent);\n if (this.checkInsertIndex(draggingEvent)) {\n this.refreshGui();\n }\n };\n BaseDropZonePanel.prototype.onDragEnter = function (draggingEvent) {\n // this will contain all columns that are potential drops\n var dragColumns = draggingEvent.dragSource.getDragItem().columns || [];\n this.state = BaseDropZonePanel.STATE_NEW_COLUMNS_IN;\n // take out columns that are not droppable\n var goodDragColumns = dragColumns.filter(this.isColumnDroppable.bind(this));\n if (goodDragColumns.length > 0) {\n var hideColumnOnExit = this.isRowGroupPanel() && !this.gridOptionsService.is('suppressRowGroupHidesColumns') && !draggingEvent.fromNudge;\n if (hideColumnOnExit) {\n var dragItem = draggingEvent.dragSource.getDragItem();\n var columns = dragItem.columns;\n this.setColumnsVisible(columns, false, \"uiColumnDragged\");\n }\n this.potentialDndColumns = goodDragColumns;\n this.checkInsertIndex(draggingEvent);\n this.refreshGui();\n }\n };\n BaseDropZonePanel.prototype.setColumnsVisible = function (columns, visible, source) {\n if (source === void 0) { source = \"api\"; }\n if (columns) {\n var allowedCols = columns.filter(function (c) { return !c.getColDef().lockVisible; });\n this.colModel.setColumnsVisible(allowedCols, visible, source);\n }\n };\n BaseDropZonePanel.prototype.isPotentialDndColumns = function () {\n return _.existsAndNotEmpty(this.potentialDndColumns);\n };\n BaseDropZonePanel.prototype.isRowGroupPanel = function () {\n return this.dropZonePurpose === 'rowGroup';\n };\n BaseDropZonePanel.prototype.onDragLeave = function (draggingEvent) {\n // if the dragging started from us, we remove the group, however if it started\n // some place else, then we don't, as it was only 'asking'\n if (this.state === BaseDropZonePanel.STATE_REARRANGE_COLUMNS) {\n var columns = draggingEvent.dragSource.getDragItem().columns || [];\n this.removeColumns(columns);\n }\n if (this.isPotentialDndColumns()) {\n var showColumnOnExit = this.isRowGroupPanel() && !this.gridOptionsService.is('suppressMakeColumnVisibleAfterUnGroup') && !draggingEvent.fromNudge;\n if (showColumnOnExit) {\n var dragItem = draggingEvent.dragSource.getDragItem();\n this.setColumnsVisible(dragItem.columns, true, \"uiColumnDragged\");\n }\n this.potentialDndColumns = [];\n this.refreshGui();\n }\n this.state = BaseDropZonePanel.STATE_NOT_DRAGGING;\n };\n BaseDropZonePanel.prototype.onDragStop = function () {\n if (this.isPotentialDndColumns()) {\n var success = false;\n if (this.state === BaseDropZonePanel.STATE_NEW_COLUMNS_IN) {\n this.addColumns(this.potentialDndColumns);\n success = true;\n }\n else {\n success = this.rearrangeColumns(this.potentialDndColumns);\n }\n this.potentialDndColumns = [];\n // If the function is passive, then we don't refresh, as we assume the client application\n // is going to call setRowGroups / setPivots / setValues at a later point which will then\n // cause a refresh. This gives a nice GUI where the ghost stays until the app has caught\n // up with the changes. However, if there was no change in the order, then we do need to\n // refresh to reset the columns\n if (!this.beans.gridOptionsService.is('functionsPassive') || !success) {\n this.refreshGui();\n }\n }\n this.state = BaseDropZonePanel.STATE_NOT_DRAGGING;\n };\n BaseDropZonePanel.prototype.removeColumns = function (columnsToRemove) {\n var newColumnList = this.getExistingColumns().filter(function (col) { return !_.includes(columnsToRemove, col); });\n this.updateColumns(newColumnList);\n };\n BaseDropZonePanel.prototype.addColumns = function (columnsToAdd) {\n if (!columnsToAdd) {\n return;\n }\n var newColumnList = this.getExistingColumns().slice();\n var colsToAddNoDuplicates = columnsToAdd.filter(function (col) { return newColumnList.indexOf(col) < 0; });\n _.insertArrayIntoArray(newColumnList, colsToAddNoDuplicates, this.insertIndex);\n this.updateColumns(newColumnList);\n };\n BaseDropZonePanel.prototype.rearrangeColumns = function (columnsToAdd) {\n var newColumnList = this.getNonGhostColumns().slice();\n _.insertArrayIntoArray(newColumnList, columnsToAdd, this.insertIndex);\n if (_.areEqual(newColumnList, this.getExistingColumns())) {\n return false;\n }\n this.updateColumns(newColumnList);\n return true;\n };\n BaseDropZonePanel.prototype.refreshGui = function () {\n // we reset the scroll position after the refresh.\n // if we don't do this, then the list will always scroll to the top\n // each time we refresh it. this is because part of the refresh empties\n // out the list which sets scroll to zero. so the user could be just\n // reordering the list - we want to prevent the resetting of the scroll.\n // this is relevant for vertical display only (as horizontal has no scroll)\n var scrollTop = this.eColumnDropList.scrollTop;\n var resizeEnabled = this.resizeEnabled;\n var focusedIndex = this.getFocusedItem();\n var alternateElement = this.focusService.findNextFocusableElement();\n if (!alternateElement) {\n alternateElement = this.focusService.findNextFocusableElement(undefined, false, true);\n }\n this.toggleResizable(false);\n this.destroyGui();\n this.addIconAndTitleToGui();\n this.addEmptyMessageToGui();\n this.addColumnsToGui();\n if (!this.isHorizontal()) {\n this.eColumnDropList.scrollTop = scrollTop;\n }\n if (resizeEnabled) {\n this.toggleResizable(resizeEnabled);\n }\n // focus should only be restored when keyboard mode\n // otherwise mouse clicks will cause containers to scroll\n // without no apparent reason.\n if (this.focusService.isKeyboardMode()) {\n this.restoreFocus(focusedIndex, alternateElement);\n }\n };\n BaseDropZonePanel.prototype.getFocusedItem = function () {\n var eGui = this.getGui();\n var activeElement = this.gridOptionsService.getDocument().activeElement;\n if (!eGui.contains(activeElement)) {\n return -1;\n }\n var items = Array.from(eGui.querySelectorAll('.ag-column-drop-cell'));\n return items.indexOf(activeElement);\n };\n BaseDropZonePanel.prototype.restoreFocus = function (index, alternateElement) {\n var eGui = this.getGui();\n var items = Array.from(eGui.querySelectorAll('.ag-column-drop-cell'));\n if (index === -1) {\n return;\n }\n if (items.length === 0) {\n alternateElement.focus();\n }\n var indexToFocus = Math.min(items.length - 1, index);\n var el = items[indexToFocus];\n if (el) {\n el.focus();\n }\n };\n BaseDropZonePanel.prototype.getNonGhostColumns = function () {\n var _this = this;\n var existingColumns = this.getExistingColumns();\n if (this.isPotentialDndColumns()) {\n return existingColumns.filter(function (column) { return !_.includes(_this.potentialDndColumns, column); });\n }\n return existingColumns;\n };\n BaseDropZonePanel.prototype.addColumnsToGui = function () {\n var _this = this;\n var nonGhostColumns = this.getNonGhostColumns();\n var itemsToAddToGui = nonGhostColumns.map(function (column) { return (_this.createColumnComponent(column, false)); });\n if (this.isPotentialDndColumns()) {\n var dndColumns = this.potentialDndColumns.map(function (column) { return (_this.createColumnComponent(column, true)); });\n if (this.insertIndex >= itemsToAddToGui.length) {\n itemsToAddToGui.push.apply(itemsToAddToGui, __spreadArray$M([], __read$1i(dndColumns)));\n }\n else {\n itemsToAddToGui.splice.apply(itemsToAddToGui, __spreadArray$M([this.insertIndex, 0], __read$1i(dndColumns)));\n }\n }\n this.appendChild(this.eColumnDropList);\n itemsToAddToGui.forEach(function (columnComponent, index) {\n if (index > 0) {\n _this.addArrow(_this.eColumnDropList);\n }\n _this.eColumnDropList.appendChild(columnComponent.getGui());\n });\n this.addAriaLabelsToComponents();\n };\n BaseDropZonePanel.prototype.addAriaLabelsToComponents = function () {\n var _this = this;\n this.childColumnComponents.forEach(function (comp, idx) {\n var eGui = comp.getGui();\n _.setAriaPosInSet(eGui, idx + 1);\n _.setAriaSetSize(eGui, _this.childColumnComponents.length);\n });\n };\n BaseDropZonePanel.prototype.createColumnComponent = function (column, ghost) {\n var _this = this;\n var columnComponent = new DropZoneColumnComp(column, this.dropTarget, ghost, this.dropZonePurpose, this.horizontal);\n columnComponent.addEventListener(DropZoneColumnComp.EVENT_COLUMN_REMOVE, this.removeColumns.bind(this, [column]));\n this.beans.context.createBean(columnComponent);\n this.guiDestroyFunctions.push(function () { return _this.destroyBean(columnComponent); });\n if (!ghost) {\n this.childColumnComponents.push(columnComponent);\n }\n return columnComponent;\n };\n BaseDropZonePanel.prototype.addIconAndTitleToGui = function () {\n var eGroupIcon = this.params.icon;\n var eTitleBar = document.createElement('div');\n _.setAriaHidden(eTitleBar, true);\n this.addElementClasses(eTitleBar, 'title-bar');\n this.addElementClasses(eGroupIcon, 'icon');\n this.addOrRemoveCssClass('ag-column-drop-empty', this.isExistingColumnsEmpty());\n eTitleBar.appendChild(eGroupIcon);\n if (!this.horizontal) {\n var eTitle = document.createElement('span');\n this.addElementClasses(eTitle, 'title');\n eTitle.innerHTML = this.params.title;\n eTitleBar.appendChild(eTitle);\n }\n this.appendChild(eTitleBar);\n };\n BaseDropZonePanel.prototype.isExistingColumnsEmpty = function () {\n return this.getExistingColumns().length === 0;\n };\n BaseDropZonePanel.prototype.addEmptyMessageToGui = function () {\n if (!this.isExistingColumnsEmpty() || this.isPotentialDndColumns()) {\n return;\n }\n var eMessage = document.createElement('span');\n eMessage.innerHTML = this.params.emptyMessage;\n this.addElementClasses(eMessage, 'empty-message');\n this.eColumnDropList.appendChild(eMessage);\n };\n BaseDropZonePanel.prototype.addArrow = function (eParent) {\n // only add the arrows if the layout is horizontal\n if (this.horizontal) {\n // for RTL it's a left arrow, otherwise it's a right arrow\n var enableRtl = this.beans.gridOptionsService.is('enableRtl');\n var icon = _.createIconNoSpan(enableRtl ? 'smallLeft' : 'smallRight', this.beans.gridOptionsService);\n this.addElementClasses(icon, 'cell-separator');\n eParent.appendChild(icon);\n }\n };\n BaseDropZonePanel.STATE_NOT_DRAGGING = 'notDragging';\n BaseDropZonePanel.STATE_NEW_COLUMNS_IN = 'newColumnsIn';\n BaseDropZonePanel.STATE_REARRANGE_COLUMNS = 'rearrangeColumns';\n __decorate$2m([\n Autowired('columnModel')\n ], BaseDropZonePanel.prototype, \"colModel\", void 0);\n __decorate$2m([\n Autowired('focusService')\n ], BaseDropZonePanel.prototype, \"focusService\", void 0);\n return BaseDropZonePanel;\n}(Component));\n\nvar __extends$3a = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$2l = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar RowGroupDropZonePanel = /** @class */ (function (_super) {\n __extends$3a(RowGroupDropZonePanel, _super);\n function RowGroupDropZonePanel(horizontal) {\n return _super.call(this, horizontal, 'rowGroup') || this;\n }\n RowGroupDropZonePanel.prototype.passBeansUp = function () {\n _super.prototype.setBeans.call(this, {\n gridOptionsService: this.gridOptionsService,\n eventService: this.eventService,\n context: this.getContext(),\n loggerFactory: this.loggerFactory,\n dragAndDropService: this.dragAndDropService\n });\n var localeTextFunc = this.localeService.getLocaleTextFunc();\n var emptyMessage = localeTextFunc('rowGroupColumnsEmptyMessage', 'Drag here to set row groups');\n var title = localeTextFunc('groups', 'Row Groups');\n _super.prototype.init.call(this, {\n dragAndDropIcon: DragAndDropService.ICON_GROUP,\n icon: _.createIconNoSpan('rowGroupPanel', this.gridOptionsService, null),\n emptyMessage: emptyMessage,\n title: title\n });\n this.addManagedListener(this.eventService, Events.EVENT_COLUMN_ROW_GROUP_CHANGED, this.refreshGui.bind(this));\n };\n RowGroupDropZonePanel.prototype.getAriaLabel = function () {\n var translate = this.localeService.getLocaleTextFunc();\n var label = translate('ariaRowGroupDropZonePanelLabel', 'Row Groups');\n return label;\n };\n RowGroupDropZonePanel.prototype.getTooltipParams = function () {\n var res = _super.prototype.getTooltipParams.call(this);\n res.location = 'rowGroupColumnsList';\n return res;\n };\n RowGroupDropZonePanel.prototype.isColumnDroppable = function (column) {\n // we never allow grouping of secondary columns\n if (this.gridOptionsService.is('functionsReadOnly') || !column.isPrimary()) {\n return false;\n }\n return column.isAllowRowGroup() && !column.isRowGroupActive();\n };\n RowGroupDropZonePanel.prototype.updateColumns = function (columns) {\n if (this.gridOptionsService.is('functionsPassive')) {\n var event_1 = {\n type: Events.EVENT_COLUMN_ROW_GROUP_CHANGE_REQUEST,\n columns: columns\n };\n this.eventService.dispatchEvent(event_1);\n }\n else {\n this.columnModel.setRowGroupColumns(columns, \"toolPanelUi\");\n }\n };\n RowGroupDropZonePanel.prototype.getIconName = function () {\n return this.isPotentialDndColumns() ? DragAndDropService.ICON_GROUP : DragAndDropService.ICON_NOT_ALLOWED;\n };\n RowGroupDropZonePanel.prototype.getExistingColumns = function () {\n return this.columnModel.getRowGroupColumns();\n };\n __decorate$2l([\n Autowired('columnModel')\n ], RowGroupDropZonePanel.prototype, \"columnModel\", void 0);\n __decorate$2l([\n Autowired('loggerFactory')\n ], RowGroupDropZonePanel.prototype, \"loggerFactory\", void 0);\n __decorate$2l([\n Autowired('dragAndDropService')\n ], RowGroupDropZonePanel.prototype, \"dragAndDropService\", void 0);\n __decorate$2l([\n PostConstruct\n ], RowGroupDropZonePanel.prototype, \"passBeansUp\", null);\n return RowGroupDropZonePanel;\n}(BaseDropZonePanel));\n\nvar __extends$39 = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$2k = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar PivotDropZonePanel = /** @class */ (function (_super) {\n __extends$39(PivotDropZonePanel, _super);\n function PivotDropZonePanel(horizontal) {\n return _super.call(this, horizontal, 'pivot') || this;\n }\n PivotDropZonePanel.prototype.passBeansUp = function () {\n _super.prototype.setBeans.call(this, {\n gridOptionsService: this.gridOptionsService,\n eventService: this.eventService,\n context: this.getContext(),\n loggerFactory: this.loggerFactory,\n dragAndDropService: this.dragAndDropService\n });\n var localeTextFunc = this.localeService.getLocaleTextFunc();\n var emptyMessage = localeTextFunc('pivotColumnsEmptyMessage', 'Drag here to set column labels');\n var title = localeTextFunc('pivots', 'Column Labels');\n _super.prototype.init.call(this, {\n dragAndDropIcon: DragAndDropService.ICON_GROUP,\n icon: _.createIconNoSpan('pivotPanel', this.gridOptionsService, null),\n emptyMessage: emptyMessage,\n title: title\n });\n this.addManagedListener(this.eventService, Events.EVENT_NEW_COLUMNS_LOADED, this.refresh.bind(this));\n this.addManagedListener(this.eventService, Events.EVENT_COLUMN_PIVOT_CHANGED, this.refresh.bind(this));\n this.addManagedListener(this.eventService, Events.EVENT_COLUMN_PIVOT_MODE_CHANGED, this.checkVisibility.bind(this));\n this.refresh();\n };\n PivotDropZonePanel.prototype.getAriaLabel = function () {\n var translate = this.localeService.getLocaleTextFunc();\n var label = translate('ariaPivotDropZonePanelLabel', 'Column Labels');\n return label;\n };\n PivotDropZonePanel.prototype.getTooltipParams = function () {\n var res = _super.prototype.getTooltipParams.call(this);\n res.location = 'pivotColumnsList';\n return res;\n };\n PivotDropZonePanel.prototype.refresh = function () {\n this.checkVisibility();\n this.refreshGui();\n };\n PivotDropZonePanel.prototype.checkVisibility = function () {\n var pivotMode = this.columnModel.isPivotMode();\n if (this.isHorizontal()) {\n // what we do for horizontal (ie the pivot panel at the top) depends\n // on the user property as well as pivotMode.\n switch (this.gridOptionsService.get('pivotPanelShow')) {\n case 'always':\n this.setDisplayed(pivotMode);\n break;\n case 'onlyWhenPivoting':\n var pivotActive = this.columnModel.isPivotActive();\n this.setDisplayed(pivotMode && pivotActive);\n break;\n default:\n // never show it\n this.setDisplayed(false);\n break;\n }\n }\n else {\n // in toolPanel, the pivot panel is always shown when pivot mode is on\n this.setDisplayed(pivotMode);\n }\n };\n PivotDropZonePanel.prototype.isColumnDroppable = function (column) {\n // we never allow grouping of secondary columns\n if (this.gridOptionsService.is('functionsReadOnly') || !column.isPrimary()) {\n return false;\n }\n return column.isAllowPivot() && !column.isPivotActive();\n };\n PivotDropZonePanel.prototype.updateColumns = function (columns) {\n if (this.gridOptionsService.is('functionsPassive')) {\n var event_1 = {\n type: Events.EVENT_COLUMN_PIVOT_CHANGE_REQUEST,\n columns: columns\n };\n this.eventService.dispatchEvent(event_1);\n }\n else {\n this.columnModel.setPivotColumns(columns, \"toolPanelUi\");\n }\n };\n PivotDropZonePanel.prototype.getIconName = function () {\n return this.isPotentialDndColumns() ? DragAndDropService.ICON_PIVOT : DragAndDropService.ICON_NOT_ALLOWED;\n };\n PivotDropZonePanel.prototype.getExistingColumns = function () {\n return this.columnModel.getPivotColumns();\n };\n __decorate$2k([\n Autowired('columnModel')\n ], PivotDropZonePanel.prototype, \"columnModel\", void 0);\n __decorate$2k([\n Autowired('loggerFactory')\n ], PivotDropZonePanel.prototype, \"loggerFactory\", void 0);\n __decorate$2k([\n Autowired('dragAndDropService')\n ], PivotDropZonePanel.prototype, \"dragAndDropService\", void 0);\n __decorate$2k([\n PostConstruct\n ], PivotDropZonePanel.prototype, \"passBeansUp\", null);\n return PivotDropZonePanel;\n}(BaseDropZonePanel));\n\nvar __extends$38 = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$2j = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar GridHeaderDropZones = /** @class */ (function (_super) {\n __extends$38(GridHeaderDropZones, _super);\n function GridHeaderDropZones() {\n return _super.call(this) || this;\n }\n GridHeaderDropZones.prototype.postConstruct = function () {\n this.setGui(this.createNorthPanel());\n this.addManagedListener(this.eventService, Events.EVENT_COLUMN_ROW_GROUP_CHANGED, this.onRowGroupChanged.bind(this));\n this.addManagedListener(this.eventService, Events.EVENT_NEW_COLUMNS_LOADED, this.onRowGroupChanged.bind(this));\n this.addManagedPropertyListener('rowGroupPanelShow', this.onRowGroupChanged.bind(this));\n this.onRowGroupChanged();\n };\n GridHeaderDropZones.prototype.createNorthPanel = function () {\n var topPanelGui = document.createElement('div');\n var dropPanelVisibleListener = this.onDropPanelVisible.bind(this);\n topPanelGui.classList.add('ag-column-drop-wrapper');\n _.setAriaRole(topPanelGui, 'presentation');\n this.rowGroupComp = new RowGroupDropZonePanel(true);\n this.createManagedBean(this.rowGroupComp);\n this.pivotComp = new PivotDropZonePanel(true);\n this.createManagedBean(this.pivotComp);\n topPanelGui.appendChild(this.rowGroupComp.getGui());\n topPanelGui.appendChild(this.pivotComp.getGui());\n this.addManagedListener(this.rowGroupComp, Component.EVENT_DISPLAYED_CHANGED, dropPanelVisibleListener);\n this.addManagedListener(this.pivotComp, Component.EVENT_DISPLAYED_CHANGED, dropPanelVisibleListener);\n this.onDropPanelVisible();\n return topPanelGui;\n };\n GridHeaderDropZones.prototype.onDropPanelVisible = function () {\n var bothDisplayed = this.rowGroupComp.isDisplayed() && this.pivotComp.isDisplayed();\n this.rowGroupComp.addOrRemoveCssClass('ag-column-drop-horizontal-half-width', bothDisplayed);\n this.pivotComp.addOrRemoveCssClass('ag-column-drop-horizontal-half-width', bothDisplayed);\n };\n GridHeaderDropZones.prototype.onRowGroupChanged = function () {\n if (!this.rowGroupComp) {\n return;\n }\n var rowGroupPanelShow = this.gridOptionsService.get('rowGroupPanelShow');\n if (rowGroupPanelShow === 'always') {\n this.rowGroupComp.setDisplayed(true);\n }\n else if (rowGroupPanelShow === 'onlyWhenGrouping') {\n var grouping = !this.columnModel.isRowGroupEmpty();\n this.rowGroupComp.setDisplayed(grouping);\n }\n else {\n this.rowGroupComp.setDisplayed(false);\n }\n };\n __decorate$2j([\n Autowired('columnModel')\n ], GridHeaderDropZones.prototype, \"columnModel\", void 0);\n __decorate$2j([\n PostConstruct\n ], GridHeaderDropZones.prototype, \"postConstruct\", null);\n return GridHeaderDropZones;\n}(Component));\n\nvar __extends$37 = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$2i = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar FilterAggregatesStage = /** @class */ (function (_super) {\n __extends$37(FilterAggregatesStage, _super);\n function FilterAggregatesStage() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n FilterAggregatesStage.prototype.execute = function (params) {\n var _this = this;\n var isPivotMode = this.columnModel.isPivotMode();\n var isAggFilterActive = this.filterManager.isAggregateFilterPresent()\n || this.filterManager.isAggregateQuickFilterPresent();\n // This is the default filter for applying only to leaf nodes, realistically this should not apply as primary agg columns,\n // should not be applied by the filterManager if getGroupAggFiltering is missing. Predicate will apply filters to leaf level.\n var defaultPrimaryColumnPredicate = function (params) { return !params.node.group; };\n // Default secondary column predicate, selecting only leaf level groups.\n var defaultSecondaryColumnPredicate = (function (params) { return params.node.leafGroup; });\n // The predicate to determine whether filters should apply to this row. Either defined by the user in groupAggFiltering or a default depending\n // on current pivot mode status.\n var applyFilterToNode = this.gridOptionsService.getGroupAggFiltering()\n || (isPivotMode ? defaultSecondaryColumnPredicate : defaultPrimaryColumnPredicate);\n var changedPath = params.changedPath;\n var preserveChildren = function (node, recursive) {\n if (recursive === void 0) { recursive = false; }\n if (node.childrenAfterFilter) {\n node.childrenAfterAggFilter = node.childrenAfterFilter;\n if (recursive) {\n node.childrenAfterAggFilter.forEach(function (child) { return preserveChildren(child, recursive); });\n }\n _this.setAllChildrenCount(node);\n }\n if (node.sibling) {\n node.sibling.childrenAfterAggFilter = node.childrenAfterAggFilter;\n }\n };\n var filterChildren = function (node) {\n var _a;\n node.childrenAfterAggFilter = ((_a = node.childrenAfterFilter) === null || _a === void 0 ? void 0 : _a.filter(function (child) {\n var _a;\n var shouldFilterRow = applyFilterToNode({ node: child });\n if (shouldFilterRow) {\n var doesNodePassFilter = _this.filterManager.doesRowPassAggregateFilters({ rowNode: child });\n if (doesNodePassFilter) {\n // Node has passed, so preserve children\n preserveChildren(child, true);\n return true;\n }\n }\n var hasChildPassed = (_a = child.childrenAfterAggFilter) === null || _a === void 0 ? void 0 : _a.length;\n return hasChildPassed;\n })) || null;\n _this.setAllChildrenCount(node);\n if (node.sibling) {\n node.sibling.childrenAfterAggFilter = node.childrenAfterAggFilter;\n }\n };\n changedPath.forEachChangedNodeDepthFirst(isAggFilterActive ? filterChildren : preserveChildren, true);\n };\n FilterAggregatesStage.prototype.setAllChildrenCountTreeData = function (rowNode) {\n // for tree data, we include all children, groups and leafs\n var allChildrenCount = 0;\n rowNode.childrenAfterAggFilter.forEach(function (child) {\n // include child itself\n allChildrenCount++;\n // include children of children\n allChildrenCount += child.allChildrenCount;\n });\n rowNode.setAllChildrenCount(allChildrenCount);\n };\n FilterAggregatesStage.prototype.setAllChildrenCountGridGrouping = function (rowNode) {\n // for grid data, we only count the leafs\n var allChildrenCount = 0;\n rowNode.childrenAfterAggFilter.forEach(function (child) {\n if (child.group) {\n allChildrenCount += child.allChildrenCount;\n }\n else {\n allChildrenCount++;\n }\n });\n rowNode.setAllChildrenCount(allChildrenCount);\n };\n FilterAggregatesStage.prototype.setAllChildrenCount = function (rowNode) {\n if (!rowNode.hasChildren()) {\n rowNode.setAllChildrenCount(null);\n return;\n }\n if (this.gridOptionsService.isTreeData()) {\n this.setAllChildrenCountTreeData(rowNode);\n }\n else {\n this.setAllChildrenCountGridGrouping(rowNode);\n }\n };\n __decorate$2i([\n Autowired('filterManager')\n ], FilterAggregatesStage.prototype, \"filterManager\", void 0);\n __decorate$2i([\n Autowired('columnModel')\n ], FilterAggregatesStage.prototype, \"columnModel\", void 0);\n FilterAggregatesStage = __decorate$2i([\n Bean('filterAggregatesStage')\n ], FilterAggregatesStage);\n return FilterAggregatesStage;\n}(BeanStub));\n\n// DO NOT UPDATE MANUALLY: Generated from script during build time\nvar VERSION$g = '30.0.6';\n\nvar __extends$36 = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$2h = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar GroupFilter = /** @class */ (function (_super) {\n __extends$36(GroupFilter, _super);\n function GroupFilter() {\n return _super.call(this, /* html */ \"\\n
\\n
\\n
\\n
\\n \") || this;\n }\n GroupFilter.prototype.postConstruct = function () {\n this.initialiseTabGuard({});\n };\n GroupFilter.prototype.init = function (params) {\n var _this = this;\n this.params = params;\n this.validateParams();\n return this.updateGroups().then(function () {\n _this.addManagedListener(_this.eventService, Events.EVENT_COLUMN_ROW_GROUP_CHANGED, function () { return _this.onColumnRowGroupChanged(); });\n });\n };\n GroupFilter.prototype.validateParams = function () {\n var colDef = this.params.colDef;\n if (colDef.field) {\n _.doOnce(function () { return console.warn('AG Grid: Group Column Filter does not work with the colDef property \"field\". This property will be ignored.'); }, 'groupFilterFieldParam');\n }\n if (colDef.filterValueGetter) {\n _.doOnce(function () { return console.warn('AG Grid: Group Column Filter does not work with the colDef property \"filterValueGetter\". This property will be ignored.'); }, 'groupFilterFilterValueGetterParam');\n }\n if (colDef.filterParams) {\n _.doOnce(function () { return console.warn('AG Grid: Group Column Filter does not work with the colDef property \"filterParams\". This property will be ignored.'); }, 'groupFilterFilterParams');\n }\n };\n GroupFilter.prototype.updateGroups = function () {\n var sourceColumns = this.updateGroupField();\n return this.getUnderlyingFilters(sourceColumns);\n };\n GroupFilter.prototype.getSourceColumns = function () {\n this.groupColumn = this.params.column;\n if (this.gridOptionsService.is('treeData')) {\n _.doOnce(function () { return console.warn('AG Grid: Group Column Filter does not work with Tree Data enabled. Please disable Tree Data, or use a different filter.'); }, 'groupFilterTreeData');\n return [];\n }\n var sourceColumns = this.columnModel.getSourceColumnsForGroupColumn(this.groupColumn);\n if (!sourceColumns) {\n _.doOnce(function () { return console.warn('AG Grid: Group Column Filter only works on group columns. Please use a different filter.'); }, 'groupFilterNotGroupColumn');\n return [];\n }\n return sourceColumns;\n };\n GroupFilter.prototype.updateGroupField = function () {\n var _this = this;\n _.clearElement(this.eGroupField);\n if (this.eGroupFieldSelect) {\n this.destroyBean(this.eGroupFieldSelect);\n }\n var allSourceColumns = this.getSourceColumns();\n var sourceColumns = allSourceColumns.filter(function (sourceColumn) { return sourceColumn.isFilterAllowed(); });\n if (!sourceColumns.length) {\n this.selectedColumn = undefined;\n _.setDisplayed(this.eGroupField, false);\n return null;\n }\n if (allSourceColumns.length === 1) {\n // we only want to hide the group field element if there's only one group column.\n // If there's one group column that has a filter, but multiple columns in total,\n // we should still show the select so the user knows which column it's for.\n this.selectedColumn = sourceColumns[0];\n _.setDisplayed(this.eGroupField, false);\n }\n else {\n // keep the old selected column if it's still valid\n if (!this.selectedColumn || !sourceColumns.some(function (column) { return column.getId() === _this.selectedColumn.getId(); })) {\n this.selectedColumn = sourceColumns[0];\n }\n this.createGroupFieldSelectElement(sourceColumns);\n this.eGroupField.appendChild(this.eGroupFieldSelect.getGui());\n this.eGroupField.appendChild(_.loadTemplate(/* html */ \"
\"));\n _.setDisplayed(this.eGroupField, true);\n }\n return sourceColumns;\n };\n GroupFilter.prototype.createGroupFieldSelectElement = function (sourceColumns) {\n var _this = this;\n this.eGroupFieldSelect = this.createManagedBean(new AgSelect());\n var localeTextFunc = this.localeService.getLocaleTextFunc();\n this.eGroupFieldSelect.setLabel(localeTextFunc('groupFilterSelect', 'Select field:'));\n this.eGroupFieldSelect.setLabelAlignment('top');\n this.eGroupFieldSelect.addOptions(sourceColumns.map(function (sourceColumn) {\n var _a;\n return ({\n value: sourceColumn.getId(),\n text: (_a = _this.columnModel.getDisplayNameForColumn(sourceColumn, 'groupFilter', false)) !== null && _a !== void 0 ? _a : undefined\n });\n }));\n this.eGroupFieldSelect.setValue(this.selectedColumn.getId());\n this.eGroupFieldSelect.onValueChange(function (newValue) { return _this.updateSelectedColumn(newValue); });\n this.eGroupFieldSelect.addCssClass('ag-group-filter-field-select-wrapper');\n if (sourceColumns.length === 1) {\n this.eGroupFieldSelect.setDisabled(true);\n }\n };\n GroupFilter.prototype.getUnderlyingFilters = function (sourceColumns) {\n var _this = this;\n if (!sourceColumns) {\n this.filterColumnPairs = undefined;\n this.selectedFilter = undefined;\n this.groupColumn.setFilterActive(false, 'columnRowGroupChanged');\n return AgPromise.resolve();\n }\n var filterPromises = [];\n var filterColumnPairs = [];\n sourceColumns.forEach(function (column) {\n var filterWrapper = _this.filterManager.getOrCreateFilterWrapper(column, 'COLUMN_MENU');\n if (filterWrapper === null || filterWrapper === void 0 ? void 0 : filterWrapper.filterPromise) {\n filterPromises.push(filterWrapper.filterPromise.then(function (filter) {\n if (filter) {\n filterColumnPairs.push({\n filter: filter,\n column: column\n });\n }\n if (column.getId() === _this.selectedColumn.getId()) {\n _this.selectedFilter = filter !== null && filter !== void 0 ? filter : undefined;\n }\n return filter;\n }));\n }\n });\n return AgPromise.all(filterPromises).then(function () {\n _this.filterColumnPairs = filterColumnPairs;\n _this.groupColumn.setFilterActive(_this.isFilterActive(), 'columnRowGroupChanged');\n });\n };\n GroupFilter.prototype.addUnderlyingFilterElement = function () {\n var _this = this;\n _.clearElement(this.eUnderlyingFilter);\n if (!this.selectedColumn) {\n return AgPromise.resolve();\n }\n var filterWrapper = this.filterManager.getOrCreateFilterWrapper(this.selectedColumn, 'COLUMN_MENU');\n if (!filterWrapper) {\n return AgPromise.resolve();\n }\n return filterWrapper.guiPromise.then(function (gui) {\n var _a;\n _this.eUnderlyingFilter.appendChild(gui);\n (_a = filterWrapper.filterPromise) === null || _a === void 0 ? void 0 : _a.then(function (filter) {\n var _a, _b;\n (_a = filter === null || filter === void 0 ? void 0 : filter.afterGuiAttached) === null || _a === void 0 ? void 0 : _a.call(filter, _this.afterGuiAttachedParams);\n if (!((_b = _this.afterGuiAttachedParams) === null || _b === void 0 ? void 0 : _b.suppressFocus) && _this.eGroupFieldSelect && !_this.eGroupFieldSelect.isDisabled()) {\n _this.eGroupFieldSelect.getFocusableElement().focus();\n }\n });\n });\n };\n GroupFilter.prototype.updateSelectedColumn = function (columnId) {\n var _a, _b;\n if (!columnId) {\n return;\n }\n (_b = (_a = this.selectedFilter) === null || _a === void 0 ? void 0 : _a.afterGuiDetached) === null || _b === void 0 ? void 0 : _b.call(_a);\n var selectedFilterColumnPair = this.getFilterColumnPair(columnId);\n this.selectedColumn = selectedFilterColumnPair === null || selectedFilterColumnPair === void 0 ? void 0 : selectedFilterColumnPair.column;\n this.selectedFilter = selectedFilterColumnPair === null || selectedFilterColumnPair === void 0 ? void 0 : selectedFilterColumnPair.filter;\n this.dispatchEvent({\n type: GroupFilter.EVENT_SELECTED_COLUMN_CHANGED\n });\n this.addUnderlyingFilterElement();\n };\n GroupFilter.prototype.isFilterActive = function () {\n var _a;\n return !!((_a = this.filterColumnPairs) === null || _a === void 0 ? void 0 : _a.some(function (_a) {\n var filter = _a.filter;\n return filter.isFilterActive();\n }));\n };\n GroupFilter.prototype.doesFilterPass = function () {\n return true;\n };\n GroupFilter.prototype.getModel = function () {\n return null;\n };\n GroupFilter.prototype.setModel = function () {\n return AgPromise.resolve();\n };\n GroupFilter.prototype.afterGuiAttached = function (params) {\n this.afterGuiAttachedParams = params;\n this.addUnderlyingFilterElement();\n };\n GroupFilter.prototype.afterGuiDetached = function () {\n var _a, _b;\n _.clearElement(this.eUnderlyingFilter);\n (_b = (_a = this.selectedFilter) === null || _a === void 0 ? void 0 : _a.afterGuiDetached) === null || _b === void 0 ? void 0 : _b.call(_a);\n };\n GroupFilter.prototype.onColumnRowGroupChanged = function () {\n var _this = this;\n this.updateGroups().then(function () {\n _this.dispatchEvent({\n type: GroupFilter.EVENT_COLUMN_ROW_GROUP_CHANGED\n });\n _this.eventService.dispatchEvent({\n type: 'filterAllowedUpdated'\n });\n });\n };\n GroupFilter.prototype.getFilterColumnPair = function (columnId) {\n var _a;\n if (!columnId) {\n return undefined;\n }\n return (_a = this.filterColumnPairs) === null || _a === void 0 ? void 0 : _a.find(function (_a) {\n var column = _a.column;\n return column.getId() === columnId;\n });\n };\n GroupFilter.prototype.getSelectedFilter = function () {\n return this.selectedFilter;\n };\n GroupFilter.prototype.getSelectedColumn = function () {\n return this.selectedColumn;\n };\n GroupFilter.prototype.isFilterAllowed = function () {\n return !!this.selectedColumn;\n };\n GroupFilter.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n };\n GroupFilter.EVENT_COLUMN_ROW_GROUP_CHANGED = 'columnRowGroupChanged';\n GroupFilter.EVENT_SELECTED_COLUMN_CHANGED = 'selectedColumnChanged';\n __decorate$2h([\n Autowired('filterManager')\n ], GroupFilter.prototype, \"filterManager\", void 0);\n __decorate$2h([\n Autowired('columnModel')\n ], GroupFilter.prototype, \"columnModel\", void 0);\n __decorate$2h([\n RefSelector('eGroupField')\n ], GroupFilter.prototype, \"eGroupField\", void 0);\n __decorate$2h([\n RefSelector('eUnderlyingFilter')\n ], GroupFilter.prototype, \"eUnderlyingFilter\", void 0);\n __decorate$2h([\n PostConstruct\n ], GroupFilter.prototype, \"postConstruct\", null);\n return GroupFilter;\n}(TabGuardComp));\n\nvar __extends$35 = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$2g = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar GroupFloatingFilterComp = /** @class */ (function (_super) {\n __extends$35(GroupFloatingFilterComp, _super);\n function GroupFloatingFilterComp() {\n return _super.call(this, /* html */ \"\\n
\\n \") || this;\n }\n GroupFloatingFilterComp.prototype.init = function (params) {\n var _this = this;\n this.params = params;\n // we only support showing the underlying floating filter for multiple group columns\n var canShowUnderlyingFloatingFilter = this.gridOptionsService.get('groupDisplayType') === 'multipleColumns';\n return new AgPromise(function (resolve) {\n _this.params.parentFilterInstance(function (parentFilterInstance) {\n _this.parentFilterInstance = parentFilterInstance;\n if (canShowUnderlyingFloatingFilter) {\n _this.setupUnderlyingFloatingFilterElement().then(function () { return resolve(); });\n }\n else {\n _this.setupReadOnlyFloatingFilterElement();\n resolve();\n }\n });\n }).then(function () {\n _this.addManagedListener(_this.parentFilterInstance, GroupFilter.EVENT_SELECTED_COLUMN_CHANGED, function () { return _this.onSelectedColumnChanged(); });\n _this.addManagedListener(_this.parentFilterInstance, GroupFilter.EVENT_COLUMN_ROW_GROUP_CHANGED, function () { return _this.onColumnRowGroupChanged(); });\n });\n };\n GroupFloatingFilterComp.prototype.setupReadOnlyFloatingFilterElement = function () {\n var _this = this;\n if (!this.eFloatingFilterText) {\n this.eFloatingFilterText = this.createManagedBean(new AgInputTextField());\n var displayName = this.columnModel.getDisplayNameForColumn(this.params.column, 'header', true);\n var translate = this.localeService.getLocaleTextFunc();\n this.eFloatingFilterText\n .setDisabled(true)\n .setInputAriaLabel(displayName + \" \" + translate('ariaFilterInput', 'Filter Input'))\n .addGuiEventListener('click', function () { return _this.params.showParentFilter(); });\n }\n this.updateDisplayedValue();\n this.eFloatingFilter.appendChild(this.eFloatingFilterText.getGui());\n };\n GroupFloatingFilterComp.prototype.setupUnderlyingFloatingFilterElement = function () {\n var _this = this;\n this.showingUnderlyingFloatingFilter = false;\n this.underlyingFloatingFilter = undefined;\n _.clearElement(this.eFloatingFilter);\n var column = this.parentFilterInstance.getSelectedColumn();\n // we can only show the underlying filter if there is one instance (e.g. the underlying column is not visible)\n if (column && !column.isVisible()) {\n var compDetails = this.filterManager.getFloatingFilterCompDetails(column, this.params.showParentFilter);\n if (compDetails) {\n if (!this.columnVisibleChangedListener) {\n this.columnVisibleChangedListener = this.addManagedListener(column, Column.EVENT_VISIBLE_CHANGED, this.onColumnVisibleChanged.bind(this));\n }\n return compDetails.newAgStackInstance().then(function (floatingFilter) {\n var _a, _b;\n _this.underlyingFloatingFilter = floatingFilter;\n (_a = _this.underlyingFloatingFilter) === null || _a === void 0 ? void 0 : _a.onParentModelChanged((_b = _this.parentFilterInstance.getSelectedFilter()) === null || _b === void 0 ? void 0 : _b.getModel());\n _this.appendChild(floatingFilter.getGui());\n _this.showingUnderlyingFloatingFilter = true;\n });\n }\n }\n // fallback to the read-only version\n this.setupReadOnlyFloatingFilterElement();\n return AgPromise.resolve();\n };\n GroupFloatingFilterComp.prototype.onColumnVisibleChanged = function () {\n this.setupUnderlyingFloatingFilterElement();\n };\n GroupFloatingFilterComp.prototype.onParentModelChanged = function (_model, event) {\n var _a, _b;\n if (this.showingUnderlyingFloatingFilter) {\n (_a = this.underlyingFloatingFilter) === null || _a === void 0 ? void 0 : _a.onParentModelChanged((_b = this.parentFilterInstance.getSelectedFilter()) === null || _b === void 0 ? void 0 : _b.getModel(), event);\n }\n else {\n this.updateDisplayedValue();\n }\n };\n GroupFloatingFilterComp.prototype.updateDisplayedValue = function () {\n if (!this.parentFilterInstance || !this.eFloatingFilterText) {\n return;\n }\n var selectedFilter = this.parentFilterInstance.getSelectedFilter();\n if (!selectedFilter) {\n this.eFloatingFilterText.setValue('');\n this.eFloatingFilterText.setDisplayed(false);\n return;\n }\n this.eFloatingFilterText.setDisplayed(true);\n if (selectedFilter.getModelAsString) {\n var filterModel = selectedFilter.getModel();\n this.eFloatingFilterText.setValue(filterModel == null ? '' : selectedFilter.getModelAsString(filterModel));\n }\n else {\n this.eFloatingFilterText.setValue('');\n }\n };\n GroupFloatingFilterComp.prototype.onSelectedColumnChanged = function () {\n if (!this.showingUnderlyingFloatingFilter) {\n this.updateDisplayedValue();\n }\n };\n GroupFloatingFilterComp.prototype.onColumnRowGroupChanged = function () {\n if (!this.showingUnderlyingFloatingFilter) {\n this.updateDisplayedValue();\n }\n };\n GroupFloatingFilterComp.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n };\n __decorate$2g([\n Autowired('columnModel')\n ], GroupFloatingFilterComp.prototype, \"columnModel\", void 0);\n __decorate$2g([\n Autowired('filterManager')\n ], GroupFloatingFilterComp.prototype, \"filterManager\", void 0);\n __decorate$2g([\n RefSelector('eFloatingFilter')\n ], GroupFloatingFilterComp.prototype, \"eFloatingFilter\", void 0);\n return GroupFloatingFilterComp;\n}(Component));\n\nvar RowGroupingModule = {\n version: VERSION$g,\n moduleName: ModuleNames.RowGroupingModule,\n beans: [AggregationStage, FilterAggregatesStage, GroupStage, PivotColDefService, PivotStage, AggFuncService],\n agStackComponents: [\n { componentName: 'AgGridHeaderDropZones', componentClass: GridHeaderDropZones }\n ],\n userComponents: [\n { componentName: 'agGroupColumnFilter', componentClass: GroupFilter },\n { componentName: 'agGroupColumnFloatingFilter', componentClass: GroupFloatingFilterComp },\n ],\n dependantModules: [\n EnterpriseCoreModule\n ]\n};\n\nvar __extends$34 = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$2f = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar ValuesDropZonePanel = /** @class */ (function (_super) {\n __extends$34(ValuesDropZonePanel, _super);\n function ValuesDropZonePanel(horizontal) {\n return _super.call(this, horizontal, 'aggregation') || this;\n }\n ValuesDropZonePanel.prototype.passBeansUp = function () {\n _super.prototype.setBeans.call(this, {\n gridOptionsService: this.gridOptionsService,\n eventService: this.eventService,\n context: this.getContext(),\n loggerFactory: this.loggerFactory,\n dragAndDropService: this.dragAndDropService\n });\n var localeTextFunc = this.localeService.getLocaleTextFunc();\n var emptyMessage = localeTextFunc('valueColumnsEmptyMessage', 'Drag here to aggregate');\n var title = localeTextFunc('values', 'Values');\n _super.prototype.init.call(this, {\n dragAndDropIcon: DragAndDropService.ICON_AGGREGATE,\n icon: _.createIconNoSpan('valuePanel', this.gridOptionsService, null),\n emptyMessage: emptyMessage,\n title: title\n });\n this.addManagedListener(this.eventService, Events.EVENT_COLUMN_VALUE_CHANGED, this.refreshGui.bind(this));\n };\n ValuesDropZonePanel.prototype.getAriaLabel = function () {\n var translate = this.localeService.getLocaleTextFunc();\n var label = translate('ariaValuesDropZonePanelLabel', 'Values');\n return label;\n };\n ValuesDropZonePanel.prototype.getTooltipParams = function () {\n var res = _super.prototype.getTooltipParams.call(this);\n res.location = 'valueColumnsList';\n return res;\n };\n ValuesDropZonePanel.prototype.getIconName = function () {\n return this.isPotentialDndColumns() ? DragAndDropService.ICON_AGGREGATE : DragAndDropService.ICON_NOT_ALLOWED;\n };\n ValuesDropZonePanel.prototype.isColumnDroppable = function (column) {\n // we never allow grouping of secondary columns\n if (this.gridOptionsService.is('functionsReadOnly') || !column.isPrimary()) {\n return false;\n }\n return column.isAllowValue() && !column.isValueActive();\n };\n ValuesDropZonePanel.prototype.updateColumns = function (columns) {\n if (this.gridOptionsService.is('functionsPassive')) {\n var event_1 = {\n type: Events.EVENT_COLUMN_VALUE_CHANGE_REQUEST,\n columns: columns\n };\n this.eventService.dispatchEvent(event_1);\n }\n else {\n this.columnModel.setValueColumns(columns, \"toolPanelUi\");\n }\n };\n ValuesDropZonePanel.prototype.getExistingColumns = function () {\n return this.columnModel.getValueColumns();\n };\n __decorate$2f([\n Autowired('columnModel')\n ], ValuesDropZonePanel.prototype, \"columnModel\", void 0);\n __decorate$2f([\n Autowired('loggerFactory')\n ], ValuesDropZonePanel.prototype, \"loggerFactory\", void 0);\n __decorate$2f([\n Autowired('dragAndDropService')\n ], ValuesDropZonePanel.prototype, \"dragAndDropService\", void 0);\n __decorate$2f([\n PostConstruct\n ], ValuesDropZonePanel.prototype, \"passBeansUp\", null);\n return ValuesDropZonePanel;\n}(BaseDropZonePanel));\n\nvar __extends$33 = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$2e = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar PrimaryColsPanel = /** @class */ (function (_super) {\n __extends$33(PrimaryColsPanel, _super);\n function PrimaryColsPanel() {\n return _super.call(this, PrimaryColsPanel.TEMPLATE) || this;\n }\n // we allow dragging in the toolPanel, but not when this component appears in the column menu\n PrimaryColsPanel.prototype.init = function (allowDragging, params, eventType) {\n this.allowDragging = allowDragging;\n this.params = params;\n this.eventType = eventType;\n this.primaryColsHeaderPanel.init(this.params);\n var hideFilter = this.params.suppressColumnFilter;\n var hideSelect = this.params.suppressColumnSelectAll;\n var hideExpand = this.params.suppressColumnExpandAll;\n if (hideExpand && hideFilter && hideSelect) {\n this.primaryColsHeaderPanel.setDisplayed(false);\n }\n this.addManagedListener(this.primaryColsListPanel, 'groupExpanded', this.onGroupExpanded.bind(this));\n this.addManagedListener(this.primaryColsListPanel, 'selectionChanged', this.onSelectionChange.bind(this));\n this.primaryColsListPanel.init(this.params, this.allowDragging, this.eventType);\n this.addManagedListener(this.primaryColsHeaderPanel, 'expandAll', this.onExpandAll.bind(this));\n this.addManagedListener(this.primaryColsHeaderPanel, 'collapseAll', this.onCollapseAll.bind(this));\n this.addManagedListener(this.primaryColsHeaderPanel, 'selectAll', this.onSelectAll.bind(this));\n this.addManagedListener(this.primaryColsHeaderPanel, 'unselectAll', this.onUnselectAll.bind(this));\n this.addManagedListener(this.primaryColsHeaderPanel, 'filterChanged', this.onFilterChanged.bind(this));\n this.positionableFeature = new PositionableFeature(this.getGui(), { minHeight: 100 });\n this.createManagedBean(this.positionableFeature);\n };\n PrimaryColsPanel.prototype.toggleResizable = function (resizable) {\n this.positionableFeature.setResizable(resizable ? { bottom: true } : false);\n };\n PrimaryColsPanel.prototype.onExpandAll = function () {\n this.primaryColsListPanel.doSetExpandedAll(true);\n };\n PrimaryColsPanel.prototype.onCollapseAll = function () {\n this.primaryColsListPanel.doSetExpandedAll(false);\n };\n PrimaryColsPanel.prototype.expandGroups = function (groupIds) {\n this.primaryColsListPanel.setGroupsExpanded(true, groupIds);\n };\n PrimaryColsPanel.prototype.collapseGroups = function (groupIds) {\n this.primaryColsListPanel.setGroupsExpanded(false, groupIds);\n };\n PrimaryColsPanel.prototype.setColumnLayout = function (colDefs) {\n this.primaryColsListPanel.setColumnLayout(colDefs);\n };\n PrimaryColsPanel.prototype.onFilterChanged = function (event) {\n this.primaryColsListPanel.setFilterText(event.filterText);\n };\n PrimaryColsPanel.prototype.syncLayoutWithGrid = function () {\n this.primaryColsListPanel.onColumnsChanged();\n };\n PrimaryColsPanel.prototype.onSelectAll = function () {\n this.primaryColsListPanel.doSetSelectedAll(true);\n };\n PrimaryColsPanel.prototype.onUnselectAll = function () {\n this.primaryColsListPanel.doSetSelectedAll(false);\n };\n PrimaryColsPanel.prototype.onGroupExpanded = function (event) {\n this.primaryColsHeaderPanel.setExpandState(event.state);\n };\n PrimaryColsPanel.prototype.onSelectionChange = function (event) {\n this.primaryColsHeaderPanel.setSelectionState(event.state);\n };\n PrimaryColsPanel.TEMPLATE = \"
\\n \\n \\n
\";\n __decorate$2e([\n RefSelector('primaryColsHeaderPanel')\n ], PrimaryColsPanel.prototype, \"primaryColsHeaderPanel\", void 0);\n __decorate$2e([\n RefSelector('primaryColsListPanel')\n ], PrimaryColsPanel.prototype, \"primaryColsListPanel\", void 0);\n return PrimaryColsPanel;\n}(Component));\n\nvar __extends$32 = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign$Z = (undefined && undefined.__assign) || function () {\n __assign$Z = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$Z.apply(this, arguments);\n};\nvar __decorate$2d = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar ColumnToolPanel = /** @class */ (function (_super) {\n __extends$32(ColumnToolPanel, _super);\n function ColumnToolPanel() {\n var _this = _super.call(this, ColumnToolPanel.TEMPLATE) || this;\n _this.initialised = false;\n _this.childDestroyFuncs = [];\n return _this;\n }\n // lazy initialise the panel\n ColumnToolPanel.prototype.setVisible = function (visible) {\n _super.prototype.setDisplayed.call(this, visible);\n if (visible && !this.initialised) {\n this.init(this.params);\n }\n };\n ColumnToolPanel.prototype.init = function (params) {\n var _this = this;\n var defaultParams = {\n suppressColumnMove: false,\n suppressColumnSelectAll: false,\n suppressColumnFilter: false,\n suppressColumnExpandAll: false,\n contractColumnSelection: false,\n suppressPivotMode: false,\n suppressRowGroups: false,\n suppressValues: false,\n suppressPivots: false,\n suppressSyncLayoutWithGrid: false,\n api: this.gridApi,\n columnApi: this.columnApi,\n };\n this.params = __assign$Z(__assign$Z(__assign$Z({}, defaultParams), params), { context: this.gridOptionsService.context });\n if (this.isRowGroupingModuleLoaded() && !this.params.suppressPivotMode) {\n // DO NOT CHANGE TO createManagedBean\n this.pivotModePanel = this.createBean(new PivotModePanel());\n this.childDestroyFuncs.push(function () { return _this.destroyBean(_this.pivotModePanel); });\n this.appendChild(this.pivotModePanel);\n }\n // DO NOT CHANGE TO createManagedBean\n this.primaryColsPanel = this.createBean(new PrimaryColsPanel());\n this.childDestroyFuncs.push(function () { return _this.destroyBean(_this.primaryColsPanel); });\n this.primaryColsPanel.init(true, this.params, \"toolPanelUi\");\n this.primaryColsPanel.addCssClass('ag-column-panel-column-select');\n this.appendChild(this.primaryColsPanel);\n if (this.isRowGroupingModuleLoaded()) {\n if (!this.params.suppressRowGroups) {\n // DO NOT CHANGE TO createManagedBean\n this.rowGroupDropZonePanel = this.createBean(new RowGroupDropZonePanel(false));\n this.childDestroyFuncs.push(function () { return _this.destroyBean(_this.rowGroupDropZonePanel); });\n this.appendChild(this.rowGroupDropZonePanel);\n }\n if (!this.params.suppressValues) {\n // DO NOT CHANGE TO createManagedBean\n this.valuesDropZonePanel = this.createBean(new ValuesDropZonePanel(false));\n this.childDestroyFuncs.push(function () { return _this.destroyBean(_this.valuesDropZonePanel); });\n this.appendChild(this.valuesDropZonePanel);\n }\n if (!this.params.suppressPivots) {\n // DO NOT CHANGE TO createManagedBean\n this.pivotDropZonePanel = this.createBean(new PivotDropZonePanel(false));\n this.childDestroyFuncs.push(function () { return _this.destroyBean(_this.pivotDropZonePanel); });\n this.appendChild(this.pivotDropZonePanel);\n }\n this.setLastVisible();\n var pivotModeListener_1 = this.addManagedListener(this.eventService, Events.EVENT_COLUMN_PIVOT_MODE_CHANGED, function () {\n _this.resetChildrenHeight();\n _this.setLastVisible();\n });\n this.childDestroyFuncs.push(function () { return pivotModeListener_1(); });\n }\n this.initialised = true;\n };\n ColumnToolPanel.prototype.setPivotModeSectionVisible = function (visible) {\n var _this = this;\n if (!this.isRowGroupingModuleLoaded()) {\n return;\n }\n if (this.pivotModePanel) {\n this.pivotModePanel.setDisplayed(visible);\n }\n else if (visible) {\n this.pivotModePanel = this.createBean(new PivotModePanel());\n // ensure pivot mode panel is positioned at the top of the columns tool panel\n this.getGui().insertBefore(this.pivotModePanel.getGui(), this.getGui().firstChild);\n this.childDestroyFuncs.push(function () { return _this.destroyBean(_this.pivotModePanel); });\n }\n this.setLastVisible();\n };\n ColumnToolPanel.prototype.setRowGroupsSectionVisible = function (visible) {\n if (!this.isRowGroupingModuleLoaded()) {\n return;\n }\n if (this.rowGroupDropZonePanel) {\n this.rowGroupDropZonePanel.setDisplayed(visible);\n }\n else if (visible) {\n this.rowGroupDropZonePanel = this.createManagedBean(new RowGroupDropZonePanel(false));\n this.appendChild(this.rowGroupDropZonePanel);\n }\n this.setLastVisible();\n };\n ColumnToolPanel.prototype.setValuesSectionVisible = function (visible) {\n if (!this.isRowGroupingModuleLoaded()) {\n return;\n }\n if (this.valuesDropZonePanel) {\n this.valuesDropZonePanel.setDisplayed(visible);\n }\n else if (visible) {\n this.valuesDropZonePanel = this.createManagedBean(new ValuesDropZonePanel(false));\n this.appendChild(this.valuesDropZonePanel);\n }\n this.setLastVisible();\n };\n ColumnToolPanel.prototype.setPivotSectionVisible = function (visible) {\n if (!this.isRowGroupingModuleLoaded()) {\n return;\n }\n if (this.pivotDropZonePanel) {\n this.pivotDropZonePanel.setDisplayed(visible);\n }\n else if (visible) {\n this.pivotDropZonePanel = this.createManagedBean(new PivotDropZonePanel(false));\n this.appendChild(this.pivotDropZonePanel);\n this.pivotDropZonePanel.setDisplayed(visible);\n }\n this.setLastVisible();\n };\n ColumnToolPanel.prototype.setResizers = function () {\n [\n this.primaryColsPanel,\n this.rowGroupDropZonePanel,\n this.valuesDropZonePanel,\n this.pivotDropZonePanel\n ].forEach(function (panel) {\n if (!panel) {\n return;\n }\n var eGui = panel.getGui();\n panel.toggleResizable(!eGui.classList.contains('ag-last-column-drop') && !eGui.classList.contains('ag-hidden'));\n });\n };\n ColumnToolPanel.prototype.setLastVisible = function () {\n var eGui = this.getGui();\n var columnDrops = Array.prototype.slice.call(eGui.querySelectorAll('.ag-column-drop'));\n columnDrops.forEach(function (columnDrop) { return columnDrop.classList.remove('ag-last-column-drop'); });\n var columnDropEls = eGui.querySelectorAll('.ag-column-drop:not(.ag-hidden)');\n var lastVisible = _.last(columnDropEls);\n if (lastVisible) {\n lastVisible.classList.add('ag-last-column-drop');\n }\n this.setResizers();\n };\n ColumnToolPanel.prototype.resetChildrenHeight = function () {\n var eGui = this.getGui();\n var children = eGui.children;\n for (var i = 0; i < children.length; i++) {\n var child = children[i];\n child.style.removeProperty('height');\n child.style.removeProperty('flex');\n }\n };\n ColumnToolPanel.prototype.isRowGroupingModuleLoaded = function () {\n return ModuleRegistry.__assertRegistered(ModuleNames.RowGroupingModule, 'Row Grouping', this.context.getGridId());\n };\n ColumnToolPanel.prototype.expandColumnGroups = function (groupIds) {\n this.primaryColsPanel.expandGroups(groupIds);\n };\n ColumnToolPanel.prototype.collapseColumnGroups = function (groupIds) {\n this.primaryColsPanel.collapseGroups(groupIds);\n };\n ColumnToolPanel.prototype.setColumnLayout = function (colDefs) {\n this.primaryColsPanel.setColumnLayout(colDefs);\n };\n ColumnToolPanel.prototype.syncLayoutWithGrid = function () {\n this.primaryColsPanel.syncLayoutWithGrid();\n };\n ColumnToolPanel.prototype.destroyChildren = function () {\n this.childDestroyFuncs.forEach(function (func) { return func(); });\n this.childDestroyFuncs.length = 0;\n _.clearElement(this.getGui());\n };\n ColumnToolPanel.prototype.refresh = function () {\n this.destroyChildren();\n this.init(this.params);\n };\n // this is a user component, and IComponent has \"public destroy()\" as part of the interface.\n // so this must be public.\n ColumnToolPanel.prototype.destroy = function () {\n this.destroyChildren();\n _super.prototype.destroy.call(this);\n };\n ColumnToolPanel.TEMPLATE = \"
\";\n __decorate$2d([\n Autowired(\"gridApi\")\n ], ColumnToolPanel.prototype, \"gridApi\", void 0);\n __decorate$2d([\n Autowired(\"columnApi\")\n ], ColumnToolPanel.prototype, \"columnApi\", void 0);\n return ColumnToolPanel;\n}(Component));\n\nvar __extends$31 = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$2c = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar HorizontalResizeComp = /** @class */ (function (_super) {\n __extends$31(HorizontalResizeComp, _super);\n function HorizontalResizeComp() {\n var _this = _super.call(this, /* html */ \"
\") || this;\n _this.minWidth = 100;\n _this.maxWidth = null;\n return _this;\n }\n HorizontalResizeComp.prototype.setElementToResize = function (elementToResize) {\n this.elementToResize = elementToResize;\n };\n HorizontalResizeComp.prototype.postConstruct = function () {\n var finishedWithResizeFunc = this.horizontalResizeService.addResizeBar({\n eResizeBar: this.getGui(),\n dragStartPixels: 1,\n onResizeStart: this.onResizeStart.bind(this),\n onResizing: this.onResizing.bind(this),\n onResizeEnd: this.onResizeEnd.bind(this)\n });\n this.addDestroyFunc(finishedWithResizeFunc);\n this.setInverted(this.gridOptionsService.is('enableRtl'));\n };\n HorizontalResizeComp.prototype.dispatchResizeEvent = function (start, end, width) {\n var event = {\n type: Events.EVENT_TOOL_PANEL_SIZE_CHANGED,\n width: width,\n started: start,\n ended: end,\n };\n this.eventService.dispatchEvent(event);\n };\n HorizontalResizeComp.prototype.onResizeStart = function () {\n this.startingWidth = this.elementToResize.offsetWidth;\n this.dispatchResizeEvent(true, false, this.startingWidth);\n };\n HorizontalResizeComp.prototype.onResizeEnd = function (delta) {\n return this.onResizing(delta, true);\n };\n HorizontalResizeComp.prototype.onResizing = function (delta, isEnd) {\n if (isEnd === void 0) { isEnd = false; }\n var direction = this.inverted ? -1 : 1;\n var newWidth = Math.max(this.minWidth, Math.floor(this.startingWidth - (delta * direction)));\n if (this.maxWidth != null) {\n newWidth = Math.min(this.maxWidth, newWidth);\n }\n this.elementToResize.style.width = newWidth + \"px\";\n this.dispatchResizeEvent(false, isEnd, newWidth);\n };\n HorizontalResizeComp.prototype.setInverted = function (inverted) {\n this.inverted = inverted;\n };\n HorizontalResizeComp.prototype.setMaxWidth = function (value) {\n this.maxWidth = value;\n };\n HorizontalResizeComp.prototype.setMinWidth = function (value) {\n if (value != null) {\n this.minWidth = value;\n }\n else {\n this.minWidth = 100;\n }\n };\n __decorate$2c([\n Autowired('horizontalResizeService')\n ], HorizontalResizeComp.prototype, \"horizontalResizeService\", void 0);\n __decorate$2c([\n PostConstruct\n ], HorizontalResizeComp.prototype, \"postConstruct\", null);\n return HorizontalResizeComp;\n}(Component));\n\nvar __extends$30 = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$2b = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar SideBarButtonComp = /** @class */ (function (_super) {\n __extends$30(SideBarButtonComp, _super);\n function SideBarButtonComp(toolPanelDef) {\n var _this = _super.call(this) || this;\n _this.toolPanelDef = toolPanelDef;\n return _this;\n }\n SideBarButtonComp.prototype.getToolPanelId = function () {\n return this.toolPanelDef.id;\n };\n SideBarButtonComp.prototype.postConstruct = function () {\n var template = this.createTemplate();\n this.setTemplate(template);\n this.setLabel();\n this.setIcon();\n this.addManagedListener(this.eToggleButton, 'click', this.onButtonPressed.bind(this));\n this.eToggleButton.setAttribute('id', \"ag-\" + this.getCompId() + \"-button\");\n };\n SideBarButtonComp.prototype.createTemplate = function () {\n var res = /* html */ \"
\\n \\n
\";\n return res;\n };\n SideBarButtonComp.prototype.setLabel = function () {\n var translate = this.localeService.getLocaleTextFunc();\n var def = this.toolPanelDef;\n var label = translate(def.labelKey, def.labelDefault);\n this.eLabel.innerText = label;\n };\n SideBarButtonComp.prototype.setIcon = function () {\n this.eIconWrapper.insertAdjacentElement('afterbegin', _.createIconNoSpan(this.toolPanelDef.iconKey, this.gridOptionsService));\n };\n SideBarButtonComp.prototype.onButtonPressed = function () {\n this.dispatchEvent({ type: SideBarButtonComp.EVENT_TOGGLE_BUTTON_CLICKED });\n };\n SideBarButtonComp.prototype.setSelected = function (selected) {\n this.addOrRemoveCssClass('ag-selected', selected);\n _.setAriaExpanded(this.eToggleButton, selected);\n };\n SideBarButtonComp.prototype.getButtonElement = function () {\n return this.eToggleButton;\n };\n SideBarButtonComp.EVENT_TOGGLE_BUTTON_CLICKED = 'toggleButtonClicked';\n __decorate$2b([\n RefSelector('eToggleButton')\n ], SideBarButtonComp.prototype, \"eToggleButton\", void 0);\n __decorate$2b([\n RefSelector('eIconWrapper')\n ], SideBarButtonComp.prototype, \"eIconWrapper\", void 0);\n __decorate$2b([\n RefSelector('eLabel')\n ], SideBarButtonComp.prototype, \"eLabel\", void 0);\n __decorate$2b([\n PostConstruct\n ], SideBarButtonComp.prototype, \"postConstruct\", null);\n return SideBarButtonComp;\n}(Component));\n\nvar __extends$2$ = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$2a = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar SideBarButtonsComp = /** @class */ (function (_super) {\n __extends$2$(SideBarButtonsComp, _super);\n function SideBarButtonsComp() {\n var _this = _super.call(this, SideBarButtonsComp.TEMPLATE) || this;\n _this.buttonComps = [];\n return _this;\n }\n SideBarButtonsComp.prototype.postConstruct = function () {\n this.addManagedListener(this.getFocusableElement(), 'keydown', this.handleKeyDown.bind(this));\n };\n SideBarButtonsComp.prototype.handleKeyDown = function (e) {\n if (e.key !== KeyCode.TAB || !e.shiftKey) {\n return;\n }\n var lastColumn = _.last(this.columnModel.getAllDisplayedColumns());\n if (this.focusService.focusGridView(lastColumn, true)) {\n e.preventDefault();\n }\n };\n SideBarButtonsComp.prototype.setActiveButton = function (id) {\n this.buttonComps.forEach(function (comp) {\n comp.setSelected(id === comp.getToolPanelId());\n });\n };\n SideBarButtonsComp.prototype.addButtonComp = function (def) {\n var _this = this;\n var buttonComp = this.createBean(new SideBarButtonComp(def));\n this.buttonComps.push(buttonComp);\n this.appendChild(buttonComp);\n buttonComp.addEventListener(SideBarButtonComp.EVENT_TOGGLE_BUTTON_CLICKED, function () {\n _this.dispatchEvent({\n type: SideBarButtonsComp.EVENT_SIDE_BAR_BUTTON_CLICKED,\n toolPanelId: def.id\n });\n });\n return buttonComp;\n };\n SideBarButtonsComp.prototype.clearButtons = function () {\n this.buttonComps = this.destroyBeans(this.buttonComps);\n _.clearElement(this.getGui());\n };\n SideBarButtonsComp.EVENT_SIDE_BAR_BUTTON_CLICKED = 'sideBarButtonClicked';\n SideBarButtonsComp.TEMPLATE = \"
\";\n __decorate$2a([\n Autowired('focusService')\n ], SideBarButtonsComp.prototype, \"focusService\", void 0);\n __decorate$2a([\n Autowired('columnModel')\n ], SideBarButtonsComp.prototype, \"columnModel\", void 0);\n __decorate$2a([\n PostConstruct\n ], SideBarButtonsComp.prototype, \"postConstruct\", null);\n __decorate$2a([\n PreDestroy\n ], SideBarButtonsComp.prototype, \"clearButtons\", null);\n return SideBarButtonsComp;\n}(Component));\n\nvar SideBarDefParser = /** @class */ (function () {\n function SideBarDefParser() {\n }\n SideBarDefParser.parse = function (toParse) {\n if (!toParse) {\n return undefined;\n }\n if (toParse === true) {\n return {\n toolPanels: [\n SideBarDefParser.DEFAULT_COLUMN_COMP,\n SideBarDefParser.DEFAULT_FILTER_COMP,\n ],\n defaultToolPanel: 'columns'\n };\n }\n if (typeof toParse === 'string') {\n return SideBarDefParser.parse([toParse]);\n }\n if (Array.isArray(toParse)) {\n var comps_1 = [];\n toParse.forEach(function (key) {\n var lookupResult = SideBarDefParser.DEFAULT_BY_KEY[key];\n if (!lookupResult) {\n console.warn(\"AG Grid: the key \" + key + \" is not a valid key for specifying a tool panel, valid keys are: \" + Object.keys(SideBarDefParser.DEFAULT_BY_KEY).join(','));\n return;\n }\n comps_1.push(lookupResult);\n });\n if (comps_1.length === 0) {\n return undefined;\n }\n return {\n toolPanels: comps_1,\n defaultToolPanel: comps_1[0].id\n };\n }\n var result = {\n toolPanels: SideBarDefParser.parseComponents(toParse.toolPanels),\n defaultToolPanel: toParse.defaultToolPanel,\n hiddenByDefault: toParse.hiddenByDefault,\n position: toParse.position\n };\n return result;\n };\n SideBarDefParser.parseComponents = function (from) {\n var result = [];\n if (!from) {\n return result;\n }\n from.forEach(function (it) {\n var toAdd = null;\n if (typeof it === 'string') {\n var lookupResult = SideBarDefParser.DEFAULT_BY_KEY[it];\n if (!lookupResult) {\n console.warn(\"AG Grid: the key \" + it + \" is not a valid key for specifying a tool panel, valid keys are: \" + Object.keys(SideBarDefParser.DEFAULT_BY_KEY).join(','));\n return;\n }\n toAdd = lookupResult;\n }\n else {\n toAdd = it;\n }\n result.push(toAdd);\n });\n return result;\n };\n SideBarDefParser.DEFAULT_COLUMN_COMP = {\n id: 'columns',\n labelDefault: 'Columns',\n labelKey: 'columns',\n iconKey: 'columns',\n toolPanel: 'agColumnsToolPanel',\n };\n SideBarDefParser.DEFAULT_FILTER_COMP = {\n id: 'filters',\n labelDefault: 'Filters',\n labelKey: 'filters',\n iconKey: 'filter',\n toolPanel: 'agFiltersToolPanel',\n };\n SideBarDefParser.DEFAULT_BY_KEY = {\n columns: SideBarDefParser.DEFAULT_COLUMN_COMP,\n filters: SideBarDefParser.DEFAULT_FILTER_COMP\n };\n return SideBarDefParser;\n}());\n\nvar __extends$2_ = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$29 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar ToolPanelWrapper = /** @class */ (function (_super) {\n __extends$2_(ToolPanelWrapper, _super);\n function ToolPanelWrapper() {\n return _super.call(this, ToolPanelWrapper.TEMPLATE) || this;\n }\n ToolPanelWrapper.prototype.setupResize = function () {\n var eGui = this.getGui();\n var resizeBar = this.resizeBar = this.createManagedBean(new HorizontalResizeComp());\n eGui.setAttribute('id', \"ag-\" + this.getCompId());\n resizeBar.setElementToResize(eGui);\n this.appendChild(resizeBar);\n };\n ToolPanelWrapper.prototype.getToolPanelId = function () {\n return this.toolPanelId;\n };\n ToolPanelWrapper.prototype.setToolPanelDef = function (toolPanelDef) {\n var id = toolPanelDef.id, minWidth = toolPanelDef.minWidth, maxWidth = toolPanelDef.maxWidth, width = toolPanelDef.width;\n this.toolPanelId = id;\n this.width = width;\n var params = {};\n var compDetails = this.userComponentFactory.getToolPanelCompDetails(toolPanelDef, params);\n var componentPromise = compDetails.newAgStackInstance();\n if (componentPromise == null) {\n console.warn(\"AG Grid: error processing tool panel component \" + id + \". You need to specify 'toolPanel'\");\n return;\n }\n componentPromise.then(this.setToolPanelComponent.bind(this));\n if (minWidth != null) {\n this.resizeBar.setMinWidth(minWidth);\n }\n if (maxWidth != null) {\n this.resizeBar.setMaxWidth(maxWidth);\n }\n };\n ToolPanelWrapper.prototype.setToolPanelComponent = function (compInstance) {\n var _this = this;\n this.toolPanelCompInstance = compInstance;\n this.appendChild(compInstance.getGui());\n this.addDestroyFunc(function () {\n _this.destroyBean(compInstance);\n });\n if (this.width) {\n this.getGui().style.width = this.width + \"px\";\n }\n };\n ToolPanelWrapper.prototype.getToolPanelInstance = function () {\n return this.toolPanelCompInstance;\n };\n ToolPanelWrapper.prototype.setResizerSizerSide = function (side) {\n var isRtl = this.gridOptionsService.is('enableRtl');\n var isLeft = side === 'left';\n var inverted = isRtl ? isLeft : !isLeft;\n this.resizeBar.setInverted(inverted);\n };\n ToolPanelWrapper.prototype.refresh = function () {\n this.toolPanelCompInstance.refresh();\n };\n ToolPanelWrapper.TEMPLATE = \"
\";\n __decorate$29([\n Autowired(\"userComponentFactory\")\n ], ToolPanelWrapper.prototype, \"userComponentFactory\", void 0);\n __decorate$29([\n PostConstruct\n ], ToolPanelWrapper.prototype, \"setupResize\", null);\n return ToolPanelWrapper;\n}(Component));\n\nvar __extends$2Z = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$28 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __values$O = (undefined && undefined.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nvar SideBarComp = /** @class */ (function (_super) {\n __extends$2Z(SideBarComp, _super);\n function SideBarComp() {\n var _this = _super.call(this, SideBarComp.TEMPLATE) || this;\n _this.toolPanelWrappers = [];\n return _this;\n }\n SideBarComp.prototype.postConstruct = function () {\n var _this = this;\n this.sideBarButtonsComp.addEventListener(SideBarButtonsComp.EVENT_SIDE_BAR_BUTTON_CLICKED, this.onToolPanelButtonClicked.bind(this));\n this.setSideBarDef();\n this.addManagedPropertyListener('sideBar', function () {\n _this.clearDownUi();\n _this.setSideBarDef();\n });\n this.gridApi.registerSideBarComp(this);\n this.createManagedBean(new ManagedFocusFeature(this.getFocusableElement(), {\n onTabKeyDown: this.onTabKeyDown.bind(this),\n handleKeyDown: this.handleKeyDown.bind(this)\n }));\n };\n SideBarComp.prototype.onTabKeyDown = function (e) {\n if (e.defaultPrevented) {\n return;\n }\n var _a = this, focusService = _a.focusService, sideBarButtonsComp = _a.sideBarButtonsComp;\n var eGui = this.getGui();\n var sideBarGui = sideBarButtonsComp.getGui();\n var eDocument = this.gridOptionsService.getDocument();\n var activeElement = eDocument.activeElement;\n var openPanel = eGui.querySelector('.ag-tool-panel-wrapper:not(.ag-hidden)');\n var target = e.target;\n if (!openPanel) {\n return;\n }\n if (sideBarGui.contains(activeElement)) {\n if (focusService.focusInto(openPanel, e.shiftKey)) {\n e.preventDefault();\n }\n return;\n }\n // only handle backwards focus to target the sideBar buttons\n if (!e.shiftKey) {\n return;\n }\n var nextEl = null;\n if (openPanel.contains(activeElement)) {\n nextEl = this.focusService.findNextFocusableElement(openPanel, undefined, true);\n }\n else if (focusService.isTargetUnderManagedComponent(openPanel, target) && e.shiftKey) {\n nextEl = this.focusService.findFocusableElementBeforeTabGuard(openPanel, target);\n }\n if (!nextEl) {\n nextEl = sideBarGui.querySelector('.ag-selected button');\n }\n if (nextEl) {\n e.preventDefault();\n nextEl.focus();\n }\n };\n SideBarComp.prototype.handleKeyDown = function (e) {\n var eDocument = this.gridOptionsService.getDocument();\n if (!this.sideBarButtonsComp.getGui().contains(eDocument.activeElement)) {\n return;\n }\n var sideBarGui = this.sideBarButtonsComp.getGui();\n var buttons = Array.prototype.slice.call(sideBarGui.querySelectorAll('.ag-side-button'));\n var currentButton = eDocument.activeElement;\n var currentPos = buttons.findIndex(function (button) { return button.contains(currentButton); });\n var nextPos = null;\n switch (e.key) {\n case KeyCode.LEFT:\n case KeyCode.UP:\n nextPos = Math.max(0, currentPos - 1);\n break;\n case KeyCode.RIGHT:\n case KeyCode.DOWN:\n nextPos = Math.min(currentPos + 1, buttons.length - 1);\n break;\n }\n if (nextPos === null) {\n return;\n }\n var innerButton = buttons[nextPos].querySelector('button');\n if (innerButton) {\n innerButton.focus();\n e.preventDefault();\n }\n };\n SideBarComp.prototype.onToolPanelButtonClicked = function (event) {\n var id = event.toolPanelId;\n var openedItem = this.openedItem();\n // if item was already open, we close it\n if (openedItem === id) {\n this.openToolPanel(undefined, 'sideBarButtonClicked'); // passing undefined closes\n }\n else {\n this.openToolPanel(id, 'sideBarButtonClicked');\n }\n };\n SideBarComp.prototype.clearDownUi = function () {\n this.sideBarButtonsComp.clearButtons();\n this.destroyToolPanelWrappers();\n };\n SideBarComp.prototype.setSideBarDef = function () {\n // initially hide side bar\n this.setDisplayed(false);\n var sideBarRaw = this.gridOptionsService.get('sideBar');\n this.sideBar = SideBarDefParser.parse(sideBarRaw);\n if (!!this.sideBar && !!this.sideBar.toolPanels) {\n var shouldDisplaySideBar = !this.sideBar.hiddenByDefault;\n this.setDisplayed(shouldDisplaySideBar);\n var toolPanelDefs = this.sideBar.toolPanels;\n this.createToolPanelsAndSideButtons(toolPanelDefs);\n this.setSideBarPosition(this.sideBar.position);\n if (!this.sideBar.hiddenByDefault) {\n this.openToolPanel(this.sideBar.defaultToolPanel, 'sideBarInitializing');\n }\n }\n };\n SideBarComp.prototype.getDef = function () {\n return this.sideBar;\n };\n SideBarComp.prototype.setSideBarPosition = function (position) {\n if (!position) {\n position = 'right';\n }\n var isLeft = position === 'left';\n var resizerSide = isLeft ? 'right' : 'left';\n this.addOrRemoveCssClass('ag-side-bar-left', isLeft);\n this.addOrRemoveCssClass('ag-side-bar-right', !isLeft);\n this.toolPanelWrappers.forEach(function (wrapper) {\n wrapper.setResizerSizerSide(resizerSide);\n });\n return this;\n };\n SideBarComp.prototype.createToolPanelsAndSideButtons = function (defs) {\n var e_1, _a;\n try {\n for (var defs_1 = __values$O(defs), defs_1_1 = defs_1.next(); !defs_1_1.done; defs_1_1 = defs_1.next()) {\n var def = defs_1_1.value;\n this.createToolPanelAndSideButton(def);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (defs_1_1 && !defs_1_1.done && (_a = defs_1.return)) _a.call(defs_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n };\n SideBarComp.prototype.validateDef = function (def) {\n if (def.id == null) {\n console.warn(\"AG Grid: please review all your toolPanel components, it seems like at least one of them doesn't have an id\");\n return false;\n }\n // helpers, in case user doesn't have the right module loaded\n if (def.toolPanel === 'agColumnsToolPanel') {\n var moduleMissing = !ModuleRegistry.__assertRegistered(ModuleNames.ColumnsToolPanelModule, 'Column Tool Panel', this.context.getGridId());\n if (moduleMissing) {\n return false;\n }\n }\n if (def.toolPanel === 'agFiltersToolPanel') {\n var moduleMissing = !ModuleRegistry.__assertRegistered(ModuleNames.FiltersToolPanelModule, 'Filters Tool Panel', this.context.getGridId());\n if (moduleMissing) {\n return false;\n }\n }\n return true;\n };\n SideBarComp.prototype.createToolPanelAndSideButton = function (def) {\n if (!this.validateDef(def)) {\n return;\n }\n var button = this.sideBarButtonsComp.addButtonComp(def);\n var wrapper = this.getContext().createBean(new ToolPanelWrapper());\n wrapper.setToolPanelDef(def);\n wrapper.setDisplayed(false);\n var wrapperGui = wrapper.getGui();\n this.appendChild(wrapperGui);\n this.toolPanelWrappers.push(wrapper);\n _.setAriaControls(button.getButtonElement(), wrapperGui);\n };\n SideBarComp.prototype.refresh = function () {\n this.toolPanelWrappers.forEach(function (wrapper) { return wrapper.refresh(); });\n };\n SideBarComp.prototype.openToolPanel = function (key, source) {\n if (source === void 0) { source = 'api'; }\n var currentlyOpenedKey = this.openedItem();\n if (currentlyOpenedKey === key) {\n return;\n }\n this.toolPanelWrappers.forEach(function (wrapper) {\n var show = key === wrapper.getToolPanelId();\n wrapper.setDisplayed(show);\n });\n var newlyOpenedKey = this.openedItem();\n var openToolPanelChanged = currentlyOpenedKey !== newlyOpenedKey;\n if (openToolPanelChanged) {\n this.sideBarButtonsComp.setActiveButton(key);\n this.raiseToolPanelVisibleEvent(key, currentlyOpenedKey !== null && currentlyOpenedKey !== void 0 ? currentlyOpenedKey : undefined, source);\n }\n };\n SideBarComp.prototype.getToolPanelInstance = function (key) {\n var toolPanelWrapper = this.toolPanelWrappers.filter(function (toolPanel) { return toolPanel.getToolPanelId() === key; })[0];\n if (!toolPanelWrapper) {\n console.warn(\"AG Grid: unable to lookup Tool Panel as invalid key supplied: \" + key);\n return;\n }\n return toolPanelWrapper.getToolPanelInstance();\n };\n SideBarComp.prototype.raiseToolPanelVisibleEvent = function (key, previousKey, source) {\n var switchingToolPanel = !!key && !!previousKey;\n if (previousKey) {\n var event_1 = {\n type: Events.EVENT_TOOL_PANEL_VISIBLE_CHANGED,\n source: source,\n key: previousKey,\n visible: false,\n switchingToolPanel: switchingToolPanel,\n };\n this.eventService.dispatchEvent(event_1);\n }\n if (key) {\n var event_2 = {\n type: Events.EVENT_TOOL_PANEL_VISIBLE_CHANGED,\n source: source,\n key: key,\n visible: true,\n switchingToolPanel: switchingToolPanel,\n };\n this.eventService.dispatchEvent(event_2);\n }\n };\n SideBarComp.prototype.close = function (source) {\n if (source === void 0) { source = 'api'; }\n this.openToolPanel(undefined, source);\n };\n SideBarComp.prototype.isToolPanelShowing = function () {\n return !!this.openedItem();\n };\n SideBarComp.prototype.openedItem = function () {\n var activeToolPanel = null;\n this.toolPanelWrappers.forEach(function (wrapper) {\n if (wrapper.isDisplayed()) {\n activeToolPanel = wrapper.getToolPanelId();\n }\n });\n return activeToolPanel;\n };\n SideBarComp.prototype.destroyToolPanelWrappers = function () {\n var _this = this;\n this.toolPanelWrappers.forEach(function (wrapper) {\n _.removeFromParent(wrapper.getGui());\n _this.destroyBean(wrapper);\n });\n this.toolPanelWrappers.length = 0;\n };\n SideBarComp.prototype.destroy = function () {\n this.destroyToolPanelWrappers();\n _super.prototype.destroy.call(this);\n };\n SideBarComp.TEMPLATE = \"
\\n \\n
\";\n __decorate$28([\n Autowired('gridApi')\n ], SideBarComp.prototype, \"gridApi\", void 0);\n __decorate$28([\n Autowired('focusService')\n ], SideBarComp.prototype, \"focusService\", void 0);\n __decorate$28([\n RefSelector('sideBarButtons')\n ], SideBarComp.prototype, \"sideBarButtonsComp\", void 0);\n __decorate$28([\n PostConstruct\n ], SideBarComp.prototype, \"postConstruct\", null);\n return SideBarComp;\n}(Component));\n\nvar __extends$2Y = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$27 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar ToolPanelColDefService = /** @class */ (function (_super) {\n __extends$2Y(ToolPanelColDefService, _super);\n function ToolPanelColDefService() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.isColGroupDef = function (colDef) { return colDef && typeof colDef.children !== 'undefined'; };\n _this.getId = function (colDef) {\n return _this.isColGroupDef(colDef) ? colDef.groupId : colDef.colId;\n };\n return _this;\n }\n ToolPanelColDefService.prototype.createColumnTree = function (colDefs) {\n var _this = this;\n var invalidColIds = [];\n var createDummyColGroup = function (abstractColDef, depth) {\n if (_this.isColGroupDef(abstractColDef)) {\n // creating 'dummy' group which is not associated with grid column group\n var groupDef = abstractColDef;\n var groupId = (typeof groupDef.groupId !== 'undefined') ? groupDef.groupId : groupDef.headerName;\n var group = new ProvidedColumnGroup(groupDef, groupId, false, depth);\n var children_1 = [];\n groupDef.children.forEach(function (def) {\n var child = createDummyColGroup(def, depth + 1);\n // check column exists in case invalid colDef is supplied for primary column\n if (child) {\n children_1.push(child);\n }\n });\n group.setChildren(children_1);\n return group;\n }\n else {\n var colDef = abstractColDef;\n var key = colDef.colId ? colDef.colId : colDef.field;\n var column = _this.columnModel.getPrimaryColumn(key);\n if (!column) {\n invalidColIds.push(colDef);\n }\n return column;\n }\n };\n var mappedResults = [];\n colDefs.forEach(function (colDef) {\n var result = createDummyColGroup(colDef, 0);\n if (result) {\n // only return correctly mapped colDef results\n mappedResults.push(result);\n }\n });\n if (invalidColIds.length > 0) {\n console.warn('AG Grid: unable to find grid columns for the supplied colDef(s):', invalidColIds);\n }\n return mappedResults;\n };\n ToolPanelColDefService.prototype.syncLayoutWithGrid = function (syncLayoutCallback) {\n // extract ordered list of leaf path trees (column group hierarchy for each individual leaf column)\n var leafPathTrees = this.getLeafPathTrees();\n // merge leaf path tree taking split column groups into account\n var mergedColumnTrees = this.mergeLeafPathTrees(leafPathTrees);\n // sync layout with merged column trees\n syncLayoutCallback(mergedColumnTrees);\n };\n ToolPanelColDefService.prototype.getLeafPathTrees = function () {\n // leaf tree paths are obtained by walking up the tree starting at a column until we reach the top level group.\n var getLeafPathTree = function (node, childDef) {\n var leafPathTree;\n // build up tree in reverse order\n if (node instanceof ProvidedColumnGroup) {\n if (node.isPadding()) {\n // skip over padding groups\n leafPathTree = childDef;\n }\n else {\n var groupDef = Object.assign({}, node.getColGroupDef());\n // ensure group contains groupId\n groupDef.groupId = node.getGroupId();\n groupDef.children = [childDef];\n leafPathTree = groupDef;\n }\n }\n else {\n var colDef = Object.assign({}, node.getColDef());\n // ensure col contains colId\n colDef.colId = node.getColId();\n leafPathTree = colDef;\n }\n // walk tree\n var parent = node.getOriginalParent();\n if (parent) {\n // keep walking up the tree until we reach the root\n return getLeafPathTree(parent, leafPathTree);\n }\n else {\n // we have reached the root - exit with resulting leaf path tree\n return leafPathTree;\n }\n };\n // obtain a sorted list of all grid columns\n var allGridColumns = this.columnModel.getAllGridColumns();\n // only primary columns and non row group columns should appear in the tool panel\n var allPrimaryGridColumns = allGridColumns.filter(function (column) {\n var colDef = column.getColDef();\n return column.isPrimary() && !colDef.showRowGroup;\n });\n // construct a leaf path tree for each column\n return allPrimaryGridColumns.map(function (col) { return getLeafPathTree(col, col.getColDef()); });\n };\n ToolPanelColDefService.prototype.mergeLeafPathTrees = function (leafPathTrees) {\n var _this = this;\n var matchingRootGroupIds = function (pathA, pathB) {\n var bothPathsAreGroups = _this.isColGroupDef(pathA) && _this.isColGroupDef(pathB);\n return bothPathsAreGroups && _this.getId(pathA) === _this.getId(pathB);\n };\n var mergeTrees = function (treeA, treeB) {\n if (!_this.isColGroupDef(treeB)) {\n return treeA;\n }\n var mergeResult = treeA;\n var groupToMerge = treeB;\n if (groupToMerge.children && groupToMerge.groupId) {\n var added = _this.addChildrenToGroup(mergeResult, groupToMerge.groupId, groupToMerge.children[0]);\n if (added) {\n return mergeResult;\n }\n }\n groupToMerge.children.forEach(function (child) { return mergeTrees(mergeResult, child); });\n return mergeResult;\n };\n // we can't just merge the leaf path trees as groups can be split apart - instead only merge if leaf\n // path groups with the same root group id are contiguous.\n var mergeColDefs = [];\n for (var i = 1; i <= leafPathTrees.length; i++) {\n var first = leafPathTrees[i - 1];\n var second = leafPathTrees[i];\n if (matchingRootGroupIds(first, second)) {\n leafPathTrees[i] = mergeTrees(first, second);\n }\n else {\n mergeColDefs.push(first);\n }\n }\n return mergeColDefs;\n };\n ToolPanelColDefService.prototype.addChildrenToGroup = function (tree, groupId, colDef) {\n var _this = this;\n var subGroupIsSplit = function (currentSubGroup, currentSubGroupToAdd) {\n var existingChildIds = currentSubGroup.children.map(_this.getId);\n var childGroupAlreadyExists = _.includes(existingChildIds, _this.getId(currentSubGroupToAdd));\n var lastChild = _.last(currentSubGroup.children);\n var lastChildIsDifferent = lastChild && _this.getId(lastChild) !== _this.getId(currentSubGroupToAdd);\n return childGroupAlreadyExists && lastChildIsDifferent;\n };\n if (!this.isColGroupDef(tree)) {\n return true;\n }\n var currentGroup = tree;\n var groupToAdd = colDef;\n if (subGroupIsSplit(currentGroup, groupToAdd)) {\n currentGroup.children.push(groupToAdd);\n return true;\n }\n if (currentGroup.groupId === groupId) {\n // add children that don't already exist to group\n var existingChildIds = currentGroup.children.map(this.getId);\n var colDefAlreadyPresent = _.includes(existingChildIds, this.getId(groupToAdd));\n if (!colDefAlreadyPresent) {\n currentGroup.children.push(groupToAdd);\n return true;\n }\n }\n // recurse until correct group is found to add children\n currentGroup.children.forEach(function (subGroup) { return _this.addChildrenToGroup(subGroup, groupId, colDef); });\n return false;\n };\n __decorate$27([\n Autowired('columnModel')\n ], ToolPanelColDefService.prototype, \"columnModel\", void 0);\n ToolPanelColDefService = __decorate$27([\n Bean('toolPanelColDefService')\n ], ToolPanelColDefService);\n return ToolPanelColDefService;\n}(BeanStub));\n\n// DO NOT UPDATE MANUALLY: Generated from script during build time\nvar VERSION$f = '30.0.6';\n\nvar SideBarModule = {\n version: VERSION$f,\n moduleName: ModuleNames.SideBarModule,\n beans: [ToolPanelColDefService],\n agStackComponents: [\n { componentName: 'AgHorizontalResize', componentClass: HorizontalResizeComp },\n { componentName: 'AgSideBar', componentClass: SideBarComp },\n { componentName: 'AgSideBarButtons', componentClass: SideBarButtonsComp },\n ],\n dependantModules: [\n EnterpriseCoreModule\n ]\n};\n\nvar __decorate$26 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar ModelItemUtils = /** @class */ (function () {\n function ModelItemUtils() {\n }\n ModelItemUtils.prototype.selectAllChildren = function (colTree, selectAllChecked, eventType) {\n var cols = this.extractAllLeafColumns(colTree);\n this.setAllColumns(cols, selectAllChecked, eventType);\n };\n ModelItemUtils.prototype.setColumn = function (col, selectAllChecked, eventType) {\n this.setAllColumns([col], selectAllChecked, eventType);\n };\n ModelItemUtils.prototype.setAllColumns = function (cols, selectAllChecked, eventType) {\n if (this.columnModel.isPivotMode()) {\n this.setAllPivot(cols, selectAllChecked, eventType);\n }\n else {\n this.setAllVisible(cols, selectAllChecked, eventType);\n }\n };\n ModelItemUtils.prototype.extractAllLeafColumns = function (allItems) {\n var res = [];\n var recursiveFunc = function (items) {\n items.forEach(function (item) {\n if (!item.isPassesFilter()) {\n return;\n }\n if (item.isGroup()) {\n recursiveFunc(item.getChildren());\n }\n else {\n res.push(item.getColumn());\n }\n });\n };\n recursiveFunc(allItems);\n return res;\n };\n ModelItemUtils.prototype.setAllVisible = function (columns, visible, eventType) {\n var colStateItems = [];\n columns.forEach(function (col) {\n if (col.getColDef().lockVisible) {\n return;\n }\n if (col.isVisible() != visible) {\n colStateItems.push({\n colId: col.getId(),\n hide: !visible\n });\n }\n });\n if (colStateItems.length > 0) {\n this.columnModel.applyColumnState({ state: colStateItems }, eventType);\n }\n };\n ModelItemUtils.prototype.setAllPivot = function (columns, value, eventType) {\n if (this.gridOptionsService.is('functionsPassive')) {\n this.setAllPivotPassive(columns, value);\n }\n else {\n this.setAllPivotActive(columns, value, eventType);\n }\n };\n ModelItemUtils.prototype.setAllPivotPassive = function (columns, value) {\n var copyOfPivotColumns = this.columnModel.getPivotColumns().slice();\n var copyOfValueColumns = this.columnModel.getValueColumns().slice();\n var copyOfRowGroupColumns = this.columnModel.getRowGroupColumns().slice();\n var pivotChanged = false;\n var valueChanged = false;\n var rowGroupChanged = false;\n var turnOnAction = function (col) {\n // don't change any column that's already got a function active\n if (col.isAnyFunctionActive()) {\n return;\n }\n if (col.isAllowValue()) {\n copyOfValueColumns.push(col);\n valueChanged = true;\n }\n else if (col.isAllowRowGroup()) {\n copyOfRowGroupColumns.push(col);\n pivotChanged = true;\n }\n else if (col.isAllowPivot()) {\n copyOfPivotColumns.push(col);\n rowGroupChanged = true;\n }\n };\n var turnOffAction = function (col) {\n if (!col.isAnyFunctionActive()) {\n return;\n }\n if (copyOfPivotColumns.indexOf(col) >= 0) {\n _.removeFromArray(copyOfPivotColumns, col);\n pivotChanged = true;\n }\n if (copyOfValueColumns.indexOf(col) >= 0) {\n _.removeFromArray(copyOfValueColumns, col);\n valueChanged = true;\n }\n if (copyOfRowGroupColumns.indexOf(col) >= 0) {\n _.removeFromArray(copyOfRowGroupColumns, col);\n rowGroupChanged = true;\n }\n };\n var action = value ? turnOnAction : turnOffAction;\n columns.forEach(action);\n if (pivotChanged) {\n var event_1 = {\n type: Events.EVENT_COLUMN_PIVOT_CHANGE_REQUEST,\n columns: copyOfPivotColumns\n };\n this.eventService.dispatchEvent(event_1);\n }\n if (rowGroupChanged) {\n var event_2 = {\n type: Events.EVENT_COLUMN_ROW_GROUP_CHANGE_REQUEST,\n columns: copyOfRowGroupColumns\n };\n this.eventService.dispatchEvent(event_2);\n }\n if (valueChanged) {\n var event_3 = {\n type: Events.EVENT_COLUMN_VALUE_CHANGE_REQUEST,\n columns: copyOfRowGroupColumns\n };\n this.eventService.dispatchEvent(event_3);\n }\n };\n ModelItemUtils.prototype.setAllPivotActive = function (columns, value, eventType) {\n var _this = this;\n var colStateItems = [];\n var turnOnAction = function (col) {\n // don't change any column that's already got a function active\n if (col.isAnyFunctionActive()) {\n return;\n }\n if (col.isAllowValue()) {\n var aggFunc = typeof col.getAggFunc() === 'string'\n ? col.getAggFunc()\n : _this.aggFuncService.getDefaultAggFunc(col);\n colStateItems.push({\n colId: col.getId(),\n aggFunc: aggFunc\n });\n }\n else if (col.isAllowRowGroup()) {\n colStateItems.push({\n colId: col.getId(),\n rowGroup: true\n });\n }\n else if (col.isAllowPivot()) {\n colStateItems.push({\n colId: col.getId(),\n pivot: true\n });\n }\n };\n var turnOffAction = function (col) {\n var isActive = col.isPivotActive() || col.isRowGroupActive() || col.isValueActive();\n if (isActive) {\n colStateItems.push({\n colId: col.getId(),\n pivot: false,\n rowGroup: false,\n aggFunc: null\n });\n }\n };\n var action = value ? turnOnAction : turnOffAction;\n columns.forEach(action);\n if (colStateItems.length > 0) {\n this.columnModel.applyColumnState({ state: colStateItems }, eventType);\n }\n };\n ModelItemUtils.prototype.updateColumns = function (params) {\n var _this = this;\n var columns = params.columns, visibleState = params.visibleState, pivotState = params.pivotState, eventType = params.eventType;\n var state = columns.map(function (column) {\n var colId = column.getColId();\n if (_this.columnModel.isPivotMode()) {\n var pivotStateForColumn = pivotState === null || pivotState === void 0 ? void 0 : pivotState[colId];\n return {\n colId: colId,\n pivot: pivotStateForColumn === null || pivotStateForColumn === void 0 ? void 0 : pivotStateForColumn.pivot,\n rowGroup: pivotStateForColumn === null || pivotStateForColumn === void 0 ? void 0 : pivotStateForColumn.rowGroup,\n aggFunc: pivotStateForColumn === null || pivotStateForColumn === void 0 ? void 0 : pivotStateForColumn.aggFunc,\n };\n }\n else {\n return {\n colId: colId,\n hide: !(visibleState === null || visibleState === void 0 ? void 0 : visibleState[colId])\n };\n }\n });\n this.columnModel.applyColumnState({ state: state }, eventType);\n };\n ModelItemUtils.prototype.createPivotState = function (column) {\n return {\n pivot: column.isPivotActive(),\n rowGroup: column.isRowGroupActive(),\n aggFunc: column.isValueActive() ? column.getAggFunc() : undefined\n };\n };\n __decorate$26([\n Autowired('aggFuncService')\n ], ModelItemUtils.prototype, \"aggFuncService\", void 0);\n __decorate$26([\n Autowired('columnModel')\n ], ModelItemUtils.prototype, \"columnModel\", void 0);\n __decorate$26([\n Autowired('gridOptionsService')\n ], ModelItemUtils.prototype, \"gridOptionsService\", void 0);\n __decorate$26([\n Autowired('eventService')\n ], ModelItemUtils.prototype, \"eventService\", void 0);\n ModelItemUtils = __decorate$26([\n Bean('modelItemUtils')\n ], ModelItemUtils);\n return ModelItemUtils;\n}());\n\n// DO NOT UPDATE MANUALLY: Generated from script during build time\nvar VERSION$e = '30.0.6';\n\nvar ColumnsToolPanelModule = {\n version: VERSION$e,\n moduleName: ModuleNames.ColumnsToolPanelModule,\n beans: [ModelItemUtils],\n agStackComponents: [\n { componentName: 'AgPrimaryColsHeader', componentClass: PrimaryColsHeaderPanel },\n { componentName: 'AgPrimaryColsList', componentClass: PrimaryColsListPanel },\n { componentName: 'AgPrimaryCols', componentClass: PrimaryColsPanel }\n ],\n userComponents: [\n { componentName: 'agColumnsToolPanel', componentClass: ColumnToolPanel },\n ],\n dependantModules: [\n EnterpriseCoreModule,\n RowGroupingModule,\n SideBarModule\n ]\n};\n\nvar workbook = {\n getTemplate: function () {\n return {\n name: \"Workbook\",\n properties: {\n prefixedAttributes: [{\n prefix: \"xmlns:\",\n map: {\n o: \"urn:schemas-microsoft-com:office:office\",\n x: \"urn:schemas-microsoft-com:office:excel\",\n ss: \"urn:schemas-microsoft-com:office:spreadsheet\",\n html: \"http://www.w3.org/TR/REC-html40\"\n },\n }],\n rawMap: {\n xmlns: \"urn:schemas-microsoft-com:office:spreadsheet\"\n }\n }\n };\n }\n};\n\nvar excelWorkbook = {\n getTemplate: function () {\n return {\n name: \"ExcelWorkbook\",\n properties: {\n rawMap: {\n xmlns: \"urn:schemas-microsoft-com:office:excel\"\n }\n },\n children: [{\n name: \"WindowHeight\",\n textNode: \"8130\"\n }, {\n name: \"WindowWidth\",\n textNode: \"15135\"\n }, {\n name: \"WindowHeight\",\n textNode: \"8130\"\n }, {\n name: \"WindowTopX\",\n textNode: \"120\"\n }, {\n name: \"WindowTopY\",\n textNode: \"45\"\n }, {\n name: \"ProtectStructure\",\n textNode: \"False\"\n }, {\n name: \"ProtectWindow\",\n textNode: \"False\"\n }]\n };\n }\n};\n\nvar column = {\n getTemplate: function (c) {\n var width = c.width;\n return {\n name: \"Column\",\n properties: {\n prefixedAttributes: [{\n prefix: \"ss:\",\n map: {\n Width: width\n }\n }]\n }\n };\n }\n};\n\nvar cell = {\n getTemplate: function (c) {\n var mergeAcross = c.mergeAcross, styleId = c.styleId, data = c.data;\n var properties = {};\n if (mergeAcross) {\n properties.MergeAcross = mergeAcross;\n }\n if (styleId) {\n properties.StyleID = styleId;\n }\n return {\n name: \"Cell\",\n properties: {\n prefixedAttributes: [{\n prefix: \"ss:\",\n map: properties\n }]\n },\n children: [{\n name: \"Data\",\n properties: {\n prefixedAttributes: [{\n prefix: \"ss:\",\n map: {\n Type: data === null || data === void 0 ? void 0 : data.type\n }\n }]\n },\n textNode: data === null || data === void 0 ? void 0 : data.value\n }]\n };\n }\n};\n\nvar row = {\n getTemplate: function (r) {\n var cells = r.cells;\n return {\n name: \"Row\",\n children: cells.map(function (it) { return cell.getTemplate(it); })\n };\n }\n};\n\nvar worksheet = {\n getTemplate: function (ws) {\n var table = ws.table, name = ws.name;\n var columns = table.columns, rows = table.rows;\n var c = columns.map(function (it) { return column.getTemplate(it); });\n var r = rows.map(function (it) { return row.getTemplate(it); });\n return {\n name: \"Worksheet\",\n children: [{\n name: \"Table\",\n children: c.concat(r)\n }],\n properties: {\n prefixedAttributes: [{\n prefix: \"ss:\",\n map: {\n Name: name\n }\n }]\n }\n };\n }\n};\n\nvar documentProperties = {\n getTemplate: function () {\n return {\n name: \"DocumentProperties\",\n properties: {\n rawMap: {\n xmlns: \"urn:schemas-microsoft-com:office:office\"\n }\n },\n children: [{\n name: \"Version\",\n textNode: \"12.00\"\n }]\n };\n }\n};\n\nvar alignment = {\n getTemplate: function (styleProperties) {\n var _a = styleProperties.alignment, vertical = _a.vertical, horizontal = _a.horizontal, indent = _a.indent, readingOrder = _a.readingOrder, rotate = _a.rotate, shrinkToFit = _a.shrinkToFit, verticalText = _a.verticalText, wrapText = _a.wrapText;\n return {\n name: 'Alignment',\n properties: {\n prefixedAttributes: [{\n prefix: \"ss:\",\n map: {\n Vertical: vertical,\n Horizontal: horizontal,\n Indent: indent,\n ReadingOrder: readingOrder,\n Rotate: rotate,\n ShrinkToFit: shrinkToFit,\n VerticalText: verticalText,\n WrapText: wrapText\n }\n }]\n }\n };\n }\n};\n\nvar borders = {\n getTemplate: function (styleProperties) {\n var _a = styleProperties.borders, borderBottom = _a.borderBottom, borderLeft = _a.borderLeft, borderRight = _a.borderRight, borderTop = _a.borderTop;\n return {\n name: 'Borders',\n children: [borderBottom, borderLeft, borderRight, borderTop].map(function (it, index) {\n var current = index == 0 ? \"Bottom\" : index == 1 ? \"Left\" : index == 2 ? \"Right\" : \"Top\";\n return {\n name: 'Border',\n properties: {\n prefixedAttributes: [{\n prefix: 'ss:',\n map: {\n Position: current,\n LineStyle: it.lineStyle,\n Weight: it.weight,\n Color: it.color\n }\n }]\n }\n };\n })\n };\n }\n};\n\nvar font = {\n getTemplate: function (styleProperties) {\n var _a = styleProperties.font, bold = _a.bold, fontName = _a.fontName, italic = _a.italic, color = _a.color, outline = _a.outline, shadow = _a.shadow, size = _a.size, strikeThrough = _a.strikeThrough, underline = _a.underline, verticalAlign = _a.verticalAlign, charSet = _a.charSet, family = _a.family;\n return {\n name: \"Font\",\n properties: {\n prefixedAttributes: [{\n prefix: \"ss:\",\n map: {\n Bold: bold,\n FontName: fontName,\n Italic: italic,\n Color: color,\n Outline: outline,\n Shadow: shadow,\n Size: size,\n StrikeThrough: strikeThrough,\n Underline: underline,\n VerticalAlign: verticalAlign\n }\n }, {\n prefix: \"x:\",\n map: {\n CharSet: charSet,\n Family: family\n }\n }]\n }\n };\n }\n};\n\nvar interior = {\n getTemplate: function (styleProperties) {\n var _a = styleProperties.interior, color = _a.color, pattern = _a.pattern, patternColor = _a.patternColor;\n return {\n name: \"Interior\",\n properties: {\n prefixedAttributes: [{\n prefix: \"ss:\",\n map: {\n Color: color,\n Pattern: pattern,\n PatternColor: patternColor\n }\n }]\n }\n };\n }\n};\n\nvar protection = {\n getTemplate: function (styleProperties) {\n return {\n name: \"Protection\",\n properties: {\n prefixedAttributes: [{\n prefix: \"ss:\",\n map: {\n Protected: styleProperties.protection.protected,\n HideFormula: styleProperties.protection.hideFormula\n }\n }]\n }\n };\n }\n};\n\nvar numberFormat = {\n getTemplate: function (styleProperties) {\n var format = styleProperties.numberFormat.format;\n return {\n name: \"NumberFormat\",\n properties: {\n prefixedAttributes: [{\n prefix: \"ss:\",\n map: {\n Format: format\n }\n }]\n }\n };\n }\n};\n\nvar style = {\n getTemplate: function (styleProperties) {\n var id = styleProperties.id, name = styleProperties.name;\n return {\n name: 'Style',\n properties: {\n prefixedAttributes: [{\n prefix: \"ss:\",\n map: {\n ID: id,\n Name: name ? name : id\n }\n }]\n }\n };\n }\n};\n\n/**\n * See https://msdn.microsoft.com/en-us/library/aa140066(v=office.10).aspx\n */\nvar ExcelXmlFactory = /** @class */ (function () {\n function ExcelXmlFactory() {\n }\n ExcelXmlFactory.createExcel = function (styles, currentWorksheet) {\n var header = this.excelXmlHeader();\n var docProps = documentProperties.getTemplate();\n var eWorkbook = excelWorkbook.getTemplate();\n var wb = this.workbook(docProps, eWorkbook, styles, currentWorksheet);\n return \"\" + header + XmlFactory.createXml(wb, function (boolean) { return boolean ? '1' : '0'; });\n };\n ExcelXmlFactory.workbook = function (docProperties, eWorkbook, styles, currentWorksheet) {\n var children = [\n docProperties,\n eWorkbook,\n this.stylesXmlElement(styles)\n ].concat(worksheet.getTemplate(currentWorksheet));\n return Object.assign({}, workbook.getTemplate(), { children: children });\n };\n ExcelXmlFactory.excelXmlHeader = function () {\n return \"\\n \\n \";\n };\n ExcelXmlFactory.stylesXmlElement = function (styles) {\n var _this = this;\n return {\n name: 'Styles',\n children: styles ? styles.map(function (it) { return _this.styleXmlElement(it); }) : []\n };\n };\n ExcelXmlFactory.styleXmlElement = function (styleProperties) {\n var children = _.compose(this.addProperty('alignment', styleProperties), this.addProperty('borders', styleProperties), this.addProperty('font', styleProperties), this.addProperty('interior', styleProperties), this.addProperty('protection', styleProperties), this.addProperty('numberFormat', styleProperties))([]);\n return Object.assign({}, style.getTemplate(styleProperties), { children: children });\n };\n ExcelXmlFactory.addProperty = function (property, styleProperties) {\n return function (children) {\n if (!styleProperties[property]) {\n return children;\n }\n var options = {\n alignment: alignment,\n borders: borders,\n font: font,\n interior: interior,\n numberFormat: numberFormat,\n protection: protection\n };\n return children.concat(options[property].getTemplate(styleProperties));\n };\n };\n ExcelXmlFactory.factoryMode = ExcelFactoryMode.SINGLE_SHEET;\n return ExcelXmlFactory;\n}());\n\nvar INCH_TO_EMU = 9525;\nvar numberFormatMap = {\n '0': 1,\n '0.00': 2,\n '#,##0': 3,\n '#,##0.00': 4,\n '0%': 9,\n '0.00%': 10,\n '0.00E+00': 11,\n '# ?/?': 12,\n '# ??/??': 13,\n 'mm-dd-yy': 14,\n 'd-mmm-yy': 15,\n 'd-mmm': 16,\n 'mmm-yy': 17,\n 'h:mm AM/PM': 18,\n 'h:mm:ss AM/PM': 19,\n 'h:mm': 20,\n 'h:mm:ss': 21,\n 'm/d/yy h:mm': 22,\n '#,##0 ;(#,##0)': 37,\n '#,##0 ;[Red](#,##0)': 38,\n '#,##0.00;(#,##0.00)': 39,\n '#,##0.00;[Red](#,##0.00)': 40,\n 'mm:ss': 45,\n '[h]:mm:ss': 46,\n 'mmss.0': 47,\n '##0.0E+0': 48,\n '@': 49\n};\n\nvar pixelsToPoint = function (pixels) {\n return Math.round(pixels * 72 / 96);\n};\nvar pointsToPixel = function (points) {\n return Math.round(points * 96 / 72);\n};\nvar pixelsToEMU = function (value) {\n return Math.ceil(value * INCH_TO_EMU);\n};\nvar getFontFamilyId = function (name) {\n if (name === undefined) {\n return;\n }\n var families = ['Automatic', 'Roman', 'Swiss', 'Modern', 'Script', 'Decorative'];\n var pos = families.indexOf(name || 'Automatic');\n return Math.max(pos, 0);\n};\nvar getHeightFromProperty = function (rowIndex, height) {\n if (!height) {\n return;\n }\n var finalHeight;\n if (typeof height === 'number') {\n finalHeight = height;\n }\n else {\n var heightFunc = height;\n finalHeight = heightFunc({ rowIndex: rowIndex });\n }\n return pixelsToPoint(finalHeight);\n};\nvar setExcelImageTotalWidth = function (image, columnsToExport) {\n var _a = image.position, colSpan = _a.colSpan, column = _a.column;\n if (image.width) {\n if (colSpan) {\n var columnsInSpan = columnsToExport.slice(column - 1, column + colSpan - 1);\n var totalWidth = 0;\n for (var i = 0; i < columnsInSpan.length; i++) {\n var colWidth = columnsInSpan[i].getActualWidth();\n if (image.width < totalWidth + colWidth) {\n image.position.colSpan = i + 1;\n image.totalWidth = image.width;\n image.width = image.totalWidth - totalWidth;\n break;\n }\n totalWidth += colWidth;\n }\n }\n else {\n image.totalWidth = image.width;\n }\n }\n};\nvar setExcelImageTotalHeight = function (image, rowHeight) {\n var _a = image.position, rowSpan = _a.rowSpan, row = _a.row;\n if (image.height) {\n if (rowSpan) {\n var totalHeight = 0;\n var counter = 0;\n for (var i = row; i < row + rowSpan; i++) {\n var nextRowHeight = pointsToPixel(getHeightFromProperty(i, rowHeight) || 20);\n if (image.height < totalHeight + nextRowHeight) {\n image.position.rowSpan = counter + 1;\n image.totalHeight = image.height;\n image.height = image.totalHeight - totalHeight;\n break;\n }\n totalHeight += nextRowHeight;\n counter++;\n }\n }\n else {\n image.totalHeight = image.height;\n }\n }\n};\nvar createXmlPart = function (body) {\n var header = XmlFactory.createHeader({\n encoding: 'UTF-8',\n standalone: 'yes'\n });\n var xmlBody = XmlFactory.createXml(body);\n return \"\" + header + xmlBody;\n};\nvar getExcelColumnName = function (colIdx) {\n var startCode = 65;\n var tableWidth = 26;\n var fromCharCode = String.fromCharCode;\n var pos = Math.floor(colIdx / tableWidth);\n var tableIdx = colIdx % tableWidth;\n if (!pos || colIdx === tableWidth) {\n return fromCharCode(startCode + colIdx - 1);\n }\n if (!tableIdx) {\n return getExcelColumnName(pos - 1) + 'Z';\n }\n if (pos < tableWidth) {\n return fromCharCode(startCode + pos - 1) + fromCharCode(startCode + tableIdx - 1);\n }\n return getExcelColumnName(pos) + fromCharCode(startCode + tableIdx - 1);\n};\n\nvar __extends$2X = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign$Y = (undefined && undefined.__assign) || function () {\n __assign$Y = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$Y.apply(this, arguments);\n};\nvar __read$1h = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray$L = (undefined && undefined.__spreadArray) || function (to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\n to[j] = from[i];\n return to;\n};\nvar BaseExcelSerializingSession = /** @class */ (function (_super) {\n __extends$2X(BaseExcelSerializingSession, _super);\n function BaseExcelSerializingSession(config) {\n var _this = _super.call(this, config) || this;\n _this.mixedStyles = {};\n _this.mixedStyleCounter = 0;\n _this.rows = [];\n _this.config = Object.assign({}, config);\n _this.stylesByIds = {};\n _this.config.baseExcelStyles.forEach(function (style) {\n _this.stylesByIds[style.id] = style;\n });\n _this.excelStyles = __spreadArray$L([], __read$1h(_this.config.baseExcelStyles));\n return _this;\n }\n BaseExcelSerializingSession.prototype.addCustomContent = function (customContent) {\n var _this = this;\n customContent.forEach(function (row) {\n var rowLen = _this.rows.length + 1;\n var outlineLevel;\n if (!_this.config.suppressRowOutline && row.outlineLevel != null) {\n outlineLevel = row.outlineLevel;\n }\n var rowObj = {\n height: getHeightFromProperty(rowLen, row.height || _this.config.rowHeight),\n cells: (row.cells || []).map(function (cell, idx) {\n var _a, _b, _c;\n var image = _this.addImage(rowLen, _this.columnsToExport[idx], (_a = cell.data) === null || _a === void 0 ? void 0 : _a.value);\n var excelStyles = null;\n if (cell.styleId) {\n excelStyles = typeof cell.styleId === 'string' ? [cell.styleId] : cell.styleId;\n }\n var excelStyleId = _this.getStyleId(excelStyles);\n if (image) {\n return _this.createCell(excelStyleId, _this.getDataTypeForValue(image.value), image.value == null ? '' : image.value);\n }\n var value = (_c = (_b = cell.data) === null || _b === void 0 ? void 0 : _b.value) !== null && _c !== void 0 ? _c : '';\n var type = _this.getDataTypeForValue(value);\n if (cell.mergeAcross) {\n return _this.createMergedCell(excelStyleId, type, value, cell.mergeAcross);\n }\n return _this.createCell(excelStyleId, type, value);\n }),\n outlineLevel: outlineLevel\n };\n if (row.collapsed != null) {\n rowObj.collapsed = row.collapsed;\n }\n if (row.hidden != null) {\n rowObj.hidden = row.hidden;\n }\n _this.rows.push(rowObj);\n });\n };\n BaseExcelSerializingSession.prototype.onNewHeaderGroupingRow = function () {\n var _this = this;\n var currentCells = [];\n this.rows.push({\n cells: currentCells,\n height: getHeightFromProperty(this.rows.length + 1, this.config.headerRowHeight)\n });\n return {\n onColumn: function (columnGroup, header, index, span, collapsibleRanges) {\n var styleIds = _this.config.styleLinker({ rowType: RowType.HEADER_GROUPING, rowIndex: 1, value: \"grouping-\" + header, columnGroup: columnGroup });\n currentCells.push(__assign$Y(__assign$Y({}, _this.createMergedCell(_this.getStyleId(styleIds), _this.getDataTypeForValue('string'), header, span)), { collapsibleRanges: collapsibleRanges }));\n }\n };\n };\n BaseExcelSerializingSession.prototype.onNewHeaderRow = function () {\n return this.onNewRow(this.onNewHeaderColumn, this.config.headerRowHeight);\n };\n BaseExcelSerializingSession.prototype.onNewBodyRow = function (node) {\n var rowAccumulator = this.onNewRow(this.onNewBodyColumn, this.config.rowHeight);\n if (node) {\n this.addRowOutlineIfNecessary(node);\n }\n return rowAccumulator;\n };\n BaseExcelSerializingSession.prototype.addRowOutlineIfNecessary = function (node) {\n var _a = this.config, gridOptionsService = _a.gridOptionsService, suppressRowOutline = _a.suppressRowOutline, _b = _a.rowGroupExpandState, rowGroupExpandState = _b === void 0 ? 'expanded' : _b;\n var isGroupHideOpenParents = gridOptionsService.is('groupHideOpenParents');\n if (isGroupHideOpenParents || suppressRowOutline || node.level == null) {\n return;\n }\n var padding = node.footer ? 1 : 0;\n var currentRow = _.last(this.rows);\n currentRow.outlineLevel = node.level + padding;\n if (rowGroupExpandState === 'expanded') {\n return;\n }\n var collapseAll = rowGroupExpandState === 'collapsed';\n if (node.isExpandable()) {\n var isExpanded = !collapseAll && node.expanded;\n currentRow.collapsed = !isExpanded;\n }\n currentRow.hidden =\n // always show the node if there is no parent to be expanded\n !!node.parent &&\n // or if it is a child of the root node\n node.parent.level !== -1 &&\n (collapseAll || this.isAnyParentCollapsed(node.parent));\n };\n BaseExcelSerializingSession.prototype.isAnyParentCollapsed = function (node) {\n while (node && node.level !== -1) {\n if (!node.expanded) {\n return true;\n }\n node = node.parent;\n }\n return false;\n };\n BaseExcelSerializingSession.prototype.prepare = function (columnsToExport) {\n var _this = this;\n _super.prototype.prepare.call(this, columnsToExport);\n this.columnsToExport = __spreadArray$L([], __read$1h(columnsToExport));\n this.cols = columnsToExport.map(function (col, i) { return _this.convertColumnToExcel(col, i); });\n };\n BaseExcelSerializingSession.prototype.parse = function () {\n // adding custom content might have made some rows wider than the grid, so add new columns\n var longestRow = this.rows.reduce(function (a, b) { return Math.max(a, b.cells.length); }, 0);\n while (this.cols.length < longestRow) {\n this.cols.push(this.convertColumnToExcel(null, this.cols.length + 1));\n }\n var data = {\n name: this.config.sheetName,\n table: {\n columns: this.cols,\n rows: this.rows\n }\n };\n return this.createExcel(data);\n };\n BaseExcelSerializingSession.prototype.isFormula = function (value) {\n if (value == null) {\n return false;\n }\n return this.config.autoConvertFormulas && value.toString().startsWith('=');\n };\n BaseExcelSerializingSession.prototype.isNumerical = function (value) {\n if (typeof value === 'bigint') {\n return true;\n }\n return isFinite(value) && value !== '' && !isNaN(parseFloat(value));\n };\n BaseExcelSerializingSession.prototype.getStyleById = function (styleId) {\n if (styleId == null) {\n return null;\n }\n return this.stylesByIds[styleId] || null;\n };\n BaseExcelSerializingSession.prototype.convertColumnToExcel = function (column, index) {\n var columnWidth = this.config.columnWidth;\n if (columnWidth) {\n if (typeof columnWidth === 'number') {\n return { width: columnWidth };\n }\n return { width: columnWidth({ column: column, index: index }) };\n }\n if (column) {\n var smallestUsefulWidth = 75;\n return { width: Math.max(column.getActualWidth(), smallestUsefulWidth) };\n }\n return {};\n };\n BaseExcelSerializingSession.prototype.onNewHeaderColumn = function (rowIndex, currentCells) {\n var _this = this;\n return function (column, index) {\n var nameForCol = _this.extractHeaderValue(column);\n var styleIds = _this.config.styleLinker({ rowType: RowType.HEADER, rowIndex: rowIndex, value: nameForCol, column: column });\n currentCells.push(_this.createCell(_this.getStyleId(styleIds), _this.getDataTypeForValue('string'), nameForCol));\n };\n };\n BaseExcelSerializingSession.prototype.onNewRow = function (onNewColumnAccumulator, height) {\n var currentCells = [];\n this.rows.push({\n cells: currentCells,\n height: getHeightFromProperty(this.rows.length + 1, height)\n });\n return {\n onColumn: onNewColumnAccumulator.bind(this, this.rows.length, currentCells)()\n };\n };\n BaseExcelSerializingSession.prototype.onNewBodyColumn = function (rowIndex, currentCells) {\n var _this = this;\n var skipCols = 0;\n return function (column, index, node) {\n if (skipCols > 0) {\n skipCols -= 1;\n return;\n }\n var _a = _this.extractRowCellValue(column, index, rowIndex, 'excel', node), valueForCell = _a.value, valueFormatted = _a.valueFormatted;\n var styleIds = _this.config.styleLinker({ rowType: RowType.BODY, rowIndex: rowIndex, value: valueForCell, column: column, node: node });\n var excelStyleId = _this.getStyleId(styleIds);\n var colSpan = column.getColSpan(node);\n var addedImage = _this.addImage(rowIndex, column, valueForCell);\n if (addedImage) {\n currentCells.push(_this.createCell(excelStyleId, _this.getDataTypeForValue(addedImage.value), addedImage.value == null ? '' : addedImage.value));\n }\n else if (colSpan > 1) {\n skipCols = colSpan - 1;\n currentCells.push(_this.createMergedCell(excelStyleId, _this.getDataTypeForValue(valueForCell), valueForCell, colSpan - 1));\n }\n else {\n currentCells.push(_this.createCell(excelStyleId, _this.getDataTypeForValue(valueForCell), valueForCell, valueFormatted));\n }\n };\n };\n BaseExcelSerializingSession.prototype.getStyleId = function (styleIds) {\n if (!styleIds || !styleIds.length) {\n return null;\n }\n if (styleIds.length === 1) {\n return styleIds[0];\n }\n var key = styleIds.join(\"-\");\n if (!this.mixedStyles[key]) {\n this.addNewMixedStyle(styleIds);\n }\n return this.mixedStyles[key].excelID;\n };\n BaseExcelSerializingSession.prototype.addNewMixedStyle = function (styleIds) {\n var _this = this;\n this.mixedStyleCounter += 1;\n var excelId = \"mixedStyle\" + this.mixedStyleCounter;\n var resultantStyle = {};\n styleIds.forEach(function (styleId) {\n _this.excelStyles.forEach(function (excelStyle) {\n if (excelStyle.id === styleId) {\n _.mergeDeep(resultantStyle, _.deepCloneObject(excelStyle));\n }\n });\n });\n resultantStyle.id = excelId;\n resultantStyle.name = excelId;\n var key = styleIds.join(\"-\");\n this.mixedStyles[key] = {\n excelID: excelId,\n key: key,\n result: resultantStyle\n };\n this.excelStyles.push(resultantStyle);\n this.stylesByIds[excelId] = resultantStyle;\n };\n return BaseExcelSerializingSession;\n}(BaseGridSerializingSession));\n\nvar __extends$2W = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar ExcelXmlSerializingSession = /** @class */ (function (_super) {\n __extends$2W(ExcelXmlSerializingSession, _super);\n function ExcelXmlSerializingSession() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n ExcelXmlSerializingSession.prototype.createExcel = function (data) {\n return ExcelXmlFactory.createExcel(this.excelStyles, data);\n };\n ExcelXmlSerializingSession.prototype.getDataTypeForValue = function (valueForCell) {\n return this.isNumerical(valueForCell) ? 'Number' : 'String';\n };\n ExcelXmlSerializingSession.prototype.getType = function (type, style, value) {\n if (this.isFormula(value)) {\n return 'Formula';\n }\n if (style && style.dataType) {\n switch (style.dataType.toLocaleLowerCase()) {\n case 'string':\n return 'Formula';\n case 'number':\n return 'Number';\n case 'datetime':\n return 'DateTime';\n case 'error':\n return 'Error';\n case 'boolean':\n return 'Boolean';\n default:\n console.warn(\"AG Grid: Unrecognized data type for excel export [\" + style.id + \".dataType=\" + style.dataType + \"]\");\n }\n }\n return type;\n };\n ExcelXmlSerializingSession.prototype.addImage = function () {\n return;\n };\n ExcelXmlSerializingSession.prototype.createCell = function (styleId, type, value, valueFormatted) {\n var actualStyle = this.getStyleById(styleId);\n if (!(actualStyle === null || actualStyle === void 0 ? void 0 : actualStyle.dataType) && type === 'String' && valueFormatted) {\n value = valueFormatted;\n }\n var typeTransformed = (this.getType(type, actualStyle, value) || type);\n return {\n styleId: !!actualStyle ? styleId : undefined,\n data: {\n type: typeTransformed,\n value: this.getValueTransformed(typeTransformed, value)\n }\n };\n };\n ExcelXmlSerializingSession.prototype.getValueTransformed = function (typeTransformed, value) {\n var _this = this;\n var wrapText = function (val) {\n if (_this.config.suppressTextAsCDATA) {\n return _.escapeString(val);\n }\n var cdataStart = '';\n var cdataEndRegex = new RegExp(cdataEnd, \"g\");\n return cdataStart\n // CDATA sections are closed by the character sequence ']]>' and there is no\n // way of escaping this, so if the text contains the offending sequence, emit\n // multiple CDATA sections and split the characters between them.\n + String(val).replace(cdataEndRegex, ']]' + cdataEnd + cdataStart + '>')\n + cdataEnd;\n };\n var convertBoolean = function (val) {\n if (!val || val === '0' || val === 'false') {\n return '0';\n }\n return '1';\n };\n switch (typeTransformed) {\n case 'String':\n return wrapText(value);\n case 'Number':\n return Number(value).valueOf() + '';\n case 'Boolean':\n return convertBoolean(value);\n default:\n return value;\n }\n };\n ExcelXmlSerializingSession.prototype.createMergedCell = function (styleId, type, value, numOfCells) {\n return {\n styleId: !!this.getStyleById(styleId) ? styleId : undefined,\n data: {\n type: type,\n value: value\n },\n mergeAcross: numOfCells\n };\n };\n return ExcelXmlSerializingSession;\n}(BaseExcelSerializingSession));\n\nvar coreFactory = {\n getTemplate: function (author) {\n var dt = new Date();\n var jsonDate = dt.toJSON();\n return {\n name: 'cp:coreProperties',\n properties: {\n prefixedAttributes: [{\n prefix: \"xmlns:\",\n map: {\n cp: \"http://schemas.openxmlformats.org/package/2006/metadata/core-properties\",\n dc: 'http://purl.org/dc/elements/1.1/',\n dcterms: 'http://purl.org/dc/terms/',\n dcmitype: 'http://purl.org/dc/dcmitype/',\n xsi: 'http://www.w3.org/2001/XMLSchema-instance'\n }\n }]\n },\n children: [{\n name: 'dc:creator',\n textNode: author\n }, {\n name: 'dc:title',\n textNode: 'Workbook'\n }, {\n name: 'dcterms:created',\n properties: {\n rawMap: {\n 'xsi:type': 'dcterms:W3CDTF'\n }\n },\n textNode: jsonDate\n }, {\n name: 'dcterms:modified',\n properties: {\n rawMap: {\n 'xsi:type': 'dcterms:W3CDTF'\n }\n },\n textNode: jsonDate\n }]\n };\n }\n};\n\nvar contentTypeFactory = {\n getTemplate: function (config) {\n var name = config.name, ContentType = config.ContentType, Extension = config.Extension, PartName = config.PartName;\n return {\n name: name,\n properties: {\n rawMap: {\n Extension: Extension,\n PartName: PartName,\n ContentType: ContentType\n }\n }\n };\n }\n};\n\nvar __read$1g = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray$K = (undefined && undefined.__spreadArray) || function (to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\n to[j] = from[i];\n return to;\n};\nvar contentTypesFactory = {\n getTemplate: function (sheetLen) {\n var worksheets = new Array(sheetLen).fill(undefined).map(function (v, i) { return ({\n name: 'Override',\n ContentType: 'application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml',\n PartName: \"/xl/worksheets/sheet\" + (i + 1) + \".xml\"\n }); });\n var sheetsWithImages = ExcelXlsxFactory.worksheetImages.size;\n var imageTypesObject = {};\n ExcelXlsxFactory.workbookImageIds.forEach(function (v) {\n imageTypesObject[v.type] = true;\n });\n var imageDocs = new Array(sheetsWithImages).fill(undefined).map(function (v, i) { return ({\n name: 'Override',\n ContentType: 'application/vnd.openxmlformats-officedocument.drawing+xml',\n PartName: \"/xl/drawings/drawing\" + (i + 1) + \".xml\"\n }); });\n var imageTypes = Object.keys(imageTypesObject).map(function (ext) { return ({\n name: 'Default',\n ContentType: \"image/\" + ext,\n Extension: ext\n }); });\n var children = __spreadArray$K(__spreadArray$K(__spreadArray$K(__spreadArray$K(__spreadArray$K(__spreadArray$K([], __read$1g(imageTypes)), [\n {\n name: 'Default',\n Extension: 'rels',\n ContentType: 'application/vnd.openxmlformats-package.relationships+xml'\n }, {\n name: 'Default',\n ContentType: 'application/xml',\n Extension: 'xml'\n }, {\n name: 'Override',\n ContentType: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml',\n PartName: \"/xl/workbook.xml\"\n }\n ]), __read$1g(worksheets)), [\n {\n name: 'Override',\n ContentType: 'application/vnd.openxmlformats-officedocument.theme+xml',\n PartName: '/xl/theme/theme1.xml'\n }, {\n name: 'Override',\n ContentType: 'application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml',\n PartName: '/xl/styles.xml'\n }, {\n name: 'Override',\n ContentType: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml',\n PartName: '/xl/sharedStrings.xml'\n }\n ]), __read$1g(imageDocs)), [\n {\n name: 'Override',\n ContentType: 'application/vnd.openxmlformats-package.core-properties+xml',\n PartName: '/docProps/core.xml'\n }\n ]).map(function (contentType) { return contentTypeFactory.getTemplate(contentType); });\n return {\n name: \"Types\",\n properties: {\n rawMap: {\n xmlns: \"http://schemas.openxmlformats.org/package/2006/content-types\"\n }\n },\n children: children\n };\n }\n};\n\nvar getAnchor = function (name, imageAnchor) { return ({\n name: \"xdr:\" + name,\n children: [{\n name: 'xdr:col',\n textNode: (imageAnchor.col).toString()\n }, {\n name: 'xdr:colOff',\n textNode: imageAnchor.offsetX.toString()\n }, {\n name: 'xdr:row',\n textNode: imageAnchor.row.toString()\n }, {\n name: 'xdr:rowOff',\n textNode: imageAnchor.offsetY.toString()\n }]\n}); };\nvar getExt = function (image) {\n var children = [{\n name: 'a:ext',\n properties: {\n rawMap: {\n uri: '{FF2B5EF4-FFF2-40B4-BE49-F238E27FC236}'\n }\n },\n children: [{\n name: 'a16:creationId',\n properties: {\n rawMap: {\n 'id': '{822E6D20-D7BC-2841-A643-D49A6EF008A2}',\n 'xmlns:a16': 'http://schemas.microsoft.com/office/drawing/2014/main'\n }\n }\n }]\n }];\n var recolor = image.recolor && image.recolor.toLowerCase();\n switch (recolor) {\n case 'grayscale':\n case 'sepia':\n case 'washout':\n children.push({\n name: 'a:ext',\n properties: {\n rawMap: {\n uri: '{C183D7F6-B498-43B3-948B-1728B52AA6E4}'\n }\n },\n children: [{\n name: 'adec:decorative',\n properties: {\n rawMap: {\n 'val': '0',\n 'xmlns:adec': 'http://schemas.microsoft.com/office/drawing/2017/decorative'\n }\n }\n }]\n });\n }\n return {\n name: 'a:extLst',\n children: children\n };\n};\nvar getNvPicPr = function (image, index) { return ({\n name: 'xdr:nvPicPr',\n children: [{\n name: 'xdr:cNvPr',\n properties: {\n rawMap: {\n id: index,\n name: image.id,\n descr: image.altText != null ? image.altText : undefined\n }\n },\n children: [getExt(image)]\n }, {\n name: 'xdr:cNvPicPr',\n properties: {\n rawMap: {\n preferRelativeResize: '0'\n }\n },\n children: [{\n name: 'a:picLocks'\n }]\n }]\n}); };\nvar getColorDetails = function (color) {\n if (!color.saturation && !color.tint) {\n return;\n }\n var ret = [];\n if (color.saturation) {\n ret.push({\n name: 'a:satMod',\n properties: {\n rawMap: {\n val: color.saturation * 1000\n }\n }\n });\n }\n if (color.tint) {\n ret.push({\n name: 'a:tint',\n properties: {\n rawMap: {\n val: color.tint * 1000\n }\n }\n });\n }\n return ret;\n};\nvar getDuoTone = function (primaryColor, secondaryColor) {\n return ({\n name: 'a:duotone',\n children: [{\n name: 'a:prstClr',\n properties: {\n rawMap: {\n val: primaryColor.color\n }\n },\n children: getColorDetails(primaryColor)\n }, {\n name: 'a:srgbClr',\n properties: {\n rawMap: {\n val: secondaryColor.color\n }\n },\n children: getColorDetails(secondaryColor)\n }]\n });\n};\nvar getBlipFill = function (image, index) {\n var blipChildren;\n if (image.transparency) {\n var transparency = Math.min(Math.max(image.transparency, 0), 100);\n blipChildren = [{\n name: 'a:alphaModFix',\n properties: {\n rawMap: {\n amt: 100000 - Math.round(transparency * 1000),\n }\n }\n }];\n }\n if (image.recolor) {\n if (!blipChildren) {\n blipChildren = [];\n }\n switch (image.recolor.toLocaleLowerCase()) {\n case 'grayscale':\n blipChildren.push({ name: 'a:grayscl' });\n break;\n case 'sepia':\n blipChildren.push(getDuoTone({ color: 'black' }, { color: 'D9C3A5', tint: 50, saturation: 180 }));\n break;\n case 'washout':\n blipChildren.push({\n name: 'a:lum',\n properties: {\n rawMap: {\n bright: '70000',\n contrast: '-70000'\n }\n }\n });\n break;\n }\n }\n return ({\n name: 'xdr:blipFill',\n children: [{\n name: 'a:blip',\n properties: {\n rawMap: {\n 'cstate': 'print',\n 'r:embed': \"rId\" + index,\n 'xmlns:r': 'http://schemas.openxmlformats.org/officeDocument/2006/relationships'\n }\n },\n children: blipChildren\n }, {\n name: 'a:stretch',\n children: [{\n name: 'a:fillRect'\n }]\n }]\n });\n};\nvar getSpPr = function (image, imageBoxSize) {\n var xfrm = {\n name: 'a:xfrm',\n children: [{\n name: 'a:off',\n properties: {\n rawMap: {\n x: 0,\n y: 0\n }\n }\n }, {\n name: 'a:ext',\n properties: {\n rawMap: {\n cx: imageBoxSize.width,\n cy: imageBoxSize.height\n }\n }\n }]\n };\n if (image.rotation) {\n var rotation = image.rotation;\n xfrm.properties = {\n rawMap: {\n rot: Math.min(Math.max(rotation, 0), 360) * 60000\n }\n };\n }\n var prstGeom = {\n name: 'a:prstGeom',\n properties: {\n rawMap: {\n prst: 'rect'\n }\n },\n children: [{ name: 'a:avLst' }]\n };\n var ret = {\n name: 'xdr:spPr',\n children: [xfrm, prstGeom]\n };\n return ret;\n};\nvar getImageBoxSize = function (image) {\n image.fitCell = !!image.fitCell || (!image.width || !image.height);\n var _a = image.position, position = _a === void 0 ? {} : _a, fitCell = image.fitCell, _b = image.width, width = _b === void 0 ? 0 : _b, _c = image.height, height = _c === void 0 ? 0 : _c, totalHeight = image.totalHeight, totalWidth = image.totalWidth;\n var _d = position.offsetX, offsetX = _d === void 0 ? 0 : _d, _e = position.offsetY, offsetY = _e === void 0 ? 0 : _e, _f = position.row, row = _f === void 0 ? 1 : _f, _g = position.rowSpan, rowSpan = _g === void 0 ? 1 : _g, _h = position.column, column = _h === void 0 ? 1 : _h, _j = position.colSpan, colSpan = _j === void 0 ? 1 : _j;\n return {\n from: {\n row: row - 1,\n col: column - 1,\n offsetX: pixelsToEMU(offsetX),\n offsetY: pixelsToEMU(offsetY)\n },\n to: {\n row: (row - 1) + (fitCell ? 1 : rowSpan - 1),\n col: (column - 1) + (fitCell ? 1 : colSpan - 1),\n offsetX: pixelsToEMU(width + offsetX),\n offsetY: pixelsToEMU(height + offsetY)\n },\n height: pixelsToEMU(totalHeight || height),\n width: pixelsToEMU(totalWidth || width)\n };\n};\nvar getPicture = function (image, currentIndex, worksheetImageIndex, imageBoxSize) {\n return {\n name: 'xdr:pic',\n children: [\n getNvPicPr(image, currentIndex + 1),\n getBlipFill(image, worksheetImageIndex + 1),\n getSpPr(image, imageBoxSize)\n ]\n };\n};\nvar drawingFactory = {\n getTemplate: function (config) {\n var sheetIndex = config.sheetIndex;\n var sheetImages = ExcelXlsxFactory.worksheetImages.get(sheetIndex);\n var sheetImageIds = ExcelXlsxFactory.worksheetImageIds.get(sheetIndex);\n var children = sheetImages.map(function (image, idx) {\n var boxSize = getImageBoxSize(image);\n return ({\n name: 'xdr:twoCellAnchor',\n properties: {\n rawMap: {\n editAs: 'absolute'\n }\n },\n children: [\n getAnchor('from', boxSize.from),\n getAnchor('to', boxSize.to),\n getPicture(image, idx, sheetImageIds.get(image.id).index, boxSize),\n { name: 'xdr:clientData' }\n ]\n });\n });\n return {\n name: 'xdr:wsDr',\n properties: {\n rawMap: {\n 'xmlns:a': 'http://schemas.openxmlformats.org/drawingml/2006/main',\n 'xmlns:xdr': 'http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing'\n }\n },\n children: children\n };\n }\n};\n\nvar __read$1f = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar getColorChildren = function (props) {\n var _a = __read$1f(props, 4), type = _a[0], innerType = _a[1], val = _a[2], lastClr = _a[3];\n return {\n name: \"a:\" + type,\n children: [{\n name: \"a:\" + innerType,\n properties: {\n rawMap: {\n val: val,\n lastClr: lastClr\n }\n }\n }]\n };\n};\nvar colorScheme = {\n getTemplate: function () {\n return {\n name: \"a:clrScheme\",\n properties: {\n rawMap: {\n name: \"Office\"\n }\n },\n children: [\n getColorChildren(['dk1', 'sysClr', 'windowText', '000000']),\n getColorChildren(['lt1', 'sysClr', 'window', 'FFFFFF']),\n getColorChildren(['dk2', 'srgbClr', '44546A']),\n getColorChildren(['lt2', 'srgbClr', 'E7E6E6']),\n getColorChildren(['accent1', 'srgbClr', '4472C4']),\n getColorChildren(['accent2', 'srgbClr', 'ED7D31']),\n getColorChildren(['accent3', 'srgbClr', 'A5A5A5']),\n getColorChildren(['accent4', 'srgbClr', 'FFC000']),\n getColorChildren(['accent5', 'srgbClr', '5B9BD5']),\n getColorChildren(['accent6', 'srgbClr', '70AD47']),\n getColorChildren(['hlink', 'srgbClr', '0563C1']),\n getColorChildren(['folHlink', 'srgbClr', '954F72'])\n ]\n };\n }\n};\n\nvar __read$1e = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar getFont$1 = function (props) {\n var _a = __read$1e(props, 4), type = _a[0], typeface = _a[1], script = _a[2], panose = _a[3];\n return {\n name: \"a:\" + type,\n properties: {\n rawMap: {\n script: script,\n typeface: typeface,\n panose: panose\n }\n }\n };\n};\nvar fontScheme = {\n getTemplate: function () {\n var utf8_encode = _.utf8_encode;\n return {\n name: \"a:fontScheme\",\n properties: {\n rawMap: {\n name: \"Office\"\n }\n },\n children: [{\n name: 'a:majorFont',\n children: [\n getFont$1(['latin', 'Calibri Light', undefined, '020F0302020204030204']),\n getFont$1(['ea', '']),\n getFont$1(['cs', '']),\n getFont$1(['font', utf8_encode('游ゴシック Light'), 'Jpan']),\n getFont$1(['font', utf8_encode('맑은 고딕'), 'Hang']),\n getFont$1(['font', utf8_encode('等线 Light'), 'Hans']),\n getFont$1(['font', utf8_encode('新細明體'), 'Hant']),\n getFont$1(['font', 'Times New Roman', 'Arab']),\n getFont$1(['font', 'Times New Roman', 'Hebr']),\n getFont$1(['font', 'Tahoma', 'Thai']),\n getFont$1(['font', 'Nyala', 'Ethi']),\n getFont$1(['font', 'Vrinda', 'Beng']),\n getFont$1(['font', 'Shruti', 'Gujr']),\n getFont$1(['font', 'MoolBoran', 'Khmr']),\n getFont$1(['font', 'Tunga', 'Knda']),\n getFont$1(['font', 'Raavi', 'Guru']),\n getFont$1(['font', 'Euphemia', 'Cans']),\n getFont$1(['font', 'Plantagenet Cherokee', 'Cher']),\n getFont$1(['font', 'Microsoft Yi Baiti', 'Yiii']),\n getFont$1(['font', 'Microsoft Himalaya', 'Tibt']),\n getFont$1(['font', 'MV Boli', 'Thaa']),\n getFont$1(['font', 'Mangal', 'Deva']),\n getFont$1(['font', 'Gautami', 'Telu']),\n getFont$1(['font', 'Latha', 'Taml']),\n getFont$1(['font', 'Estrangelo Edessa', 'Syrc']),\n getFont$1(['font', 'Kalinga', 'Orya']),\n getFont$1(['font', 'Kartika', 'Mlym']),\n getFont$1(['font', 'DokChampa', 'Laoo']),\n getFont$1(['font', 'Iskoola Pota', 'Sinh']),\n getFont$1(['font', 'Mongolian Baiti', 'Mong']),\n getFont$1(['font', 'Times New Roman', 'Viet']),\n getFont$1(['font', 'Microsoft Uighur', 'Uigh']),\n getFont$1(['font', 'Sylfaen', 'Geor']),\n getFont$1(['font', 'Arial', 'Armn']),\n getFont$1(['font', 'Leelawadee UI', 'Bugi']),\n getFont$1(['font', 'Microsoft JhengHei', 'Bopo']),\n getFont$1(['font', 'Javanese Text', 'Java']),\n getFont$1(['font', 'Segoe UI', 'Lisu']),\n getFont$1(['font', 'Myanmar Text', 'Mymr']),\n getFont$1(['font', 'Ebrima', 'Nkoo']),\n getFont$1(['font', 'Nirmala UI', 'Olck']),\n getFont$1(['font', 'Ebrima', 'Osma']),\n getFont$1(['font', 'Phagspa', 'Phag']),\n getFont$1(['font', 'Estrangelo Edessa', 'Syrn']),\n getFont$1(['font', 'Estrangelo Edessa', 'Syrj']),\n getFont$1(['font', 'Estrangelo Edessa', 'Syre']),\n getFont$1(['font', 'Nirmala UI', 'Sora']),\n getFont$1(['font', 'Microsoft Tai Le', 'Tale']),\n getFont$1(['font', 'Microsoft New Tai Lue', 'Talu']),\n getFont$1(['font', 'Ebrima', 'Tfng'])\n ]\n }, {\n name: 'a:minorFont',\n children: [\n getFont$1(['latin', 'Calibri', undefined, '020F0502020204030204']),\n getFont$1(['ea', '']),\n getFont$1(['cs', '']),\n getFont$1(['font', utf8_encode('游ゴシック'), 'Jpan']),\n getFont$1(['font', utf8_encode('맑은 고딕'), 'Hang']),\n getFont$1(['font', utf8_encode('等线'), 'Hans']),\n getFont$1(['font', utf8_encode('新細明體'), 'Hant']),\n getFont$1(['font', 'Arial', 'Arab']),\n getFont$1(['font', 'Arial', 'Hebr']),\n getFont$1(['font', 'Tahoma', 'Thai']),\n getFont$1(['font', 'Nyala', 'Ethi']),\n getFont$1(['font', 'Vrinda', 'Beng']),\n getFont$1(['font', 'Shruti', 'Gujr']),\n getFont$1(['font', 'DaunPenh', 'Khmr']),\n getFont$1(['font', 'Tunga', 'Knda']),\n getFont$1(['font', 'Raavi', 'Guru']),\n getFont$1(['font', 'Euphemia', 'Cans']),\n getFont$1(['font', 'Plantagenet Cherokee', 'Cher']),\n getFont$1(['font', 'Microsoft Yi Baiti', 'Yiii']),\n getFont$1(['font', 'Microsoft Himalaya', 'Tibt']),\n getFont$1(['font', 'MV Boli', 'Thaa']),\n getFont$1(['font', 'Mangal', 'Deva']),\n getFont$1(['font', 'Gautami', 'Telu']),\n getFont$1(['font', 'Latha', 'Taml']),\n getFont$1(['font', 'Estrangelo Edessa', 'Syrc']),\n getFont$1(['font', 'Kalinga', 'Orya']),\n getFont$1(['font', 'Kartika', 'Mlym']),\n getFont$1(['font', 'DokChampa', 'Laoo']),\n getFont$1(['font', 'Iskoola Pota', 'Sinh']),\n getFont$1(['font', 'Mongolian Baiti', 'Mong']),\n getFont$1(['font', 'Arial', 'Viet']),\n getFont$1(['font', 'Microsoft Uighur', 'Uigh']),\n getFont$1(['font', 'Sylfaen', 'Geor']),\n getFont$1(['font', 'Arial', 'Armn']),\n getFont$1(['font', 'Leelawadee UI', 'Bugi']),\n getFont$1(['font', 'Microsoft JhengHei', 'Bopo']),\n getFont$1(['font', 'Javanese Text', 'Java']),\n getFont$1(['font', 'Segoe UI', 'Lisu']),\n getFont$1(['font', 'Myanmar Text', 'Mymr']),\n getFont$1(['font', 'Ebrima', 'Nkoo']),\n getFont$1(['font', 'Nirmala UI', 'Olck']),\n getFont$1(['font', 'Ebrima', 'Osma']),\n getFont$1(['font', 'Phagspa', 'Phag']),\n getFont$1(['font', 'Estrangelo Edessa', 'Syrn']),\n getFont$1(['font', 'Estrangelo Edessa', 'Syrj']),\n getFont$1(['font', 'Estrangelo Edessa', 'Syre']),\n getFont$1(['font', 'Nirmala UI', 'Sora']),\n getFont$1(['font', 'Microsoft Tai Le', 'Tale']),\n getFont$1(['font', 'Microsoft New Tai Lue', 'Talu']),\n getFont$1(['font', 'Ebrima', 'Tfng'])\n ]\n }]\n };\n }\n};\n\nvar __read$1d = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar getPropertyVal = function (name, val, children) { return ({\n name: \"a:\" + name,\n properties: {\n rawMap: {\n val: val\n }\n },\n children: children\n}); };\nvar getGs = function (props) {\n var _a = __read$1d(props, 6), pos = _a[0], schemeColor = _a[1], satMod = _a[2], lumMod = _a[3], tint = _a[4], shade = _a[5];\n var children = [];\n children.push(getPropertyVal('satMod', satMod));\n if (lumMod) {\n children.push(getPropertyVal('lumMod', lumMod));\n }\n if (tint) {\n children.push(getPropertyVal('tint', tint));\n }\n if (shade) {\n children.push(getPropertyVal('shade', shade));\n }\n return {\n name: 'a:gs',\n properties: {\n rawMap: {\n pos: pos\n }\n },\n children: [{\n name: 'a:schemeClr',\n properties: {\n rawMap: {\n val: schemeColor\n }\n },\n children: children\n }]\n };\n};\nvar getSolidFill = function (val, children) { return ({\n name: 'a:solidFill',\n children: [getPropertyVal('schemeClr', val, children)]\n}); };\nvar getGradFill = function (props) {\n var _a = __read$1d(props, 5), rotWithShape = _a[0], gs1 = _a[1], gs2 = _a[2], gs3 = _a[3], lin = _a[4];\n var _b = __read$1d(lin, 2), ang = _b[0], scaled = _b[1];\n return {\n name: 'a:gradFill',\n properties: {\n rawMap: {\n rotWithShape: rotWithShape\n }\n },\n children: [{\n name: 'a:gsLst',\n children: [\n getGs(gs1),\n getGs(gs2),\n getGs(gs3)\n ]\n }, {\n name: 'a:lin',\n properties: {\n rawMap: {\n ang: ang,\n scaled: scaled\n }\n }\n }]\n };\n};\nvar getLine = function (props) {\n var _a = __read$1d(props, 4), w = _a[0], cap = _a[1], cmpd = _a[2], algn = _a[3];\n return {\n name: 'a:ln',\n properties: {\n rawMap: { w: w, cap: cap, cmpd: cmpd, algn: algn }\n },\n children: [\n getSolidFill('phClr'),\n getPropertyVal('prstDash', 'solid'),\n {\n name: 'a:miter',\n properties: {\n rawMap: {\n lim: '800000'\n }\n }\n }\n ]\n };\n};\nvar getEffectStyle = function (shadow) {\n var children = [];\n if (shadow) {\n var _a = __read$1d(shadow, 5), blurRad = _a[0], dist = _a[1], dir = _a[2], algn = _a[3], rotWithShape = _a[4];\n children.push({\n name: 'a:outerShdw',\n properties: {\n rawMap: { blurRad: blurRad, dist: dist, dir: dir, algn: algn, rotWithShape: rotWithShape }\n },\n children: [\n getPropertyVal('srgbClr', '000000', [getPropertyVal('alpha', '63000')])\n ]\n });\n }\n return {\n name: 'a:effectStyle',\n children: [Object.assign({}, {\n name: 'a:effectLst'\n }, children.length ? { children: children } : {})]\n };\n};\nvar getFillStyleList = function () { return ({\n name: 'a:fillStyleLst',\n children: [\n getSolidFill('phClr'),\n getGradFill([\n '1',\n ['0', 'phClr', '105000', '110000', '67000'],\n ['50000', 'phClr', '103000', '105000', '73000'],\n ['100000', 'phClr', '109000', '105000', '81000'],\n ['5400000', '0']\n ]),\n getGradFill([\n '1',\n ['0', 'phClr', '103000', '102000', '94000'],\n ['50000', 'phClr', '110000', '100000', undefined, '100000'],\n ['100000', 'phClr', '120000', '99000', undefined, '78000'],\n ['5400000', '0']\n ])\n ]\n}); };\nvar getLineStyleList = function () { return ({\n name: 'a:lnStyleLst',\n children: [\n getLine(['6350', 'flat', 'sng', 'ctr']),\n getLine(['12700', 'flat', 'sng', 'ctr']),\n getLine(['19050', 'flat', 'sng', 'ctr'])\n ]\n}); };\nvar getEffectStyleList = function () { return ({\n name: 'a:effectStyleLst',\n children: [\n getEffectStyle(),\n getEffectStyle(),\n getEffectStyle(['57150', '19050', '5400000', 'ctr', '0'])\n ]\n}); };\nvar getBgFillStyleList = function () { return ({\n name: 'a:bgFillStyleLst',\n children: [\n getSolidFill('phClr'),\n getSolidFill('phClr', [\n getPropertyVal('tint', '95000'),\n getPropertyVal('satMod', '170000'),\n ]),\n getGradFill([\n '1',\n ['0', 'phClr', '150000', '102000', '93000', '98000'],\n ['50000', 'phClr', '130000', '103000', '98000', '90000'],\n ['100000', 'phClr', '120000', undefined, undefined, '63000'],\n ['5400000', '0']\n ])\n ]\n}); };\nvar formatScheme = {\n getTemplate: function () {\n return {\n name: \"a:fmtScheme\",\n properties: {\n rawMap: {\n name: \"Office\"\n }\n },\n children: [\n getFillStyleList(),\n getLineStyleList(),\n getEffectStyleList(),\n getBgFillStyleList()\n ]\n };\n }\n};\n\nvar themeElements = {\n getTemplate: function () {\n return {\n name: \"a:themeElements\",\n children: [\n colorScheme.getTemplate(),\n fontScheme.getTemplate(),\n formatScheme.getTemplate()\n ]\n };\n }\n};\n\nvar officeTheme = {\n getTemplate: function () {\n return {\n name: \"a:theme\",\n properties: {\n prefixedAttributes: [{\n prefix: \"xmlns:\",\n map: {\n a: \"http://schemas.openxmlformats.org/drawingml/2006/main\"\n },\n }],\n rawMap: {\n name: \"Office Theme\"\n }\n },\n children: [\n themeElements.getTemplate(),\n {\n name: 'a:objectDefaults'\n },\n {\n name: 'a:extraClrSchemeLst'\n }\n ]\n };\n }\n};\n\nvar buildSharedString = function (strMap) {\n var ret = [];\n strMap.forEach(function (val, key) {\n var textNode = key.toString();\n var child = {\n name: 't',\n textNode: _.utf8_encode(_.escapeString(textNode))\n };\n // if we have leading or trailing spaces, instruct Excel not to trim them\n var preserveSpaces = textNode.trim().length !== textNode.length;\n if (preserveSpaces) {\n child.properties = {\n rawMap: {\n \"xml:space\": \"preserve\"\n }\n };\n }\n ret.push({\n name: 'si',\n children: [child]\n });\n });\n return ret;\n};\nvar sharedStrings = {\n getTemplate: function (strings) {\n return {\n name: \"sst\",\n properties: {\n rawMap: {\n xmlns: 'http://schemas.openxmlformats.org/spreadsheetml/2006/main',\n count: strings.size,\n uniqueCount: strings.size\n }\n },\n children: buildSharedString(strings)\n };\n }\n};\n\nfunction prepareString(str) {\n var split = str.split(/(\\[[^\\]]*\\])/);\n for (var i = 0; i < split.length; i++) {\n // excel formulas require symbols to be escaped. Excel also requires $ to be \n // placed in quotes but only when the $ is not wrapped inside of square brackets.\n var currentString = split[i];\n if (!currentString.length) {\n continue;\n }\n if (!currentString.startsWith('[')) {\n currentString = currentString.replace(/\\$/g, '\"$\"');\n }\n split[i] = _.escapeString(currentString);\n }\n return split.join('');\n}\nvar numberFormatFactory = {\n getTemplate: function (numberFormat) {\n var formatCode = numberFormat.formatCode, numFmtId = numberFormat.numFmtId;\n if (formatCode.length) {\n formatCode = prepareString(formatCode);\n }\n return {\n name: \"numFmt\",\n properties: {\n rawMap: {\n formatCode: formatCode,\n numFmtId: numFmtId\n }\n }\n };\n }\n};\n\nvar numberFormatsFactory = {\n getTemplate: function (numberFormats) {\n return {\n name: \"numFmts\",\n properties: {\n rawMap: {\n count: numberFormats.length\n }\n },\n children: numberFormats.map(function (numberFormat) { return numberFormatFactory.getTemplate(numberFormat); })\n };\n }\n};\n\nvar fontFactory = {\n getTemplate: function (font) {\n var size = font.size, colorTheme = font.colorTheme, _a = font.color, color = _a === void 0 ? 'FF000000' : _a, _b = font.fontName, fontName = _b === void 0 ? 'Calibri' : _b, family = font.family, scheme = font.scheme, italic = font.italic, bold = font.bold, strikeThrough = font.strikeThrough, outline = font.outline, shadow = font.shadow, underline = font.underline, verticalAlign = font.verticalAlign;\n var children = [\n { name: 'sz', properties: { rawMap: { val: size } } },\n { name: 'color', properties: { rawMap: { theme: colorTheme, rgb: color } } },\n { name: 'name', properties: { rawMap: { val: fontName } } }\n ];\n if (family) {\n children.push({ name: 'family', properties: { rawMap: { val: family } } });\n }\n if (scheme) {\n children.push({ name: 'scheme', properties: { rawMap: { val: scheme } } });\n }\n if (italic) {\n children.push({ name: 'i' });\n }\n if (bold) {\n children.push({ name: 'b' });\n }\n if (strikeThrough) {\n children.push({ name: 'strike' });\n }\n if (outline) {\n children.push({ name: 'outline' });\n }\n if (shadow) {\n children.push({ name: 'shadow' });\n }\n if (underline) {\n children.push({ name: 'u', properties: { rawMap: { val: underline } } });\n }\n if (verticalAlign) {\n children.push({ name: 'vertAlign', properties: { rawMap: { val: verticalAlign } } });\n }\n return { name: \"font\", children: children };\n }\n};\n\nvar fontsFactory = {\n getTemplate: function (fonts) {\n return {\n name: \"fonts\",\n properties: {\n rawMap: {\n count: fonts.length\n }\n },\n children: fonts.map(function (font) { return fontFactory.getTemplate(font); })\n };\n }\n};\n\nvar fillFactory = {\n getTemplate: function (fill) {\n var patternType = fill.patternType, fgTheme = fill.fgTheme, fgTint = fill.fgTint, fgRgb = fill.fgRgb, bgRgb = fill.bgRgb, bgIndexed = fill.bgIndexed;\n var pf = {\n name: 'patternFill',\n properties: {\n rawMap: {\n patternType: patternType\n }\n }\n };\n if (fgTheme || fgTint || fgRgb) {\n pf.children = [{\n name: 'fgColor',\n properties: {\n rawMap: {\n theme: fgTheme,\n tint: fgTint,\n rgb: fgRgb\n }\n }\n }];\n }\n if (bgIndexed || bgRgb) {\n if (!pf.children) {\n pf.children = [];\n }\n pf.children.push({\n name: 'bgColor',\n properties: {\n rawMap: {\n indexed: bgIndexed,\n rgb: bgRgb\n }\n }\n });\n }\n return {\n name: \"fill\",\n children: [pf]\n };\n }\n};\n\nvar fillsFactory = {\n getTemplate: function (fills) {\n return {\n name: \"fills\",\n properties: {\n rawMap: {\n count: fills.length\n }\n },\n children: fills.map(function (fill) { return fillFactory.getTemplate(fill); })\n };\n }\n};\n\nvar getWeightName = function (value) {\n switch (value) {\n case 1: return 'thin';\n case 2: return 'medium';\n case 3: return 'thick';\n default: return 'hair';\n }\n};\nvar mappedBorderNames = {\n None: 'None',\n Dot: 'Dotted',\n Dash: 'Dashed',\n Double: 'Double',\n DashDot: 'DashDot',\n DashDotDot: 'DashDotDot',\n SlantDashDot: 'SlantDashDot'\n};\nvar mediumBorders = ['Dashed', 'DashDot', 'DashDotDot'];\nvar colorMap = {\n None: 'none',\n Solid: 'solid',\n Gray50: 'mediumGray',\n Gray75: 'darkGray',\n Gray25: 'lightGray',\n HorzStripe: 'darkHorizontal',\n VertStripe: 'darkVertical',\n ReverseDiagStripe: 'darkDown',\n DiagStripe: 'darkUp',\n DiagCross: 'darkGrid',\n ThickDiagCross: 'darkTrellis',\n ThinHorzStripe: 'lightHorizontal',\n ThinVertStripe: 'lightVertical',\n ThinReverseDiagStripe: 'lightDown',\n ThinDiagStripe: 'lightUp',\n ThinHorzCross: 'lightGrid',\n ThinDiagCross: 'lightTrellis',\n Gray125: 'gray125',\n Gray0625: 'gray0625'\n};\nvar horizontalAlignmentMap = {\n Automatic: 'general',\n Left: 'left',\n Center: 'center',\n Right: 'right',\n Fill: 'fill',\n Justify: 'justify',\n CenterAcrossSelection: 'centerContinuous',\n Distributed: 'distributed',\n JustifyDistributed: 'justify'\n};\nvar verticalAlignmentMap = {\n Automatic: undefined,\n Top: 'top',\n Bottom: 'bottom',\n Center: 'center',\n Justify: 'justify',\n Distributed: 'distributed',\n JustifyDistributed: 'justify'\n};\nvar convertLegacyPattern = function (name) {\n if (!name) {\n return 'none';\n }\n return colorMap[name] || name;\n};\nvar convertLegacyColor = function (color) {\n if (color == undefined) {\n return color;\n }\n if (color.charAt(0) === '#') {\n color = color.substr(1);\n }\n return color.length === 6 ? 'FF' + color : color;\n};\nvar convertLegacyBorder = function (type, weight) {\n if (!type) {\n return 'thin';\n }\n // Legacy Types are: None, Continuous, Dash, Dot, DashDot, DashDotDot, SlantDashDot, and Double\n // Weight represents: 0—Hairline, 1—Thin , 2—Medium, 3—Thick\n // New types: none, thin, medium, dashed, dotted, thick, double, hair, mediumDashed, dashDot, mediumDashDot,\n // dashDotDot, mediumDashDotDot, slantDashDot\n var namedWeight = getWeightName(weight);\n var mappedName = mappedBorderNames[type];\n if (type === 'Continuous') {\n return namedWeight;\n }\n if (namedWeight === 'medium' && mediumBorders.indexOf(mappedName) !== -1) {\n return \"medium\" + mappedName;\n }\n return mappedName.charAt(0).toLowerCase() + mappedName.substr(1);\n};\nvar convertLegacyHorizontalAlignment = function (alignment) {\n return horizontalAlignmentMap[alignment] || 'general';\n};\nvar convertLegacyVerticalAlignment = function (alignment) {\n return verticalAlignmentMap[alignment] || undefined;\n};\n\nvar getBorderColor = function (color) {\n return {\n name: 'color',\n properties: {\n rawMap: {\n rgb: convertLegacyColor(color || '#000000')\n }\n }\n };\n};\nvar borderFactory$1 = {\n getTemplate: function (border) {\n var left = border.left, right = border.right, top = border.top, bottom = border.bottom, diagonal = border.diagonal;\n var leftChildren = left ? [getBorderColor(left.color)] : undefined;\n var rightChildren = right ? [getBorderColor(right.color)] : undefined;\n var topChildren = top ? [getBorderColor(top.color)] : undefined;\n var bottomChildren = bottom ? [getBorderColor(bottom.color)] : undefined;\n var diagonalChildren = diagonal ? [getBorderColor(diagonal.color)] : undefined;\n return {\n name: 'border',\n children: [{\n name: 'left',\n properties: { rawMap: { style: left && left.style } },\n children: leftChildren\n }, {\n name: 'right',\n properties: { rawMap: { style: right && right.style } },\n children: rightChildren\n }, {\n name: 'top',\n properties: { rawMap: { style: top && top.style } },\n children: topChildren\n }, {\n name: 'bottom',\n properties: { rawMap: { style: bottom && bottom.style } },\n children: bottomChildren\n }, {\n name: 'diagonal',\n properties: { rawMap: { style: diagonal && diagonal.style } },\n children: diagonalChildren\n }]\n };\n }\n};\n\nvar bordersFactory = {\n getTemplate: function (borders) {\n return {\n name: \"borders\",\n properties: {\n rawMap: {\n count: borders.length\n }\n },\n children: borders.map(function (border) { return borderFactory$1.getTemplate(border); })\n };\n }\n};\n\nvar getReadingOrderId = function (readingOrder) {\n var order = ['Context', 'LeftToRight', 'RightToLeft'];\n var pos = order.indexOf(readingOrder);\n return Math.max(pos, 0);\n};\nvar alignmentFactory = {\n getTemplate: function (alignment) {\n var horizontal = alignment.horizontal, indent = alignment.indent, readingOrder = alignment.readingOrder, rotate = alignment.rotate, shrinkToFit = alignment.shrinkToFit, vertical = alignment.vertical, wrapText = alignment.wrapText;\n return {\n name: 'alignment',\n properties: {\n rawMap: {\n horizontal: horizontal && convertLegacyHorizontalAlignment(horizontal),\n indent: indent,\n readingOrder: readingOrder && getReadingOrderId(readingOrder),\n textRotation: rotate,\n shrinkToFit: shrinkToFit,\n vertical: vertical && convertLegacyVerticalAlignment(vertical),\n wrapText: wrapText\n }\n }\n };\n }\n};\n\nvar protectionFactory = {\n getTemplate: function (protection) {\n var locked = protection.protected === false ? 0 : 1;\n var hidden = protection.hideFormula === true ? 1 : 0;\n return {\n name: 'protection',\n properties: {\n rawMap: {\n hidden: hidden,\n locked: locked\n }\n }\n };\n }\n};\n\nvar xfFactory = {\n getTemplate: function (xf) {\n var alignment = xf.alignment, borderId = xf.borderId, fillId = xf.fillId, fontId = xf.fontId, numFmtId = xf.numFmtId, protection = xf.protection, xfId = xf.xfId;\n var children = [];\n if (alignment) {\n children.push(alignmentFactory.getTemplate(alignment));\n }\n if (protection) {\n children.push(protectionFactory.getTemplate(protection));\n }\n return {\n name: \"xf\",\n properties: {\n rawMap: {\n applyAlignment: alignment ? 1 : undefined,\n applyProtection: protection ? 1 : undefined,\n applyBorder: borderId ? 1 : undefined,\n applyFill: fillId ? 1 : undefined,\n borderId: borderId,\n fillId: fillId,\n applyFont: fontId ? 1 : undefined,\n fontId: fontId,\n applyNumberFormat: numFmtId ? 1 : undefined,\n numFmtId: numFmtId,\n xfId: xfId\n }\n },\n children: children.length ? children : undefined\n };\n }\n};\n\nvar cellStylesXfsFactory = {\n getTemplate: function (xfs) {\n return {\n name: \"cellStyleXfs\",\n properties: {\n rawMap: {\n count: xfs.length\n }\n },\n children: xfs.map(function (xf) { return xfFactory.getTemplate(xf); })\n };\n }\n};\n\nvar cellXfsFactory = {\n getTemplate: function (xfs) {\n return {\n name: \"cellXfs\",\n properties: {\n rawMap: {\n count: xfs.length\n }\n },\n children: xfs.map(function (xf) { return xfFactory.getTemplate(xf); })\n };\n }\n};\n\nvar borderFactory = {\n getTemplate: function (cellStyle) {\n var builtinId = cellStyle.builtinId, name = cellStyle.name, xfId = cellStyle.xfId;\n return {\n name: \"cellStyle\",\n properties: {\n rawMap: {\n builtinId: builtinId,\n name: name,\n xfId: xfId\n }\n }\n };\n }\n};\n\nvar cellStylesFactory = {\n getTemplate: function (cellStyles) {\n return {\n name: \"cellStyles\",\n properties: {\n rawMap: {\n count: cellStyles.length\n }\n },\n children: cellStyles.map(function (cellStyle) { return borderFactory.getTemplate(cellStyle); })\n };\n }\n};\n\nvar __assign$X = (undefined && undefined.__assign) || function () {\n __assign$X = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$X.apply(this, arguments);\n};\nvar stylesMap;\nvar registeredNumberFmts;\nvar registeredFonts;\nvar registeredFills;\nvar registeredBorders;\nvar registeredCellStyleXfs;\nvar registeredCellXfs;\nvar registeredCellStyles;\nvar currentSheet;\nvar getStyleName = function (name, currentSheet) {\n if (name.indexOf('mixedStyle') !== -1 && currentSheet > 1) {\n name += \"_\" + currentSheet;\n }\n return name;\n};\nvar resetStylesheetValues = function () {\n stylesMap = { base: 0 };\n registeredNumberFmts = [];\n registeredFonts = [{ fontName: 'Calibri', colorTheme: '1', family: '2', scheme: 'minor' }];\n registeredFills = [{ patternType: 'none', }, { patternType: 'gray125' }];\n registeredBorders = [{ left: undefined, right: undefined, top: undefined, bottom: undefined, diagonal: undefined }];\n registeredCellStyleXfs = [{ borderId: 0, fillId: 0, fontId: 0, numFmtId: 0 }];\n registeredCellXfs = [{ borderId: 0, fillId: 0, fontId: 0, numFmtId: 0, xfId: 0 }];\n registeredCellStyles = [{ builtinId: 0, name: 'Normal', xfId: 0 }];\n};\nvar registerFill = function (fill) {\n var convertedPattern = convertLegacyPattern(fill.pattern);\n var convertedFillColor = convertLegacyColor(fill.color);\n var convertedPatternColor = convertLegacyColor(fill.patternColor);\n var pos = registeredFills.findIndex(function (currentFill) {\n var patternType = currentFill.patternType, fgRgb = currentFill.fgRgb, bgRgb = currentFill.bgRgb;\n if (patternType != convertedPattern ||\n fgRgb != convertedFillColor ||\n bgRgb != convertedPatternColor) {\n return false;\n }\n return true;\n });\n if (pos === -1) {\n pos = registeredFills.length;\n registeredFills.push({ patternType: convertedPattern, fgRgb: convertedFillColor, bgRgb: convertedPatternColor });\n }\n return pos;\n};\nvar registerNumberFmt = function (format) {\n format = _.utf8_encode(format);\n if (numberFormatMap[format]) {\n return numberFormatMap[format];\n }\n var pos = registeredNumberFmts.findIndex(function (currentFormat) { return currentFormat.formatCode === format; });\n if (pos === -1) {\n pos = registeredNumberFmts.length + 164;\n registeredNumberFmts.push({ formatCode: format, numFmtId: pos });\n }\n else {\n pos = registeredNumberFmts[pos].numFmtId;\n }\n return pos;\n};\nvar registerBorders = function (borders) {\n var borderBottom = borders.borderBottom, borderTop = borders.borderTop, borderLeft = borders.borderLeft, borderRight = borders.borderRight;\n var bottomStyle;\n var topStyle;\n var leftStyle;\n var rightStyle;\n var bottomColor;\n var topColor;\n var leftColor;\n var rightColor;\n if (borderLeft) {\n leftStyle = convertLegacyBorder(borderLeft.lineStyle, borderLeft.weight);\n leftColor = convertLegacyColor(borderLeft.color);\n }\n if (borderRight) {\n rightStyle = convertLegacyBorder(borderRight.lineStyle, borderRight.weight);\n rightColor = convertLegacyColor(borderRight.color);\n }\n if (borderBottom) {\n bottomStyle = convertLegacyBorder(borderBottom.lineStyle, borderBottom.weight);\n bottomColor = convertLegacyColor(borderBottom.color);\n }\n if (borderTop) {\n topStyle = convertLegacyBorder(borderTop.lineStyle, borderTop.weight);\n topColor = convertLegacyColor(borderTop.color);\n }\n var pos = registeredBorders.findIndex(function (currentBorder) {\n var left = currentBorder.left, right = currentBorder.right, top = currentBorder.top, bottom = currentBorder.bottom;\n if (!left && (leftStyle || leftColor)) {\n return false;\n }\n if (!right && (rightStyle || rightColor)) {\n return false;\n }\n if (!top && (topStyle || topColor)) {\n return false;\n }\n if (!bottom && (bottomStyle || bottomColor)) {\n return false;\n }\n var _a = left || {}, clS = _a.style, clC = _a.color;\n var _b = right || {}, crS = _b.style, crC = _b.color;\n var _c = top || {}, ctS = _c.style, ctC = _c.color;\n var _d = bottom || {}, cbS = _d.style, cbC = _d.color;\n if (clS != leftStyle || clC != leftColor) {\n return false;\n }\n if (crS != rightStyle || crC != rightColor) {\n return false;\n }\n if (ctS != topStyle || ctC != topColor) {\n return false;\n }\n if (cbS != bottomStyle || cbC != bottomColor) {\n return false;\n }\n return true;\n });\n if (pos === -1) {\n pos = registeredBorders.length;\n registeredBorders.push({\n left: {\n style: leftStyle, color: leftColor\n },\n right: {\n style: rightStyle, color: rightColor\n },\n top: {\n style: topStyle, color: topColor\n },\n bottom: {\n style: bottomStyle, color: bottomColor\n },\n diagonal: {\n style: undefined,\n color: undefined\n }\n });\n }\n return pos;\n};\nvar registerFont = function (font) {\n var _a = font.fontName, name = _a === void 0 ? 'Calibri' : _a, color = font.color, size = font.size, bold = font.bold, italic = font.italic, outline = font.outline, shadow = font.shadow, strikeThrough = font.strikeThrough, underline = font.underline, family = font.family, verticalAlign = font.verticalAlign;\n var utf8Name = name ? _.utf8_encode(name) : name;\n var convertedColor = convertLegacyColor(color);\n var familyId = getFontFamilyId(family);\n var convertedUnderline = underline ? underline.toLocaleLowerCase() : undefined;\n var convertedVerticalAlign = verticalAlign ? verticalAlign.toLocaleLowerCase() : undefined;\n var pos = registeredFonts.findIndex(function (currentFont) {\n if (currentFont.fontName != utf8Name ||\n currentFont.color != convertedColor ||\n currentFont.size != size ||\n currentFont.bold != bold ||\n currentFont.italic != italic ||\n currentFont.outline != outline ||\n currentFont.shadow != shadow ||\n currentFont.strikeThrough != strikeThrough ||\n currentFont.underline != convertedUnderline ||\n currentFont.verticalAlign != convertedVerticalAlign ||\n // @ts-ignore\n currentFont.family != familyId) {\n return false;\n }\n return true;\n });\n if (pos === -1) {\n pos = registeredFonts.length;\n registeredFonts.push({\n fontName: utf8Name,\n color: convertedColor,\n size: size,\n bold: bold,\n italic: italic,\n outline: outline,\n shadow: shadow,\n strikeThrough: strikeThrough,\n underline: convertedUnderline,\n verticalAlign: convertedVerticalAlign,\n family: familyId != null ? familyId.toString() : undefined\n });\n }\n return pos;\n};\nvar registerStyle = function (config) {\n var alignment = config.alignment, borders = config.borders, font = config.font, interior = config.interior, numberFormat = config.numberFormat, protection = config.protection;\n var id = config.id;\n var currentFill = 0;\n var currentBorder = 0;\n var currentFont = 0;\n var currentNumberFmt = 0;\n if (!id) {\n return;\n }\n id = getStyleName(id, currentSheet);\n if (stylesMap[id] != undefined) {\n return;\n }\n if (interior) {\n currentFill = registerFill(interior);\n }\n if (borders) {\n currentBorder = registerBorders(borders);\n }\n if (font) {\n currentFont = registerFont(font);\n }\n if (numberFormat) {\n currentNumberFmt = registerNumberFmt(numberFormat.format);\n }\n stylesMap[id] = registeredCellXfs.length;\n registeredCellXfs.push({\n alignment: alignment,\n borderId: currentBorder || 0,\n fillId: currentFill || 0,\n fontId: currentFont || 0,\n numFmtId: currentNumberFmt || 0,\n protection: protection,\n xfId: 0\n });\n};\nvar stylesheetFactory = {\n getTemplate: function (defaultFontSize) {\n var numberFormats = numberFormatsFactory.getTemplate(registeredNumberFmts);\n var fonts = fontsFactory.getTemplate(registeredFonts.map(function (font) { return (__assign$X(__assign$X({}, font), { size: font.size != null ? font.size : defaultFontSize })); }));\n var fills = fillsFactory.getTemplate(registeredFills);\n var borders = bordersFactory.getTemplate(registeredBorders);\n var cellStylesXfs = cellStylesXfsFactory.getTemplate(registeredCellStyleXfs);\n var cellXfs = cellXfsFactory.getTemplate(registeredCellXfs);\n var cellStyles = cellStylesFactory.getTemplate(registeredCellStyles);\n resetStylesheetValues();\n return {\n name: 'styleSheet',\n properties: {\n rawMap: {\n 'mc:Ignorable': 'x14ac x16r2 xr',\n 'xmlns': 'http://schemas.openxmlformats.org/spreadsheetml/2006/main',\n 'xmlns:mc': 'http://schemas.openxmlformats.org/markup-compatibility/2006',\n 'xmlns:x14ac': 'http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac',\n 'xmlns:x16r2': 'http://schemas.microsoft.com/office/spreadsheetml/2015/02/main',\n 'xmlns:xr': 'http://schemas.microsoft.com/office/spreadsheetml/2014/revision'\n }\n },\n children: [\n numberFormats,\n fonts,\n fills,\n borders,\n cellStylesXfs,\n cellXfs,\n cellStyles,\n {\n name: 'tableStyles',\n properties: {\n rawMap: {\n count: 0,\n defaultPivotStyle: 'PivotStyleLight16',\n defaultTableStyle: 'TableStyleMedium2'\n }\n }\n }\n ]\n };\n }\n};\nvar getStyleId = function (name, currentSheet) {\n return stylesMap[getStyleName(name, currentSheet)] || 0;\n};\nvar registerStyles = function (styles, _currentSheet) {\n currentSheet = _currentSheet;\n if (currentSheet === 1) {\n resetStylesheetValues();\n }\n styles.forEach(registerStyle);\n};\n\nvar sheetFactory = {\n getTemplate: function (name, idx) {\n var sheetId = (idx + 1).toString();\n return {\n name: \"sheet\",\n properties: {\n rawMap: {\n \"name\": name,\n \"sheetId\": sheetId,\n \"r:id\": \"rId\" + sheetId\n }\n }\n };\n }\n};\n\nvar sheetsFactory = {\n getTemplate: function (names) {\n return {\n name: \"sheets\",\n children: names.map(function (sheet, idx) { return sheetFactory.getTemplate(sheet, idx); })\n };\n }\n};\n\nvar workbookFactory = {\n getTemplate: function (names) {\n return {\n name: \"workbook\",\n properties: {\n prefixedAttributes: [{\n prefix: \"xmlns:\",\n map: {\n r: \"http://schemas.openxmlformats.org/officeDocument/2006/relationships\"\n },\n }],\n rawMap: {\n xmlns: \"http://schemas.openxmlformats.org/spreadsheetml/2006/main\"\n }\n },\n children: [sheetsFactory.getTemplate(names)]\n };\n }\n};\n\n// https://docs.microsoft.com/en-us/office/troubleshoot/excel/determine-column-widths\nvar getExcelCellWidth = function (width) { return Math.ceil((width - 12) / 7 + 1); };\nvar columnFactory = {\n getTemplate: function (config) {\n var min = config.min, max = config.max, outlineLevel = config.outlineLevel, s = config.s, width = config.width, hidden = config.hidden, bestFit = config.bestFit;\n var excelWidth = 1;\n var customWidth = '0';\n if (width > 1) {\n excelWidth = getExcelCellWidth(width);\n customWidth = '1';\n }\n return {\n name: 'col',\n properties: {\n rawMap: {\n min: min,\n max: max,\n outlineLevel: outlineLevel != null ? outlineLevel : undefined,\n width: excelWidth,\n style: s,\n hidden: hidden ? '1' : '0',\n bestFit: bestFit ? '1' : '0',\n customWidth: customWidth\n }\n }\n };\n }\n};\n\nvar convertLegacyType = function (type) {\n var t = type.charAt(0).toLowerCase();\n return t === 's' ? 'inlineStr' : t;\n};\nvar cellFactory = {\n getTemplate: function (config, idx, currentSheet) {\n var ref = config.ref, data = config.data, styleId = config.styleId;\n var _a = data || { type: 'empty', value: null }, type = _a.type, value = _a.value;\n var convertedType = type;\n if (type === 'f') {\n convertedType = 'str';\n }\n else if (type.charAt(0) === type.charAt(0).toUpperCase()) {\n convertedType = convertLegacyType(type);\n }\n var obj = {\n name: 'c',\n properties: {\n rawMap: {\n r: ref,\n t: convertedType === 'empty' ? undefined : convertedType,\n s: styleId ? getStyleId(styleId, currentSheet) : undefined\n }\n }\n };\n if (convertedType === 'empty') {\n return obj;\n }\n var children;\n if (convertedType === 'str' && type === 'f') {\n children = [{\n name: 'f',\n textNode: _.escapeString(_.utf8_encode(value))\n }];\n }\n else if (convertedType === 'inlineStr') {\n children = [{\n name: 'is',\n children: [{\n name: 't',\n textNode: _.escapeString(_.utf8_encode(value))\n }]\n }];\n }\n else {\n children = [{\n name: 'v',\n textNode: value\n }];\n }\n return Object.assign({}, obj, { children: children });\n }\n};\n\nvar __read$1c = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray$J = (undefined && undefined.__spreadArray) || function (to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\n to[j] = from[i];\n return to;\n};\nvar addEmptyCells = function (cells, rowIdx) {\n var mergeMap = [];\n var posCounter = 0;\n for (var i = 0; i < cells.length; i++) {\n var cell = cells[i];\n if (cell.mergeAcross) {\n mergeMap.push({\n pos: i,\n excelPos: posCounter\n });\n posCounter += cell.mergeAcross;\n }\n posCounter++;\n }\n if (mergeMap.length) {\n for (var i = mergeMap.length - 1; i >= 0; i--) {\n var mergedCells = [];\n var cell = cells[mergeMap[i].pos];\n for (var j = 1; j <= cell.mergeAcross; j++) {\n mergedCells.push({\n ref: \"\" + getExcelColumnName(mergeMap[i].excelPos + 1 + j) + (rowIdx + 1),\n styleId: cell.styleId,\n data: { type: 'empty', value: null }\n });\n }\n if (mergedCells.length) {\n cells.splice.apply(cells, __spreadArray$J([mergeMap[i].pos + 1, 0], __read$1c(mergedCells)));\n }\n }\n }\n};\nvar shouldDisplayCell = function (cell) { var _a; return ((_a = cell.data) === null || _a === void 0 ? void 0 : _a.value) !== '' || cell.styleId !== undefined; };\nvar rowFactory = {\n getTemplate: function (config, idx, currentSheet) {\n var collapsed = config.collapsed, hidden = config.hidden, height = config.height, outlineLevel = config.outlineLevel, _a = config.cells, cells = _a === void 0 ? [] : _a;\n addEmptyCells(cells, idx);\n var children = cells.filter(shouldDisplayCell).map(function (cell, idx) { return cellFactory.getTemplate(cell, idx, currentSheet); });\n return {\n name: \"row\",\n properties: {\n rawMap: {\n r: idx + 1,\n collapsed: collapsed ? '1' : '0',\n hidden: hidden ? '1' : '0',\n ht: height,\n customHeight: height != null ? '1' : '0',\n spans: '1:1',\n outlineLevel: outlineLevel || undefined\n }\n },\n children: children\n };\n }\n};\n\nvar mergeCellFactory = {\n getTemplate: function (ref) {\n return {\n name: 'mergeCell',\n properties: {\n rawMap: {\n ref: ref\n }\n }\n };\n }\n};\n\nvar getMergedCellsAndAddColumnGroups = function (rows, cols, suppressColumnOutline) {\n var mergedCells = [];\n var cellsWithCollapsibleGroups = [];\n rows.forEach(function (currentRow, rowIdx) {\n var cells = currentRow.cells;\n var merges = 0;\n var lastCol;\n cells.forEach(function (currentCell, cellIdx) {\n var min = cellIdx + merges + 1;\n var start = getExcelColumnName(min);\n var outputRow = rowIdx + 1;\n if (currentCell.mergeAcross) {\n merges += currentCell.mergeAcross;\n var end = getExcelColumnName(cellIdx + merges + 1);\n mergedCells.push(\"\" + start + outputRow + \":\" + end + outputRow);\n }\n if (!cols[min - 1]) {\n cols[min - 1] = {};\n }\n var collapsibleRanges = currentCell.collapsibleRanges;\n if (collapsibleRanges) {\n collapsibleRanges.forEach(function (range) {\n cellsWithCollapsibleGroups.push([min + range[0], min + range[1]]);\n });\n }\n lastCol = cols[min - 1];\n lastCol.min = min;\n lastCol.max = min;\n currentCell.ref = \"\" + start + outputRow;\n });\n });\n cellsWithCollapsibleGroups.sort(function (a, b) {\n if (a[0] !== b[0]) {\n return a[0] - b[0];\n }\n return b[1] - a[1];\n });\n var rangeMap = new Map();\n var outlineLevel = new Map();\n cellsWithCollapsibleGroups.filter(function (currentRange) {\n var rangeString = currentRange.toString();\n var inMap = rangeMap.get(rangeString);\n if (inMap) {\n return false;\n }\n rangeMap.set(rangeString, true);\n return true;\n }).forEach(function (range) {\n var refCol = cols.find(function (col) { return col.min == range[0] && col.max == range[1]; });\n var currentOutlineLevel = outlineLevel.get(range[0]);\n cols.push({\n min: range[0],\n max: range[1],\n outlineLevel: suppressColumnOutline ? undefined : (currentOutlineLevel || 1),\n width: (refCol || { width: 100 }).width\n });\n outlineLevel.set(range[0], (currentOutlineLevel || 0) + 1);\n });\n return mergedCells;\n};\nvar getPageOrientation = function (orientation) {\n if (!orientation || (orientation !== 'Portrait' && orientation !== 'Landscape')) {\n return 'portrait';\n }\n return orientation.toLocaleLowerCase();\n};\nvar getPageSize = function (pageSize) {\n if (pageSize == null) {\n return 1;\n }\n var positions = ['Letter', 'Letter Small', 'Tabloid', 'Ledger', 'Legal', 'Statement', 'Executive', 'A3', 'A4', 'A4 Small', 'A5', 'A6', 'B4', 'B5', 'Folio', 'Envelope', 'Envelope DL', 'Envelope C5', 'Envelope B5', 'Envelope C3', 'Envelope C4', 'Envelope C6', 'Envelope Monarch', 'Japanese Postcard', 'Japanese Double Postcard'];\n var pos = positions.indexOf(pageSize);\n return pos === -1 ? 1 : (pos + 1);\n};\nvar addColumns = function (columns) {\n return function (children) {\n if (columns.length) {\n children.push({\n name: 'cols',\n children: columns.map(function (column) { return columnFactory.getTemplate(column); })\n });\n }\n return children;\n };\n};\nvar addSheetData = function (rows, sheetNumber) {\n return function (children) {\n if (rows.length) {\n children.push({\n name: 'sheetData',\n children: rows.map(function (row, idx) { return rowFactory.getTemplate(row, idx, sheetNumber); })\n });\n }\n return children;\n };\n};\nvar addMergeCells = function (mergeCells) {\n return function (children) {\n if (mergeCells.length) {\n children.push({\n name: 'mergeCells',\n properties: {\n rawMap: {\n count: mergeCells.length\n }\n },\n children: mergeCells.map(function (mergedCell) { return mergeCellFactory.getTemplate(mergedCell); })\n });\n }\n return children;\n };\n};\nvar addPageMargins = function (margins) {\n return function (children) {\n var _a = margins.top, top = _a === void 0 ? 0.75 : _a, _b = margins.right, right = _b === void 0 ? 0.7 : _b, _c = margins.bottom, bottom = _c === void 0 ? 0.75 : _c, _d = margins.left, left = _d === void 0 ? 0.7 : _d, _e = margins.header, header = _e === void 0 ? 0.3 : _e, _f = margins.footer, footer = _f === void 0 ? 0.3 : _f;\n children.push({\n name: 'pageMargins',\n properties: {\n rawMap: { bottom: bottom, footer: footer, header: header, left: left, right: right, top: top }\n }\n });\n return children;\n };\n};\nvar addPageSetup = function (pageSetup) {\n return function (children) {\n if (pageSetup) {\n children.push({\n name: 'pageSetup',\n properties: {\n rawMap: {\n horizontalDpi: 0,\n verticalDpi: 0,\n orientation: getPageOrientation(pageSetup.orientation),\n paperSize: getPageSize(pageSetup.pageSize)\n }\n }\n });\n }\n return children;\n };\n};\nvar replaceHeaderFooterTokens = function (value) {\n var map = {\n '&[Page]': '&P',\n '&[Pages]': '&N',\n '&[Date]': '&D',\n '&[Time]': '&T',\n '&[Tab]': '&A',\n '&[Path]': '&Z',\n '&[File]': '&F'\n };\n _.iterateObject(map, function (key, val) {\n value = value.replace(key, val);\n });\n return value;\n};\nvar getHeaderPosition = function (position) {\n if (position === 'Center') {\n return 'C';\n }\n if (position === 'Right') {\n return 'R';\n }\n return 'L';\n};\nvar applyHeaderFontStyle = function (headerString, font) {\n if (!font) {\n return headerString;\n }\n headerString += '&"';\n headerString += font.fontName || 'Calibri';\n if (font.bold !== font.italic) {\n headerString += font.bold ? ',Bold' : ',Italic';\n }\n else if (font.bold) {\n headerString += ',Bold Italic';\n }\n else {\n headerString += ',Regular';\n }\n headerString += '"';\n if (font.size) {\n headerString += \"&\" + font.size;\n }\n if (font.strikeThrough) {\n headerString += '&S';\n }\n if (font.underline) {\n headerString += \"&\" + (font.underline === 'Double' ? 'E' : 'U');\n }\n if (font.color) {\n headerString += \"&K\" + font.color.replace('#', '').toUpperCase();\n }\n return headerString;\n};\nvar processHeaderFooterContent = function (content) {\n return content.reduce(function (prev, curr) {\n var pos = getHeaderPosition(curr.position);\n var output = applyHeaderFontStyle(prev + \"&\" + pos, curr.font);\n return \"\" + output + _.escapeString(replaceHeaderFooterTokens(curr.value));\n }, '');\n};\nvar buildHeaderFooter = function (headerFooterConfig) {\n var rules = ['all', 'first', 'even'];\n var headersAndFooters = [];\n rules.forEach(function (rule) {\n var headerFooter = headerFooterConfig[rule];\n var namePrefix = rule === 'all' ? 'odd' : rule;\n if (!headerFooter || (!headerFooter.header && !headerFooter.footer)) {\n return;\n }\n _.iterateObject(headerFooter, function (key, value) {\n var nameSuffix = \"\" + key.charAt(0).toUpperCase() + key.slice(1);\n if (value) {\n headersAndFooters.push({\n name: \"\" + namePrefix + nameSuffix,\n properties: {\n rawMap: {\n 'xml:space': 'preserve'\n }\n },\n textNode: processHeaderFooterContent(value)\n });\n }\n });\n });\n return headersAndFooters;\n};\nvar addHeaderFooter = function (headerFooterConfig) {\n return function (children) {\n if (!headerFooterConfig) {\n return children;\n }\n var differentFirst = headerFooterConfig.first != null ? 1 : 0;\n var differentOddEven = headerFooterConfig.even != null ? 1 : 0;\n children.push({\n name: 'headerFooter',\n properties: {\n rawMap: {\n differentFirst: differentFirst,\n differentOddEven: differentOddEven\n }\n },\n children: buildHeaderFooter(headerFooterConfig)\n });\n return children;\n };\n};\nvar addDrawingRel = function (currentSheet) {\n return function (children) {\n if (ExcelXlsxFactory.worksheetImages.get(currentSheet)) {\n children.push({\n name: 'drawing',\n properties: {\n rawMap: {\n 'r:id': 'rId1'\n }\n }\n });\n }\n return children;\n };\n};\nvar addSheetPr = function () {\n return function (children) {\n children.push({\n name: 'sheetPr',\n children: [{\n name: 'outlinePr',\n properties: {\n rawMap: {\n summaryBelow: 0\n }\n }\n }]\n });\n return children;\n };\n};\nvar addSheetFormatPr = function (rows) {\n return function (children) {\n var maxOutline = rows.reduce(function (prev, row) {\n if (row.outlineLevel && row.outlineLevel > prev) {\n return row.outlineLevel;\n }\n return prev;\n }, 0);\n children.push({\n name: 'sheetFormatPr',\n properties: {\n rawMap: {\n baseColWidth: 10,\n defaultRowHeight: 16,\n outlineLevelRow: maxOutline ? maxOutline : undefined\n }\n }\n });\n return children;\n };\n};\nvar worksheetFactory = {\n getTemplate: function (params) {\n var worksheet = params.worksheet, currentSheet = params.currentSheet, config = params.config;\n var _a = config.margins, margins = _a === void 0 ? {} : _a, pageSetup = config.pageSetup, headerFooterConfig = config.headerFooterConfig, suppressColumnOutline = config.suppressColumnOutline;\n var table = worksheet.table;\n var rows = table.rows, columns = table.columns;\n var mergedCells = (columns && columns.length) ? getMergedCellsAndAddColumnGroups(rows, columns, !!suppressColumnOutline) : [];\n var createWorksheetChildren = _.compose(addSheetPr(), addSheetFormatPr(rows), addColumns(columns), addSheetData(rows, currentSheet + 1), addMergeCells(mergedCells), addPageMargins(margins), addPageSetup(pageSetup), addHeaderFooter(headerFooterConfig), addDrawingRel(currentSheet));\n var children = createWorksheetChildren([]);\n return {\n name: \"worksheet\",\n properties: {\n prefixedAttributes: [{\n prefix: \"xmlns:\",\n map: {\n r: \"http://schemas.openxmlformats.org/officeDocument/2006/relationships\"\n }\n }],\n rawMap: {\n xmlns: \"http://schemas.openxmlformats.org/spreadsheetml/2006/main\"\n }\n },\n children: children\n };\n }\n};\n\nvar relationshipFactory = {\n getTemplate: function (config) {\n var Id = config.Id, Type = config.Type, Target = config.Target;\n return {\n name: \"Relationship\",\n properties: {\n rawMap: {\n Id: Id,\n Type: Type,\n Target: Target\n }\n }\n };\n }\n};\n\nvar relationshipsFactory = {\n getTemplate: function (c) {\n var children = c.map(function (relationship) { return relationshipFactory.getTemplate(relationship); });\n return {\n name: \"Relationships\",\n properties: {\n rawMap: {\n xmlns: \"http://schemas.openxmlformats.org/package/2006/relationships\"\n }\n },\n children: children\n };\n }\n};\n\nvar __read$1b = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray$I = (undefined && undefined.__spreadArray) || function (to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\n to[j] = from[i];\n return to;\n};\n/**\n * See https://www.ecma-international.org/news/TC45_current_work/OpenXML%20White%20Paper.pdf\n */\nvar ExcelXlsxFactory = /** @class */ (function () {\n function ExcelXlsxFactory() {\n }\n ExcelXlsxFactory.createExcel = function (styles, worksheet, config) {\n this.addSheetName(worksheet);\n registerStyles(styles, this.sheetNames.length);\n return this.createWorksheet(worksheet, config);\n };\n ExcelXlsxFactory.buildImageMap = function (image, rowIndex, col, columnsToExport, rowHeight) {\n var currentSheetIndex = this.sheetNames.length;\n var registeredImage = this.images.get(image.id);\n if (!image.position || !image.position.row || !image.position.column) {\n if (!image.position) {\n image.position = {};\n }\n image.position = Object.assign({}, image.position, {\n row: rowIndex,\n column: columnsToExport.indexOf(col) + 1\n });\n }\n var calculatedImage = image;\n setExcelImageTotalWidth(calculatedImage, columnsToExport);\n setExcelImageTotalHeight(calculatedImage, rowHeight);\n if (registeredImage) {\n var currentSheetImages = registeredImage.find(function (currentImage) { return currentImage.sheetId === currentSheetIndex; });\n if (currentSheetImages) {\n currentSheetImages.image.push(calculatedImage);\n }\n else {\n registeredImage.push({\n sheetId: currentSheetIndex,\n image: [calculatedImage]\n });\n }\n }\n else {\n this.images.set(calculatedImage.id, [{ sheetId: currentSheetIndex, image: [calculatedImage] }]);\n this.workbookImageIds.set(calculatedImage.id, { type: calculatedImage.imageType, index: this.workbookImageIds.size });\n }\n this.buildSheetImageMap(currentSheetIndex, calculatedImage);\n };\n ExcelXlsxFactory.buildSheetImageMap = function (sheetIndex, image) {\n var worksheetImageIdMap = this.worksheetImageIds.get(sheetIndex);\n if (!worksheetImageIdMap) {\n worksheetImageIdMap = new Map();\n this.worksheetImageIds.set(sheetIndex, worksheetImageIdMap);\n }\n var sheetImages = this.worksheetImages.get(sheetIndex);\n if (!sheetImages) {\n this.worksheetImages.set(sheetIndex, [image]);\n worksheetImageIdMap.set(image.id, { index: 0, type: image.imageType });\n }\n else {\n sheetImages.push(image);\n if (!worksheetImageIdMap.get(image.id)) {\n worksheetImageIdMap.set(image.id, { index: worksheetImageIdMap.size, type: image.imageType });\n }\n }\n };\n ExcelXlsxFactory.addSheetName = function (worksheet) {\n var name = _.escapeString(worksheet.name) || '';\n var append = '';\n while (this.sheetNames.indexOf(\"\" + name + append) !== -1) {\n if (append === '') {\n append = '_1';\n }\n else {\n var curr = parseInt(append.slice(1), 10);\n append = \"_\" + (curr + 1);\n }\n }\n worksheet.name = \"\" + name + append;\n this.sheetNames.push(worksheet.name);\n };\n ExcelXlsxFactory.getStringPosition = function (str) {\n if (this.sharedStrings.has(str)) {\n return this.sharedStrings.get(str);\n }\n this.sharedStrings.set(str, this.sharedStrings.size);\n return this.sharedStrings.size - 1;\n };\n ExcelXlsxFactory.resetFactory = function () {\n this.sharedStrings = new Map();\n this.images = new Map();\n this.worksheetImages = new Map();\n this.workbookImageIds = new Map();\n this.worksheetImageIds = new Map();\n this.sheetNames = [];\n this.factoryMode = ExcelFactoryMode.SINGLE_SHEET;\n };\n ExcelXlsxFactory.createWorkbook = function () {\n return createXmlPart(workbookFactory.getTemplate(this.sheetNames));\n };\n ExcelXlsxFactory.createStylesheet = function (defaultFontSize) {\n return createXmlPart(stylesheetFactory.getTemplate(defaultFontSize));\n };\n ExcelXlsxFactory.createSharedStrings = function () {\n return createXmlPart(sharedStrings.getTemplate(this.sharedStrings));\n };\n ExcelXlsxFactory.createCore = function (author) {\n return createXmlPart(coreFactory.getTemplate(author));\n };\n ExcelXlsxFactory.createContentTypes = function (sheetLen) {\n return createXmlPart(contentTypesFactory.getTemplate(sheetLen));\n };\n ExcelXlsxFactory.createRels = function () {\n var rs = relationshipsFactory.getTemplate([{\n Id: 'rId1',\n Type: 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument',\n Target: 'xl/workbook.xml'\n }, {\n Id: 'rId2',\n Type: 'http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties',\n Target: 'docProps/core.xml'\n }]);\n return createXmlPart(rs);\n };\n ExcelXlsxFactory.createTheme = function () {\n return createXmlPart(officeTheme.getTemplate());\n };\n ExcelXlsxFactory.createWorkbookRels = function (sheetLen) {\n var worksheets = new Array(sheetLen).fill(undefined).map(function (v, i) { return ({\n Id: \"rId\" + (i + 1),\n Type: 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet',\n Target: \"worksheets/sheet\" + (i + 1) + \".xml\"\n }); });\n var rs = relationshipsFactory.getTemplate(__spreadArray$I(__spreadArray$I([], __read$1b(worksheets)), [\n {\n Id: \"rId\" + (sheetLen + 1),\n Type: 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme',\n Target: 'theme/theme1.xml'\n }, {\n Id: \"rId\" + (sheetLen + 2),\n Type: 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles',\n Target: 'styles.xml'\n }, {\n Id: \"rId\" + (sheetLen + 3),\n Type: 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings',\n Target: 'sharedStrings.xml'\n }\n ]));\n return createXmlPart(rs);\n };\n ExcelXlsxFactory.createDrawing = function (sheetIndex) {\n return createXmlPart(drawingFactory.getTemplate({ sheetIndex: sheetIndex }));\n };\n ExcelXlsxFactory.createDrawingRel = function (sheetIndex) {\n var _this = this;\n var worksheetImageIds = this.worksheetImageIds.get(sheetIndex);\n var XMLArr = [];\n worksheetImageIds.forEach(function (value, key) {\n XMLArr.push({\n Id: \"rId\" + (value.index + 1),\n Type: 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/image',\n Target: \"../media/image\" + (_this.workbookImageIds.get(key).index + 1) + \".\" + value.type\n });\n });\n return createXmlPart(relationshipsFactory.getTemplate(XMLArr));\n };\n ExcelXlsxFactory.createWorksheetDrawingRel = function (currentRelationIndex) {\n var rs = relationshipsFactory.getTemplate([{\n Id: 'rId1',\n Type: 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing',\n Target: \"../drawings/drawing\" + (currentRelationIndex + 1) + \".xml\"\n }]);\n return createXmlPart(rs);\n };\n ExcelXlsxFactory.createWorksheet = function (worksheet, config) {\n return createXmlPart(worksheetFactory.getTemplate({\n worksheet: worksheet,\n currentSheet: this.sheetNames.length - 1,\n config: config\n }));\n };\n ExcelXlsxFactory.sharedStrings = new Map();\n ExcelXlsxFactory.sheetNames = [];\n /** Maps images to sheet */\n ExcelXlsxFactory.images = new Map();\n /** Maps sheets to images */\n ExcelXlsxFactory.worksheetImages = new Map();\n /** Maps all workbook images to a global Id */\n ExcelXlsxFactory.workbookImageIds = new Map();\n /** Maps all sheet images to unique Ids */\n ExcelXlsxFactory.worksheetImageIds = new Map();\n ExcelXlsxFactory.factoryMode = ExcelFactoryMode.SINGLE_SHEET;\n return ExcelXlsxFactory;\n}());\n\nvar __extends$2V = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar ExcelXlsxSerializingSession = /** @class */ (function (_super) {\n __extends$2V(ExcelXlsxSerializingSession, _super);\n function ExcelXlsxSerializingSession() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n ExcelXlsxSerializingSession.prototype.createExcel = function (data) {\n var _a = this, excelStyles = _a.excelStyles, config = _a.config;\n return ExcelXlsxFactory.createExcel(excelStyles, data, config);\n };\n ExcelXlsxSerializingSession.prototype.getDataTypeForValue = function (valueForCell) {\n if (valueForCell === undefined) {\n return 'empty';\n }\n return this.isNumerical(valueForCell) ? 'n' : 's';\n };\n ExcelXlsxSerializingSession.prototype.getType = function (type, style, value) {\n if (this.isFormula(value)) {\n return 'f';\n }\n if (style && style.dataType) {\n switch (style.dataType.toLocaleLowerCase()) {\n case 'formula':\n return 'f';\n case 'string':\n return 's';\n case 'number':\n return 'n';\n case 'datetime':\n return 'd';\n case 'error':\n return 'e';\n case 'boolean':\n return 'b';\n default:\n console.warn(\"AG Grid: Unrecognized data type for excel export [\" + style.id + \".dataType=\" + style.dataType + \"]\");\n }\n }\n return type;\n };\n ExcelXlsxSerializingSession.prototype.addImage = function (rowIndex, column, value) {\n if (!this.config.addImageToCell) {\n return;\n }\n var addedImage = this.config.addImageToCell(rowIndex, column, value);\n if (!addedImage) {\n return;\n }\n ExcelXlsxFactory.buildImageMap(addedImage.image, rowIndex, column, this.columnsToExport, this.config.rowHeight);\n return addedImage;\n };\n ExcelXlsxSerializingSession.prototype.createCell = function (styleId, type, value, valueFormatted) {\n var actualStyle = this.getStyleById(styleId);\n if (!(actualStyle === null || actualStyle === void 0 ? void 0 : actualStyle.dataType) && type === 's' && valueFormatted) {\n value = valueFormatted;\n }\n var typeTransformed = this.getType(type, actualStyle, value) || type;\n return {\n styleId: actualStyle ? styleId : undefined,\n data: {\n type: typeTransformed,\n value: this.getCellValue(typeTransformed, value)\n }\n };\n };\n ExcelXlsxSerializingSession.prototype.createMergedCell = function (styleId, type, value, numOfCells) {\n var valueToUse = value == null ? '' : value;\n return {\n styleId: !!this.getStyleById(styleId) ? styleId : undefined,\n data: {\n type: type,\n value: type === 's' ? ExcelXlsxFactory.getStringPosition(valueToUse).toString() : value\n },\n mergeAcross: numOfCells\n };\n };\n ExcelXlsxSerializingSession.prototype.getCellValue = function (type, value) {\n if (value == null) {\n return ExcelXlsxFactory.getStringPosition('').toString();\n }\n switch (type) {\n case 's':\n return value === '' ? '' : ExcelXlsxFactory.getStringPosition(value).toString();\n case 'f':\n return value.slice(1);\n case 'n':\n return Number(value).toString();\n default:\n return value;\n }\n };\n return ExcelXlsxSerializingSession;\n}(BaseExcelSerializingSession));\n\nvar __extends$2U = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign$W = (undefined && undefined.__assign) || function () {\n __assign$W = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$W.apply(this, arguments);\n};\nvar __decorate$25 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar getMultipleSheetsAsExcel = function (params) {\n var data = params.data, _a = params.fontSize, fontSize = _a === void 0 ? 11 : _a, _b = params.author, author = _b === void 0 ? 'AG Grid' : _b;\n var hasImages = ExcelXlsxFactory.images.size > 0;\n ZipContainer.addFolders([\n '_rels/',\n 'docProps/',\n 'xl/',\n 'xl/theme/',\n 'xl/_rels/',\n 'xl/worksheets/'\n ]);\n if (hasImages) {\n ZipContainer.addFolders([\n 'xl/worksheets/_rels',\n 'xl/drawings/',\n 'xl/drawings/_rels',\n 'xl/media/',\n ]);\n var imgCounter_1 = 0;\n ExcelXlsxFactory.images.forEach(function (value) {\n var firstImage = value[0].image[0];\n var ext = firstImage.imageType;\n ZipContainer.addFile(\"xl/media/image\" + ++imgCounter_1 + \".\" + ext, firstImage.base64, true);\n });\n }\n if (!data || data.length === 0) {\n console.warn(\"AG Grid: Invalid params supplied to getMultipleSheetsAsExcel() - `ExcelExportParams.data` is empty.\");\n ExcelXlsxFactory.resetFactory();\n return;\n }\n var sheetLen = data.length;\n var imageRelationCounter = 0;\n data.forEach(function (value, idx) {\n ZipContainer.addFile(\"xl/worksheets/sheet\" + (idx + 1) + \".xml\", value);\n if (hasImages && ExcelXlsxFactory.worksheetImages.get(idx)) {\n createImageRelationsForSheet(idx, imageRelationCounter++);\n }\n });\n ZipContainer.addFile('xl/workbook.xml', ExcelXlsxFactory.createWorkbook());\n ZipContainer.addFile('xl/styles.xml', ExcelXlsxFactory.createStylesheet(fontSize));\n ZipContainer.addFile('xl/sharedStrings.xml', ExcelXlsxFactory.createSharedStrings());\n ZipContainer.addFile('xl/theme/theme1.xml', ExcelXlsxFactory.createTheme());\n ZipContainer.addFile('xl/_rels/workbook.xml.rels', ExcelXlsxFactory.createWorkbookRels(sheetLen));\n ZipContainer.addFile('docProps/core.xml', ExcelXlsxFactory.createCore(author));\n ZipContainer.addFile('[Content_Types].xml', ExcelXlsxFactory.createContentTypes(sheetLen));\n ZipContainer.addFile('_rels/.rels', ExcelXlsxFactory.createRels());\n ExcelXlsxFactory.resetFactory();\n var mimeType = params.mimeType || 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';\n return ZipContainer.getContent(mimeType);\n};\nvar exportMultipleSheetsAsExcel = function (params) {\n var _a = params.fileName, fileName = _a === void 0 ? 'export.xlsx' : _a;\n var contents = getMultipleSheetsAsExcel(params);\n if (contents) {\n Downloader.download(fileName, contents);\n }\n};\nvar createImageRelationsForSheet = function (sheetIndex, currentRelationIndex) {\n var drawingFolder = 'xl/drawings';\n var drawingFileName = drawingFolder + \"/drawing\" + (currentRelationIndex + 1) + \".xml\";\n var relFileName = drawingFolder + \"/_rels/drawing\" + (currentRelationIndex + 1) + \".xml.rels\";\n var worksheetRelFile = \"xl/worksheets/_rels/sheet\" + (sheetIndex + 1) + \".xml.rels\";\n ZipContainer.addFile(relFileName, ExcelXlsxFactory.createDrawingRel(sheetIndex));\n ZipContainer.addFile(drawingFileName, ExcelXlsxFactory.createDrawing(sheetIndex));\n ZipContainer.addFile(worksheetRelFile, ExcelXlsxFactory.createWorksheetDrawingRel(currentRelationIndex));\n};\nvar ExcelCreator = /** @class */ (function (_super) {\n __extends$2U(ExcelCreator, _super);\n function ExcelCreator() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.exportMode = 'xlsx';\n return _this;\n }\n ExcelCreator.prototype.postConstruct = function () {\n this.setBeans({\n gridSerializer: this.gridSerializer,\n gridOptionsService: this.gridOptionsService\n });\n };\n ExcelCreator.prototype.getMergedParams = function (params) {\n var baseParams = this.gridOptionsService.get('defaultExcelExportParams');\n return Object.assign({}, baseParams, params);\n };\n ExcelCreator.prototype.getData = function (params) {\n this.setExportMode(params.exportMode || 'xlsx');\n return _super.prototype.getData.call(this, params);\n };\n ExcelCreator.prototype.export = function (userParams) {\n if (this.isExportSuppressed()) {\n console.warn(\"AG Grid: Export cancelled. Export is not allowed as per your configuration.\");\n return '';\n }\n var mergedParams = this.getMergedParams(userParams);\n var data = this.getData(mergedParams);\n var exportParams = {\n data: [data],\n fontSize: mergedParams.fontSize,\n author: mergedParams.author,\n mimeType: mergedParams.mimeType\n };\n var packageFile = this.packageFile(exportParams);\n if (packageFile) {\n Downloader.download(this.getFileName(mergedParams.fileName), packageFile);\n }\n return data;\n };\n ExcelCreator.prototype.exportDataAsExcel = function (params) {\n return this.export(params);\n };\n ExcelCreator.prototype.getDataAsExcel = function (params) {\n var mergedParams = this.getMergedParams(params);\n var data = this.getData(mergedParams);\n if (params && params.exportMode === 'xml') {\n return data;\n }\n var exportParams = {\n data: [data],\n fontSize: mergedParams.fontSize,\n author: mergedParams.author,\n mimeType: mergedParams.mimeType\n };\n return this.packageFile(exportParams);\n };\n ExcelCreator.prototype.setFactoryMode = function (factoryMode, exportMode) {\n if (exportMode === void 0) { exportMode = 'xlsx'; }\n var factory = exportMode === 'xlsx' ? ExcelXlsxFactory : ExcelXmlFactory;\n factory.factoryMode = factoryMode;\n };\n ExcelCreator.prototype.getFactoryMode = function (exportMode) {\n var factory = exportMode === 'xlsx' ? ExcelXlsxFactory : ExcelXmlFactory;\n return factory.factoryMode;\n };\n ExcelCreator.prototype.getSheetDataForExcel = function (params) {\n var mergedParams = this.getMergedParams(params);\n var data = this.getData(mergedParams);\n return data;\n };\n ExcelCreator.prototype.getMultipleSheetsAsExcel = function (params) {\n return getMultipleSheetsAsExcel(params);\n };\n ExcelCreator.prototype.exportMultipleSheetsAsExcel = function (params) {\n return exportMultipleSheetsAsExcel(params);\n };\n ExcelCreator.prototype.getDefaultFileName = function () {\n return \"export.\" + this.getExportMode();\n };\n ExcelCreator.prototype.getDefaultFileExtension = function () {\n return this.getExportMode();\n };\n ExcelCreator.prototype.createSerializingSession = function (params) {\n var _a = this, columnModel = _a.columnModel, valueService = _a.valueService, gridOptionsService = _a.gridOptionsService, valueFormatterService = _a.valueFormatterService, valueParserService = _a.valueParserService;\n var isXlsx = this.getExportMode() === 'xlsx';\n var sheetName = 'ag-grid';\n if (params.sheetName != null) {\n sheetName = _.utf8_encode(params.sheetName.toString().substr(0, 31));\n }\n var config = __assign$W(__assign$W({}, params), { sheetName: sheetName, columnModel: columnModel, valueService: valueService, gridOptionsService: gridOptionsService, valueFormatterService: valueFormatterService, valueParserService: valueParserService, headerRowHeight: params.headerRowHeight || params.rowHeight, baseExcelStyles: this.gridOptionsService.get('excelStyles') || [], styleLinker: this.styleLinker.bind(this) });\n return new (isXlsx ? ExcelXlsxSerializingSession : ExcelXmlSerializingSession)(config);\n };\n ExcelCreator.prototype.styleLinker = function (params) {\n var rowType = params.rowType, rowIndex = params.rowIndex, value = params.value, column = params.column, columnGroup = params.columnGroup, node = params.node;\n var isHeader = rowType === RowType.HEADER;\n var isGroupHeader = rowType === RowType.HEADER_GROUPING;\n var col = (isHeader ? column : columnGroup);\n var headerClasses = [];\n if (isHeader || isGroupHeader) {\n headerClasses.push('header');\n if (isGroupHeader) {\n headerClasses.push('headerGroup');\n }\n if (col) {\n headerClasses = headerClasses.concat(CssClassApplier.getHeaderClassesFromColDef(col.getDefinition(), this.gridOptionsService, column || null, columnGroup || null));\n }\n return headerClasses;\n }\n var styles = this.gridOptionsService.get('excelStyles');\n var applicableStyles = [\"cell\"];\n if (!styles || !styles.length) {\n return applicableStyles;\n }\n var styleIds = styles.map(function (it) {\n return it.id;\n });\n this.stylingService.processAllCellClasses(column.getDefinition(), {\n value: value,\n data: node.data,\n node: node,\n colDef: column.getDefinition(),\n column: column,\n rowIndex: rowIndex,\n api: this.gridOptionsService.api,\n columnApi: this.gridOptionsService.columnApi,\n context: this.gridOptionsService.context\n }, function (className) {\n if (styleIds.indexOf(className) > -1) {\n applicableStyles.push(className);\n }\n });\n return applicableStyles.sort(function (left, right) {\n return (styleIds.indexOf(left) < styleIds.indexOf(right)) ? -1 : 1;\n });\n };\n ExcelCreator.prototype.isExportSuppressed = function () {\n return this.gridOptionsService.is('suppressExcelExport');\n };\n ExcelCreator.prototype.setExportMode = function (exportMode) {\n this.exportMode = exportMode;\n };\n ExcelCreator.prototype.getExportMode = function () {\n return this.exportMode;\n };\n ExcelCreator.prototype.packageFile = function (params) {\n if (this.getExportMode() === 'xml') {\n var mimeType = params.mimeType || 'application/vnd.ms-excel';\n return new Blob([\"\\ufeff\", params.data[0]], { type: mimeType });\n }\n return getMultipleSheetsAsExcel(params);\n };\n __decorate$25([\n Autowired('columnModel')\n ], ExcelCreator.prototype, \"columnModel\", void 0);\n __decorate$25([\n Autowired('valueService')\n ], ExcelCreator.prototype, \"valueService\", void 0);\n __decorate$25([\n Autowired('stylingService')\n ], ExcelCreator.prototype, \"stylingService\", void 0);\n __decorate$25([\n Autowired('gridSerializer')\n ], ExcelCreator.prototype, \"gridSerializer\", void 0);\n __decorate$25([\n Autowired('gridOptionsService')\n ], ExcelCreator.prototype, \"gridOptionsService\", void 0);\n __decorate$25([\n Autowired('valueFormatterService')\n ], ExcelCreator.prototype, \"valueFormatterService\", void 0);\n __decorate$25([\n Autowired('valueParserService')\n ], ExcelCreator.prototype, \"valueParserService\", void 0);\n __decorate$25([\n PostConstruct\n ], ExcelCreator.prototype, \"postConstruct\", null);\n ExcelCreator = __decorate$25([\n Bean('excelCreator')\n ], ExcelCreator);\n return ExcelCreator;\n}(BaseCreator));\n\n// DO NOT UPDATE MANUALLY: Generated from script during build time\nvar VERSION$d = '30.0.6';\n\nvar ExcelExportModule = {\n version: VERSION$d,\n moduleName: ModuleNames.ExcelExportModule,\n beans: [\n // beans in this module\n ExcelCreator,\n // these beans are part of CSV Export module\n GridSerializer, CsvCreator\n ],\n dependantModules: [\n CsvExportModule,\n EnterpriseCoreModule\n ]\n};\n\nvar __extends$2T = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$24 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar EXPAND_STATE;\n(function (EXPAND_STATE) {\n EXPAND_STATE[EXPAND_STATE[\"EXPANDED\"] = 0] = \"EXPANDED\";\n EXPAND_STATE[EXPAND_STATE[\"COLLAPSED\"] = 1] = \"COLLAPSED\";\n EXPAND_STATE[EXPAND_STATE[\"INDETERMINATE\"] = 2] = \"INDETERMINATE\";\n})(EXPAND_STATE || (EXPAND_STATE = {}));\nvar FiltersToolPanelHeaderPanel = /** @class */ (function (_super) {\n __extends$2T(FiltersToolPanelHeaderPanel, _super);\n function FiltersToolPanelHeaderPanel() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n FiltersToolPanelHeaderPanel.prototype.preConstruct = function () {\n this.setTemplate(/* html */ \"
\\n
\\n \\n
\");\n };\n FiltersToolPanelHeaderPanel.prototype.postConstruct = function () {\n var translate = this.localeService.getLocaleTextFunc();\n this.eFilterTextField.onValueChange(this.onSearchTextChanged.bind(this));\n this.eFilterTextField.setInputAriaLabel(translate('ariaFilterColumnsInput', 'Filter Columns Input'));\n this.createExpandIcons();\n this.setExpandState(EXPAND_STATE.EXPANDED);\n this.addManagedListener(this.eExpand, 'click', this.onExpandClicked.bind(this));\n this.addManagedListener(this.eventService, Events.EVENT_NEW_COLUMNS_LOADED, this.showOrHideOptions.bind(this));\n };\n FiltersToolPanelHeaderPanel.prototype.init = function (params) {\n this.params = params;\n if (this.columnModel.isReady()) {\n this.showOrHideOptions();\n }\n };\n FiltersToolPanelHeaderPanel.prototype.createExpandIcons = function () {\n this.eExpand.appendChild(this.eExpandChecked = _.createIconNoSpan('columnSelectOpen', this.gridOptionsService));\n this.eExpand.appendChild(this.eExpandUnchecked = _.createIconNoSpan('columnSelectClosed', this.gridOptionsService));\n this.eExpand.appendChild(this.eExpandIndeterminate = _.createIconNoSpan('columnSelectIndeterminate', this.gridOptionsService));\n };\n // we only show expand / collapse if we are showing filters\n FiltersToolPanelHeaderPanel.prototype.showOrHideOptions = function () {\n var showFilterSearch = !this.params.suppressFilterSearch;\n var showExpand = !this.params.suppressExpandAll;\n var translate = this.localeService.getLocaleTextFunc();\n this.eFilterTextField.setInputPlaceholder(translate('searchOoo', 'Search...'));\n var isFilterGroupPresent = function (col) { return col.getOriginalParent() && col.isFilterAllowed(); };\n var filterGroupsPresent = this.columnModel.getAllGridColumns().some(isFilterGroupPresent);\n _.setDisplayed(this.eFilterTextField.getGui(), showFilterSearch);\n _.setDisplayed(this.eExpand, showExpand && filterGroupsPresent);\n };\n FiltersToolPanelHeaderPanel.prototype.onSearchTextChanged = function () {\n var _this = this;\n if (!this.onSearchTextChangedDebounced) {\n this.onSearchTextChangedDebounced = _.debounce(function () {\n _this.dispatchEvent({ type: 'searchChanged', searchText: _this.eFilterTextField.getValue() });\n }, 300);\n }\n this.onSearchTextChangedDebounced();\n };\n FiltersToolPanelHeaderPanel.prototype.onExpandClicked = function () {\n var event = this.currentExpandState === EXPAND_STATE.EXPANDED ? { type: 'collapseAll' } : { type: 'expandAll' };\n this.dispatchEvent(event);\n };\n FiltersToolPanelHeaderPanel.prototype.setExpandState = function (state) {\n this.currentExpandState = state;\n _.setDisplayed(this.eExpandChecked, this.currentExpandState === EXPAND_STATE.EXPANDED);\n _.setDisplayed(this.eExpandUnchecked, this.currentExpandState === EXPAND_STATE.COLLAPSED);\n _.setDisplayed(this.eExpandIndeterminate, this.currentExpandState === EXPAND_STATE.INDETERMINATE);\n };\n __decorate$24([\n Autowired('columnModel')\n ], FiltersToolPanelHeaderPanel.prototype, \"columnModel\", void 0);\n __decorate$24([\n RefSelector('eExpand')\n ], FiltersToolPanelHeaderPanel.prototype, \"eExpand\", void 0);\n __decorate$24([\n RefSelector('eFilterTextField')\n ], FiltersToolPanelHeaderPanel.prototype, \"eFilterTextField\", void 0);\n __decorate$24([\n PreConstruct\n ], FiltersToolPanelHeaderPanel.prototype, \"preConstruct\", null);\n __decorate$24([\n PostConstruct\n ], FiltersToolPanelHeaderPanel.prototype, \"postConstruct\", null);\n return FiltersToolPanelHeaderPanel;\n}(Component));\n\nvar __extends$2S = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$23 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar ToolPanelFilterComp = /** @class */ (function (_super) {\n __extends$2S(ToolPanelFilterComp, _super);\n function ToolPanelFilterComp(hideHeader) {\n if (hideHeader === void 0) { hideHeader = false; }\n var _this = _super.call(this, ToolPanelFilterComp.TEMPLATE) || this;\n _this.expanded = false;\n _this.hideHeader = hideHeader;\n return _this;\n }\n ToolPanelFilterComp.prototype.postConstruct = function () {\n this.eExpandChecked = _.createIconNoSpan('columnSelectOpen', this.gridOptionsService);\n this.eExpandUnchecked = _.createIconNoSpan('columnSelectClosed', this.gridOptionsService);\n this.eExpand.appendChild(this.eExpandChecked);\n this.eExpand.appendChild(this.eExpandUnchecked);\n };\n ToolPanelFilterComp.prototype.setColumn = function (column) {\n var _this = this;\n this.column = column;\n this.eFilterName.innerText = this.columnModel.getDisplayNameForColumn(this.column, 'filterToolPanel', false) || '';\n this.addManagedListener(this.eFilterToolPanelHeader, 'click', this.toggleExpanded.bind(this));\n this.addManagedListener(this.eFilterToolPanelHeader, 'keydown', function (e) {\n if (e.key === KeyCode.ENTER) {\n _this.toggleExpanded();\n }\n });\n this.addManagedListener(this.eventService, Events.EVENT_FILTER_OPENED, this.onFilterOpened.bind(this));\n this.addInIcon('filter', this.eFilterIcon, this.column);\n _.setDisplayed(this.eFilterIcon, this.isFilterActive(), { skipAriaHidden: true });\n _.setDisplayed(this.eExpandChecked, false);\n if (this.hideHeader) {\n _.setDisplayed(this.eFilterToolPanelHeader, false);\n this.eFilterToolPanelHeader.removeAttribute('tabindex');\n }\n else {\n this.eFilterToolPanelHeader.setAttribute('tabindex', '0');\n }\n this.addManagedListener(this.column, Column.EVENT_FILTER_CHANGED, this.onFilterChanged.bind(this));\n this.addManagedListener(this.eventService, Events.EVENT_FILTER_DESTROYED, this.onFilterDestroyed.bind(this));\n };\n ToolPanelFilterComp.prototype.getColumn = function () {\n return this.column;\n };\n ToolPanelFilterComp.prototype.getColumnFilterName = function () {\n return this.columnModel.getDisplayNameForColumn(this.column, 'filterToolPanel', false);\n };\n ToolPanelFilterComp.prototype.addCssClassToTitleBar = function (cssClass) {\n this.eFilterToolPanelHeader.classList.add(cssClass);\n };\n ToolPanelFilterComp.prototype.addInIcon = function (iconName, eParent, column) {\n if (eParent == null) {\n return;\n }\n var eIcon = _.createIconNoSpan(iconName, this.gridOptionsService, column);\n eParent.appendChild(eIcon);\n };\n ToolPanelFilterComp.prototype.isFilterActive = function () {\n return this.filterManager.isFilterActive(this.column);\n };\n ToolPanelFilterComp.prototype.onFilterChanged = function () {\n _.setDisplayed(this.eFilterIcon, this.isFilterActive(), { skipAriaHidden: true });\n this.dispatchEvent({ type: Column.EVENT_FILTER_CHANGED });\n };\n ToolPanelFilterComp.prototype.onFilterDestroyed = function (event) {\n if (this.expanded &&\n event.source === 'api' &&\n event.column.getId() === this.column.getId() &&\n this.columnModel.getPrimaryColumn(this.column)) {\n // filter was visible and has been destroyed by the API. If the column still exists, need to recreate UI component\n this.removeFilterElement();\n this.addFilterElement();\n }\n };\n ToolPanelFilterComp.prototype.toggleExpanded = function () {\n this.expanded ? this.collapse() : this.expand();\n };\n ToolPanelFilterComp.prototype.expand = function () {\n if (this.expanded) {\n return;\n }\n this.expanded = true;\n _.setAriaExpanded(this.eFilterToolPanelHeader, true);\n _.setDisplayed(this.eExpandChecked, true);\n _.setDisplayed(this.eExpandUnchecked, false);\n this.addFilterElement();\n };\n ToolPanelFilterComp.prototype.addFilterElement = function () {\n var _this = this;\n var filterPanelWrapper = _.loadTemplate(/* html */ \"
\");\n var filterWrapper = this.filterManager.getOrCreateFilterWrapper(this.column, 'TOOLBAR');\n if (!filterWrapper) {\n return;\n }\n var filterPromise = filterWrapper.filterPromise, guiPromise = filterWrapper.guiPromise;\n filterPromise === null || filterPromise === void 0 ? void 0 : filterPromise.then(function (filter) {\n _this.underlyingFilter = filter;\n if (!filter) {\n return;\n }\n guiPromise.then(function (filterContainerEl) {\n if (filterContainerEl) {\n filterPanelWrapper.appendChild(filterContainerEl);\n }\n _this.agFilterToolPanelBody.appendChild(filterPanelWrapper);\n if (filter.afterGuiAttached) {\n filter.afterGuiAttached({ container: 'toolPanel' });\n }\n });\n });\n };\n ToolPanelFilterComp.prototype.collapse = function () {\n var _a, _b;\n if (!this.expanded) {\n return;\n }\n this.expanded = false;\n _.setAriaExpanded(this.eFilterToolPanelHeader, false);\n this.removeFilterElement();\n _.setDisplayed(this.eExpandChecked, false);\n _.setDisplayed(this.eExpandUnchecked, true);\n (_b = (_a = this.underlyingFilter) === null || _a === void 0 ? void 0 : _a.afterGuiDetached) === null || _b === void 0 ? void 0 : _b.call(_a);\n };\n ToolPanelFilterComp.prototype.removeFilterElement = function () {\n _.clearElement(this.agFilterToolPanelBody);\n };\n ToolPanelFilterComp.prototype.isExpanded = function () {\n return this.expanded;\n };\n ToolPanelFilterComp.prototype.refreshFilter = function (isDisplayed) {\n var _a;\n if (!this.expanded) {\n return;\n }\n var filter = this.underlyingFilter;\n if (!filter) {\n return;\n }\n if (isDisplayed) {\n // set filters should be updated when the filter has been changed elsewhere, i.e. via api. Note that we can't\n // use 'afterGuiAttached' to refresh the virtual list as it also focuses on the mini filter which changes the\n // scroll position in the filter list panel\n if (typeof filter.refreshVirtualList === 'function') {\n filter.refreshVirtualList();\n }\n }\n else {\n (_a = filter.afterGuiDetached) === null || _a === void 0 ? void 0 : _a.call(filter);\n }\n };\n ToolPanelFilterComp.prototype.onFilterOpened = function (event) {\n if (event.source !== 'COLUMN_MENU') {\n return;\n }\n if (event.column !== this.column) {\n return;\n }\n if (!this.expanded) {\n return;\n }\n this.collapse();\n };\n ToolPanelFilterComp.TEMPLATE = \"\\n
\\n
\\n
\\n \\n \\n
\\n
\\n
\";\n __decorate$23([\n RefSelector('eFilterToolPanelHeader')\n ], ToolPanelFilterComp.prototype, \"eFilterToolPanelHeader\", void 0);\n __decorate$23([\n RefSelector('eFilterName')\n ], ToolPanelFilterComp.prototype, \"eFilterName\", void 0);\n __decorate$23([\n RefSelector('agFilterToolPanelBody')\n ], ToolPanelFilterComp.prototype, \"agFilterToolPanelBody\", void 0);\n __decorate$23([\n RefSelector('eFilterIcon')\n ], ToolPanelFilterComp.prototype, \"eFilterIcon\", void 0);\n __decorate$23([\n RefSelector('eExpand')\n ], ToolPanelFilterComp.prototype, \"eExpand\", void 0);\n __decorate$23([\n Autowired('filterManager')\n ], ToolPanelFilterComp.prototype, \"filterManager\", void 0);\n __decorate$23([\n Autowired('columnModel')\n ], ToolPanelFilterComp.prototype, \"columnModel\", void 0);\n __decorate$23([\n PostConstruct\n ], ToolPanelFilterComp.prototype, \"postConstruct\", null);\n return ToolPanelFilterComp;\n}(Component));\n\nvar __extends$2R = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$22 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar ToolPanelFilterGroupComp = /** @class */ (function (_super) {\n __extends$2R(ToolPanelFilterGroupComp, _super);\n function ToolPanelFilterGroupComp(columnGroup, childFilterComps, expandedCallback, depth, showingColumn) {\n var _this = _super.call(this) || this;\n _this.columnGroup = columnGroup;\n _this.childFilterComps = childFilterComps;\n _this.depth = depth;\n _this.expandedCallback = expandedCallback;\n _this.showingColumn = showingColumn;\n return _this;\n }\n ToolPanelFilterGroupComp.prototype.preConstruct = function () {\n var groupParams = {\n cssIdentifier: 'filter-toolpanel',\n direction: 'vertical'\n };\n this.setTemplate(ToolPanelFilterGroupComp.TEMPLATE, { filterGroupComp: groupParams });\n };\n ToolPanelFilterGroupComp.prototype.init = function () {\n var _this = this;\n this.setGroupTitle();\n this.filterGroupComp.setAlignItems('stretch');\n this.filterGroupComp.addCssClass(\"ag-filter-toolpanel-group-level-\" + this.depth);\n this.filterGroupComp.addCssClassToTitleBar(\"ag-filter-toolpanel-group-level-\" + this.depth + \"-header\");\n this.childFilterComps.forEach(function (filterComp) {\n _this.filterGroupComp.addItem(filterComp);\n filterComp.addCssClassToTitleBar(\"ag-filter-toolpanel-group-level-\" + (_this.depth + 1) + \"-header\");\n });\n this.refreshFilterClass();\n this.addExpandCollapseListeners();\n this.addFilterChangedListeners();\n this.setupTooltip();\n };\n ToolPanelFilterGroupComp.prototype.setupTooltip = function () {\n var _this = this;\n // we don't show tooltips for groups, as when the group expands, it's div contains the columns which also\n // have tooltips, so the tooltips would clash. Eg mouse over group, tooltip shows, mouse over column, another\n // tooltip shows but cos we didn't leave the group the group tooltip remains. this should be fixed in the future,\n // maybe the group shouldn't contain the children form a DOM perspective.\n if (!this.showingColumn) {\n return;\n }\n var refresh = function () {\n var newTooltipText = _this.columnGroup.getColDef().headerTooltip;\n _this.setTooltip(newTooltipText);\n };\n refresh();\n this.addManagedListener(this.eventService, Events.EVENT_NEW_COLUMNS_LOADED, refresh);\n };\n ToolPanelFilterGroupComp.prototype.getTooltipParams = function () {\n var res = _super.prototype.getTooltipParams.call(this);\n res.location = 'filterToolPanelColumnGroup';\n return res;\n };\n ToolPanelFilterGroupComp.prototype.addCssClassToTitleBar = function (cssClass) {\n this.filterGroupComp.addCssClassToTitleBar(cssClass);\n };\n ToolPanelFilterGroupComp.prototype.refreshFilters = function (isDisplayed) {\n this.childFilterComps.forEach(function (filterComp) {\n if (filterComp instanceof ToolPanelFilterGroupComp) {\n filterComp.refreshFilters(isDisplayed);\n }\n else {\n filterComp.refreshFilter(isDisplayed);\n }\n });\n };\n ToolPanelFilterGroupComp.prototype.isColumnGroup = function () {\n return this.columnGroup instanceof ProvidedColumnGroup;\n };\n ToolPanelFilterGroupComp.prototype.isExpanded = function () {\n return this.filterGroupComp.isExpanded();\n };\n ToolPanelFilterGroupComp.prototype.getChildren = function () {\n return this.childFilterComps;\n };\n ToolPanelFilterGroupComp.prototype.getFilterGroupName = function () {\n return this.filterGroupName ? this.filterGroupName : '';\n };\n ToolPanelFilterGroupComp.prototype.getFilterGroupId = function () {\n return this.columnGroup.getId();\n };\n ToolPanelFilterGroupComp.prototype.hideGroupItem = function (hide, index) {\n this.filterGroupComp.hideItem(hide, index);\n };\n ToolPanelFilterGroupComp.prototype.hideGroup = function (hide) {\n this.setDisplayed(!hide);\n };\n ToolPanelFilterGroupComp.prototype.forEachToolPanelFilterChild = function (action) {\n this.childFilterComps.forEach(function (filterComp) {\n if (filterComp instanceof ToolPanelFilterComp) {\n action(filterComp);\n }\n });\n };\n ToolPanelFilterGroupComp.prototype.addExpandCollapseListeners = function () {\n var _this = this;\n var expandListener = this.isColumnGroup() ?\n function () { return _this.expandedCallback(); } :\n function () { return _this.forEachToolPanelFilterChild(function (filterComp) { return filterComp.expand(); }); };\n var collapseListener = this.isColumnGroup() ?\n function () { return _this.expandedCallback(); } :\n function () { return _this.forEachToolPanelFilterChild(function (filterComp) { return filterComp.collapse(); }); };\n this.addManagedListener(this.filterGroupComp, AgGroupComponent.EVENT_EXPANDED, expandListener);\n this.addManagedListener(this.filterGroupComp, AgGroupComponent.EVENT_COLLAPSED, collapseListener);\n };\n ToolPanelFilterGroupComp.prototype.getColumns = function () {\n if (this.columnGroup instanceof ProvidedColumnGroup) {\n return this.columnGroup.getLeafColumns();\n }\n return [this.columnGroup];\n };\n ToolPanelFilterGroupComp.prototype.addFilterChangedListeners = function () {\n var _this = this;\n this.getColumns().forEach(function (column) {\n _this.addManagedListener(column, Column.EVENT_FILTER_CHANGED, function () { return _this.refreshFilterClass(); });\n });\n if (!(this.columnGroup instanceof ProvidedColumnGroup)) {\n this.addManagedListener(this.eventService, Events.EVENT_FILTER_OPENED, this.onFilterOpened.bind(this));\n }\n };\n ToolPanelFilterGroupComp.prototype.refreshFilterClass = function () {\n var columns = this.getColumns();\n var anyChildFiltersActive = function () { return columns.some(function (col) { return col.isFilterActive(); }); };\n this.filterGroupComp.addOrRemoveCssClass('ag-has-filter', anyChildFiltersActive());\n };\n ToolPanelFilterGroupComp.prototype.onFilterOpened = function (event) {\n // when a filter is opened elsewhere, i.e. column menu we close the filter comp so we also need to collapse\n // the column group. This approach means we don't need to try and sync filter models on the same column.\n if (event.source !== 'COLUMN_MENU') {\n return;\n }\n if (event.column !== this.columnGroup) {\n return;\n }\n if (!this.isExpanded()) {\n return;\n }\n this.collapse();\n };\n ToolPanelFilterGroupComp.prototype.expand = function () {\n this.filterGroupComp.toggleGroupExpand(true);\n };\n ToolPanelFilterGroupComp.prototype.collapse = function () {\n this.filterGroupComp.toggleGroupExpand(false);\n };\n ToolPanelFilterGroupComp.prototype.setGroupTitle = function () {\n this.filterGroupName = (this.columnGroup instanceof ProvidedColumnGroup) ?\n this.getColumnGroupName(this.columnGroup) : this.getColumnName(this.columnGroup);\n this.filterGroupComp.setTitle(this.filterGroupName || '');\n };\n ToolPanelFilterGroupComp.prototype.getColumnGroupName = function (columnGroup) {\n return this.columnModel.getDisplayNameForProvidedColumnGroup(null, columnGroup, 'filterToolPanel');\n };\n ToolPanelFilterGroupComp.prototype.getColumnName = function (column) {\n return this.columnModel.getDisplayNameForColumn(column, 'filterToolPanel', false);\n };\n ToolPanelFilterGroupComp.prototype.destroyFilters = function () {\n this.childFilterComps = this.destroyBeans(this.childFilterComps);\n _.clearElement(this.getGui());\n };\n ToolPanelFilterGroupComp.prototype.destroy = function () {\n this.destroyFilters();\n _super.prototype.destroy.call(this);\n };\n ToolPanelFilterGroupComp.TEMPLATE = \"
\\n \\n
\";\n __decorate$22([\n RefSelector('filterGroupComp')\n ], ToolPanelFilterGroupComp.prototype, \"filterGroupComp\", void 0);\n __decorate$22([\n Autowired('columnModel')\n ], ToolPanelFilterGroupComp.prototype, \"columnModel\", void 0);\n __decorate$22([\n PreConstruct\n ], ToolPanelFilterGroupComp.prototype, \"preConstruct\", null);\n __decorate$22([\n PostConstruct\n ], ToolPanelFilterGroupComp.prototype, \"init\", null);\n return ToolPanelFilterGroupComp;\n}(Component));\n\nvar __extends$2Q = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$21 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar FiltersToolPanelListPanel = /** @class */ (function (_super) {\n __extends$2Q(FiltersToolPanelListPanel, _super);\n function FiltersToolPanelListPanel() {\n var _this = _super.call(this, FiltersToolPanelListPanel.TEMPLATE) || this;\n _this.initialised = false;\n _this.filterGroupComps = [];\n return _this;\n }\n FiltersToolPanelListPanel.prototype.init = function (params) {\n var _this = this;\n this.initialised = true;\n var defaultParams = {\n suppressExpandAll: false,\n suppressFilterSearch: false,\n suppressSyncLayoutWithGrid: false,\n api: this.gridApi,\n columnApi: this.columnApi,\n context: this.gridOptionsService.context\n };\n _.mergeDeep(defaultParams, params);\n this.params = defaultParams;\n if (!this.params.suppressSyncLayoutWithGrid) {\n this.addManagedListener(this.eventService, Events.EVENT_COLUMN_MOVED, function () { return _this.onColumnsChanged(); });\n }\n this.addManagedListener(this.eventService, Events.EVENT_NEW_COLUMNS_LOADED, function () { return _this.onColumnsChanged(); });\n this.addManagedListener(this.eventService, Events.EVENT_TOOL_PANEL_VISIBLE_CHANGED, function (event) {\n // when re-entering the filters tool panel we need to refresh the virtual lists in the set filters in case\n // filters have been changed elsewhere, i.e. via an api call.\n if (event.key === 'filters') {\n _this.refreshFilters(event.visible);\n }\n });\n if (this.columnModel.isReady()) {\n this.onColumnsChanged();\n }\n };\n FiltersToolPanelListPanel.prototype.onColumnsChanged = function () {\n var pivotModeActive = this.columnModel.isPivotMode();\n var shouldSyncColumnLayoutWithGrid = !this.params.suppressSyncLayoutWithGrid && !pivotModeActive;\n shouldSyncColumnLayoutWithGrid ? this.syncFilterLayout() : this.buildTreeFromProvidedColumnDefs();\n };\n FiltersToolPanelListPanel.prototype.syncFilterLayout = function () {\n this.toolPanelColDefService.syncLayoutWithGrid(this.setFiltersLayout.bind(this));\n };\n FiltersToolPanelListPanel.prototype.buildTreeFromProvidedColumnDefs = function () {\n var columnTree = this.columnModel.getPrimaryColumnTree();\n this.recreateFilters(columnTree);\n };\n FiltersToolPanelListPanel.prototype.setFiltersLayout = function (colDefs) {\n var columnTree = this.toolPanelColDefService.createColumnTree(colDefs);\n this.recreateFilters(columnTree);\n };\n FiltersToolPanelListPanel.prototype.recreateFilters = function (columnTree) {\n var _this = this;\n // Underlying filter comp/element won't get recreated if the column still exists (the element just gets detached/re-attached).\n // We can therefore restore focus if an element in the filter tool panel was focused.\n var activeElement = this.gridOptionsService.getDocument().activeElement;\n // Want to restore the expansion state where possible.\n var expansionState = this.getExpansionState();\n this.destroyFilters();\n this.filterGroupComps = this.recursivelyAddComps(columnTree, 0, expansionState);\n var len = this.filterGroupComps.length;\n if (len) {\n // skip the destroy function because this will be managed\n // by the `destroyFilters` function\n this.filterGroupComps.forEach(function (comp) { return _this.appendChild(comp); });\n this.setFirstAndLastVisible(0, len - 1);\n }\n // perform search if searchFilterText exists\n if (_.exists(this.searchFilterText)) {\n this.searchFilters(this.searchFilterText);\n }\n // notify header of expand\n this.fireExpandedEvent();\n // We only care about restoring focus if the originally focused element was in the filter tool panel.\n if (this.getGui().contains(activeElement)) {\n activeElement.focus();\n }\n };\n FiltersToolPanelListPanel.prototype.recursivelyAddComps = function (tree, depth, expansionState) {\n var _this = this;\n return _.flatten(tree.map(function (child) {\n if (child instanceof ProvidedColumnGroup) {\n return _.flatten(_this.recursivelyAddFilterGroupComps(child, depth, expansionState));\n }\n var column = child;\n if (!_this.shouldDisplayFilter(column)) {\n return [];\n }\n var hideFilterCompHeader = depth === 0;\n var filterComp = new ToolPanelFilterComp(hideFilterCompHeader);\n _this.createBean(filterComp);\n filterComp.setColumn(column);\n if (expansionState.get(column.getId())) {\n // Default state on creation and desired state are both collapsed. Expand if expanded before.\n filterComp.expand();\n }\n if (depth > 0) {\n return filterComp;\n }\n var filterGroupComp = _this.createBean(new ToolPanelFilterGroupComp(column, [filterComp], _this.onGroupExpanded.bind(_this), depth, true));\n filterGroupComp.addCssClassToTitleBar('ag-filter-toolpanel-header');\n if (!expansionState.get(filterGroupComp.getFilterGroupId())) {\n // Default state on creation is expanded. Desired initial state is collapsed. Always collapse unless expanded before.\n filterGroupComp.collapse();\n }\n return filterGroupComp;\n }));\n };\n FiltersToolPanelListPanel.prototype.recursivelyAddFilterGroupComps = function (columnGroup, depth, expansionState) {\n if (!this.filtersExistInChildren(columnGroup.getChildren())) {\n return;\n }\n var colGroupDef = columnGroup.getColGroupDef();\n if (colGroupDef && colGroupDef.suppressFiltersToolPanel) {\n return [];\n }\n var newDepth = columnGroup.isPadding() ? depth : depth + 1;\n var childFilterComps = _.flatten(this.recursivelyAddComps(columnGroup.getChildren(), newDepth, expansionState));\n if (columnGroup.isPadding()) {\n return childFilterComps;\n }\n var filterGroupComp = new ToolPanelFilterGroupComp(columnGroup, childFilterComps, this.onGroupExpanded.bind(this), depth, false);\n this.createBean(filterGroupComp);\n filterGroupComp.addCssClassToTitleBar('ag-filter-toolpanel-header');\n if (expansionState.get(filterGroupComp.getFilterGroupId()) === false) {\n // Default state on creation is expanded. Desired initial state is expanded. Only collapse if collapsed before.\n filterGroupComp.collapse();\n }\n return [filterGroupComp];\n };\n FiltersToolPanelListPanel.prototype.filtersExistInChildren = function (tree) {\n var _this = this;\n return tree.some(function (child) {\n if (child instanceof ProvidedColumnGroup) {\n return _this.filtersExistInChildren(child.getChildren());\n }\n return _this.shouldDisplayFilter(child);\n });\n };\n FiltersToolPanelListPanel.prototype.shouldDisplayFilter = function (column) {\n var suppressFiltersToolPanel = column.getColDef() && column.getColDef().suppressFiltersToolPanel;\n return column.isFilterAllowed() && !suppressFiltersToolPanel;\n };\n FiltersToolPanelListPanel.prototype.getExpansionState = function () {\n var expansionState = new Map();\n var recursiveGetExpansionState = function (filterGroupComp) {\n expansionState.set(filterGroupComp.getFilterGroupId(), filterGroupComp.isExpanded());\n filterGroupComp.getChildren().forEach(function (child) {\n if (child instanceof ToolPanelFilterGroupComp) {\n recursiveGetExpansionState(child);\n }\n else {\n expansionState.set(child.getColumn().getId(), child.isExpanded());\n }\n });\n };\n this.filterGroupComps.forEach(recursiveGetExpansionState);\n return expansionState;\n };\n // we don't support refreshing, but must implement because it's on the tool panel interface\n FiltersToolPanelListPanel.prototype.refresh = function () { };\n // lazy initialise the panel\n FiltersToolPanelListPanel.prototype.setVisible = function (visible) {\n _super.prototype.setDisplayed.call(this, visible);\n if (visible && !this.initialised) {\n this.init(this.params);\n }\n };\n FiltersToolPanelListPanel.prototype.expandFilterGroups = function (expand, groupIds) {\n var updatedGroupIds = [];\n var updateGroupExpandState = function (filterGroup) {\n var groupId = filterGroup.getFilterGroupId();\n var shouldExpandOrCollapse = !groupIds || _.includes(groupIds, groupId);\n if (shouldExpandOrCollapse) {\n // don't expand 'column groups', i.e. top level columns wrapped in a group\n if (expand && filterGroup.isColumnGroup()) {\n filterGroup.expand();\n }\n else {\n filterGroup.collapse();\n }\n updatedGroupIds.push(groupId);\n }\n // recursively look for more groups to expand / collapse\n filterGroup.getChildren().forEach(function (child) {\n if (child instanceof ToolPanelFilterGroupComp) {\n updateGroupExpandState(child);\n }\n });\n };\n this.filterGroupComps.forEach(updateGroupExpandState);\n // update header expand / collapse icon\n this.onGroupExpanded();\n if (groupIds) {\n var unrecognisedGroupIds = groupIds.filter(function (groupId) { return updatedGroupIds.indexOf(groupId) < 0; });\n if (unrecognisedGroupIds.length > 0) {\n console.warn('AG Grid: unable to find groups for these supplied groupIds:', unrecognisedGroupIds);\n }\n }\n };\n FiltersToolPanelListPanel.prototype.expandFilters = function (expand, colIds) {\n var updatedColIds = [];\n var updateGroupExpandState = function (filterComp) {\n if (filterComp instanceof ToolPanelFilterGroupComp) {\n var anyChildrenChanged_1 = false;\n filterComp.getChildren().forEach(function (child) {\n var childUpdated = updateGroupExpandState(child);\n if (childUpdated) {\n if (expand) {\n filterComp.expand();\n anyChildrenChanged_1 = true;\n }\n else if (!filterComp.isColumnGroup()) {\n // we only collapse columns wrapped in groups\n filterComp.collapse();\n }\n }\n });\n return anyChildrenChanged_1;\n }\n var colId = filterComp.getColumn().getColId();\n var updateFilterExpandState = !colIds || _.includes(colIds, colId);\n if (updateFilterExpandState) {\n expand ? filterComp.expand() : filterComp.collapse();\n updatedColIds.push(colId);\n }\n return updateFilterExpandState;\n };\n this.filterGroupComps.forEach(updateGroupExpandState);\n // update header expand / collapse icon\n this.onGroupExpanded();\n if (colIds) {\n var unrecognisedColIds = colIds.filter(function (colId) { return updatedColIds.indexOf(colId) < 0; });\n if (unrecognisedColIds.length > 0) {\n console.warn('AG Grid: unable to find columns for these supplied colIds:', unrecognisedColIds);\n }\n }\n };\n FiltersToolPanelListPanel.prototype.onGroupExpanded = function () {\n this.fireExpandedEvent();\n };\n FiltersToolPanelListPanel.prototype.fireExpandedEvent = function () {\n var expandedCount = 0;\n var notExpandedCount = 0;\n var updateExpandCounts = function (filterGroup) {\n if (!filterGroup.isColumnGroup()) {\n return;\n }\n filterGroup.isExpanded() ? expandedCount++ : notExpandedCount++;\n filterGroup.getChildren().forEach(function (child) {\n if (child instanceof ToolPanelFilterGroupComp) {\n updateExpandCounts(child);\n }\n });\n };\n this.filterGroupComps.forEach(updateExpandCounts);\n var state;\n if (expandedCount > 0 && notExpandedCount > 0) {\n state = EXPAND_STATE.INDETERMINATE;\n }\n else if (notExpandedCount > 0) {\n state = EXPAND_STATE.COLLAPSED;\n }\n else {\n state = EXPAND_STATE.EXPANDED;\n }\n this.dispatchEvent({ type: 'groupExpanded', state: state });\n };\n FiltersToolPanelListPanel.prototype.performFilterSearch = function (searchText) {\n this.searchFilterText = _.exists(searchText) ? searchText.toLowerCase() : null;\n this.searchFilters(this.searchFilterText);\n };\n FiltersToolPanelListPanel.prototype.searchFilters = function (searchFilter) {\n var passesFilter = function (groupName) {\n return !_.exists(searchFilter) || groupName.toLowerCase().indexOf(searchFilter) !== -1;\n };\n var recursivelySearch = function (filterItem, parentPasses) {\n if (!(filterItem instanceof ToolPanelFilterGroupComp)) {\n return passesFilter(filterItem.getColumnFilterName() || '');\n }\n var children = filterItem.getChildren();\n var groupNamePasses = passesFilter(filterItem.getFilterGroupName());\n // if group or parent already passed - ensure this group and all children are visible\n var alreadyPassed = parentPasses || groupNamePasses;\n if (alreadyPassed) {\n // ensure group visible\n filterItem.hideGroup(false);\n // ensure all children are visible\n for (var i = 0; i < children.length; i++) {\n recursivelySearch(children[i], alreadyPassed);\n filterItem.hideGroupItem(false, i);\n }\n return true;\n }\n // hide group item filters\n var anyChildPasses = false;\n children.forEach(function (child, index) {\n var childPasses = recursivelySearch(child, parentPasses);\n filterItem.hideGroupItem(!childPasses, index);\n if (childPasses) {\n anyChildPasses = true;\n }\n });\n // hide group if no children pass\n filterItem.hideGroup(!anyChildPasses);\n return anyChildPasses;\n };\n var firstVisible;\n var lastVisible;\n this.filterGroupComps.forEach(function (filterGroup, idx) {\n recursivelySearch(filterGroup, false);\n if (firstVisible === undefined) {\n if (!filterGroup.containsCssClass('ag-hidden')) {\n firstVisible = idx;\n lastVisible = idx;\n }\n }\n else if (!filterGroup.containsCssClass('ag-hidden') && lastVisible !== idx) {\n lastVisible = idx;\n }\n });\n this.setFirstAndLastVisible(firstVisible, lastVisible);\n };\n FiltersToolPanelListPanel.prototype.setFirstAndLastVisible = function (firstIdx, lastIdx) {\n this.filterGroupComps.forEach(function (filterGroup, idx) {\n filterGroup.removeCssClass('ag-first-group-visible');\n filterGroup.removeCssClass('ag-last-group-visible');\n if (idx === firstIdx) {\n filterGroup.addCssClass('ag-first-group-visible');\n }\n if (idx === lastIdx) {\n filterGroup.addCssClass('ag-last-group-visible');\n }\n });\n };\n FiltersToolPanelListPanel.prototype.refreshFilters = function (isDisplayed) {\n this.filterGroupComps.forEach(function (filterGroupComp) { return filterGroupComp.refreshFilters(isDisplayed); });\n };\n FiltersToolPanelListPanel.prototype.destroyFilters = function () {\n this.filterGroupComps = this.destroyBeans(this.filterGroupComps);\n _.clearElement(this.getGui());\n };\n FiltersToolPanelListPanel.prototype.destroy = function () {\n this.destroyFilters();\n _super.prototype.destroy.call(this);\n };\n FiltersToolPanelListPanel.TEMPLATE = \"
\";\n __decorate$21([\n Autowired(\"gridApi\")\n ], FiltersToolPanelListPanel.prototype, \"gridApi\", void 0);\n __decorate$21([\n Autowired(\"columnApi\")\n ], FiltersToolPanelListPanel.prototype, \"columnApi\", void 0);\n __decorate$21([\n Autowired('toolPanelColDefService')\n ], FiltersToolPanelListPanel.prototype, \"toolPanelColDefService\", void 0);\n __decorate$21([\n Autowired('columnModel')\n ], FiltersToolPanelListPanel.prototype, \"columnModel\", void 0);\n return FiltersToolPanelListPanel;\n}(Component));\n\nvar __extends$2P = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign$V = (undefined && undefined.__assign) || function () {\n __assign$V = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$V.apply(this, arguments);\n};\nvar __decorate$20 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar FiltersToolPanel = /** @class */ (function (_super) {\n __extends$2P(FiltersToolPanel, _super);\n function FiltersToolPanel() {\n var _this = _super.call(this, FiltersToolPanel.TEMPLATE) || this;\n _this.initialised = false;\n _this.listenerDestroyFuncs = [];\n return _this;\n }\n FiltersToolPanel.prototype.init = function (params) {\n // if initialised is true, means this is a refresh\n if (this.initialised) {\n this.listenerDestroyFuncs.forEach(function (func) { return func(); });\n this.listenerDestroyFuncs = [];\n }\n this.initialised = true;\n var defaultParams = {\n suppressExpandAll: false,\n suppressFilterSearch: false,\n suppressSyncLayoutWithGrid: false,\n api: this.gridApi,\n columnApi: this.columnApi,\n };\n this.params = __assign$V(__assign$V(__assign$V({}, defaultParams), params), { context: this.gridOptionsService.context });\n this.filtersToolPanelHeaderPanel.init(this.params);\n this.filtersToolPanelListPanel.init(this.params);\n var hideExpand = this.params.suppressExpandAll;\n var hideSearch = this.params.suppressFilterSearch;\n if (hideExpand && hideSearch) {\n this.filtersToolPanelHeaderPanel.setDisplayed(false);\n }\n // this is necessary to prevent a memory leak while refreshing the tool panel\n this.listenerDestroyFuncs.push(this.addManagedListener(this.filtersToolPanelHeaderPanel, 'expandAll', this.onExpandAll.bind(this)), this.addManagedListener(this.filtersToolPanelHeaderPanel, 'collapseAll', this.onCollapseAll.bind(this)), this.addManagedListener(this.filtersToolPanelHeaderPanel, 'searchChanged', this.onSearchChanged.bind(this)), this.addManagedListener(this.filtersToolPanelListPanel, 'groupExpanded', this.onGroupExpanded.bind(this)));\n };\n // lazy initialise the panel\n FiltersToolPanel.prototype.setVisible = function (visible) {\n _super.prototype.setDisplayed.call(this, visible);\n if (visible && !this.initialised) {\n this.init(this.params);\n }\n };\n FiltersToolPanel.prototype.onExpandAll = function () {\n this.filtersToolPanelListPanel.expandFilterGroups(true);\n };\n FiltersToolPanel.prototype.onCollapseAll = function () {\n this.filtersToolPanelListPanel.expandFilterGroups(false);\n };\n FiltersToolPanel.prototype.onSearchChanged = function (event) {\n this.filtersToolPanelListPanel.performFilterSearch(event.searchText);\n };\n FiltersToolPanel.prototype.setFilterLayout = function (colDefs) {\n this.filtersToolPanelListPanel.setFiltersLayout(colDefs);\n };\n FiltersToolPanel.prototype.onGroupExpanded = function (event) {\n this.filtersToolPanelHeaderPanel.setExpandState(event.state);\n };\n FiltersToolPanel.prototype.expandFilterGroups = function (groupIds) {\n this.filtersToolPanelListPanel.expandFilterGroups(true, groupIds);\n };\n FiltersToolPanel.prototype.collapseFilterGroups = function (groupIds) {\n this.filtersToolPanelListPanel.expandFilterGroups(false, groupIds);\n };\n FiltersToolPanel.prototype.expandFilters = function (colIds) {\n this.filtersToolPanelListPanel.expandFilters(true, colIds);\n };\n FiltersToolPanel.prototype.collapseFilters = function (colIds) {\n this.filtersToolPanelListPanel.expandFilters(false, colIds);\n };\n FiltersToolPanel.prototype.syncLayoutWithGrid = function () {\n this.filtersToolPanelListPanel.syncFilterLayout();\n };\n FiltersToolPanel.prototype.refresh = function () {\n this.init(this.params);\n };\n // this is a user component, and IComponent has \"public destroy()\" as part of the interface.\n // so we need to override destroy() just to make the method public.\n FiltersToolPanel.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n };\n FiltersToolPanel.TEMPLATE = \"
\\n \\n \\n
\";\n __decorate$20([\n RefSelector('filtersToolPanelHeaderPanel')\n ], FiltersToolPanel.prototype, \"filtersToolPanelHeaderPanel\", void 0);\n __decorate$20([\n RefSelector('filtersToolPanelListPanel')\n ], FiltersToolPanel.prototype, \"filtersToolPanelListPanel\", void 0);\n __decorate$20([\n Autowired('gridApi')\n ], FiltersToolPanel.prototype, \"gridApi\", void 0);\n __decorate$20([\n Autowired('columnApi')\n ], FiltersToolPanel.prototype, \"columnApi\", void 0);\n return FiltersToolPanel;\n}(Component));\n\n// DO NOT UPDATE MANUALLY: Generated from script during build time\nvar VERSION$c = '30.0.6';\n\nvar FiltersToolPanelModule = {\n version: VERSION$c,\n moduleName: ModuleNames.FiltersToolPanelModule,\n beans: [],\n agStackComponents: [\n { componentName: 'AgFiltersToolPanelHeader', componentClass: FiltersToolPanelHeaderPanel },\n { componentName: 'AgFiltersToolPanelList', componentClass: FiltersToolPanelListPanel }\n ],\n userComponents: [\n { componentName: 'agFiltersToolPanel', componentClass: FiltersToolPanel },\n ],\n dependantModules: [\n SideBarModule,\n EnterpriseCoreModule\n ]\n};\n\nvar __extends$2O = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * The interval methods don't mutate Date parameters.\n */\nvar TimeInterval = /** @class */ (function () {\n function TimeInterval(encode, decode, rangeCallback) {\n this._encode = encode;\n this._decode = decode;\n this._rangeCallback = rangeCallback;\n }\n /**\n * Returns a new date representing the latest interval boundary date before or equal to date.\n * For example, `day.floor(date)` typically returns 12:00 AM local time on the given date.\n * @param date\n */\n TimeInterval.prototype.floor = function (date) {\n var d = new Date(date);\n var e = this._encode(d);\n return this._decode(e);\n };\n /**\n * Returns a new date representing the earliest interval boundary date after or equal to date.\n * @param date\n */\n TimeInterval.prototype.ceil = function (date) {\n var d = new Date(Number(date) - 1);\n var e = this._encode(d);\n return this._decode(e + 1);\n };\n /**\n * Returns an array of dates representing every interval boundary after or equal to start (inclusive) and before stop (exclusive).\n * @param start Range start.\n * @param stop Range end.\n * @param extend If specified, the requested range will be extended to the closest \"nice\" values.\n */\n TimeInterval.prototype.range = function (start, stop, extend) {\n var _a;\n var rangeCallback = (_a = this._rangeCallback) === null || _a === void 0 ? void 0 : _a.call(this, start, stop);\n var e0 = this._encode(extend ? this.floor(start) : this.ceil(start));\n var e1 = this._encode(extend ? this.ceil(stop) : this.floor(stop));\n if (e1 < e0) {\n return [];\n }\n var range = [];\n for (var e = e0; e <= e1; e++) {\n var d = this._decode(e);\n range.push(d);\n }\n rangeCallback === null || rangeCallback === void 0 ? void 0 : rangeCallback();\n return range;\n };\n return TimeInterval;\n}());\nvar CountableTimeInterval = /** @class */ (function (_super) {\n __extends$2O(CountableTimeInterval, _super);\n function CountableTimeInterval() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n CountableTimeInterval.prototype.getOffset = function (snapTo, step) {\n var s = typeof snapTo === 'number' || snapTo instanceof Date ? this._encode(new Date(snapTo)) : 0;\n return Math.floor(s) % step;\n };\n /**\n * Returns a filtered view of this interval representing every step'th date.\n * It can be a number of minutes, hours, days etc.\n * Must be a positive integer.\n * @param step\n */\n CountableTimeInterval.prototype.every = function (step, options) {\n var _this = this;\n var offset = 0;\n var rangeCallback;\n var _a = (options !== null && options !== void 0 ? options : {}).snapTo, snapTo = _a === void 0 ? 'start' : _a;\n if (typeof snapTo === 'string') {\n var initialOffset_1 = offset;\n rangeCallback = function (start, stop) {\n var s = snapTo === 'start' ? start : stop;\n offset = _this.getOffset(s, step);\n return function () { return (offset = initialOffset_1); };\n };\n }\n else if (typeof snapTo === 'number') {\n offset = this.getOffset(new Date(snapTo), step);\n }\n else if (snapTo instanceof Date) {\n offset = this.getOffset(snapTo, step);\n }\n var encode = function (date) {\n var e = _this._encode(date);\n return Math.floor((e - offset) / step);\n };\n var decode = function (encoded) {\n return _this._decode(encoded * step + offset);\n };\n var interval = new TimeInterval(encode, decode, rangeCallback);\n return interval;\n };\n return CountableTimeInterval;\n}(TimeInterval));\n\nfunction encode$b(date) {\n return date.getTime();\n}\nfunction decode$b(encoded) {\n return new Date(encoded);\n}\nvar millisecond = new CountableTimeInterval(encode$b, decode$b);\n\n// Common time unit sizes in milliseconds.\nnew Date(0).getFullYear();\nvar durationSecond = 1000;\nvar durationMinute = durationSecond * 60;\nvar durationHour = durationMinute * 60;\nvar durationDay = durationHour * 24;\nvar durationWeek = durationDay * 7;\nvar durationMonth = durationDay * 30;\nvar durationYear = durationDay * 365;\n\nvar offset$2 = new Date().getTimezoneOffset() * durationMinute;\nfunction encode$a(date) {\n return Math.floor((date.getTime() - offset$2) / durationSecond);\n}\nfunction decode$a(encoded) {\n return new Date(offset$2 + encoded * durationSecond);\n}\nvar second = new CountableTimeInterval(encode$a, decode$a);\n\nvar offset$1 = new Date().getTimezoneOffset() * durationMinute;\nfunction encode$9(date) {\n return Math.floor((date.getTime() - offset$1) / durationMinute);\n}\nfunction decode$9(encoded) {\n return new Date(offset$1 + encoded * durationMinute);\n}\nvar minute = new CountableTimeInterval(encode$9, decode$9);\n\nvar offset = new Date().getTimezoneOffset() * durationMinute;\nfunction encode$8(date) {\n return Math.floor((date.getTime() - offset) / durationHour);\n}\nfunction decode$8(encoded) {\n return new Date(offset + encoded * durationHour);\n}\nvar hour = new CountableTimeInterval(encode$8, decode$8);\n\nfunction encode$7(date) {\n var tzOffsetMs = date.getTimezoneOffset() * 60000;\n return Math.floor((date.getTime() - tzOffsetMs) / durationDay);\n}\nfunction decode$7(encoded) {\n var d = new Date(1970, 0, 1);\n d.setDate(d.getDate() + encoded);\n return d;\n}\nvar day = new CountableTimeInterval(encode$7, decode$7);\n\n// Set date to n-th day of the week.\nfunction weekday(n) {\n var base = new Date(2023, 0, 1 + n).getTime();\n function encode(date) {\n var dateMs = date.getTime();\n return Math.floor((dateMs - base) / durationWeek);\n }\n function decode(encoded) {\n var d = new Date(base);\n d.setDate(d.getDate() + encoded * 7);\n return d;\n }\n return new CountableTimeInterval(encode, decode);\n}\nvar sunday = weekday(0);\nvar monday = weekday(1);\nvar tuesday = weekday(2);\nvar wednesday = weekday(3);\nvar thursday = weekday(4);\nvar friday = weekday(5);\nvar saturday = weekday(6);\n\nfunction encode$6(date) {\n return date.getFullYear() * 12 + date.getMonth();\n}\nfunction decode$6(encoded) {\n var year = Math.floor(encoded / 12);\n var month = encoded - year * 12;\n return new Date(year, month, 1);\n}\nvar month = new CountableTimeInterval(encode$6, decode$6);\n\nfunction encode$5(date) {\n return date.getFullYear();\n}\nfunction decode$5(encoded) {\n // Note: assigning years through the constructor\n // will break for years 0 - 99 AD (will turn 1900's).\n var d = new Date();\n d.setFullYear(encoded);\n d.setMonth(0, 1);\n d.setHours(0, 0, 0, 0);\n return d;\n}\nvar year = new CountableTimeInterval(encode$5, decode$5);\n\nfunction encode$4(date) {\n return Math.floor(date.getTime() / durationMinute);\n}\nfunction decode$4(encoded) {\n return new Date(encoded * durationMinute);\n}\nvar utcMinute = new CountableTimeInterval(encode$4, decode$4);\n\nfunction encode$3(date) {\n return Math.floor(date.getTime() / durationHour);\n}\nfunction decode$3(encoded) {\n return new Date(encoded * durationHour);\n}\nvar utcHour = new CountableTimeInterval(encode$3, decode$3);\n\nfunction encode$2(date) {\n return Math.floor(date.getTime() / durationDay);\n}\nfunction decode$2(encoded) {\n var d = new Date(0);\n d.setUTCDate(d.getUTCDate() + encoded);\n d.setUTCHours(0, 0, 0, 0);\n return d;\n}\nvar utcDay = new CountableTimeInterval(encode$2, decode$2);\n\nfunction encode$1(date) {\n return date.getUTCFullYear() * 12 + date.getUTCMonth();\n}\nfunction decode$1(encoded) {\n var year = Math.floor(encoded / 12);\n var month = encoded - year * 12;\n return new Date(Date.UTC(year, month, 1));\n}\nvar utcMonth = new CountableTimeInterval(encode$1, decode$1);\n\nfunction encode(date) {\n return date.getUTCFullYear();\n}\nfunction decode(encoded) {\n // Note: assigning years through the constructor\n // will break for years 0 - 99 AD (will turn 1900's).\n var d = new Date();\n d.setUTCFullYear(encoded);\n d.setUTCMonth(0, 1);\n d.setUTCHours(0, 0, 0, 0);\n return d;\n}\nvar utcYear = new CountableTimeInterval(encode, decode);\n\nvar time = /*#__PURE__*/Object.freeze({\n __proto__: null,\n millisecond: millisecond,\n second: second,\n minute: minute,\n hour: hour,\n day: day,\n sunday: sunday,\n monday: monday,\n tuesday: tuesday,\n wednesday: wednesday,\n thursday: thursday,\n friday: friday,\n saturday: saturday,\n month: month,\n year: year,\n utcMinute: utcMinute,\n utcHour: utcHour,\n utcDay: utcDay,\n utcMonth: utcMonth,\n utcYear: utcYear\n});\n\nvar MOBILE = [/Android/i, /webOS/i, /iPhone/i, /iPad/i, /iPod/i, /BlackBerry/i, /Windows Phone/i];\nfunction isDesktop() {\n var userAgent = navigator.userAgent;\n if (MOBILE.some(function (r) { return r.test(userAgent); })) {\n return false;\n }\n return true;\n}\n\n/**\n * Wraps the native Canvas element and overrides its CanvasRenderingContext2D to\n * provide resolution independent rendering based on `window.devicePixelRatio`.\n */\nvar HdpiCanvas = /** @class */ (function () {\n // The width/height attributes of the Canvas element default to\n // 300/150 according to w3.org.\n function HdpiCanvas(_a) {\n var _b = _a.document, document = _b === void 0 ? window.document : _b, _c = _a.width, width = _c === void 0 ? 600 : _c, _d = _a.height, height = _d === void 0 ? 300 : _d, _e = _a.domLayer, domLayer = _e === void 0 ? false : _e, _f = _a.zIndex, zIndex = _f === void 0 ? 0 : _f, _g = _a.name, name = _g === void 0 ? undefined : _g, _h = _a.overrideDevicePixelRatio, overrideDevicePixelRatio = _h === void 0 ? undefined : _h;\n this._container = undefined;\n this._enabled = true;\n // `NaN` is deliberate here, so that overrides are always applied\n // and the `resetTransform` inside the `resize` method works in IE11.\n this._pixelRatio = NaN;\n this._width = 0;\n this._height = 0;\n this.document = document;\n // Create canvas and immediately apply width + height to avoid out-of-memory\n // errors on iOS/iPadOS Safari.\n this.element = document.createElement('canvas');\n this.element.width = width;\n this.element.height = height;\n this.context = this.element.getContext('2d');\n this.imageSource = this.context.canvas;\n var style = this.element.style;\n style.userSelect = 'none';\n style.display = 'block';\n if (domLayer) {\n style.position = 'absolute';\n style.zIndex = String(zIndex);\n style.top = '0';\n style.left = '0';\n style.pointerEvents = 'none';\n style.opacity = \"1\";\n if (name) {\n this.element.id = name;\n }\n }\n this.setPixelRatio(overrideDevicePixelRatio);\n this.resize(width, height);\n }\n Object.defineProperty(HdpiCanvas.prototype, \"container\", {\n get: function () {\n return this._container;\n },\n set: function (value) {\n if (this._container !== value) {\n this.remove();\n if (value) {\n value.appendChild(this.element);\n }\n this._container = value;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(HdpiCanvas.prototype, \"enabled\", {\n get: function () {\n return this._enabled;\n },\n set: function (value) {\n this.element.style.display = value ? 'block' : 'none';\n this._enabled = !!value;\n },\n enumerable: false,\n configurable: true\n });\n HdpiCanvas.prototype.remove = function () {\n var parentNode = this.element.parentNode;\n if (parentNode != null) {\n parentNode.removeChild(this.element);\n }\n };\n HdpiCanvas.prototype.destroy = function () {\n this.element.remove();\n // Workaround memory allocation quirks in iOS Safari by resizing to 0x0 and clearing.\n // See https://bugs.webkit.org/show_bug.cgi?id=195325.\n this.element.width = 0;\n this.element.height = 0;\n this.context.clearRect(0, 0, 0, 0);\n Object.freeze(this);\n };\n HdpiCanvas.prototype.snapshot = function () {\n // No-op for compatibility with HdpiOffscreenCanvas.\n };\n HdpiCanvas.prototype.clear = function () {\n this.context.save();\n this.context.resetTransform();\n this.context.clearRect(0, 0, this.width, this.height);\n this.context.restore();\n };\n HdpiCanvas.prototype.toImage = function () {\n var img = this.document.createElement('img');\n img.src = this.getDataURL();\n return img;\n };\n HdpiCanvas.prototype.getDataURL = function (type) {\n return this.element.toDataURL(type);\n };\n /**\n * @param fileName The name of the downloaded file.\n * @param fileFormat The file format, the default is `image/png`\n */\n HdpiCanvas.prototype.download = function (fileName, fileFormat) {\n if (fileFormat === void 0) { fileFormat = 'image/png'; }\n fileName = (fileName !== null && fileName !== void 0 ? fileName : '').trim() || 'image';\n var dataUrl = this.getDataURL(fileFormat);\n var document = this.document;\n var a = document.createElement('a');\n a.href = dataUrl;\n a.download = fileName;\n a.style.display = 'none';\n document.body.appendChild(a); // required for the `click` to work in Firefox\n a.click();\n document.body.removeChild(a);\n };\n Object.defineProperty(HdpiCanvas.prototype, \"pixelRatio\", {\n get: function () {\n return this._pixelRatio;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Changes the pixel ratio of the Canvas element to the given value,\n * or uses the window.devicePixelRatio (default), then resizes the Canvas\n * element accordingly (default).\n */\n HdpiCanvas.prototype.setPixelRatio = function (ratio) {\n var pixelRatio = ratio !== null && ratio !== void 0 ? ratio : window.devicePixelRatio;\n if (!isDesktop()) {\n // Mobile browsers have stricter memory limits, we reduce rendering resolution to\n // improve stability on mobile browsers. iOS Safari 12->16 are pain-points since they\n // have memory allocation quirks - see https://bugs.webkit.org/show_bug.cgi?id=195325.\n pixelRatio = 1;\n }\n HdpiCanvas.overrideScale(this.context, pixelRatio);\n this._pixelRatio = pixelRatio;\n };\n Object.defineProperty(HdpiCanvas.prototype, \"pixelated\", {\n get: function () {\n return this.element.style.imageRendering === 'pixelated';\n },\n set: function (value) {\n this.element.style.imageRendering = value ? 'pixelated' : 'auto';\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(HdpiCanvas.prototype, \"width\", {\n get: function () {\n return this._width;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(HdpiCanvas.prototype, \"height\", {\n get: function () {\n return this._height;\n },\n enumerable: false,\n configurable: true\n });\n HdpiCanvas.prototype.resize = function (width, height) {\n if (!(width > 0 && height > 0)) {\n return;\n }\n var _a = this, element = _a.element, context = _a.context, pixelRatio = _a.pixelRatio;\n element.width = Math.round(width * pixelRatio);\n element.height = Math.round(height * pixelRatio);\n element.style.width = width + 'px';\n element.style.height = height + 'px';\n context.resetTransform();\n this._width = width;\n this._height = height;\n };\n Object.defineProperty(HdpiCanvas, \"textMeasuringContext\", {\n get: function () {\n if (this._textMeasuringContext) {\n return this._textMeasuringContext;\n }\n var canvas = document.createElement('canvas');\n this._textMeasuringContext = canvas.getContext('2d');\n return this._textMeasuringContext;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(HdpiCanvas, \"svgText\", {\n get: function () {\n if (this._svgText) {\n return this._svgText;\n }\n var xmlns = 'http://www.w3.org/2000/svg';\n var svg = document.createElementNS(xmlns, 'svg');\n svg.setAttribute('width', '100');\n svg.setAttribute('height', '100');\n // Add a descriptive class name in case someone sees this SVG element\n // in devtools and wonders about its purpose:\n if (svg.classList) {\n svg.classList.add('text-measuring-svg');\n }\n else {\n svg.setAttribute('class', 'text-measuring-svg');\n }\n svg.style.position = 'absolute';\n svg.style.top = '-1000px';\n svg.style.visibility = 'hidden';\n var svgText = document.createElementNS(xmlns, 'text');\n svgText.setAttribute('x', '0');\n svgText.setAttribute('y', '30');\n svgText.setAttribute('text', 'black');\n svg.appendChild(svgText);\n document.body.appendChild(svg);\n this._svgText = svgText;\n return svgText;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(HdpiCanvas, \"has\", {\n get: function () {\n if (this._has) {\n return this._has;\n }\n var isChrome = navigator.userAgent.indexOf('Chrome') > -1;\n var isFirefox = navigator.userAgent.indexOf('Firefox') > -1;\n var isSafari = !isChrome && navigator.userAgent.indexOf('Safari') > -1;\n this._has = Object.freeze({\n textMetrics: this.textMeasuringContext.measureText('test').actualBoundingBoxDescent !== undefined &&\n // Firefox implemented advanced TextMetrics object in v74:\n // https://bugzilla.mozilla.org/show_bug.cgi?id=1102584\n // but it's buggy, so we'll keep using the SVG for text measurement in Firefox for now.\n !isFirefox &&\n !isSafari,\n getTransform: this.textMeasuringContext.getTransform !== undefined,\n });\n return this._has;\n },\n enumerable: false,\n configurable: true\n });\n HdpiCanvas.measureText = function (text, font, textBaseline, textAlign) {\n var ctx = this.textMeasuringContext;\n ctx.font = font;\n ctx.textBaseline = textBaseline;\n ctx.textAlign = textAlign;\n return ctx.measureText(text);\n };\n /**\n * Returns the width and height of the measured text.\n * @param text The single-line text to measure.\n * @param font The font shorthand string.\n */\n HdpiCanvas.getTextSize = function (text, font) {\n if (this.has.textMetrics) {\n var ctx = this.textMeasuringContext;\n ctx.font = font;\n var metrics = ctx.measureText(text);\n return {\n width: metrics.width,\n height: metrics.actualBoundingBoxAscent + metrics.actualBoundingBoxDescent,\n };\n }\n else {\n return this.measureSvgText(text, font);\n }\n };\n HdpiCanvas.measureSvgText = function (text, font) {\n var cache = this.textSizeCache;\n var fontCache = cache[font];\n // Note: consider not caching the size of numeric strings.\n // For example: if (isNaN(+text)) { // skip\n if (fontCache) {\n var size_1 = fontCache[text];\n if (size_1) {\n return size_1;\n }\n }\n else {\n cache[font] = {};\n }\n var svgText = this.svgText;\n svgText.style.font = font;\n svgText.textContent = text;\n // `getBBox` returns an instance of `SVGRect` with the same `width` and `height`\n // measurements as `DOMRect` instance returned by the `getBoundingClientRect`.\n // But the `SVGRect` instance has half the properties of the `DOMRect`,\n // so we use the `getBBox` method.\n var bbox = svgText.getBBox();\n var size = {\n width: bbox.width,\n height: bbox.height,\n };\n cache[font][text] = size;\n return size;\n };\n HdpiCanvas.overrideScale = function (ctx, scale) {\n var depth = 0;\n var overrides = {\n save: function () {\n this.$save();\n depth++;\n },\n restore: function () {\n if (depth > 0) {\n this.$restore();\n depth--;\n }\n else {\n throw new Error('AG Charts - Unable to restore() past depth 0');\n }\n },\n setTransform: function (a, b, c, d, e, f) {\n if (typeof a === 'object') {\n this.$setTransform(a);\n }\n else {\n this.$setTransform(a * scale, b * scale, c * scale, d * scale, e * scale, f * scale);\n }\n },\n resetTransform: function () {\n // As of Jan 8, 2019, `resetTransform` is still an \"experimental technology\",\n // and doesn't work in IE11 and Edge 44.\n this.$setTransform(scale, 0, 0, scale, 0, 0);\n },\n verifyDepthZero: function () {\n if (depth !== 0) {\n throw new Error('AG Charts - Save/restore depth is non-zero: ' + depth);\n }\n },\n };\n for (var name_1 in overrides) {\n if (Object.prototype.hasOwnProperty.call(overrides, name_1)) {\n // Save native methods under prefixed names,\n // if this hasn't been done by the previous overrides already.\n if (!ctx['$' + name_1]) {\n ctx['$' + name_1] = ctx[name_1];\n }\n // Replace native methods with overrides,\n // or previous overrides with the new ones.\n ctx[name_1] = overrides[name_1];\n }\n }\n };\n HdpiCanvas.textSizeCache = {};\n return HdpiCanvas;\n}());\n\n// For small data structs like a bounding box, objects are superior to arrays\n// in terms of performance (by 3-4% in Chrome 71, Safari 12 and by 20% in Firefox 64).\n// They are also self descriptive and harder to abuse.\n// For example, one has to do:\n// `ctx.strokeRect(bbox.x, bbox.y, bbox.width, bbox.height);`\n// rather than become enticed by the much slower:\n// `ctx.strokeRect(...bbox);`\n// https://jsperf.com/array-vs-object-create-access\nvar __assign$U = (undefined && undefined.__assign) || function () {\n __assign$U = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$U.apply(this, arguments);\n};\nvar __read$1a = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar BBox = /** @class */ (function () {\n function BBox(x, y, width, height) {\n this.x = x;\n this.y = y;\n this.width = width;\n this.height = height;\n }\n BBox.prototype.clone = function () {\n var _a = this, x = _a.x, y = _a.y, width = _a.width, height = _a.height;\n return new BBox(x, y, width, height);\n };\n BBox.prototype.equals = function (other) {\n return this.x === other.x && this.y === other.y && this.width === other.width && this.height === other.height;\n };\n BBox.prototype.containsPoint = function (x, y) {\n return x >= this.x && x <= this.x + this.width && y >= this.y && y <= this.y + this.height;\n };\n BBox.prototype.collidesBBox = function (other) {\n return (this.x < other.x + other.width &&\n this.x + this.width > other.x &&\n this.y < other.y + other.height &&\n this.y + this.height > other.y);\n };\n BBox.prototype.isInfinite = function () {\n return (Math.abs(this.x) === Infinity ||\n Math.abs(this.y) === Infinity ||\n Math.abs(this.width) === Infinity ||\n Math.abs(this.height) === Infinity);\n };\n BBox.prototype.shrink = function (amount, position) {\n var _this = this;\n var apply = function (pos, amt) {\n switch (pos) {\n case 'top':\n _this.y += amt;\n // eslint-disable-next-line no-fallthrough\n case 'bottom':\n _this.height -= amt;\n break;\n case 'left':\n _this.x += amt;\n // eslint-disable-next-line no-fallthrough\n case 'right':\n _this.width -= amt;\n break;\n case 'vertical':\n _this.y += amt;\n _this.height -= amt * 2;\n break;\n case 'horizontal':\n _this.x += amt;\n _this.width -= amt * 2;\n break;\n default:\n _this.x += amt;\n _this.width -= amt * 2;\n _this.y += amt;\n _this.height -= amt * 2;\n }\n };\n if (typeof amount === 'number') {\n apply(position, amount);\n }\n else {\n Object.entries(amount).forEach(function (_a) {\n var _b = __read$1a(_a, 2), pos = _b[0], amt = _b[1];\n return apply(pos, amt);\n });\n }\n return this;\n };\n BBox.prototype.grow = function (amount, position) {\n if (typeof amount === 'number') {\n this.shrink(-amount, position);\n }\n else {\n var paddingCopy = __assign$U({}, amount);\n for (var key in paddingCopy) {\n paddingCopy[key] *= -1;\n }\n this.shrink(paddingCopy);\n }\n return this;\n };\n BBox.merge = function (boxes) {\n var left = Infinity;\n var top = Infinity;\n var right = -Infinity;\n var bottom = -Infinity;\n boxes.forEach(function (box) {\n if (box.x < left) {\n left = box.x;\n }\n if (box.y < top) {\n top = box.y;\n }\n if (box.x + box.width > right) {\n right = box.x + box.width;\n }\n if (box.y + box.height > bottom) {\n bottom = box.y + box.height;\n }\n });\n return new BBox(left, top, right - left, bottom - top);\n };\n return BBox;\n}());\n\nvar __read$19 = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray$H = (undefined && undefined.__spreadArray) || function (to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\n to[j] = from[i];\n return to;\n};\n/**\n * As of Jan 8, 2019, Firefox still doesn't implement\n * `getTransform(): DOMMatrix;`\n * `setTransform(transform?: DOMMatrix2DInit)`\n * in the `CanvasRenderingContext2D`.\n * Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=928150\n * IE11 and Edge 44 also don't have the support.\n * Thus this class, to keep track of the current transform and\n * combine transformations.\n * Standards:\n * https://html.spec.whatwg.org/dev/canvas.html\n * https://www.w3.org/TR/geometry-1/\n */\nvar Matrix = /** @class */ (function () {\n function Matrix(elements) {\n if (elements === void 0) { elements = [1, 0, 0, 1, 0, 0]; }\n this.elements = elements;\n }\n Object.defineProperty(Matrix.prototype, \"e\", {\n get: function () {\n return __spreadArray$H([], __read$19(this.elements));\n },\n enumerable: false,\n configurable: true\n });\n Matrix.prototype.setElements = function (elements) {\n var e = this.elements;\n // `this.elements = elements.slice()` is 4-5 times slower\n // (in Chrome 71 and FF 64) than manually copying elements,\n // since slicing allocates new memory.\n // The performance of passing parameters individually\n // vs as an array is about the same in both browsers, so we\n // go with a single (array of elements) parameter, because\n // `setElements(elements)` and `setElements([a, b, c, d, e, f])`\n // calls give us roughly the same performance, versus\n // `setElements(...elements)` and `setElements(a, b, c, d, e, f)`,\n // where the spread operator causes a 20-30x performance drop\n // (30x when compiled to ES5's `.apply(this, elements)`\n // 20x when used natively).\n e[0] = elements[0];\n e[1] = elements[1];\n e[2] = elements[2];\n e[3] = elements[3];\n e[4] = elements[4];\n e[5] = elements[5];\n return this;\n };\n Object.defineProperty(Matrix.prototype, \"identity\", {\n get: function () {\n var e = this.elements;\n return e[0] === 1 && e[1] === 0 && e[2] === 0 && e[3] === 1 && e[4] === 0 && e[5] === 0;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Performs the AxB matrix multiplication and saves the result\n * to `C`, if given, or to `A` otherwise.\n */\n Matrix.prototype.AxB = function (A, B, C) {\n var a = A[0] * B[0] + A[2] * B[1], b = A[1] * B[0] + A[3] * B[1], c = A[0] * B[2] + A[2] * B[3], d = A[1] * B[2] + A[3] * B[3], e = A[0] * B[4] + A[2] * B[5] + A[4], f = A[1] * B[4] + A[3] * B[5] + A[5];\n C = C !== null && C !== void 0 ? C : A;\n C[0] = a;\n C[1] = b;\n C[2] = c;\n C[3] = d;\n C[4] = e;\n C[5] = f;\n };\n /**\n * The `other` matrix gets post-multiplied to the current matrix.\n * Returns the current matrix.\n * @param other\n */\n Matrix.prototype.multiplySelf = function (other) {\n this.AxB(this.elements, other.elements);\n return this;\n };\n /**\n * The `other` matrix gets post-multiplied to the current matrix.\n * Returns a new matrix.\n * @param other\n */\n Matrix.prototype.multiply = function (other) {\n var elements = new Array(6);\n this.AxB(this.elements, other.elements, elements);\n return new Matrix(elements);\n };\n Matrix.prototype.preMultiplySelf = function (other) {\n this.AxB(other.elements, this.elements, this.elements);\n return this;\n };\n /**\n * Returns the inverse of this matrix as a new matrix.\n */\n Matrix.prototype.inverse = function () {\n var el = this.elements;\n var a = el[0], b = el[1], c = el[2], d = el[3];\n var e = el[4], f = el[5];\n var rD = 1 / (a * d - b * c); // reciprocal of determinant\n a *= rD;\n b *= rD;\n c *= rD;\n d *= rD;\n return new Matrix([d, -b, -c, a, c * f - d * e, b * e - a * f]);\n };\n /**\n * Save the inverse of this matrix to the given matrix.\n */\n Matrix.prototype.inverseTo = function (other) {\n var el = this.elements;\n var a = el[0], b = el[1], c = el[2], d = el[3];\n var e = el[4], f = el[5];\n var rD = 1 / (a * d - b * c); // reciprocal of determinant\n a *= rD;\n b *= rD;\n c *= rD;\n d *= rD;\n other.setElements([d, -b, -c, a, c * f - d * e, b * e - a * f]);\n return this;\n };\n Matrix.prototype.invertSelf = function () {\n var el = this.elements;\n var a = el[0], b = el[1], c = el[2], d = el[3];\n var e = el[4], f = el[5];\n var rD = 1 / (a * d - b * c); // reciprocal of determinant\n a *= rD;\n b *= rD;\n c *= rD;\n d *= rD;\n el[0] = d;\n el[1] = -b;\n el[2] = -c;\n el[3] = a;\n el[4] = c * f - d * e;\n el[5] = b * e - a * f;\n return this;\n };\n Matrix.prototype.transformPoint = function (x, y) {\n var e = this.elements;\n return {\n x: x * e[0] + y * e[2] + e[4],\n y: x * e[1] + y * e[3] + e[5],\n };\n };\n Matrix.prototype.transformBBox = function (bbox, target) {\n var elements = this.elements;\n var xx = elements[0];\n var xy = elements[1];\n var yx = elements[2];\n var yy = elements[3];\n var h_w = bbox.width * 0.5;\n var h_h = bbox.height * 0.5;\n var cx = bbox.x + h_w;\n var cy = bbox.y + h_h;\n var w = Math.abs(h_w * xx) + Math.abs(h_h * yx);\n var h = Math.abs(h_w * xy) + Math.abs(h_h * yy);\n if (!target) {\n target = new BBox(0, 0, 0, 0);\n }\n target.x = cx * xx + cy * yx + elements[4] - w;\n target.y = cx * xy + cy * yy + elements[5] - h;\n target.width = w + w;\n target.height = h + h;\n return target;\n };\n Matrix.prototype.toContext = function (ctx) {\n // It's fair to say that matrix multiplications are not cheap.\n // However, updating path definitions on every frame isn't either, so\n // it may be cheaper to just translate paths. It's also fair to\n // say, that most paths will have to be re-rendered anyway, say\n // rectangle paths in a bar chart, where an animation would happen when\n // the data set changes and existing bars are morphed into new ones.\n // Or a pie chart, where old sectors are also morphed into new ones.\n // Same for the line chart. The only plausible case where translating\n // existing paths would be enough, is the scatter chart, where marker\n // icons, typically circles, stay the same size. But if circle radii\n // are bound to some data points, even circle paths would have to be\n // updated. And thus it makes sense to optimize for fewer matrix\n // transforms, where transform matrices of paths are mostly identity\n // matrices and `x`/`y`, `centerX`/`centerY` and similar properties\n // are used to define a path at specific coordinates. And only groups\n // are used to collectively apply a transform to a set of nodes.\n // If the matrix is mostly identity (95% of the time),\n // the `if (this.isIdentity)` check can make this call 3-4 times\n // faster on average: https://jsperf.com/matrix-check-first-vs-always-set\n if (this.identity) {\n return;\n }\n var e = this.elements;\n ctx.transform(e[0], e[1], e[2], e[3], e[4], e[5]);\n };\n Matrix.flyweight = function (sourceMatrix) {\n return Matrix.instance.setElements(sourceMatrix.elements);\n };\n Matrix.updateTransformMatrix = function (matrix, scalingX, scalingY, rotation, translationX, translationY, opts) {\n // Assume that centers of scaling and rotation are at the origin.\n var _a = __read$19([0, 0], 2), bbcx = _a[0], bbcy = _a[1];\n var sx = scalingX;\n var sy = scalingY;\n var scx;\n var scy;\n if (sx === 1 && sy === 1) {\n scx = 0;\n scy = 0;\n }\n else {\n scx = (opts === null || opts === void 0 ? void 0 : opts.scalingCenterX) == null ? bbcx : opts === null || opts === void 0 ? void 0 : opts.scalingCenterX;\n scy = (opts === null || opts === void 0 ? void 0 : opts.scalingCenterY) == null ? bbcy : opts === null || opts === void 0 ? void 0 : opts.scalingCenterY;\n }\n var r = rotation;\n var cos = Math.cos(r);\n var sin = Math.sin(r);\n var rcx;\n var rcy;\n if (r === 0) {\n rcx = 0;\n rcy = 0;\n }\n else {\n rcx = (opts === null || opts === void 0 ? void 0 : opts.rotationCenterX) == null ? bbcx : opts === null || opts === void 0 ? void 0 : opts.rotationCenterX;\n rcy = (opts === null || opts === void 0 ? void 0 : opts.rotationCenterY) == null ? bbcy : opts === null || opts === void 0 ? void 0 : opts.rotationCenterY;\n }\n var tx = translationX;\n var ty = translationY;\n // The transform matrix `M` is a result of the following transformations:\n // 1) translate the center of scaling to the origin\n // 2) scale\n // 3) translate back\n // 4) translate the center of rotation to the origin\n // 5) rotate\n // 6) translate back\n // 7) translate\n // (7) (6) (5) (4) (3) (2) (1)\n // | 1 0 tx | | 1 0 rcx | | cos -sin 0 | | 1 0 -rcx | | 1 0 scx | | sx 0 0 | | 1 0 -scx |\n // M = | 0 1 ty | * | 0 1 rcy | * | sin cos 0 | * | 0 1 -rcy | * | 0 1 scy | * | 0 sy 0 | * | 0 1 -scy |\n // | 0 0 1 | | 0 0 1 | | 0 0 1 | | 0 0 1 | | 0 0 1 | | 0 0 0 | | 0 0 1 |\n // Translation after steps 1-4 above:\n var tx4 = scx * (1 - sx) - rcx;\n var ty4 = scy * (1 - sy) - rcy;\n matrix.setElements([\n cos * sx,\n sin * sx,\n -sin * sy,\n cos * sy,\n cos * tx4 - sin * ty4 + rcx + tx,\n sin * tx4 + cos * ty4 + rcy + ty,\n ]);\n return matrix;\n };\n Matrix.fromContext = function (ctx) {\n var domMatrix = ctx.getTransform();\n return new Matrix([domMatrix.a, domMatrix.b, domMatrix.c, domMatrix.d, domMatrix.e, domMatrix.f]);\n };\n Matrix.instance = new Matrix();\n return Matrix;\n}());\n\nvar ID_MAP = {};\nfunction createId$1(instance) {\n var _a;\n var constructor = instance.constructor;\n var className = Object.prototype.hasOwnProperty.call(constructor, 'className')\n ? constructor.className\n : constructor.name;\n if (!className) {\n throw new Error(\"The \" + constructor + \" is missing the 'className' property.\");\n }\n var nextId = ((_a = ID_MAP[className]) !== null && _a !== void 0 ? _a : 0) + 1;\n ID_MAP[className] = nextId;\n return className + '-' + nextId;\n}\n\nvar RedrawType;\n(function (RedrawType) {\n RedrawType[RedrawType[\"NONE\"] = 0] = \"NONE\";\n // Canvas doesn't need clearing, an incremental re-rerender is sufficient.\n RedrawType[RedrawType[\"TRIVIAL\"] = 1] = \"TRIVIAL\";\n // Group needs clearing, a semi-incremental re-render is sufficient.\n RedrawType[RedrawType[\"MINOR\"] = 2] = \"MINOR\";\n // Canvas needs to be cleared for these redraw types.\n RedrawType[RedrawType[\"MAJOR\"] = 3] = \"MAJOR\";\n})(RedrawType || (RedrawType = {}));\n/** @returns true if new Function() is disabled in the current execution context. */\nfunction functionConstructorAvailable() {\n try {\n new Function('return true');\n return true;\n }\n catch (e) {\n return false;\n }\n}\nvar STRING_FUNCTION_USEABLE = functionConstructorAvailable();\nfunction SceneChangeDetection(opts) {\n var _a = opts !== null && opts !== void 0 ? opts : {}, changeCb = _a.changeCb, convertor = _a.convertor;\n return function (target, key) {\n // `target` is either a constructor (static member) or prototype (instance member)\n var privateKey = \"__\" + key;\n if (target[key]) {\n return;\n }\n if (STRING_FUNCTION_USEABLE && changeCb == null && convertor == null) {\n prepareFastGetSet(target, key, privateKey, opts);\n }\n else {\n prepareSlowGetSet(target, key, privateKey, opts);\n }\n };\n}\nfunction prepareFastGetSet(target, key, privateKey, opts) {\n var _a = opts !== null && opts !== void 0 ? opts : {}, _b = _a.redraw, redraw = _b === void 0 ? RedrawType.TRIVIAL : _b, _c = _a.type, type = _c === void 0 ? 'normal' : _c, _d = _a.checkDirtyOnAssignment, checkDirtyOnAssignment = _d === void 0 ? false : _d;\n // Optimised code-path.\n // Remove all conditional logic from runtime - generate a setter with the exact necessary\n // steps, as these setters are called a LOT during update cycles.\n var setterJs = new Function('value', \"\\n const oldValue = this.\" + privateKey + \";\\n if (value !== oldValue) {\\n this.\" + privateKey + \" = value;\\n \" + (type === 'normal' ? \"this.markDirty(this, \" + redraw + \");\" : '') + \"\\n \" + (type === 'transform' ? \"this.markDirtyTransform(\" + redraw + \");\" : '') + \"\\n \" + (type === 'path'\n ? \"if (!this._dirtyPath) { this._dirtyPath = true; this.markDirty(this, \" + redraw + \"); }\"\n : '') + \"\\n \" + (type === 'font'\n ? \"if (!this._dirtyFont) { this._dirtyFont = true; this.markDirty(this, \" + redraw + \"); }\"\n : '') + \"\\n }\\n \" + (checkDirtyOnAssignment\n ? \"if (value != null && value._dirty > \" + RedrawType.NONE + \") { this.markDirty(value, value._dirty); }\"\n : '') + \"\\n\");\n var getterJs = new Function(\"return this.\" + privateKey + \";\");\n Object.defineProperty(target, key, {\n set: setterJs,\n get: getterJs,\n enumerable: true,\n configurable: true,\n });\n}\nfunction prepareSlowGetSet(target, key, privateKey, opts) {\n var _a = opts !== null && opts !== void 0 ? opts : {}, _b = _a.redraw, redraw = _b === void 0 ? RedrawType.TRIVIAL : _b, _c = _a.type, type = _c === void 0 ? 'normal' : _c, changeCb = _a.changeCb, convertor = _a.convertor, _d = _a.checkDirtyOnAssignment, checkDirtyOnAssignment = _d === void 0 ? false : _d;\n // Unoptimised but 'safe' code-path, for environments with CSP headers and no 'unsafe-eval'.\n // We deliberately do not support debug branches found in the optimised path above, since\n // for large data-set series performance deteriorates with every extra branch here.\n var setter = function (value) {\n var oldValue = this[privateKey];\n value = convertor ? convertor(value) : value;\n if (value !== oldValue) {\n this[privateKey] = value;\n if (type === 'normal')\n this.markDirty(this, redraw);\n if (type === 'transform')\n this.markDirtyTransform(redraw);\n if (type === 'path' && !this._dirtyPath) {\n this._dirtyPath = true;\n this.markDirty(this, redraw);\n }\n if (type === 'font' && !this._dirtyFont) {\n this._dirtyFont = true;\n this.markDirty(this, redraw);\n }\n if (changeCb)\n changeCb(this);\n }\n if (checkDirtyOnAssignment && value != null && value._dirty > RedrawType.NONE)\n this.markDirty(value, value._dirty);\n };\n var getter = function () {\n return this[privateKey];\n };\n Object.defineProperty(target, key, {\n set: setter,\n get: getter,\n enumerable: true,\n configurable: true,\n });\n}\nvar ChangeDetectable = /** @class */ (function () {\n function ChangeDetectable() {\n this._dirty = RedrawType.MAJOR;\n }\n ChangeDetectable.prototype.markDirty = function (_source, type) {\n if (type === void 0) { type = RedrawType.TRIVIAL; }\n if (this._dirty > type) {\n return;\n }\n this._dirty = type;\n };\n ChangeDetectable.prototype.markClean = function (_opts) {\n this._dirty = RedrawType.NONE;\n };\n ChangeDetectable.prototype.isDirty = function () {\n return this._dirty > RedrawType.NONE;\n };\n return ChangeDetectable;\n}());\n\nvar __extends$2N = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$1$ = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __values$N = (undefined && undefined.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nvar __read$18 = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray$G = (undefined && undefined.__spreadArray) || function (to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\n to[j] = from[i];\n return to;\n};\nvar PointerEvents;\n(function (PointerEvents) {\n PointerEvents[PointerEvents[\"All\"] = 0] = \"All\";\n PointerEvents[PointerEvents[\"None\"] = 1] = \"None\";\n})(PointerEvents || (PointerEvents = {}));\nvar zIndexChangedCallback = function (o) {\n if (o.parent) {\n o.parent.dirtyZIndex = true;\n }\n o.zIndexChanged();\n};\n/**\n * Abstract scene graph node.\n * Each node can have zero or one parent and belong to zero or one scene.\n */\nvar Node = /** @class */ (function (_super) {\n __extends$2N(Node, _super);\n function Node(_a) {\n var _b = _a === void 0 ? {} : _a, isVirtual = _b.isVirtual;\n var _this = _super.call(this) || this;\n /** Unique number to allow creation order to be easily determined. */\n _this.serialNumber = Node._nextSerialNumber++;\n /**\n * Unique node ID in the form `ClassName-NaturalNumber`.\n */\n _this.id = createId$1(_this);\n /**\n * Some number to identify this node, typically within a `Group` node.\n * Usually this will be some enum value used as a selector.\n */\n _this.tag = NaN;\n /**\n * To simplify the type system (especially in Selections) we don't have the `Parent` node\n * (one that has children). Instead, we mimic HTML DOM, where any node can have children.\n * But we still need to distinguish regular leaf nodes from container leafs somehow.\n */\n _this.isContainerNode = false;\n _this._virtualChildren = [];\n _this._children = [];\n // Used to check for duplicate nodes.\n _this.childSet = {}; // new Set()\n // These matrices may need to have package level visibility\n // for performance optimization purposes.\n _this.matrix = new Matrix();\n _this.inverseMatrix = new Matrix();\n _this.dirtyTransform = false;\n _this.scalingX = 1;\n _this.scalingY = 1;\n /**\n * The center of scaling.\n * The default value of `null` means the scaling center will be\n * determined automatically, as the center of the bounding box\n * of a node.\n */\n _this.scalingCenterX = null;\n _this.scalingCenterY = null;\n _this.rotationCenterX = null;\n _this.rotationCenterY = null;\n /**\n * Rotation angle in radians.\n * The value is set as is. No normalization to the [-180, 180) or [0, 360)\n * interval is performed.\n */\n _this.rotation = 0;\n _this.translationX = 0;\n _this.translationY = 0;\n _this.visible = true;\n _this.dirtyZIndex = false;\n _this.zIndex = 0;\n /** Discriminators for render order within a zIndex. */\n _this.zIndexSubOrder = undefined;\n _this.pointerEvents = PointerEvents.All;\n _this.isVirtual = isVirtual !== null && isVirtual !== void 0 ? isVirtual : false;\n return _this;\n }\n Object.defineProperty(Node.prototype, \"datum\", {\n /**\n * Some arbitrary data bound to the node.\n */\n get: function () {\n var _a;\n if (this._datum !== undefined) {\n return this._datum;\n }\n return (_a = this._parent) === null || _a === void 0 ? void 0 : _a.datum;\n },\n set: function (datum) {\n this._datum = datum;\n },\n enumerable: false,\n configurable: true\n });\n Node.prototype._setLayerManager = function (value) {\n var e_1, _a, e_2, _b;\n this._layerManager = value;\n this._debug = value === null || value === void 0 ? void 0 : value.debug;\n try {\n for (var _c = __values$N(this._children), _d = _c.next(); !_d.done; _d = _c.next()) {\n var child = _d.value;\n child._setLayerManager(value);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_d && !_d.done && (_a = _c.return)) _a.call(_c);\n }\n finally { if (e_1) throw e_1.error; }\n }\n try {\n for (var _e = __values$N(this._virtualChildren), _f = _e.next(); !_f.done; _f = _e.next()) {\n var child = _f.value;\n child._setLayerManager(value);\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (_f && !_f.done && (_b = _e.return)) _b.call(_e);\n }\n finally { if (e_2) throw e_2.error; }\n }\n };\n Object.defineProperty(Node.prototype, \"layerManager\", {\n get: function () {\n return this._layerManager;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Node.prototype, \"parent\", {\n get: function () {\n return this._parent;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Node.prototype, \"children\", {\n get: function () {\n var e_3, _a;\n if (this._virtualChildren.length === 0)\n return this._children;\n var result = __spreadArray$G([], __read$18(this._children));\n try {\n for (var _b = __values$N(this._virtualChildren), _c = _b.next(); !_c.done; _c = _b.next()) {\n var next = _c.value;\n result.push.apply(result, __spreadArray$G([], __read$18(next.children)));\n }\n }\n catch (e_3_1) { e_3 = { error: e_3_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_3) throw e_3.error; }\n }\n return result;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Node.prototype, \"virtualChildren\", {\n get: function () {\n return this._virtualChildren;\n },\n enumerable: false,\n configurable: true\n });\n Node.prototype.hasVirtualChildren = function () {\n return this._virtualChildren.length > 0;\n };\n /**\n * Appends one or more new node instances to this parent.\n * If one needs to:\n * - move a child to the end of the list of children\n * - move a child from one parent to another (including parents in other scenes)\n * one should use the {@link insertBefore} method instead.\n * @param nodes A node or nodes to append.\n */\n Node.prototype.append = function (nodes) {\n var e_4, _a;\n // Passing a single parameter to an open-ended version of `append`\n // would be 30-35% slower than this.\n if (!Array.isArray(nodes)) {\n nodes = [nodes];\n }\n try {\n for (var nodes_1 = __values$N(nodes), nodes_1_1 = nodes_1.next(); !nodes_1_1.done; nodes_1_1 = nodes_1.next()) {\n var node = nodes_1_1.value;\n if (node.parent) {\n throw new Error(node + \" already belongs to another parent: \" + node.parent + \".\");\n }\n if (node.layerManager) {\n throw new Error(node + \" already belongs to a scene: \" + node.layerManager + \".\");\n }\n if (this.childSet[node.id]) {\n // Cast to `any` to avoid `Property 'name' does not exist on type 'Function'`.\n throw new Error(\"Duplicate \" + node.constructor.name + \" node: \" + node);\n }\n if (node.isVirtual) {\n this._virtualChildren.push(node);\n }\n else {\n this._children.push(node);\n }\n this.childSet[node.id] = true;\n node._parent = this;\n node._setLayerManager(this.layerManager);\n }\n }\n catch (e_4_1) { e_4 = { error: e_4_1 }; }\n finally {\n try {\n if (nodes_1_1 && !nodes_1_1.done && (_a = nodes_1.return)) _a.call(nodes_1);\n }\n finally { if (e_4) throw e_4.error; }\n }\n this.dirtyZIndex = true;\n this.markDirty(this, RedrawType.MAJOR);\n };\n Node.prototype.appendChild = function (node) {\n this.append(node);\n return node;\n };\n Node.prototype.removeChild = function (node) {\n var error = function () {\n throw new Error(\"The node to be removed is not a child of this node.\");\n };\n if (node.parent !== this) {\n error();\n }\n if (node.isVirtual) {\n var i = this._virtualChildren.indexOf(node);\n if (i < 0)\n error();\n this._virtualChildren.splice(i, 1);\n }\n else {\n var i = this._children.indexOf(node);\n if (i < 0)\n error();\n this._children.splice(i, 1);\n }\n delete this.childSet[node.id];\n node._parent = undefined;\n node._setLayerManager();\n this.dirtyZIndex = true;\n this.markDirty(node, RedrawType.MAJOR);\n return node;\n };\n Node.prototype.calculateCumulativeMatrix = function () {\n this.computeTransformMatrix();\n var matrix = Matrix.flyweight(this.matrix);\n var parent = this.parent;\n while (parent) {\n parent.computeTransformMatrix();\n matrix.preMultiplySelf(parent.matrix);\n parent = parent.parent;\n }\n return matrix;\n };\n Node.prototype.transformPoint = function (x, y) {\n var matrix = this.calculateCumulativeMatrix();\n return matrix.invertSelf().transformPoint(x, y);\n };\n Node.prototype.inverseTransformPoint = function (x, y) {\n var matrix = this.calculateCumulativeMatrix();\n return matrix.transformPoint(x, y);\n };\n Node.prototype.transformBBox = function (bbox) {\n var matrix = this.calculateCumulativeMatrix();\n return matrix.invertSelf().transformBBox(bbox);\n };\n Node.prototype.inverseTransformBBox = function (bbox) {\n var matrix = this.calculateCumulativeMatrix();\n return matrix.transformBBox(bbox);\n };\n Node.prototype.markDirtyTransform = function () {\n this.dirtyTransform = true;\n this.markDirty(this, RedrawType.MAJOR);\n };\n Node.prototype.containsPoint = function (_x, _y) {\n return false;\n };\n /**\n * Hit testing method.\n * Recursively checks if the given point is inside this node or any of its children.\n * Returns the first matching node or `undefined`.\n * Nodes that render later (show on top) are hit tested first.\n */\n Node.prototype.pickNode = function (x, y) {\n var _a;\n if (!this.visible || this.pointerEvents === PointerEvents.None || !this.containsPoint(x, y)) {\n return;\n }\n var children = this.children;\n if (children.length > 1000) {\n // Try to optimise which children to interrogate; BBox calculation is an approximation\n // for more complex shapes, so discarding items based on this will save a lot of\n // processing when the point is nowhere near the child.\n for (var i = children.length - 1; i >= 0; i--) {\n var child = children[i];\n var containsPoint = (_a = child.computeTransformedBBox()) === null || _a === void 0 ? void 0 : _a.containsPoint(x, y);\n var hit = containsPoint ? child.pickNode(x, y) : undefined;\n if (hit) {\n return hit;\n }\n }\n }\n else if (children.length) {\n // Nodes added later should be hit-tested first,\n // as they are rendered on top of the previously added nodes.\n for (var i = children.length - 1; i >= 0; i--) {\n var hit = children[i].pickNode(x, y);\n if (hit) {\n return hit;\n }\n }\n }\n else if (!this.isContainerNode) {\n // a leaf node, but not a container leaf\n return this;\n }\n };\n Node.prototype.findNodes = function (predicate) {\n var e_5, _a;\n var result = predicate(this) ? [this] : [];\n try {\n for (var _b = __values$N(this.children), _c = _b.next(); !_c.done; _c = _b.next()) {\n var child = _c.value;\n var childResult = child.findNodes(predicate);\n if (childResult) {\n result.push.apply(result, __spreadArray$G([], __read$18(childResult)));\n }\n }\n }\n catch (e_5_1) { e_5 = { error: e_5_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_5) throw e_5.error; }\n }\n return result;\n };\n Node.prototype.computeBBox = function () {\n return;\n };\n Node.prototype.computeTransformedBBox = function () {\n var bbox = this.computeBBox();\n if (!bbox) {\n return undefined;\n }\n this.computeTransformMatrix();\n var matrix = Matrix.flyweight(this.matrix);\n var parent = this.parent;\n while (parent) {\n parent.computeTransformMatrix();\n matrix.preMultiplySelf(parent.matrix);\n parent = parent.parent;\n }\n matrix.transformBBox(bbox, bbox);\n return bbox;\n };\n Node.prototype.computeTransformMatrix = function () {\n if (!this.dirtyTransform) {\n return;\n }\n var _a = this, matrix = _a.matrix, scalingX = _a.scalingX, scalingY = _a.scalingY, rotation = _a.rotation, translationX = _a.translationX, translationY = _a.translationY, scalingCenterX = _a.scalingCenterX, scalingCenterY = _a.scalingCenterY, rotationCenterX = _a.rotationCenterX, rotationCenterY = _a.rotationCenterY;\n Matrix.updateTransformMatrix(matrix, scalingX, scalingY, rotation, translationX, translationY, {\n scalingCenterX: scalingCenterX,\n scalingCenterY: scalingCenterY,\n rotationCenterX: rotationCenterX,\n rotationCenterY: rotationCenterY,\n });\n matrix.inverseTo(this.inverseMatrix);\n this.dirtyTransform = false;\n };\n Node.prototype.render = function (renderCtx) {\n var stats = renderCtx.stats;\n this._dirty = RedrawType.NONE;\n if (stats)\n stats.nodesRendered++;\n };\n Node.prototype.clearBBox = function (ctx) {\n var bbox = this.computeBBox();\n if (bbox == null) {\n return;\n }\n var x = bbox.x, y = bbox.y, width = bbox.width, height = bbox.height;\n var topLeft = this.transformPoint(x, y);\n var bottomRight = this.transformPoint(x + width, y + height);\n ctx.clearRect(topLeft.x, topLeft.y, bottomRight.x - topLeft.x, bottomRight.y - topLeft.y);\n };\n Node.prototype.markDirty = function (_source, type, parentType) {\n if (type === void 0) { type = RedrawType.TRIVIAL; }\n if (parentType === void 0) { parentType = type; }\n if (this._dirty > type) {\n return;\n }\n if (this._dirty === type && type === parentType) {\n return;\n }\n this._dirty = type;\n if (this.parent) {\n this.parent.markDirty(this, parentType);\n }\n else if (this.layerManager) {\n this.layerManager.markDirty();\n }\n };\n Object.defineProperty(Node.prototype, \"dirty\", {\n get: function () {\n return this._dirty;\n },\n enumerable: false,\n configurable: true\n });\n Node.prototype.markClean = function (opts) {\n var e_6, _a, e_7, _b;\n var _c = opts !== null && opts !== void 0 ? opts : {}, _d = _c.force, force = _d === void 0 ? false : _d, _e = _c.recursive, recursive = _e === void 0 ? true : _e;\n if (this._dirty === RedrawType.NONE && !force) {\n return;\n }\n this._dirty = RedrawType.NONE;\n if (recursive !== false) {\n try {\n for (var _f = __values$N(this._virtualChildren), _g = _f.next(); !_g.done; _g = _f.next()) {\n var child = _g.value;\n child.markClean({ force: force });\n }\n }\n catch (e_6_1) { e_6 = { error: e_6_1 }; }\n finally {\n try {\n if (_g && !_g.done && (_a = _f.return)) _a.call(_f);\n }\n finally { if (e_6) throw e_6.error; }\n }\n }\n if (recursive === true) {\n try {\n for (var _h = __values$N(this._children), _j = _h.next(); !_j.done; _j = _h.next()) {\n var child = _j.value;\n child.markClean({ force: force });\n }\n }\n catch (e_7_1) { e_7 = { error: e_7_1 }; }\n finally {\n try {\n if (_j && !_j.done && (_b = _h.return)) _b.call(_h);\n }\n finally { if (e_7) throw e_7.error; }\n }\n }\n };\n Node.prototype.visibilityChanged = function () {\n // Override point for sub-classes to react to visibility changes.\n };\n Object.defineProperty(Node.prototype, \"nodeCount\", {\n get: function () {\n var e_8, _a, e_9, _b;\n var count = 1;\n var dirtyCount = this._dirty >= RedrawType.NONE || this.dirtyTransform ? 1 : 0;\n var visibleCount = this.visible ? 1 : 0;\n var countChild = function (child) {\n var _a = child.nodeCount, childCount = _a.count, childVisibleCount = _a.visibleCount, childDirtyCount = _a.dirtyCount;\n count += childCount;\n visibleCount += childVisibleCount;\n dirtyCount += childDirtyCount;\n };\n try {\n for (var _c = __values$N(this._children), _d = _c.next(); !_d.done; _d = _c.next()) {\n var child = _d.value;\n countChild(child);\n }\n }\n catch (e_8_1) { e_8 = { error: e_8_1 }; }\n finally {\n try {\n if (_d && !_d.done && (_a = _c.return)) _a.call(_c);\n }\n finally { if (e_8) throw e_8.error; }\n }\n try {\n for (var _e = __values$N(this._virtualChildren), _f = _e.next(); !_f.done; _f = _e.next()) {\n var child = _f.value;\n countChild(child);\n }\n }\n catch (e_9_1) { e_9 = { error: e_9_1 }; }\n finally {\n try {\n if (_f && !_f.done && (_b = _e.return)) _b.call(_e);\n }\n finally { if (e_9) throw e_9.error; }\n }\n return { count: count, visibleCount: visibleCount, dirtyCount: dirtyCount };\n },\n enumerable: false,\n configurable: true\n });\n Node.prototype.zIndexChanged = function () {\n // Override point for sub-classes.\n };\n Node._nextSerialNumber = 0;\n __decorate$1$([\n SceneChangeDetection({ type: 'transform' })\n ], Node.prototype, \"scalingX\", void 0);\n __decorate$1$([\n SceneChangeDetection({ type: 'transform' })\n ], Node.prototype, \"scalingY\", void 0);\n __decorate$1$([\n SceneChangeDetection({ type: 'transform' })\n ], Node.prototype, \"scalingCenterX\", void 0);\n __decorate$1$([\n SceneChangeDetection({ type: 'transform' })\n ], Node.prototype, \"scalingCenterY\", void 0);\n __decorate$1$([\n SceneChangeDetection({ type: 'transform' })\n ], Node.prototype, \"rotationCenterX\", void 0);\n __decorate$1$([\n SceneChangeDetection({ type: 'transform' })\n ], Node.prototype, \"rotationCenterY\", void 0);\n __decorate$1$([\n SceneChangeDetection({ type: 'transform' })\n ], Node.prototype, \"rotation\", void 0);\n __decorate$1$([\n SceneChangeDetection({ type: 'transform' })\n ], Node.prototype, \"translationX\", void 0);\n __decorate$1$([\n SceneChangeDetection({ type: 'transform' })\n ], Node.prototype, \"translationY\", void 0);\n __decorate$1$([\n SceneChangeDetection({ redraw: RedrawType.MAJOR, changeCb: function (o) { return o.visibilityChanged(); } })\n ], Node.prototype, \"visible\", void 0);\n __decorate$1$([\n SceneChangeDetection({\n redraw: RedrawType.TRIVIAL,\n changeCb: zIndexChangedCallback,\n })\n ], Node.prototype, \"zIndex\", void 0);\n __decorate$1$([\n SceneChangeDetection({\n redraw: RedrawType.TRIVIAL,\n changeCb: zIndexChangedCallback,\n })\n ], Node.prototype, \"zIndexSubOrder\", void 0);\n return Node;\n}(ChangeDetectable));\n\nfunction ascendingStringNumberUndefined(a, b) {\n var diff = 0;\n if (typeof a === 'number' && typeof b === 'number') {\n diff = a - b;\n }\n else if (typeof a === 'string' && typeof b === 'string') {\n diff = a.localeCompare(b);\n }\n else if (a == null && b == null) ;\n else if (a == null) {\n diff = -1;\n }\n else if (b == null) {\n diff = 1;\n }\n else {\n diff = String(a).localeCompare(String(b));\n }\n return diff;\n}\nfunction compoundAscending(a, b, comparator) {\n var toLiteral = function (v) {\n if (typeof v === 'function') {\n return v();\n }\n return v;\n };\n for (var idx in a) {\n var diff = comparator(toLiteral(a[idx]), toLiteral(b[idx]));\n if (diff !== 0) {\n return diff;\n }\n }\n return 0;\n}\n\nvar doOnceFlags$1 = {};\n/**\n * If the key was passed before, then doesn't execute the func\n */\nfunction doOnce$1(func, key) {\n if (doOnceFlags$1[key]) {\n return;\n }\n func();\n doOnceFlags$1[key] = true;\n}\n\nvar __read$17 = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray$F = (undefined && undefined.__spreadArray) || function (to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\n to[j] = from[i];\n return to;\n};\nvar Logger = {\n debug: function () {\n var logContent = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n logContent[_i] = arguments[_i];\n }\n console.log.apply(console, __spreadArray$F([], __read$17(logContent)));\n },\n warn: function (message) {\n var logContent = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n logContent[_i - 1] = arguments[_i];\n }\n console.warn.apply(console, __spreadArray$F([\"AG Charts - \" + message], __read$17(logContent)));\n },\n error: function (message) {\n var logContent = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n logContent[_i - 1] = arguments[_i];\n }\n if (typeof message === 'object') {\n console.error.apply(console, __spreadArray$F([\"AG Charts error\", message], __read$17(logContent)));\n }\n else {\n console.error.apply(console, __spreadArray$F([\"AG Charts - \" + message], __read$17(logContent)));\n }\n },\n warnOnce: function (message) {\n var logContent = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n logContent[_i - 1] = arguments[_i];\n }\n doOnce$1(function () { return Logger.warn.apply(Logger, __spreadArray$F([message], __read$17(logContent))); }, \"Logger.warn: \" + message);\n },\n errorOnce: function (message) {\n var logContent = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n logContent[_i - 1] = arguments[_i];\n }\n doOnce$1(function () { return Logger.error.apply(Logger, __spreadArray$F([message], __read$17(logContent))); }, \"Logger.warn: \" + message);\n },\n};\n\nvar __extends$2M = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign$T = (undefined && undefined.__assign) || function () {\n __assign$T = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$T.apply(this, arguments);\n};\nvar __decorate$1_ = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __values$M = (undefined && undefined.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nvar __read$16 = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray$E = (undefined && undefined.__spreadArray) || function (to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\n to[j] = from[i];\n return to;\n};\nvar Group = /** @class */ (function (_super) {\n __extends$2M(Group, _super);\n function Group(opts) {\n var _a;\n var _this = _super.call(this, { isVirtual: opts === null || opts === void 0 ? void 0 : opts.isVirtual }) || this;\n _this.opts = opts;\n _this.opacity = 1;\n _this.lastBBox = undefined;\n var _b = opts !== null && opts !== void 0 ? opts : {}, zIndex = _b.zIndex, zIndexSubOrder = _b.zIndexSubOrder;\n _this.isContainerNode = true;\n if (zIndex !== undefined) {\n _this.zIndex = zIndex;\n }\n if (zIndexSubOrder !== undefined) {\n _this.zIndexSubOrder = zIndexSubOrder;\n }\n _this.name = (_a = _this.opts) === null || _a === void 0 ? void 0 : _a.name;\n return _this;\n }\n Group.prototype.zIndexChanged = function () {\n var _a;\n if (this.layer) {\n (_a = this._layerManager) === null || _a === void 0 ? void 0 : _a.moveLayer(this.layer, this.zIndex, this.zIndexSubOrder);\n }\n };\n Group.prototype.isLayer = function () {\n return this.layer != null;\n };\n Group.prototype._setLayerManager = function (scene) {\n var _this = this;\n var _a, _b;\n if (this._layerManager && this.layer) {\n this._layerManager.removeLayer(this.layer);\n this.layer = undefined;\n }\n if (this.layer) {\n throw new Error('AG Charts - unable to deregister scene rendering layer!');\n }\n _super.prototype._setLayerManager.call(this, scene);\n if (scene && ((_a = this.opts) === null || _a === void 0 ? void 0 : _a.layer)) {\n var _c = (_b = this.opts) !== null && _b !== void 0 ? _b : {}, zIndex = _c.zIndex, zIndexSubOrder = _c.zIndexSubOrder, name_1 = _c.name;\n var getComputedOpacity = function () { return _this.getComputedOpacity(); };\n var getVisibility = function () { return _this.getVisibility(); };\n this.layer = scene.addLayer({ zIndex: zIndex, zIndexSubOrder: zIndexSubOrder, name: name_1, getComputedOpacity: getComputedOpacity, getVisibility: getVisibility });\n }\n };\n Group.prototype.getComputedOpacity = function () {\n var opacity = 1;\n var node = this;\n do {\n if (node instanceof Group) {\n opacity *= node.opacity;\n }\n } while ((node = node.parent));\n return opacity;\n };\n Group.prototype.getVisibility = function () {\n var node = this;\n var visible = this.visible;\n while ((node = node.parent)) {\n if (node.visible) {\n continue;\n }\n visible = node.visible;\n }\n return visible;\n };\n Group.prototype.visibilityChanged = function () {\n if (this.layer) {\n this.layer.enabled = this.visible;\n }\n };\n Group.prototype.markDirty = function (source, type) {\n if (type === void 0) { type = RedrawType.TRIVIAL; }\n if (this.isVirtual) {\n // Always percolate directly for virtual nodes - they don't exist for rendering purposes.\n _super.prototype.markDirty.call(this, source, type);\n return;\n }\n // Downgrade dirty-ness percolated to parent in special cases.\n var parentType = type;\n if (type < RedrawType.MINOR) {\n parentType = RedrawType.TRIVIAL;\n }\n else if (this.layer != null) {\n parentType = RedrawType.TRIVIAL;\n }\n _super.prototype.markDirty.call(this, source, type, parentType);\n };\n // We consider a group to be boundless, thus any point belongs to it.\n Group.prototype.containsPoint = function (_x, _y) {\n return true;\n };\n Group.prototype.computeBBox = function () {\n this.computeTransformMatrix();\n return Group.computeBBox(this.children);\n };\n Group.prototype.computeTransformedBBox = function () {\n return this.computeBBox();\n };\n Group.prototype.render = function (renderCtx) {\n var e_1, _a, e_2, _b, e_3, _c;\n var _d, _e;\n var _f = this.opts, _g = _f === void 0 ? {} : _f, _h = _g.name, name = _h === void 0 ? undefined : _h;\n var _j = this._debug, _k = _j === void 0 ? {} : _j, _l = _k.consoleLog, consoleLog = _l === void 0 ? false : _l;\n var _m = this, dirty = _m.dirty, dirtyZIndex = _m.dirtyZIndex, layer = _m.layer, children = _m.children, clipRect = _m.clipRect, dirtyTransform = _m.dirtyTransform;\n var ctx = renderCtx.ctx, forceRender = renderCtx.forceRender, clipBBox = renderCtx.clipBBox;\n var resized = renderCtx.resized, stats = renderCtx.stats;\n var canvasCtxTransform = ctx.getTransform();\n var isDirty = dirty >= RedrawType.MINOR || dirtyZIndex || resized;\n var isChildDirty = isDirty;\n var isChildLayerDirty = false;\n try {\n for (var children_1 = __values$M(children), children_1_1 = children_1.next(); !children_1_1.done; children_1_1 = children_1.next()) {\n var child = children_1_1.value;\n isChildDirty || (isChildDirty = child.layerManager == null && child.dirty >= RedrawType.TRIVIAL);\n isChildLayerDirty || (isChildLayerDirty = child.layerManager != null && child.dirty >= RedrawType.TRIVIAL);\n if (isChildDirty) {\n break;\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (children_1_1 && !children_1_1.done && (_a = children_1.return)) _a.call(children_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n if (name && consoleLog) {\n Logger.debug({ name: name, group: this, isDirty: isDirty, isChildDirty: isChildDirty, dirtyTransform: dirtyTransform, renderCtx: renderCtx, forceRender: forceRender });\n }\n if (dirtyTransform) {\n forceRender = 'dirtyTransform';\n }\n else if (layer) {\n // If bounding-box of a layer changes, force re-render.\n var currentBBox = this.computeBBox();\n if (this.lastBBox === undefined || !this.lastBBox.equals(currentBBox)) {\n forceRender = 'dirtyTransform';\n this.lastBBox = currentBBox;\n }\n }\n if (!isDirty && !isChildDirty && !isChildLayerDirty && !forceRender) {\n if (name && consoleLog && stats) {\n var counts = this.nodeCount;\n Logger.debug({ name: name, result: 'skipping', renderCtx: renderCtx, counts: counts, group: this });\n }\n if (layer && stats) {\n stats.layersSkipped++;\n stats.nodesSkipped += this.nodeCount.count;\n }\n this.markClean({ recursive: false });\n // Nothing to do.\n return;\n }\n var groupVisible = this.visible;\n if (layer) {\n // Switch context to the canvas layer we use for this group.\n ctx = layer.context;\n ctx.save();\n ctx.resetTransform();\n if (forceRender !== 'dirtyTransform') {\n forceRender = isChildDirty || dirtyZIndex;\n }\n if (forceRender)\n layer.clear();\n if (clipBBox) {\n // clipBBox is in the canvas coordinate space, when we hit a layer we apply the new clipping at which point there are no transforms in play\n var width = clipBBox.width, height = clipBBox.height, x = clipBBox.x, y = clipBBox.y;\n if (consoleLog) {\n Logger.debug({ name: name, clipBBox: clipBBox, ctxTransform: ctx.getTransform(), renderCtx: renderCtx, group: this });\n }\n this.clipCtx(ctx, x, y, width, height);\n }\n ctx.setTransform(canvasCtxTransform);\n }\n else {\n // Only apply opacity if this isn't a distinct layer - opacity will be applied\n // at composition time.\n ctx.globalAlpha *= this.opacity;\n }\n // A group can have `scaling`, `rotation`, `translation` properties\n // that are applied to the canvas context before children are rendered,\n // so all children can be transformed at once.\n this.computeTransformMatrix();\n this.matrix.toContext(ctx);\n if (clipRect) {\n // clipRect is in the group's coordinate space\n var x = clipRect.x, y = clipRect.y, width = clipRect.width, height = clipRect.height;\n ctx.save();\n if (consoleLog) {\n Logger.debug({ name: name, clipRect: clipRect, ctxTransform: ctx.getTransform(), renderCtx: renderCtx, group: this });\n }\n this.clipCtx(ctx, x, y, width, height);\n // clipBBox is in the canvas coordinate space, when we hit a layer we apply the new clipping at which point there are no transforms in play\n clipBBox = this.matrix.transformBBox(clipRect);\n }\n var hasVirtualChildren = this.hasVirtualChildren();\n if (dirtyZIndex) {\n this.sortChildren(children);\n if (forceRender !== 'dirtyTransform')\n forceRender = true;\n }\n else if (hasVirtualChildren) {\n this.sortChildren(children);\n }\n // Reduce churn if renderCtx is identical.\n var renderContextChanged = forceRender !== renderCtx.forceRender || clipBBox !== renderCtx.clipBBox || ctx !== renderCtx.ctx;\n var childRenderContext = renderContextChanged ? __assign$T(__assign$T({}, renderCtx), { ctx: ctx, forceRender: forceRender, clipBBox: clipBBox }) : renderCtx;\n // Render visible children.\n var skipped = 0;\n try {\n for (var children_2 = __values$M(children), children_2_1 = children_2.next(); !children_2_1.done; children_2_1 = children_2.next()) {\n var child = children_2_1.value;\n if (!child.visible || !groupVisible) {\n // Skip invisible children, but make sure their dirty flag is reset.\n child.markClean();\n if (stats)\n skipped += child.nodeCount.count;\n continue;\n }\n if (!forceRender && child.dirty === RedrawType.NONE) {\n // Skip children that don't need to be redrawn.\n if (stats)\n skipped += child.nodeCount.count;\n continue;\n }\n // Render marks this node (and children) as clean - no need to explicitly markClean().\n ctx.save();\n child.render(childRenderContext);\n ctx.restore();\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (children_2_1 && !children_2_1.done && (_b = children_2.return)) _b.call(children_2);\n }\n finally { if (e_2) throw e_2.error; }\n }\n if (stats)\n stats.nodesSkipped += skipped;\n // Render marks this node as clean - no need to explicitly markClean().\n _super.prototype.render.call(this, renderCtx);\n if (clipRect) {\n ctx.restore();\n }\n if (hasVirtualChildren) {\n try {\n // Mark virtual nodes as clean and their virtual children - all other nodes have already\n // been visited and marked clean.\n for (var _o = __values$M(this.virtualChildren), _p = _o.next(); !_p.done; _p = _o.next()) {\n var child = _p.value;\n child.markClean({ recursive: 'virtual' });\n }\n }\n catch (e_3_1) { e_3 = { error: e_3_1 }; }\n finally {\n try {\n if (_p && !_p.done && (_c = _o.return)) _c.call(_o);\n }\n finally { if (e_3) throw e_3.error; }\n }\n }\n if (layer) {\n if (stats)\n stats.layersRendered++;\n ctx.restore();\n if (forceRender)\n layer.snapshot();\n // Check for save/restore depth of zero!\n (_e = (_d = layer.context).verifyDepthZero) === null || _e === void 0 ? void 0 : _e.call(_d);\n }\n if (name && consoleLog && stats) {\n var counts = this.nodeCount;\n Logger.debug({ name: name, result: 'rendered', skipped: skipped, renderCtx: renderCtx, counts: counts, group: this });\n }\n };\n Group.prototype.sortChildren = function (children) {\n this.dirtyZIndex = false;\n children.sort(function (a, b) {\n var _a, _b;\n return compoundAscending(__spreadArray$E(__spreadArray$E([a.zIndex], __read$16(((_a = a.zIndexSubOrder) !== null && _a !== void 0 ? _a : [undefined, undefined]))), [a.serialNumber]), __spreadArray$E(__spreadArray$E([b.zIndex], __read$16(((_b = b.zIndexSubOrder) !== null && _b !== void 0 ? _b : [undefined, undefined]))), [b.serialNumber]), ascendingStringNumberUndefined);\n });\n };\n Group.prototype.clipCtx = function (ctx, x, y, width, height) {\n ctx.beginPath();\n ctx.moveTo(x, y);\n ctx.lineTo(x + width, y);\n ctx.lineTo(x + width, y + height);\n ctx.lineTo(x, y + height);\n ctx.closePath();\n ctx.clip();\n };\n Group.computeBBox = function (nodes) {\n var left = Infinity;\n var right = -Infinity;\n var top = Infinity;\n var bottom = -Infinity;\n nodes.forEach(function (n) {\n if (!n.visible) {\n return;\n }\n var bbox = n.computeTransformedBBox();\n if (!bbox) {\n return;\n }\n var x = bbox.x;\n var y = bbox.y;\n if (x < left) {\n left = x;\n }\n if (y < top) {\n top = y;\n }\n if (x + bbox.width > right) {\n right = x + bbox.width;\n }\n if (y + bbox.height > bottom) {\n bottom = y + bbox.height;\n }\n });\n return new BBox(left, top, right - left, bottom - top);\n };\n /**\n * Transforms bbox given in the canvas coordinate space to bbox in this group's coordinate space and\n * sets this group's clipRect to the transformed bbox.\n * @param bbox clipRect bbox in the canvas coordinate space.\n */\n Group.prototype.setClipRectInGroupCoordinateSpace = function (bbox) {\n this.clipRect = bbox ? this.transformBBox(bbox) : undefined;\n };\n Group.className = 'Group';\n __decorate$1_([\n SceneChangeDetection({\n redraw: RedrawType.MAJOR,\n convertor: function (v) { return Math.min(1, Math.max(0, v)); },\n })\n ], Group.prototype, \"opacity\", void 0);\n return Group;\n}(Node));\n\n/**\n * Wraps a native OffscreenCanvas and overrides its OffscreenCanvasRenderingContext2D to\n * provide resolution independent rendering based on `window.devicePixelRatio`.\n */\nvar HdpiOffscreenCanvas = /** @class */ (function () {\n // The width/height attributes of the Canvas element default to\n // 300/150 according to w3.org.\n function HdpiOffscreenCanvas(_a) {\n var _b = _a.width, width = _b === void 0 ? 600 : _b, _c = _a.height, height = _c === void 0 ? 300 : _c, _d = _a.overrideDevicePixelRatio, overrideDevicePixelRatio = _d === void 0 ? undefined : _d;\n this.enabled = true;\n // `NaN` is deliberate here, so that overrides are always applied\n // and the `resetTransform` inside the `resize` method works in IE11.\n this._pixelRatio = NaN;\n this._width = 0;\n this._height = 0;\n this.canvas = new OffscreenCanvas(width, height);\n this.context = this.canvas.getContext('2d');\n this.imageSource = this.canvas.transferToImageBitmap();\n this.setPixelRatio(overrideDevicePixelRatio);\n this.resize(width, height);\n }\n HdpiOffscreenCanvas.isSupported = function () {\n return window['OffscreenCanvas'] != null;\n };\n HdpiOffscreenCanvas.prototype.snapshot = function () {\n this.imageSource.close();\n this.imageSource = this.canvas.transferToImageBitmap();\n };\n HdpiOffscreenCanvas.prototype.destroy = function () {\n this.imageSource.close();\n // Workaround memory allocation quirks in iOS Safari by resizing to 0x0 and clearing.\n // See https://bugs.webkit.org/show_bug.cgi?id=195325.\n this.canvas.width = 0;\n this.canvas.height = 0;\n this.context.clearRect(0, 0, 0, 0);\n };\n HdpiOffscreenCanvas.prototype.clear = function () {\n this.context.save();\n this.context.resetTransform();\n this.context.clearRect(0, 0, this.width, this.height);\n this.context.restore();\n };\n Object.defineProperty(HdpiOffscreenCanvas.prototype, \"pixelRatio\", {\n get: function () {\n return this._pixelRatio;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Changes the pixel ratio of the Canvas element to the given value,\n * or uses the window.devicePixelRatio (default), then resizes the Canvas\n * element accordingly (default).\n */\n HdpiOffscreenCanvas.prototype.setPixelRatio = function (ratio) {\n var pixelRatio = ratio !== null && ratio !== void 0 ? ratio : window.devicePixelRatio;\n if (!isDesktop()) {\n // Mobile browsers have stricter memory limits, we reduce rendering resolution to\n // improve stability on mobile browsers. iOS Safari 12->16 are pain-points since they\n // have memory allocation quirks - see https://bugs.webkit.org/show_bug.cgi?id=195325.\n pixelRatio = 1;\n }\n HdpiCanvas.overrideScale(this.context, pixelRatio);\n this._pixelRatio = pixelRatio;\n };\n Object.defineProperty(HdpiOffscreenCanvas.prototype, \"width\", {\n get: function () {\n return this._width;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(HdpiOffscreenCanvas.prototype, \"height\", {\n get: function () {\n return this._height;\n },\n enumerable: false,\n configurable: true\n });\n HdpiOffscreenCanvas.prototype.resize = function (width, height) {\n if (!(width > 0 && height > 0)) {\n return;\n }\n var _a = this, canvas = _a.canvas, context = _a.context, pixelRatio = _a.pixelRatio;\n canvas.width = Math.round(width * pixelRatio);\n canvas.height = Math.round(height * pixelRatio);\n context.resetTransform();\n this._width = width;\n this._height = height;\n };\n return HdpiOffscreenCanvas;\n}());\n\nfunction windowValue(name) {\n /**\n * Redeclaration of window that is safe for use with Gatsby server-side (webpack) compilation.\n */\n var WINDOW = typeof window !== 'undefined'\n ? window\n : // typeof global !== 'undefined' ? (global as any) :\n undefined;\n return WINDOW === null || WINDOW === void 0 ? void 0 : WINDOW[name];\n}\n\nvar SceneDebugLevel;\n(function (SceneDebugLevel) {\n SceneDebugLevel[SceneDebugLevel[\"SUMMARY\"] = 0] = \"SUMMARY\";\n SceneDebugLevel[SceneDebugLevel[\"DETAILED\"] = 1] = \"DETAILED\";\n})(SceneDebugLevel || (SceneDebugLevel = {}));\n\nvar __assign$S = (undefined && undefined.__assign) || function () {\n __assign$S = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$S.apply(this, arguments);\n};\nvar __awaiter$g = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator$g = (undefined && undefined.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nvar __read$15 = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray$D = (undefined && undefined.__spreadArray) || function (to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\n to[j] = from[i];\n return to;\n};\nvar __values$L = (undefined && undefined.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nfunction buildSceneNodeHighlight() {\n var _a;\n var config = (_a = windowValue('agChartsSceneDebug')) !== null && _a !== void 0 ? _a : [];\n if (typeof config === 'string') {\n config = [config];\n }\n var result = [];\n config.forEach(function (name) {\n if (name === 'layout') {\n result.push('seriesRoot', 'legend', 'root', /.*Axis-\\d+-axis.*/);\n }\n else {\n result.push(name);\n }\n });\n return result;\n}\nvar Scene = /** @class */ (function () {\n function Scene(opts) {\n var _a, _b, _c;\n this.id = createId$1(this);\n this.layers = [];\n this._nextZIndex = 0;\n this._nextLayerId = 0;\n this._dirty = false;\n this._root = null;\n this.debug = {\n dirtyTree: false,\n stats: false,\n renderBoundingBoxes: false,\n consoleLog: false,\n level: SceneDebugLevel.SUMMARY,\n sceneNodeHighlight: [],\n };\n var _d = opts.document, document = _d === void 0 ? window.document : _d, _e = opts.mode, mode = _e === void 0 ? (_a = windowValue('agChartsSceneRenderModel')) !== null && _a !== void 0 ? _a : 'adv-composite' : _e, width = opts.width, height = opts.height, _f = opts.overrideDevicePixelRatio, overrideDevicePixelRatio = _f === void 0 ? undefined : _f;\n this.overrideDevicePixelRatio = overrideDevicePixelRatio;\n this.opts = { document: document, mode: mode };\n this.debug.consoleLog = [true, 'scene'].includes(windowValue('agChartsDebug'));\n this.debug.level = ['scene'].includes(windowValue('agChartsDebug'))\n ? SceneDebugLevel.DETAILED\n : SceneDebugLevel.SUMMARY;\n this.debug.stats = (_b = windowValue('agChartsSceneStats')) !== null && _b !== void 0 ? _b : false;\n this.debug.dirtyTree = (_c = windowValue('agChartsSceneDirtyTree')) !== null && _c !== void 0 ? _c : false;\n this.debug.sceneNodeHighlight = buildSceneNodeHighlight();\n this.canvas = new HdpiCanvas({ document: document, width: width, height: height, overrideDevicePixelRatio: overrideDevicePixelRatio });\n }\n Object.defineProperty(Scene.prototype, \"container\", {\n get: function () {\n return this.canvas.container;\n },\n set: function (value) {\n this.canvas.container = value;\n },\n enumerable: false,\n configurable: true\n });\n Scene.prototype.download = function (fileName, fileFormat) {\n this.canvas.download(fileName, fileFormat);\n };\n Scene.prototype.getDataURL = function (type) {\n return this.canvas.getDataURL(type);\n };\n Object.defineProperty(Scene.prototype, \"width\", {\n get: function () {\n return this.pendingSize ? this.pendingSize[0] : this.canvas.width;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Scene.prototype, \"height\", {\n get: function () {\n return this.pendingSize ? this.pendingSize[1] : this.canvas.height;\n },\n enumerable: false,\n configurable: true\n });\n Scene.prototype.resize = function (width, height) {\n width = Math.round(width);\n height = Math.round(height);\n // HdpiCanvas doesn't allow width/height <= 0.\n var lessThanZero = width <= 0 || height <= 0;\n var nan = isNaN(width) || isNaN(height);\n var unchanged = width === this.width && height === this.height;\n if (unchanged || nan || lessThanZero) {\n return false;\n }\n this.pendingSize = [width, height];\n this.markDirty();\n return true;\n };\n Scene.prototype.addLayer = function (opts) {\n var _a;\n var mode = this.opts.mode;\n var layeredModes = ['composite', 'dom-composite', 'adv-composite'];\n if (!layeredModes.includes(mode)) {\n return undefined;\n }\n var _b = opts.zIndex, zIndex = _b === void 0 ? this._nextZIndex++ : _b, name = opts.name, zIndexSubOrder = opts.zIndexSubOrder, getComputedOpacity = opts.getComputedOpacity, getVisibility = opts.getVisibility;\n var _c = this, width = _c.width, height = _c.height, overrideDevicePixelRatio = _c.overrideDevicePixelRatio;\n var domLayer = mode === 'dom-composite';\n var advLayer = mode === 'adv-composite';\n var canvas = !advLayer || !HdpiOffscreenCanvas.isSupported()\n ? new HdpiCanvas({\n document: this.opts.document,\n width: width,\n height: height,\n domLayer: domLayer,\n zIndex: zIndex,\n name: name,\n overrideDevicePixelRatio: overrideDevicePixelRatio,\n })\n : new HdpiOffscreenCanvas({\n width: width,\n height: height,\n overrideDevicePixelRatio: overrideDevicePixelRatio,\n });\n var newLayer = {\n id: this._nextLayerId++,\n name: name,\n zIndex: zIndex,\n zIndexSubOrder: zIndexSubOrder,\n canvas: canvas,\n getComputedOpacity: getComputedOpacity,\n getVisibility: getVisibility,\n };\n if (zIndex >= this._nextZIndex) {\n this._nextZIndex = zIndex + 1;\n }\n this.layers.push(newLayer);\n this.sortLayers();\n if (domLayer) {\n var domCanvases = this.layers\n .map(function (v) { return v.canvas; })\n .filter(function (v) { return v instanceof HdpiCanvas; });\n var newLayerIndex = domCanvases.findIndex(function (v) { return v === canvas; });\n var lastLayer = (_a = domCanvases[newLayerIndex - 1]) !== null && _a !== void 0 ? _a : this.canvas;\n lastLayer.element.insertAdjacentElement('afterend', canvas.element);\n }\n if (this.debug.consoleLog) {\n Logger.debug('Scene.addLayer() - layers', this.layers);\n }\n return newLayer.canvas;\n };\n Scene.prototype.removeLayer = function (canvas) {\n var index = this.layers.findIndex(function (l) { return l.canvas === canvas; });\n if (index >= 0) {\n this.layers.splice(index, 1);\n canvas.destroy();\n this.markDirty();\n if (this.debug.consoleLog) {\n Logger.debug('Scene.removeLayer() - layers', this.layers);\n }\n }\n };\n Scene.prototype.moveLayer = function (canvas, newZIndex, newZIndexSubOrder) {\n var layer = this.layers.find(function (l) { return l.canvas === canvas; });\n if (layer) {\n layer.zIndex = newZIndex;\n layer.zIndexSubOrder = newZIndexSubOrder;\n this.sortLayers();\n this.markDirty();\n if (this.debug.consoleLog) {\n Logger.debug('Scene.moveLayer() - layers', this.layers);\n }\n }\n };\n Scene.prototype.sortLayers = function () {\n this.layers.sort(function (a, b) {\n var _a, _b;\n return compoundAscending(__spreadArray$D(__spreadArray$D([a.zIndex], __read$15(((_a = a.zIndexSubOrder) !== null && _a !== void 0 ? _a : [undefined, undefined]))), [a.id]), __spreadArray$D(__spreadArray$D([b.zIndex], __read$15(((_b = b.zIndexSubOrder) !== null && _b !== void 0 ? _b : [undefined, undefined]))), [b.id]), ascendingStringNumberUndefined);\n });\n };\n Scene.prototype.markDirty = function () {\n this._dirty = true;\n };\n Object.defineProperty(Scene.prototype, \"dirty\", {\n get: function () {\n return this._dirty;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Scene.prototype, \"root\", {\n get: function () {\n return this._root;\n },\n set: function (node) {\n var _this = this;\n if (node === this._root) {\n return;\n }\n if (this._root) {\n this._root._setLayerManager();\n }\n this._root = node;\n if (node) {\n // If `node` is the root node of another scene ...\n if (node.parent === null && node.layerManager && node.layerManager !== this) {\n node.layerManager.root = null;\n }\n node._setLayerManager({\n addLayer: function (opts) { return _this.addLayer(opts); },\n moveLayer: function () {\n var opts = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n opts[_i] = arguments[_i];\n }\n return _this.moveLayer.apply(_this, __spreadArray$D([], __read$15(opts)));\n },\n removeLayer: function () {\n var opts = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n opts[_i] = arguments[_i];\n }\n return _this.removeLayer.apply(_this, __spreadArray$D([], __read$15(opts)));\n },\n markDirty: function () { return _this.markDirty(); },\n canvas: this.canvas,\n debug: __assign$S(__assign$S({}, this.debug), { consoleLog: this.debug.level >= SceneDebugLevel.DETAILED }),\n });\n }\n this.markDirty();\n },\n enumerable: false,\n configurable: true\n });\n /** Alternative to destroy() that preserves re-usable resources. */\n Scene.prototype.strip = function () {\n var e_1, _a;\n var layers = this.layers;\n try {\n for (var layers_1 = __values$L(layers), layers_1_1 = layers_1.next(); !layers_1_1.done; layers_1_1 = layers_1.next()) {\n var layer = layers_1_1.value;\n layer.canvas.destroy();\n delete layer['canvas'];\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (layers_1_1 && !layers_1_1.done && (_a = layers_1.return)) _a.call(layers_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n layers.splice(0, layers.length);\n this.root = null;\n this._dirty = false;\n this.canvas.context.resetTransform();\n };\n Scene.prototype.destroy = function () {\n this.container = undefined;\n this.strip();\n this.canvas.destroy();\n Object.assign(this, { canvas: undefined, ctx: undefined });\n };\n Scene.prototype.render = function (opts) {\n var _a;\n return __awaiter$g(this, void 0, void 0, function () {\n var _b, _c, debugSplitTimes, _d, extraDebugStats, _e, canvas, ctx, root, layers, pendingSize, mode, renderCtx, canvasCleared, _f, dirtyTree, paths;\n var _g;\n return __generator$g(this, function (_h) {\n _b = opts !== null && opts !== void 0 ? opts : {}, _c = _b.debugSplitTimes, debugSplitTimes = _c === void 0 ? [performance.now()] : _c, _d = _b.extraDebugStats, extraDebugStats = _d === void 0 ? {} : _d;\n _e = this, canvas = _e.canvas, ctx = _e.canvas.context, root = _e.root, layers = _e.layers, pendingSize = _e.pendingSize, mode = _e.opts.mode;\n if (pendingSize) {\n (_g = this.canvas).resize.apply(_g, __spreadArray$D([], __read$15(pendingSize)));\n this.layers.forEach(function (layer) {\n var _a;\n return (_a = layer.canvas).resize.apply(_a, __spreadArray$D([], __read$15(pendingSize)));\n });\n this.pendingSize = undefined;\n }\n if (root && !root.visible) {\n this._dirty = false;\n return [2 /*return*/];\n }\n if (root && !this.dirty) {\n if (this.debug.consoleLog) {\n Logger.debug('Scene.render() - no-op', {\n redrawType: RedrawType[root.dirty],\n tree: this.buildTree(root),\n });\n }\n this.debugStats(debugSplitTimes, ctx, undefined, extraDebugStats);\n return [2 /*return*/];\n }\n renderCtx = {\n ctx: ctx,\n forceRender: true,\n resized: !!pendingSize,\n debugNodes: {},\n };\n if (this.debug.stats === 'detailed') {\n renderCtx.stats = { layersRendered: 0, layersSkipped: 0, nodesRendered: 0, nodesSkipped: 0 };\n }\n canvasCleared = false;\n if (!root || root.dirty >= RedrawType.TRIVIAL) {\n // start with a blank canvas, clear previous drawing\n canvasCleared = true;\n canvas.clear();\n }\n if (root && this.debug.dirtyTree) {\n _f = this.buildDirtyTree(root), dirtyTree = _f.dirtyTree, paths = _f.paths;\n Logger.debug('Scene.render() - dirtyTree', { dirtyTree: dirtyTree, paths: paths });\n }\n if (root && canvasCleared) {\n if (this.debug.consoleLog) {\n Logger.debug('Scene.render() - before', {\n redrawType: RedrawType[root.dirty],\n canvasCleared: canvasCleared,\n tree: this.buildTree(root),\n });\n }\n if (root.visible) {\n ctx.save();\n root.render(renderCtx);\n ctx.restore();\n }\n }\n if (mode !== 'dom-composite' && layers.length > 0 && canvasCleared) {\n this.sortLayers();\n ctx.save();\n ctx.setTransform(1 / canvas.pixelRatio, 0, 0, 1 / canvas.pixelRatio, 0, 0);\n layers.forEach(function (_a) {\n var _b = _a.canvas, imageSource = _b.imageSource, enabled = _b.enabled, getComputedOpacity = _a.getComputedOpacity, getVisibility = _a.getVisibility;\n if (!enabled || !getVisibility()) {\n return;\n }\n ctx.globalAlpha = getComputedOpacity();\n ctx.drawImage(imageSource, 0, 0);\n });\n ctx.restore();\n }\n // Check for save/restore depth of zero!\n (_a = ctx.verifyDepthZero) === null || _a === void 0 ? void 0 : _a.call(ctx);\n this._dirty = false;\n this.debugStats(debugSplitTimes, ctx, renderCtx.stats, extraDebugStats);\n this.debugSceneNodeHighlight(ctx, this.debug.sceneNodeHighlight, renderCtx.debugNodes);\n if (root && this.debug.consoleLog) {\n Logger.debug('Scene.render() - after', {\n redrawType: RedrawType[root.dirty],\n canvasCleared: canvasCleared,\n tree: this.buildTree(root),\n });\n }\n return [2 /*return*/];\n });\n });\n };\n Scene.prototype.debugStats = function (debugSplitTimes, ctx, renderCtxStats, extraDebugStats) {\n var e_2, _a;\n if (extraDebugStats === void 0) { extraDebugStats = {}; }\n var end = performance.now();\n if (this.debug.stats) {\n var start = debugSplitTimes[0];\n debugSplitTimes.push(end);\n var pct = function (rendered, skipped) {\n var total = rendered + skipped;\n return rendered + \" / \" + total + \" (\" + Math.round((100 * rendered) / total) + \"%)\";\n };\n var time_1 = function (start, end) {\n return Math.round((end - start) * 100) / 100 + \"ms\";\n };\n var _b = renderCtxStats !== null && renderCtxStats !== void 0 ? renderCtxStats : {}, _c = _b.layersRendered, layersRendered = _c === void 0 ? 0 : _c, _d = _b.layersSkipped, layersSkipped = _d === void 0 ? 0 : _d, _e = _b.nodesRendered, nodesRendered = _e === void 0 ? 0 : _e, _f = _b.nodesSkipped, nodesSkipped = _f === void 0 ? 0 : _f;\n var splits = debugSplitTimes\n .map(function (t, i) { return (i > 0 ? time_1(debugSplitTimes[i - 1], t) : null); })\n .filter(function (v) { return v != null; })\n .join(' + ');\n var extras = Object.entries(extraDebugStats)\n .map(function (_a) {\n var _b = __read$15(_a, 2), k = _b[0], v = _b[1];\n return k + \": \" + v;\n })\n .join(' ; ');\n var stats = [\n time_1(start, end) + \" (\" + splits + \")\",\n \"\" + extras,\n this.debug.stats === 'detailed' ? \"Layers: \" + pct(layersRendered, layersSkipped) : null,\n this.debug.stats === 'detailed' ? \"Nodes: \" + pct(nodesRendered, nodesSkipped) : null,\n ].filter(function (v) { return v != null; });\n var statsSize = stats.map(function (t) { return [t, HdpiCanvas.getTextSize(t, ctx.font)]; });\n var width = Math.max.apply(Math, __spreadArray$D([], __read$15(statsSize.map(function (_a) {\n var _b = __read$15(_a, 2), width = _b[1].width;\n return width;\n }))));\n var height = statsSize.reduce(function (total, _a) {\n var _b = __read$15(_a, 2), height = _b[1].height;\n return total + height;\n }, 0);\n ctx.save();\n ctx.fillStyle = 'white';\n ctx.fillRect(0, 0, width, height);\n ctx.fillStyle = 'black';\n var y = 0;\n try {\n for (var statsSize_1 = __values$L(statsSize), statsSize_1_1 = statsSize_1.next(); !statsSize_1_1.done; statsSize_1_1 = statsSize_1.next()) {\n var _g = __read$15(statsSize_1_1.value, 2), stat = _g[0], size = _g[1];\n y += size.height;\n ctx.fillText(stat, 2, y);\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (statsSize_1_1 && !statsSize_1_1.done && (_a = statsSize_1.return)) _a.call(statsSize_1);\n }\n finally { if (e_2) throw e_2.error; }\n }\n ctx.restore();\n }\n };\n Scene.prototype.debugSceneNodeHighlight = function (ctx, sceneNodeHighlight, debugNodes) {\n var e_3, _a, e_4, _b, e_5, _c;\n var _d;\n var regexpPredicate = function (matcher) { return function (n) {\n if (matcher.test(n.id)) {\n return true;\n }\n return n instanceof Group && n.name != null && matcher.test(n.name);\n }; };\n var stringPredicate = function (match) { return function (n) {\n if (match === n.id) {\n return true;\n }\n return n instanceof Group && n.name != null && match === n.name;\n }; };\n try {\n for (var sceneNodeHighlight_1 = __values$L(sceneNodeHighlight), sceneNodeHighlight_1_1 = sceneNodeHighlight_1.next(); !sceneNodeHighlight_1_1.done; sceneNodeHighlight_1_1 = sceneNodeHighlight_1.next()) {\n var next = sceneNodeHighlight_1_1.value;\n if (typeof next === 'string' && debugNodes[next] != null)\n continue;\n var predicate = typeof next === 'string' ? stringPredicate(next) : regexpPredicate(next);\n var nodes = (_d = this.root) === null || _d === void 0 ? void 0 : _d.findNodes(predicate);\n if (!nodes || nodes.length === 0) {\n Logger.debug(\"Scene.render() - no debugging node with id [\" + next + \"] in scene graph.\");\n continue;\n }\n try {\n for (var nodes_1 = (e_4 = void 0, __values$L(nodes)), nodes_1_1 = nodes_1.next(); !nodes_1_1.done; nodes_1_1 = nodes_1.next()) {\n var node = nodes_1_1.value;\n if (node instanceof Group && node.name) {\n debugNodes[node.name] = node;\n }\n else {\n debugNodes[node.id] = node;\n }\n }\n }\n catch (e_4_1) { e_4 = { error: e_4_1 }; }\n finally {\n try {\n if (nodes_1_1 && !nodes_1_1.done && (_b = nodes_1.return)) _b.call(nodes_1);\n }\n finally { if (e_4) throw e_4.error; }\n }\n }\n }\n catch (e_3_1) { e_3 = { error: e_3_1 }; }\n finally {\n try {\n if (sceneNodeHighlight_1_1 && !sceneNodeHighlight_1_1.done && (_a = sceneNodeHighlight_1.return)) _a.call(sceneNodeHighlight_1);\n }\n finally { if (e_3) throw e_3.error; }\n }\n ctx.save();\n try {\n for (var _e = __values$L(Object.entries(debugNodes)), _f = _e.next(); !_f.done; _f = _e.next()) {\n var _g = __read$15(_f.value, 2), name_1 = _g[0], node = _g[1];\n var bbox = node.computeTransformedBBox();\n if (!bbox) {\n Logger.debug(\"Scene.render() - no bbox for debugged node [\" + name_1 + \"].\");\n continue;\n }\n ctx.globalAlpha = 0.8;\n ctx.strokeStyle = 'red';\n ctx.lineWidth = 1;\n ctx.strokeRect(bbox.x, bbox.y, bbox.width, bbox.height);\n ctx.fillStyle = 'red';\n ctx.strokeStyle = 'white';\n ctx.font = '16px sans-serif';\n ctx.textBaseline = 'top';\n ctx.textAlign = 'left';\n ctx.lineWidth = 2;\n ctx.strokeText(name_1, bbox.x, bbox.y, bbox.width);\n ctx.fillText(name_1, bbox.x, bbox.y, bbox.width);\n }\n }\n catch (e_5_1) { e_5 = { error: e_5_1 }; }\n finally {\n try {\n if (_f && !_f.done && (_c = _e.return)) _c.call(_e);\n }\n finally { if (e_5) throw e_5.error; }\n }\n ctx.restore();\n };\n Scene.prototype.buildTree = function (node) {\n var _this = this;\n var _a, _b;\n var name = (_a = (node instanceof Group ? node.name : null)) !== null && _a !== void 0 ? _a : node.id;\n return __assign$S(__assign$S({ name: name, node: node, dirty: RedrawType[node.dirty] }, (((_b = node.parent) === null || _b === void 0 ? void 0 : _b.isVirtual)\n ? {\n virtualParentDirty: RedrawType[node.parent.dirty],\n virtualParent: node.parent,\n }\n : {})), node.children\n .map(function (c) { return _this.buildTree(c); })\n .reduce(function (result, childTree) {\n var treeNodeName = childTree.name;\n var _a = childTree.node, visible = _a.visible, opacity = _a.opacity, zIndex = _a.zIndex, zIndexSubOrder = _a.zIndexSubOrder, childNode = childTree.node, virtualParent = childTree.virtualParent;\n if (!visible || opacity <= 0) {\n treeNodeName = \"(\" + treeNodeName + \")\";\n }\n if (childNode instanceof Group && childNode.isLayer()) {\n treeNodeName = \"*\" + treeNodeName + \"*\";\n }\n var key = [\n \"\" + (treeNodeName !== null && treeNodeName !== void 0 ? treeNodeName : ''),\n \"z: \" + zIndex,\n zIndexSubOrder &&\n \"zo: \" + zIndexSubOrder\n .map(function (v) { return (typeof v === 'function' ? v() + \" (fn)\" : v); })\n .join(' / '),\n virtualParent && \"(virtual parent)\",\n ]\n .filter(function (v) { return !!v; })\n .join(' ');\n var selectedKey = key;\n var index = 1;\n while (result[selectedKey] != null && index < 100) {\n selectedKey = key + \" (\" + index++ + \")\";\n }\n result[selectedKey] = childTree;\n return result;\n }, {}));\n };\n Scene.prototype.buildDirtyTree = function (node) {\n var _this = this;\n var _a;\n if (node.dirty === RedrawType.NONE) {\n return { dirtyTree: {}, paths: [] };\n }\n var childrenDirtyTree = node.children.map(function (c) { return _this.buildDirtyTree(c); }).filter(function (c) { return c.paths.length > 0; });\n var name = (_a = (node instanceof Group ? node.name : null)) !== null && _a !== void 0 ? _a : node.id;\n var paths = childrenDirtyTree.length === 0\n ? [name]\n : childrenDirtyTree\n .map(function (c) { return c.paths; })\n .reduce(function (r, p) { return r.concat(p); }, [])\n .map(function (p) { return name + \".\" + p; });\n return {\n dirtyTree: __assign$S({ name: name, node: node, dirty: RedrawType[node.dirty] }, childrenDirtyTree\n .map(function (c) { return c.dirtyTree; })\n .filter(function (t) { return t.dirty !== undefined; })\n .reduce(function (result, childTree) {\n var _a;\n result[(_a = childTree.name) !== null && _a !== void 0 ? _a : ''] = childTree;\n return result;\n }, {})),\n paths: paths,\n };\n };\n Scene.className = 'Scene';\n return Scene;\n}());\n\nvar Gradient = /** @class */ (function () {\n function Gradient() {\n this.stops = [];\n }\n return Gradient;\n}());\n\nvar twoPi = Math.PI * 2;\n/**\n * Normalize the given angle to be in the [0, 2π) interval.\n * @param radians Angle in radians.\n */\nfunction normalizeAngle360(radians) {\n radians %= twoPi;\n radians += twoPi;\n radians %= twoPi;\n return radians;\n}\n/**\n * Normalize the given angle to be in the [-π, π) interval.\n * @param radians Angle in radians.\n */\nfunction normalizeAngle180(radians) {\n radians %= twoPi;\n if (radians < -Math.PI) {\n radians += twoPi;\n }\n else if (radians >= Math.PI) {\n radians -= twoPi;\n }\n return radians;\n}\nfunction toRadians$1(degrees) {\n return (degrees / 180) * Math.PI;\n}\n\nvar __extends$2L = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar LinearGradient = /** @class */ (function (_super) {\n __extends$2L(LinearGradient, _super);\n function LinearGradient() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.angle = 0;\n return _this;\n }\n LinearGradient.prototype.createGradient = function (ctx, bbox) {\n // Gradient 0° angle starts at top according to CSS spec\n var angleOffset = 90;\n var _a = this, stops = _a.stops, angle = _a.angle;\n var radians = normalizeAngle360(toRadians$1(angle + angleOffset));\n var cos = Math.cos(radians);\n var sin = Math.sin(radians);\n var w = bbox.width;\n var h = bbox.height;\n var cx = bbox.x + w * 0.5;\n var cy = bbox.y + h * 0.5;\n if (w > 0 && h > 0) {\n var diagonal = Math.sqrt(h * h + w * w) / 2;\n var diagonalAngle = Math.atan2(h, w);\n var quarteredAngle = void 0;\n if (radians < Math.PI / 2) {\n quarteredAngle = radians;\n }\n else if (radians < Math.PI) {\n quarteredAngle = Math.PI - radians;\n }\n else if (radians < (3 * Math.PI) / 2) {\n quarteredAngle = radians - Math.PI;\n }\n else {\n quarteredAngle = 2 * Math.PI - radians;\n }\n var l = diagonal * Math.abs(Math.cos(quarteredAngle - diagonalAngle));\n var gradient_1 = ctx.createLinearGradient(cx + cos * l, cy + sin * l, cx - cos * l, cy - sin * l);\n stops.forEach(function (stop) {\n gradient_1.addColorStop(stop.offset, stop.color);\n });\n return gradient_1;\n }\n return 'black';\n };\n return LinearGradient;\n}(Gradient));\n\nvar __extends$2K = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$1Z = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar LINEAR_GRADIENT_REGEXP = /^linear-gradient\\((.*?)deg,\\s*(.*?)\\s*\\)$/i;\nvar Shape = /** @class */ (function (_super) {\n __extends$2K(Shape, _super);\n function Shape() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.lastInstanceId = 0;\n _this.fillOpacity = 1;\n _this.strokeOpacity = 1;\n _this.fill = Shape.defaultStyles.fill;\n /**\n * Note that `strokeStyle = null` means invisible stroke,\n * while `lineWidth = 0` means no stroke, and sometimes this can mean different things.\n * For example, a rect shape with an invisible stroke may not align to the pixel grid\n * properly because the stroke affects the rules of alignment, and arc shapes forming\n * a pie chart will have a gap between them if they have an invisible stroke, whereas\n * there would be not gap if there was no stroke at all.\n * The preferred way of making the stroke invisible is setting the `lineWidth` to zero,\n * unless specific looks that is achieved by having an invisible stroke is desired.\n */\n _this.stroke = Shape.defaultStyles.stroke;\n _this.strokeWidth = Shape.defaultStyles.strokeWidth;\n _this.lineDash = Shape.defaultStyles.lineDash;\n _this.lineDashOffset = Shape.defaultStyles.lineDashOffset;\n _this.lineCap = Shape.defaultStyles.lineCap;\n _this.lineJoin = Shape.defaultStyles.lineJoin;\n _this.opacity = Shape.defaultStyles.opacity;\n _this.fillShadow = Shape.defaultStyles.fillShadow;\n return _this;\n }\n /**\n * Creates a light-weight instance of the given shape (that serves as a template).\n * The created instance only stores the properites set on the instance itself\n * and the rest of the properties come via the prototype chain from the template.\n * This can greatly reduce memory usage in cases where one has many similar shapes,\n * for example, circles of different size, position and color. The exact memory usage\n * reduction will depend on the size of the template and the number of own properties\n * set on its lightweight instances, but will typically be around an order of magnitude\n * or more.\n *\n * Note: template shapes are not supposed to be part of the scene graph (they should not\n * have a parent).\n *\n * @param template\n */\n Shape.createInstance = function (template) {\n var shape = Object.create(template);\n shape._setParent(undefined);\n shape.id = template.id + '-Instance-' + String(++template.lastInstanceId);\n return shape;\n };\n /**\n * Restores the default styles introduced by this subclass.\n */\n Shape.prototype.restoreOwnStyles = function () {\n var styles = this.constructor.defaultStyles;\n var keys = Object.getOwnPropertyNames(styles);\n // getOwnPropertyNames is about 2.5 times faster than\n // for..in with the hasOwnProperty check and in this\n // case, where most properties are inherited, can be\n // more then an order of magnitude faster.\n for (var i = 0, n = keys.length; i < n; i++) {\n var key = keys[i];\n this[key] = styles[key];\n }\n };\n Shape.prototype.restoreAllStyles = function () {\n var styles = this.constructor.defaultStyles;\n for (var property in styles) {\n this[property] = styles[property];\n }\n };\n /**\n * Restores the base class default styles that have been overridden by this subclass.\n */\n Shape.prototype.restoreOverriddenStyles = function () {\n var styles = this.constructor.defaultStyles;\n var protoStyles = Object.getPrototypeOf(styles);\n for (var property in styles) {\n if (Object.prototype.hasOwnProperty.call(styles, property) &&\n Object.prototype.hasOwnProperty.call(protoStyles, property)) {\n this[property] = styles[property];\n }\n }\n };\n Shape.prototype.updateGradient = function () {\n var fill = this.fill;\n var linearGradientMatch;\n if ((fill === null || fill === void 0 ? void 0 : fill.startsWith('linear-gradient')) && (linearGradientMatch = LINEAR_GRADIENT_REGEXP.exec(fill))) {\n var angle = parseFloat(linearGradientMatch[1]);\n var colors_1 = [];\n var colorsPart = linearGradientMatch[2];\n var colorRegex = /(#[0-9a-f]+)|(rgba?\\(.+?\\))|([a-z]+)/gi;\n var c = void 0;\n while ((c = colorRegex.exec(colorsPart))) {\n colors_1.push(c[0]);\n }\n this.gradient = new LinearGradient();\n this.gradient.angle = angle;\n this.gradient.stops = colors_1.map(function (color, index) {\n var offset = index / (colors_1.length - 1);\n return { offset: offset, color: color };\n });\n }\n else {\n this.gradient = undefined;\n }\n };\n /**\n * Returns a device-pixel aligned coordinate (or length if length is supplied).\n *\n * NOTE: Not suitable for strokes, since the stroke needs to be offset to the middle\n * of a device pixel.\n */\n Shape.prototype.align = function (start, length) {\n var _a, _b, _c;\n var pixelRatio = (_c = (_b = (_a = this.layerManager) === null || _a === void 0 ? void 0 : _a.canvas) === null || _b === void 0 ? void 0 : _b.pixelRatio) !== null && _c !== void 0 ? _c : 1;\n var alignedStart = Math.round(start * pixelRatio) / pixelRatio;\n if (length == undefined) {\n return alignedStart;\n }\n if (length === 0) {\n return 0;\n }\n if (length < 1) {\n // Avoid hiding crisp shapes\n return Math.ceil(length * pixelRatio) / pixelRatio;\n }\n // Account for the rounding of alignedStart by increasing length to compensate before\n // alignment.\n return Math.round((length + start) * pixelRatio) / pixelRatio - alignedStart;\n };\n Shape.prototype.fillStroke = function (ctx) {\n this.renderFill(ctx);\n this.renderStroke(ctx);\n };\n Shape.prototype.renderFill = function (ctx) {\n if (this.fill) {\n var globalAlpha = ctx.globalAlpha;\n this.applyFill(ctx);\n this.applyFillAlpha(ctx);\n this.applyShadow(ctx);\n ctx.fill();\n ctx.globalAlpha = globalAlpha;\n }\n ctx.shadowColor = 'rgba(0, 0, 0, 0)';\n };\n Shape.prototype.applyFill = function (ctx) {\n if (this.gradient) {\n ctx.fillStyle = this.gradient.createGradient(ctx, this.computeBBox());\n }\n else {\n ctx.fillStyle = this.fill;\n }\n };\n Shape.prototype.applyFillAlpha = function (ctx) {\n var globalAlpha = ctx.globalAlpha;\n ctx.globalAlpha = globalAlpha * this.opacity * this.fillOpacity;\n };\n Shape.prototype.applyShadow = function (ctx) {\n var _a, _b;\n // The canvas context scaling (depends on the device's pixel ratio)\n // has no effect on shadows, so we have to account for the pixel ratio\n // manually here.\n var pixelRatio = (_b = (_a = this.layerManager) === null || _a === void 0 ? void 0 : _a.canvas.pixelRatio) !== null && _b !== void 0 ? _b : 1;\n var fillShadow = this.fillShadow;\n if (fillShadow === null || fillShadow === void 0 ? void 0 : fillShadow.enabled) {\n ctx.shadowColor = fillShadow.color;\n ctx.shadowOffsetX = fillShadow.xOffset * pixelRatio;\n ctx.shadowOffsetY = fillShadow.yOffset * pixelRatio;\n ctx.shadowBlur = fillShadow.blur * pixelRatio;\n }\n };\n Shape.prototype.renderStroke = function (ctx) {\n if (this.stroke && this.strokeWidth) {\n var globalAlpha = ctx.globalAlpha;\n ctx.strokeStyle = this.stroke;\n ctx.globalAlpha = globalAlpha * this.opacity * this.strokeOpacity;\n ctx.lineWidth = this.strokeWidth;\n if (this.lineDash) {\n ctx.setLineDash(this.lineDash);\n }\n if (this.lineDashOffset) {\n ctx.lineDashOffset = this.lineDashOffset;\n }\n if (this.lineCap) {\n ctx.lineCap = this.lineCap;\n }\n if (this.lineJoin) {\n ctx.lineJoin = this.lineJoin;\n }\n ctx.stroke();\n ctx.globalAlpha = globalAlpha;\n }\n };\n Shape.prototype.containsPoint = function (x, y) {\n return this.isPointInPath(x, y);\n };\n /**\n * Defaults for style properties. Note that properties that affect the position\n * and shape of the node are not considered style properties, for example:\n * `x`, `y`, `width`, `height`, `radius`, `rotation`, etc.\n * Can be used to reset to the original styling after some custom styling\n * has been applied (using the `restoreOwnStyles` and `restoreAllStyles` methods).\n * These static defaults are meant to be inherited by subclasses.\n */\n Shape.defaultStyles = Object.assign({}, {\n fill: 'black',\n stroke: undefined,\n strokeWidth: 0,\n lineDash: undefined,\n lineDashOffset: 0,\n lineCap: undefined,\n lineJoin: undefined,\n opacity: 1,\n fillShadow: undefined,\n });\n __decorate$1Z([\n SceneChangeDetection({ redraw: RedrawType.MINOR })\n ], Shape.prototype, \"fillOpacity\", void 0);\n __decorate$1Z([\n SceneChangeDetection({ redraw: RedrawType.MINOR })\n ], Shape.prototype, \"strokeOpacity\", void 0);\n __decorate$1Z([\n SceneChangeDetection({ redraw: RedrawType.MINOR, changeCb: function (s) { return s.updateGradient(); } })\n ], Shape.prototype, \"fill\", void 0);\n __decorate$1Z([\n SceneChangeDetection({ redraw: RedrawType.MINOR })\n ], Shape.prototype, \"stroke\", void 0);\n __decorate$1Z([\n SceneChangeDetection({ redraw: RedrawType.MINOR })\n ], Shape.prototype, \"strokeWidth\", void 0);\n __decorate$1Z([\n SceneChangeDetection({ redraw: RedrawType.MINOR })\n ], Shape.prototype, \"lineDash\", void 0);\n __decorate$1Z([\n SceneChangeDetection({ redraw: RedrawType.MINOR })\n ], Shape.prototype, \"lineDashOffset\", void 0);\n __decorate$1Z([\n SceneChangeDetection({ redraw: RedrawType.MINOR })\n ], Shape.prototype, \"lineCap\", void 0);\n __decorate$1Z([\n SceneChangeDetection({ redraw: RedrawType.MINOR })\n ], Shape.prototype, \"lineJoin\", void 0);\n __decorate$1Z([\n SceneChangeDetection({\n redraw: RedrawType.MINOR,\n convertor: function (v) { return Math.min(1, Math.max(0, v)); },\n })\n ], Shape.prototype, \"opacity\", void 0);\n __decorate$1Z([\n SceneChangeDetection({ redraw: RedrawType.MINOR, checkDirtyOnAssignment: true })\n ], Shape.prototype, \"fillShadow\", void 0);\n return Shape;\n}(Node));\n\nvar __extends$2J = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$1Y = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __values$K = (undefined && undefined.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nvar ellipsis = '\\u2026';\nfunction SceneFontChangeDetection(opts) {\n var _a = opts !== null && opts !== void 0 ? opts : {}, _b = _a.redraw, redraw = _b === void 0 ? RedrawType.MAJOR : _b, changeCb = _a.changeCb;\n return SceneChangeDetection({ redraw: redraw, type: 'font', changeCb: changeCb });\n}\nvar Text = /** @class */ (function (_super) {\n __extends$2J(Text, _super);\n function Text() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.x = 0;\n _this.y = 0;\n _this.lines = [];\n _this.text = undefined;\n _this._dirtyFont = true;\n _this.fontSize = 10;\n _this.fontFamily = 'sans-serif';\n _this.textAlign = Text.defaultStyles.textAlign;\n _this.textBaseline = Text.defaultStyles.textBaseline;\n // TextMetrics are used if lineHeight is not defined.\n _this.lineHeight = undefined;\n return _this;\n }\n Text.prototype._setLines = function () {\n this.lines = splitText(this.text);\n };\n Object.defineProperty(Text.prototype, \"font\", {\n get: function () {\n if (this._font == null || this._dirtyFont) {\n this._dirtyFont = false;\n this._font = getFont(this);\n }\n return this._font;\n },\n enumerable: false,\n configurable: true\n });\n Text.prototype.computeBBox = function () {\n return HdpiCanvas.has.textMetrics\n ? getPreciseBBox(this.lines, this.x, this.y, this)\n : getApproximateBBox(this.lines, this.x, this.y, this);\n };\n Text.prototype.getLineHeight = function (line) {\n var _a, _b;\n if (this.lineHeight)\n return this.lineHeight;\n if (HdpiCanvas.has.textMetrics) {\n var metrics = HdpiCanvas.measureText(line, this.font, this.textBaseline, this.textAlign);\n return (((_a = metrics.fontBoundingBoxAscent) !== null && _a !== void 0 ? _a : metrics.emHeightAscent) +\n ((_b = metrics.fontBoundingBoxDescent) !== null && _b !== void 0 ? _b : metrics.emHeightDescent));\n }\n return HdpiCanvas.getTextSize(line, this.font).height;\n };\n Text.prototype.isPointInPath = function (x, y) {\n var point = this.transformPoint(x, y);\n var bbox = this.computeBBox();\n return bbox ? bbox.containsPoint(point.x, point.y) : false;\n };\n Text.prototype.render = function (renderCtx) {\n var ctx = renderCtx.ctx, forceRender = renderCtx.forceRender, stats = renderCtx.stats;\n if (this.dirty === RedrawType.NONE && !forceRender) {\n if (stats)\n stats.nodesSkipped += this.nodeCount.count;\n return;\n }\n if (!this.lines.length || !this.layerManager) {\n if (stats)\n stats.nodesSkipped += this.nodeCount.count;\n return;\n }\n this.computeTransformMatrix();\n this.matrix.toContext(ctx);\n var _a = this, fill = _a.fill, stroke = _a.stroke, strokeWidth = _a.strokeWidth;\n ctx.font = this.font;\n ctx.textAlign = this.textAlign;\n ctx.textBaseline = this.textBaseline;\n var pixelRatio = this.layerManager.canvas.pixelRatio || 1;\n var globalAlpha = ctx.globalAlpha;\n if (fill) {\n ctx.fillStyle = fill;\n ctx.globalAlpha = globalAlpha * this.opacity * this.fillOpacity;\n var fillShadow = this.fillShadow;\n if (fillShadow === null || fillShadow === void 0 ? void 0 : fillShadow.enabled) {\n ctx.shadowColor = fillShadow.color;\n ctx.shadowOffsetX = fillShadow.xOffset * pixelRatio;\n ctx.shadowOffsetY = fillShadow.yOffset * pixelRatio;\n ctx.shadowBlur = fillShadow.blur * pixelRatio;\n }\n this.renderLines(function (line, x, y) { return ctx.fillText(line, x, y); });\n }\n if (stroke && strokeWidth) {\n ctx.strokeStyle = stroke;\n ctx.lineWidth = strokeWidth;\n ctx.globalAlpha = globalAlpha * this.opacity * this.strokeOpacity;\n var _b = this, lineDash = _b.lineDash, lineDashOffset = _b.lineDashOffset, lineCap = _b.lineCap, lineJoin = _b.lineJoin;\n if (lineDash) {\n ctx.setLineDash(lineDash);\n }\n if (lineDashOffset) {\n ctx.lineDashOffset = lineDashOffset;\n }\n if (lineCap) {\n ctx.lineCap = lineCap;\n }\n if (lineJoin) {\n ctx.lineJoin = lineJoin;\n }\n this.renderLines(function (line, x, y) { return ctx.strokeText(line, x, y); });\n }\n _super.prototype.render.call(this, renderCtx);\n };\n Text.prototype.renderLines = function (renderCallback) {\n var _this = this;\n var _a = this, lines = _a.lines, x = _a.x, y = _a.y;\n var lineHeights = this.lines.map(function (line) { return _this.getLineHeight(line); });\n var totalHeight = lineHeights.reduce(function (a, b) { return a + b; }, 0);\n var offsetY = -(totalHeight - lineHeights[0]) * getVerticalOffset(this.textBaseline);\n for (var i = 0; i < lines.length; i++) {\n renderCallback(lines[i], x, y + offsetY);\n offsetY += lineHeights[i];\n }\n };\n Text.wrap = function (text, maxWidth, maxHeight, textProps, wrapping) {\n var e_1, _a;\n var font = getFont(textProps);\n var measurer = createTextMeasurer(font);\n var lines = text.split(/\\r?\\n/g);\n if (lines.length === 0) {\n return '';\n }\n if (wrapping === 'never') {\n return Text.truncateLine(lines[0], maxWidth, measurer, false);\n }\n var result = [];\n var cumulativeHeight = 0;\n try {\n for (var lines_1 = __values$K(lines), lines_1_1 = lines_1.next(); !lines_1_1.done; lines_1_1 = lines_1.next()) {\n var line = lines_1_1.value;\n var wrappedLine = Text.wrapLine(line, maxWidth, maxHeight, measurer, textProps, wrapping, cumulativeHeight);\n result.push(wrappedLine.result);\n cumulativeHeight = wrappedLine.cumulativeHeight;\n if (wrappedLine.truncated) {\n break;\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (lines_1_1 && !lines_1_1.done && (_a = lines_1.return)) _a.call(lines_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n return result.join('\\n').trim();\n };\n Text.wrapLine = function (text, maxWidth, maxHeight, measurer, textProps, wrapping, cumulativeHeight) {\n text = text.trim();\n if (!text) {\n return { result: '', truncated: false, cumulativeHeight: cumulativeHeight };\n }\n var initialSize = measurer.size(text);\n if (initialSize.width <= maxWidth) {\n // Text fits into a single line\n return { result: text, truncated: false, cumulativeHeight: cumulativeHeight + initialSize.height };\n }\n if (initialSize.height > maxHeight || measurer.width('W') > maxWidth) {\n // Not enough space for a single line or character\n return { result: '', truncated: true, cumulativeHeight: cumulativeHeight };\n }\n var words = text.split(/\\s+/g);\n var wrapResult = Text.wrapLineSequentially(words, maxWidth, maxHeight, measurer, textProps, wrapping, cumulativeHeight);\n cumulativeHeight = wrapResult.cumulativeHeight;\n var lines = wrapResult.lines;\n if (!(wrapResult.wordsBrokenOrTruncated || wrapResult.linesTruncated)) {\n // If no word breaks or truncations, try the balanced wrapping\n var linesCount = wrapResult.lines.length;\n var balanced = Text.wrapLineBalanced(words, maxWidth, measurer, linesCount);\n if (balanced.length === lines.length) {\n // Some lines can't be balanced properly because of unusually long words\n lines = balanced;\n }\n }\n var wrappedText = lines.map(function (ln) { return ln.join(' '); }).join('\\n');\n return { result: wrappedText, truncated: wrapResult.linesTruncated, cumulativeHeight: cumulativeHeight };\n };\n Text.breakWord = function (word, firstLineWidth, maxWidth, hyphens, measurer) {\n var e_2, _a;\n var isPunctuationAt = function (index) { return Text.punctuationMarks.includes(word[index]); };\n var h = hyphens ? measurer.width('-') : 0;\n var breaks = [];\n var partWidth = 0;\n var p = 0;\n for (var i = 0; i < word.length; i++) {\n var c = word[i];\n var w = measurer.width(c);\n var limit = p === 0 ? firstLineWidth : maxWidth;\n if (partWidth + w + h > limit) {\n breaks.push(i);\n partWidth = 0;\n p++;\n }\n partWidth += w;\n }\n var parts = [];\n var start = 0;\n try {\n for (var breaks_1 = __values$K(breaks), breaks_1_1 = breaks_1.next(); !breaks_1_1.done; breaks_1_1 = breaks_1.next()) {\n var index = breaks_1_1.value;\n var part = word.substring(start, index);\n if (hyphens && part.length > 0 && !isPunctuationAt(index - 1) && !isPunctuationAt(index)) {\n part += '-';\n }\n parts.push(part);\n start = index;\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (breaks_1_1 && !breaks_1_1.done && (_a = breaks_1.return)) _a.call(breaks_1);\n }\n finally { if (e_2) throw e_2.error; }\n }\n parts.push(word.substring(start));\n return parts;\n };\n Text.truncateLine = function (text, maxWidth, measurer, forceEllipsis) {\n var lineWidth = measurer.width(text);\n if (lineWidth < maxWidth && !forceEllipsis) {\n return text;\n }\n var ellipsisWidth = measurer.width(ellipsis);\n if (lineWidth + ellipsisWidth <= maxWidth) {\n return \"\" + text + ellipsis;\n }\n var index = Math.floor((text.length * maxWidth) / lineWidth) + 1;\n var trunc;\n var truncWidth;\n do {\n trunc = text.substring(0, index);\n truncWidth = measurer.width(trunc);\n } while (--index >= 0 && truncWidth + ellipsisWidth > maxWidth);\n return \"\" + trunc + ellipsis;\n };\n Text.wrapLineSequentially = function (words, maxWidth, maxHeight, measurer, textProps, wrapping, cumulativeHeight) {\n var fontSize = textProps.fontSize, _a = textProps.lineHeight, lineHeight = _a === void 0 ? fontSize * Text.defaultLineHeightRatio : _a;\n var breakWord = wrapping === 'always' || wrapping === 'hyphenate';\n var hyphenate = wrapping === 'hyphenate';\n var spaceWidth = measurer.width(' ');\n var wordsBrokenOrTruncated = false;\n var linesTruncated = false;\n var lines = [];\n var currentLine = [];\n var lineWidth = 0;\n var addNewLine = function () {\n var expectedHeight = cumulativeHeight + lineHeight;\n if (expectedHeight >= maxHeight) {\n // Truncate the last line\n var lastLine = currentLine.join(' ');\n var trunc = Text.truncateLine(lastLine, maxWidth, measurer, true);\n currentLine.splice(0, currentLine.length, trunc);\n linesTruncated = true;\n return false;\n }\n // Add new line\n currentLine = [];\n lineWidth = 0;\n cumulativeHeight = expectedHeight;\n lines.push(currentLine);\n return true;\n };\n if (!addNewLine()) {\n return { lines: lines, linesTruncated: true, wordsBrokenOrTruncated: wordsBrokenOrTruncated, cumulativeHeight: cumulativeHeight };\n }\n for (var i = 0; i < words.length; i++) {\n var word = words[i];\n var wordWidth = measurer.width(word);\n var expectedSpaceWidth = currentLine.length === 0 ? 0 : spaceWidth;\n var expectedLineWidth = lineWidth + expectedSpaceWidth + wordWidth;\n if (expectedLineWidth <= maxWidth) {\n // If the word fits, add it to the current line\n currentLine.push(word);\n lineWidth = expectedLineWidth;\n continue;\n }\n if (wordWidth <= maxWidth) {\n // If the word is not too long, put it onto new line\n if (!addNewLine()) {\n break;\n }\n currentLine.push(word);\n lineWidth = wordWidth;\n continue;\n }\n // Handle a long word\n wordsBrokenOrTruncated = true;\n if (breakWord) {\n // Break the word into parts\n var availWidth = maxWidth - lineWidth - expectedSpaceWidth;\n var parts = Text.breakWord(word, availWidth, maxWidth, hyphenate, measurer);\n var breakLoop = false;\n for (var p = 0; p < parts.length; p++) {\n var part = parts[p];\n part && currentLine.push(part);\n if (p === parts.length - 1) {\n lineWidth = measurer.width(part);\n }\n else if (!addNewLine()) {\n breakLoop = true;\n break;\n }\n }\n if (breakLoop)\n break;\n }\n else {\n // Truncate the word\n if (!addNewLine()) {\n break;\n }\n var trunc = Text.truncateLine(word, maxWidth, measurer, true);\n currentLine.push(trunc);\n if (i < words.length - 1) {\n linesTruncated = true;\n }\n break;\n }\n }\n return { lines: lines, linesTruncated: linesTruncated, wordsBrokenOrTruncated: wordsBrokenOrTruncated, cumulativeHeight: cumulativeHeight };\n };\n Text.wrapLineBalanced = function (words, maxWidth, measurer, linesCount) {\n var e_3, _a;\n var totalWordsWidth = words.reduce(function (sum, w) { return sum + measurer.width(w); }, 0);\n var spaceWidth = measurer.width(' ');\n var totalSpaceWidth = spaceWidth * (words.length - linesCount - 2);\n var averageLineWidth = (totalWordsWidth + totalSpaceWidth) / linesCount;\n var lines = [];\n var currentLine = [];\n var lineWidth = measurer.width(words[0]);\n var newLine = true;\n try {\n for (var words_1 = __values$K(words), words_1_1 = words_1.next(); !words_1_1.done; words_1_1 = words_1.next()) {\n var word = words_1_1.value;\n var width = measurer.width(word);\n if (newLine) {\n // New line\n currentLine = [];\n currentLine.push(word);\n lineWidth = width;\n newLine = false;\n lines.push(currentLine);\n continue;\n }\n var expectedLineWidth = lineWidth + spaceWidth + width;\n if (expectedLineWidth <= averageLineWidth) {\n // Keep adding words to the line\n currentLine.push(word);\n lineWidth = expectedLineWidth;\n }\n else if (expectedLineWidth <= maxWidth) {\n // Add the last word to the line\n currentLine.push(word);\n newLine = true;\n }\n else {\n // Put the word onto the next line\n currentLine = [word];\n lineWidth = width;\n lines.push(currentLine);\n }\n }\n }\n catch (e_3_1) { e_3 = { error: e_3_1 }; }\n finally {\n try {\n if (words_1_1 && !words_1_1.done && (_a = words_1.return)) _a.call(words_1);\n }\n finally { if (e_3) throw e_3.error; }\n }\n return lines;\n };\n Text.prototype.setFont = function (props) {\n this.fontFamily = props.fontFamily;\n this.fontSize = props.fontSize;\n this.fontStyle = props.fontStyle;\n this.fontWeight = props.fontWeight;\n };\n Text.prototype.setAlign = function (props) {\n this.textAlign = props.textAlign;\n this.textBaseline = props.textBaseline;\n };\n Text.className = 'Text';\n // The default line spacing for document editors is usually 1.15\n Text.defaultLineHeightRatio = 1.15;\n Text.defaultStyles = Object.assign({}, Shape.defaultStyles, {\n textAlign: 'start',\n fontStyle: undefined,\n fontWeight: undefined,\n fontSize: 10,\n fontFamily: 'sans-serif',\n textBaseline: 'alphabetic',\n });\n Text.punctuationMarks = ['.', ',', '-', ':', ';', '!', '?', \"'\", '\"', '(', ')'];\n __decorate$1Y([\n SceneChangeDetection({ redraw: RedrawType.MAJOR })\n ], Text.prototype, \"x\", void 0);\n __decorate$1Y([\n SceneChangeDetection({ redraw: RedrawType.MAJOR })\n ], Text.prototype, \"y\", void 0);\n __decorate$1Y([\n SceneChangeDetection({ redraw: RedrawType.MAJOR, changeCb: function (o) { return o._setLines(); } })\n ], Text.prototype, \"text\", void 0);\n __decorate$1Y([\n SceneFontChangeDetection()\n ], Text.prototype, \"fontStyle\", void 0);\n __decorate$1Y([\n SceneFontChangeDetection()\n ], Text.prototype, \"fontWeight\", void 0);\n __decorate$1Y([\n SceneFontChangeDetection()\n ], Text.prototype, \"fontSize\", void 0);\n __decorate$1Y([\n SceneFontChangeDetection()\n ], Text.prototype, \"fontFamily\", void 0);\n __decorate$1Y([\n SceneChangeDetection({ redraw: RedrawType.MAJOR })\n ], Text.prototype, \"textAlign\", void 0);\n __decorate$1Y([\n SceneChangeDetection({ redraw: RedrawType.MAJOR })\n ], Text.prototype, \"textBaseline\", void 0);\n __decorate$1Y([\n SceneChangeDetection({ redraw: RedrawType.MAJOR })\n ], Text.prototype, \"lineHeight\", void 0);\n return Text;\n}(Shape));\nfunction createTextMeasurer(font) {\n var cache = new Map();\n var getTextSize = function (text) { return HdpiCanvas.getTextSize(text, font); };\n var getLineWidth = function (text) {\n if (cache.has(text)) {\n return cache.get(text);\n }\n var width = getTextSize(text).width;\n cache.set(text, width);\n return width;\n };\n return { size: getTextSize, width: getLineWidth };\n}\nfunction getFont(fontProps) {\n var fontFamily = fontProps.fontFamily, fontSize = fontProps.fontSize, fontStyle = fontProps.fontStyle, fontWeight = fontProps.fontWeight;\n return [fontStyle !== null && fontStyle !== void 0 ? fontStyle : '', fontWeight !== null && fontWeight !== void 0 ? fontWeight : '', fontSize + 'px', fontFamily].join(' ').trim();\n}\nfunction measureText(lines, x, y, textProps) {\n return HdpiCanvas.has.textMetrics\n ? getPreciseBBox(lines, x, y, textProps)\n : getApproximateBBox(lines, x, y, textProps);\n}\nfunction getPreciseBBox(lines, x, y, textProps) {\n var _a, _b;\n var left = 0;\n var top = 0;\n var width = 0;\n var height = 0;\n // Distance between first and last base lines.\n var baselineDistance = 0;\n var font = getFont(textProps);\n var lineHeight = textProps.lineHeight, _c = textProps.textBaseline, textBaseline = _c === void 0 ? Text.defaultStyles.textBaseline : _c, _d = textProps.textAlign, textAlign = _d === void 0 ? Text.defaultStyles.textAlign : _d;\n for (var i = 0; i < lines.length; i++) {\n var metrics = HdpiCanvas.measureText(lines[i], font, textBaseline, textAlign);\n left = Math.max(left, metrics.actualBoundingBoxLeft);\n width = Math.max(width, metrics.width);\n if (i == 0) {\n top += metrics.actualBoundingBoxAscent;\n height += metrics.actualBoundingBoxAscent;\n }\n else {\n baselineDistance += (_a = metrics.fontBoundingBoxAscent) !== null && _a !== void 0 ? _a : metrics.emHeightAscent;\n }\n if (i == lines.length - 1) {\n height += metrics.actualBoundingBoxDescent;\n }\n else {\n baselineDistance += (_b = metrics.fontBoundingBoxDescent) !== null && _b !== void 0 ? _b : metrics.emHeightDescent;\n }\n }\n if (lineHeight !== undefined) {\n baselineDistance = (lines.length - 1) * lineHeight;\n }\n height += baselineDistance;\n top += baselineDistance * getVerticalOffset(textBaseline);\n return new BBox(x - left, y - top, width, height);\n}\nfunction getApproximateBBox(lines, x, y, textProps) {\n var width = 0;\n var firstLineHeight = 0;\n // Distance between first and last base lines.\n var baselineDistance = 0;\n var font = getFont(textProps);\n var lineHeight = textProps.lineHeight, _a = textProps.textBaseline, textBaseline = _a === void 0 ? Text.defaultStyles.textBaseline : _a, _b = textProps.textAlign, textAlign = _b === void 0 ? Text.defaultStyles.textAlign : _b;\n if (lines.length > 0) {\n var lineSize = HdpiCanvas.getTextSize(lines[0], font);\n width = lineSize.width;\n firstLineHeight = lineSize.height;\n }\n for (var i = 1; i < lines.length; i++) {\n var lineSize = HdpiCanvas.getTextSize(lines[i], font);\n width = Math.max(width, lineSize.width);\n baselineDistance += lineHeight !== null && lineHeight !== void 0 ? lineHeight : lineSize.height;\n }\n switch (textAlign) {\n case 'end':\n case 'right':\n x -= width;\n break;\n case 'center':\n x -= width / 2;\n }\n switch (textBaseline) {\n case 'alphabetic':\n y -= firstLineHeight * 0.7 + baselineDistance * 0.5;\n break;\n case 'middle':\n y -= firstLineHeight * 0.45 + baselineDistance * 0.5;\n break;\n case 'ideographic':\n y -= firstLineHeight + baselineDistance;\n break;\n case 'hanging':\n y -= firstLineHeight * 0.2 + baselineDistance * 0.5;\n break;\n case 'bottom':\n y -= firstLineHeight + baselineDistance;\n break;\n }\n return new BBox(x, y, width, firstLineHeight + baselineDistance);\n}\nfunction getVerticalOffset(textBaseline) {\n switch (textBaseline) {\n case 'top':\n case 'hanging':\n return 0;\n case 'bottom':\n case 'alphabetic':\n case 'ideographic':\n return 1;\n case 'middle':\n return 0.5;\n }\n}\nfunction splitText(text) {\n return typeof text === 'string' ? text.split(/\\r?\\n/g) : [];\n}\n\nvar Observable = /** @class */ (function () {\n function Observable() {\n this.allEventListeners = new Map();\n }\n Observable.prototype.addEventListener = function (type, listener) {\n if (typeof listener !== 'function') {\n throw new Error('AG Charts - listener must be a Function');\n }\n var allEventListeners = this.allEventListeners;\n var eventListeners = allEventListeners.get(type);\n if (!eventListeners) {\n eventListeners = new Set();\n allEventListeners.set(type, eventListeners);\n }\n if (!eventListeners.has(listener)) {\n eventListeners.add(listener);\n }\n };\n Observable.prototype.removeEventListener = function (type, listener) {\n var allEventListeners = this.allEventListeners;\n var eventListeners = allEventListeners.get(type);\n if (!eventListeners) {\n return;\n }\n eventListeners.delete(listener);\n if (eventListeners.size === 0) {\n allEventListeners.delete(type);\n }\n };\n Observable.prototype.hasEventListener = function (type) {\n return this.allEventListeners.has(type);\n };\n Observable.prototype.clearEventListeners = function () {\n this.allEventListeners.clear();\n };\n Observable.prototype.fireEvent = function (event) {\n var listeners = this.allEventListeners.get(event.type);\n listeners === null || listeners === void 0 ? void 0 : listeners.forEach(function (listener) { return listener(event); });\n };\n return Observable;\n}());\n\nvar isString$2 = function (v) { return typeof v === 'string'; };\nvar isStringObject$1 = function (v) {\n return !!v && Object.prototype.hasOwnProperty.call(v, 'toString') && isString$2(v.toString());\n};\nvar isDate$1 = function (v) { return v instanceof Date && !isNaN(+v); };\nfunction isDiscrete(value) {\n return isString$2(value) || isStringObject$1(value);\n}\nfunction isContinuous(value) {\n var isNumberObject = function (v) {\n return !!v && Object.prototype.hasOwnProperty.call(v, 'valueOf') && isNumber$4(v.valueOf());\n };\n var isDate = function (v) { return v instanceof Date && !isNaN(+v); };\n return isNumber$4(value) || isNumberObject(value) || isDate(value);\n}\nfunction checkDatum(value, isContinuousScale) {\n if (isContinuousScale && isContinuous(value)) {\n return value;\n }\n else if (!isContinuousScale) {\n if (!isDiscrete(value)) {\n return String(value);\n }\n return value;\n }\n return undefined;\n}\nvar isNumber$4 = function (v) { return typeof v === 'number' && Number.isFinite(v); };\n\nvar __read$14 = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar Color = /** @class */ (function () {\n /**\n * Every color component should be in the [0, 1] range.\n * Some easing functions (such as elastic easing) can overshoot the target value by some amount.\n * So, when animating colors, if the source or target color components are already near\n * or at the edge of the allowed [0, 1] range, it is possible for the intermediate color\n * component value to end up outside of that range mid-animation. For this reason the constructor\n * performs range checking/constraining.\n * @param r Red component.\n * @param g Green component.\n * @param b Blue component.\n * @param a Alpha (opacity) component.\n */\n function Color(r, g, b, a) {\n if (a === void 0) { a = 1; }\n // NaN is treated as 0.\n this.r = Math.min(1, Math.max(0, r || 0));\n this.g = Math.min(1, Math.max(0, g || 0));\n this.b = Math.min(1, Math.max(0, b || 0));\n this.a = Math.min(1, Math.max(0, a || 0));\n }\n /**\n * A color string can be in one of the following formats to be valid:\n * - #rgb\n * - #rrggbb\n * - rgb(r, g, b)\n * - rgba(r, g, b, a)\n * - CSS color name such as 'white', 'orange', 'cyan', etc.\n */\n Color.validColorString = function (str) {\n if (str.indexOf('#') >= 0) {\n return !!Color.parseHex(str);\n }\n if (str.indexOf('rgb') >= 0) {\n return !!Color.stringToRgba(str);\n }\n return !!Color.nameToHex[str.toLowerCase()];\n };\n /**\n * The given string can be in one of the following formats:\n * - #rgb\n * - #rrggbb\n * - rgb(r, g, b)\n * - rgba(r, g, b, a)\n * - CSS color name such as 'white', 'orange', 'cyan', etc.\n * @param str\n */\n Color.fromString = function (str) {\n // hexadecimal notation\n if (str.indexOf('#') >= 0) {\n // there can be some leading whitespace\n return Color.fromHexString(str);\n }\n // color name\n var hex = Color.nameToHex[str.toLowerCase()];\n if (hex) {\n return Color.fromHexString(hex);\n }\n // rgb(a) notation\n if (str.indexOf('rgb') >= 0) {\n return Color.fromRgbaString(str);\n }\n throw new Error(\"Invalid color string: '\" + str + \"'\");\n };\n Color.tryParseFromString = function (str) {\n try {\n return Color.fromString(str);\n }\n catch (e) {\n Logger.warnOnce(\"invalid color string: '\" + str + \"'.\");\n return Color.fromArray([0, 0, 0]);\n }\n };\n // See https://drafts.csswg.org/css-color/#hex-notation\n Color.parseHex = function (input) {\n input = input.replace(/ /g, '').slice(1);\n var parts;\n switch (input.length) {\n case 6:\n case 8:\n parts = [];\n for (var i = 0; i < input.length; i += 2) {\n parts.push(parseInt(\"\" + input[i] + input[i + 1], 16));\n }\n break;\n case 3:\n case 4:\n parts = input\n .split('')\n .map(function (p) { return parseInt(p, 16); })\n .map(function (p) { return p + p * 16; });\n break;\n }\n if ((parts === null || parts === void 0 ? void 0 : parts.length) >= 3) {\n if (parts.every(function (p) { return p >= 0; })) {\n if (parts.length === 3) {\n parts.push(255);\n }\n return parts;\n }\n }\n };\n Color.fromHexString = function (str) {\n var values = Color.parseHex(str);\n if (values) {\n var _a = __read$14(values, 4), r = _a[0], g = _a[1], b = _a[2], a = _a[3];\n return new Color(r / 255, g / 255, b / 255, a / 255);\n }\n throw new Error(\"Malformed hexadecimal color string: '\" + str + \"'\");\n };\n Color.stringToRgba = function (str) {\n // Find positions of opening and closing parentheses.\n var _a = __read$14([NaN, NaN], 2), po = _a[0], pc = _a[1];\n for (var i = 0; i < str.length; i++) {\n var c = str[i];\n if (!po && c === '(') {\n po = i;\n }\n else if (c === ')') {\n pc = i;\n break;\n }\n }\n var contents = po && pc && str.substring(po + 1, pc);\n if (!contents) {\n return;\n }\n var parts = contents.split(',');\n var rgba = [];\n for (var i = 0; i < parts.length; i++) {\n var part = parts[i];\n var value = parseFloat(part);\n if (isNaN(value)) {\n return;\n }\n if (part.indexOf('%') >= 0) {\n // percentage r, g, or b value\n value = Math.max(0, Math.min(100, value));\n value /= 100;\n }\n else {\n if (i === 3) {\n // alpha component\n value = Math.max(0, Math.min(1, value));\n }\n else {\n // absolute r, g, or b value\n value = Math.max(0, Math.min(255, value));\n value /= 255;\n }\n }\n rgba.push(value);\n }\n return rgba;\n };\n Color.fromRgbaString = function (str) {\n var rgba = Color.stringToRgba(str);\n if (rgba) {\n if (rgba.length === 3) {\n return new Color(rgba[0], rgba[1], rgba[2]);\n }\n else if (rgba.length === 4) {\n return new Color(rgba[0], rgba[1], rgba[2], rgba[3]);\n }\n }\n throw new Error(\"Malformed rgb/rgba color string: '\" + str + \"'\");\n };\n Color.fromArray = function (arr) {\n if (arr.length === 4) {\n return new Color(arr[0], arr[1], arr[2], arr[3]);\n }\n if (arr.length === 3) {\n return new Color(arr[0], arr[1], arr[2]);\n }\n throw new Error('The given array should contain 3 or 4 color components (numbers).');\n };\n Color.fromHSB = function (h, s, b, alpha) {\n if (alpha === void 0) { alpha = 1; }\n var rgb = Color.HSBtoRGB(h, s, b);\n return new Color(rgb[0], rgb[1], rgb[2], alpha);\n };\n Color.padHex = function (str) {\n // Can't use `padStart(2, '0')` here because of IE.\n return str.length === 1 ? '0' + str : str;\n };\n Color.prototype.toHexString = function () {\n var hex = '#' +\n Color.padHex(Math.round(this.r * 255).toString(16)) +\n Color.padHex(Math.round(this.g * 255).toString(16)) +\n Color.padHex(Math.round(this.b * 255).toString(16));\n if (this.a < 1) {\n hex += Color.padHex(Math.round(this.a * 255).toString(16));\n }\n return hex;\n };\n Color.prototype.toRgbaString = function (fractionDigits) {\n if (fractionDigits === void 0) { fractionDigits = 3; }\n var components = [Math.round(this.r * 255), Math.round(this.g * 255), Math.round(this.b * 255)];\n var k = Math.pow(10, fractionDigits);\n if (this.a !== 1) {\n components.push(Math.round(this.a * k) / k);\n return \"rgba(\" + components.join(', ') + \")\";\n }\n return \"rgb(\" + components.join(', ') + \")\";\n };\n Color.prototype.toString = function () {\n if (this.a === 1) {\n return this.toHexString();\n }\n return this.toRgbaString();\n };\n Color.prototype.toHSB = function () {\n return Color.RGBtoHSB(this.r, this.g, this.b);\n };\n /**\n * Converts the given RGB triple to an array of HSB (HSV) components.\n * The hue component will be `NaN` for achromatic colors.\n */\n Color.RGBtoHSB = function (r, g, b) {\n var min = Math.min(r, g, b);\n var max = Math.max(r, g, b);\n var S = max !== 0 ? (max - min) / max : 0;\n var H = NaN;\n // min == max, means all components are the same\n // and the color is a shade of gray with no hue (H is NaN)\n if (min !== max) {\n var delta = max - min;\n var rc = (max - r) / delta;\n var gc = (max - g) / delta;\n var bc = (max - b) / delta;\n if (r === max) {\n H = bc - gc;\n }\n else if (g === max) {\n H = 2.0 + rc - bc;\n }\n else {\n H = 4.0 + gc - rc;\n }\n H /= 6.0;\n if (H < 0) {\n H = H + 1.0;\n }\n }\n return [H * 360, S, max];\n };\n /**\n * Converts the given HSB (HSV) triple to an array of RGB components.\n */\n Color.HSBtoRGB = function (H, S, B) {\n if (isNaN(H)) {\n H = 0;\n }\n H = (((H % 360) + 360) % 360) / 360; // normalize hue to [0, 360] interval, then scale to [0, 1]\n var r = 0;\n var g = 0;\n var b = 0;\n if (S === 0) {\n r = g = b = B;\n }\n else {\n var h = (H - Math.floor(H)) * 6;\n var f = h - Math.floor(h);\n var p = B * (1 - S);\n var q = B * (1 - S * f);\n var t = B * (1 - S * (1 - f));\n switch (h >> 0 // discard the floating point part of the number\n ) {\n case 0:\n r = B;\n g = t;\n b = p;\n break;\n case 1:\n r = q;\n g = B;\n b = p;\n break;\n case 2:\n r = p;\n g = B;\n b = t;\n break;\n case 3:\n r = p;\n g = q;\n b = B;\n break;\n case 4:\n r = t;\n g = p;\n b = B;\n break;\n case 5:\n r = B;\n g = p;\n b = q;\n break;\n }\n }\n return [r, g, b];\n };\n Color.prototype.derive = function (hueShift, saturationFactor, brightnessFactor, opacityFactor) {\n var hsb = Color.RGBtoHSB(this.r, this.g, this.b);\n var b = hsb[2];\n if (b == 0 && brightnessFactor > 1.0) {\n b = 0.05;\n }\n var h = (((hsb[0] + hueShift) % 360) + 360) % 360;\n var s = Math.max(Math.min(hsb[1] * saturationFactor, 1.0), 0.0);\n b = Math.max(Math.min(b * brightnessFactor, 1.0), 0.0);\n var a = Math.max(Math.min(this.a * opacityFactor, 1.0), 0.0);\n var rgba = Color.HSBtoRGB(h, s, b);\n rgba.push(a);\n return Color.fromArray(rgba);\n };\n Color.prototype.brighter = function () {\n return this.derive(0, 1.0, 1.0 / 0.7, 1.0);\n };\n Color.prototype.darker = function () {\n return this.derive(0, 1.0, 0.7, 1.0);\n };\n Color.interpolate = function (color, other) {\n var c0 = Color.tryParseFromString(color);\n var c1 = Color.tryParseFromString(other);\n return function (t) {\n var i = function (x, y) { return x * (1 - t) + y * t; };\n var c = new Color(i(c0.r, c1.r), i(c0.g, c1.g), i(c0.b, c1.b), i(c0.a, c1.a));\n return c.toString();\n };\n };\n /**\n * CSS Color Module Level 4:\n * https://drafts.csswg.org/css-color/#named-colors\n */\n Color.nameToHex = Object.freeze({\n aliceblue: '#F0F8FF',\n antiquewhite: '#FAEBD7',\n aqua: '#00FFFF',\n aquamarine: '#7FFFD4',\n azure: '#F0FFFF',\n beige: '#F5F5DC',\n bisque: '#FFE4C4',\n black: '#000000',\n blanchedalmond: '#FFEBCD',\n blue: '#0000FF',\n blueviolet: '#8A2BE2',\n brown: '#A52A2A',\n burlywood: '#DEB887',\n cadetblue: '#5F9EA0',\n chartreuse: '#7FFF00',\n chocolate: '#D2691E',\n coral: '#FF7F50',\n cornflowerblue: '#6495ED',\n cornsilk: '#FFF8DC',\n crimson: '#DC143C',\n cyan: '#00FFFF',\n darkblue: '#00008B',\n darkcyan: '#008B8B',\n darkgoldenrod: '#B8860B',\n darkgray: '#A9A9A9',\n darkgreen: '#006400',\n darkgrey: '#A9A9A9',\n darkkhaki: '#BDB76B',\n darkmagenta: '#8B008B',\n darkolivegreen: '#556B2F',\n darkorange: '#FF8C00',\n darkorchid: '#9932CC',\n darkred: '#8B0000',\n darksalmon: '#E9967A',\n darkseagreen: '#8FBC8F',\n darkslateblue: '#483D8B',\n darkslategray: '#2F4F4F',\n darkslategrey: '#2F4F4F',\n darkturquoise: '#00CED1',\n darkviolet: '#9400D3',\n deeppink: '#FF1493',\n deepskyblue: '#00BFFF',\n dimgray: '#696969',\n dimgrey: '#696969',\n dodgerblue: '#1E90FF',\n firebrick: '#B22222',\n floralwhite: '#FFFAF0',\n forestgreen: '#228B22',\n fuchsia: '#FF00FF',\n gainsboro: '#DCDCDC',\n ghostwhite: '#F8F8FF',\n gold: '#FFD700',\n goldenrod: '#DAA520',\n gray: '#808080',\n green: '#008000',\n greenyellow: '#ADFF2F',\n grey: '#808080',\n honeydew: '#F0FFF0',\n hotpink: '#FF69B4',\n indianred: '#CD5C5C',\n indigo: '#4B0082',\n ivory: '#FFFFF0',\n khaki: '#F0E68C',\n lavender: '#E6E6FA',\n lavenderblush: '#FFF0F5',\n lawngreen: '#7CFC00',\n lemonchiffon: '#FFFACD',\n lightblue: '#ADD8E6',\n lightcoral: '#F08080',\n lightcyan: '#E0FFFF',\n lightgoldenrodyellow: '#FAFAD2',\n lightgray: '#D3D3D3',\n lightgreen: '#90EE90',\n lightgrey: '#D3D3D3',\n lightpink: '#FFB6C1',\n lightsalmon: '#FFA07A',\n lightseagreen: '#20B2AA',\n lightskyblue: '#87CEFA',\n lightslategray: '#778899',\n lightslategrey: '#778899',\n lightsteelblue: '#B0C4DE',\n lightyellow: '#FFFFE0',\n lime: '#00FF00',\n limegreen: '#32CD32',\n linen: '#FAF0E6',\n magenta: '#FF00FF',\n maroon: '#800000',\n mediumaquamarine: '#66CDAA',\n mediumblue: '#0000CD',\n mediumorchid: '#BA55D3',\n mediumpurple: '#9370DB',\n mediumseagreen: '#3CB371',\n mediumslateblue: '#7B68EE',\n mediumspringgreen: '#00FA9A',\n mediumturquoise: '#48D1CC',\n mediumvioletred: '#C71585',\n midnightblue: '#191970',\n mintcream: '#F5FFFA',\n mistyrose: '#FFE4E1',\n moccasin: '#FFE4B5',\n navajowhite: '#FFDEAD',\n navy: '#000080',\n oldlace: '#FDF5E6',\n olive: '#808000',\n olivedrab: '#6B8E23',\n orange: '#FFA500',\n orangered: '#FF4500',\n orchid: '#DA70D6',\n palegoldenrod: '#EEE8AA',\n palegreen: '#98FB98',\n paleturquoise: '#AFEEEE',\n palevioletred: '#DB7093',\n papayawhip: '#FFEFD5',\n peachpuff: '#FFDAB9',\n peru: '#CD853F',\n pink: '#FFC0CB',\n plum: '#DDA0DD',\n powderblue: '#B0E0E6',\n purple: '#800080',\n rebeccapurple: '#663399',\n red: '#FF0000',\n rosybrown: '#BC8F8F',\n royalblue: '#4169E1',\n saddlebrown: '#8B4513',\n salmon: '#FA8072',\n sandybrown: '#F4A460',\n seagreen: '#2E8B57',\n seashell: '#FFF5EE',\n sienna: '#A0522D',\n silver: '#C0C0C0',\n skyblue: '#87CEEB',\n slateblue: '#6A5ACD',\n slategray: '#708090',\n slategrey: '#708090',\n snow: '#FFFAFA',\n springgreen: '#00FF7F',\n steelblue: '#4682B4',\n tan: '#D2B48C',\n teal: '#008080',\n thistle: '#D8BFD8',\n tomato: '#FF6347',\n transparent: '#00000000',\n turquoise: '#40E0D0',\n violet: '#EE82EE',\n wheat: '#F5DEB3',\n white: '#FFFFFF',\n whitesmoke: '#F5F5F5',\n yellow: '#FFFF00',\n yellowgreen: '#9ACD32',\n });\n return Color;\n}());\n\nvar __values$J = (undefined && undefined.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nvar BREAK_TRANSFORM_CHAIN = Symbol('BREAK');\nvar CONFIG_KEY = '__decorator_config';\nfunction initialiseConfig(target, propertyKeyOrSymbol, propertyKey, valueStoreKey) {\n if (Object.getOwnPropertyDescriptor(target, CONFIG_KEY) == null) {\n Object.defineProperty(target, CONFIG_KEY, { value: {} });\n }\n var config = target[CONFIG_KEY];\n if (config[propertyKey] != null) {\n return config[propertyKey];\n }\n config[propertyKey] = { setters: [], getters: [] };\n var descriptor = Object.getOwnPropertyDescriptor(target, propertyKeyOrSymbol);\n var prevSet = descriptor === null || descriptor === void 0 ? void 0 : descriptor.set;\n var prevGet = descriptor === null || descriptor === void 0 ? void 0 : descriptor.get;\n var getter = function () {\n var e_1, _a;\n var _b, _c;\n var value = prevGet ? prevGet.call(this) : this[valueStoreKey];\n try {\n for (var _d = __values$J((_c = (_b = config[propertyKey]) === null || _b === void 0 ? void 0 : _b.getters) !== null && _c !== void 0 ? _c : []), _e = _d.next(); !_e.done; _e = _d.next()) {\n var transformFn = _e.value;\n value = transformFn(this, propertyKeyOrSymbol, value);\n if (value === BREAK_TRANSFORM_CHAIN) {\n return undefined;\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_e && !_e.done && (_a = _d.return)) _a.call(_d);\n }\n finally { if (e_1) throw e_1.error; }\n }\n return value;\n };\n var setter = function (value) {\n var e_2, _a;\n var _b, _c;\n var setters = (_c = (_b = config[propertyKey]) === null || _b === void 0 ? void 0 : _b.setters) !== null && _c !== void 0 ? _c : [];\n var oldValue;\n if (setters.some(function (f) { return f.length > 2; })) {\n // Lazily retrieve old value.\n oldValue = prevGet ? prevGet.call(this) : this[valueStoreKey];\n }\n try {\n for (var setters_1 = __values$J(setters), setters_1_1 = setters_1.next(); !setters_1_1.done; setters_1_1 = setters_1.next()) {\n var transformFn = setters_1_1.value;\n value = transformFn(this, propertyKeyOrSymbol, value, oldValue);\n if (value === BREAK_TRANSFORM_CHAIN) {\n return;\n }\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (setters_1_1 && !setters_1_1.done && (_a = setters_1.return)) _a.call(setters_1);\n }\n finally { if (e_2) throw e_2.error; }\n }\n if (prevSet) {\n prevSet.call(this, value);\n }\n else {\n this[valueStoreKey] = value;\n }\n };\n Object.defineProperty(target, propertyKeyOrSymbol, {\n set: setter,\n get: getter,\n enumerable: true,\n configurable: false,\n });\n return config[propertyKey];\n}\nfunction addTransformToInstanceProperty(setTransform, getTransform) {\n return function (target, propertyKeyOrSymbol) {\n var propertyKey = propertyKeyOrSymbol.toString();\n var valueStoreKey = \"__\" + propertyKey;\n var _a = initialiseConfig(target, propertyKeyOrSymbol, propertyKey, valueStoreKey), getters = _a.getters, setters = _a.setters;\n setters.push(setTransform);\n if (getTransform) {\n getters.splice(0, 0, getTransform);\n }\n };\n}\n\nfunction Validate(predicate) {\n return addTransformToInstanceProperty(function (target, prop, v) {\n var _a, _b, _c;\n if (predicate(v, { target: target })) {\n return v;\n }\n var cleanKey = prop.toString().replace(/^_*/, '');\n var targetClass = (_b = (_a = target.constructor) === null || _a === void 0 ? void 0 : _a.className) !== null && _b !== void 0 ? _b : (_c = target.constructor) === null || _c === void 0 ? void 0 : _c.name;\n if ((targetClass === null || targetClass === void 0 ? void 0 : targetClass.length) < 3) {\n targetClass = null;\n }\n var targetClassName = targetClass ? \"of [\" + targetClass + \"] \" : '';\n if (predicate.message) {\n Logger.warn(\"Property [\" + cleanKey + \"] \" + targetClassName + \"cannot be set to [\" + JSON.stringify(v) + \"]; \" + predicate.message + \", ignoring.\");\n }\n else {\n Logger.warn(\"Property [\" + cleanKey + \"] \" + targetClassName + \"cannot be set to [\" + JSON.stringify(v) + \"], ignoring.\");\n }\n return BREAK_TRANSFORM_CHAIN;\n });\n}\nfunction predicateWithMessage(predicate, message) {\n predicate.message = message;\n return predicate;\n}\nvar OPTIONAL = function (v, ctx, predicate) {\n return v === undefined || predicate(v, ctx);\n};\nvar ARRAY = function (length, predicate) {\n return predicateWithMessage(function (v, ctx) {\n return Array.isArray(v) &&\n (length ? v.length === length : true) &&\n (predicate ? v.every(function (e) { return predicate(e, ctx); }) : true);\n }, \"expecting an Array\");\n};\nvar OPT_ARRAY = function (length) {\n return predicateWithMessage(function (v, ctx) { return OPTIONAL(v, ctx, ARRAY(length)); }, 'expecting an optional Array');\n};\nvar AND = function () {\n var predicates = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n predicates[_i] = arguments[_i];\n }\n return predicateWithMessage(function (v, ctx) { return predicates.every(function (p) { return p(v, ctx); }); }, predicates\n .map(function (p) { return p.message; })\n .filter(function (m) { return m != null; })\n .join(' AND '));\n};\nvar OR = function () {\n var predicates = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n predicates[_i] = arguments[_i];\n }\n return predicateWithMessage(function (v, ctx) { return predicates.some(function (p) { return p(v, ctx); }); }, predicates\n .map(function (p) { return p.message; })\n .filter(function (m) { return m != null; })\n .join(' OR '));\n};\nvar isComparable = function (v) {\n return v != null && !isNaN(v);\n};\nvar LESS_THAN = function (otherField) {\n return predicateWithMessage(function (v, ctx) {\n return !isComparable(v) || !isComparable(ctx.target[otherField]) || v < ctx.target[otherField];\n }, \"expected to be less than \" + otherField);\n};\nvar GREATER_THAN = function (otherField) {\n return predicateWithMessage(function (v, ctx) {\n return !isComparable(v) || !isComparable(ctx.target[otherField]) || v > ctx.target[otherField];\n }, \"expected to be greater than \" + otherField);\n};\nvar FUNCTION = predicateWithMessage(function (v) { return typeof v === 'function'; }, 'expecting a Function');\nvar OPT_FUNCTION = predicateWithMessage(function (v, ctx) { return OPTIONAL(v, ctx, FUNCTION); }, \"expecting an optional Function\");\nvar BOOLEAN = predicateWithMessage(function (v) { return v === true || v === false; }, 'expecting a Boolean');\nvar OPT_BOOLEAN = predicateWithMessage(function (v, ctx) { return OPTIONAL(v, ctx, BOOLEAN); }, 'expecting an optional Boolean');\nvar STRING = predicateWithMessage(function (v) { return typeof v === 'string'; }, 'expecting a String');\nvar OPT_STRING = predicateWithMessage(function (v, ctx) { return OPTIONAL(v, ctx, STRING); }, 'expecting an optional String');\nvar DATE = predicateWithMessage(function (v) { return v instanceof Date && !isNaN(+v); }, 'expecting a Date object');\nvar OPT_DATE = predicateWithMessage(function (v, ctx) { return OPTIONAL(v, ctx, DATE); }, 'expecting an optional Date');\npredicateWithMessage(ARRAY(undefined, DATE), 'expecting an Array of Date objects');\nvar DATETIME_MS = NUMBER(0);\nvar OPT_DATETIME_MS = predicateWithMessage(function (v, ctx) { return OPTIONAL(v, ctx, DATETIME_MS); }, 'expecting an optional number');\nvar OPT_DATE_OR_DATETIME_MS = OR(OPT_DATE, OPT_DATETIME_MS);\nvar colorMessage = \"A color string can be in one of the following formats to be valid: #rgb, #rrggbb, rgb(r, g, b), rgba(r, g, b, a) or a CSS color name such as 'white', 'orange', 'cyan', etc\";\nvar COLOR_STRING = predicateWithMessage(function (v) {\n if (typeof v !== 'string') {\n return false;\n }\n return Color.validColorString(v);\n}, \"expecting a color String. \" + colorMessage);\nvar OPT_COLOR_STRING = predicateWithMessage(function (v, ctx) { return OPTIONAL(v, ctx, COLOR_STRING); }, \"expecting an optional color String. \" + colorMessage);\nvar COLOR_STRING_ARRAY = predicateWithMessage(ARRAY(undefined, COLOR_STRING), \"expecting an Array of color strings. \" + colorMessage);\nvar OPT_COLOR_STRING_ARRAY = predicateWithMessage(function (v, ctx) { return OPTIONAL(v, ctx, COLOR_STRING_ARRAY); }, \"expecting an optional Array of color strings. \" + colorMessage);\nfunction NUMBER(min, max) {\n var message = \"expecting a finite Number\" + ((min !== undefined ? ', more than or equal to ' + min : '') +\n (max !== undefined ? ', less than or equal to ' + max : ''));\n return predicateWithMessage(function (v) {\n return typeof v === 'number' &&\n Number.isFinite(v) &&\n (min !== undefined ? v >= min : true) &&\n (max !== undefined ? v <= max : true);\n }, message);\n}\nfunction OPT_NUMBER(min, max) {\n var message = \"expecting an optional finite Number\" + ((min !== undefined ? ', more than or equal to ' + min : '') +\n (max !== undefined ? ', less than or equal to ' + max : ''));\n return predicateWithMessage(function (v, ctx) { return OPTIONAL(v, ctx, NUMBER(min, max)); }, message);\n}\nfunction NUMBER_OR_NAN(min, max) {\n // Can be NaN or finite number\n var message = \"expecting a finite Number\" + ((min !== undefined ? ', more than or equal to ' + min : '') +\n (max !== undefined ? ', less than or equal to ' + max : ''));\n return predicateWithMessage(function (v) {\n return typeof v === 'number' &&\n (isNaN(v) ||\n (Number.isFinite(v) && (min !== undefined ? v >= min : true) && (max !== undefined ? v <= max : true)));\n }, message);\n}\nvar NUMBER_ARRAY = predicateWithMessage(ARRAY(undefined, NUMBER()), 'expecting an Array of numbers');\nvar OPT_NUMBER_ARRAY = predicateWithMessage(function (v, ctx) { return OPTIONAL(v, ctx, NUMBER_ARRAY); }, 'expecting an optional Array of numbers');\nvar STRING_ARRAY = predicateWithMessage(ARRAY(undefined, STRING), 'expecting an Array of strings');\npredicateWithMessage(function (v, ctx) { return OPTIONAL(v, ctx, STRING_ARRAY); }, 'expecting an optional Array of strings');\nfunction STRING_UNION() {\n var values = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n values[_i] = arguments[_i];\n }\n var message = \"expecting one of: \" + values.join(', ');\n return predicateWithMessage(function (v) { return typeof v === 'string' && values.indexOf(v) >= 0; }, message);\n}\nvar BOOLEAN_ARRAY = predicateWithMessage(ARRAY(undefined, BOOLEAN), 'expecting an Array of boolean values');\npredicateWithMessage(function (v, ctx) { return OPTIONAL(v, ctx, BOOLEAN_ARRAY); }, 'expecting an optional Array of boolean values');\nvar FONT_WEIGHTS = [\n 'normal',\n 'bold',\n 'bolder',\n 'lighter',\n '100',\n '200',\n '300',\n '400',\n '500',\n '600',\n '700',\n '800',\n '900',\n];\nvar FONT_STYLE = predicateWithMessage(function (v) { return v === 'normal' || v === 'italic' || v === 'oblique'; }, \"expecting a font style keyword such as 'normal', 'italic' or 'oblique'\");\nvar OPT_FONT_STYLE = predicateWithMessage(function (v, ctx) { return OPTIONAL(v, ctx, FONT_STYLE); }, \"expecting an optional font style keyword such as 'normal', 'italic' or 'oblique'\");\nvar FONT_WEIGHT = predicateWithMessage(function (v) { return FONT_WEIGHTS.includes(v); }, \"expecting a font weight keyword such as 'normal', 'bold' or 'bolder' or a numeric value such as 100, 300 or 600\");\nvar OPT_FONT_WEIGHT = predicateWithMessage(function (v, ctx) { return OPTIONAL(v, ctx, FONT_WEIGHT); }, \"expecting an optional font weight keyword such as 'normal', 'bold' or 'bolder' or a numeric value such as 100, 300 or 600\");\nvar LINE_DASH = predicateWithMessage(ARRAY(undefined, NUMBER(0)), 'expecting an Array of numbers specifying the length in pixels of alternating dashes and gaps, for example, [6, 3] means dashes with a length of 6 pixels with gaps between of 3 pixels.');\nvar OPT_LINE_DASH = predicateWithMessage(function (v, ctx) { return OPTIONAL(v, ctx, LINE_DASH); }, 'expecting an optional Array of numbers specifying the length in pixels of alternating dashes and gaps, for example, [6, 3] means dashes with a length of 6 pixels with gaps between of 3 pixels.');\nvar LINE_CAPS = ['butt', 'round', 'square'];\nvar LINE_CAP = predicateWithMessage(function (v) { return LINE_CAPS.includes(v); }, \"expecting a line cap keyword such as 'butt', 'round' or 'square'\");\npredicateWithMessage(function (v, ctx) { return OPTIONAL(v, ctx, LINE_CAP); }, \"expecting an optional line cap keyword such as 'butt', 'round' or 'square'\");\nvar LINE_JOINS = ['round', 'bevel', 'miter'];\nvar LINE_JOIN = predicateWithMessage(function (v) { return LINE_JOINS.includes(v); }, \"expecting a line join keyword such as 'round', 'bevel' or 'miter'\");\npredicateWithMessage(function (v, ctx) { return OPTIONAL(v, ctx, LINE_JOIN); }, \"expecting an optional line join keyword such as 'round', 'bevel' or 'miter'\");\nvar POSITIONS = ['top', 'right', 'bottom', 'left'];\nvar POSITION = predicateWithMessage(function (v) { return POSITIONS.includes(v); }, \"expecting a position keyword such as 'top', 'right', 'bottom' or 'left\");\nvar INTERACTION_RANGES = ['exact', 'nearest'];\nvar INTERACTION_RANGE = predicateWithMessage(function (v) { return (typeof v === 'number' && Number.isFinite(v)) || INTERACTION_RANGES.includes(v); }, \"expecting an interaction range of 'exact', 'nearest' or a number\");\nvar TEXT_WRAPS = ['never', 'always', 'hyphenate', 'on-space'];\nvar TEXT_WRAP = predicateWithMessage(function (v) { return TEXT_WRAPS.includes(v); }, \"expecting a text wrap strategy keyword such as 'never', 'always', 'hyphenate', 'on-space'\");\n\n/**\n * Constants to declare the expected nominal zIndex for all types of layer in chart rendering.\n */\nvar Layers;\n(function (Layers) {\n Layers[Layers[\"SERIES_BACKGROUND_ZINDEX\"] = -10] = \"SERIES_BACKGROUND_ZINDEX\";\n Layers[Layers[\"AXIS_GRID_ZINDEX\"] = 0] = \"AXIS_GRID_ZINDEX\";\n Layers[Layers[\"AXIS_ZINDEX\"] = 20] = \"AXIS_ZINDEX\";\n Layers[Layers[\"SERIES_CROSSLINE_RANGE_ZINDEX\"] = 30] = \"SERIES_CROSSLINE_RANGE_ZINDEX\";\n Layers[Layers[\"SERIES_LAYER_ZINDEX\"] = 500] = \"SERIES_LAYER_ZINDEX\";\n Layers[Layers[\"SERIES_CROSSHAIR_ZINDEX\"] = 1000] = \"SERIES_CROSSHAIR_ZINDEX\";\n Layers[Layers[\"SERIES_LABEL_ZINDEX\"] = 1500] = \"SERIES_LABEL_ZINDEX\";\n Layers[Layers[\"SERIES_CROSSLINE_LINE_ZINDEX\"] = 2500] = \"SERIES_CROSSLINE_LINE_ZINDEX\";\n Layers[Layers[\"LEGEND_ZINDEX\"] = 3000] = \"LEGEND_ZINDEX\";\n})(Layers || (Layers = {}));\n\nvar ChartAxisDirection;\n(function (ChartAxisDirection) {\n ChartAxisDirection[\"X\"] = \"x\";\n ChartAxisDirection[\"Y\"] = \"y\";\n})(ChartAxisDirection || (ChartAxisDirection = {}));\n\nvar DataDomain = /** @class */ (function () {\n function DataDomain(type) {\n this.type = type;\n this.continuousDomain = [Infinity, -Infinity];\n this.discreteDomain = new Set();\n }\n DataDomain.prototype.extend = function (val) {\n if (this.type === 'discrete') {\n this.discreteDomain.add(val);\n }\n else if (this.type === 'continuous') {\n if (this.continuousDomain[0] > val) {\n this.continuousDomain[0] = val;\n }\n if (this.continuousDomain[1] < val) {\n this.continuousDomain[1] = val;\n }\n }\n };\n DataDomain.prototype.getDomain = function () {\n if (this.type === 'discrete') {\n return this.discreteDomain;\n }\n else if (this.type === 'continuous') {\n return this.continuousDomain;\n }\n throw new Error('AG Charts - Unsupported data domain type: ' + this.type);\n };\n return DataDomain;\n}());\n\nvar __values$I = (undefined && undefined.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nfunction extendDomain(values, domain) {\n var e_1, _a;\n if (domain === void 0) { domain = [Infinity, -Infinity]; }\n try {\n for (var values_1 = __values$I(values), values_1_1 = values_1.next(); !values_1_1.done; values_1_1 = values_1.next()) {\n var value = values_1_1.value;\n if (typeof value !== 'number') {\n continue;\n }\n if (value < domain[0]) {\n domain[0] = value;\n }\n if (value > domain[1]) {\n domain[1] = value;\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (values_1_1 && !values_1_1.done && (_a = values_1.return)) _a.call(values_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n return domain;\n}\n\nvar __assign$R = (undefined && undefined.__assign) || function () {\n __assign$R = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$R.apply(this, arguments);\n};\nvar __read$13 = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __values$H = (undefined && undefined.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nvar __spreadArray$C = (undefined && undefined.__spreadArray) || function (to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\n to[j] = from[i];\n return to;\n};\nfunction toKeyString(keys) {\n return keys\n .map(function (v) {\n if (v == null) {\n return v;\n }\n else if (typeof v === 'number' || typeof v === 'string' || typeof v === 'boolean') {\n return v;\n }\n else if (typeof v === 'object') {\n return JSON.stringify(v);\n }\n return v;\n })\n .join('-');\n}\nfunction round(val) {\n var accuracy = 10000;\n if (Number.isInteger(val)) {\n return val;\n }\n else if (Math.abs(val) > accuracy) {\n return Math.trunc(val);\n }\n return Math.round(val * accuracy) / accuracy;\n}\nfunction fixNumericExtent(extent) {\n if (extent === undefined) {\n // Don't return a range, there is no range.\n return [];\n }\n var _a = __read$13(extent, 2), min = _a[0], max = _a[1];\n min = +min;\n max = +max;\n if (min === 0 && max === 0) {\n // domain has zero length and the single valid value is 0. Use the default of [0, 1].\n return [0, 1];\n }\n if (min === Infinity && max === -Infinity) {\n // There's no data in the domain.\n return [];\n }\n if (min === Infinity) {\n min = 0;\n }\n if (max === -Infinity) {\n max = 0;\n }\n if (!(isNumber$4(min) && isNumber$4(max))) {\n return [];\n }\n return [min, max];\n}\nvar INVALID_VALUE = Symbol('invalid');\nvar DataModel = /** @class */ (function () {\n function DataModel(opts) {\n var e_1, _a, e_2, _b, e_3, _c;\n var _this = this;\n var props = opts.props;\n // Validate that keys appear before values in the definitions, as output ordering depends\n // on configuration ordering, but we process keys before values.\n var keys = true;\n try {\n for (var props_1 = __values$H(props), props_1_1 = props_1.next(); !props_1_1.done; props_1_1 = props_1.next()) {\n var next = props_1_1.value;\n if (next.type === 'key' && !keys) {\n throw new Error('AG Charts - internal config error: keys must come before values.');\n }\n if (next.type === 'value' && keys) {\n keys = false;\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (props_1_1 && !props_1_1.done && (_a = props_1.return)) _a.call(props_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n this.opts = __assign$R({ dataVisible: true }, opts);\n this.keys = props\n .filter(function (def) { return def.type === 'key'; })\n .map(function (def, index) { return (__assign$R(__assign$R({}, def), { index: index, missing: 0 })); });\n this.values = props\n .filter(function (def) { return def.type === 'value'; })\n .map(function (def, index) { return (__assign$R(__assign$R({}, def), { index: index, missing: 0 })); });\n this.aggregates = props\n .filter(function (def) { return def.type === 'aggregate'; })\n .map(function (def, index) { return (__assign$R(__assign$R({}, def), { index: index })); });\n this.groupProcessors = props\n .filter(function (def) { return def.type === 'group-value-processor'; })\n .map(function (def, index) { return (__assign$R(__assign$R({}, def), { index: index })); });\n this.propertyProcessors = props\n .filter(function (def) { return def.type === 'property-value-processor'; })\n .map(function (def, index) { return (__assign$R(__assign$R({}, def), { index: index })); });\n this.reducers = props\n .filter(function (def) { return def.type === 'reducer'; })\n .map(function (def, index) { return (__assign$R(__assign$R({}, def), { index: index })); });\n this.processors = props\n .filter(function (def) { return def.type === 'processor'; })\n .map(function (def, index) { return (__assign$R(__assign$R({}, def), { index: index })); });\n try {\n for (var _d = __values$H(this.values), _e = _d.next(); !_e.done; _e = _d.next()) {\n var def = _e.value;\n if (def.property == null) {\n throw new Error(\"AG Charts - internal config error: no properties specified for value definitions: \" + JSON.stringify(def));\n }\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (_e && !_e.done && (_b = _d.return)) _b.call(_d);\n }\n finally { if (e_2) throw e_2.error; }\n }\n var verifyMatchGroupId = function (_a) {\n var e_4, _b;\n var matchGroupIds = _a.matchGroupIds;\n var _loop_1 = function (matchGroupId) {\n if (!_this.values.some(function (def) { return def.groupId === matchGroupId; })) {\n throw new Error(\"AG Charts - internal config error: matchGroupIds properties must match defined groups (\" + matchGroupId + \").\");\n }\n };\n try {\n for (var _c = __values$H(matchGroupIds !== null && matchGroupIds !== void 0 ? matchGroupIds : []), _d = _c.next(); !_d.done; _d = _c.next()) {\n var matchGroupId = _d.value;\n _loop_1(matchGroupId);\n }\n }\n catch (e_4_1) { e_4 = { error: e_4_1 }; }\n finally {\n try {\n if (_d && !_d.done && (_b = _c.return)) _b.call(_c);\n }\n finally { if (e_4) throw e_4.error; }\n }\n };\n var verifyMatchScopes = function (_a) {\n var e_5, _b;\n var matchScopes = _a.matchScopes;\n var _loop_2 = function (matchScope) {\n if (!_this.values.some(function (def) { var _a; return (_a = def.scopes) === null || _a === void 0 ? void 0 : _a.includes(matchScope); })) {\n throw new Error(\"AG Charts - internal config error: matchGroupIds properties must match defined groups (\" + matchScope + \").\");\n }\n };\n try {\n for (var _c = __values$H(matchScopes !== null && matchScopes !== void 0 ? matchScopes : []), _d = _c.next(); !_d.done; _d = _c.next()) {\n var matchScope = _d.value;\n _loop_2(matchScope);\n }\n }\n catch (e_5_1) { e_5 = { error: e_5_1 }; }\n finally {\n try {\n if (_d && !_d.done && (_b = _c.return)) _b.call(_c);\n }\n finally { if (e_5) throw e_5.error; }\n }\n };\n var verifyMatchIds = function (_a) {\n var e_6, _b;\n var matchIds = _a.matchIds;\n var _loop_3 = function (matchId) {\n if (!_this.values.some(function (def) { return def.id === matchId; })) {\n throw new Error(\"AG Charts - internal config error: matchGroupIds properties must match defined groups (\" + matchId + \").\");\n }\n };\n try {\n for (var _c = __values$H(matchIds !== null && matchIds !== void 0 ? matchIds : []), _d = _c.next(); !_d.done; _d = _c.next()) {\n var matchId = _d.value;\n _loop_3(matchId);\n }\n }\n catch (e_6_1) { e_6 = { error: e_6_1 }; }\n finally {\n try {\n if (_d && !_d.done && (_b = _c.return)) _b.call(_c);\n }\n finally { if (e_6) throw e_6.error; }\n }\n };\n try {\n for (var _f = __values$H(__spreadArray$C(__spreadArray$C([], __read$13(this.groupProcessors)), __read$13(this.aggregates))), _g = _f.next(); !_g.done; _g = _f.next()) {\n var def = _g.value;\n verifyMatchIds(def);\n verifyMatchGroupId(def);\n verifyMatchScopes(def);\n }\n }\n catch (e_3_1) { e_3 = { error: e_3_1 }; }\n finally {\n try {\n if (_g && !_g.done && (_c = _f.return)) _c.call(_f);\n }\n finally { if (e_3) throw e_3.error; }\n }\n }\n DataModel.prototype.resolveProcessedDataIndexById = function (scope, searchId, type) {\n var _a;\n if (type === void 0) { type = 'value'; }\n var _b = (_a = this.resolveProcessedDataDefById(scope, searchId, type)) !== null && _a !== void 0 ? _a : {}, index = _b.index, def = _b.def;\n return { type: type, index: index, def: def };\n };\n DataModel.prototype.resolveProcessedDataIndicesById = function (scope, searchId, type) {\n if (type === void 0) { type = 'value'; }\n return this.resolveProcessedDataDefsById(scope, searchId, type).map(function (_a) {\n var index = _a.index, def = _a.def;\n return ({ type: type, index: index, def: def });\n });\n };\n DataModel.prototype.resolveProcessedDataDefById = function (scope, searchId, type) {\n if (type === void 0) { type = 'value'; }\n return this.resolveProcessedDataDefsById(scope, searchId, type)[0];\n };\n DataModel.prototype.resolveProcessedDataDefsById = function (scope, searchId, type) {\n var e_7, _a;\n if (type === void 0) { type = 'value'; }\n var _b = this, keys = _b.keys, values = _b.values, aggregates = _b.aggregates, groupProcessors = _b.groupProcessors, reducers = _b.reducers;\n var match = function (_a) {\n var id = _a.id, scopes = _a.scopes;\n if (id == null)\n return false;\n if (scope != null && !(scopes === null || scopes === void 0 ? void 0 : scopes.includes(scope.id)))\n return false;\n if (typeof searchId === 'string') {\n return id === searchId;\n }\n return searchId.test(id);\n };\n var allDefs = [\n keys,\n values,\n aggregates,\n groupProcessors,\n reducers,\n ];\n var result = [];\n try {\n for (var allDefs_1 = __values$H(allDefs), allDefs_1_1 = allDefs_1.next(); !allDefs_1_1.done; allDefs_1_1 = allDefs_1.next()) {\n var defs = allDefs_1_1.value;\n result.push.apply(result, __spreadArray$C([], __read$13(defs.filter(match).map(function (def) { return ({ index: def.index, def: def }); }))));\n }\n }\n catch (e_7_1) { e_7 = { error: e_7_1 }; }\n finally {\n try {\n if (allDefs_1_1 && !allDefs_1_1.done && (_a = allDefs_1.return)) _a.call(allDefs_1);\n }\n finally { if (e_7) throw e_7.error; }\n }\n if (result.length > 0) {\n return result;\n }\n throw new Error(\"AG Charts - didn't find property definition for [\" + searchId + \", \" + scope.id + \", \" + type + \"]\");\n };\n DataModel.prototype.getDomain = function (scope, searchId, type, processedData) {\n var e_8, _a;\n var _b, _c, _d, _e;\n if (type === void 0) { type = 'value'; }\n var matches;\n try {\n matches = this.resolveProcessedDataIndicesById(scope, searchId, type);\n }\n catch (e) {\n if (typeof searchId !== 'string' && /didn't find property definition/.test(e.message))\n return [];\n throw e;\n }\n var domainProp;\n switch (type) {\n case 'key':\n domainProp = 'keys';\n break;\n case 'value':\n domainProp = 'values';\n break;\n case 'aggregate':\n domainProp = 'aggValues';\n break;\n case 'group-value-processor':\n domainProp = 'groups';\n break;\n default:\n return [];\n }\n var firstMatch = (_c = (_b = processedData.domain[domainProp]) === null || _b === void 0 ? void 0 : _b[matches[0].index]) !== null && _c !== void 0 ? _c : [];\n if (matches.length === 1) {\n return firstMatch;\n }\n var result = __spreadArray$C([], __read$13(firstMatch));\n try {\n for (var _f = __values$H(matches.slice(1)), _g = _f.next(); !_g.done; _g = _f.next()) {\n var idx = _g.value;\n extendDomain((_e = (_d = processedData.domain[domainProp]) === null || _d === void 0 ? void 0 : _d[idx.index]) !== null && _e !== void 0 ? _e : [], result);\n }\n }\n catch (e_8_1) { e_8 = { error: e_8_1 }; }\n finally {\n try {\n if (_g && !_g.done && (_a = _f.return)) _a.call(_f);\n }\n finally { if (e_8) throw e_8.error; }\n }\n return result;\n };\n DataModel.prototype.processData = function (data) {\n var e_9, _a, e_10, _b;\n var _c = this, _d = _c.opts, groupByKeys = _d.groupByKeys, groupByFn = _d.groupByFn, aggregates = _c.aggregates, groupProcessors = _c.groupProcessors, reducers = _c.reducers, processors = _c.processors, propertyProcessors = _c.propertyProcessors;\n var start = performance.now();\n try {\n for (var _e = __values$H(__spreadArray$C(__spreadArray$C([], __read$13(this.keys)), __read$13(this.values))), _f = _e.next(); !_f.done; _f = _e.next()) {\n var def = _f.value;\n def.missing = 0;\n }\n }\n catch (e_9_1) { e_9 = { error: e_9_1 }; }\n finally {\n try {\n if (_f && !_f.done && (_a = _e.return)) _a.call(_e);\n }\n finally { if (e_9) throw e_9.error; }\n }\n if (groupByKeys && this.keys.length === 0) {\n return undefined;\n }\n var processedData = this.extractData(data);\n if (groupByKeys) {\n processedData = this.groupData(processedData);\n }\n else if (groupByFn) {\n processedData = this.groupData(processedData, groupByFn(processedData));\n }\n if (groupProcessors.length > 0) {\n this.postProcessGroups(processedData);\n }\n if (aggregates.length > 0) {\n this.aggregateData(processedData);\n }\n if (propertyProcessors.length > 0) {\n this.postProcessProperties(processedData);\n }\n if (reducers.length > 0) {\n this.reduceData(processedData);\n }\n if (processors.length > 0) {\n this.postProcessData(processedData);\n }\n try {\n for (var _g = __values$H(__spreadArray$C(__spreadArray$C([], __read$13(this.keys)), __read$13(this.values))), _h = _g.next(); !_h.done; _h = _g.next()) {\n var def = _h.value;\n if (data.length > 0 && def.missing >= data.length) {\n Logger.warnOnce(\"the key '\" + def.property + \"' was not found in any data element.\");\n }\n }\n }\n catch (e_10_1) { e_10 = { error: e_10_1 }; }\n finally {\n try {\n if (_h && !_h.done && (_b = _g.return)) _b.call(_g);\n }\n finally { if (e_10) throw e_10.error; }\n }\n var end = performance.now();\n processedData.time = end - start;\n if (DataModel.DEBUG()) {\n logProcessedData(processedData);\n }\n return processedData;\n };\n DataModel.prototype.valueGroupIdxLookup = function (_a) {\n var matchGroupIds = _a.matchGroupIds, matchIds = _a.matchIds, matchScopes = _a.matchScopes;\n return this.values\n .map(function (def, index) { return ({ def: def, index: index }); })\n .filter(function (_a) {\n var def = _a.def;\n if (matchGroupIds && (def.groupId == null || !matchGroupIds.includes(def.groupId))) {\n return false;\n }\n if (matchIds && (def.id == null || !matchIds.includes(def.id))) {\n return false;\n }\n if (matchScopes && (def.scopes == null || !matchScopes.some(function (s) { var _a; return (_a = def.scopes) === null || _a === void 0 ? void 0 : _a.includes(s); }))) {\n return false;\n }\n return true;\n })\n .map(function (_a) {\n var index = _a.index;\n return index;\n });\n };\n DataModel.prototype.valueIdxLookup = function (scopes, prop) {\n var result;\n var noScopesToMatch = scopes == null || scopes.length === 0;\n var scopeMatch = function (compareTo) {\n var anyScope = compareTo == null;\n if (anyScope)\n return true;\n var noScopes = compareTo == null || compareTo.length === 0;\n if (noScopesToMatch === noScopes)\n return true;\n return compareTo === null || compareTo === void 0 ? void 0 : compareTo.some(function (s) { return scopes.includes(s); });\n };\n if (typeof prop === 'string') {\n result = this.values.findIndex(function (def) { return scopeMatch(def.scopes) && def.property === prop; });\n }\n else {\n result = this.values.findIndex(function (def) { return scopeMatch(def.scopes) && def.id === prop.id; });\n }\n if (result >= 0) {\n return result;\n }\n throw new Error(\"AG Charts - configuration error, unknown property \" + JSON.stringify(prop) + \" in scope(s) \" + JSON.stringify(scopes));\n };\n DataModel.prototype.extractData = function (data) {\n var e_11, _a, e_12, _b, e_13, _c, e_14, _d;\n var _e;\n var _f = this, keyDefs = _f.keys, valueDefs = _f.values, dataVisible = _f.opts.dataVisible;\n var _g = this.initDataDomainProcessor(), dataDomain = _g.dataDomain, processValue = _g.processValue, scopes = _g.scopes, allScopesHaveSameDefs = _g.allScopesHaveSameDefs;\n var resultData = new Array(dataVisible ? data.length : 0);\n var resultDataIdx = 0;\n var partialValidDataCount = 0;\n try {\n for (var data_1 = __values$H(data), data_1_1 = data_1.next(); !data_1_1.done; data_1_1 = data_1.next()) {\n var datum = data_1_1.value;\n var validScopes = scopes.size > 0 ? new Set(scopes) : undefined;\n var keys = dataVisible ? new Array(keyDefs.length) : undefined;\n var keyIdx = 0;\n var key = void 0;\n try {\n for (var keyDefs_1 = (e_12 = void 0, __values$H(keyDefs)), keyDefs_1_1 = keyDefs_1.next(); !keyDefs_1_1.done; keyDefs_1_1 = keyDefs_1.next()) {\n var def = keyDefs_1_1.value;\n key = processValue(def, datum, key);\n if (key === INVALID_VALUE)\n break;\n if (keys) {\n keys[keyIdx++] = key;\n }\n }\n }\n catch (e_12_1) { e_12 = { error: e_12_1 }; }\n finally {\n try {\n if (keyDefs_1_1 && !keyDefs_1_1.done && (_b = keyDefs_1.return)) _b.call(keyDefs_1);\n }\n finally { if (e_12) throw e_12.error; }\n }\n if (key === INVALID_VALUE)\n continue;\n var values = dataVisible && valueDefs.length > 0 ? new Array(valueDefs.length) : undefined;\n var valueIdx = 0;\n var value = void 0;\n try {\n for (var valueDefs_1 = (e_13 = void 0, __values$H(valueDefs)), valueDefs_1_1 = valueDefs_1.next(); !valueDefs_1_1.done; valueDefs_1_1 = valueDefs_1.next()) {\n var def = valueDefs_1_1.value;\n value = processValue(def, datum, value);\n if (value === INVALID_VALUE) {\n if (allScopesHaveSameDefs)\n break;\n try {\n for (var _h = (e_14 = void 0, __values$H((_e = def.scopes) !== null && _e !== void 0 ? _e : scopes)), _j = _h.next(); !_j.done; _j = _h.next()) {\n var scope = _j.value;\n validScopes === null || validScopes === void 0 ? void 0 : validScopes.delete(scope);\n }\n }\n catch (e_14_1) { e_14 = { error: e_14_1 }; }\n finally {\n try {\n if (_j && !_j.done && (_d = _h.return)) _d.call(_h);\n }\n finally { if (e_14) throw e_14.error; }\n }\n valueIdx++;\n if ((validScopes === null || validScopes === void 0 ? void 0 : validScopes.size) === 0)\n break;\n }\n else if (values) {\n values[valueIdx++] = value;\n }\n }\n }\n catch (e_13_1) { e_13 = { error: e_13_1 }; }\n finally {\n try {\n if (valueDefs_1_1 && !valueDefs_1_1.done && (_c = valueDefs_1.return)) _c.call(valueDefs_1);\n }\n finally { if (e_13) throw e_13.error; }\n }\n if (value === INVALID_VALUE && allScopesHaveSameDefs)\n continue;\n if ((validScopes === null || validScopes === void 0 ? void 0 : validScopes.size) === 0)\n continue;\n if (dataVisible) {\n var result = {\n datum: datum,\n keys: keys,\n values: values,\n };\n if (!allScopesHaveSameDefs && validScopes && validScopes.size < scopes.size) {\n partialValidDataCount++;\n result.validScopes = __spreadArray$C([], __read$13(validScopes));\n }\n resultData[resultDataIdx++] = result;\n }\n }\n }\n catch (e_11_1) { e_11 = { error: e_11_1 }; }\n finally {\n try {\n if (data_1_1 && !data_1_1.done && (_a = data_1.return)) _a.call(data_1);\n }\n finally { if (e_11) throw e_11.error; }\n }\n resultData.length = resultDataIdx;\n var propertyDomain = function (def) {\n var result = dataDomain.get(def).getDomain();\n if (Array.isArray(result) && result[0] > result[1]) {\n // Ignore starting values.\n return [];\n }\n return __spreadArray$C([], __read$13(result));\n };\n return {\n type: 'ungrouped',\n data: resultData,\n domain: {\n keys: keyDefs.map(function (def) { return propertyDomain(def); }),\n values: valueDefs.map(function (def) { return propertyDomain(def); }),\n },\n defs: {\n allScopesHaveSameDefs: allScopesHaveSameDefs,\n keys: keyDefs,\n values: valueDefs,\n },\n partialValidDataCount: partialValidDataCount,\n time: 0,\n };\n };\n DataModel.prototype.groupData = function (data, groupingFn) {\n var e_15, _a, e_16, _b;\n var _c, _d, _e, _f;\n var processedData = new Map();\n try {\n for (var _g = __values$H(data.data), _h = _g.next(); !_h.done; _h = _g.next()) {\n var dataEntry = _h.value;\n var keys = dataEntry.keys, values = dataEntry.values, datum = dataEntry.datum, validScopes = dataEntry.validScopes;\n var group = groupingFn ? groupingFn(dataEntry) : keys;\n var groupStr = toKeyString(group);\n if (processedData.has(groupStr)) {\n var existingData = processedData.get(groupStr);\n existingData.values.push(values);\n existingData.datum.push(datum);\n if (validScopes != null) {\n var _loop_4 = function (index) {\n var scope = (_e = existingData.validScopes) === null || _e === void 0 ? void 0 : _e[index];\n if (validScopes.some(function (s) { return s === scope; }))\n return \"continue\";\n (_f = existingData.validScopes) === null || _f === void 0 ? void 0 : _f.splice(index, 1);\n };\n // Intersection of existing validScopes with new validScopes.\n for (var index = 0; index < ((_d = (_c = existingData.validScopes) === null || _c === void 0 ? void 0 : _c.length) !== null && _d !== void 0 ? _d : 0); index++) {\n _loop_4(index);\n }\n }\n }\n else {\n processedData.set(groupStr, { keys: group, values: [values], datum: [datum], validScopes: validScopes });\n }\n }\n }\n catch (e_15_1) { e_15 = { error: e_15_1 }; }\n finally {\n try {\n if (_h && !_h.done && (_a = _g.return)) _a.call(_g);\n }\n finally { if (e_15) throw e_15.error; }\n }\n var resultData = new Array(processedData.size);\n var resultGroups = new Array(processedData.size);\n var dataIndex = 0;\n try {\n for (var _j = __values$H(processedData.entries()), _k = _j.next(); !_k.done; _k = _j.next()) {\n var _l = __read$13(_k.value, 2), _m = _l[1], keys = _m.keys, values = _m.values, datum = _m.datum, validScopes = _m.validScopes;\n if ((validScopes === null || validScopes === void 0 ? void 0 : validScopes.length) === 0)\n continue;\n resultGroups[dataIndex] = keys;\n resultData[dataIndex++] = {\n keys: keys,\n values: values,\n datum: datum,\n validScopes: validScopes,\n };\n }\n }\n catch (e_16_1) { e_16 = { error: e_16_1 }; }\n finally {\n try {\n if (_k && !_k.done && (_b = _j.return)) _b.call(_j);\n }\n finally { if (e_16) throw e_16.error; }\n }\n return __assign$R(__assign$R({}, data), { type: 'grouped', data: resultData, domain: __assign$R(__assign$R({}, data.domain), { groups: resultGroups }) });\n };\n DataModel.prototype.aggregateData = function (processedData) {\n var e_17, _a;\n var _this = this;\n var _b, _c, _d, _e, _f, _g, _h, _j;\n var aggDefs = this.aggregates;\n if (!aggDefs)\n return;\n var resultAggValues = aggDefs.map(function () { return [Infinity, -Infinity]; });\n var resultAggValueIndices = aggDefs.map(function (def) { return _this.valueGroupIdxLookup(def); });\n var resultAggFns = aggDefs.map(function (def) { return def.aggregateFunction; });\n var resultGroupAggFns = aggDefs.map(function (def) { return def.groupAggregateFunction; });\n var resultFinalFns = aggDefs.map(function (def) { return def.finalFunction; });\n var _loop_5 = function (group) {\n var e_18, _m, e_19, _o;\n var values = group.values;\n var validScopes = group.validScopes;\n (_b = group.aggValues) !== null && _b !== void 0 ? _b : (group.aggValues = new Array(resultAggValueIndices.length));\n if (processedData.type === 'ungrouped') {\n values = [values];\n }\n var resultIdx = 0;\n try {\n for (var resultAggValueIndices_1 = (e_18 = void 0, __values$H(resultAggValueIndices)), resultAggValueIndices_1_1 = resultAggValueIndices_1.next(); !resultAggValueIndices_1_1.done; resultAggValueIndices_1_1 = resultAggValueIndices_1.next()) {\n var indices = resultAggValueIndices_1_1.value;\n var scopeValid = (_c = validScopes === null || validScopes === void 0 ? void 0 : validScopes.some(function (s) { var _a; return (_a = aggDefs[resultIdx].matchScopes) === null || _a === void 0 ? void 0 : _a.some(function (as) { return s === as; }); })) !== null && _c !== void 0 ? _c : true;\n if (!scopeValid) {\n resultIdx++;\n continue;\n }\n var groupAggValues = (_e = (_d = resultGroupAggFns[resultIdx]) === null || _d === void 0 ? void 0 : _d.call(resultGroupAggFns)) !== null && _e !== void 0 ? _e : extendDomain([]);\n var _loop_6 = function (distinctValues) {\n var valuesToAgg = indices.map(function (valueIdx) { return distinctValues[valueIdx]; });\n var valuesAgg = resultAggFns[resultIdx](valuesToAgg, group.keys);\n if (valuesAgg) {\n groupAggValues =\n (_g = (_f = resultGroupAggFns[resultIdx]) === null || _f === void 0 ? void 0 : _f.call(resultGroupAggFns, valuesAgg, groupAggValues)) !== null && _g !== void 0 ? _g : extendDomain(valuesAgg, groupAggValues);\n }\n };\n try {\n for (var values_1 = (e_19 = void 0, __values$H(values)), values_1_1 = values_1.next(); !values_1_1.done; values_1_1 = values_1.next()) {\n var distinctValues = values_1_1.value;\n _loop_6(distinctValues);\n }\n }\n catch (e_19_1) { e_19 = { error: e_19_1 }; }\n finally {\n try {\n if (values_1_1 && !values_1_1.done && (_o = values_1.return)) _o.call(values_1);\n }\n finally { if (e_19) throw e_19.error; }\n }\n var finalValues = ((_j = (_h = resultFinalFns[resultIdx]) === null || _h === void 0 ? void 0 : _h.call(resultFinalFns, groupAggValues)) !== null && _j !== void 0 ? _j : groupAggValues).map(function (v) {\n return round(v);\n });\n extendDomain(finalValues, resultAggValues[resultIdx]);\n group.aggValues[resultIdx++] = finalValues;\n }\n }\n catch (e_18_1) { e_18 = { error: e_18_1 }; }\n finally {\n try {\n if (resultAggValueIndices_1_1 && !resultAggValueIndices_1_1.done && (_m = resultAggValueIndices_1.return)) _m.call(resultAggValueIndices_1);\n }\n finally { if (e_18) throw e_18.error; }\n }\n };\n try {\n for (var _k = __values$H(processedData.data), _l = _k.next(); !_l.done; _l = _k.next()) {\n var group = _l.value;\n _loop_5(group);\n }\n }\n catch (e_17_1) { e_17 = { error: e_17_1 }; }\n finally {\n try {\n if (_l && !_l.done && (_a = _k.return)) _a.call(_k);\n }\n finally { if (e_17) throw e_17.error; }\n }\n processedData.domain.aggValues = resultAggValues;\n };\n DataModel.prototype.postProcessGroups = function (processedData) {\n var e_20, _a, e_21, _b, e_22, _c, e_23, _d, e_24, _e, e_25, _f;\n var _g, _h, _j, _k, _l;\n var groupProcessors = this.groupProcessors;\n if (!groupProcessors)\n return;\n var affectedIndices = new Set();\n var updatedDomains = new Map();\n var groupProcessorIndices = new Map();\n var groupProcessorInitFns = new Map();\n try {\n for (var groupProcessors_1 = __values$H(groupProcessors), groupProcessors_1_1 = groupProcessors_1.next(); !groupProcessors_1_1.done; groupProcessors_1_1 = groupProcessors_1.next()) {\n var processor = groupProcessors_1_1.value;\n var indices = this.valueGroupIdxLookup(processor);\n groupProcessorIndices.set(processor, indices);\n groupProcessorInitFns.set(processor, processor.adjust());\n try {\n for (var indices_1 = (e_21 = void 0, __values$H(indices)), indices_1_1 = indices_1.next(); !indices_1_1.done; indices_1_1 = indices_1.next()) {\n var idx = indices_1_1.value;\n var valueDef = this.values[idx];\n affectedIndices.add(idx);\n updatedDomains.set(idx, new DataDomain(valueDef.valueType === 'category' ? 'discrete' : 'continuous'));\n }\n }\n catch (e_21_1) { e_21 = { error: e_21_1 }; }\n finally {\n try {\n if (indices_1_1 && !indices_1_1.done && (_b = indices_1.return)) _b.call(indices_1);\n }\n finally { if (e_21) throw e_21.error; }\n }\n }\n }\n catch (e_20_1) { e_20 = { error: e_20_1 }; }\n finally {\n try {\n if (groupProcessors_1_1 && !groupProcessors_1_1.done && (_a = groupProcessors_1.return)) _a.call(groupProcessors_1);\n }\n finally { if (e_20) throw e_20.error; }\n }\n var updateDomains = function (values) {\n var e_26, _a;\n var _b;\n try {\n for (var affectedIndices_1 = __values$H(affectedIndices), affectedIndices_1_1 = affectedIndices_1.next(); !affectedIndices_1_1.done; affectedIndices_1_1 = affectedIndices_1.next()) {\n var valueIndex = affectedIndices_1_1.value;\n (_b = updatedDomains.get(valueIndex)) === null || _b === void 0 ? void 0 : _b.extend(values[valueIndex]);\n }\n }\n catch (e_26_1) { e_26 = { error: e_26_1 }; }\n finally {\n try {\n if (affectedIndices_1_1 && !affectedIndices_1_1.done && (_a = affectedIndices_1.return)) _a.call(affectedIndices_1);\n }\n finally { if (e_26) throw e_26.error; }\n }\n };\n try {\n for (var _m = __values$H(processedData.data), _o = _m.next(); !_o.done; _o = _m.next()) {\n var group = _o.value;\n var _loop_7 = function (processor) {\n var e_27, _s;\n var scopeValid = (_h = (_g = group.validScopes) === null || _g === void 0 ? void 0 : _g.some(function (s) { var _a; return (_a = processor.matchScopes) === null || _a === void 0 ? void 0 : _a.some(function (as) { return s === as; }); })) !== null && _h !== void 0 ? _h : true;\n if (!scopeValid) {\n return \"continue\";\n }\n var valueIndexes = (_j = groupProcessorIndices.get(processor)) !== null && _j !== void 0 ? _j : [];\n var adjustFn = (_l = (_k = groupProcessorInitFns.get(processor)) === null || _k === void 0 ? void 0 : _k()) !== null && _l !== void 0 ? _l : (function () { return undefined; });\n if (processedData.type === 'grouped') {\n try {\n for (var _t = (e_27 = void 0, __values$H(group.values)), _u = _t.next(); !_u.done; _u = _t.next()) {\n var values = _u.value;\n if (values) {\n adjustFn(values, valueIndexes);\n }\n }\n }\n catch (e_27_1) { e_27 = { error: e_27_1 }; }\n finally {\n try {\n if (_u && !_u.done && (_s = _t.return)) _s.call(_t);\n }\n finally { if (e_27) throw e_27.error; }\n }\n return \"continue\";\n }\n if (group.values) {\n adjustFn(group.values, valueIndexes);\n }\n };\n try {\n for (var groupProcessors_2 = (e_23 = void 0, __values$H(groupProcessors)), groupProcessors_2_1 = groupProcessors_2.next(); !groupProcessors_2_1.done; groupProcessors_2_1 = groupProcessors_2.next()) {\n var processor = groupProcessors_2_1.value;\n _loop_7(processor);\n }\n }\n catch (e_23_1) { e_23 = { error: e_23_1 }; }\n finally {\n try {\n if (groupProcessors_2_1 && !groupProcessors_2_1.done && (_d = groupProcessors_2.return)) _d.call(groupProcessors_2);\n }\n finally { if (e_23) throw e_23.error; }\n }\n if (processedData.type === 'grouped') {\n try {\n for (var _p = (e_24 = void 0, __values$H(group.values)), _q = _p.next(); !_q.done; _q = _p.next()) {\n var values = _q.value;\n updateDomains(values);\n }\n }\n catch (e_24_1) { e_24 = { error: e_24_1 }; }\n finally {\n try {\n if (_q && !_q.done && (_e = _p.return)) _e.call(_p);\n }\n finally { if (e_24) throw e_24.error; }\n }\n }\n else {\n updateDomains(group.values);\n }\n }\n }\n catch (e_22_1) { e_22 = { error: e_22_1 }; }\n finally {\n try {\n if (_o && !_o.done && (_c = _m.return)) _c.call(_m);\n }\n finally { if (e_22) throw e_22.error; }\n }\n try {\n for (var updatedDomains_1 = __values$H(updatedDomains), updatedDomains_1_1 = updatedDomains_1.next(); !updatedDomains_1_1.done; updatedDomains_1_1 = updatedDomains_1.next()) {\n var _r = __read$13(updatedDomains_1_1.value, 2), idx = _r[0], dataDomain = _r[1];\n processedData.domain.values[idx] = __spreadArray$C([], __read$13(dataDomain.getDomain()));\n }\n }\n catch (e_25_1) { e_25 = { error: e_25_1 }; }\n finally {\n try {\n if (updatedDomains_1_1 && !updatedDomains_1_1.done && (_f = updatedDomains_1.return)) _f.call(updatedDomains_1);\n }\n finally { if (e_25) throw e_25.error; }\n }\n };\n DataModel.prototype.postProcessProperties = function (processedData) {\n var e_28, _a;\n var propertyProcessors = this.propertyProcessors;\n if (!propertyProcessors)\n return;\n try {\n for (var propertyProcessors_1 = __values$H(propertyProcessors), propertyProcessors_1_1 = propertyProcessors_1.next(); !propertyProcessors_1_1.done; propertyProcessors_1_1 = propertyProcessors_1.next()) {\n var _b = propertyProcessors_1_1.value, adjust = _b.adjust, property = _b.property, scopes = _b.scopes;\n adjust()(processedData, this.valueIdxLookup(scopes !== null && scopes !== void 0 ? scopes : [], property));\n }\n }\n catch (e_28_1) { e_28 = { error: e_28_1 }; }\n finally {\n try {\n if (propertyProcessors_1_1 && !propertyProcessors_1_1.done && (_a = propertyProcessors_1.return)) _a.call(propertyProcessors_1);\n }\n finally { if (e_28) throw e_28.error; }\n }\n };\n DataModel.prototype.reduceData = function (processedData) {\n var e_29, _a;\n var _b, _c, _d;\n var reducerDefs = this.reducers;\n var scopes = reducerDefs.map(function (def) { return def.scopes; });\n var reducers = reducerDefs.map(function (def) { return def.reducer(); });\n var accValues = reducerDefs.map(function (def) { return def.initialValue; });\n var _loop_8 = function (group) {\n var e_30, _g;\n var reducerIndex = 0;\n try {\n for (var reducers_1 = (e_30 = void 0, __values$H(reducers)), reducers_1_1 = reducers_1.next(); !reducers_1_1.done; reducers_1_1 = reducers_1.next()) {\n var reducer = reducers_1_1.value;\n var scopeValid = (_c = (_b = group.validScopes) === null || _b === void 0 ? void 0 : _b.some(function (s) { var _a; return (_a = scopes[reducerIndex]) === null || _a === void 0 ? void 0 : _a.some(function (as) { return s === as; }); })) !== null && _c !== void 0 ? _c : true;\n if (!scopeValid) {\n reducerIndex++;\n continue;\n }\n accValues[reducerIndex] = reducer(accValues[reducerIndex], group);\n reducerIndex++;\n }\n }\n catch (e_30_1) { e_30 = { error: e_30_1 }; }\n finally {\n try {\n if (reducers_1_1 && !reducers_1_1.done && (_g = reducers_1.return)) _g.call(reducers_1);\n }\n finally { if (e_30) throw e_30.error; }\n }\n };\n try {\n for (var _e = __values$H(processedData.data), _f = _e.next(); !_f.done; _f = _e.next()) {\n var group = _f.value;\n _loop_8(group);\n }\n }\n catch (e_29_1) { e_29 = { error: e_29_1 }; }\n finally {\n try {\n if (_f && !_f.done && (_a = _e.return)) _a.call(_e);\n }\n finally { if (e_29) throw e_29.error; }\n }\n for (var accIdx = 0; accIdx < accValues.length; accIdx++) {\n (_d = processedData.reduced) !== null && _d !== void 0 ? _d : (processedData.reduced = {});\n processedData.reduced[reducerDefs[accIdx].property] = accValues[accIdx];\n }\n };\n DataModel.prototype.postProcessData = function (processedData) {\n var e_31, _a;\n var _b;\n var processorDefs = this.processors;\n try {\n for (var processorDefs_1 = __values$H(processorDefs), processorDefs_1_1 = processorDefs_1.next(); !processorDefs_1_1.done; processorDefs_1_1 = processorDefs_1.next()) {\n var def = processorDefs_1_1.value;\n (_b = processedData.reduced) !== null && _b !== void 0 ? _b : (processedData.reduced = {});\n processedData.reduced[def.property] = def.calculate(processedData);\n }\n }\n catch (e_31_1) { e_31 = { error: e_31_1 }; }\n finally {\n try {\n if (processorDefs_1_1 && !processorDefs_1_1.done && (_a = processorDefs_1.return)) _a.call(processorDefs_1);\n }\n finally { if (e_31) throw e_31.error; }\n }\n };\n DataModel.prototype.initDataDomainProcessor = function () {\n var e_32, _a, e_33, _b;\n var _c;\n var _d = this, keyDefs = _d.keys, valueDefs = _d.values;\n var scopes = new Set();\n try {\n for (var valueDefs_2 = __values$H(valueDefs), valueDefs_2_1 = valueDefs_2.next(); !valueDefs_2_1.done; valueDefs_2_1 = valueDefs_2.next()) {\n var valueDef = valueDefs_2_1.value;\n try {\n for (var _e = (e_33 = void 0, __values$H((_c = valueDef.scopes) !== null && _c !== void 0 ? _c : [])), _f = _e.next(); !_f.done; _f = _e.next()) {\n var scope = _f.value;\n scopes.add(scope);\n }\n }\n catch (e_33_1) { e_33 = { error: e_33_1 }; }\n finally {\n try {\n if (_f && !_f.done && (_b = _e.return)) _b.call(_e);\n }\n finally { if (e_33) throw e_33.error; }\n }\n }\n }\n catch (e_32_1) { e_32 = { error: e_32_1 }; }\n finally {\n try {\n if (valueDefs_2_1 && !valueDefs_2_1.done && (_a = valueDefs_2.return)) _a.call(valueDefs_2);\n }\n finally { if (e_32) throw e_32.error; }\n }\n var scopesCount = scopes.size;\n var dataDomain = new Map();\n var processorFns = new Map();\n var allScopesHaveSameDefs = true;\n var initDataDomainKey = function (key, type, updateDataDomain) {\n var _a;\n if (updateDataDomain === void 0) { updateDataDomain = dataDomain; }\n if (type === 'category') {\n updateDataDomain.set(key, new DataDomain('discrete'));\n }\n else {\n updateDataDomain.set(key, new DataDomain('continuous'));\n allScopesHaveSameDefs && (allScopesHaveSameDefs = ((_a = key.scopes) !== null && _a !== void 0 ? _a : []).length === scopesCount);\n }\n };\n var initDataDomain = function () {\n keyDefs.forEach(function (def) { return initDataDomainKey(def, def.valueType); });\n valueDefs.forEach(function (def) { return initDataDomainKey(def, def.valueType); });\n };\n initDataDomain();\n var accessors = this.buildAccessors.apply(this, __spreadArray$C(__spreadArray$C([], __read$13(keyDefs)), __read$13(valueDefs)));\n var processValue = function (def, datum, previousDatum) {\n var _a, _b, _c, _d;\n var hasAccessor = def.property in accessors;\n var valueInDatum = false;\n var value;\n if (hasAccessor) {\n try {\n value = accessors[def.property](datum);\n }\n catch (error) {\n // Swallow errors - these get reported as missing values to the user later.\n }\n valueInDatum = value !== undefined;\n }\n else {\n valueInDatum = def.property in datum;\n value = valueInDatum ? datum[def.property] : def.missingValue;\n }\n var missingValueDef = 'missingValue' in def;\n if (!valueInDatum && !missingValueDef) {\n def.missing++;\n }\n if (!dataDomain.has(def)) {\n initDataDomain();\n }\n if (valueInDatum) {\n var valid = (_b = (_a = def.validation) === null || _a === void 0 ? void 0 : _a.call(def, value, datum)) !== null && _b !== void 0 ? _b : true;\n if (!valid) {\n if ('invalidValue' in def) {\n value = def.invalidValue;\n }\n else {\n return INVALID_VALUE;\n }\n }\n }\n if (def.processor) {\n if (!processorFns.has(def)) {\n processorFns.set(def, def.processor());\n }\n value = (_c = processorFns.get(def)) === null || _c === void 0 ? void 0 : _c(value, previousDatum !== INVALID_VALUE ? previousDatum : undefined);\n }\n (_d = dataDomain.get(def)) === null || _d === void 0 ? void 0 : _d.extend(value);\n return value;\n };\n return { dataDomain: dataDomain, processValue: processValue, initDataDomain: initDataDomain, scopes: scopes, allScopesHaveSameDefs: allScopesHaveSameDefs };\n };\n DataModel.prototype.buildAccessors = function () {\n var e_34, _a;\n var defs = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n defs[_i] = arguments[_i];\n }\n var result = {};\n try {\n for (var defs_1 = __values$H(defs), defs_1_1 = defs_1.next(); !defs_1_1.done; defs_1_1 = defs_1.next()) {\n var def = defs_1_1.value;\n var isPath = def.property.indexOf('.') >= 0 || def.property.indexOf('[') >= 0;\n if (!isPath)\n continue;\n var fnBody = void 0;\n if (def.property.startsWith('[')) {\n fnBody = \"return datum\" + def.property + \";\";\n }\n else {\n fnBody = \"return datum.\" + def.property + \";\";\n }\n result[def.property] = new Function('datum', fnBody);\n }\n }\n catch (e_34_1) { e_34 = { error: e_34_1 }; }\n finally {\n try {\n if (defs_1_1 && !defs_1_1.done && (_a = defs_1.return)) _a.call(defs_1);\n }\n finally { if (e_34) throw e_34.error; }\n }\n return result;\n };\n DataModel.DEBUG = function () { var _a; return (_a = [true, 'data-model'].includes(windowValue('agChartsDebug'))) !== null && _a !== void 0 ? _a : false; };\n return DataModel;\n}());\nfunction logProcessedData(processedData) {\n var _a, _b;\n var log = function (name, data) {\n if (data.length > 0) {\n // eslint-disable-next-line no-console\n console.log(\"DataModel.processData() - \" + name);\n // eslint-disable-next-line no-console\n console.table(data);\n }\n };\n // eslint-disable-next-line no-console\n console.log('DataModel.processData() - processedData', processedData);\n log('Key Domains', processedData.domain.keys);\n log('Group Domains', (_a = processedData.domain.groups) !== null && _a !== void 0 ? _a : []);\n log('Value Domains', processedData.domain.values);\n log('Aggregate Domains', (_b = processedData.domain.aggValues) !== null && _b !== void 0 ? _b : []);\n if (processedData.type === 'grouped') {\n var flattenedValues = processedData.data.reduce(function (acc, next) {\n var _a, _b;\n var keys = (_a = next.keys) !== null && _a !== void 0 ? _a : [];\n var aggValues = (_b = next.aggValues) !== null && _b !== void 0 ? _b : [];\n var skipKeys = next.keys.map(function () { return undefined; });\n var skipAggValues = aggValues === null || aggValues === void 0 ? void 0 : aggValues.map(function () { return undefined; });\n acc.push.apply(acc, __spreadArray$C([], __read$13(next.values.map(function (v, i) { return __spreadArray$C(__spreadArray$C(__spreadArray$C([], __read$13((i === 0 ? keys : skipKeys))), __read$13((v !== null && v !== void 0 ? v : []))), __read$13((i == 0 ? aggValues : skipAggValues))); }))));\n return acc;\n }, []);\n log('Values', flattenedValues);\n }\n else {\n var flattenedValues = processedData.data.reduce(function (acc, next) {\n var _a;\n var aggValues = (_a = next.aggValues) !== null && _a !== void 0 ? _a : [];\n acc.push(__spreadArray$C(__spreadArray$C(__spreadArray$C([], __read$13(next.keys)), __read$13(next.values)), __read$13(aggValues)));\n return acc;\n }, []);\n log('Values', flattenedValues);\n }\n}\n\nfunction createDeprecationWarning() {\n return function (key, message) {\n var msg = [\"Property [\" + key + \"] is deprecated.\", message].filter(function (v) { return v != null; }).join(' ');\n Logger.warnOnce(msg);\n };\n}\nfunction Deprecated(message, opts) {\n var def = opts === null || opts === void 0 ? void 0 : opts.default;\n var warn = createDeprecationWarning();\n return addTransformToInstanceProperty(function (_, key, value) {\n if (value !== def) {\n warn(key.toString(), message);\n }\n return value;\n });\n}\nfunction DeprecatedAndRenamedTo(newPropName, mapValue) {\n var warnDeprecated = createDeprecationWarning();\n return addTransformToInstanceProperty(function (target, key, value) {\n if (value !== target[newPropName]) {\n warnDeprecated(key.toString(), \"Use [\" + newPropName + \"] instead.\");\n target[newPropName] = mapValue ? mapValue(value) : value;\n }\n return BREAK_TRANSFORM_CHAIN;\n }, function (target, key) {\n warnDeprecated(key.toString(), \"Use [\" + newPropName + \"] instead.\");\n return target[newPropName];\n });\n}\n\nvar __decorate$1X = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __values$G = (undefined && undefined.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nvar DEFAULT_TOOLTIP_CLASS = 'ag-chart-tooltip';\nvar defaultTooltipCss$1 = \"\\n.\" + DEFAULT_TOOLTIP_CLASS + \" {\\n transition: transform 0.1s ease;\\n display: table;\\n position: fixed;\\n left: 0px;\\n top: 0px;\\n white-space: nowrap;\\n z-index: 99999;\\n font: 12px Verdana, sans-serif;\\n color: black;\\n background: rgb(244, 244, 244);\\n border-radius: 5px;\\n box-shadow: 0 0 1px rgba(3, 3, 3, 0.7), 0.5vh 0.5vh 1vh rgba(3, 3, 3, 0.25);\\n}\\n\\n.\" + DEFAULT_TOOLTIP_CLASS + \"-no-interaction {\\n pointer-events: none;\\n user-select: none;\\n}\\n\\n.\" + DEFAULT_TOOLTIP_CLASS + \"-no-animation {\\n transition: none !important;\\n}\\n\\n.\" + DEFAULT_TOOLTIP_CLASS + \"-hidden {\\n visibility: hidden;\\n}\\n\\n.\" + DEFAULT_TOOLTIP_CLASS + \"-title {\\n font-weight: bold;\\n padding: 7px;\\n border-top-left-radius: 5px;\\n border-top-right-radius: 5px;\\n color: white;\\n background-color: #888888;\\n border-top-left-radius: 5px;\\n border-top-right-radius: 5px;\\n}\\n\\n.\" + DEFAULT_TOOLTIP_CLASS + \"-content {\\n padding: 7px;\\n line-height: 1.7em;\\n border-bottom-left-radius: 5px;\\n border-bottom-right-radius: 5px;\\n overflow: hidden;\\n}\\n\\n.\" + DEFAULT_TOOLTIP_CLASS + \"-content:empty {\\n padding: 0;\\n height: 7px;\\n}\\n\\n.\" + DEFAULT_TOOLTIP_CLASS + \"-arrow::before {\\n content: \\\"\\\";\\n\\n position: absolute;\\n top: 100%;\\n left: 50%;\\n transform: translateX(-50%);\\n\\n border: 6px solid #989898;\\n\\n border-left-color: transparent;\\n border-right-color: transparent;\\n border-top-color: #989898;\\n border-bottom-color: transparent;\\n\\n width: 0;\\n height: 0;\\n\\n margin: 0 auto;\\n}\\n\\n.\" + DEFAULT_TOOLTIP_CLASS + \"-arrow::after {\\n content: \\\"\\\";\\n\\n position: absolute;\\n top: 100%;\\n left: 50%;\\n transform: translateX(-50%);\\n\\n border: 5px solid black;\\n\\n border-left-color: transparent;\\n border-right-color: transparent;\\n border-top-color: rgb(244, 244, 244);\\n border-bottom-color: transparent;\\n\\n width: 0;\\n height: 0;\\n\\n margin: 0 auto;\\n}\\n\\n.ag-chart-wrapper {\\n box-sizing: border-box;\\n overflow: hidden;\\n}\\n\";\nfunction toTooltipHtml$1(input, defaults) {\n var _a, _b, _c, _d;\n if (typeof input === 'string') {\n return input;\n }\n defaults = defaults !== null && defaults !== void 0 ? defaults : {};\n var _e = input.content, content = _e === void 0 ? (_a = defaults.content) !== null && _a !== void 0 ? _a : '' : _e, _f = input.title, title = _f === void 0 ? (_b = defaults.title) !== null && _b !== void 0 ? _b : undefined : _f, _g = input.color, color = _g === void 0 ? (_c = defaults.color) !== null && _c !== void 0 ? _c : 'white' : _g, _h = input.backgroundColor, backgroundColor = _h === void 0 ? (_d = defaults.backgroundColor) !== null && _d !== void 0 ? _d : '#888' : _h;\n var titleHtml = title\n ? \"
\" + title + \"
\"\n : '';\n return titleHtml + \"
\" + content + \"
\";\n}\nvar POSITION_TYPES = ['pointer', 'node'];\nvar POSITION_TYPE = predicateWithMessage(function (v) { return POSITION_TYPES.includes(v); }, \"expecting a position type keyword such as 'pointer' or 'node'\");\nvar TooltipPosition = /** @class */ (function () {\n function TooltipPosition() {\n /** The type of positioning for the tooltip. By default, the tooltip follows the pointer. */\n this.type = 'pointer';\n /** The horizontal offset in pixels for the position of the tooltip. */\n this.xOffset = 0;\n /** The vertical offset in pixels for the position of the tooltip. */\n this.yOffset = 0;\n }\n __decorate$1X([\n Validate(POSITION_TYPE)\n ], TooltipPosition.prototype, \"type\", void 0);\n __decorate$1X([\n Validate(NUMBER())\n ], TooltipPosition.prototype, \"xOffset\", void 0);\n __decorate$1X([\n Validate(NUMBER())\n ], TooltipPosition.prototype, \"yOffset\", void 0);\n return TooltipPosition;\n}());\nvar Tooltip = /** @class */ (function () {\n function Tooltip(canvasElement, document, container) {\n var _this = this;\n this.enableInteraction = false;\n this.enabled = true;\n this.showArrow = undefined;\n this.class = undefined;\n this.lastClass = undefined;\n this.delay = 0;\n this.range = 'nearest';\n this.position = new TooltipPosition();\n this.showTimeout = 0;\n this._showArrow = true;\n this.tooltipRoot = container;\n var element = document.createElement('div');\n this.element = this.tooltipRoot.appendChild(element);\n this.element.classList.add(DEFAULT_TOOLTIP_CLASS);\n this.canvasElement = canvasElement;\n // Detect when the chart becomes invisible and hide the tooltip as well.\n if (window.IntersectionObserver) {\n var observer = new IntersectionObserver(function (entries) {\n var e_1, _a;\n try {\n for (var entries_1 = __values$G(entries), entries_1_1 = entries_1.next(); !entries_1_1.done; entries_1_1 = entries_1.next()) {\n var entry = entries_1_1.value;\n if (entry.target === _this.canvasElement && entry.intersectionRatio === 0) {\n _this.toggle(false);\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (entries_1_1 && !entries_1_1.done && (_a = entries_1.return)) _a.call(entries_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n }, { root: this.tooltipRoot });\n observer.observe(this.canvasElement);\n this.observer = observer;\n }\n if (Tooltip.tooltipDocuments.indexOf(document) < 0) {\n var styleElement = document.createElement('style');\n styleElement.innerHTML = defaultTooltipCss$1;\n // Make sure the default tooltip style goes before other styles so it can be overridden.\n document.head.insertBefore(styleElement, document.head.querySelector('style'));\n Tooltip.tooltipDocuments.push(document);\n }\n }\n Tooltip.prototype.destroy = function () {\n var parentNode = this.element.parentNode;\n if (parentNode) {\n parentNode.removeChild(this.element);\n }\n if (this.observer) {\n this.observer.unobserve(this.canvasElement);\n }\n };\n Tooltip.prototype.isVisible = function () {\n var element = this.element;\n return !element.classList.contains(DEFAULT_TOOLTIP_CLASS + '-hidden');\n };\n Tooltip.prototype.updateClass = function (visible, showArrow) {\n var _a = this, element = _a.element, newClass = _a.class, lastClass = _a.lastClass, enableInteraction = _a.enableInteraction;\n var wasVisible = this.isVisible();\n var toggleClass = function (name, include) {\n var className = DEFAULT_TOOLTIP_CLASS + \"-\" + name;\n if (include) {\n element.classList.add(className);\n }\n else {\n element.classList.remove(className);\n }\n };\n toggleClass('no-animation', !wasVisible && !!visible); // No animation on first show.\n toggleClass('no-interaction', !enableInteraction); // Prevent interaction.\n toggleClass('hidden', !visible); // Hide if not visible.\n toggleClass('arrow', !!showArrow); // Add arrow if tooltip is constrained.\n if (newClass !== lastClass) {\n if (lastClass) {\n element.classList.remove(lastClass);\n }\n if (newClass) {\n element.classList.add(newClass);\n }\n this.lastClass = newClass;\n }\n };\n /**\n * Shows tooltip at the given event's coordinates.\n * If the `html` parameter is missing, moves the existing tooltip to the new position.\n */\n Tooltip.prototype.show = function (meta, html, instantly) {\n var _this = this;\n var _a, _b, _c, _d, _e, _f, _g;\n if (instantly === void 0) { instantly = false; }\n var _h = this, element = _h.element, canvasElement = _h.canvasElement;\n if (html !== undefined) {\n element.innerHTML = html;\n }\n else if (!element.innerHTML) {\n this.toggle(false);\n return;\n }\n var limit = function (low, actual, high) {\n return Math.max(Math.min(actual, high), low);\n };\n var xOffset = (_b = (_a = meta.position) === null || _a === void 0 ? void 0 : _a.xOffset) !== null && _b !== void 0 ? _b : 0;\n var yOffset = (_d = (_c = meta.position) === null || _c === void 0 ? void 0 : _c.yOffset) !== null && _d !== void 0 ? _d : 0;\n var canvasRect = canvasElement.getBoundingClientRect();\n var naiveLeft = canvasRect.left + meta.offsetX - element.clientWidth / 2 + xOffset;\n var naiveTop = canvasRect.top + meta.offsetY - element.clientHeight - 8 + yOffset;\n var windowBounds = this.getWindowBoundingBox();\n var maxLeft = windowBounds.x + windowBounds.width - element.clientWidth - 1;\n var maxTop = windowBounds.y + windowBounds.height - element.clientHeight;\n var left = limit(windowBounds.x, naiveLeft, maxLeft);\n var top = limit(windowBounds.y, naiveTop, maxTop);\n var constrained = left !== naiveLeft || top !== naiveTop;\n var defaultShowArrow = !constrained && !xOffset && !yOffset;\n var showArrow = (_f = (_e = meta.showArrow) !== null && _e !== void 0 ? _e : this.showArrow) !== null && _f !== void 0 ? _f : defaultShowArrow;\n this.updateShowArrow(showArrow);\n element.style.transform = \"translate(\" + Math.round(left) + \"px, \" + Math.round(top) + \"px)\";\n this.enableInteraction = (_g = meta.enableInteraction) !== null && _g !== void 0 ? _g : false;\n if (this.delay > 0 && !instantly) {\n this.toggle(false);\n this.showTimeout = window.setTimeout(function () {\n _this.toggle(true);\n }, this.delay);\n return;\n }\n this.toggle(true);\n };\n Tooltip.prototype.getWindowBoundingBox = function () {\n return new BBox(0, 0, window.innerWidth, window.innerHeight);\n };\n Tooltip.prototype.toggle = function (visible) {\n if (!visible) {\n window.clearTimeout(this.showTimeout);\n }\n this.updateClass(visible, this._showArrow);\n };\n Tooltip.prototype.pointerLeftOntoTooltip = function (event) {\n var _a;\n if (!this.enableInteraction)\n return false;\n var classList = (_a = event.sourceEvent.relatedTarget) === null || _a === void 0 ? void 0 : _a.classList;\n var classes = ['', '-title', '-content'];\n var classListContains = Boolean(classes.filter(function (c) { return classList === null || classList === void 0 ? void 0 : classList.contains(\"\" + DEFAULT_TOOLTIP_CLASS + c); }));\n return classList !== undefined && classListContains;\n };\n Tooltip.prototype.updateShowArrow = function (show) {\n this._showArrow = show;\n };\n Tooltip.tooltipDocuments = [];\n __decorate$1X([\n Validate(BOOLEAN)\n ], Tooltip.prototype, \"enabled\", void 0);\n __decorate$1X([\n Validate(OPT_BOOLEAN)\n ], Tooltip.prototype, \"showArrow\", void 0);\n __decorate$1X([\n Validate(OPT_STRING)\n ], Tooltip.prototype, \"class\", void 0);\n __decorate$1X([\n Validate(NUMBER(0))\n ], Tooltip.prototype, \"delay\", void 0);\n __decorate$1X([\n DeprecatedAndRenamedTo('range', function (value) { return (value ? 'nearest' : 'exact'); })\n ], Tooltip.prototype, \"tracking\", void 0);\n __decorate$1X([\n Validate(INTERACTION_RANGE)\n ], Tooltip.prototype, \"range\", void 0);\n return Tooltip;\n}());\n\nvar __values$F = (undefined && undefined.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nfunction sumValues(values, accumulator) {\n var e_1, _a;\n if (accumulator === void 0) { accumulator = [0, 0]; }\n try {\n for (var values_1 = __values$F(values), values_1_1 = values_1.next(); !values_1_1.done; values_1_1 = values_1.next()) {\n var value = values_1_1.value;\n if (typeof value !== 'number') {\n continue;\n }\n if (value < 0) {\n accumulator[0] += value;\n }\n if (value > 0) {\n accumulator[1] += value;\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (values_1_1 && !values_1_1.done && (_a = values_1.return)) _a.call(values_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n return accumulator;\n}\nfunction groupSum(scope, id, matchGroupId) {\n return {\n id: id,\n scopes: [scope.id],\n type: 'aggregate',\n matchGroupIds: matchGroupId ? [matchGroupId] : undefined,\n aggregateFunction: function (values) { return sumValues(values); },\n groupAggregateFunction: function (next, acc) {\n var _a, _b;\n if (acc === void 0) { acc = [0, 0]; }\n acc[0] += (_a = next === null || next === void 0 ? void 0 : next[0]) !== null && _a !== void 0 ? _a : 0;\n acc[1] += (_b = next === null || next === void 0 ? void 0 : next[1]) !== null && _b !== void 0 ? _b : 0;\n return acc;\n },\n };\n}\nfunction groupCount(scope, id) {\n return {\n id: id,\n scopes: [scope.id],\n type: 'aggregate',\n aggregateFunction: function () { return [0, 1]; },\n groupAggregateFunction: function (next, acc) {\n var _a, _b;\n if (acc === void 0) { acc = [0, 0]; }\n acc[0] += (_a = next === null || next === void 0 ? void 0 : next[0]) !== null && _a !== void 0 ? _a : 0;\n acc[1] += (_b = next === null || next === void 0 ? void 0 : next[1]) !== null && _b !== void 0 ? _b : 0;\n return acc;\n },\n };\n}\nfunction groupAverage(scope, id, matchGroupId) {\n var result = {\n id: id,\n scopes: [scope.id],\n matchGroupIds: matchGroupId ? [matchGroupId] : undefined,\n type: 'aggregate',\n aggregateFunction: function (values) { return sumValues(values); },\n groupAggregateFunction: function (next, acc) {\n var _a, _b;\n if (acc === void 0) { acc = [0, 0, -1]; }\n acc[0] += (_a = next === null || next === void 0 ? void 0 : next[0]) !== null && _a !== void 0 ? _a : 0;\n acc[1] += (_b = next === null || next === void 0 ? void 0 : next[1]) !== null && _b !== void 0 ? _b : 0;\n acc[2]++;\n return acc;\n },\n finalFunction: function (acc) {\n if (acc === void 0) { acc = [0, 0, 0]; }\n var result = acc[0] + acc[1];\n if (result >= 0) {\n return [0, result / acc[2]];\n }\n return [result / acc[2], 0];\n },\n };\n return result;\n}\nfunction area(scope, id, aggFn, matchGroupId) {\n var result = {\n id: id,\n scopes: [scope.id],\n matchGroupIds: matchGroupId ? [matchGroupId] : undefined,\n type: 'aggregate',\n aggregateFunction: function (values, keyRange) {\n if (keyRange === void 0) { keyRange = []; }\n var keyWidth = keyRange[1] - keyRange[0];\n return aggFn.aggregateFunction(values).map(function (v) { return v / keyWidth; });\n },\n };\n if (aggFn.groupAggregateFunction) {\n result.groupAggregateFunction = aggFn.groupAggregateFunction;\n }\n return result;\n}\nfunction accumulatedValue() {\n return function () {\n var value = 0;\n return function (datum) {\n if (typeof datum !== 'number')\n return datum;\n if (isNaN(datum))\n return datum;\n value += datum;\n return value;\n };\n };\n}\n\nvar memorizedFns = new Map();\nfunction memo(params, fnGenerator) {\n var _a, _b, _c;\n var serialisedParams = JSON.stringify(params, null, 0);\n if (!memorizedFns.has(fnGenerator)) {\n memorizedFns.set(fnGenerator, new Map());\n }\n if (!((_a = memorizedFns.get(fnGenerator)) === null || _a === void 0 ? void 0 : _a.has(serialisedParams))) {\n (_b = memorizedFns.get(fnGenerator)) === null || _b === void 0 ? void 0 : _b.set(serialisedParams, fnGenerator(params));\n }\n return (_c = memorizedFns.get(fnGenerator)) === null || _c === void 0 ? void 0 : _c.get(serialisedParams);\n}\n\nvar __read$12 = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray$B = (undefined && undefined.__spreadArray) || function (to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\n to[j] = from[i];\n return to;\n};\nvar __values$E = (undefined && undefined.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nvar SMALLEST_KEY_INTERVAL = {\n type: 'reducer',\n property: 'smallestKeyInterval',\n initialValue: Infinity,\n reducer: function () {\n var prevX = NaN;\n return function (smallestSoFar, next) {\n var nextX = next.keys[0];\n var interval = Math.abs(nextX - prevX);\n prevX = nextX;\n if (!isNaN(interval) && interval > 0 && interval < smallestSoFar) {\n return interval;\n }\n return smallestSoFar;\n };\n },\n};\nvar SORT_DOMAIN_GROUPS = {\n type: 'processor',\n property: 'sortedGroupDomain',\n calculate: function (_a) {\n var groups = _a.domain.groups;\n if (groups == null)\n return undefined;\n return __spreadArray$B([], __read$12(groups)).sort(function (a, b) {\n for (var i = 0; i < a.length; i++) {\n var result = a[i] - b[i];\n if (result !== 0) {\n return result;\n }\n }\n return 0;\n });\n },\n};\nfunction normaliseFnBuilder(_a) {\n var normaliseTo = _a.normaliseTo, mode = _a.mode;\n var normalise = function (val, extent) {\n var result = (val * normaliseTo) / extent;\n if (result >= 0) {\n return Math.min(normaliseTo, result);\n }\n return Math.max(-normaliseTo, result);\n };\n return function () { return function () { return function (values, valueIndexes) {\n var e_2, _a, e_3, _b;\n var valuesExtent = [0, 0];\n try {\n for (var valueIndexes_1 = __values$E(valueIndexes), valueIndexes_1_1 = valueIndexes_1.next(); !valueIndexes_1_1.done; valueIndexes_1_1 = valueIndexes_1.next()) {\n var valueIdx = valueIndexes_1_1.value;\n var value = values[valueIdx];\n var valIdx = value < 0 ? 0 : 1;\n if (mode === 'sum') {\n valuesExtent[valIdx] += value;\n }\n else if (valIdx === 0) {\n valuesExtent[valIdx] = Math.min(valuesExtent[valIdx], value);\n }\n else {\n valuesExtent[valIdx] = Math.max(valuesExtent[valIdx], value);\n }\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (valueIndexes_1_1 && !valueIndexes_1_1.done && (_a = valueIndexes_1.return)) _a.call(valueIndexes_1);\n }\n finally { if (e_2) throw e_2.error; }\n }\n var extent = Math.max(Math.abs(valuesExtent[0]), valuesExtent[1]);\n try {\n for (var valueIndexes_2 = __values$E(valueIndexes), valueIndexes_2_1 = valueIndexes_2.next(); !valueIndexes_2_1.done; valueIndexes_2_1 = valueIndexes_2.next()) {\n var valueIdx = valueIndexes_2_1.value;\n values[valueIdx] = normalise(values[valueIdx], extent);\n }\n }\n catch (e_3_1) { e_3 = { error: e_3_1 }; }\n finally {\n try {\n if (valueIndexes_2_1 && !valueIndexes_2_1.done && (_b = valueIndexes_2.return)) _b.call(valueIndexes_2);\n }\n finally { if (e_3) throw e_3.error; }\n }\n }; }; };\n}\nfunction normaliseGroupTo(scope, matchGroupIds, normaliseTo, mode) {\n if (mode === void 0) { mode = 'sum'; }\n return {\n scopes: [scope.id],\n type: 'group-value-processor',\n matchGroupIds: matchGroupIds,\n adjust: memo({ normaliseTo: normaliseTo, mode: mode }, normaliseFnBuilder),\n };\n}\nfunction normalisePropertyFnBuilder(_a) {\n var normaliseTo = _a.normaliseTo, rangeMin = _a.rangeMin, rangeMax = _a.rangeMax;\n var normaliseSpan = normaliseTo[1] - normaliseTo[0];\n var normalise = function (val, start, span) {\n var result = normaliseTo[0] + ((val - start) / span) * normaliseSpan;\n if (span === 0)\n return normaliseTo[1];\n if (result >= normaliseTo[1])\n return normaliseTo[1];\n if (result < normaliseTo[0])\n return normaliseTo[0];\n return result;\n };\n return function () { return function (pData, pIdx) {\n var e_4, _a, e_5, _b;\n var _c = __read$12(pData.domain.values[pIdx], 2), start = _c[0], end = _c[1];\n if (rangeMin != null)\n start = rangeMin;\n if (rangeMax != null)\n end = rangeMax;\n var span = end - start;\n pData.domain.values[pIdx] = [normaliseTo[0], normaliseTo[1]];\n try {\n for (var _d = __values$E(pData.data), _e = _d.next(); !_e.done; _e = _d.next()) {\n var group = _e.value;\n var groupValues = group.values;\n if (pData.type === 'ungrouped') {\n groupValues = [groupValues];\n }\n try {\n for (var groupValues_1 = (e_5 = void 0, __values$E(groupValues)), groupValues_1_1 = groupValues_1.next(); !groupValues_1_1.done; groupValues_1_1 = groupValues_1.next()) {\n var values = groupValues_1_1.value;\n values[pIdx] = normalise(values[pIdx], start, span);\n }\n }\n catch (e_5_1) { e_5 = { error: e_5_1 }; }\n finally {\n try {\n if (groupValues_1_1 && !groupValues_1_1.done && (_b = groupValues_1.return)) _b.call(groupValues_1);\n }\n finally { if (e_5) throw e_5.error; }\n }\n }\n }\n catch (e_4_1) { e_4 = { error: e_4_1 }; }\n finally {\n try {\n if (_e && !_e.done && (_a = _d.return)) _a.call(_d);\n }\n finally { if (e_4) throw e_4.error; }\n }\n }; };\n}\nfunction normalisePropertyTo(scope, property, normaliseTo, rangeMin, rangeMax) {\n return {\n scopes: [scope.id],\n type: 'property-value-processor',\n property: property,\n adjust: memo({ normaliseTo: normaliseTo, rangeMin: rangeMin, rangeMax: rangeMax }, normalisePropertyFnBuilder),\n };\n}\nfunction buildGroupAccFn(mode) {\n return function () { return function () { return function (values, valueIndexes) {\n var e_6, _a;\n // Datum scope.\n var acc = 0;\n try {\n for (var valueIndexes_3 = __values$E(valueIndexes), valueIndexes_3_1 = valueIndexes_3.next(); !valueIndexes_3_1.done; valueIndexes_3_1 = valueIndexes_3.next()) {\n var valueIdx = valueIndexes_3_1.value;\n var currentVal = values[valueIdx];\n if (typeof currentVal !== 'number' || isNaN(currentVal))\n continue;\n if (mode === 'normal')\n acc += currentVal;\n values[valueIdx] = acc;\n if (mode === 'trailing')\n acc += currentVal;\n }\n }\n catch (e_6_1) { e_6 = { error: e_6_1 }; }\n finally {\n try {\n if (valueIndexes_3_1 && !valueIndexes_3_1.done && (_a = valueIndexes_3.return)) _a.call(valueIndexes_3);\n }\n finally { if (e_6) throw e_6.error; }\n }\n }; }; };\n}\nfunction buildGroupWindowAccFn(_a) {\n var mode = _a.mode, sum = _a.sum;\n return function () {\n // Entire data-set scope.\n var lastValues = [];\n var firstRow = true;\n return function () {\n // Group scope.\n return function (values, valueIndexes) {\n var e_7, _a;\n // Datum scope.\n var acc = 0;\n try {\n for (var valueIndexes_4 = __values$E(valueIndexes), valueIndexes_4_1 = valueIndexes_4.next(); !valueIndexes_4_1.done; valueIndexes_4_1 = valueIndexes_4.next()) {\n var valueIdx = valueIndexes_4_1.value;\n var currentVal = values[valueIdx];\n var lastValue = firstRow && sum === 'current' ? 0 : lastValues[valueIdx];\n lastValues[valueIdx] = currentVal;\n var sumValue = sum === 'current' ? currentVal : lastValue;\n if (typeof currentVal !== 'number' || isNaN(currentVal)) {\n values[valueIdx] = sumValue;\n continue;\n }\n if (typeof lastValue !== 'number' || isNaN(lastValue)) {\n values[valueIdx] = sumValue;\n continue;\n }\n if (mode === 'normal')\n acc += sumValue;\n values[valueIdx] = acc;\n if (mode === 'trailing')\n acc += sumValue;\n }\n }\n catch (e_7_1) { e_7 = { error: e_7_1 }; }\n finally {\n try {\n if (valueIndexes_4_1 && !valueIndexes_4_1.done && (_a = valueIndexes_4.return)) _a.call(valueIndexes_4);\n }\n finally { if (e_7) throw e_7.error; }\n }\n firstRow = false;\n };\n };\n };\n}\nfunction accumulateGroup(scope, matchGroupId, mode, sum) {\n var adjust;\n if (mode.startsWith('window')) {\n var modeParam = mode.endsWith('-trailing') ? 'trailing' : 'normal';\n adjust = memo({ mode: modeParam, sum: sum }, buildGroupWindowAccFn);\n }\n else {\n adjust = memo(mode, buildGroupAccFn);\n }\n return {\n scopes: [scope.id],\n type: 'group-value-processor',\n matchGroupIds: [matchGroupId],\n adjust: adjust,\n };\n}\nfunction diff(previousData, updateMovedDatums) {\n if (updateMovedDatums === void 0) { updateMovedDatums = true; }\n return {\n type: 'processor',\n property: 'diff',\n calculate: function (processedData) {\n var diff = {\n changed: false,\n added: [],\n updated: [],\n removed: [],\n };\n var added = new Map();\n var updated = new Map();\n var removed = new Map();\n var sep = '___';\n for (var i = 0; i < Math.max(previousData.data.length, processedData.data.length); i++) {\n var prev = previousData.data[i];\n var datum = processedData.data[i];\n var prevId = prev === null || prev === void 0 ? void 0 : prev.keys.join(sep);\n var datumId = datum === null || datum === void 0 ? void 0 : datum.keys.join(sep);\n if (prevId === datumId) {\n if (!arraysEqual(prev.values, datum.values)) {\n updated.set(datumId, datum);\n }\n continue;\n }\n if (removed.has(datumId)) {\n if (updateMovedDatums || !arraysEqual(removed.get(datumId).values, datum.values)) {\n updated.set(datumId, datum);\n }\n removed.delete(datumId);\n }\n else if (datum) {\n added.set(datumId, datum);\n }\n if (added.has(prevId)) {\n if (updateMovedDatums || !arraysEqual(added.get(prevId).values, prev.values)) {\n updated.set(prevId, prev);\n }\n added.delete(prevId);\n }\n else if (prev) {\n removed.set(prevId, prev);\n }\n }\n diff.added = Array.from(added.values()).map(function (datum) { return datum.keys; });\n diff.updated = Array.from(updated.values()).map(function (datum) { return datum.keys; });\n diff.removed = Array.from(removed.values()).map(function (datum) { return datum.keys; });\n diff.changed = diff.added.length > 0 || diff.updated.length > 0 || diff.removed.length > 0;\n return diff;\n },\n };\n}\nfunction arraysEqual(a, b) {\n if (a == null || b == null)\n return false;\n if (a.length !== b.length)\n return false;\n for (var i = 0; i < a.length; i++) {\n if (Array.isArray(a[i]) && Array.isArray(b[i]))\n return arraysEqual(a[i], b[i]);\n if (a[i] !== b[i])\n return false;\n }\n return true;\n}\n\nfunction ProxyPropertyOnWrite(childName, childProperty) {\n return addTransformToInstanceProperty(function (target, key, value) {\n target[childName][childProperty !== null && childProperty !== void 0 ? childProperty : key] = value;\n return value;\n });\n}\n/**\n * Allows side-effects to be triggered on property write.\n *\n * @param opts.newValue called when a new value is set - never called for undefined values.\n * @param opts.oldValue called with the old value before a new value is set - never called for\n * undefined values.\n * @param opts.changeValue called on any change to the value - always called.\n */\nfunction ActionOnSet(opts) {\n var newValueFn = opts.newValue, oldValueFn = opts.oldValue, changeValueFn = opts.changeValue;\n return addTransformToInstanceProperty(function (target, _, newValue, oldValue) {\n if (newValue !== oldValue) {\n if (oldValue !== undefined) {\n oldValueFn === null || oldValueFn === void 0 ? void 0 : oldValueFn.call(target, oldValue);\n }\n if (newValue !== undefined) {\n newValueFn === null || newValueFn === void 0 ? void 0 : newValueFn.call(target, newValue);\n }\n changeValueFn === null || changeValueFn === void 0 ? void 0 : changeValueFn.call(target, newValue, oldValue);\n }\n return newValue;\n });\n}\n\nvar __extends$2I = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign$Q = (undefined && undefined.__assign) || function () {\n __assign$Q = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$Q.apply(this, arguments);\n};\nvar __decorate$1W = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __rest$5 = (undefined && undefined.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nvar __values$D = (undefined && undefined.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nvar __read$11 = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray$A = (undefined && undefined.__spreadArray) || function (to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\n to[j] = from[i];\n return to;\n};\n/** Modes of matching user interactions to rendered nodes (e.g. hover or click) */\nvar SeriesNodePickMode;\n(function (SeriesNodePickMode) {\n /** Pick matches based upon pick coordinates being inside a matching shape/marker. */\n SeriesNodePickMode[SeriesNodePickMode[\"EXACT_SHAPE_MATCH\"] = 0] = \"EXACT_SHAPE_MATCH\";\n /** Pick matches by nearest category/X-axis value, then distance within that category/X-value. */\n SeriesNodePickMode[SeriesNodePickMode[\"NEAREST_BY_MAIN_AXIS_FIRST\"] = 1] = \"NEAREST_BY_MAIN_AXIS_FIRST\";\n /** Pick matches by nearest category value, then distance within that category. */\n SeriesNodePickMode[SeriesNodePickMode[\"NEAREST_BY_MAIN_CATEGORY_AXIS_FIRST\"] = 2] = \"NEAREST_BY_MAIN_CATEGORY_AXIS_FIRST\";\n /** Pick matches based upon distance to ideal position */\n SeriesNodePickMode[SeriesNodePickMode[\"NEAREST_NODE\"] = 3] = \"NEAREST_NODE\";\n})(SeriesNodePickMode || (SeriesNodePickMode = {}));\nfunction basicContinuousCheckDatumValidation(v) {\n return checkDatum(v, true) != null;\n}\nfunction basicDiscreteCheckDatumValidation(v) {\n return checkDatum(v, false) != null;\n}\nfunction keyProperty(scope, propName, continuous, opts) {\n if (opts === void 0) { opts = {}; }\n var result = __assign$Q({ scopes: [scope.id], property: propName, type: 'key', valueType: continuous ? 'range' : 'category', validation: continuous ? basicContinuousCheckDatumValidation : basicDiscreteCheckDatumValidation }, opts);\n return result;\n}\nfunction valueProperty(scope, propName, continuous, opts) {\n if (opts === void 0) { opts = {}; }\n var result = __assign$Q({ scopes: [scope.id], property: propName, type: 'value', valueType: continuous ? 'range' : 'category', validation: continuous ? basicContinuousCheckDatumValidation : basicDiscreteCheckDatumValidation }, opts);\n return result;\n}\nfunction rangedValueProperty(scope, propName, opts) {\n if (opts === void 0) { opts = {}; }\n var _a = opts.min, min = _a === void 0 ? -Infinity : _a, _b = opts.max, max = _b === void 0 ? Infinity : _b, defOpts = __rest$5(opts, [\"min\", \"max\"]);\n return __assign$Q({ scopes: [scope.id], type: 'value', property: propName, valueType: 'range', validation: basicContinuousCheckDatumValidation, processor: function () { return function (datum) {\n if (typeof datum !== 'number')\n return datum;\n if (isNaN(datum))\n return datum;\n return Math.min(Math.max(datum, min), max);\n }; } }, defOpts);\n}\nfunction accumulativeValueProperty(scope, propName, continuous, opts) {\n if (opts === void 0) { opts = {}; }\n var result = __assign$Q(__assign$Q({}, valueProperty(scope, propName, continuous, opts)), { processor: accumulatedValue() });\n return result;\n}\nfunction groupAccumulativeValueProperty(scope, propName, continuous, mode, sum, opts) {\n if (sum === void 0) { sum = 'current'; }\n return [valueProperty(scope, propName, continuous, opts), accumulateGroup(scope, opts.groupId, mode, sum)];\n}\nvar SeriesNodeBaseClickEvent = /** @class */ (function () {\n function SeriesNodeBaseClickEvent(nativeEvent, datum, series) {\n this.type = 'nodeClick';\n this.event = nativeEvent;\n this.datum = datum.datum;\n this.seriesId = series.id;\n }\n return SeriesNodeBaseClickEvent;\n}());\nvar SeriesNodeClickEvent = /** @class */ (function (_super) {\n __extends$2I(SeriesNodeClickEvent, _super);\n function SeriesNodeClickEvent() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n return SeriesNodeClickEvent;\n}(SeriesNodeBaseClickEvent));\nvar SeriesNodeDoubleClickEvent = /** @class */ (function (_super) {\n __extends$2I(SeriesNodeDoubleClickEvent, _super);\n function SeriesNodeDoubleClickEvent() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = 'nodeDoubleClick';\n return _this;\n }\n return SeriesNodeDoubleClickEvent;\n}(SeriesNodeBaseClickEvent));\nvar SeriesItemHighlightStyle = /** @class */ (function () {\n function SeriesItemHighlightStyle() {\n this.fill = 'yellow';\n this.fillOpacity = undefined;\n this.stroke = undefined;\n this.strokeWidth = undefined;\n }\n __decorate$1W([\n Validate(OPT_COLOR_STRING)\n ], SeriesItemHighlightStyle.prototype, \"fill\", void 0);\n __decorate$1W([\n Validate(OPT_NUMBER(0, 1))\n ], SeriesItemHighlightStyle.prototype, \"fillOpacity\", void 0);\n __decorate$1W([\n Validate(OPT_COLOR_STRING)\n ], SeriesItemHighlightStyle.prototype, \"stroke\", void 0);\n __decorate$1W([\n Validate(OPT_NUMBER(0))\n ], SeriesItemHighlightStyle.prototype, \"strokeWidth\", void 0);\n return SeriesItemHighlightStyle;\n}());\nvar SeriesHighlightStyle = /** @class */ (function () {\n function SeriesHighlightStyle() {\n this.strokeWidth = undefined;\n this.dimOpacity = undefined;\n this.enabled = undefined;\n }\n __decorate$1W([\n Validate(OPT_NUMBER(0))\n ], SeriesHighlightStyle.prototype, \"strokeWidth\", void 0);\n __decorate$1W([\n Validate(OPT_NUMBER(0, 1))\n ], SeriesHighlightStyle.prototype, \"dimOpacity\", void 0);\n __decorate$1W([\n Validate(OPT_BOOLEAN)\n ], SeriesHighlightStyle.prototype, \"enabled\", void 0);\n return SeriesHighlightStyle;\n}());\nvar TextHighlightStyle = /** @class */ (function () {\n function TextHighlightStyle() {\n this.color = 'black';\n }\n __decorate$1W([\n Validate(OPT_COLOR_STRING)\n ], TextHighlightStyle.prototype, \"color\", void 0);\n return TextHighlightStyle;\n}());\nvar HighlightStyle = /** @class */ (function () {\n function HighlightStyle() {\n this.item = new SeriesItemHighlightStyle();\n this.series = new SeriesHighlightStyle();\n this.text = new TextHighlightStyle();\n }\n return HighlightStyle;\n}());\nvar SeriesTooltip = /** @class */ (function () {\n function SeriesTooltip() {\n this.enabled = true;\n this.showArrow = undefined;\n this.interaction = new SeriesTooltipInteraction();\n this.position = new TooltipPosition();\n }\n __decorate$1W([\n Validate(BOOLEAN)\n ], SeriesTooltip.prototype, \"enabled\", void 0);\n __decorate$1W([\n Validate(OPT_BOOLEAN)\n ], SeriesTooltip.prototype, \"showArrow\", void 0);\n return SeriesTooltip;\n}());\nvar SeriesTooltipInteraction = /** @class */ (function () {\n function SeriesTooltipInteraction() {\n this.enabled = false;\n }\n __decorate$1W([\n Validate(BOOLEAN)\n ], SeriesTooltipInteraction.prototype, \"enabled\", void 0);\n return SeriesTooltipInteraction;\n}());\nvar Series = /** @class */ (function (_super) {\n __extends$2I(Series, _super);\n function Series(seriesOpts) {\n var _a;\n var _this = _super.call(this) || this;\n _this.id = createId$1(_this);\n // The group node that contains all the nodes used to render this series.\n _this.rootGroup = new Group({ name: 'seriesRoot', isVirtual: true });\n _this.axes = (_a = {},\n _a[ChartAxisDirection.X] = undefined,\n _a[ChartAxisDirection.Y] = undefined,\n _a);\n _this.directions = [ChartAxisDirection.X, ChartAxisDirection.Y];\n // Flag to determine if we should recalculate node data.\n _this.nodeDataRefresh = true;\n _this._data = undefined;\n _this._visible = true;\n _this.showInLegend = true;\n _this.cursor = 'default';\n _this.nodeClickRange = 'exact';\n _this.seriesGrouping = undefined;\n _this._declarationOrder = -1;\n _this.highlightStyle = new HighlightStyle();\n _this.ctx = seriesOpts.moduleCtx;\n var _b = seriesOpts.useLabelLayer, useLabelLayer = _b === void 0 ? false : _b, _c = seriesOpts.pickModes, pickModes = _c === void 0 ? [SeriesNodePickMode.NEAREST_BY_MAIN_AXIS_FIRST] : _c, _d = seriesOpts.directionKeys, directionKeys = _d === void 0 ? {} : _d, _e = seriesOpts.directionNames, directionNames = _e === void 0 ? {} : _e, _f = seriesOpts.contentGroupVirtual, contentGroupVirtual = _f === void 0 ? true : _f;\n var rootGroup = _this.rootGroup;\n _this.directionKeys = directionKeys;\n _this.directionNames = directionNames;\n _this.contentGroup = rootGroup.appendChild(new Group({\n name: _this.id + \"-content\",\n layer: !contentGroupVirtual,\n isVirtual: contentGroupVirtual,\n zIndex: Layers.SERIES_LAYER_ZINDEX,\n zIndexSubOrder: _this.getGroupZIndexSubOrder('data'),\n }));\n _this.highlightGroup = rootGroup.appendChild(new Group({\n name: _this.id + \"-highlight\",\n layer: true,\n zIndex: Layers.SERIES_LAYER_ZINDEX,\n zIndexSubOrder: _this.getGroupZIndexSubOrder('highlight'),\n }));\n _this.highlightNode = _this.highlightGroup.appendChild(new Group({ name: 'highlightNode' }));\n _this.highlightLabel = _this.highlightGroup.appendChild(new Group({ name: 'highlightLabel' }));\n _this.highlightNode.zIndex = 0;\n _this.highlightLabel.zIndex = 10;\n _this.pickModes = pickModes;\n if (useLabelLayer) {\n _this.labelGroup = rootGroup.appendChild(new Group({\n name: _this.id + \"-series-labels\",\n layer: true,\n zIndex: Layers.SERIES_LABEL_ZINDEX,\n }));\n }\n return _this;\n }\n Object.defineProperty(Series.prototype, \"type\", {\n get: function () {\n var _a;\n return (_a = this.constructor.type) !== null && _a !== void 0 ? _a : '';\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Series.prototype, \"data\", {\n get: function () {\n return this._data;\n },\n set: function (input) {\n this._data = input;\n this.nodeDataRefresh = true;\n },\n enumerable: false,\n configurable: true\n });\n Series.prototype.hasData = function () {\n var data = this.data;\n return data && (!Array.isArray(data) || data.length > 0);\n };\n Object.defineProperty(Series.prototype, \"visible\", {\n get: function () {\n return this._visible;\n },\n set: function (value) {\n this._visible = value;\n this.visibleChanged();\n },\n enumerable: false,\n configurable: true\n });\n Series.prototype.onSeriesGroupingChange = function (prev, next) {\n var _this = this;\n var _a = this, id = _a.id, type = _a.type, visible = _a.visible, rootGroup = _a.rootGroup;\n if (prev) {\n this.ctx.seriesStateManager.deregisterSeries({ id: id, type: type });\n }\n if (next) {\n this.ctx.seriesStateManager.registerSeries({ id: id, type: type, visible: visible, seriesGrouping: next });\n }\n this.ctx.seriesLayerManager.changeGroup({\n id: id,\n type: type,\n rootGroup: rootGroup,\n getGroupZIndexSubOrder: function (type) { return _this.getGroupZIndexSubOrder(type); },\n seriesGrouping: next,\n oldGrouping: prev,\n });\n };\n Series.prototype.getBandScalePadding = function () {\n return { inner: 1, outer: 0 };\n };\n Series.prototype.getGroupZIndexSubOrder = function (type, subIndex) {\n var _this = this;\n if (subIndex === void 0) { subIndex = 0; }\n var mainAdjust = 0;\n switch (type) {\n case 'data':\n case 'paths':\n break;\n case 'labels':\n mainAdjust += 20000;\n break;\n case 'marker':\n mainAdjust += 10000;\n break;\n // Following cases are in their own layer, so need to be careful to respect declarationOrder.\n case 'highlight':\n subIndex += 15000;\n break;\n }\n var main = function () { return _this._declarationOrder + mainAdjust; };\n return [main, subIndex];\n };\n Series.prototype.addChartEventListeners = function () {\n return;\n };\n Series.prototype.destroy = function () {\n this.ctx.seriesStateManager.deregisterSeries(this);\n this.ctx.seriesLayerManager.releaseGroup(this);\n };\n Series.prototype.getDirectionValues = function (direction, properties) {\n var _this = this;\n var resolvedDirection = this.resolveKeyDirection(direction);\n var keys = properties === null || properties === void 0 ? void 0 : properties[resolvedDirection];\n var values = [];\n var flatten = function () {\n var e_1, _a;\n var array = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n array[_i] = arguments[_i];\n }\n try {\n for (var array_1 = __values$D(array), array_1_1 = array_1.next(); !array_1_1.done; array_1_1 = array_1.next()) {\n var value = array_1_1.value;\n addValue(value);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (array_1_1 && !array_1_1.done && (_a = array_1.return)) _a.call(array_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n };\n var addValue = function (value) {\n if (Array.isArray(value)) {\n flatten.apply(void 0, __spreadArray$A([], __read$11(value)));\n }\n else if (typeof value === 'object') {\n flatten(Object.values(value));\n }\n else {\n values.push(value);\n }\n };\n if (!keys)\n return values;\n keys.forEach(function (key) {\n var value = _this[key];\n addValue(value);\n });\n return values;\n };\n Series.prototype.getKeys = function (direction) {\n return this.getDirectionValues(direction, this.directionKeys);\n };\n Series.prototype.getNames = function (direction) {\n return this.getDirectionValues(direction, this.directionNames);\n };\n Series.prototype.resolveKeyDirection = function (direction) {\n return direction;\n };\n // Indicate that something external changed and we should recalculate nodeData.\n Series.prototype.markNodeDataDirty = function () {\n this.nodeDataRefresh = true;\n };\n Series.prototype.visibleChanged = function () {\n this.ctx.seriesStateManager.registerSeries(this);\n };\n Series.prototype.getOpacity = function (datum) {\n var _a = this.highlightStyle.series, _b = _a.dimOpacity, dimOpacity = _b === void 0 ? 1 : _b, _c = _a.enabled, enabled = _c === void 0 ? true : _c;\n var defaultOpacity = 1;\n if (enabled === false || dimOpacity === defaultOpacity) {\n return defaultOpacity;\n }\n switch (this.isItemIdHighlighted(datum)) {\n case 'no-highlight':\n case 'highlighted':\n return defaultOpacity;\n case 'peer-highlighted':\n case 'other-highlighted':\n return dimOpacity;\n }\n };\n Series.prototype.getStrokeWidth = function (defaultStrokeWidth, datum) {\n var _a = this.highlightStyle.series, strokeWidth = _a.strokeWidth, _b = _a.enabled, enabled = _b === void 0 ? true : _b;\n if (enabled === false || strokeWidth === undefined) {\n // No change in styling for highlight cases.\n return defaultStrokeWidth;\n }\n switch (this.isItemIdHighlighted(datum)) {\n case 'highlighted':\n return strokeWidth;\n case 'no-highlight':\n case 'other-highlighted':\n case 'peer-highlighted':\n return defaultStrokeWidth;\n }\n };\n Series.prototype.isItemIdHighlighted = function (datum) {\n var _a;\n var highlightedDatum = (_a = this.ctx.highlightManager) === null || _a === void 0 ? void 0 : _a.getActiveHighlight();\n var _b = highlightedDatum !== null && highlightedDatum !== void 0 ? highlightedDatum : {}, series = _b.series, itemId = _b.itemId;\n var highlighting = series != null;\n if (!highlighting) {\n // Highlighting not active.\n return 'no-highlight';\n }\n if (series !== this) {\n // Highlighting active, this series not highlighted.\n return 'other-highlighted';\n }\n if (itemId === undefined) {\n // Series doesn't use itemIds - so no further refinement needed, series is highlighted.\n return 'highlighted';\n }\n if (datum && highlightedDatum !== datum && itemId !== datum.itemId) {\n // A peer (in same Series instance) sub-series has highlight active, but this sub-series\n // does not.\n return 'peer-highlighted';\n }\n return 'highlighted';\n };\n Series.prototype.pickNode = function (point, limitPickModes) {\n var e_2, _a;\n var _b = this, pickModes = _b.pickModes, visible = _b.visible, rootGroup = _b.rootGroup;\n if (!visible || !rootGroup.visible) {\n return;\n }\n try {\n for (var pickModes_1 = __values$D(pickModes), pickModes_1_1 = pickModes_1.next(); !pickModes_1_1.done; pickModes_1_1 = pickModes_1.next()) {\n var pickMode = pickModes_1_1.value;\n if (limitPickModes && !limitPickModes.includes(pickMode)) {\n continue;\n }\n var match = undefined;\n switch (pickMode) {\n case SeriesNodePickMode.EXACT_SHAPE_MATCH:\n match = this.pickNodeExactShape(point);\n break;\n case SeriesNodePickMode.NEAREST_BY_MAIN_AXIS_FIRST:\n case SeriesNodePickMode.NEAREST_BY_MAIN_CATEGORY_AXIS_FIRST:\n match = this.pickNodeMainAxisFirst(point, pickMode === SeriesNodePickMode.NEAREST_BY_MAIN_CATEGORY_AXIS_FIRST);\n break;\n case SeriesNodePickMode.NEAREST_NODE:\n match = this.pickNodeClosestDatum(point);\n break;\n }\n if (match) {\n return { pickMode: pickMode, match: match.datum, distance: match.distance };\n }\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (pickModes_1_1 && !pickModes_1_1.done && (_a = pickModes_1.return)) _a.call(pickModes_1);\n }\n finally { if (e_2) throw e_2.error; }\n }\n };\n Series.prototype.pickNodeExactShape = function (point) {\n var match = this.contentGroup.pickNode(point.x, point.y);\n if (match) {\n return {\n datum: match.datum,\n distance: 0,\n };\n }\n };\n Series.prototype.pickNodeClosestDatum = function (_point) {\n // Override point for sub-classes - but if this is invoked, the sub-class specified it wants\n // to use this feature.\n throw new Error('AG Charts - Series.pickNodeClosestDatum() not implemented');\n };\n Series.prototype.pickNodeMainAxisFirst = function (_point, _requireCategoryAxis) {\n // Override point for sub-classes - but if this is invoked, the sub-class specified it wants\n // to use this feature.\n throw new Error('AG Charts - Series.pickNodeMainAxisFirst() not implemented');\n };\n Series.prototype.fireNodeClickEvent = function (event, _datum) {\n var eventObject = this.getNodeClickEvent(event, _datum);\n this.fireEvent(eventObject);\n };\n Series.prototype.fireNodeDoubleClickEvent = function (event, _datum) {\n var eventObject = this.getNodeDoubleClickEvent(event, _datum);\n this.fireEvent(eventObject);\n };\n Series.prototype.getNodeClickEvent = function (event, datum) {\n return new SeriesNodeClickEvent(event, datum, this);\n };\n Series.prototype.getNodeDoubleClickEvent = function (event, datum) {\n return new SeriesNodeDoubleClickEvent(event, datum, this);\n };\n Series.prototype.toggleSeriesItem = function (_itemId, enabled) {\n this.visible = enabled;\n this.nodeDataRefresh = true;\n };\n Series.prototype.isEnabled = function () {\n return this.visible;\n };\n Series.prototype.fixNumericExtent = function (extent, axis) {\n var _a;\n var fixedExtent = fixNumericExtent(extent);\n if (fixedExtent.length === 0) {\n return fixedExtent;\n }\n var _b = __read$11(fixedExtent, 2), min = _b[0], max = _b[1];\n if (min === max) {\n // domain has zero length, there is only a single valid value in data\n var _c = __read$11((_a = axis === null || axis === void 0 ? void 0 : axis.calculatePadding(min, max)) !== null && _a !== void 0 ? _a : [1, 1], 2), paddingMin = _c[0], paddingMax = _c[1];\n min -= paddingMin;\n max += paddingMax;\n }\n return [min, max];\n };\n Series.highlightedZIndex = 1000000000000;\n __decorate$1W([\n Validate(STRING)\n ], Series.prototype, \"id\", void 0);\n __decorate$1W([\n Validate(BOOLEAN)\n ], Series.prototype, \"_visible\", void 0);\n __decorate$1W([\n Validate(BOOLEAN)\n ], Series.prototype, \"showInLegend\", void 0);\n __decorate$1W([\n Validate(STRING)\n ], Series.prototype, \"cursor\", void 0);\n __decorate$1W([\n Validate(INTERACTION_RANGE)\n ], Series.prototype, \"nodeClickRange\", void 0);\n __decorate$1W([\n ActionOnSet({\n changeValue: function (newVal, oldVal) {\n this.onSeriesGroupingChange(oldVal, newVal);\n },\n })\n ], Series.prototype, \"seriesGrouping\", void 0);\n return Series;\n}(Observable));\n\nvar __decorate$1V = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar Padding$1 = /** @class */ (function () {\n function Padding(top, right, bottom, left) {\n if (top === void 0) { top = 0; }\n if (right === void 0) { right = top; }\n if (bottom === void 0) { bottom = top; }\n if (left === void 0) { left = right; }\n this.top = top;\n this.right = right;\n this.bottom = bottom;\n this.left = left;\n }\n Padding.prototype.clear = function () {\n this.top = this.right = this.bottom = this.left = 0;\n };\n __decorate$1V([\n Validate(NUMBER(0))\n ], Padding.prototype, \"top\", void 0);\n __decorate$1V([\n Validate(NUMBER(0))\n ], Padding.prototype, \"right\", void 0);\n __decorate$1V([\n Validate(NUMBER(0))\n ], Padding.prototype, \"bottom\", void 0);\n __decorate$1V([\n Validate(NUMBER(0))\n ], Padding.prototype, \"left\", void 0);\n return Padding;\n}());\n\nvar __values$C = (undefined && undefined.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nvar SizeMonitor = /** @class */ (function () {\n function SizeMonitor() {\n }\n SizeMonitor.init = function () {\n var _this = this;\n var NativeResizeObserver = window.ResizeObserver;\n if (NativeResizeObserver) {\n this.resizeObserver = new NativeResizeObserver(function (entries) {\n var e_1, _a;\n try {\n for (var entries_1 = __values$C(entries), entries_1_1 = entries_1.next(); !entries_1_1.done; entries_1_1 = entries_1.next()) {\n var entry = entries_1_1.value;\n var _b = entry.contentRect, width = _b.width, height = _b.height;\n _this.checkSize(_this.elements.get(entry.target), entry.target, width, height);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (entries_1_1 && !entries_1_1.done && (_a = entries_1.return)) _a.call(entries_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n });\n }\n else {\n // polyfill (more reliable even in browsers that support ResizeObserver)\n var step = function () {\n _this.elements.forEach(function (entry, element) {\n _this.checkClientSize(element, entry);\n });\n };\n this.pollerHandler = window.setInterval(step, 100);\n }\n this.ready = true;\n };\n SizeMonitor.destroy = function () {\n var _a;\n if (this.pollerHandler != null) {\n clearInterval(this.pollerHandler);\n this.pollerHandler = undefined;\n }\n (_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();\n this.resizeObserver = undefined;\n this.ready = false;\n };\n SizeMonitor.checkSize = function (entry, element, width, height) {\n if (entry) {\n if (!entry.size || width !== entry.size.width || height !== entry.size.height) {\n entry.size = { width: width, height: height };\n entry.cb(entry.size, element);\n }\n }\n };\n // Only a single callback is supported.\n SizeMonitor.observe = function (element, cb) {\n if (!this.ready) {\n this.init();\n }\n this.unobserve(element, false);\n if (this.resizeObserver) {\n this.resizeObserver.observe(element);\n }\n this.elements.set(element, { cb: cb });\n // Ensure first size callback happens synchronously.\n this.checkClientSize(element, { cb: cb });\n };\n SizeMonitor.unobserve = function (element, cleanup) {\n if (cleanup === void 0) { cleanup = true; }\n if (this.resizeObserver) {\n this.resizeObserver.unobserve(element);\n }\n this.elements.delete(element);\n if (cleanup && this.elements.size === 0) {\n this.destroy();\n }\n };\n SizeMonitor.checkClientSize = function (element, entry) {\n var width = element.clientWidth ? element.clientWidth : 0;\n var height = element.clientHeight ? element.clientHeight : 0;\n this.checkSize(entry, element, width, height);\n };\n SizeMonitor.elements = new Map();\n SizeMonitor.ready = false;\n return SizeMonitor;\n}());\n\nfunction circleRectOverlap(c, x, y, w, h) {\n // Find closest horizontal and vertical edges.\n var edgeX = c.x;\n if (c.x < x) {\n edgeX = x;\n }\n else if (c.x > x + w) {\n edgeX = x + w;\n }\n var edgeY = c.y;\n if (c.y < y) {\n edgeY = y;\n }\n else if (c.y > y + h) {\n edgeY = y + h;\n }\n // Find distance to closest edges.\n var dx = c.x - edgeX;\n var dy = c.y - edgeY;\n var d = Math.sqrt(dx * dx + dy * dy);\n return d <= c.size * 0.5;\n}\nfunction rectRectOverlap(r1, x2, y2, w2, h2) {\n var xOverlap = r1.x + r1.width > x2 && r1.x < x2 + w2;\n var yOverlap = r1.y + r1.height > y2 && r1.y < y2 + h2;\n return xOverlap && yOverlap;\n}\nfunction rectContainsRect(r1, r2x, r2y, r2w, r2h) {\n return r2x + r2w < r1.x + r1.width && r2x > r1.x && r2y > r1.y && r2y + r2h < r1.y + r1.height;\n}\nfunction isPointLabelDatum(x) {\n return x != null && typeof x.point === 'object' && typeof x.label === 'object';\n}\n/**\n * @param data Points and labels for one or more series. The order of series determines label placement precedence.\n * @param bounds Bounds to fit the labels into. If a label can't be fully contained, it doesn't fit.\n * @returns Placed labels for the given series (in the given order).\n */\nfunction placeLabels(data, bounds, padding) {\n if (padding === void 0) { padding = 5; }\n var result = [];\n data = data.map(function (d) { return d.slice().sort(function (a, b) { return b.point.size - a.point.size; }); });\n for (var j = 0; j < data.length; j++) {\n var labels = (result[j] = []);\n var datum = data[j];\n if (!((datum === null || datum === void 0 ? void 0 : datum.length) && datum[0].label)) {\n continue;\n }\n var _loop_1 = function (i, ln) {\n var d = datum[i];\n var l = d.label;\n var r = d.point.size * 0.5;\n var x = d.point.x - l.width * 0.5;\n var y = d.point.y - r - l.height - padding;\n var width = l.width, height = l.height;\n var withinBounds = !bounds || rectContainsRect(bounds, x, y, width, height);\n if (!withinBounds) {\n return \"continue\";\n }\n var overlapPoints = data.some(function (datum) {\n return datum.some(function (d) { return circleRectOverlap(d.point, x, y, width, height); });\n });\n if (overlapPoints) {\n return \"continue\";\n }\n var overlapLabels = result.some(function (labels) { return labels.some(function (l) { return rectRectOverlap(l, x, y, width, height); }); });\n if (overlapLabels) {\n return \"continue\";\n }\n labels.push({\n index: i,\n text: l.text,\n x: x,\n y: y,\n width: width,\n height: height,\n datum: d,\n });\n };\n for (var i = 0, ln = datum.length; i < ln; i++) {\n _loop_1(i, ln);\n }\n }\n return result;\n}\nfunction axisLabelsOverlap(data, padding) {\n var result = [];\n var _loop_2 = function (i) {\n var datum = data[i];\n var _a = datum.point, x = _a.x, y = _a.y, text = datum.label.text;\n var _b = datum.label, width = _b.width, height = _b.height;\n width += padding !== null && padding !== void 0 ? padding : 0;\n height += padding !== null && padding !== void 0 ? padding : 0;\n var overlapLabels = result.some(function (l) {\n var overlap = rectRectOverlap(l, x, y, width, height);\n return overlap;\n });\n if (overlapLabels) {\n return { value: true };\n }\n result.push({\n index: i,\n text: text,\n x: x,\n y: y,\n width: width,\n height: height,\n datum: datum,\n });\n };\n for (var i = 0; i < data.length; i++) {\n var state_1 = _loop_2(i);\n if (typeof state_1 === \"object\")\n return state_1.value;\n }\n return false;\n}\n\nvar __awaiter$f = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator$f = (undefined && undefined.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\n/**\n * Wrap a function in debouncing trigger function. A requestAnimationFrame() is scheduled\n * after the first schedule() call, and subsequent schedule() calls will be ignored until the\n * animation callback executes.\n */\nfunction debouncedAnimationFrame(cb) {\n return buildScheduler(function (cb, _delayMs) { return requestAnimationFrame(cb); }, cb);\n}\nfunction debouncedCallback(cb) {\n return buildScheduler(function (cb, delayMs) {\n if (delayMs === void 0) { delayMs = 0; }\n return setTimeout(cb, delayMs);\n }, cb);\n}\nfunction buildScheduler(scheduleFn, cb) {\n var scheduleCount = 0;\n var promiseRunning = false;\n var awaitingPromise;\n var awaitingDone;\n var busy = function () {\n return promiseRunning;\n };\n var done = function () {\n promiseRunning = false;\n awaitingDone === null || awaitingDone === void 0 ? void 0 : awaitingDone();\n awaitingDone = undefined;\n awaitingPromise = undefined;\n if (scheduleCount > 0) {\n scheduleFn(scheduleCb);\n }\n };\n var scheduleCb = function () {\n var count = scheduleCount;\n scheduleCount = 0;\n promiseRunning = true;\n var maybePromise = cb({ count: count });\n if (!maybePromise) {\n done();\n return;\n }\n maybePromise.then(done).catch(done);\n };\n return {\n schedule: function (delayMs) {\n if (scheduleCount === 0 && !busy()) {\n scheduleFn(scheduleCb, delayMs);\n }\n scheduleCount++;\n },\n await: function () {\n return __awaiter$f(this, void 0, void 0, function () {\n return __generator$f(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!busy()) {\n return [2 /*return*/];\n }\n if (awaitingPromise == null) {\n awaitingPromise = new Promise(function (resolve) {\n awaitingDone = resolve;\n });\n }\n _a.label = 1;\n case 1:\n if (!busy()) return [3 /*break*/, 3];\n return [4 /*yield*/, awaitingPromise];\n case 2:\n _a.sent();\n return [3 /*break*/, 1];\n case 3: return [2 /*return*/];\n }\n });\n });\n },\n };\n}\n\nfunction sleep(sleepTimeoutMs) {\n return new Promise(function (resolve) {\n setTimeout(function () { return resolve(undefined); }, sleepTimeoutMs);\n });\n}\n\nvar __decorate$1U = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar Overlay = /** @class */ (function () {\n function Overlay(className, parent) {\n this.renderer = undefined;\n this.text = undefined;\n this.className = className;\n this.parentElement = parent;\n }\n Overlay.prototype.show = function (rect) {\n var _a, _b;\n var element = this.element;\n if (!element) {\n element = document.createElement('div');\n element.className = this.className;\n this.element = element;\n }\n element.style.position = 'absolute';\n element.style.left = rect.x + \"px\";\n element.style.top = rect.y + \"px\";\n element.style.width = rect.width + \"px\";\n element.style.height = rect.height + \"px\";\n if (this.renderer) {\n element.innerHTML = this.renderer();\n }\n else {\n var content = document.createElement('div');\n content.style.alignItems = 'center';\n content.style.boxSizing = 'border-box';\n content.style.display = 'flex';\n content.style.justifyContent = 'center';\n content.style.margin = '8px';\n content.style.height = '100%';\n content.style.font = '12px Verdana, sans-serif';\n content.innerText = (_a = this.text) !== null && _a !== void 0 ? _a : 'No data to display';\n element.append(content);\n }\n (_b = this.parentElement) === null || _b === void 0 ? void 0 : _b.append(element);\n };\n Overlay.prototype.hide = function () {\n var _a;\n (_a = this.element) === null || _a === void 0 ? void 0 : _a.remove();\n this.element = undefined;\n };\n __decorate$1U([\n Validate(OPT_FUNCTION)\n ], Overlay.prototype, \"renderer\", void 0);\n __decorate$1U([\n Validate(OPT_STRING)\n ], Overlay.prototype, \"text\", void 0);\n return Overlay;\n}());\n\nvar ChartOverlays = /** @class */ (function () {\n function ChartOverlays(parent) {\n this.noData = new Overlay('ag-chart-no-data-overlay', parent);\n }\n return ChartOverlays;\n}());\n\nvar __assign$P = (undefined && undefined.__assign) || function () {\n __assign$P = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$P.apply(this, arguments);\n};\nvar __read$10 = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray$z = (undefined && undefined.__spreadArray) || function (to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\n to[j] = from[i];\n return to;\n};\nvar __values$B = (undefined && undefined.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\n/**\n * Performs a JSON-diff between a source and target JSON structure.\n *\n * On a per property basis, takes the target property value where:\n * - types are different.\n * - type is primitive.\n * - type is array and length or content have changed.\n *\n * Recurses for object types.\n *\n * @param source starting point for diff\n * @param target target for diff vs. source\n *\n * @returns `null` if no differences, or an object with the subset of properties that have changed.\n */\nfunction jsonDiff(source, target) {\n var e_1, _a;\n var sourceType = classify(source);\n var targetType = classify(target);\n if (targetType === 'array') {\n var targetArray = target;\n if (sourceType !== 'array' || source.length !== targetArray.length) {\n return __spreadArray$z([], __read$10(targetArray));\n }\n if (targetArray.some(function (targetElement, i) { var _a; return jsonDiff((_a = source) === null || _a === void 0 ? void 0 : _a[i], targetElement) != null; })) {\n return __spreadArray$z([], __read$10(targetArray));\n }\n return null;\n }\n if (targetType === 'primitive') {\n if (sourceType !== 'primitive') {\n return __assign$P({}, target);\n }\n if (source !== target) {\n return target;\n }\n return null;\n }\n var lhs = source || {};\n var rhs = target || {};\n var allProps = new Set(__spreadArray$z(__spreadArray$z([], __read$10(Object.keys(lhs))), __read$10(Object.keys(rhs))));\n var propsChangedCount = 0;\n var result = {};\n var _loop_1 = function (prop) {\n // Cheap-and-easy equality check.\n if (lhs[prop] === rhs[prop]) {\n return \"continue\";\n }\n var take = function (v) {\n result[prop] = v;\n propsChangedCount++;\n };\n var lhsType = classify(lhs[prop]);\n var rhsType = classify(rhs[prop]);\n if (lhsType !== rhsType) {\n // Types changed, just take RHS.\n take(rhs[prop]);\n return \"continue\";\n }\n if (rhsType === 'primitive' || rhsType === null) {\n take(rhs[prop]);\n return \"continue\";\n }\n if (rhsType === 'array' && lhs[prop].length !== rhs[prop].length) {\n // Arrays are different sizes, so just take target array.\n take(rhs[prop]);\n return \"continue\";\n }\n if (rhsType === 'class-instance') {\n // Don't try to do anything tricky with array diffs!\n take(rhs[prop]);\n return \"continue\";\n }\n if (rhsType === 'function' && lhs[prop] !== rhs[prop]) {\n take(rhs[prop]);\n return \"continue\";\n }\n var diff = jsonDiff(lhs[prop], rhs[prop]);\n if (diff !== null) {\n take(diff);\n }\n };\n try {\n for (var allProps_1 = __values$B(allProps), allProps_1_1 = allProps_1.next(); !allProps_1_1.done; allProps_1_1 = allProps_1.next()) {\n var prop = allProps_1_1.value;\n _loop_1(prop);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (allProps_1_1 && !allProps_1_1.done && (_a = allProps_1.return)) _a.call(allProps_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n return propsChangedCount === 0 ? null : result;\n}\n/**\n * Special value used by `jsonMerge` to signal that a property should be removed from the merged\n * output.\n */\nvar DELETE = Symbol('');\nvar NOT_SPECIFIED = Symbol('');\n/**\n * Merge together the provide JSON object structures, with the precedence of application running\n * from higher indexes to lower indexes.\n *\n * Deep-clones all objects to avoid mutation of the inputs changing the output object. For arrays,\n * just performs a deep-clone of the entire array, no merging of elements attempted.\n *\n * @param json all json objects to merge\n * @param opts merge options\n * @param opts.avoidDeepClone contains a list of properties where deep clones should be avoided\n *\n * @returns the combination of all of the json inputs\n */\nfunction jsonMerge(json, opts) {\n var e_2, _a;\n var _b;\n var avoidDeepClone = (_b = opts === null || opts === void 0 ? void 0 : opts.avoidDeepClone) !== null && _b !== void 0 ? _b : [];\n var jsonTypes = json.map(function (v) { return classify(v); });\n if (jsonTypes.some(function (v) { return v === 'array'; })) {\n // Clone final array.\n var finalValue = json[json.length - 1];\n if (finalValue instanceof Array) {\n return finalValue.map(function (v) {\n var type = classify(v);\n if (type === 'array')\n return jsonMerge([[], v], opts);\n if (type === 'object')\n return jsonMerge([{}, v], opts);\n return v;\n });\n }\n return finalValue;\n }\n var result = {};\n var props = new Set(json.map(function (v) { return (v != null ? Object.keys(v) : []); }).reduce(function (r, n) { return r.concat(n); }, []));\n var _loop_2 = function (nextProp) {\n var values = json\n .map(function (j) {\n if (j != null && typeof j === 'object' && nextProp in j) {\n return j[nextProp];\n }\n return NOT_SPECIFIED;\n })\n .filter(function (v) { return v !== NOT_SPECIFIED; });\n if (values.length === 0) {\n return \"continue\";\n }\n var lastValue = values[values.length - 1];\n if (lastValue === DELETE) {\n return \"continue\";\n }\n var types = values.map(function (v) { return classify(v); });\n var type = types[0];\n if (types.some(function (t) { return t !== type; })) {\n // Short-circuit if mismatching types.\n result[nextProp] = lastValue;\n return \"continue\";\n }\n if ((type === 'array' || type === 'object') && !avoidDeepClone.includes(nextProp)) {\n result[nextProp] = jsonMerge(values, opts);\n }\n else if (type === 'array') {\n // Arrays need to be shallow copied to avoid external mutation and allow jsonDiff to\n // detect changes.\n result[nextProp] = __spreadArray$z([], __read$10(lastValue));\n }\n else {\n // Just directly assign/overwrite.\n result[nextProp] = lastValue;\n }\n };\n try {\n for (var props_1 = __values$B(props), props_1_1 = props_1.next(); !props_1_1.done; props_1_1 = props_1.next()) {\n var nextProp = props_1_1.value;\n _loop_2(nextProp);\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (props_1_1 && !props_1_1.done && (_a = props_1.return)) _a.call(props_1);\n }\n finally { if (e_2) throw e_2.error; }\n }\n return result;\n}\n/**\n * Recursively apply a JSON object into a class-hierarchy, optionally instantiating certain classes\n * by property name.\n *\n * @param target to apply source JSON properties into\n * @param source to be applied\n * @param params.path path for logging/error purposes, to aid with pinpointing problems\n * @param params.matcherPath path for pattern matching, to lookup allowedTypes override.\n * @param params.skip property names to skip from the source\n * @param params.constructors dictionary of property name to class constructors for properties that\n * require object construction\n * @param params.constructedArrays map stores arrays which items should be initialised\n * using a class constructor\n * @param params.allowedTypes overrides by path for allowed property types\n */\nfunction jsonApply(target, source, params) {\n var _a, _b, _c;\n if (params === void 0) { params = {}; }\n var _d = params.path, path = _d === void 0 ? undefined : _d, _e = params.matcherPath, matcherPath = _e === void 0 ? path ? path.replace(/(\\[[0-9+]+\\])/i, '[]') : undefined : _e, _f = params.skip, skip = _f === void 0 ? [] : _f, _g = params.constructors, constructors = _g === void 0 ? {} : _g, _h = params.constructedArrays, constructedArrays = _h === void 0 ? new WeakMap() : _h, _j = params.allowedTypes, allowedTypes = _j === void 0 ? {} : _j, idx = params.idx;\n if (target == null) {\n throw new Error(\"AG Charts - target is uninitialised: \" + (path !== null && path !== void 0 ? path : ''));\n }\n if (source == null) {\n return target;\n }\n var targetAny = target;\n if (idx != null && '_declarationOrder' in targetAny) {\n targetAny['_declarationOrder'] = idx;\n }\n var targetType = classify(target);\n var _loop_3 = function (property) {\n var propertyMatcherPath = \"\" + (matcherPath ? matcherPath + '.' : '') + property;\n if (skip.indexOf(propertyMatcherPath) >= 0) {\n return \"continue\";\n }\n var newValue = source[property];\n var propertyPath = \"\" + (path ? path + '.' : '') + property;\n var targetClass = targetAny.constructor;\n var currentValue = targetAny[property];\n var ctr = (_a = constructors[propertyMatcherPath]) !== null && _a !== void 0 ? _a : constructors[property];\n try {\n var currentValueType = classify(currentValue);\n var newValueType = classify(newValue);\n if (targetType === 'class-instance' &&\n !(property in target || Object.prototype.hasOwnProperty.call(targetAny, property))) {\n Logger.warn(\"unable to set [\" + propertyPath + \"] in \" + (targetClass === null || targetClass === void 0 ? void 0 : targetClass.name) + \" - property is unknown\");\n return \"continue\";\n }\n var allowableTypes = (_b = allowedTypes[propertyMatcherPath]) !== null && _b !== void 0 ? _b : [currentValueType];\n if (currentValueType === 'class-instance' && newValueType === 'object') {\n // Allowed, this is the common case! - do not error.\n }\n else if (currentValueType != null && newValueType != null && !allowableTypes.includes(newValueType)) {\n Logger.warn(\"unable to set [\" + propertyPath + \"] in \" + (targetClass === null || targetClass === void 0 ? void 0 : targetClass.name) + \" - can't apply type of [\" + newValueType + \"], allowed types are: [\" + allowableTypes + \"]\");\n return \"continue\";\n }\n if (newValueType === 'array') {\n ctr = (_c = ctr !== null && ctr !== void 0 ? ctr : constructedArrays.get(currentValue)) !== null && _c !== void 0 ? _c : constructors[propertyMatcherPath + \"[]\"];\n if (ctr != null) {\n var newValueArray = newValue;\n targetAny[property] = newValueArray.map(function (v, idx) {\n return jsonApply(new ctr(), v, __assign$P(__assign$P({}, params), { path: propertyPath, matcherPath: propertyMatcherPath + '[]', idx: idx }));\n });\n }\n else {\n targetAny[property] = newValue;\n }\n }\n else if (newValueType === 'class-instance') {\n targetAny[property] = newValue;\n }\n else if (newValueType === 'object') {\n if (currentValue != null) {\n jsonApply(currentValue, newValue, __assign$P(__assign$P({}, params), { path: propertyPath, matcherPath: propertyMatcherPath, idx: undefined }));\n }\n else if (ctr != null) {\n targetAny[property] = jsonApply(new ctr(), newValue, __assign$P(__assign$P({}, params), { path: propertyPath, matcherPath: propertyMatcherPath, idx: undefined }));\n }\n else {\n targetAny[property] = newValue;\n }\n }\n else {\n targetAny[property] = newValue;\n }\n }\n catch (error) {\n Logger.warn(\"unable to set [\" + propertyPath + \"] in [\" + (targetClass === null || targetClass === void 0 ? void 0 : targetClass.name) + \"]; nested error is: \" + error.message);\n return \"continue\";\n }\n };\n for (var property in source) {\n _loop_3(property);\n }\n return target;\n}\n/**\n * Walk the given JSON object graphs, invoking the visit() callback for every object encountered.\n * Arrays are descended into without a callback, however their elements will have the visit()\n * callback invoked if they are objects.\n *\n * @param json to traverse\n * @param visit callback for each non-primitive and non-array object found\n * @param opts.skip property names to skip when walking\n * @param jsons to traverse in parallel\n */\nfunction jsonWalk(json, visit, opts) {\n var _a;\n var jsons = [];\n for (var _i = 3; _i < arguments.length; _i++) {\n jsons[_i - 3] = arguments[_i];\n }\n var jsonType = classify(json);\n var skip = (_a = opts.skip) !== null && _a !== void 0 ? _a : [];\n if (jsonType === 'array') {\n json.forEach(function (element, index) {\n jsonWalk.apply(void 0, __spreadArray$z([element, visit, opts], __read$10((jsons !== null && jsons !== void 0 ? jsons : []).map(function (o) { return o === null || o === void 0 ? void 0 : o[index]; }))));\n });\n return;\n }\n else if (jsonType !== 'object') {\n return;\n }\n visit.apply(void 0, __spreadArray$z([jsonType, json], __read$10(jsons)));\n var _loop_4 = function (property) {\n if (skip.indexOf(property) >= 0) {\n return \"continue\";\n }\n var value = json[property];\n var otherValues = jsons === null || jsons === void 0 ? void 0 : jsons.map(function (o) { return o === null || o === void 0 ? void 0 : o[property]; });\n var valueType = classify(value);\n if (valueType === 'object' || valueType === 'array') {\n jsonWalk.apply(void 0, __spreadArray$z([value, visit, opts], __read$10(otherValues)));\n }\n };\n for (var property in json) {\n _loop_4(property);\n }\n}\nvar isBrowser = typeof window !== 'undefined';\n/**\n * Classify the type of a value to assist with handling for merge purposes.\n */\nfunction classify(value) {\n if (value == null) {\n return null;\n }\n else if (isBrowser && value instanceof HTMLElement) {\n return 'primitive';\n }\n else if (value instanceof Array) {\n return 'array';\n }\n else if (value instanceof Date) {\n return 'primitive';\n }\n else if (typeof value === 'object' && value.constructor === Object) {\n return 'object';\n }\n else if (typeof value === 'function') {\n return 'function';\n }\n else if (typeof value === 'object' && value.constructor != null) {\n return 'class-instance';\n }\n return 'primitive';\n}\n\nvar __values$A = (undefined && undefined.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nvar __read$$ = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray$y = (undefined && undefined.__spreadArray) || function (to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\n to[j] = from[i];\n return to;\n};\nvar Listeners = /** @class */ (function () {\n function Listeners() {\n this.registeredListeners = {};\n }\n Listeners.prototype.addListener = function (type, cb) {\n var _a;\n var symbol = Symbol(type);\n if (!this.registeredListeners[type]) {\n this.registeredListeners[type] = [];\n }\n (_a = this.registeredListeners[type]) === null || _a === void 0 ? void 0 : _a.push({ symbol: symbol, handler: cb });\n return symbol;\n };\n Listeners.prototype.dispatch = function (type) {\n var e_1, _a;\n var _b;\n var params = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n params[_i - 1] = arguments[_i];\n }\n var listeners = (_b = this.registeredListeners[type]) !== null && _b !== void 0 ? _b : [];\n var results = [];\n try {\n for (var listeners_1 = __values$A(listeners), listeners_1_1 = listeners_1.next(); !listeners_1_1.done; listeners_1_1 = listeners_1.next()) {\n var listener = listeners_1_1.value;\n try {\n results.push(listener.handler.apply(listener, __spreadArray$y([], __read$$(params))));\n }\n catch (e) {\n Logger.errorOnce(e);\n results.push(undefined);\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (listeners_1_1 && !listeners_1_1.done && (_a = listeners_1.return)) _a.call(listeners_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n return results;\n };\n Listeners.prototype.cancellableDispatch = function (type, cancelled) {\n var e_2, _a;\n var _b;\n var params = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n params[_i - 2] = arguments[_i];\n }\n var listeners = (_b = this.registeredListeners[type]) !== null && _b !== void 0 ? _b : [];\n var results = [];\n try {\n for (var listeners_2 = __values$A(listeners), listeners_2_1 = listeners_2.next(); !listeners_2_1.done; listeners_2_1 = listeners_2.next()) {\n var listener = listeners_2_1.value;\n if (cancelled())\n break;\n results.push(listener.handler.apply(listener, __spreadArray$y([], __read$$(params))));\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (listeners_2_1 && !listeners_2_1.done && (_a = listeners_2.return)) _a.call(listeners_2);\n }\n finally { if (e_2) throw e_2.error; }\n }\n return results;\n };\n Listeners.prototype.reduceDispatch = function (type, reduceFn) {\n var e_3, _a;\n var _b;\n var params = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n params[_i - 2] = arguments[_i];\n }\n var listeners = (_b = this.registeredListeners[type]) !== null && _b !== void 0 ? _b : [];\n var listenerResult = undefined;\n try {\n for (var listeners_3 = __values$A(listeners), listeners_3_1 = listeners_3.next(); !listeners_3_1.done; listeners_3_1 = listeners_3.next()) {\n var listener = listeners_3_1.value;\n listenerResult = listener.handler.apply(listener, __spreadArray$y([], __read$$(params)));\n params = reduceFn.apply(void 0, __spreadArray$y([listenerResult], __read$$(params)));\n }\n }\n catch (e_3_1) { e_3 = { error: e_3_1 }; }\n finally {\n try {\n if (listeners_3_1 && !listeners_3_1.done && (_a = listeners_3.return)) _a.call(listeners_3);\n }\n finally { if (e_3) throw e_3.error; }\n }\n return listenerResult;\n };\n Listeners.prototype.removeListener = function (listenerSymbol) {\n for (var type in this.registeredListeners) {\n var listeners = this.registeredListeners[type];\n var match = listeners === null || listeners === void 0 ? void 0 : listeners.findIndex(function (entry) { return entry.symbol === listenerSymbol; });\n if (match != null && match >= 0) {\n listeners === null || listeners === void 0 ? void 0 : listeners.splice(match, 1);\n }\n if (match != null && (listeners === null || listeners === void 0 ? void 0 : listeners.length) === 0) {\n delete this.registeredListeners[type];\n }\n }\n };\n return Listeners;\n}());\n\nvar BaseManager = /** @class */ (function () {\n function BaseManager() {\n this.listeners = new Listeners();\n }\n BaseManager.prototype.addListener = function (type, cb) {\n return this.listeners.addListener(type, cb);\n };\n BaseManager.prototype.removeListener = function (listenerSymbol) {\n this.listeners.removeListener(listenerSymbol);\n };\n return BaseManager;\n}());\n\nfunction number (a, b) {\n a = +a;\n b = +b;\n return function (t) { return a * (1 - t) + b * t; };\n}\n\nfunction interpolateColor (a, b) {\n if (typeof a === 'string') {\n try {\n a = Color.fromString(a);\n }\n catch (e) {\n a = Color.fromArray([0, 0, 0]);\n }\n }\n if (typeof b === 'string') {\n try {\n b = Color.fromString(b);\n }\n catch (e) {\n b = Color.fromArray([0, 0, 0]);\n }\n }\n var red = number(a.r, b.r);\n var green = number(a.g, b.g);\n var blue = number(a.b, b.b);\n var alpha = number(a.a, b.a);\n return function (t) {\n return Color.fromArray([red(t), green(t), blue(t), alpha(t)]).toRgbaString();\n };\n}\n\nfunction interpolate$1 (a, b) {\n var t = typeof b;\n var c;\n if (t === 'number') {\n return number(a, b);\n }\n if (t === 'string') {\n try {\n c = Color.fromString(b);\n b = c;\n return interpolateColor(a, b);\n }\n catch (e) {\n // Error-case handled below.\n }\n }\n throw new Error('Unable to interpolate values');\n}\n\nfunction createEase(fn) {\n return function (_a) {\n var from = _a.from, to = _a.to;\n var interp = interpolate$1(from, to);\n return function (time) { return interp(fn(time)); };\n };\n}\nfunction linear(_a) {\n var from = _a.from, to = _a.to;\n return interpolate$1(from, to);\n}\nvar easeOut = createEase(function (x) { return Math.sin((x * Math.PI) / 2); });\n\nvar __assign$O = (undefined && undefined.__assign) || function () {\n __assign$O = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$O.apply(this, arguments);\n};\nvar RepeatType;\n(function (RepeatType) {\n RepeatType[\"Loop\"] = \"loop\";\n RepeatType[\"Reverse\"] = \"reverse\";\n})(RepeatType || (RepeatType = {}));\nfunction animate(_a) {\n var driver = _a.driver, duration = _a.duration, from = _a.from, to = _a.to, _b = _a.autoplay, autoplay = _b === void 0 ? true : _b, _c = _a.delay, delay = _c === void 0 ? 0 : _c, _d = _a.ease, ease = _d === void 0 ? linear : _d, _e = _a.repeat, repeatMax = _e === void 0 ? 0 : _e, _f = _a.repeatType, repeatType = _f === void 0 ? RepeatType.Loop : _f, onComplete = _a.onComplete, onPlay = _a.onPlay, onRepeat = _a.onRepeat, onStop = _a.onStop, onUpdate = _a.onUpdate;\n var state;\n var delayElapsed = 0;\n var elapsed = 0;\n var iteration = 0;\n var isForward = true;\n var isComplete = false;\n var easing = ease({ from: from, to: to });\n var controls = { isPlaying: false, play: play, pause: pause, stop: stop, reset: reset };\n var driverControls = driver(update);\n function play() {\n controls.isPlaying = true;\n driverControls.start();\n onPlay === null || onPlay === void 0 ? void 0 : onPlay();\n return controls;\n }\n function pause() {\n controls.isPlaying = false;\n return controls;\n }\n function stop() {\n controls.isPlaying = false;\n driverControls.stop();\n onStop === null || onStop === void 0 ? void 0 : onStop();\n return controls;\n }\n function reset() {\n isComplete = false;\n elapsed = 0;\n iteration = 0;\n driverControls.reset();\n return controls;\n }\n function repeat() {\n iteration++;\n if (repeatType === RepeatType.Reverse) {\n isForward = iteration % 2 === 0;\n elapsed = isForward ? elapsed % duration : duration - (elapsed % duration);\n }\n else {\n elapsed = elapsed % duration;\n }\n isComplete = false;\n onRepeat === null || onRepeat === void 0 ? void 0 : onRepeat();\n }\n function complete() {\n stop();\n onComplete === null || onComplete === void 0 ? void 0 : onComplete();\n }\n function update(delta) {\n if (!isForward)\n delta = -delta;\n if (delayElapsed >= delay) {\n elapsed += delta;\n }\n else {\n delayElapsed += delta;\n return;\n }\n if (!isComplete) {\n state = easing(Math.min(1, Math.max(0, elapsed / duration)));\n isComplete = isForward ? elapsed >= duration : elapsed <= 0;\n }\n onUpdate === null || onUpdate === void 0 ? void 0 : onUpdate(state);\n if (isComplete) {\n if (iteration < repeatMax) {\n repeat();\n }\n else {\n complete();\n }\n }\n }\n if (autoplay)\n play();\n return controls;\n}\nfunction tween(opts) {\n var handleUpdate;\n var animateOpts = __assign$O(__assign$O({}, opts), { autoplay: false, onUpdate: function (value) {\n handleUpdate === null || handleUpdate === void 0 ? void 0 : handleUpdate(value);\n } });\n var animationControls = animate(animateOpts);\n var controls = {\n start: function (onUpdate) {\n animationControls.stop();\n animationControls.reset();\n animationControls.play();\n handleUpdate = onUpdate;\n return controls;\n },\n stop: function () {\n animationControls.stop();\n return controls;\n },\n };\n return controls;\n}\n\nvar __extends$2H = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign$N = (undefined && undefined.__assign) || function () {\n __assign$N = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$N.apply(this, arguments);\n};\nvar __rest$4 = (undefined && undefined.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nvar __values$z = (undefined && undefined.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nvar __read$_ = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar AnimationManager = /** @class */ (function (_super) {\n __extends$2H(AnimationManager, _super);\n function AnimationManager(interactionManager) {\n var _this = _super.call(this) || this;\n _this.controllers = {};\n _this.throttles = {};\n _this.throttleGroups = new Set();\n _this.updaters = [];\n _this.isPlaying = false;\n _this.readyToPlay = false;\n _this.defaultOptions = {};\n _this.skipAnimations = false;\n _this.debug = false;\n _this.interactionManager = interactionManager;\n window.addEventListener('DOMContentLoaded', function () {\n _this.readyToPlay = true;\n });\n // Fallback if `DOMContentLoaded` event is not fired, e.g. in an iframe\n setTimeout(function () {\n _this.readyToPlay = true;\n }, 10);\n return _this;\n }\n AnimationManager.prototype.play = function () {\n if (this.isPlaying)\n return;\n this.isPlaying = true;\n if (this.debug) {\n Logger.debug('AnimationManager.play()');\n }\n for (var id in this.controllers) {\n this.controllers[id].play();\n }\n this.startAnimationCycle();\n };\n AnimationManager.prototype.pause = function () {\n if (!this.isPlaying)\n return;\n this.isPlaying = false;\n this.cancelAnimationFrame();\n if (this.debug) {\n Logger.debug('AnimationManager.pause()');\n }\n for (var id in this.controllers) {\n this.controllers[id].pause();\n }\n };\n AnimationManager.prototype.stop = function () {\n this.isPlaying = false;\n this.cancelAnimationFrame();\n if (this.debug) {\n Logger.debug('AnimationManager.stop()');\n }\n for (var id in this.controllers) {\n this.controllers[id].stop();\n }\n };\n AnimationManager.prototype.reset = function () {\n if (this.isPlaying) {\n this.stop();\n this.play();\n }\n else {\n this.stop();\n }\n };\n AnimationManager.prototype.animate = function (id, _a) {\n var _b, _c;\n var _d = _a.disableInteractions, disableInteractions = _d === void 0 ? true : _d, opts = __rest$4(_a, [\"disableInteractions\"]);\n if (this.skipAnimations) {\n // Initialise the animation with the final values immediately and then stop the animation\n (_b = opts.onUpdate) === null || _b === void 0 ? void 0 : _b.call(opts, opts.to);\n return;\n }\n var optsExtra = __assign$N(__assign$N({}, opts), { autoplay: this.isPlaying ? opts.autoplay : false, driver: this.createDriver(id, disableInteractions) });\n if (this.controllers[id]) {\n this.controllers[id].stop();\n }\n var controller = animate(optsExtra);\n this.controllers[id] = controller;\n // Initialise the animation immediately without requesting a frame to prevent flashes\n (_c = opts.onUpdate) === null || _c === void 0 ? void 0 : _c.call(opts, opts.from);\n return controller;\n };\n AnimationManager.prototype.animateMany = function (id, props, opts) {\n var e_1, _a;\n var _b;\n if (this.skipAnimations) {\n var state_1 = props.map(function (prop) { return prop.to; });\n opts.onUpdate(state_1);\n (_b = opts.onComplete) === null || _b === void 0 ? void 0 : _b.call(opts);\n return;\n }\n var state = props.map(function (prop) { return prop.from; });\n var playBatch = 0;\n var stopBatch = 0;\n var updateBatch = 0;\n var completeBatch = 0;\n var onUpdate = function (index) { return function (v) {\n var _a;\n state[index] = v;\n if (++updateBatch >= props.length) {\n (_a = opts.onUpdate) === null || _a === void 0 ? void 0 : _a.call(opts, state);\n updateBatch = 0;\n }\n }; };\n var onPlay = function () {\n var _a;\n if (++playBatch >= props.length) {\n (_a = opts.onPlay) === null || _a === void 0 ? void 0 : _a.call(opts);\n }\n };\n var onStop = function () {\n var _a;\n if (++stopBatch >= props.length) {\n (_a = opts.onStop) === null || _a === void 0 ? void 0 : _a.call(opts);\n }\n };\n var onComplete = function () {\n var _a;\n if (++completeBatch >= props.length) {\n (_a = opts.onComplete) === null || _a === void 0 ? void 0 : _a.call(opts);\n }\n };\n var index = 0;\n try {\n for (var props_1 = __values$z(props), props_1_1 = props_1.next(); !props_1_1.done; props_1_1 = props_1.next()) {\n var prop = props_1_1.value;\n var inner_id = id + \"-\" + index;\n this.animate(inner_id, __assign$N(__assign$N(__assign$N({}, opts), prop), { onUpdate: onUpdate(index), onPlay: onPlay, onStop: onStop, onComplete: onComplete }));\n index++;\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (props_1_1 && !props_1_1.done && (_a = props_1.return)) _a.call(props_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n };\n AnimationManager.prototype.animateWithThrottle = function (id, opts) {\n var _a;\n var throttleId = (_a = opts.throttleId) !== null && _a !== void 0 ? _a : id;\n if (this.throttles[throttleId] && opts.duration && Date.now() - this.throttles[throttleId] < opts.duration) {\n opts.delay = 0;\n opts.duration = 1;\n }\n this.throttles[id] = Date.now();\n this.animate(id, __assign$N({}, opts));\n };\n AnimationManager.prototype.animateManyWithThrottle = function (id, props, opts) {\n var _this = this;\n var _a;\n var throttleGroup = opts.throttleGroup;\n var throttleId = (_a = opts.throttleId) !== null && _a !== void 0 ? _a : id;\n var now = Date.now();\n var isThrottled = this.throttles[throttleId] && opts.duration && now - this.throttles[throttleId] < opts.duration;\n var inGroup = throttleGroup && this.throttleGroups.has(throttleGroup);\n if (isThrottled && !inGroup) {\n opts.delay = 0;\n opts.duration = 1;\n }\n if (!isThrottled && throttleGroup) {\n this.throttleGroups.add(throttleGroup);\n }\n var onStop = function () {\n var _a;\n if (throttleGroup) {\n _this.throttleGroups.delete(throttleGroup);\n }\n (_a = opts.onStop) === null || _a === void 0 ? void 0 : _a.call(opts);\n };\n this.throttles[throttleId] = now;\n return this.animateMany(id, props, __assign$N(__assign$N({}, opts), { onStop: onStop }));\n };\n AnimationManager.prototype.tween = function (opts) {\n var id = \"tween-\" + btoa(JSON.stringify(opts));\n var optsExtra = __assign$N(__assign$N({}, opts), { driver: this.createDriver(id) });\n return tween(optsExtra);\n };\n AnimationManager.prototype.createDriver = function (id, disableInteractions) {\n var _this = this;\n return function (update) {\n return {\n start: function () {\n _this.updaters.push([id, update]);\n if (_this.requestId == null) {\n _this.startAnimationCycle();\n }\n if (disableInteractions) {\n _this.interactionManager.pause(\"animation_\" + id);\n }\n },\n stop: function () {\n delete _this.controllers[id];\n _this.updaters = _this.updaters.filter(function (_a) {\n var _b = __read$_(_a, 1), uid = _b[0];\n return uid !== id;\n });\n if (_this.updaters.length <= 0) {\n _this.cancelAnimationFrame();\n }\n if (disableInteractions) {\n _this.interactionManager.resume(\"animation_\" + id);\n }\n },\n reset: function () { },\n };\n };\n };\n AnimationManager.prototype.startAnimationCycle = function () {\n var _this = this;\n if (this.updaters.length === 0)\n return;\n var frame = function (time) {\n _this.requestId = requestAnimationFrame(frame);\n if (!_this.readyToPlay)\n return;\n if (_this.lastTime === undefined)\n _this.lastTime = time;\n var deltaMs = time - _this.lastTime;\n _this.lastTime = time;\n if (_this.debug) {\n Logger.debug('AnimationManager - frame()', { updaterCount: _this.updaters.length });\n }\n _this.updaters.forEach(function (_a) {\n var _b = __read$_(_a, 2); _b[0]; var update = _b[1];\n return update(deltaMs);\n });\n _this.listeners.dispatch('animation-frame', { type: 'animation-frame', deltaMs: deltaMs });\n };\n this.requestId = requestAnimationFrame(frame);\n };\n AnimationManager.prototype.cancelAnimationFrame = function () {\n if (!this.requestId)\n return;\n cancelAnimationFrame(this.requestId);\n this.requestId = undefined;\n this.lastTime = undefined;\n };\n return AnimationManager;\n}(BaseManager));\n\nvar __read$Z = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\n/**\n * Manages the cursor styling for an element. Tracks the requested styling from distinct\n * dependents and handles conflicting styling requests.\n */\nvar CursorManager = /** @class */ (function () {\n function CursorManager(element) {\n this.states = {};\n this.element = element;\n }\n CursorManager.prototype.updateCursor = function (callerId, style) {\n delete this.states[callerId];\n if (style != null) {\n this.states[callerId] = { style: style };\n }\n this.applyStates();\n };\n CursorManager.prototype.applyStates = function () {\n var styleToApply = 'default';\n // Last added entry wins.\n Object.entries(this.states)\n .reverse()\n .slice(0, 1)\n .forEach(function (_a) {\n var _b = __read$Z(_a, 2); _b[0]; var style = _b[1].style;\n return (styleToApply = style);\n });\n this.element.style.cursor = styleToApply;\n };\n return CursorManager;\n}());\n\nvar __extends$2G = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar ChartEventManager = /** @class */ (function (_super) {\n __extends$2G(ChartEventManager, _super);\n function ChartEventManager() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n ChartEventManager.prototype.legendItemClick = function (series, itemId, enabled, legendItemName) {\n var event = {\n type: 'legend-item-click',\n series: series,\n itemId: itemId,\n enabled: enabled,\n legendItemName: legendItemName,\n };\n this.listeners.dispatch('legend-item-click', event);\n };\n ChartEventManager.prototype.legendItemDoubleClick = function (series, itemId, enabled, numVisibleItems, legendItemName) {\n var event = {\n type: 'legend-item-double-click',\n series: series,\n itemId: itemId,\n enabled: enabled,\n legendItemName: legendItemName,\n numVisibleItems: numVisibleItems,\n };\n this.listeners.dispatch('legend-item-double-click', event);\n };\n ChartEventManager.prototype.axisHover = function (axisId, direction) {\n var event = {\n type: 'axis-hover',\n axisId: axisId,\n direction: direction,\n };\n this.listeners.dispatch('axis-hover', event);\n };\n return ChartEventManager;\n}(BaseManager));\n\nvar __extends$2F = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __read$Y = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nfunction isEqual$1(a, b) {\n if (a === b)\n return true;\n if ((a === null || a === void 0 ? void 0 : a.series) !== (b === null || b === void 0 ? void 0 : b.series))\n return false;\n if ((a === null || a === void 0 ? void 0 : a.itemId) !== (b === null || b === void 0 ? void 0 : b.itemId))\n return false;\n if ((a === null || a === void 0 ? void 0 : a.datum) !== (b === null || b === void 0 ? void 0 : b.datum))\n return false;\n return true;\n}\n/**\n * Manages the actively highlighted series/datum for a chart. Tracks the requested highlights from\n * distinct dependents and handles conflicting highlight requests.\n */\nvar HighlightManager = /** @class */ (function (_super) {\n __extends$2F(HighlightManager, _super);\n function HighlightManager() {\n var _this = _super.call(this) || this;\n _this.states = {};\n _this.activeHighlight = undefined;\n return _this;\n }\n HighlightManager.prototype.updateHighlight = function (callerId, highlightedDatum) {\n delete this.states[callerId];\n if (highlightedDatum != null) {\n this.states[callerId] = { highlightedDatum: highlightedDatum };\n }\n this.applyStates();\n };\n HighlightManager.prototype.getActiveHighlight = function () {\n return this.activeHighlight;\n };\n HighlightManager.prototype.applyStates = function () {\n var previousHighlight = this.activeHighlight;\n var highlightToApply = undefined;\n // Last added entry wins.\n Object.entries(this.states)\n .reverse()\n .slice(0, 1)\n .forEach(function (_a) {\n var _b = __read$Y(_a, 2); _b[0]; var highlightedDatum = _b[1].highlightedDatum;\n return (highlightToApply = highlightedDatum);\n });\n this.activeHighlight = highlightToApply;\n var changed = !isEqual$1(previousHighlight, this.activeHighlight);\n if (changed) {\n var event_1 = {\n type: 'highlight-change',\n previousHighlight: previousHighlight,\n currentHighlight: this.activeHighlight,\n };\n this.listeners.dispatch('highlight-change', event_1);\n }\n };\n return HighlightManager;\n}(BaseManager));\n\nvar __extends$2E = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign$M = (undefined && undefined.__assign) || function () {\n __assign$M = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$M.apply(this, arguments);\n};\nvar __awaiter$e = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator$e = (undefined && undefined.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nvar __values$y = (undefined && undefined.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nvar WINDOW_EVENT_HANDLERS = ['pagehide', 'mousemove', 'mouseup', 'wheel'];\nvar EVENT_HANDLERS = [\n 'click',\n 'dblclick',\n 'contextmenu',\n 'mousedown',\n 'mouseout',\n 'mouseenter',\n 'touchstart',\n 'touchmove',\n 'touchend',\n 'touchcancel',\n];\nvar CSS = \"\\n.ag-chart-wrapper {\\n touch-action: none;\\n}\\n\";\n/**\n * Manages user interactions with a specific HTMLElement (or interactions that bubble from it's\n * children)\n */\nvar InteractionManager = /** @class */ (function (_super) {\n __extends$2E(InteractionManager, _super);\n function InteractionManager(element, doc) {\n var e_1, _a, e_2, _b;\n if (doc === void 0) { doc = document; }\n var _this = _super.call(this) || this;\n _this.eventHandler = function (event) { return _this.processEvent(event); };\n _this.mouseDown = false;\n _this.touchDown = false;\n _this.enabled = true;\n _this.pausers = [];\n _this.rootElement = doc.body;\n _this.element = element;\n try {\n for (var EVENT_HANDLERS_1 = __values$y(EVENT_HANDLERS), EVENT_HANDLERS_1_1 = EVENT_HANDLERS_1.next(); !EVENT_HANDLERS_1_1.done; EVENT_HANDLERS_1_1 = EVENT_HANDLERS_1.next()) {\n var type = EVENT_HANDLERS_1_1.value;\n if (type.startsWith('touch')) {\n element.addEventListener(type, _this.eventHandler, { passive: true });\n }\n else {\n element.addEventListener(type, _this.eventHandler);\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (EVENT_HANDLERS_1_1 && !EVENT_HANDLERS_1_1.done && (_a = EVENT_HANDLERS_1.return)) _a.call(EVENT_HANDLERS_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n try {\n for (var WINDOW_EVENT_HANDLERS_1 = __values$y(WINDOW_EVENT_HANDLERS), WINDOW_EVENT_HANDLERS_1_1 = WINDOW_EVENT_HANDLERS_1.next(); !WINDOW_EVENT_HANDLERS_1_1.done; WINDOW_EVENT_HANDLERS_1_1 = WINDOW_EVENT_HANDLERS_1.next()) {\n var type = WINDOW_EVENT_HANDLERS_1_1.value;\n if (type === 'wheel') {\n window.addEventListener(type, _this.eventHandler, { passive: false });\n }\n else {\n window.addEventListener(type, _this.eventHandler);\n }\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (WINDOW_EVENT_HANDLERS_1_1 && !WINDOW_EVENT_HANDLERS_1_1.done && (_b = WINDOW_EVENT_HANDLERS_1.return)) _b.call(WINDOW_EVENT_HANDLERS_1);\n }\n finally { if (e_2) throw e_2.error; }\n }\n if (InteractionManager.interactionDocuments.indexOf(doc) < 0) {\n var styleElement = document.createElement('style');\n styleElement.innerHTML = CSS;\n document.head.insertBefore(styleElement, document.head.querySelector('style'));\n InteractionManager.interactionDocuments.push(doc);\n }\n return _this;\n }\n InteractionManager.prototype.destroy = function () {\n var e_3, _a, e_4, _b;\n try {\n for (var WINDOW_EVENT_HANDLERS_2 = __values$y(WINDOW_EVENT_HANDLERS), WINDOW_EVENT_HANDLERS_2_1 = WINDOW_EVENT_HANDLERS_2.next(); !WINDOW_EVENT_HANDLERS_2_1.done; WINDOW_EVENT_HANDLERS_2_1 = WINDOW_EVENT_HANDLERS_2.next()) {\n var type = WINDOW_EVENT_HANDLERS_2_1.value;\n window.removeEventListener(type, this.eventHandler);\n }\n }\n catch (e_3_1) { e_3 = { error: e_3_1 }; }\n finally {\n try {\n if (WINDOW_EVENT_HANDLERS_2_1 && !WINDOW_EVENT_HANDLERS_2_1.done && (_a = WINDOW_EVENT_HANDLERS_2.return)) _a.call(WINDOW_EVENT_HANDLERS_2);\n }\n finally { if (e_3) throw e_3.error; }\n }\n try {\n for (var EVENT_HANDLERS_2 = __values$y(EVENT_HANDLERS), EVENT_HANDLERS_2_1 = EVENT_HANDLERS_2.next(); !EVENT_HANDLERS_2_1.done; EVENT_HANDLERS_2_1 = EVENT_HANDLERS_2.next()) {\n var type = EVENT_HANDLERS_2_1.value;\n this.element.removeEventListener(type, this.eventHandler);\n }\n }\n catch (e_4_1) { e_4 = { error: e_4_1 }; }\n finally {\n try {\n if (EVENT_HANDLERS_2_1 && !EVENT_HANDLERS_2_1.done && (_b = EVENT_HANDLERS_2.return)) _b.call(EVENT_HANDLERS_2);\n }\n finally { if (e_4) throw e_4.error; }\n }\n };\n InteractionManager.prototype.resume = function (callerId) {\n this.pausers = this.pausers.filter(function (id) { return id !== callerId; });\n this.enabled = this.pausers.length <= 0;\n return this.enabled;\n };\n InteractionManager.prototype.pause = function (callerId) {\n this.enabled = false;\n this.pausers.push(callerId);\n };\n InteractionManager.prototype.processEvent = function (event) {\n var types = this.decideInteractionEventTypes(event);\n if (types.length > 0 && this.enabled) {\n // Async dispatch to avoid blocking the event-processing thread.\n this.dispatchEvent(event, types).catch(function (e) { return Logger.errorOnce(e); });\n }\n };\n InteractionManager.prototype.dispatchEvent = function (event, types) {\n return __awaiter$e(this, void 0, void 0, function () {\n var coords, _loop_1, this_1, types_1, types_1_1, type;\n var e_5, _a;\n return __generator$e(this, function (_b) {\n coords = this.calculateCoordinates(event);\n if (coords == null) {\n return [2 /*return*/];\n }\n _loop_1 = function (type) {\n var interactionEvent = this_1.buildEvent(__assign$M(__assign$M({ event: event }, coords), { type: type }));\n this_1.listeners.cancellableDispatch(type, function () { return interactionEvent.consumed; }, interactionEvent);\n };\n this_1 = this;\n try {\n for (types_1 = __values$y(types), types_1_1 = types_1.next(); !types_1_1.done; types_1_1 = types_1.next()) {\n type = types_1_1.value;\n _loop_1(type);\n }\n }\n catch (e_5_1) { e_5 = { error: e_5_1 }; }\n finally {\n try {\n if (types_1_1 && !types_1_1.done && (_a = types_1.return)) _a.call(types_1);\n }\n finally { if (e_5) throw e_5.error; }\n }\n return [2 /*return*/];\n });\n });\n };\n InteractionManager.prototype.decideInteractionEventTypes = function (event) {\n switch (event.type) {\n case 'click':\n return ['click'];\n case 'dblclick':\n return ['dblclick'];\n case 'contextmenu':\n return ['contextmenu'];\n case 'mousedown':\n this.mouseDown = true;\n this.dragStartElement = event.target;\n return ['drag-start'];\n case 'touchstart':\n this.touchDown = true;\n this.dragStartElement = event.target;\n return ['drag-start'];\n case 'touchmove':\n case 'mousemove':\n if (!this.mouseDown && !this.touchDown && !this.isEventOverElement(event)) {\n // We only care about these events if the target is the canvas, unless\n // we're in the middle of a drag/slide.\n return [];\n }\n return this.mouseDown || this.touchDown ? ['drag'] : ['hover'];\n case 'mouseup':\n if (!this.mouseDown && !this.isEventOverElement(event)) {\n // We only care about these events if the target is the canvas, unless\n // we're in the middle of a drag.\n return [];\n }\n this.mouseDown = false;\n this.dragStartElement = undefined;\n return ['drag-end'];\n case 'touchend':\n if (!this.touchDown && !this.isEventOverElement(event)) {\n // We only care about these events if the target is the canvas, unless\n // we're in the middle of a slide.\n return [];\n }\n this.touchDown = false;\n this.dragStartElement = undefined;\n return ['drag-end'];\n case 'mouseout':\n case 'touchcancel':\n return ['leave'];\n case 'mouseenter':\n var mouseButtonDown = event instanceof MouseEvent && (event.buttons & 1) === 1;\n if (this.mouseDown !== mouseButtonDown) {\n this.mouseDown = mouseButtonDown;\n return [mouseButtonDown ? 'drag-start' : 'drag-end'];\n }\n return [];\n case 'pagehide':\n return ['page-left'];\n case 'wheel':\n return ['wheel'];\n }\n return [];\n };\n InteractionManager.prototype.isEventOverElement = function (event) {\n var _a;\n return event.target === this.element || ((_a = event.target) === null || _a === void 0 ? void 0 : _a.parentElement) === this.element;\n };\n InteractionManager.prototype.calculateCoordinates = function (event) {\n var _a;\n if (event instanceof MouseEvent) {\n var clientX = event.clientX, clientY = event.clientY, pageX = event.pageX, pageY = event.pageY, offsetX = event.offsetX, offsetY = event.offsetY;\n return this.fixOffsets(event, { clientX: clientX, clientY: clientY, pageX: pageX, pageY: pageY, offsetX: offsetX, offsetY: offsetY });\n }\n else if (typeof TouchEvent !== 'undefined' && event instanceof TouchEvent) {\n var lastTouch = (_a = event.touches[0]) !== null && _a !== void 0 ? _a : event.changedTouches[0];\n var clientX = lastTouch.clientX, clientY = lastTouch.clientY, pageX = lastTouch.pageX, pageY = lastTouch.pageY;\n return __assign$M(__assign$M({}, InteractionManager.NULL_COORDS), { clientX: clientX, clientY: clientY, pageX: pageX, pageY: pageY });\n }\n else if (event instanceof PageTransitionEvent) {\n if (event.persisted) {\n // Don't fire the page-left event since the page maybe revisited.\n return;\n }\n return InteractionManager.NULL_COORDS;\n }\n // Unsupported event - abort.\n };\n InteractionManager.prototype.fixOffsets = function (event, coords) {\n var offsets = function (el) {\n var x = 0;\n var y = 0;\n while (el) {\n x += el.offsetLeft;\n y += el.offsetTop;\n el = el.offsetParent;\n }\n return { x: x, y: y };\n };\n if (this.dragStartElement != null && event.target !== this.dragStartElement) {\n // Offsets need to be relative to the drag-start element to avoid jumps when\n // the pointer moves between element boundaries.\n var offsetDragStart = offsets(this.dragStartElement);\n var offsetEvent = offsets(event.target);\n coords.offsetX -= offsetDragStart.x - offsetEvent.x;\n coords.offsetY -= offsetDragStart.y - offsetEvent.y;\n }\n return coords;\n };\n InteractionManager.prototype.buildEvent = function (opts) {\n var type = opts.type, event = opts.event, clientX = opts.clientX, clientY = opts.clientY;\n var offsetX = opts.offsetX, offsetY = opts.offsetY, pageX = opts.pageX, pageY = opts.pageY;\n if (!isNumber$4(offsetX) || !isNumber$4(offsetY)) {\n var rect = this.element.getBoundingClientRect();\n offsetX = clientX - rect.left;\n offsetY = clientY - rect.top;\n }\n if (!isNumber$4(pageX) || !isNumber$4(pageY)) {\n var pageRect = this.rootElement.getBoundingClientRect();\n pageX = clientX - pageRect.left;\n pageY = clientY - pageRect.top;\n }\n var builtEvent = {\n type: type,\n offsetX: offsetX,\n offsetY: offsetY,\n pageX: pageX,\n pageY: pageY,\n sourceEvent: event,\n consumed: false,\n consume: function () { return (builtEvent.consumed = true); },\n };\n return builtEvent;\n };\n InteractionManager.interactionDocuments = [];\n InteractionManager.NULL_COORDS = {\n clientX: -Infinity,\n clientY: -Infinity,\n pageX: -Infinity,\n pageY: -Infinity,\n offsetX: -Infinity,\n offsetY: -Infinity,\n };\n return InteractionManager;\n}(BaseManager));\n\nvar __values$x = (undefined && undefined.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nvar __read$X = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\n/**\n * Manages the tooltip HTML an element. Tracks the requested HTML from distinct dependents and\n * handles conflicting tooltip requests.\n */\nvar TooltipManager = /** @class */ (function () {\n function TooltipManager(tooltip, interactionManager) {\n var _this = this;\n this.states = {};\n this.exclusiveAreas = {};\n this.destroyFns = [];\n this.tooltip = tooltip;\n var hoverRef = interactionManager.addListener('hover', function (e) { return _this.checkExclusiveRects(e); });\n this.destroyFns.push(function () { return interactionManager.removeListener(hoverRef); });\n }\n TooltipManager.prototype.updateTooltip = function (callerId, meta, content) {\n var _a;\n if (content == null) {\n content = (_a = this.states[callerId]) === null || _a === void 0 ? void 0 : _a.content;\n }\n this.states[callerId] = { content: content, meta: meta };\n this.applyStates();\n };\n TooltipManager.prototype.updateExclusiveRect = function (callerId, area) {\n if (area) {\n this.exclusiveAreas[callerId] = area;\n }\n else {\n delete this.exclusiveAreas[callerId];\n }\n };\n TooltipManager.prototype.removeTooltip = function (callerId) {\n delete this.states[callerId];\n this.applyStates();\n };\n TooltipManager.prototype.getTooltipMeta = function (callerId) {\n var _a;\n return (_a = this.states[callerId]) === null || _a === void 0 ? void 0 : _a.meta;\n };\n TooltipManager.prototype.destroy = function () {\n var e_1, _a;\n try {\n for (var _b = __values$x(this.destroyFns), _c = _b.next(); !_c.done; _c = _b.next()) {\n var destroyFn = _c.value;\n destroyFn();\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_1) throw e_1.error; }\n }\n };\n TooltipManager.prototype.checkExclusiveRects = function (e) {\n var e_2, _a;\n var newAppliedExclusiveArea;\n try {\n for (var _b = __values$x(Object.entries(this.exclusiveAreas)), _c = _b.next(); !_c.done; _c = _b.next()) {\n var _d = __read$X(_c.value, 2), entryId = _d[0], area = _d[1];\n if (!area.containsPoint(e.offsetX, e.offsetY)) {\n continue;\n }\n newAppliedExclusiveArea = entryId;\n break;\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_2) throw e_2.error; }\n }\n if (newAppliedExclusiveArea === this.appliedExclusiveArea) {\n return;\n }\n this.appliedExclusiveArea = newAppliedExclusiveArea;\n this.applyStates();\n };\n TooltipManager.prototype.applyStates = function () {\n var _this = this;\n var _a;\n var ids = this.appliedExclusiveArea ? [this.appliedExclusiveArea] : Object.keys(this.states);\n var contentToApply = undefined;\n var metaToApply = undefined;\n // Last added entry wins.\n ids.reverse();\n ids.slice(0, 1).forEach(function (id) {\n var _a;\n var _b = (_a = _this.states[id]) !== null && _a !== void 0 ? _a : {}, content = _b.content, meta = _b.meta;\n contentToApply = content;\n metaToApply = meta;\n });\n if (metaToApply === undefined || contentToApply === undefined) {\n this.appliedState = undefined;\n this.tooltip.toggle(false);\n return;\n }\n if (((_a = this.appliedState) === null || _a === void 0 ? void 0 : _a.content) === contentToApply) {\n var renderInstantly = this.tooltip.isVisible();\n this.tooltip.show(metaToApply, undefined, renderInstantly);\n }\n else {\n this.tooltip.show(metaToApply, contentToApply);\n }\n this.appliedState = { content: contentToApply, meta: metaToApply };\n };\n return TooltipManager;\n}());\n\nvar __extends$2D = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign$L = (undefined && undefined.__assign) || function () {\n __assign$L = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$L.apply(this, arguments);\n};\nvar __values$w = (undefined && undefined.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nvar __read$W = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\n/**\n * Manages the current zoom state for a chart. Tracks the requested zoom from distinct dependents\n * and handles conflicting zoom requests.\n */\nvar ZoomManager = /** @class */ (function (_super) {\n __extends$2D(ZoomManager, _super);\n function ZoomManager() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.axes = {};\n return _this;\n }\n ZoomManager.prototype.updateAxes = function (axes) {\n var _this = this;\n var removedAxes = new Set(Object.keys(this.axes));\n axes.forEach(function (axis) {\n var _a;\n var _b, _c;\n removedAxes.delete(axis.id);\n (_a = (_b = _this.axes)[_c = axis.id]) !== null && _a !== void 0 ? _a : (_b[_c] = new AxisZoomManager(axis));\n });\n removedAxes.forEach(function (axisId) {\n delete _this.axes[axisId];\n });\n if (this.initialZoom) {\n this.updateZoom(this.initialZoom.callerId, this.initialZoom.newZoom);\n this.initialZoom = undefined;\n }\n };\n ZoomManager.prototype.updateZoom = function (callerId, newZoom) {\n if (Object.keys(this.axes).length === 0) {\n this.initialZoom = { callerId: callerId, newZoom: newZoom };\n return;\n }\n Object.values(this.axes).forEach(function (axis) {\n axis.updateZoom(callerId, newZoom === null || newZoom === void 0 ? void 0 : newZoom[axis.getDirection()]);\n });\n this.applyStates();\n };\n ZoomManager.prototype.updateAxisZoom = function (callerId, axisId, newZoom) {\n var _a;\n (_a = this.axes[axisId]) === null || _a === void 0 ? void 0 : _a.updateZoom(callerId, newZoom);\n this.applyStates();\n };\n ZoomManager.prototype.getZoom = function () {\n var x;\n var y;\n // TODO: this only works when there is a single axis on each direction as it gets the last of each\n Object.values(this.axes).forEach(function (axis) {\n if (axis.getDirection() === ChartAxisDirection.X) {\n x = axis.getZoom();\n }\n else if (axis.getDirection() === ChartAxisDirection.Y) {\n y = axis.getZoom();\n }\n });\n if (x || y) {\n return { x: x, y: y };\n }\n };\n ZoomManager.prototype.getAxisZoom = function (axisId) {\n var _a;\n return (_a = this.axes[axisId]) === null || _a === void 0 ? void 0 : _a.getZoom();\n };\n ZoomManager.prototype.getAxisZooms = function () {\n var e_1, _a;\n var axes = {};\n try {\n for (var _b = __values$w(Object.entries(this.axes)), _c = _b.next(); !_c.done; _c = _b.next()) {\n var _d = __read$W(_c.value, 2), axisId = _d[0], axis = _d[1];\n axes[axisId] = {\n direction: axis.getDirection(),\n zoom: axis.getZoom(),\n };\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_1) throw e_1.error; }\n }\n return axes;\n };\n ZoomManager.prototype.applyStates = function () {\n var e_2, _a;\n var changed = Object.values(this.axes)\n .map(function (axis) { return axis.applyStates(); })\n .some(Boolean);\n if (!changed) {\n return;\n }\n var currentZoom = this.getZoom();\n var axes = {};\n try {\n for (var _b = __values$w(Object.entries(this.axes)), _c = _b.next(); !_c.done; _c = _b.next()) {\n var _d = __read$W(_c.value, 2), axisId = _d[0], axis = _d[1];\n axes[axisId] = axis.getZoom();\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_2) throw e_2.error; }\n }\n var event = __assign$L(__assign$L({ type: 'zoom-change' }, (currentZoom !== null && currentZoom !== void 0 ? currentZoom : {})), { axes: axes });\n this.listeners.dispatch('zoom-change', event);\n };\n return ZoomManager;\n}(BaseManager));\nvar AxisZoomManager = /** @class */ (function () {\n function AxisZoomManager(axis) {\n this.states = {};\n this.currentZoom = undefined;\n this.axis = axis;\n }\n AxisZoomManager.prototype.getDirection = function () {\n return this.axis.direction;\n };\n AxisZoomManager.prototype.updateZoom = function (callerId, newZoom) {\n delete this.states[callerId];\n if (newZoom != null) {\n this.states[callerId] = __assign$L({}, newZoom);\n }\n };\n AxisZoomManager.prototype.getZoom = function () {\n return this.currentZoom;\n };\n AxisZoomManager.prototype.applyStates = function () {\n var _a, _b;\n var prevZoom = this.currentZoom;\n var last = Object.keys(this.states)[Object.keys(this.states).length - 1];\n this.currentZoom = __assign$L({}, this.states[last]);\n var changed = (prevZoom === null || prevZoom === void 0 ? void 0 : prevZoom.min) !== ((_a = this.currentZoom) === null || _a === void 0 ? void 0 : _a.min) || (prevZoom === null || prevZoom === void 0 ? void 0 : prevZoom.max) !== ((_b = this.currentZoom) === null || _b === void 0 ? void 0 : _b.max);\n return changed;\n };\n return AxisZoomManager;\n}());\n\nvar __assign$K = (undefined && undefined.__assign) || function () {\n __assign$K = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$K.apply(this, arguments);\n};\nfunction isLayoutStage(t) {\n return t !== 'layout-complete';\n}\nfunction isLayoutComplete(t) {\n return t === 'layout-complete';\n}\nvar LayoutService = /** @class */ (function () {\n function LayoutService() {\n this.layoutProcessors = new Listeners();\n this.listeners = new Listeners();\n }\n LayoutService.prototype.addListener = function (type, cb) {\n if (isLayoutStage(type)) {\n return this.layoutProcessors.addListener(type, cb);\n }\n else if (isLayoutComplete(type)) {\n return this.listeners.addListener(type, cb);\n }\n throw new Error('AG Charts - unsupported listener type: ' + type);\n };\n LayoutService.prototype.removeListener = function (listenerSymbol) {\n this.listeners.removeListener(listenerSymbol);\n this.layoutProcessors.removeListener(listenerSymbol);\n };\n LayoutService.prototype.dispatchPerformLayout = function (stage, ctx) {\n var result = this.layoutProcessors.reduceDispatch(stage, function (_a, ctx) {\n var shrinkRect = _a.shrinkRect;\n return [__assign$K(__assign$K({}, ctx), { shrinkRect: shrinkRect })];\n }, ctx);\n return result !== null && result !== void 0 ? result : ctx;\n };\n LayoutService.prototype.dispatchLayoutComplete = function (event) {\n this.listeners.dispatch('layout-complete', event);\n };\n return LayoutService;\n}());\n\nvar DataService = /** @class */ (function () {\n function DataService(getSeries) {\n this.getSeries = getSeries;\n }\n return DataService;\n}());\n\n/** Types of chart-update, in pipeline execution order. */\nvar ChartUpdateType;\n(function (ChartUpdateType) {\n ChartUpdateType[ChartUpdateType[\"FULL\"] = 0] = \"FULL\";\n ChartUpdateType[ChartUpdateType[\"PROCESS_DATA\"] = 1] = \"PROCESS_DATA\";\n ChartUpdateType[ChartUpdateType[\"PERFORM_LAYOUT\"] = 2] = \"PERFORM_LAYOUT\";\n ChartUpdateType[ChartUpdateType[\"SERIES_UPDATE\"] = 3] = \"SERIES_UPDATE\";\n ChartUpdateType[ChartUpdateType[\"TOOLTIP_RECALCULATION\"] = 4] = \"TOOLTIP_RECALCULATION\";\n ChartUpdateType[ChartUpdateType[\"SCENE_RENDER\"] = 5] = \"SCENE_RENDER\";\n ChartUpdateType[ChartUpdateType[\"NONE\"] = 6] = \"NONE\";\n})(ChartUpdateType || (ChartUpdateType = {}));\n\nvar UpdateService = /** @class */ (function () {\n function UpdateService(updateCallback) {\n this.updateCallback = updateCallback;\n }\n UpdateService.prototype.update = function (type, _a) {\n if (type === void 0) { type = ChartUpdateType.FULL; }\n var _b = _a === void 0 ? {} : _a, _c = _b.forceNodeDataRefresh, forceNodeDataRefresh = _c === void 0 ? false : _c;\n this.updateCallback(type, { forceNodeDataRefresh: forceNodeDataRefresh });\n };\n return UpdateService;\n}());\n\nvar __decorate$1T = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar ChartHighlight = /** @class */ (function () {\n function ChartHighlight() {\n this.range = 'tooltip';\n }\n __decorate$1T([\n Validate(STRING_UNION('tooltip', 'node'))\n ], ChartHighlight.prototype, \"range\", void 0);\n return ChartHighlight;\n}());\n\nvar __values$v = (undefined && undefined.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nvar __read$V = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar Selection = /** @class */ (function () {\n function Selection(parent, classOrFactory, garbageCollection) {\n if (garbageCollection === void 0) { garbageCollection = true; }\n this._nodes = [];\n this._data = [];\n this._datumNodeIndices = new Map();\n // If garbage collection is set to false, you must call `selection.cleanup()` to remove deleted nodes\n this._garbage = [];\n this._garbageCollection = true;\n this._parent = parent;\n this._factory = Object.prototype.isPrototypeOf.call(Node, classOrFactory)\n ? function () { return new classOrFactory(); }\n : classOrFactory;\n this._garbageCollection = garbageCollection;\n }\n Selection.select = function (parent, classOrFactory, garbageCollection) {\n if (garbageCollection === void 0) { garbageCollection = true; }\n return new Selection(parent, classOrFactory, garbageCollection);\n };\n Selection.prototype.each = function (iterate) {\n this._nodes.forEach(function (node, i) { return iterate(node, node.datum, i); });\n return this;\n };\n /**\n * Update the data in a selection. If an `getDatumId()` function is provided, maintain a list of ids related to\n * the nodes. Otherwise, take the more efficient route of simply creating and destroying nodes at the end\n * of the array.\n */\n Selection.prototype.update = function (data, init, getDatumId) {\n var e_1, _a;\n var _this = this;\n var old = this._data;\n var parent = this._parent;\n var factory = this._factory;\n var datumIds = new Map();\n if (getDatumId) {\n // Check if new datum and append node and save map of datum id to node index\n data.forEach(function (datum, index) {\n var datumId = getDatumId(datum);\n datumIds.set(datumId, index);\n if (!_this._datumNodeIndices.has(datumId)) {\n var node = factory(datum);\n node.datum = datum;\n init === null || init === void 0 ? void 0 : init(node);\n parent.appendChild(node);\n _this._nodes.push(node);\n _this._datumNodeIndices.set(datumId, _this._nodes.length - 1);\n }\n });\n }\n else if (data.length > old.length) {\n // Create and append nodes for new data\n data.slice(old.length).forEach(function (datum) {\n var node = factory(datum);\n node.datum = datum;\n init === null || init === void 0 ? void 0 : init(node);\n parent.appendChild(node);\n _this._nodes.push(node);\n });\n }\n else if (data.length < old.length) {\n // Destroy any nodes that are in excess of the new data\n this._nodes.splice(data.length).forEach(function (node) {\n parent.removeChild(node);\n });\n }\n // Copy the data into a new array to prevent mutation and duplicates\n this._data = data.slice(0);\n if (getDatumId) {\n try {\n // Find and update the datum for each node or throw into garbage if datum no longer exists\n for (var _b = __values$v(this._datumNodeIndices), _c = _b.next(); !_c.done; _c = _b.next()) {\n var _d = __read$V(_c.value, 2), datumId = _d[0], nodeIndex = _d[1];\n var datumIndex = datumIds.get(datumId);\n if (datumIndex !== undefined) {\n this._nodes[nodeIndex].datum = data[datumIndex];\n }\n else {\n this._garbage.push(datumId);\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_1) throw e_1.error; }\n }\n if (this._garbageCollection) {\n this.cleanup();\n }\n }\n else {\n // Reset the node data by index\n for (var i = 0; i < data.length; i++) {\n this._nodes[i].datum = this._data[i];\n }\n }\n return this;\n };\n Selection.prototype.clear = function () {\n this.update([]);\n return this;\n };\n Selection.prototype.cleanup = function () {\n var e_2, _a;\n var _this = this;\n if (this._garbage.length === 0)\n return;\n this._garbage.forEach(function (datumId) {\n var nodeIndex = _this._datumNodeIndices.get(datumId);\n if (nodeIndex === undefined)\n return;\n var node = _this._nodes[nodeIndex];\n delete _this._nodes[nodeIndex];\n _this._datumNodeIndices.delete(datumId);\n if (node) {\n _this._parent.removeChild(node);\n }\n });\n // Reset map of datum ids to node indices while filtering out any removed, undefined, nodes\n var newIndex = 0;\n var datumNodeIndices = this._datumNodeIndices.entries();\n var nodeIndexDatums = new Map();\n try {\n for (var datumNodeIndices_1 = __values$v(datumNodeIndices), datumNodeIndices_1_1 = datumNodeIndices_1.next(); !datumNodeIndices_1_1.done; datumNodeIndices_1_1 = datumNodeIndices_1.next()) {\n var _b = __read$V(datumNodeIndices_1_1.value, 2), datumId = _b[0], nodeIndex = _b[1];\n nodeIndexDatums.set(nodeIndex, datumId);\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (datumNodeIndices_1_1 && !datumNodeIndices_1_1.done && (_a = datumNodeIndices_1.return)) _a.call(datumNodeIndices_1);\n }\n finally { if (e_2) throw e_2.error; }\n }\n this._nodes = this._nodes.filter(function (node, index) {\n if (node === undefined)\n return false;\n var datumId = nodeIndexDatums.get(index);\n _this._datumNodeIndices.set(datumId, newIndex);\n newIndex++;\n return true;\n });\n this._garbage = [];\n };\n Selection.selectAll = function (parent, predicate) {\n var results = [];\n var traverse = function (node) {\n if (predicate(node)) {\n results.push(node);\n }\n node.children.forEach(traverse);\n };\n traverse(parent);\n return results;\n };\n Selection.selectByClass = function (node, Class) {\n return Selection.selectAll(node, function (node) { return node instanceof Class; });\n };\n Selection.selectByTag = function (node, tag) {\n return Selection.selectAll(node, function (node) { return node.tag === tag; });\n };\n Selection.prototype.select = function (predicate) {\n return Selection.selectAll(this._parent, predicate);\n };\n Selection.prototype.selectByClass = function (Class) {\n return this.select(function (node) { return node instanceof Class; });\n };\n Selection.prototype.selectByTag = function (tag) {\n return this.select(function (node) { return node.tag === tag; });\n };\n Selection.prototype.nodes = function () {\n return this._nodes;\n };\n return Selection;\n}());\n\n/**\n * Finds the roots of a parametric linear equation in `t`,\n * where `t` lies in the interval of `[0,1]`.\n */\nfunction linearRoot(a, b) {\n var t = -b / a;\n return a !== 0 && t >= 0 && t <= 1 ? [t] : [];\n}\n/**\n * Finds the roots of a parametric quadratic equation in `t`,\n * where `t` lies in the interval of `[0,1]`.\n */\nfunction quadraticRoots(a, b, c) {\n if (a === 0) {\n return linearRoot(b, c);\n }\n var D = b * b - 4 * a * c; // The polynomial's discriminant.\n var roots = [];\n if (D === 0) {\n // A single real root.\n var t = -b / (2 * a);\n if (t >= 0 && t <= 1) {\n roots.push(t);\n }\n }\n else if (D > 0) {\n // A pair of distinct real roots.\n var rD = Math.sqrt(D);\n var t1 = (-b - rD) / (2 * a);\n var t2 = (-b + rD) / (2 * a);\n if (t1 >= 0 && t1 <= 1) {\n roots.push(t1);\n }\n if (t2 >= 0 && t2 <= 1) {\n roots.push(t2);\n }\n }\n // else -> Complex roots.\n return roots;\n}\n/**\n * Finds the roots of a parametric cubic equation in `t`,\n * where `t` lies in the interval of `[0,1]`.\n * Returns an array of parametric intersection locations along the cubic,\n * excluding out-of-bounds intersections (before or after the end point\n * or in the imaginary plane).\n * An adaptation of http://www.particleincell.com/blog/2013/cubic-line-intersection/\n */\nfunction cubicRoots(a, b, c, d) {\n if (a === 0) {\n return quadraticRoots(b, c, d);\n }\n var A = b / a;\n var B = c / a;\n var C = d / a;\n var Q = (3 * B - A * A) / 9;\n var R = (9 * A * B - 27 * C - 2 * A * A * A) / 54;\n var D = Q * Q * Q + R * R; // The polynomial's discriminant.\n var third = 1 / 3;\n var roots = [];\n if (D >= 0) {\n // Complex or duplicate roots.\n var rD = Math.sqrt(D);\n var S = Math.sign(R + rD) * Math.pow(Math.abs(R + rD), third);\n var T = Math.sign(R - rD) * Math.pow(Math.abs(R - rD), third);\n var Im = Math.abs((Math.sqrt(3) * (S - T)) / 2); // Complex part of the root pair.\n var t = -third * A + (S + T); // A real root.\n if (t >= 0 && t <= 1) {\n roots.push(t);\n }\n if (Im === 0) {\n var t_1 = -third * A - (S + T) / 2; // The real part of a complex root.\n if (t_1 >= 0 && t_1 <= 1) {\n roots.push(t_1);\n }\n }\n }\n else {\n // Distinct real roots.\n var theta = Math.acos(R / Math.sqrt(-Q * Q * Q));\n var thirdA = third * A;\n var twoSqrtQ = 2 * Math.sqrt(-Q);\n var t1 = twoSqrtQ * Math.cos(third * theta) - thirdA;\n var t2 = twoSqrtQ * Math.cos(third * (theta + 2 * Math.PI)) - thirdA;\n var t3 = twoSqrtQ * Math.cos(third * (theta + 4 * Math.PI)) - thirdA;\n if (t1 >= 0 && t1 <= 1) {\n roots.push(t1);\n }\n if (t2 >= 0 && t2 <= 1) {\n roots.push(t2);\n }\n if (t3 >= 0 && t3 <= 1) {\n roots.push(t3);\n }\n }\n return roots;\n}\n\nvar __values$u = (undefined && undefined.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\n/**\n * Returns the intersection point for the given pair of line segments, or null,\n * if the segments are parallel or don't intersect.\n * Based on http://paulbourke.net/geometry/pointlineplane/\n */\nfunction segmentIntersection(ax1, ay1, ax2, ay2, bx1, by1, bx2, by2) {\n var d = (ax2 - ax1) * (by2 - by1) - (ay2 - ay1) * (bx2 - bx1);\n if (d === 0) {\n // The lines are parallel.\n return null;\n }\n var ua = ((bx2 - bx1) * (ay1 - by1) - (ax1 - bx1) * (by2 - by1)) / d;\n var ub = ((ax2 - ax1) * (ay1 - by1) - (ay2 - ay1) * (ax1 - bx1)) / d;\n if (ua >= 0 && ua <= 1 && ub >= 0 && ub <= 1) {\n return {\n x: ax1 + ua * (ax2 - ax1),\n y: ay1 + ua * (ay2 - ay1),\n };\n }\n return null; // The intersection point is outside either or both segments.\n}\n/**\n * Returns intersection points of the given cubic curve and the line segment.\n * Takes in x/y components of cubic control points and line segment start/end points\n * as parameters.\n */\nfunction cubicSegmentIntersections(px1, py1, px2, py2, px3, py3, px4, py4, x1, y1, x2, y2) {\n var e_1, _a;\n var intersections = [];\n // Find line equation coefficients.\n var A = y1 - y2;\n var B = x2 - x1;\n var C = x1 * (y2 - y1) - y1 * (x2 - x1);\n // Find cubic Bezier curve equation coefficients from control points.\n var bx = bezierCoefficients(px1, px2, px3, px4);\n var by = bezierCoefficients(py1, py2, py3, py4);\n var a = A * bx[0] + B * by[0]; // t^3\n var b = A * bx[1] + B * by[1]; // t^2\n var c = A * bx[2] + B * by[2]; // t\n var d = A * bx[3] + B * by[3] + C; // 1\n var roots = cubicRoots(a, b, c, d);\n try {\n // Verify that the roots are within bounds of the linear segment.\n for (var roots_1 = __values$u(roots), roots_1_1 = roots_1.next(); !roots_1_1.done; roots_1_1 = roots_1.next()) {\n var t = roots_1_1.value;\n var tt = t * t;\n var ttt = t * tt;\n // Find the cartesian plane coordinates for the parametric root `t`.\n var x = bx[0] * ttt + bx[1] * tt + bx[2] * t + bx[3];\n var y = by[0] * ttt + by[1] * tt + by[2] * t + by[3];\n // The parametric cubic roots we found are intersection points\n // with an infinite line, and so the x/y coordinates above are as well.\n // Make sure the x/y is also within the bounds of the given segment.\n var s = void 0;\n if (x1 !== x2) {\n s = (x - x1) / (x2 - x1);\n }\n else {\n // the line is vertical\n s = (y - y1) / (y2 - y1);\n }\n if (s >= 0 && s <= 1) {\n intersections.push({ x: x, y: y });\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (roots_1_1 && !roots_1_1.done && (_a = roots_1.return)) _a.call(roots_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n return intersections;\n}\n/**\n * Returns the given coordinates vector multiplied by the coefficient matrix\n * of the parametric cubic Bézier equation.\n */\nfunction bezierCoefficients(P1, P2, P3, P4) {\n return [\n // Bézier expressed as matrix operations:\n -P1 + 3 * P2 - 3 * P3 + P4,\n 3 * P1 - 6 * P2 + 3 * P3,\n -3 * P1 + 3 * P2,\n P1, // | 1 0 0 0| |P4|\n ];\n}\n/**\n * Returns intersection points of the arc and the line segment.\n * Takes in arc parameters and line segment start/end points.\n */\nfunction arcIntersections(cx, cy, r, startAngle, endAngle, counterClockwise, x1, y1, x2, y2) {\n // Solving the quadratic equation:\n // 1. y = k * x + y0\n // 2. (x - cx)^2 + (y - cy)^2 = r^2\n var k = (y2 - y1) / (x2 - x1);\n var y0 = y1 - k * x1;\n var a = Math.pow(k, 2) + 1;\n var b = 2 * (k * (y0 - cy) - cx);\n var c = Math.pow(cx, 2) + Math.pow(y0 - cy, 2) - Math.pow(r, 2);\n var d = Math.pow(b, 2) - 4 * a * c;\n if (d < 0) {\n return [];\n }\n var i1x = (-b + Math.sqrt(d)) / 2 / a;\n var i2x = (-b - Math.sqrt(d)) / 2 / a;\n var intersections = [];\n [i1x, i2x].forEach(function (x) {\n var isXInsideLine = x >= Math.min(x1, x2) && x <= Math.max(x1, x2);\n if (!isXInsideLine) {\n return;\n }\n var y = k * x;\n var a1 = normalizeAngle360(counterClockwise ? endAngle : startAngle);\n var a2 = normalizeAngle360(counterClockwise ? startAngle : endAngle);\n var intersectionAngle = normalizeAngle360(Math.atan2(y, x));\n // Order angles clockwise after the start angle\n // (end angle if counter-clockwise)\n if (a2 <= a1) {\n a2 += 2 * Math.PI;\n }\n if (intersectionAngle < a1) {\n intersectionAngle += 2 * Math.PI;\n }\n if (intersectionAngle >= a1 && intersectionAngle <= a2) {\n intersections.push({ x: x, y: y });\n }\n });\n return intersections;\n}\n\nvar __values$t = (undefined && undefined.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nvar Command;\n(function (Command) {\n Command[Command[\"Move\"] = 0] = \"Move\";\n Command[Command[\"Line\"] = 1] = \"Line\";\n Command[Command[\"Arc\"] = 2] = \"Arc\";\n Command[Command[\"Curve\"] = 3] = \"Curve\";\n Command[Command[\"ClosePath\"] = 4] = \"ClosePath\";\n})(Command || (Command = {}));\nvar Path2D = /** @class */ (function () {\n function Path2D() {\n // The methods of this class will likely be called many times per animation frame,\n // and any allocation can trigger a GC cycle during animation, so we attempt\n // to minimize the number of allocations.\n this.previousCommands = [];\n this.previousParams = [];\n this.previousClosedPath = false;\n this.commands = [];\n this.params = [];\n this._closedPath = false;\n }\n Path2D.prototype.isDirty = function () {\n if (this._closedPath !== this.previousClosedPath) {\n return true;\n }\n if (this.previousCommands.length !== this.commands.length) {\n return true;\n }\n if (this.previousParams.length !== this.params.length) {\n return true;\n }\n for (var i = 0; i < this.commands.length; i++) {\n if (this.commands[i] !== this.previousCommands[i]) {\n return true;\n }\n }\n for (var i = 0; i < this.params.length; i++) {\n if (this.params[i] !== this.previousParams[i]) {\n return true;\n }\n }\n return false;\n };\n Path2D.prototype.draw = function (ctx) {\n var e_1, _a;\n var commands = this.commands;\n var params = this.params;\n var j = 0;\n ctx.beginPath();\n try {\n for (var commands_1 = __values$t(commands), commands_1_1 = commands_1.next(); !commands_1_1.done; commands_1_1 = commands_1.next()) {\n var command = commands_1_1.value;\n switch (command) {\n case Command.Move:\n ctx.moveTo(params[j++], params[j++]);\n break;\n case Command.Line:\n ctx.lineTo(params[j++], params[j++]);\n break;\n case Command.Curve:\n ctx.bezierCurveTo(params[j++], params[j++], params[j++], params[j++], params[j++], params[j++]);\n break;\n case Command.Arc:\n ctx.arc(params[j++], params[j++], params[j++], params[j++], params[j++], params[j++] === 1);\n break;\n case Command.ClosePath:\n ctx.closePath();\n break;\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (commands_1_1 && !commands_1_1.done && (_a = commands_1.return)) _a.call(commands_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n if (commands.length === 0) {\n ctx.closePath();\n }\n };\n Path2D.prototype.moveTo = function (x, y) {\n if (this.xy) {\n this.xy[0] = x;\n this.xy[1] = y;\n }\n else {\n this.xy = [x, y];\n }\n this.commands.push(Command.Move);\n this.params.push(x, y);\n };\n Path2D.prototype.lineTo = function (x, y) {\n if (this.xy) {\n this.commands.push(Command.Line);\n this.params.push(x, y);\n this.xy[0] = x;\n this.xy[1] = y;\n }\n else {\n this.moveTo(x, y);\n }\n };\n Path2D.prototype.rect = function (x, y, width, height) {\n this.moveTo(x, y);\n this.lineTo(x + width, y);\n this.lineTo(x + width, y + height);\n this.lineTo(x, y + height);\n this.closePath();\n };\n Path2D.prototype.arc = function (x, y, r, sAngle, eAngle, antiClockwise) {\n if (antiClockwise === void 0) { antiClockwise = false; }\n var endX = x + r * Math.cos(eAngle);\n var endY = y + r * Math.sin(eAngle);\n if (this.xy) {\n this.xy[0] = endX;\n this.xy[1] = endY;\n }\n else {\n this.xy = [endX, endY];\n }\n this.commands.push(Command.Arc);\n this.params.push(x, y, r, sAngle, eAngle, antiClockwise ? 1 : 0);\n };\n Path2D.prototype.cubicCurveTo = function (cx1, cy1, cx2, cy2, x, y) {\n if (!this.xy) {\n this.moveTo(cx1, cy1);\n }\n this.commands.push(Command.Curve);\n this.params.push(cx1, cy1, cx2, cy2, x, y);\n if (this.xy) {\n this.xy[0] = x;\n this.xy[1] = y;\n }\n };\n Object.defineProperty(Path2D.prototype, \"closedPath\", {\n get: function () {\n return this._closedPath;\n },\n enumerable: false,\n configurable: true\n });\n Path2D.prototype.closePath = function () {\n if (this.xy) {\n this.xy = undefined;\n this.commands.push(Command.ClosePath);\n this._closedPath = true;\n }\n };\n Path2D.prototype.clear = function (_a) {\n var _b = _a === void 0 ? { trackChanges: false } : _a, trackChanges = _b.trackChanges;\n if (trackChanges) {\n this.previousCommands = this.commands;\n this.previousParams = this.params;\n this.previousClosedPath = this._closedPath;\n this.commands = [];\n this.params = [];\n }\n else {\n this.commands.length = 0;\n this.params.length = 0;\n }\n this.xy = undefined;\n this._closedPath = false;\n };\n Path2D.prototype.isPointInPath = function (x, y) {\n var commands = this.commands;\n var params = this.params;\n var cn = commands.length;\n // Hit testing using ray casting method, where the ray's origin is some point\n // outside the path. In this case, an offscreen point that is remote enough, so that\n // even if the path itself is large and is partially offscreen, the ray's origin\n // will likely be outside the path anyway. To test if the given point is inside the\n // path or not, we cast a ray from the origin to the given point and check the number\n // of intersections of this segment with the path. If the number of intersections is\n // even, then the ray both entered and exited the path an equal number of times,\n // therefore the point is outside the path, and inside the path, if the number of\n // intersections is odd. Since the path is compound, we check if the ray segment\n // intersects with each of the path's segments, which can be either a line segment\n // (one or no intersection points) or a Bézier curve segment (up to 3 intersection\n // points).\n var ox = -10000;\n var oy = -10000;\n // the starting point of the current path\n var sx = NaN;\n var sy = NaN;\n // the previous point of the current path\n var px = 0;\n var py = 0;\n var intersectionCount = 0;\n for (var ci = 0, pi = 0; ci < cn; ci++) {\n switch (commands[ci]) {\n case Command.Move:\n if (!isNaN(sx)) {\n if (segmentIntersection(sx, sy, px, py, ox, oy, x, y)) {\n intersectionCount++;\n }\n }\n px = params[pi++];\n sx = px;\n py = params[pi++];\n sy = py;\n break;\n case Command.Line:\n if (segmentIntersection(px, py, params[pi++], params[pi++], ox, oy, x, y)) {\n intersectionCount++;\n }\n px = params[pi - 2];\n py = params[pi - 1];\n break;\n case Command.Curve:\n intersectionCount += cubicSegmentIntersections(px, py, params[pi++], params[pi++], params[pi++], params[pi++], params[pi++], params[pi++], ox, oy, x, y).length;\n px = params[pi - 2];\n py = params[pi - 1];\n break;\n case Command.Arc:\n intersectionCount += arcIntersections(params[pi++], params[pi++], params[pi++], params[pi++], params[pi++], Boolean(params[pi++]), ox, oy, x, y).length;\n px = params[pi - 2];\n py = params[pi - 1];\n break;\n case Command.ClosePath:\n if (!isNaN(sx)) {\n if (segmentIntersection(sx, sy, px, py, ox, oy, x, y)) {\n intersectionCount++;\n }\n }\n break;\n }\n }\n return intersectionCount % 2 === 1;\n };\n return Path2D;\n}());\n\nvar __extends$2C = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$1S = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nfunction ScenePathChangeDetection(opts) {\n var _a = opts !== null && opts !== void 0 ? opts : {}, _b = _a.redraw, redraw = _b === void 0 ? RedrawType.MAJOR : _b, changeCb = _a.changeCb, convertor = _a.convertor;\n return SceneChangeDetection({ redraw: redraw, type: 'path', convertor: convertor, changeCb: changeCb });\n}\nvar Path = /** @class */ (function (_super) {\n __extends$2C(Path, _super);\n function Path() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n /**\n * Declare a path to retain for later rendering and hit testing\n * using custom Path2D class. Think of it as a TypeScript version\n * of the native Path2D (with some differences) that works in all browsers.\n */\n _this.path = new Path2D();\n /**\n * The path only has to be updated when certain attributes change.\n * For example, if transform attributes (such as `translationX`)\n * are changed, we don't have to update the path. The `dirtyPath` flag\n * is how we keep track if the path has to be updated or not.\n */\n _this._dirtyPath = true;\n return _this;\n }\n Object.defineProperty(Path.prototype, \"dirtyPath\", {\n get: function () {\n return this._dirtyPath;\n },\n set: function (value) {\n if (this._dirtyPath !== value) {\n this._dirtyPath = value;\n if (value) {\n this.markDirty(this, RedrawType.MAJOR);\n }\n }\n },\n enumerable: false,\n configurable: true\n });\n Path.prototype.checkPathDirty = function () {\n var _a, _b;\n if (this._dirtyPath) {\n return;\n }\n this.dirtyPath = this.path.isDirty() || ((_b = (_a = this.fillShadow) === null || _a === void 0 ? void 0 : _a.isDirty()) !== null && _b !== void 0 ? _b : false);\n };\n Path.prototype.isPointInPath = function (x, y) {\n var point = this.transformPoint(x, y);\n return this.path.closedPath && this.path.isPointInPath(point.x, point.y);\n };\n Path.prototype.isDirtyPath = function () {\n // Override point for more expensive dirty checks.\n return false;\n };\n Path.prototype.updatePath = function () {\n // Override point for subclasses.\n };\n Path.prototype.render = function (renderCtx) {\n var _a, _b;\n var ctx = renderCtx.ctx, forceRender = renderCtx.forceRender, stats = renderCtx.stats;\n if (this.dirty === RedrawType.NONE && !forceRender) {\n if (stats)\n stats.nodesSkipped += this.nodeCount.count;\n return;\n }\n this.computeTransformMatrix();\n this.matrix.toContext(ctx);\n if (this.dirtyPath || this.isDirtyPath()) {\n this.updatePath();\n this.dirtyPath = false;\n }\n if (this.clipPath) {\n ctx.save();\n if (this.clipMode === 'normal') {\n // Bound the shape rendered to the clipping path.\n this.clipPath.draw(ctx);\n ctx.clip();\n }\n this.path.draw(ctx);\n this.fillStroke(ctx);\n if (this.clipMode === 'punch-out') {\n // Bound the shape rendered to outside the clipping path.\n this.clipPath.draw(ctx);\n ctx.clip();\n // Fallback values, but practically these should never be used.\n var _c = (_a = this.computeBBox()) !== null && _a !== void 0 ? _a : {}, _d = _c.x, x = _d === void 0 ? -10000 : _d, _e = _c.y, y = _e === void 0 ? -10000 : _e, _f = _c.width, width = _f === void 0 ? 20000 : _f, _g = _c.height, height = _g === void 0 ? 20000 : _g;\n ctx.clearRect(x, y, width, height);\n }\n ctx.restore();\n }\n else {\n this.path.draw(ctx);\n this.fillStroke(ctx);\n }\n (_b = this.fillShadow) === null || _b === void 0 ? void 0 : _b.markClean();\n _super.prototype.render.call(this, renderCtx);\n };\n Path.className = 'Path';\n __decorate$1S([\n ScenePathChangeDetection()\n ], Path.prototype, \"clipPath\", void 0);\n __decorate$1S([\n ScenePathChangeDetection()\n ], Path.prototype, \"clipMode\", void 0);\n return Path;\n}(Shape));\n\nvar __extends$2B = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$1R = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __values$s = (undefined && undefined.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nvar Marker = /** @class */ (function (_super) {\n __extends$2B(Marker, _super);\n function Marker() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.x = 0;\n _this.y = 0;\n _this.size = 12;\n return _this;\n }\n Marker.prototype.computeBBox = function () {\n var _a = this, x = _a.x, y = _a.y, size = _a.size;\n var half = size / 2;\n return new BBox(x - half, y - half, size, size);\n };\n Marker.prototype.applyPath = function (s, moves) {\n var e_1, _a;\n var path = this.path;\n var _b = this, x = _b.x, y = _b.y;\n path.clear();\n try {\n for (var moves_1 = __values$s(moves), moves_1_1 = moves_1.next(); !moves_1_1.done; moves_1_1 = moves_1.next()) {\n var _c = moves_1_1.value, mx = _c.x, my = _c.y, t = _c.t;\n x += mx * s;\n y += my * s;\n if (t === 'move') {\n path.moveTo(x, y);\n }\n else {\n path.lineTo(x, y);\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (moves_1_1 && !moves_1_1.done && (_a = moves_1.return)) _a.call(moves_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n path.closePath();\n };\n __decorate$1R([\n ScenePathChangeDetection()\n ], Marker.prototype, \"x\", void 0);\n __decorate$1R([\n ScenePathChangeDetection()\n ], Marker.prototype, \"y\", void 0);\n __decorate$1R([\n ScenePathChangeDetection({ convertor: Math.abs })\n ], Marker.prototype, \"size\", void 0);\n return Marker;\n}(Path));\n\nvar __extends$2A = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar Square = /** @class */ (function (_super) {\n __extends$2A(Square, _super);\n function Square() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Square.prototype.updatePath = function () {\n var _a = this, path = _a.path, x = _a.x, y = _a.y;\n var hs = this.size / 2;\n path.clear();\n path.moveTo(this.align(x - hs), this.align(y - hs));\n path.lineTo(this.align(x + hs), this.align(y - hs));\n path.lineTo(this.align(x + hs), this.align(y + hs));\n path.lineTo(this.align(x - hs), this.align(y + hs));\n path.closePath();\n };\n Square.className = 'Square';\n return Square;\n}(Marker));\n\nvar __extends$2z = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$1Q = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar MarkerLabel = /** @class */ (function (_super) {\n __extends$2z(MarkerLabel, _super);\n function MarkerLabel() {\n var _this = _super.call(this, { name: 'markerLabelGroup' }) || this;\n _this.label = new Text();\n _this._marker = new Square();\n _this._markerSize = 15;\n _this._spacing = 8;\n var label = _this.label;\n label.textBaseline = 'middle';\n label.fontSize = 12;\n label.fontFamily = 'Verdana, sans-serif';\n label.fill = 'black';\n // For better looking vertical alignment of labels to markers.\n label.y = HdpiCanvas.has.textMetrics ? 1 : 0;\n _this.append([_this.marker, label]);\n _this.update();\n return _this;\n }\n Object.defineProperty(MarkerLabel.prototype, \"marker\", {\n get: function () {\n return this._marker;\n },\n set: function (value) {\n if (this._marker !== value) {\n this.removeChild(this._marker);\n this._marker = value;\n this.appendChild(value);\n this.update();\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MarkerLabel.prototype, \"markerSize\", {\n get: function () {\n return this._markerSize;\n },\n set: function (value) {\n if (this._markerSize !== value) {\n this._markerSize = value;\n this.update();\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MarkerLabel.prototype, \"spacing\", {\n get: function () {\n return this._spacing;\n },\n set: function (value) {\n if (this._spacing !== value) {\n this._spacing = value;\n this.update();\n }\n },\n enumerable: false,\n configurable: true\n });\n MarkerLabel.prototype.update = function () {\n var marker = this.marker;\n var markerSize = this.markerSize;\n marker.size = markerSize;\n this.label.x = markerSize / 2 + this.spacing;\n };\n MarkerLabel.prototype.render = function (renderCtx) {\n // Cannot override field Group.opacity with get/set pair, so\n // propagate opacity changes here.\n this.marker.opacity = this.opacity;\n this.label.opacity = this.opacity;\n _super.prototype.render.call(this, renderCtx);\n };\n MarkerLabel.className = 'MarkerLabel';\n __decorate$1Q([\n ProxyPropertyOnWrite('label')\n ], MarkerLabel.prototype, \"text\", void 0);\n __decorate$1Q([\n ProxyPropertyOnWrite('label')\n ], MarkerLabel.prototype, \"fontStyle\", void 0);\n __decorate$1Q([\n ProxyPropertyOnWrite('label')\n ], MarkerLabel.prototype, \"fontWeight\", void 0);\n __decorate$1Q([\n ProxyPropertyOnWrite('label')\n ], MarkerLabel.prototype, \"fontSize\", void 0);\n __decorate$1Q([\n ProxyPropertyOnWrite('label')\n ], MarkerLabel.prototype, \"fontFamily\", void 0);\n __decorate$1Q([\n ProxyPropertyOnWrite('label', 'fill')\n ], MarkerLabel.prototype, \"color\", void 0);\n __decorate$1Q([\n ProxyPropertyOnWrite('marker', 'fill')\n ], MarkerLabel.prototype, \"markerFill\", void 0);\n __decorate$1Q([\n ProxyPropertyOnWrite('marker', 'stroke')\n ], MarkerLabel.prototype, \"markerStroke\", void 0);\n __decorate$1Q([\n ProxyPropertyOnWrite('marker', 'strokeWidth')\n ], MarkerLabel.prototype, \"markerStrokeWidth\", void 0);\n __decorate$1Q([\n ProxyPropertyOnWrite('marker', 'fillOpacity')\n ], MarkerLabel.prototype, \"markerFillOpacity\", void 0);\n __decorate$1Q([\n ProxyPropertyOnWrite('marker', 'strokeOpacity')\n ], MarkerLabel.prototype, \"markerStrokeOpacity\", void 0);\n return MarkerLabel;\n}(Group));\n\nvar __extends$2y = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar Circle = /** @class */ (function (_super) {\n __extends$2y(Circle, _super);\n function Circle() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Circle.prototype.updatePath = function () {\n var _a = this, x = _a.x, y = _a.y, path = _a.path, size = _a.size;\n var r = size / 2;\n path.clear();\n path.arc(x, y, r, 0, Math.PI * 2);\n path.closePath();\n };\n Circle.className = 'Circle';\n return Circle;\n}(Marker));\n\nvar __extends$2x = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar Cross = /** @class */ (function (_super) {\n __extends$2x(Cross, _super);\n function Cross() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Cross.prototype.updatePath = function () {\n var s = this.size / 4.2;\n _super.prototype.applyPath.call(this, s, Cross.moves);\n };\n Cross.className = 'Cross';\n Cross.moves = [\n { x: -1, y: 0, t: 'move' },\n { x: -1, y: -1 },\n { x: +1, y: -1 },\n { x: +1, y: +1 },\n { x: +1, y: -1 },\n { x: +1, y: +1 },\n { x: -1, y: +1 },\n { x: +1, y: +1 },\n { x: -1, y: +1 },\n { x: -1, y: -1 },\n { x: -1, y: +1 },\n { x: -1, y: -1 },\n ];\n return Cross;\n}(Marker));\n\nvar __extends$2w = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar Diamond = /** @class */ (function (_super) {\n __extends$2w(Diamond, _super);\n function Diamond() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Diamond.prototype.updatePath = function () {\n var s = this.size / 2;\n _super.prototype.applyPath.call(this, s, Diamond.moves);\n };\n Diamond.className = 'Diamond';\n Diamond.moves = [\n { x: 0, y: -1, t: 'move' },\n { x: +1, y: +1 },\n { x: -1, y: +1 },\n { x: -1, y: -1 },\n { x: +1, y: -1 },\n ];\n return Diamond;\n}(Marker));\n\nvar __extends$2v = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar Heart = /** @class */ (function (_super) {\n __extends$2v(Heart, _super);\n function Heart() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Heart.prototype.rad = function (degree) {\n return (degree / 180) * Math.PI;\n };\n Heart.prototype.updatePath = function () {\n var _a = this, x = _a.x, path = _a.path, size = _a.size, rad = _a.rad;\n var r = size / 4;\n var y = this.y + r / 2;\n path.clear();\n path.arc(x - r, y - r, r, rad(130), rad(330));\n path.arc(x + r, y - r, r, rad(220), rad(50));\n path.lineTo(x, y + r);\n path.closePath();\n };\n Heart.className = 'Heart';\n return Heart;\n}(Marker));\n\nvar __extends$2u = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar Plus = /** @class */ (function (_super) {\n __extends$2u(Plus, _super);\n function Plus() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Plus.prototype.updatePath = function () {\n var s = this.size / 3;\n _super.prototype.applyPath.call(this, s, Plus.moves);\n };\n Plus.className = 'Plus';\n Plus.moves = [\n { x: -0.5, y: -0.5, t: 'move' },\n { x: 0, y: -1 },\n { x: +1, y: 0 },\n { x: 0, y: +1 },\n { x: +1, y: 0 },\n { x: 0, y: +1 },\n { x: -1, y: 0 },\n { x: 0, y: +1 },\n { x: -1, y: 0 },\n { x: 0, y: -1 },\n { x: -1, y: 0 },\n { x: 0, y: -1 },\n ];\n return Plus;\n}(Marker));\n\nvar __extends$2t = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar Triangle = /** @class */ (function (_super) {\n __extends$2t(Triangle, _super);\n function Triangle() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Triangle.prototype.updatePath = function () {\n var s = this.size * 1.1;\n _super.prototype.applyPath.call(this, s, Triangle.moves);\n };\n Triangle.className = 'Triangle';\n Triangle.moves = [\n { x: 0, y: -0.48, t: 'move' },\n { x: 0.5, y: 0.87 },\n { x: -1, y: 0 },\n ];\n return Triangle;\n}(Marker));\n\n// This function is in its own file because putting it into SeriesMarker makes the Legend\n// suddenly aware of the series (it's an agnostic component), and putting it into Marker\n// introduces circular dependencies.\nfunction getMarker$1(shape) {\n if (shape === void 0) { shape = Square; }\n if (typeof shape === 'string') {\n switch (shape) {\n case 'circle':\n return Circle;\n case 'cross':\n return Cross;\n case 'diamond':\n return Diamond;\n case 'heart':\n return Heart;\n case 'plus':\n return Plus;\n case 'triangle':\n return Triangle;\n default:\n return Square;\n }\n }\n if (typeof shape === 'function') {\n return shape;\n }\n return Square;\n}\n\nvar __values$r = (undefined && undefined.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nfunction gridLayout(_a) {\n var orientation = _a.orientation, bboxes = _a.bboxes, maxHeight = _a.maxHeight, maxWidth = _a.maxWidth, _b = _a.itemPaddingY, itemPaddingY = _b === void 0 ? 0 : _b, _c = _a.itemPaddingX, itemPaddingX = _c === void 0 ? 0 : _c, _d = _a.forceResult, forceResult = _d === void 0 ? false : _d;\n var horizontal = orientation === 'horizontal';\n var primary = {\n max: horizontal ? maxWidth : maxHeight,\n fn: horizontal ? function (b) { return b.width; } : function (b) { return b.height; },\n padding: horizontal ? itemPaddingX : itemPaddingY,\n };\n var secondary = {\n max: !horizontal ? maxWidth : maxHeight,\n fn: !horizontal ? function (b) { return b.width; } : function (b) { return b.height; },\n padding: !horizontal ? itemPaddingX : itemPaddingY,\n };\n var processedBBoxCount = 0;\n var rawPages = [];\n while (processedBBoxCount < bboxes.length) {\n var unprocessedBBoxes = bboxes.slice(processedBBoxCount);\n var result = processBBoxes(unprocessedBBoxes, processedBBoxCount, primary, secondary, forceResult);\n if (!result) {\n return;\n }\n processedBBoxCount += result.processedBBoxCount;\n rawPages.push(result.pageIndices);\n }\n return buildPages(rawPages, orientation, bboxes, itemPaddingY, itemPaddingX);\n}\nfunction processBBoxes(bboxes, indexOffset, primary, secondary, forceResult) {\n // If calculatePage() fails on the first guess, we could use the number of items that fit\n // as a good guess for the next iteration.\n var minGuess = 1;\n var startingGuess = estimateStartingGuess(bboxes, primary);\n if (startingGuess < minGuess) {\n if (!forceResult) {\n return undefined;\n }\n // Legend constraints too small! Display at least one row/column if forceResult is true\n startingGuess = minGuess;\n }\n for (var guess = startingGuess; guess >= minGuess; guess--) {\n var pageIndices = calculatePage(bboxes, indexOffset, guess, primary, secondary, forceResult);\n if (pageIndices == null && guess <= minGuess) {\n // Can't layout!\n return undefined;\n }\n if (pageIndices == null) {\n // Guess again!\n continue;\n }\n if (typeof pageIndices === 'number') {\n // calculatePage() suggested a better guess, use that if it's more than minGuess.\n if (pageIndices <= minGuess) {\n // Can't layout!\n return undefined;\n }\n guess = pageIndices < guess && pageIndices > minGuess ? pageIndices : guess;\n continue;\n }\n var processedBBoxCount = pageIndices.length * pageIndices[0].length; // this is an estimate, not all rows/columns will have the same length\n return { processedBBoxCount: processedBBoxCount, pageIndices: pageIndices };\n }\n}\nfunction calculatePage(bboxes, indexOffset, primaryCount, primary, secondary, forceResult) {\n var _a;\n var result = [];\n var sumSecondary = 0;\n var currentMaxSecondary = 0;\n var currentPrimaryIndices = [];\n var maxPrimaryValues = [];\n for (var bboxIndex = 0; bboxIndex < bboxes.length; bboxIndex++) {\n var primaryValueIdx = (bboxIndex + primaryCount) % primaryCount;\n if (primaryValueIdx === 0) {\n sumSecondary += currentMaxSecondary;\n currentMaxSecondary = 0;\n if (currentPrimaryIndices.length > 0) {\n result.push(currentPrimaryIndices);\n }\n currentPrimaryIndices = [];\n }\n var primaryValue = primary.fn(bboxes[bboxIndex]) + primary.padding;\n maxPrimaryValues[primaryValueIdx] = Math.max((_a = maxPrimaryValues[primaryValueIdx]) !== null && _a !== void 0 ? _a : 0, primaryValue);\n currentMaxSecondary = Math.max(currentMaxSecondary, secondary.fn(bboxes[bboxIndex]) + secondary.padding);\n var currentSecondaryDimension = sumSecondary + currentMaxSecondary;\n var returnResult = !forceResult || result.length > 0;\n if (currentSecondaryDimension > secondary.max && returnResult) {\n // Breached max secondary dimension size, return indices accumlated so far (but not in-progress row/column).\n currentPrimaryIndices = [];\n break;\n }\n var sumPrimary = maxPrimaryValues.reduce(function (sum, next) { return sum + next; }, 0);\n if (sumPrimary > primary.max && !forceResult) {\n // Breached max main dimension size.\n if (maxPrimaryValues.length < primaryCount) {\n // Feedback as guess for next iteration if we're on the first round still.\n return maxPrimaryValues.length;\n }\n return undefined;\n }\n currentPrimaryIndices.push(bboxIndex + indexOffset);\n }\n if (currentPrimaryIndices.length > 0) {\n result.push(currentPrimaryIndices);\n }\n return result.length > 0 ? result : undefined;\n}\nfunction buildPages(rawPages, orientation, bboxes, itemPaddingY, itemPaddingX) {\n var maxPageWidth = 0;\n var maxPageHeight = 0;\n var pages = rawPages.map(function (indices) {\n if (orientation === 'horizontal') {\n indices = transpose(indices);\n }\n var endIndex = 0;\n var columns = indices.map(function (colIndices) {\n var colBBoxes = colIndices.map(function (bboxIndex) {\n endIndex = Math.max(bboxIndex, endIndex);\n return bboxes[bboxIndex];\n });\n var columnHeight = 0;\n var columnWidth = 0;\n colBBoxes.forEach(function (bbox) {\n columnHeight += bbox.height + itemPaddingY;\n columnWidth = Math.max(columnWidth, bbox.width + itemPaddingX);\n });\n return {\n indices: colIndices,\n bboxes: colBBoxes,\n columnHeight: columnHeight,\n columnWidth: columnWidth,\n };\n });\n var pageWidth = 0;\n var pageHeight = 0;\n columns.forEach(function (column) {\n pageWidth += column.columnWidth;\n pageHeight = Math.max(pageHeight, column.columnHeight);\n });\n maxPageWidth = Math.max(pageWidth, maxPageWidth);\n maxPageHeight = Math.max(pageHeight, maxPageHeight);\n return {\n columns: columns,\n startIndex: indices[0][0],\n endIndex: endIndex,\n pageWidth: pageWidth,\n pageHeight: pageHeight,\n };\n });\n return { pages: pages, maxPageWidth: maxPageWidth, maxPageHeight: maxPageHeight };\n}\nfunction transpose(data) {\n var e_1, _a;\n var result = [];\n try {\n for (var _b = __values$r(data[0]), _c = _b.next(); !_c.done; _c = _b.next()) {\n var _ = _c.value;\n result.push([]);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_1) throw e_1.error; }\n }\n data.forEach(function (innerData, dataIdx) {\n innerData.forEach(function (item, itemIdx) {\n result[itemIdx][dataIdx] = item;\n });\n });\n return result;\n}\nfunction estimateStartingGuess(bboxes, primary) {\n var n = bboxes.length;\n var primarySum = 0;\n for (var bboxIndex = 0; bboxIndex < n; bboxIndex++) {\n primarySum += primary.fn(bboxes[bboxIndex]) + primary.padding;\n if (primarySum > primary.max) {\n var ratio = n / bboxIndex;\n if (ratio < 2) {\n return Math.ceil(n / 2);\n }\n return bboxIndex;\n }\n }\n return n;\n}\n\nvar __decorate$1P = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar PaginationLabel = /** @class */ (function () {\n function PaginationLabel() {\n this.color = 'black';\n this.fontStyle = undefined;\n this.fontWeight = undefined;\n this.fontSize = 12;\n this.fontFamily = 'Verdana, sans-serif';\n }\n __decorate$1P([\n Validate(COLOR_STRING)\n ], PaginationLabel.prototype, \"color\", void 0);\n __decorate$1P([\n Validate(OPT_FONT_STYLE)\n ], PaginationLabel.prototype, \"fontStyle\", void 0);\n __decorate$1P([\n Validate(OPT_FONT_WEIGHT)\n ], PaginationLabel.prototype, \"fontWeight\", void 0);\n __decorate$1P([\n Validate(NUMBER(0))\n ], PaginationLabel.prototype, \"fontSize\", void 0);\n __decorate$1P([\n Validate(STRING)\n ], PaginationLabel.prototype, \"fontFamily\", void 0);\n return PaginationLabel;\n}());\nvar PaginationMarkerStyle = /** @class */ (function () {\n function PaginationMarkerStyle() {\n this.size = 15;\n this.fill = undefined;\n this.fillOpacity = undefined;\n this.stroke = undefined;\n this.strokeWidth = 1;\n this.strokeOpacity = 1;\n }\n __decorate$1P([\n Validate(NUMBER(0))\n ], PaginationMarkerStyle.prototype, \"size\", void 0);\n __decorate$1P([\n Validate(OPT_COLOR_STRING)\n ], PaginationMarkerStyle.prototype, \"fill\", void 0);\n __decorate$1P([\n Validate(OPT_NUMBER(0, 1))\n ], PaginationMarkerStyle.prototype, \"fillOpacity\", void 0);\n __decorate$1P([\n Validate(OPT_COLOR_STRING)\n ], PaginationMarkerStyle.prototype, \"stroke\", void 0);\n __decorate$1P([\n Validate(NUMBER(0))\n ], PaginationMarkerStyle.prototype, \"strokeWidth\", void 0);\n __decorate$1P([\n Validate(NUMBER(0, 1))\n ], PaginationMarkerStyle.prototype, \"strokeOpacity\", void 0);\n return PaginationMarkerStyle;\n}());\nvar PaginationMarker = /** @class */ (function () {\n function PaginationMarker() {\n this.size = 15;\n this._shape = Triangle;\n /**\n * Inner padding between a pagination button and the label.\n */\n this.padding = 8;\n }\n Object.defineProperty(PaginationMarker.prototype, \"shape\", {\n get: function () {\n return this._shape;\n },\n set: function (value) {\n var _a;\n this._shape = value;\n (_a = this.parent) === null || _a === void 0 ? void 0 : _a.onMarkerShapeChange();\n },\n enumerable: false,\n configurable: true\n });\n __decorate$1P([\n Validate(NUMBER(0))\n ], PaginationMarker.prototype, \"size\", void 0);\n __decorate$1P([\n Validate(NUMBER(0))\n ], PaginationMarker.prototype, \"padding\", void 0);\n return PaginationMarker;\n}());\nvar Pagination = /** @class */ (function () {\n function Pagination(chartUpdateCallback, pageUpdateCallback, interactionManager, cursorManager) {\n var _this = this;\n this.chartUpdateCallback = chartUpdateCallback;\n this.pageUpdateCallback = pageUpdateCallback;\n this.interactionManager = interactionManager;\n this.cursorManager = cursorManager;\n this.id = createId$1(this);\n this.group = new Group({ name: 'pagination' });\n this.labelNode = new Text();\n this.marker = new PaginationMarker();\n this.activeStyle = new PaginationMarkerStyle();\n this.inactiveStyle = new PaginationMarkerStyle();\n this.highlightStyle = new PaginationMarkerStyle();\n this.label = new PaginationLabel();\n this.totalPages = 0;\n this.currentPage = 0;\n this.translationX = 0;\n this.translationY = 0;\n this.nextButtonDisabled = false;\n this.previousButtonDisabled = false;\n this._visible = true;\n this._enabled = true;\n this._orientation = 'vertical';\n this._nextButton = new Triangle();\n this._previousButton = new Triangle();\n var labelNode = this.labelNode;\n labelNode.textBaseline = 'middle';\n labelNode.fontSize = 12;\n labelNode.fontFamily = 'Verdana, sans-serif';\n labelNode.fill = 'black';\n labelNode.y = HdpiCanvas.has.textMetrics ? 1 : 0;\n this.group.append([this.nextButton, this.previousButton, labelNode]);\n this.interactionManager.addListener('click', function (event) { return _this.onPaginationClick(event); });\n this.interactionManager.addListener('hover', function (event) { return _this.onPaginationMouseMove(event); });\n this.marker.parent = this;\n this.update();\n this.updateMarkers();\n }\n Object.defineProperty(Pagination.prototype, \"visible\", {\n get: function () {\n return this._visible;\n },\n set: function (value) {\n this._visible = value;\n this.updateGroupVisibility();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Pagination.prototype, \"enabled\", {\n get: function () {\n return this._enabled;\n },\n set: function (value) {\n this._enabled = value;\n this.updateGroupVisibility();\n },\n enumerable: false,\n configurable: true\n });\n Pagination.prototype.updateGroupVisibility = function () {\n this.group.visible = this.enabled && this.visible;\n };\n Object.defineProperty(Pagination.prototype, \"orientation\", {\n get: function () {\n return this._orientation;\n },\n set: function (value) {\n this._orientation = value;\n switch (value) {\n case 'horizontal': {\n this.previousButton.rotation = -Math.PI / 2;\n this.nextButton.rotation = Math.PI / 2;\n break;\n }\n case 'vertical':\n default: {\n this.previousButton.rotation = 0;\n this.nextButton.rotation = Math.PI;\n }\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Pagination.prototype, \"nextButton\", {\n get: function () {\n return this._nextButton;\n },\n set: function (value) {\n if (this._nextButton !== value) {\n this.group.removeChild(this._nextButton);\n this._nextButton = value;\n this.group.appendChild(value);\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Pagination.prototype, \"previousButton\", {\n get: function () {\n return this._previousButton;\n },\n set: function (value) {\n if (this._previousButton !== value) {\n this.group.removeChild(this._previousButton);\n this._previousButton = value;\n this.group.appendChild(value);\n }\n },\n enumerable: false,\n configurable: true\n });\n Pagination.prototype.update = function () {\n this.updateLabel();\n this.updatePositions();\n this.enableOrDisableButtons();\n };\n Pagination.prototype.updatePositions = function () {\n this.group.translationX = this.translationX;\n this.group.translationY = this.translationY;\n this.updateLabelPosition();\n this.updateNextButtonPosition();\n };\n Pagination.prototype.updateLabelPosition = function () {\n var _a = this.marker, markerSize = _a.size, markerPadding = _a.padding;\n this.nextButton.size = markerSize;\n this.previousButton.size = markerSize;\n this.labelNode.x = markerSize / 2 + markerPadding;\n };\n Pagination.prototype.updateNextButtonPosition = function () {\n var labelBBox = this.labelNode.computeBBox();\n this.nextButton.translationX = labelBBox.x + labelBBox.width + this.marker.size / 2 + this.marker.padding;\n };\n Pagination.prototype.updateLabel = function () {\n var _a = this, currentPage = _a.currentPage, pages = _a.totalPages, labelNode = _a.labelNode, _b = _a.label, color = _b.color, fontStyle = _b.fontStyle, fontWeight = _b.fontWeight, fontSize = _b.fontSize, fontFamily = _b.fontFamily;\n labelNode.text = currentPage + 1 + \" / \" + pages;\n labelNode.fill = color;\n labelNode.fontStyle = fontStyle;\n labelNode.fontWeight = fontWeight;\n labelNode.fontSize = fontSize;\n labelNode.fontFamily = fontFamily;\n };\n Pagination.prototype.updateMarkers = function () {\n var _a = this, nextButton = _a.nextButton, previousButton = _a.previousButton, nextButtonDisabled = _a.nextButtonDisabled, previousButtonDisabled = _a.previousButtonDisabled, activeStyle = _a.activeStyle, inactiveStyle = _a.inactiveStyle, highlightStyle = _a.highlightStyle, highlightActive = _a.highlightActive;\n var buttonStyle = function (button, disabled) {\n if (disabled) {\n return inactiveStyle;\n }\n else if (button === highlightActive) {\n return highlightStyle;\n }\n return activeStyle;\n };\n this.updateMarker(nextButton, buttonStyle('next', nextButtonDisabled));\n this.updateMarker(previousButton, buttonStyle('previous', previousButtonDisabled));\n };\n Pagination.prototype.updateMarker = function (marker, style) {\n var _a;\n var size = this.marker.size;\n marker.size = size;\n marker.fill = style.fill;\n marker.fillOpacity = (_a = style.fillOpacity) !== null && _a !== void 0 ? _a : 1;\n marker.stroke = style.stroke;\n marker.strokeWidth = style.strokeWidth;\n marker.strokeOpacity = style.strokeOpacity;\n };\n Pagination.prototype.enableOrDisableButtons = function () {\n var _a = this, currentPage = _a.currentPage, totalPages = _a.totalPages;\n var zeroPagesToDisplay = totalPages === 0;\n var onLastPage = currentPage === totalPages - 1;\n var onFirstPage = currentPage === 0;\n this.nextButtonDisabled = onLastPage || zeroPagesToDisplay;\n this.previousButtonDisabled = onFirstPage || zeroPagesToDisplay;\n };\n Pagination.prototype.nextButtonContainsPoint = function (offsetX, offsetY) {\n return !this.nextButtonDisabled && this.nextButton.containsPoint(offsetX, offsetY);\n };\n Pagination.prototype.previousButtonContainsPoint = function (offsetX, offsetY) {\n return !this.previousButtonDisabled && this.previousButton.containsPoint(offsetX, offsetY);\n };\n Pagination.prototype.onPaginationClick = function (event) {\n var offsetX = event.offsetX, offsetY = event.offsetY;\n if (this.nextButtonContainsPoint(offsetX, offsetY)) {\n this.incrementPage();\n this.onPaginationChanged();\n event.consume();\n }\n else if (this.previousButtonContainsPoint(offsetX, offsetY)) {\n this.decrementPage();\n this.onPaginationChanged();\n event.consume();\n }\n };\n Pagination.prototype.onPaginationMouseMove = function (event) {\n var offsetX = event.offsetX, offsetY = event.offsetY;\n if (this.nextButtonContainsPoint(offsetX, offsetY)) {\n this.cursorManager.updateCursor(this.id, 'pointer');\n this.highlightActive = 'next';\n }\n else if (this.previousButtonContainsPoint(offsetX, offsetY)) {\n this.cursorManager.updateCursor(this.id, 'pointer');\n this.highlightActive = 'previous';\n }\n else {\n this.cursorManager.updateCursor(this.id);\n this.highlightActive = undefined;\n }\n this.updateMarkers();\n this.chartUpdateCallback(ChartUpdateType.SCENE_RENDER);\n };\n Pagination.prototype.onPaginationChanged = function () {\n this.pageUpdateCallback(this.currentPage);\n };\n Pagination.prototype.incrementPage = function () {\n this.currentPage = Math.min(this.currentPage + 1, this.totalPages - 1);\n };\n Pagination.prototype.decrementPage = function () {\n this.currentPage = Math.max(this.currentPage - 1, 0);\n };\n Pagination.prototype.onMarkerShapeChange = function () {\n var Marker = getMarker$1(this.marker.shape || Triangle);\n this.previousButton = new Marker();\n this.nextButton = new Marker();\n this.updatePositions();\n this.updateMarkers();\n this.chartUpdateCallback(ChartUpdateType.SCENE_RENDER);\n };\n Pagination.prototype.attachPagination = function (node) {\n node.append(this.group);\n };\n Pagination.prototype.computeBBox = function () {\n return this.group.computeBBox();\n };\n Pagination.className = 'Pagination';\n return Pagination;\n}());\n\nvar __decorate$1O = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __read$U = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray$x = (undefined && undefined.__spreadArray) || function (to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\n to[j] = from[i];\n return to;\n};\nvar __values$q = (undefined && undefined.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nvar ORIENTATIONS = ['horizontal', 'vertical'];\nvar OPT_ORIENTATION = predicateWithMessage(function (v, ctx) { return OPTIONAL(v, ctx, function (v) { return ORIENTATIONS.includes(v); }); }, \"expecting an orientation keyword such as 'horizontal' or 'vertical'\");\nvar LegendLabel = /** @class */ (function () {\n function LegendLabel() {\n this.maxLength = undefined;\n this.color = 'black';\n this.fontStyle = undefined;\n this.fontWeight = undefined;\n this.fontSize = 12;\n this.fontFamily = 'Verdana, sans-serif';\n this.formatter = undefined;\n }\n __decorate$1O([\n Validate(OPT_NUMBER(0))\n ], LegendLabel.prototype, \"maxLength\", void 0);\n __decorate$1O([\n Validate(COLOR_STRING)\n ], LegendLabel.prototype, \"color\", void 0);\n __decorate$1O([\n Validate(OPT_FONT_STYLE)\n ], LegendLabel.prototype, \"fontStyle\", void 0);\n __decorate$1O([\n Validate(OPT_FONT_WEIGHT)\n ], LegendLabel.prototype, \"fontWeight\", void 0);\n __decorate$1O([\n Validate(NUMBER(0))\n ], LegendLabel.prototype, \"fontSize\", void 0);\n __decorate$1O([\n Validate(STRING)\n ], LegendLabel.prototype, \"fontFamily\", void 0);\n __decorate$1O([\n Validate(OPT_FUNCTION)\n ], LegendLabel.prototype, \"formatter\", void 0);\n return LegendLabel;\n}());\nvar LegendMarker = /** @class */ (function () {\n function LegendMarker() {\n this.size = 15;\n /**\n * If the marker type is set, the legend will always use that marker type for all its items,\n * regardless of the type that comes from the `data`.\n */\n this._shape = undefined;\n /**\n * Padding between the marker and the label within each legend item.\n */\n this.padding = 8;\n this.strokeWidth = 1;\n }\n Object.defineProperty(LegendMarker.prototype, \"shape\", {\n get: function () {\n return this._shape;\n },\n set: function (value) {\n var _a;\n this._shape = value;\n (_a = this.parent) === null || _a === void 0 ? void 0 : _a.onMarkerShapeChange();\n },\n enumerable: false,\n configurable: true\n });\n __decorate$1O([\n Validate(NUMBER(0))\n ], LegendMarker.prototype, \"size\", void 0);\n __decorate$1O([\n Validate(NUMBER(0))\n ], LegendMarker.prototype, \"padding\", void 0);\n __decorate$1O([\n Validate(NUMBER(0))\n ], LegendMarker.prototype, \"strokeWidth\", void 0);\n return LegendMarker;\n}());\nvar LegendItem = /** @class */ (function () {\n function LegendItem() {\n this.marker = new LegendMarker();\n this.label = new LegendLabel();\n /** Used to constrain the width of legend items. */\n this.maxWidth = undefined;\n /**\n * The legend uses grid layout for its items, occupying as few columns as possible when positioned to left or right,\n * and as few rows as possible when positioned to top or bottom. This config specifies the amount of horizontal\n * padding between legend items.\n */\n this.paddingX = 16;\n /**\n * The legend uses grid layout for its items, occupying as few columns as possible when positioned to left or right,\n * and as few rows as possible when positioned to top or bottom. This config specifies the amount of vertical\n * padding between legend items.\n */\n this.paddingY = 8;\n this.toggleSeriesVisible = true;\n }\n __decorate$1O([\n Validate(OPT_NUMBER(0))\n ], LegendItem.prototype, \"maxWidth\", void 0);\n __decorate$1O([\n Validate(NUMBER(0))\n ], LegendItem.prototype, \"paddingX\", void 0);\n __decorate$1O([\n Validate(NUMBER(0))\n ], LegendItem.prototype, \"paddingY\", void 0);\n __decorate$1O([\n Validate(BOOLEAN)\n ], LegendItem.prototype, \"toggleSeriesVisible\", void 0);\n return LegendItem;\n}());\nvar LegendListeners = /** @class */ (function () {\n function LegendListeners() {\n this.legendItemClick = undefined;\n this.legendItemDoubleClick = undefined;\n }\n __decorate$1O([\n Validate(OPT_FUNCTION)\n ], LegendListeners.prototype, \"legendItemClick\", void 0);\n return LegendListeners;\n}());\nvar Legend = /** @class */ (function () {\n function Legend(ctx) {\n var _a;\n var _this = this;\n this.ctx = ctx;\n this.id = createId$1(this);\n this.group = new Group({ name: 'legend', layer: true, zIndex: Layers.LEGEND_ZINDEX });\n this.itemSelection = Selection.select(this.group, MarkerLabel);\n this.oldSize = [0, 0];\n this.pages = [];\n this.maxPageSize = [0, 0];\n /** Item index to track on re-pagination, so current page updates appropriately. */\n this.paginationTrackingIndex = 0;\n this.item = new LegendItem();\n this.listeners = new LegendListeners();\n this.truncatedItems = new Set();\n this._data = [];\n this._enabled = true;\n this.position = 'bottom';\n /** Used to constrain the width of the legend. */\n this.maxWidth = undefined;\n /** Used to constrain the height of the legend. */\n this.maxHeight = undefined;\n /** Reverse the display order of legend items if `true`. */\n this.reverseOrder = undefined;\n this.destroyFns = [];\n /**\n * Spacing between the legend and the edge of the chart's element.\n */\n this.spacing = 20;\n this.characterWidths = new Map();\n this.size = [0, 0];\n this._visible = true;\n this.item.marker.parent = this;\n this.pagination = new Pagination(function (type) { return ctx.updateService.update(type); }, function (page) { return _this.updatePageNumber(page); }, ctx.interactionManager, ctx.cursorManager);\n this.pagination.attachPagination(this.group);\n this.item.marker.parent = this;\n var interactionListeners = [\n ctx.interactionManager.addListener('click', function (e) { return _this.checkLegendClick(e); }),\n ctx.interactionManager.addListener('dblclick', function (e) { return _this.checkLegendDoubleClick(e); }),\n ctx.interactionManager.addListener('hover', function (e) { return _this.handleLegendMouseMove(e); }),\n ];\n var layoutListeners = [\n ctx.layoutService.addListener('start-layout', function (e) { return _this.positionLegend(e.shrinkRect); }),\n ];\n (_a = this.destroyFns).push.apply(_a, __spreadArray$x(__spreadArray$x(__spreadArray$x([], __read$U(interactionListeners.map(function (s) { return function () { return ctx.interactionManager.removeListener(s); }; }))), __read$U(layoutListeners.map(function (s) { return function () { return ctx.layoutService.removeListener(s); }; }))), [function () { return _this.detachLegend(); }]));\n }\n Object.defineProperty(Legend.prototype, \"data\", {\n get: function () {\n return this._data;\n },\n set: function (value) {\n this._data = value;\n this.updateGroupVisibility();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Legend.prototype, \"enabled\", {\n get: function () {\n return this._enabled;\n },\n set: function (value) {\n this._enabled = value;\n this.updateGroupVisibility();\n },\n enumerable: false,\n configurable: true\n });\n Legend.prototype.getOrientation = function () {\n if (this.orientation !== undefined) {\n return this.orientation;\n }\n switch (this.position) {\n case 'right':\n case 'left':\n return 'vertical';\n case 'bottom':\n case 'top':\n return 'horizontal';\n }\n };\n Legend.prototype.destroy = function () {\n this.destroyFns.forEach(function (f) { return f(); });\n };\n Legend.prototype.onMarkerShapeChange = function () {\n this.itemSelection.clear();\n this.group.markDirty(this.group, RedrawType.MINOR);\n };\n Legend.prototype.getCharacterWidths = function (font) {\n var characterWidths = this.characterWidths;\n if (characterWidths.has(font)) {\n return characterWidths.get(font);\n }\n var cw = {\n '...': HdpiCanvas.getTextSize('...', font).width,\n };\n characterWidths.set(font, cw);\n return cw;\n };\n Object.defineProperty(Legend.prototype, \"visible\", {\n get: function () {\n return this._visible;\n },\n set: function (value) {\n this._visible = value;\n this.updateGroupVisibility();\n },\n enumerable: false,\n configurable: true\n });\n Legend.prototype.updateGroupVisibility = function () {\n this.group.visible = this.enabled && this.visible && this.data.length > 0;\n };\n Legend.prototype.attachLegend = function (node) {\n node.append(this.group);\n };\n Legend.prototype.detachLegend = function () {\n var _a;\n (_a = this.group.parent) === null || _a === void 0 ? void 0 : _a.removeChild(this.group);\n };\n Legend.prototype.getItemLabel = function (datum) {\n var callbackCache = this.ctx.callbackCache;\n var formatter = this.item.label.formatter;\n if (formatter) {\n return callbackCache.call(formatter, {\n itemId: datum.itemId,\n value: datum.label.text,\n seriesId: datum.seriesId,\n });\n }\n return datum.label.text;\n };\n /**\n * The method is given the desired size of the legend, which only serves as a hint.\n * The vertically oriented legend will take as much horizontal space as needed, but will\n * respect the height constraints, and the horizontal legend will take as much vertical\n * space as needed in an attempt not to exceed the given width.\n * After the layout is done, the {@link size} will contain the actual size of the legend.\n * If the actual size is not the same as the previous actual size, the legend will fire\n * the 'layoutChange' event to communicate that another layout is needed, and the above\n * process should be repeated.\n * @param width\n * @param height\n */\n Legend.prototype.performLayout = function (width, height) {\n var _this = this;\n var _a = this.item, paddingX = _a.paddingX, paddingY = _a.paddingY, label = _a.label, maxWidth = _a.maxWidth, _b = _a.marker, markerSize = _b.size, markerPadding = _b.padding, markerShape = _b.shape, _c = _a.label, _d = _c.maxLength, maxLength = _d === void 0 ? Infinity : _d, fontStyle = _c.fontStyle, fontWeight = _c.fontWeight, fontSize = _c.fontSize, fontFamily = _c.fontFamily;\n var data = __spreadArray$x([], __read$U(this.data));\n if (this.reverseOrder) {\n data.reverse();\n }\n this.itemSelection.update(data);\n // Update properties that affect the size of the legend items and measure them.\n var bboxes = [];\n var font = getFont(label);\n var itemMaxWidthPercentage = 0.8;\n var maxItemWidth = maxWidth !== null && maxWidth !== void 0 ? maxWidth : width * itemMaxWidthPercentage;\n var paddedMarkerWidth = markerSize + markerPadding + paddingX;\n this.itemSelection.each(function (markerLabel, datum) {\n var _a;\n var Marker = getMarker$1(markerShape !== null && markerShape !== void 0 ? markerShape : datum.marker.shape);\n if (!(markerLabel.marker && markerLabel.marker instanceof Marker)) {\n markerLabel.marker = new Marker();\n }\n markerLabel.markerSize = markerSize;\n markerLabel.spacing = markerPadding;\n markerLabel.fontStyle = fontStyle;\n markerLabel.fontWeight = fontWeight;\n markerLabel.fontSize = fontSize;\n markerLabel.fontFamily = fontFamily;\n var id = (_a = datum.itemId) !== null && _a !== void 0 ? _a : datum.id;\n var labelText = _this.getItemLabel(datum);\n var text = (labelText !== null && labelText !== void 0 ? labelText : '').replace(/\\r?\\n/g, ' ');\n markerLabel.text = _this.truncate(text, maxLength, maxItemWidth, paddedMarkerWidth, font, id);\n bboxes.push(markerLabel.computeBBox());\n });\n width = Math.max(1, width);\n height = Math.max(1, height);\n if (!isFinite(width)) {\n return false;\n }\n var size = this.size;\n var oldSize = this.oldSize;\n size[0] = width;\n size[1] = height;\n if (size[0] !== oldSize[0] || size[1] !== oldSize[1]) {\n oldSize[0] = size[0];\n oldSize[1] = size[1];\n }\n var _e = this.updatePagination(bboxes, width, height), pages = _e.pages, maxPageHeight = _e.maxPageHeight, maxPageWidth = _e.maxPageWidth;\n this.pages = pages;\n this.maxPageSize = [maxPageWidth - paddingX, maxPageHeight - paddingY];\n var pageNumber = this.pagination.currentPage;\n var page = this.pages[pageNumber];\n if (this.pages.length < 1 || !page) {\n this.visible = false;\n return;\n }\n this.visible = true;\n // Position legend items\n this.updatePositions(pageNumber);\n // Update legend item properties that don't affect the layout.\n this.update();\n };\n Legend.prototype.truncate = function (text, maxCharLength, maxItemWidth, paddedMarkerWidth, font, id) {\n var e_1, _a;\n var ellipsis = \"...\";\n var textChars = text.split('');\n var addEllipsis = false;\n if (text.length > maxCharLength) {\n text = \"\" + text.substring(0, maxCharLength);\n addEllipsis = true;\n }\n var labelWidth = Math.floor(paddedMarkerWidth + HdpiCanvas.getTextSize(text, font).width);\n if (labelWidth > maxItemWidth) {\n var truncatedText = '';\n var characterWidths = this.getCharacterWidths(font);\n var cumulativeWidth = paddedMarkerWidth + characterWidths[ellipsis];\n try {\n for (var textChars_1 = __values$q(textChars), textChars_1_1 = textChars_1.next(); !textChars_1_1.done; textChars_1_1 = textChars_1.next()) {\n var char = textChars_1_1.value;\n if (!characterWidths[char]) {\n characterWidths[char] = HdpiCanvas.getTextSize(char, font).width;\n }\n cumulativeWidth += characterWidths[char];\n if (cumulativeWidth > maxItemWidth) {\n break;\n }\n truncatedText += char;\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (textChars_1_1 && !textChars_1_1.done && (_a = textChars_1.return)) _a.call(textChars_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n text = truncatedText;\n addEllipsis = true;\n }\n if (addEllipsis) {\n text += ellipsis;\n this.truncatedItems.add(id);\n }\n else {\n this.truncatedItems.delete(id);\n }\n return text;\n };\n Legend.prototype.updatePagination = function (bboxes, width, height) {\n var orientation = this.getOrientation();\n var trackingIndex = Math.min(this.paginationTrackingIndex, bboxes.length);\n this.pagination.orientation = orientation;\n this.pagination.translationX = 0;\n this.pagination.translationY = 0;\n var _a = this.calculatePagination(bboxes, width, height), pages = _a.pages, maxPageHeight = _a.maxPageHeight, maxPageWidth = _a.maxPageWidth, paginationBBox = _a.paginationBBox, paginationVertical = _a.paginationVertical;\n var newCurrentPage = pages.findIndex(function (p) { return p.endIndex >= trackingIndex; });\n this.pagination.currentPage = Math.min(Math.max(newCurrentPage, 0), pages.length - 1);\n var _b = this.item, itemPaddingX = _b.paddingX, itemPaddingY = _b.paddingY;\n var paginationComponentPadding = 8;\n var legendItemsWidth = maxPageWidth - itemPaddingX;\n var legendItemsHeight = maxPageHeight - itemPaddingY;\n var paginationX = 0;\n var paginationY = -paginationBBox.y - this.item.marker.size / 2;\n if (paginationVertical) {\n paginationY += legendItemsHeight + paginationComponentPadding;\n }\n else {\n paginationX += -paginationBBox.x + legendItemsWidth + paginationComponentPadding;\n paginationY += (legendItemsHeight - paginationBBox.height) / 2;\n }\n this.pagination.translationX = paginationX;\n this.pagination.translationY = paginationY;\n this.pagination.update();\n this.pagination.updateMarkers();\n return {\n maxPageHeight: maxPageHeight,\n maxPageWidth: maxPageWidth,\n pages: pages,\n };\n };\n Legend.prototype.calculatePagination = function (bboxes, width, height) {\n var _a, _b, _c;\n var _d = this.item, itemPaddingX = _d.paddingX, itemPaddingY = _d.paddingY;\n var orientation = this.getOrientation();\n var paginationVertical = ['left', 'right'].includes(this.position);\n var paginationBBox = this.pagination.computeBBox();\n var lastPassPaginationBBox = new BBox(0, 0, 0, 0);\n var pages = [];\n var maxPageWidth = 0;\n var maxPageHeight = 0;\n var count = 0;\n var stableOutput = function (lastPassPaginationBBox) {\n var width = lastPassPaginationBBox.width, height = lastPassPaginationBBox.height;\n return width === paginationBBox.width && height === paginationBBox.height;\n };\n var forceResult = this.maxWidth !== undefined || this.maxHeight !== undefined;\n do {\n if (count++ > 10) {\n Logger.warn('unable to find stable legend layout.');\n break;\n }\n paginationBBox = lastPassPaginationBBox;\n var maxWidth = width - (paginationVertical ? 0 : paginationBBox.width);\n var maxHeight = height - (paginationVertical ? paginationBBox.height : 0);\n var layout = gridLayout({\n orientation: orientation,\n bboxes: bboxes,\n maxHeight: maxHeight,\n maxWidth: maxWidth,\n itemPaddingY: itemPaddingY,\n itemPaddingX: itemPaddingX,\n forceResult: forceResult,\n });\n pages = (_a = layout === null || layout === void 0 ? void 0 : layout.pages) !== null && _a !== void 0 ? _a : [];\n maxPageWidth = (_b = layout === null || layout === void 0 ? void 0 : layout.maxPageWidth) !== null && _b !== void 0 ? _b : 0;\n maxPageHeight = (_c = layout === null || layout === void 0 ? void 0 : layout.maxPageHeight) !== null && _c !== void 0 ? _c : 0;\n var totalPages = pages.length;\n this.pagination.visible = totalPages > 1;\n this.pagination.totalPages = totalPages;\n this.pagination.update();\n lastPassPaginationBBox = this.pagination.computeBBox();\n if (!this.pagination.visible) {\n break;\n }\n } while (!stableOutput(lastPassPaginationBBox));\n return { maxPageWidth: maxPageWidth, maxPageHeight: maxPageHeight, pages: pages, paginationBBox: paginationBBox, paginationVertical: paginationVertical };\n };\n Legend.prototype.updatePositions = function (pageNumber) {\n if (pageNumber === void 0) { pageNumber = 0; }\n var _a = this, paddingY = _a.item.paddingY, itemSelection = _a.itemSelection, pages = _a.pages;\n if (pages.length < 1 || !pages[pageNumber]) {\n return;\n }\n var _b = pages[pageNumber], columns = _b.columns, visibleStart = _b.startIndex, visibleEnd = _b.endIndex;\n // Position legend items using the layout computed above.\n var x = 0;\n var y = 0;\n var columnCount = columns.length;\n var rowCount = columns[0].indices.length;\n var horizontal = this.getOrientation() === 'horizontal';\n var itemHeight = columns[0].bboxes[0].height + paddingY;\n var rowSumColumnWidths = [];\n itemSelection.each(function (markerLabel, _, i) {\n var _a, _b;\n if (i < visibleStart || i > visibleEnd) {\n markerLabel.visible = false;\n return;\n }\n var pageIndex = i - visibleStart;\n var columnIndex = 0;\n var rowIndex = 0;\n if (horizontal) {\n columnIndex = pageIndex % columnCount;\n rowIndex = Math.floor(pageIndex / columnCount);\n }\n else {\n columnIndex = Math.floor(pageIndex / rowCount);\n rowIndex = pageIndex % rowCount;\n }\n markerLabel.visible = true;\n var column = columns[columnIndex];\n if (!column) {\n return;\n }\n y = itemHeight * rowIndex;\n x = (_a = rowSumColumnWidths[rowIndex]) !== null && _a !== void 0 ? _a : 0;\n rowSumColumnWidths[rowIndex] = ((_b = rowSumColumnWidths[rowIndex]) !== null && _b !== void 0 ? _b : 0) + column.columnWidth;\n // Round off for pixel grid alignment to work properly.\n markerLabel.translationX = Math.floor(x);\n markerLabel.translationY = Math.floor(y);\n });\n };\n Legend.prototype.updatePageNumber = function (pageNumber) {\n var pages = this.pages;\n // Track an item on the page in re-pagination cases (e.g. resize).\n var _a = pages[pageNumber], startIndex = _a.startIndex, endIndex = _a.endIndex;\n if (startIndex === 0) {\n // Stay on first page on pagination update.\n this.paginationTrackingIndex = 0;\n }\n else if (pageNumber === pages.length - 1) {\n // Stay on last page on pagination update.\n this.paginationTrackingIndex = endIndex;\n }\n else {\n // Track the middle item on the page).\n this.paginationTrackingIndex = Math.floor((startIndex + endIndex) / 2);\n }\n this.pagination.update();\n this.pagination.updateMarkers();\n this.updatePositions(pageNumber);\n this.ctx.updateService.update(ChartUpdateType.SCENE_RENDER);\n };\n Legend.prototype.update = function () {\n var _a = this.item, strokeWidth = _a.marker.strokeWidth, color = _a.label.color;\n this.itemSelection.each(function (markerLabel, datum) {\n var marker = datum.marker;\n markerLabel.markerFill = marker.fill;\n markerLabel.markerStroke = marker.stroke;\n markerLabel.markerStrokeWidth = strokeWidth;\n markerLabel.markerFillOpacity = marker.fillOpacity;\n markerLabel.markerStrokeOpacity = marker.strokeOpacity;\n markerLabel.opacity = datum.enabled ? 1 : 0.5;\n markerLabel.color = color;\n });\n };\n Legend.prototype.getDatumForPoint = function (x, y) {\n var e_2, _a;\n var visibleChildBBoxes = [];\n var closestLeftTop = { dist: Infinity, datum: undefined };\n try {\n for (var _b = __values$q(this.group.children), _c = _b.next(); !_c.done; _c = _b.next()) {\n var child = _c.value;\n if (!child.visible)\n continue;\n if (!(child instanceof MarkerLabel))\n continue;\n var childBBox = child.computeBBox();\n childBBox.grow(this.item.paddingX / 2, 'horizontal');\n childBBox.grow(this.item.paddingY / 2, 'vertical');\n if (childBBox.containsPoint(x, y)) {\n return child.datum;\n }\n var distX = x - childBBox.x - this.item.paddingX / 2;\n var distY = y - childBBox.y - this.item.paddingY / 2;\n var dist = Math.pow(distX, 2) + Math.pow(distY, 2);\n var toTheLeftTop = distX >= 0 && distY >= 0;\n if (toTheLeftTop && dist < closestLeftTop.dist) {\n closestLeftTop.dist = dist;\n closestLeftTop.datum = child.datum;\n }\n visibleChildBBoxes.push(childBBox);\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_2) throw e_2.error; }\n }\n var pageBBox = BBox.merge(visibleChildBBoxes);\n if (!pageBBox.containsPoint(x, y)) {\n // We're not in-between legend items.\n return undefined;\n }\n // Fallback to returning closest match to the left/up.\n return closestLeftTop.datum;\n };\n Legend.prototype.computeBBox = function () {\n return this.group.computeBBox();\n };\n Legend.prototype.computePagedBBox = function () {\n var actualBBox = this.group.computeBBox();\n if (this.pages.length <= 1) {\n return actualBBox;\n }\n var _a = __read$U(this.maxPageSize, 2), maxPageWidth = _a[0], maxPageHeight = _a[1];\n actualBBox.height = Math.max(maxPageHeight, actualBBox.height);\n actualBBox.width = Math.max(maxPageWidth, actualBBox.width);\n return actualBBox;\n };\n Legend.prototype.checkLegendClick = function (event) {\n var _a = this, legendItemClick = _a.listeners.legendItemClick, _b = _a.ctx, dataService = _b.dataService, highlightManager = _b.highlightManager, toggleSeriesVisible = _a.item.toggleSeriesVisible;\n var offsetX = event.offsetX, offsetY = event.offsetY;\n var legendBBox = this.computeBBox();\n var pointerInsideLegend = this.group.visible && legendBBox.containsPoint(offsetX, offsetY);\n var datum = this.getDatumForPoint(offsetX, offsetY);\n if (!pointerInsideLegend || !datum) {\n return;\n }\n var id = datum.id, itemId = datum.itemId, enabled = datum.enabled;\n var chartSeries = dataService.getSeries();\n var series = chartSeries.find(function (s) { return s.id === id; });\n if (!series) {\n return;\n }\n event.consume();\n var newEnabled = enabled;\n if (toggleSeriesVisible) {\n newEnabled = !enabled;\n this.ctx.chartEventManager.legendItemClick(series, itemId, newEnabled, datum.legendItemName);\n }\n if (!newEnabled) {\n highlightManager.updateHighlight(this.id);\n }\n else {\n highlightManager.updateHighlight(this.id, {\n series: series,\n itemId: itemId,\n datum: undefined,\n });\n }\n this.ctx.updateService.update(ChartUpdateType.PROCESS_DATA, { forceNodeDataRefresh: true });\n legendItemClick === null || legendItemClick === void 0 ? void 0 : legendItemClick({ type: 'click', enabled: newEnabled, itemId: itemId, seriesId: series.id });\n };\n Legend.prototype.checkLegendDoubleClick = function (event) {\n var _a;\n var _b = this, legendItemDoubleClick = _b.listeners.legendItemDoubleClick, dataService = _b.ctx.dataService, toggleSeriesVisible = _b.item.toggleSeriesVisible;\n var offsetX = event.offsetX, offsetY = event.offsetY;\n // Integrated charts do not handle double click behaviour correctly due to multiple instances of the\n // chart being created. See https://ag-grid.atlassian.net/browse/RTI-1381\n if (this.ctx.mode === 'integrated') {\n return;\n }\n var legendBBox = this.computeBBox();\n var pointerInsideLegend = this.group.visible && legendBBox.containsPoint(offsetX, offsetY);\n var datum = this.getDatumForPoint(offsetX, offsetY);\n if (!pointerInsideLegend || !datum) {\n return;\n }\n var id = datum.id, itemId = datum.itemId, seriesId = datum.seriesId;\n var chartSeries = dataService.getSeries();\n var series = chartSeries.find(function (s) { return s.id === id; });\n if (!series) {\n return;\n }\n event.consume();\n if (toggleSeriesVisible) {\n var legendData = chartSeries.reduce(function (ls, s) { return __spreadArray$x(__spreadArray$x([], __read$U(ls)), __read$U(s.getLegendData().filter(function (d) { return d.legendType === 'category'; }))); }, []);\n var numVisibleItems_1 = {};\n legendData.forEach(function (d) {\n var _a;\n var _b;\n (_a = numVisibleItems_1[_b = d.seriesId]) !== null && _a !== void 0 ? _a : (numVisibleItems_1[_b] = 0);\n if (d.enabled)\n numVisibleItems_1[d.seriesId]++;\n });\n var clickedItem = legendData.find(function (d) { return d.itemId === itemId && d.seriesId === seriesId; });\n this.ctx.chartEventManager.legendItemDoubleClick(series, itemId, (_a = clickedItem === null || clickedItem === void 0 ? void 0 : clickedItem.enabled) !== null && _a !== void 0 ? _a : false, numVisibleItems_1, clickedItem === null || clickedItem === void 0 ? void 0 : clickedItem.legendItemName);\n }\n this.ctx.updateService.update(ChartUpdateType.PROCESS_DATA, { forceNodeDataRefresh: true });\n legendItemDoubleClick === null || legendItemDoubleClick === void 0 ? void 0 : legendItemDoubleClick({ type: 'dblclick', enabled: true, itemId: itemId, seriesId: series.id });\n };\n Legend.prototype.handleLegendMouseMove = function (event) {\n var _a;\n var _b = this, enabled = _b.enabled, toggleSeriesVisible = _b.item.toggleSeriesVisible, listeners = _b.listeners;\n if (!enabled) {\n return;\n }\n var legendBBox = this.computeBBox();\n var pageX = event.pageX, pageY = event.pageY, offsetX = event.offsetX, offsetY = event.offsetY;\n var pointerInsideLegend = this.group.visible && legendBBox.containsPoint(offsetX, offsetY);\n if (!pointerInsideLegend) {\n this.ctx.cursorManager.updateCursor(this.id);\n this.ctx.highlightManager.updateHighlight(this.id);\n this.ctx.tooltipManager.removeTooltip(this.id);\n return;\n }\n // Prevent other handlers from consuming this event if it's generated inside the legend\n // boundaries.\n event.consume();\n var datum = this.getDatumForPoint(offsetX, offsetY);\n var pointerOverLegendDatum = pointerInsideLegend && datum !== undefined;\n if (!pointerOverLegendDatum) {\n this.ctx.cursorManager.updateCursor(this.id);\n this.ctx.highlightManager.updateHighlight(this.id);\n return;\n }\n var series = datum ? this.ctx.dataService.getSeries().find(function (series) { return series.id === (datum === null || datum === void 0 ? void 0 : datum.id); }) : undefined;\n if (datum && this.truncatedItems.has((_a = datum.itemId) !== null && _a !== void 0 ? _a : datum.id)) {\n var labelText = this.getItemLabel(datum);\n this.ctx.tooltipManager.updateTooltip(this.id, { pageX: pageX, pageY: pageY, offsetX: offsetX, offsetY: offsetY, event: event, showArrow: false }, toTooltipHtml$1({ content: labelText }));\n }\n else {\n this.ctx.tooltipManager.removeTooltip(this.id);\n }\n if (toggleSeriesVisible || listeners.legendItemClick != null || listeners.legendItemDoubleClick != null) {\n this.ctx.cursorManager.updateCursor(this.id, 'pointer');\n }\n if ((datum === null || datum === void 0 ? void 0 : datum.enabled) && series) {\n this.ctx.highlightManager.updateHighlight(this.id, {\n series: series,\n itemId: datum === null || datum === void 0 ? void 0 : datum.itemId,\n datum: undefined,\n });\n }\n else {\n this.ctx.highlightManager.updateHighlight(this.id);\n }\n };\n Legend.prototype.positionLegend = function (shrinkRect) {\n var _this = this;\n var newShrinkRect = shrinkRect.clone();\n if (!this.enabled || !this.data.length) {\n return { shrinkRect: newShrinkRect };\n }\n var _a = __read$U(this.calculateLegendDimensions(shrinkRect), 2), legendWidth = _a[0], legendHeight = _a[1];\n this.group.translationX = 0;\n this.group.translationY = 0;\n this.performLayout(legendWidth, legendHeight);\n var legendBBox = this.computePagedBBox();\n var calculateTranslationPerpendicularDimension = function () {\n switch (_this.position) {\n case 'top':\n return 0;\n case 'bottom':\n return shrinkRect.height - legendBBox.height;\n case 'left':\n return 0;\n case 'right':\n default:\n return shrinkRect.width - legendBBox.width;\n }\n };\n if (this.visible) {\n var translationX = void 0;\n var translationY = void 0;\n switch (this.position) {\n case 'top':\n case 'bottom':\n translationX = (shrinkRect.width - legendBBox.width) / 2;\n translationY = calculateTranslationPerpendicularDimension();\n newShrinkRect.shrink(legendBBox.height, this.position);\n break;\n case 'left':\n case 'right':\n default:\n translationX = calculateTranslationPerpendicularDimension();\n translationY = (shrinkRect.height - legendBBox.height) / 2;\n newShrinkRect.shrink(legendBBox.width, this.position);\n }\n // Round off for pixel grid alignment to work properly.\n this.group.translationX = Math.floor(-legendBBox.x + shrinkRect.x + translationX);\n this.group.translationY = Math.floor(-legendBBox.y + shrinkRect.y + translationY);\n }\n if (this.visible && this.enabled && this.data.length) {\n var legendPadding = this.spacing;\n newShrinkRect.shrink(legendPadding, this.position);\n var legendPositionedBBox = legendBBox.clone();\n legendPositionedBBox.x += this.group.translationX;\n legendPositionedBBox.y += this.group.translationY;\n this.ctx.tooltipManager.updateExclusiveRect(this.id, legendPositionedBBox);\n }\n else {\n this.ctx.tooltipManager.updateExclusiveRect(this.id);\n }\n return { shrinkRect: newShrinkRect };\n };\n Legend.prototype.calculateLegendDimensions = function (shrinkRect) {\n var width = shrinkRect.width, height = shrinkRect.height;\n var aspectRatio = width / height;\n var maxCoefficient = 0.5;\n var minHeightCoefficient = 0.2;\n var minWidthCoefficient = 0.25;\n var legendWidth = 0;\n var legendHeight = 0;\n switch (this.position) {\n case 'top':\n case 'bottom':\n // A horizontal legend should take maximum between 20 to 50 percent of the chart height if height is larger than width\n // and maximum 20 percent of the chart height if height is smaller than width.\n var heightCoefficient = aspectRatio < 1\n ? Math.min(maxCoefficient, minHeightCoefficient * (1 / aspectRatio))\n : minHeightCoefficient;\n legendWidth = this.maxWidth ? Math.min(this.maxWidth, width) : width;\n legendHeight = this.maxHeight\n ? Math.min(this.maxHeight, height)\n : Math.round(height * heightCoefficient);\n break;\n case 'left':\n case 'right':\n default:\n // A vertical legend should take maximum between 25 to 50 percent of the chart width if width is larger than height\n // and maximum 25 percent of the chart width if width is smaller than height.\n var widthCoefficient = aspectRatio > 1 ? Math.min(maxCoefficient, minWidthCoefficient * aspectRatio) : minWidthCoefficient;\n legendWidth = this.maxWidth ? Math.min(this.maxWidth, width) : Math.round(width * widthCoefficient);\n legendHeight = this.maxHeight ? Math.min(this.maxHeight, height) : height;\n }\n return [legendWidth, legendHeight];\n };\n Legend.className = 'Legend';\n __decorate$1O([\n Validate(BOOLEAN)\n ], Legend.prototype, \"_enabled\", void 0);\n __decorate$1O([\n Validate(POSITION)\n ], Legend.prototype, \"position\", void 0);\n __decorate$1O([\n Validate(OPT_NUMBER(0))\n ], Legend.prototype, \"maxWidth\", void 0);\n __decorate$1O([\n Validate(OPT_NUMBER(0))\n ], Legend.prototype, \"maxHeight\", void 0);\n __decorate$1O([\n Validate(OPT_BOOLEAN)\n ], Legend.prototype, \"reverseOrder\", void 0);\n __decorate$1O([\n Validate(OPT_ORIENTATION)\n ], Legend.prototype, \"orientation\", void 0);\n __decorate$1O([\n Validate(NUMBER(0))\n ], Legend.prototype, \"spacing\", void 0);\n return Legend;\n}());\n\nvar LEGEND_FACTORIES = {\n category: Legend,\n};\nfunction registerLegend(type, ctr) {\n if (LEGEND_FACTORIES[type]) {\n throw new Error(\"AG Charts - already registered legend type: \" + type);\n }\n LEGEND_FACTORIES[type] = ctr;\n}\nfunction getLegend(type, ctx) {\n if (LEGEND_FACTORIES[type]) {\n return new LEGEND_FACTORIES[type](ctx);\n }\n throw new Error(\"AG Charts - unknown legend type: \" + type);\n}\n\nvar __read$T = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray$w = (undefined && undefined.__spreadArray) || function (to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\n to[j] = from[i];\n return to;\n};\nvar CallbackCache = /** @class */ (function () {\n function CallbackCache() {\n this.cache = new Map();\n }\n CallbackCache.prototype.call = function (f) {\n var params = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n params[_i - 1] = arguments[_i];\n }\n var serialisedParams;\n var paramCache = this.cache.get(f);\n var invoke = function () {\n try {\n var result = f.apply(void 0, __spreadArray$w([], __read$T(params)));\n if (paramCache && serialisedParams != null) {\n paramCache.set(serialisedParams, result);\n }\n return result;\n }\n catch (e) {\n Logger.warnOnce(\"User callback errored, ignoring\", e);\n return undefined;\n }\n };\n try {\n serialisedParams = JSON.stringify(params);\n }\n catch (e) {\n // Unable to serialise params!\n // No caching possible.\n return invoke();\n }\n if (paramCache == null) {\n paramCache = new Map();\n this.cache.set(f, paramCache);\n }\n if (!paramCache.has(serialisedParams)) {\n return invoke();\n }\n return paramCache.get(serialisedParams);\n };\n CallbackCache.prototype.invalidateCache = function () {\n this.cache = new Map();\n };\n return CallbackCache;\n}());\n\nvar __assign$J = (undefined && undefined.__assign) || function () {\n __assign$J = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$J.apply(this, arguments);\n};\nvar __awaiter$d = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator$d = (undefined && undefined.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nvar __values$p = (undefined && undefined.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nvar __read$S = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray$v = (undefined && undefined.__spreadArray) || function (to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\n to[j] = from[i];\n return to;\n};\n/** Implements cross-series data model coordination. */\nvar DataController = /** @class */ (function () {\n function DataController() {\n this.requested = [];\n this.status = 'setup';\n }\n DataController.prototype.request = function (id, data, opts) {\n return __awaiter$d(this, void 0, void 0, function () {\n var _this = this;\n return __generator$d(this, function (_a) {\n if (this.status !== 'setup')\n throw new Error(\"AG Charts - data request after data setup phase.\");\n return [2 /*return*/, new Promise(function (resolve, reject) {\n _this.requested.push({\n id: id,\n opts: opts,\n data: data,\n resultCb: resolve,\n reject: reject,\n });\n })];\n });\n });\n };\n DataController.prototype.execute = function () {\n return __awaiter$d(this, void 0, void 0, function () {\n var merged, _loop_1, this_1, merged_1, merged_1_1, _a, opts, data, resultCbs, rejects, ids;\n var e_1, _b;\n return __generator$d(this, function (_c) {\n if (this.status !== 'setup')\n throw new Error(\"AG Charts - data request after data setup phase.\");\n this.status = 'executed';\n if (DataController.DEBUG())\n Logger.debug('DataController.execute() - requested', this.requested);\n merged = this.mergeRequested();\n if (DataController.DEBUG())\n Logger.debug('DataController.execute() - merged', merged);\n _loop_1 = function (opts, data, resultCbs, rejects, ids) {\n try {\n var dataModel_1 = new DataModel(opts);\n var processedData_1 = dataModel_1.processData(data);\n if (processedData_1 && processedData_1.partialValidDataCount === 0) {\n resultCbs.forEach(function (cb) { return cb({ dataModel: dataModel_1, processedData: processedData_1 }); });\n }\n else if (processedData_1) {\n this_1.splitResult(dataModel_1, processedData_1, ids, resultCbs);\n }\n else {\n rejects.forEach(function (cb) { return cb(new Error(\"AG Charts - no processed data generated\")); });\n }\n }\n catch (error) {\n rejects.forEach(function (cb) { return cb(error); });\n }\n };\n this_1 = this;\n try {\n for (merged_1 = __values$p(merged), merged_1_1 = merged_1.next(); !merged_1_1.done; merged_1_1 = merged_1.next()) {\n _a = merged_1_1.value, opts = _a.opts, data = _a.data, resultCbs = _a.resultCbs, rejects = _a.rejects, ids = _a.ids;\n _loop_1(opts, data, resultCbs, rejects, ids);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (merged_1_1 && !merged_1_1.done && (_b = merged_1.return)) _b.call(merged_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n return [2 /*return*/];\n });\n });\n };\n DataController.prototype.mergeRequested = function () {\n var e_2, _a;\n var grouped = [];\n var keys = function (props) {\n return props\n .filter(function (p) { return p.type === 'key'; })\n .map(function (p) { return p.property; })\n .join(';');\n };\n var groupMatch = function (_a) {\n var opts = _a.opts, data = _a.data;\n return function (gr) {\n return (gr[0].data === data &&\n gr[0].opts.groupByKeys === opts.groupByKeys &&\n gr[0].opts.dataVisible === opts.dataVisible &&\n gr[0].opts.groupByFn === opts.groupByFn &&\n keys(gr[0].opts.props) === keys(opts.props));\n };\n };\n var propMatch = function (prop) { return function (existing) {\n var _a;\n if (existing.type !== prop.type)\n return false;\n if (existing.id !== prop.id)\n return false;\n var diff = (_a = jsonDiff(existing, prop)) !== null && _a !== void 0 ? _a : {};\n delete diff['scopes'];\n return Object.keys(diff).length === 0;\n }; };\n var mergeOpts = function (opts) {\n return __assign$J(__assign$J({}, opts[0]), { props: opts.reduce(function (result, next) {\n var e_3, _a, _b;\n var _c, _d, _e;\n try {\n for (var _f = __values$p(next.props), _g = _f.next(); !_g.done; _g = _f.next()) {\n var prop = _g.value;\n var match = result.find(propMatch(prop));\n if (match) {\n (_c = match.scopes) !== null && _c !== void 0 ? _c : (match.scopes = []);\n (_b = match.scopes).push.apply(_b, __spreadArray$v(__spreadArray$v([], __read$S(((_d = prop.scopes) !== null && _d !== void 0 ? _d : []))), __read$S(((_e = next.scopes) !== null && _e !== void 0 ? _e : []))));\n continue;\n }\n result.push(prop);\n }\n }\n catch (e_3_1) { e_3 = { error: e_3_1 }; }\n finally {\n try {\n if (_g && !_g.done && (_a = _f.return)) _a.call(_f);\n }\n finally { if (e_3) throw e_3.error; }\n }\n return result;\n }, []) });\n };\n var merge = function (props) {\n return {\n ids: props.map(function (_a) {\n var id = _a.id;\n return id;\n }),\n resultCbs: props.map(function (_a) {\n var resultCb = _a.resultCb;\n return resultCb;\n }),\n rejects: props.map(function (_a) {\n var reject = _a.reject;\n return reject;\n }),\n data: props[0].data,\n opts: mergeOpts(props.map(function (_a) {\n var opts = _a.opts;\n return opts;\n })),\n };\n };\n try {\n for (var _b = __values$p(this.requested), _c = _b.next(); !_c.done; _c = _b.next()) {\n var request = _c.value;\n var match = grouped.find(groupMatch(request));\n if (match) {\n match.push(request);\n }\n else {\n grouped.push([request]);\n }\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_2) throw e_2.error; }\n }\n return grouped.map(merge);\n };\n DataController.prototype.splitResult = function (dataModel, processedData, scopes, resultCbs) {\n var _loop_2 = function (index) {\n var scope = scopes[index];\n var resultCb = resultCbs[index];\n resultCb({\n dataModel: dataModel,\n processedData: __assign$J(__assign$J({}, processedData), { data: processedData.data.filter(function (_a) {\n var validScopes = _a.validScopes;\n return validScopes == null || validScopes.some(function (s) { return s === scope; });\n }) }),\n });\n };\n for (var index = 0; index < scopes.length; index++) {\n _loop_2(index);\n }\n };\n DataController.DEBUG = function () { var _a; return (_a = [true, 'data-model'].includes(windowValue('agChartsDebug'))) !== null && _a !== void 0 ? _a : false; };\n return DataController;\n}());\n\nvar __read$R = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray$u = (undefined && undefined.__spreadArray) || function (to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\n to[j] = from[i];\n return to;\n};\nvar SeriesStateManager = /** @class */ (function () {\n function SeriesStateManager() {\n this.groups = {};\n }\n SeriesStateManager.prototype.registerSeries = function (_a) {\n var _b;\n var _c;\n var id = _a.id, seriesGrouping = _a.seriesGrouping, visible = _a.visible, type = _a.type;\n if (!seriesGrouping)\n return;\n (_b = (_c = this.groups)[type]) !== null && _b !== void 0 ? _b : (_c[type] = {});\n this.groups[type][id] = { grouping: seriesGrouping, visible: visible };\n };\n SeriesStateManager.prototype.deregisterSeries = function (_a) {\n var id = _a.id, type = _a.type;\n if (this.groups[type]) {\n delete this.groups[type][id];\n }\n if (this.groups[type] && Object.keys(this.groups[type]).length === 0) {\n delete this.groups[type];\n }\n };\n SeriesStateManager.prototype.getVisiblePeerGroupIndex = function (_a) {\n var _b;\n var type = _a.type, seriesGrouping = _a.seriesGrouping;\n if (!seriesGrouping)\n return { visibleGroupCount: 1, index: 0 };\n var visibleGroups = __spreadArray$u([], __read$R(Object.entries((_b = this.groups[type]) !== null && _b !== void 0 ? _b : {})\n .filter(function (_a) {\n var _b = __read$R(_a, 2); _b[0]; var entry = _b[1];\n return entry.visible;\n })\n .reduce(function (result, _a) {\n var _b = __read$R(_a, 2); _b[0]; var next = _b[1];\n if (next.visible) {\n result.add(next.grouping.groupIndex);\n }\n return result;\n }, new Set())\n .values()));\n visibleGroups.sort(function (a, b) { return a - b; });\n return { visibleGroupCount: visibleGroups.length, index: visibleGroups.indexOf(seriesGrouping.groupIndex) };\n };\n return SeriesStateManager;\n}());\n\nvar __values$o = (undefined && undefined.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nvar SeriesLayerManager = /** @class */ (function () {\n function SeriesLayerManager(rootGroup) {\n this.groups = {};\n this.series = {};\n this.rootGroup = rootGroup;\n }\n SeriesLayerManager.prototype.requestGroup = function (seriesConfig) {\n var _a, _b;\n var _c, _d;\n var id = seriesConfig.id, type = seriesConfig.type, seriesRootGroup = seriesConfig.rootGroup, seriesGrouping = seriesConfig.seriesGrouping;\n var _e = (seriesGrouping !== null && seriesGrouping !== void 0 ? seriesGrouping : {}).groupIndex, groupIndex = _e === void 0 ? id : _e;\n if (this.series[id] != null) {\n throw new Error(\"AG Charts - series already has an allocated layer: \" + this.series[id]);\n }\n (_a = (_c = this.groups)[type]) !== null && _a !== void 0 ? _a : (_c[type] = {});\n var groupInfo = this.groups[type][groupIndex];\n if (!groupInfo) {\n groupInfo = (_b = (_d = this.groups[type])[groupIndex]) !== null && _b !== void 0 ? _b : (_d[groupIndex] = {\n seriesIds: [],\n group: this.rootGroup.appendChild(new Group({\n name: type + \"-content\",\n layer: true,\n zIndex: Layers.SERIES_LAYER_ZINDEX,\n zIndexSubOrder: seriesConfig.getGroupZIndexSubOrder('data'),\n })),\n });\n }\n this.series[id] = { layerState: groupInfo, seriesConfig: seriesConfig };\n groupInfo.seriesIds.push(id);\n groupInfo.group.appendChild(seriesRootGroup);\n return groupInfo.group;\n };\n SeriesLayerManager.prototype.changeGroup = function (seriesConfig) {\n var _a, _b;\n var id = seriesConfig.id, seriesGrouping = seriesConfig.seriesGrouping, type = seriesConfig.type, rootGroup = seriesConfig.rootGroup, oldGrouping = seriesConfig.oldGrouping;\n var _c = (seriesGrouping !== null && seriesGrouping !== void 0 ? seriesGrouping : {}).groupIndex, groupIndex = _c === void 0 ? id : _c;\n if ((_b = (_a = this.groups[type]) === null || _a === void 0 ? void 0 : _a[groupIndex]) === null || _b === void 0 ? void 0 : _b.seriesIds.includes(id)) {\n // Already in the right group, nothing to do.\n return;\n }\n if (this.series[id] != null) {\n this.releaseGroup({ id: id, seriesGrouping: oldGrouping, type: type, rootGroup: rootGroup });\n }\n this.requestGroup(seriesConfig);\n };\n SeriesLayerManager.prototype.releaseGroup = function (seriesConfig) {\n var _a, _b, _c, _d, _e;\n var id = seriesConfig.id, seriesGrouping = seriesConfig.seriesGrouping, rootGroup = seriesConfig.rootGroup, type = seriesConfig.type;\n var _f = (seriesGrouping !== null && seriesGrouping !== void 0 ? seriesGrouping : {}).groupIndex, groupIndex = _f === void 0 ? id : _f;\n if (this.series[id] == null) {\n throw new Error(\"AG Charts - series doesn't have an allocated layer: \" + id);\n }\n var groupInfo = (_b = (_a = this.groups[type]) === null || _a === void 0 ? void 0 : _a[groupIndex]) !== null && _b !== void 0 ? _b : (_c = this.series[id]) === null || _c === void 0 ? void 0 : _c.layerState;\n if (groupInfo) {\n groupInfo.seriesIds = groupInfo.seriesIds.filter(function (v) { return v !== id; });\n groupInfo.group.removeChild(rootGroup);\n }\n if ((groupInfo === null || groupInfo === void 0 ? void 0 : groupInfo.seriesIds.length) === 0) {\n // Last member of the layer, cleanup.\n this.rootGroup.removeChild(groupInfo.group);\n delete this.groups[type][groupIndex];\n delete this.groups[type][id];\n }\n else if ((groupInfo === null || groupInfo === void 0 ? void 0 : groupInfo.seriesIds.length) > 0) {\n // Update zIndexSubOrder to avoid it becoming stale as series are removed and re-added\n // with the same groupIndex, but are otherwise unrelated.\n var leadSeriesConfig = (_e = this.series[(_d = groupInfo === null || groupInfo === void 0 ? void 0 : groupInfo.seriesIds) === null || _d === void 0 ? void 0 : _d[0]]) === null || _e === void 0 ? void 0 : _e.seriesConfig;\n groupInfo.group.zIndexSubOrder = leadSeriesConfig === null || leadSeriesConfig === void 0 ? void 0 : leadSeriesConfig.getGroupZIndexSubOrder('data');\n }\n delete this.series[id];\n };\n SeriesLayerManager.prototype.destroy = function () {\n var e_1, _a, e_2, _b;\n try {\n for (var _c = __values$o(Object.values(this.groups)), _d = _c.next(); !_d.done; _d = _c.next()) {\n var groups = _d.value;\n try {\n for (var _e = (e_2 = void 0, __values$o(Object.values(groups))), _f = _e.next(); !_f.done; _f = _e.next()) {\n var groupInfo = _f.value;\n this.rootGroup.removeChild(groupInfo.group);\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (_f && !_f.done && (_b = _e.return)) _b.call(_e);\n }\n finally { if (e_2) throw e_2.error; }\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_d && !_d.done && (_a = _c.return)) _a.call(_c);\n }\n finally { if (e_1) throw e_1.error; }\n }\n this.groups = {};\n this.series = {};\n };\n return SeriesLayerManager;\n}());\n\nvar __extends$2s = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign$I = (undefined && undefined.__assign) || function () {\n __assign$I = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$I.apply(this, arguments);\n};\nvar __decorate$1N = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __awaiter$c = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator$c = (undefined && undefined.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nvar __read$Q = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __values$n = (undefined && undefined.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nvar __spreadArray$t = (undefined && undefined.__spreadArray) || function (to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\n to[j] = from[i];\n return to;\n};\nvar Chart = /** @class */ (function (_super) {\n __extends$2s(Chart, _super);\n function Chart(document, overrideDevicePixelRatio, resources) {\n if (document === void 0) { document = window.document; }\n var _a;\n var _this = _super.call(this) || this;\n _this.id = createId$1(_this);\n _this.processedOptions = {};\n _this.userOptions = {};\n _this.queuedUserOptions = [];\n _this.seriesRoot = new Group({ name: _this.id + \"-Series-root\" });\n _this.extraDebugStats = {};\n _this.container = undefined;\n _this.data = [];\n _this.padding = new Padding$1(20);\n _this.seriesAreaPadding = new Padding$1(0);\n _this.title = undefined;\n _this.subtitle = undefined;\n _this.footnote = undefined;\n _this.mode = 'standalone';\n _this._destroyed = false;\n _this.modules = {};\n _this.legendModules = {};\n _this._pendingFactoryUpdates = [];\n _this._performUpdateNoRenderCount = 0;\n _this._performUpdateType = ChartUpdateType.NONE;\n _this.seriesToUpdate = new Set();\n _this.performUpdateTrigger = debouncedCallback(function (_a) {\n var count = _a.count;\n return __awaiter$c(_this, void 0, void 0, function () {\n var error_1;\n return __generator$c(this, function (_b) {\n switch (_b.label) {\n case 0:\n if (this._destroyed)\n return [2 /*return*/];\n _b.label = 1;\n case 1:\n _b.trys.push([1, 3, , 4]);\n return [4 /*yield*/, this.performUpdate(count)];\n case 2:\n _b.sent();\n return [3 /*break*/, 4];\n case 3:\n error_1 = _b.sent();\n this._lastPerformUpdateError = error_1;\n Logger.error('update error', error_1);\n return [3 /*break*/, 4];\n case 4: return [2 /*return*/];\n }\n });\n });\n });\n _this._axes = [];\n _this._series = [];\n _this.applyLegendOptions = undefined;\n _this.lastInteractionEvent = undefined;\n _this.pointerScheduler = debouncedAnimationFrame(function () {\n if (_this.lastInteractionEvent) {\n _this.handlePointer(_this.lastInteractionEvent);\n }\n _this.lastInteractionEvent = undefined;\n });\n _this.onSeriesNodeClick = function (event) {\n var seriesNodeClickEvent = __assign$I(__assign$I({}, event), { type: 'seriesNodeClick' });\n Object.defineProperty(seriesNodeClickEvent, 'series', {\n enumerable: false,\n // Should display the deprecation warning\n get: function () { return event.series; },\n });\n _this.fireEvent(seriesNodeClickEvent);\n };\n _this.onSeriesNodeDoubleClick = function (event) {\n var seriesNodeDoubleClick = __assign$I(__assign$I({}, event), { type: 'seriesNodeDoubleClick' });\n _this.fireEvent(seriesNodeDoubleClick);\n };\n var scene = resources === null || resources === void 0 ? void 0 : resources.scene;\n var element = (_a = resources === null || resources === void 0 ? void 0 : resources.element) !== null && _a !== void 0 ? _a : document.createElement('div');\n var container = resources === null || resources === void 0 ? void 0 : resources.container;\n var root = new Group({ name: 'root' });\n // Prevent the scene from rendering chart components in an invalid state\n // (before first layout is performed).\n root.visible = false;\n root.append(_this.seriesRoot);\n _this.axisGroup = new Group({ name: 'Axes', layer: true, zIndex: Layers.AXIS_ZINDEX });\n root.appendChild(_this.axisGroup);\n _this.element = element;\n element.classList.add('ag-chart-wrapper');\n element.style.position = 'relative';\n _this.scene = scene !== null && scene !== void 0 ? scene : new Scene({ document: document, overrideDevicePixelRatio: overrideDevicePixelRatio });\n _this.scene.debug.consoleLog = false;\n _this.scene.root = root;\n _this.scene.container = element;\n _this.autoSize = true;\n _this.chartEventManager = new ChartEventManager();\n _this.cursorManager = new CursorManager(element);\n _this.highlightManager = new HighlightManager();\n _this.interactionManager = new InteractionManager(element);\n _this.zoomManager = new ZoomManager();\n _this.dataService = new DataService(function () { return _this.series; });\n _this.layoutService = new LayoutService();\n _this.updateService = new UpdateService(function (type, _a) {\n if (type === void 0) { type = ChartUpdateType.FULL; }\n var forceNodeDataRefresh = _a.forceNodeDataRefresh;\n return _this.update(type, { forceNodeDataRefresh: forceNodeDataRefresh });\n });\n _this.seriesStateManager = new SeriesStateManager();\n _this.seriesLayerManager = new SeriesLayerManager(_this.seriesRoot);\n _this.callbackCache = new CallbackCache();\n _this.animationManager = new AnimationManager(_this.interactionManager);\n _this.animationManager.skipAnimations = true;\n _this.animationManager.play();\n _this.tooltip = new Tooltip(_this.scene.canvas.element, document, document.body);\n _this.tooltipManager = new TooltipManager(_this.tooltip, _this.interactionManager);\n _this.overlays = new ChartOverlays(_this.element);\n _this.highlight = new ChartHighlight();\n _this.container = container;\n _this.debug = false;\n SizeMonitor.observe(_this.element, function (size) {\n var _a;\n var width = size.width, height = size.height;\n if (!_this.autoSize) {\n return;\n }\n if (width === 0 && height === 0) {\n return;\n }\n var _b = __read$Q((_a = _this._lastAutoSize) !== null && _a !== void 0 ? _a : [], 2), _c = _b[0], autoWidth = _c === void 0 ? 0 : _c, _d = _b[1], authHeight = _d === void 0 ? 0 : _d;\n if (autoWidth === width && authHeight === height) {\n return;\n }\n _this._lastAutoSize = [width, height];\n _this.resize();\n });\n _this.layoutService.addListener('start-layout', function (e) { return _this.positionPadding(e.shrinkRect); });\n _this.layoutService.addListener('start-layout', function (e) { return _this.positionCaptions(e.shrinkRect); });\n // Add interaction listeners last so child components are registered first.\n _this.interactionManager.addListener('click', function (event) { return _this.onClick(event); });\n _this.interactionManager.addListener('dblclick', function (event) { return _this.onDoubleClick(event); });\n _this.interactionManager.addListener('hover', function (event) { return _this.onMouseMove(event); });\n _this.interactionManager.addListener('leave', function (event) { return _this.onLeave(event); });\n _this.interactionManager.addListener('page-left', function () { return _this.destroy(); });\n _this.interactionManager.addListener('wheel', function () { return _this.disablePointer(); });\n _this.animationManager.addListener('animation-frame', function (_) {\n _this.update(ChartUpdateType.SCENE_RENDER);\n });\n _this.highlightManager.addListener('highlight-change', function (event) { return _this.changeHighlightDatum(event); });\n _this.zoomManager.addListener('zoom-change', function (_) {\n return _this.update(ChartUpdateType.PROCESS_DATA, { forceNodeDataRefresh: true });\n });\n _this.attachLegend('category');\n return _this;\n }\n Chart.prototype.getOptions = function () {\n var _a;\n var queuedUserOptions = this.queuedUserOptions;\n var lastUpdateOptions = (_a = queuedUserOptions[queuedUserOptions.length - 1]) !== null && _a !== void 0 ? _a : this.userOptions;\n return jsonMerge([lastUpdateOptions]);\n };\n Chart.prototype.autoSizeChanged = function (value) {\n var style = this.element.style;\n if (value) {\n style.display = 'block';\n style.width = '100%';\n style.height = '100%';\n if (!this._lastAutoSize) {\n return;\n }\n this.resize();\n }\n else {\n style.display = 'inline-block';\n style.width = 'auto';\n style.height = 'auto';\n }\n };\n Chart.prototype.download = function (fileName, fileFormat) {\n this.scene.download(fileName, fileFormat);\n };\n Object.defineProperty(Chart.prototype, \"destroyed\", {\n get: function () {\n return this._destroyed;\n },\n enumerable: false,\n configurable: true\n });\n Chart.prototype.addModule = function (module) {\n if (this.modules[module.optionsKey] != null) {\n throw new Error('AG Charts - module already initialised: ' + module.optionsKey);\n }\n var moduleInstance = new module.instanceConstructor(this.getModuleContext());\n this.modules[module.optionsKey] = { instance: moduleInstance };\n this[module.optionsKey] = moduleInstance;\n };\n Chart.prototype.removeModule = function (module) {\n var _a, _b;\n (_b = (_a = this.modules[module.optionsKey]) === null || _a === void 0 ? void 0 : _a.instance) === null || _b === void 0 ? void 0 : _b.destroy();\n delete this.modules[module.optionsKey];\n delete this[module.optionsKey];\n };\n Chart.prototype.isModuleEnabled = function (module) {\n return this.modules[module.optionsKey] != null;\n };\n Chart.prototype.getModuleContext = function () {\n var _a = this, scene = _a.scene, animationManager = _a.animationManager, chartEventManager = _a.chartEventManager, cursorManager = _a.cursorManager, highlightManager = _a.highlightManager, interactionManager = _a.interactionManager, tooltipManager = _a.tooltipManager, zoomManager = _a.zoomManager, dataService = _a.dataService, layoutService = _a.layoutService, updateService = _a.updateService, seriesStateManager = _a.seriesStateManager, seriesLayerManager = _a.seriesLayerManager, mode = _a.mode, callbackCache = _a.callbackCache;\n return {\n scene: scene,\n animationManager: animationManager,\n chartEventManager: chartEventManager,\n cursorManager: cursorManager,\n highlightManager: highlightManager,\n interactionManager: interactionManager,\n tooltipManager: tooltipManager,\n zoomManager: zoomManager,\n dataService: dataService,\n layoutService: layoutService,\n updateService: updateService,\n mode: mode,\n seriesStateManager: seriesStateManager,\n seriesLayerManager: seriesLayerManager,\n callbackCache: callbackCache,\n };\n };\n Chart.prototype.destroy = function (opts) {\n var e_1, _a;\n var _b;\n if (this._destroyed) {\n return;\n }\n var keepTransferableResources = opts === null || opts === void 0 ? void 0 : opts.keepTransferableResources;\n var result = undefined;\n this._performUpdateType = ChartUpdateType.NONE;\n this._pendingFactoryUpdates.splice(0);\n this.tooltipManager.destroy();\n this.tooltip.destroy();\n (_b = this.legend) === null || _b === void 0 ? void 0 : _b.destroy();\n this.overlays.noData.hide();\n SizeMonitor.unobserve(this.element);\n try {\n for (var _c = __values$n(Object.entries(this.modules)), _d = _c.next(); !_d.done; _d = _c.next()) {\n var _e = __read$Q(_d.value, 2), key = _e[0], module = _e[1];\n module.instance.destroy();\n delete this.modules[key];\n delete this[key];\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_d && !_d.done && (_a = _c.return)) _a.call(_c);\n }\n finally { if (e_1) throw e_1.error; }\n }\n this.interactionManager.destroy();\n this.animationManager.stop();\n if (keepTransferableResources) {\n this.scene.strip();\n result = { container: this.container, scene: this.scene, element: this.element };\n }\n else {\n this.scene.destroy();\n this.container = undefined;\n }\n this.removeAllSeries();\n this.seriesLayerManager.destroy();\n this.axes.forEach(function (a) { return a.destroy(); });\n this.axes = [];\n this.callbackCache.invalidateCache();\n this._destroyed = true;\n return result;\n };\n Chart.prototype.log = function () {\n var opts = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n opts[_i] = arguments[_i];\n }\n if (this.debug) {\n Logger.debug.apply(Logger, __spreadArray$t([], __read$Q(opts)));\n }\n };\n Chart.prototype.disablePointer = function (highlightOnly) {\n if (highlightOnly === void 0) { highlightOnly = false; }\n if (!highlightOnly) {\n this.tooltipManager.removeTooltip(this.id);\n }\n this.highlightManager.updateHighlight(this.id);\n if (this.lastInteractionEvent) {\n this.lastInteractionEvent = undefined;\n }\n };\n Chart.prototype.requestFactoryUpdate = function (cb) {\n var callbacks = this._pendingFactoryUpdates;\n var count = callbacks.length;\n if (count === 0) {\n callbacks.push(cb);\n this._processCallbacks().catch(function (e) { return Logger.errorOnce(e); });\n }\n else {\n // Factory callback process already running, the callback will be invoked asynchronously.\n // Clear the queue after the first callback to prevent unnecessary re-renderings.\n callbacks.splice(1, count - 1, cb);\n }\n };\n Chart.prototype._processCallbacks = function () {\n return __awaiter$c(this, void 0, void 0, function () {\n var callbacks, e_2;\n return __generator$c(this, function (_a) {\n switch (_a.label) {\n case 0:\n callbacks = this._pendingFactoryUpdates;\n _a.label = 1;\n case 1:\n if (!(callbacks.length > 0)) return [3 /*break*/, 7];\n if (!this.updatePending) return [3 /*break*/, 3];\n return [4 /*yield*/, sleep(1)];\n case 2:\n _a.sent();\n return [3 /*break*/, 1]; // Make sure to check queue has an item before continuing.\n case 3:\n _a.trys.push([3, 5, , 6]);\n return [4 /*yield*/, callbacks[0]()];\n case 4:\n _a.sent();\n this.callbackCache.invalidateCache();\n return [3 /*break*/, 6];\n case 5:\n e_2 = _a.sent();\n Logger.error('update error', e_2);\n return [3 /*break*/, 6];\n case 6:\n callbacks.shift();\n return [3 /*break*/, 1];\n case 7: return [2 /*return*/];\n }\n });\n });\n };\n Object.defineProperty(Chart.prototype, \"performUpdateType\", {\n get: function () {\n return this._performUpdateType;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Chart.prototype, \"updatePending\", {\n get: function () {\n return this._performUpdateType !== ChartUpdateType.NONE || this.lastInteractionEvent != null;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Chart.prototype, \"lastPerformUpdateError\", {\n get: function () {\n return this._lastPerformUpdateError;\n },\n enumerable: false,\n configurable: true\n });\n Chart.prototype.awaitUpdateCompletion = function () {\n return __awaiter$c(this, void 0, void 0, function () {\n return __generator$c(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.performUpdateTrigger.await()];\n case 1:\n _a.sent();\n return [2 /*return*/];\n }\n });\n });\n };\n Chart.prototype.update = function (type, opts) {\n var e_3, _a;\n if (type === void 0) { type = ChartUpdateType.FULL; }\n var _b = opts !== null && opts !== void 0 ? opts : {}, _c = _b.forceNodeDataRefresh, forceNodeDataRefresh = _c === void 0 ? false : _c, _d = _b.seriesToUpdate, seriesToUpdate = _d === void 0 ? this.series : _d;\n if (forceNodeDataRefresh) {\n this.series.forEach(function (series) { return series.markNodeDataDirty(); });\n }\n try {\n for (var seriesToUpdate_1 = __values$n(seriesToUpdate), seriesToUpdate_1_1 = seriesToUpdate_1.next(); !seriesToUpdate_1_1.done; seriesToUpdate_1_1 = seriesToUpdate_1.next()) {\n var series = seriesToUpdate_1_1.value;\n this.seriesToUpdate.add(series);\n }\n }\n catch (e_3_1) { e_3 = { error: e_3_1 }; }\n finally {\n try {\n if (seriesToUpdate_1_1 && !seriesToUpdate_1_1.done && (_a = seriesToUpdate_1.return)) _a.call(seriesToUpdate_1);\n }\n finally { if (e_3) throw e_3.error; }\n }\n if (type < this._performUpdateType) {\n this._performUpdateType = type;\n this.performUpdateTrigger.schedule();\n }\n };\n Chart.prototype.performUpdate = function (count) {\n var _a;\n return __awaiter$c(this, void 0, void 0, function () {\n var _b, performUpdateType, extraDebugStats, splits, _c, seriesRect_1, seriesUpdates, tooltipMeta, end;\n return __generator$c(this, function (_d) {\n switch (_d.label) {\n case 0:\n _b = this, performUpdateType = _b._performUpdateType, extraDebugStats = _b.extraDebugStats;\n this.log('Chart.performUpdate() - start', ChartUpdateType[performUpdateType]);\n splits = [performance.now()];\n _c = performUpdateType;\n switch (_c) {\n case ChartUpdateType.FULL: return [3 /*break*/, 1];\n case ChartUpdateType.PROCESS_DATA: return [3 /*break*/, 1];\n case ChartUpdateType.PERFORM_LAYOUT: return [3 /*break*/, 3];\n case ChartUpdateType.SERIES_UPDATE: return [3 /*break*/, 5];\n case ChartUpdateType.TOOLTIP_RECALCULATION: return [3 /*break*/, 7];\n case ChartUpdateType.SCENE_RENDER: return [3 /*break*/, 8];\n case ChartUpdateType.NONE: return [3 /*break*/, 10];\n }\n return [3 /*break*/, 11];\n case 1: return [4 /*yield*/, this.processData()];\n case 2:\n _d.sent();\n this.disablePointer(true);\n splits.push(performance.now());\n _d.label = 3;\n case 3:\n if (!this.checkFirstAutoSize())\n return [3 /*break*/, 11];\n return [4 /*yield*/, this.performLayout()];\n case 4:\n _d.sent();\n this.handleOverlays();\n this.log('Chart.performUpdate() - seriesRect', this.seriesRect);\n splits.push(performance.now());\n _d.label = 5;\n case 5:\n seriesRect_1 = this.seriesRect;\n seriesUpdates = __spreadArray$t([], __read$Q(this.seriesToUpdate)).map(function (series) { return series.update({ seriesRect: seriesRect_1 }); });\n this.seriesToUpdate.clear();\n return [4 /*yield*/, Promise.all(seriesUpdates)];\n case 6:\n _d.sent();\n splits.push(performance.now());\n _d.label = 7;\n case 7:\n tooltipMeta = this.tooltipManager.getTooltipMeta(this.id);\n if (performUpdateType < ChartUpdateType.SERIES_UPDATE && ((_a = tooltipMeta === null || tooltipMeta === void 0 ? void 0 : tooltipMeta.event) === null || _a === void 0 ? void 0 : _a.type) === 'hover') {\n this.handlePointer(tooltipMeta.event);\n }\n _d.label = 8;\n case 8: return [4 /*yield*/, this.scene.render({ debugSplitTimes: splits, extraDebugStats: extraDebugStats })];\n case 9:\n _d.sent();\n this.extraDebugStats = {};\n _d.label = 10;\n case 10:\n // Do nothing.\n this._performUpdateType = ChartUpdateType.NONE;\n _d.label = 11;\n case 11:\n end = performance.now();\n this.log('Chart.performUpdate() - end', {\n chart: this,\n durationMs: Math.round((end - splits[0]) * 100) / 100,\n count: count,\n performUpdateType: ChartUpdateType[performUpdateType],\n });\n return [2 /*return*/];\n }\n });\n });\n };\n Chart.prototype.checkFirstAutoSize = function () {\n if (this.autoSize && !this._lastAutoSize) {\n var count = this._performUpdateNoRenderCount++;\n var backOffMs = (count ^ 2) * 10;\n if (count < 5) {\n // Reschedule if canvas size hasn't been set yet to avoid a race.\n this._performUpdateType = ChartUpdateType.PERFORM_LAYOUT;\n this.performUpdateTrigger.schedule(backOffMs);\n this.log('Chart.checkFirstAutoSize() - backing off until first size update', backOffMs);\n return false;\n }\n // After several failed passes, continue and accept there maybe a redundant\n // render. Sometimes this case happens when we already have the correct\n // width/height, and we end up never rendering the chart in that scenario.\n this.log('Chart.checkFirstAutoSize() - timeout for first size update.');\n }\n this._performUpdateNoRenderCount = 0;\n return true;\n };\n Object.defineProperty(Chart.prototype, \"axes\", {\n get: function () {\n return this._axes;\n },\n set: function (values) {\n var _this = this;\n var removedAxes = new Set();\n this._axes.forEach(function (axis) {\n axis.detachAxis(_this.axisGroup);\n removedAxes.add(axis);\n });\n // make linked axes go after the regular ones (simulates stable sort by `linkedTo` property)\n this._axes = values.filter(function (a) { return !a.linkedTo; }).concat(values.filter(function (a) { return a.linkedTo; }));\n this._axes.forEach(function (axis) {\n axis.attachAxis(_this.axisGroup);\n removedAxes.delete(axis);\n });\n this.zoomManager.updateAxes(this._axes);\n removedAxes.forEach(function (axis) { return axis.destroy(); });\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Chart.prototype, \"series\", {\n get: function () {\n return this._series;\n },\n set: function (values) {\n var _this = this;\n this.removeAllSeries();\n values.forEach(function (series) { return _this.addSeries(series); });\n },\n enumerable: false,\n configurable: true\n });\n Chart.prototype.addSeries = function (series) {\n var allSeries = this.series;\n var canAdd = allSeries.indexOf(series) < 0;\n if (canAdd) {\n allSeries.push(series);\n if (series.rootGroup.parent == null) {\n this.seriesLayerManager.requestGroup(series);\n }\n this.initSeries(series);\n return true;\n }\n return false;\n };\n Chart.prototype.initSeries = function (series) {\n series.chart = this;\n if (!series.data) {\n series.data = this.data;\n }\n this.addSeriesListeners(series);\n series.addChartEventListeners();\n };\n Chart.prototype.removeAllSeries = function () {\n var _this = this;\n this.series.forEach(function (series) {\n series.removeEventListener('nodeClick', _this.onSeriesNodeClick);\n series.removeEventListener('nodeDoubleClick', _this.onSeriesNodeDoubleClick);\n series.destroy();\n series.chart = undefined;\n });\n this._series = []; // using `_series` instead of `series` to prevent infinite recursion\n };\n Chart.prototype.addSeriesListeners = function (series) {\n if (this.hasEventListener('seriesNodeClick')) {\n series.addEventListener('nodeClick', this.onSeriesNodeClick);\n }\n if (this.hasEventListener('seriesNodeDoubleClick')) {\n series.addEventListener('nodeDoubleClick', this.onSeriesNodeDoubleClick);\n }\n };\n Chart.prototype.updateAllSeriesListeners = function () {\n var _this = this;\n this.series.forEach(function (series) {\n series.removeEventListener('nodeClick', _this.onSeriesNodeClick);\n series.removeEventListener('nodeDoubleClick', _this.onSeriesNodeDoubleClick);\n _this.addSeriesListeners(series);\n });\n };\n Chart.prototype.assignSeriesToAxes = function () {\n var _this = this;\n this.axes.forEach(function (axis) {\n axis.boundSeries = _this.series.filter(function (s) {\n var seriesAxis = s.axes[axis.direction];\n return seriesAxis === axis;\n });\n });\n };\n Chart.prototype.assignAxesToSeries = function () {\n var _this = this;\n // This method has to run before `assignSeriesToAxes`.\n var directionToAxesMap = {};\n this.axes.forEach(function (axis) {\n var _a;\n var direction = axis.direction;\n var directionAxes = ((_a = directionToAxesMap[direction]) !== null && _a !== void 0 ? _a : (directionToAxesMap[direction] = []));\n directionAxes.push(axis);\n });\n this.series.forEach(function (series) {\n series.directions.forEach(function (direction) {\n var directionAxes = directionToAxesMap[direction];\n if (!directionAxes) {\n Logger.warn(\"no available axis for direction [\" + direction + \"]; check series and axes configuration.\");\n return;\n }\n var seriesKeys = series.getKeys(direction);\n var newAxis = _this.findMatchingAxis(directionAxes, series.getKeys(direction));\n if (!newAxis) {\n Logger.warn(\"no matching axis for direction [\" + direction + \"] and keys [\" + seriesKeys + \"]; check series and axes configuration.\");\n return;\n }\n series.axes[direction] = newAxis;\n });\n });\n };\n Chart.prototype.findMatchingAxis = function (directionAxes, directionKeys) {\n var e_4, _a, e_5, _b;\n try {\n for (var directionAxes_1 = __values$n(directionAxes), directionAxes_1_1 = directionAxes_1.next(); !directionAxes_1_1.done; directionAxes_1_1 = directionAxes_1.next()) {\n var axis = directionAxes_1_1.value;\n var axisKeys = axis.keys;\n if (!axisKeys.length) {\n return axis;\n }\n if (!directionKeys) {\n continue;\n }\n try {\n for (var directionKeys_1 = (e_5 = void 0, __values$n(directionKeys)), directionKeys_1_1 = directionKeys_1.next(); !directionKeys_1_1.done; directionKeys_1_1 = directionKeys_1.next()) {\n var directionKey = directionKeys_1_1.value;\n if (axisKeys.indexOf(directionKey) >= 0) {\n return axis;\n }\n }\n }\n catch (e_5_1) { e_5 = { error: e_5_1 }; }\n finally {\n try {\n if (directionKeys_1_1 && !directionKeys_1_1.done && (_b = directionKeys_1.return)) _b.call(directionKeys_1);\n }\n finally { if (e_5) throw e_5.error; }\n }\n }\n }\n catch (e_4_1) { e_4 = { error: e_4_1 }; }\n finally {\n try {\n if (directionAxes_1_1 && !directionAxes_1_1.done && (_a = directionAxes_1.return)) _a.call(directionAxes_1);\n }\n finally { if (e_4) throw e_4.error; }\n }\n };\n Chart.prototype.resize = function (width, height) {\n var _a, _b, _c, _d;\n width !== null && width !== void 0 ? width : (width = (_a = this.width) !== null && _a !== void 0 ? _a : (this.autoSize ? (_b = this._lastAutoSize) === null || _b === void 0 ? void 0 : _b[0] : this.scene.canvas.width));\n height !== null && height !== void 0 ? height : (height = (_c = this.height) !== null && _c !== void 0 ? _c : (this.autoSize ? (_d = this._lastAutoSize) === null || _d === void 0 ? void 0 : _d[1] : this.scene.canvas.height));\n this.log('Chart.resize()', { width: width, height: height });\n if (!width || !height || !Number.isFinite(width) || !Number.isFinite(height))\n return;\n if (this.scene.resize(width, height)) {\n this.disablePointer();\n this.update(ChartUpdateType.PERFORM_LAYOUT, { forceNodeDataRefresh: true });\n }\n };\n Chart.prototype.processData = function () {\n return __awaiter$c(this, void 0, void 0, function () {\n var dataController, seriesPromises;\n return __generator$c(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (this.axes.length > 0) {\n this.assignAxesToSeries();\n this.assignSeriesToAxes();\n }\n dataController = new DataController();\n seriesPromises = this.series.map(function (s) { return s.processData(dataController); });\n return [4 /*yield*/, dataController.execute()];\n case 1:\n _a.sent();\n return [4 /*yield*/, Promise.all(seriesPromises)];\n case 2:\n _a.sent();\n return [4 /*yield*/, this.updateLegend()];\n case 3:\n _a.sent();\n return [2 /*return*/];\n }\n });\n });\n };\n Chart.prototype.placeLabels = function () {\n var e_6, _a;\n var visibleSeries = [];\n var data = [];\n try {\n for (var _b = __values$n(this.series), _c = _b.next(); !_c.done; _c = _b.next()) {\n var series = _c.value;\n if (!series.visible) {\n continue;\n }\n var labelData = series.getLabelData();\n if (!(labelData && isPointLabelDatum(labelData[0]))) {\n continue;\n }\n data.push(labelData);\n visibleSeries.push(series);\n }\n }\n catch (e_6_1) { e_6 = { error: e_6_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_6) throw e_6.error; }\n }\n var seriesRect = this.seriesRect;\n var labels = seriesRect && data.length > 0\n ? placeLabels(data, { x: 0, y: 0, width: seriesRect.width, height: seriesRect.height })\n : [];\n return new Map(labels.map(function (l, i) { return [visibleSeries[i], l]; }));\n };\n Chart.prototype.attachLegend = function (legendType) {\n var _a;\n if (this.legendType === legendType && this.legend) {\n return this.legend;\n }\n (_a = this.legend) === null || _a === void 0 ? void 0 : _a.destroy();\n this.legend = undefined;\n var ctx = this.getModuleContext();\n var legend = getLegend(legendType, ctx);\n legend.attachLegend(this.scene.root);\n this.legend = legend;\n this.legendType = legendType;\n return legend;\n };\n Chart.prototype.setLegendInit = function (initLegend) {\n this.applyLegendOptions = initLegend;\n };\n Chart.prototype.updateLegend = function () {\n var _a;\n return __awaiter$c(this, void 0, void 0, function () {\n var legendData, legendType, legend;\n return __generator$c(this, function (_b) {\n legendData = [];\n this.series\n .filter(function (s) { return s.showInLegend; })\n .forEach(function (series) {\n var data = series.getLegendData();\n legendData.push.apply(legendData, __spreadArray$t([], __read$Q(data)));\n });\n legendType = legendData.length > 0 ? legendData[0].legendType : 'category';\n legend = this.attachLegend(legendType);\n (_a = this.applyLegendOptions) === null || _a === void 0 ? void 0 : _a.call(this, legend);\n if (legendType === 'category') {\n this.validateLegendData(legendData);\n }\n legend.data = legendData;\n return [2 /*return*/];\n });\n });\n };\n Chart.prototype.validateLegendData = function (legendData) {\n var _this = this;\n // Validate each series that shares a legend item label uses the same fill colour\n var labelMarkerFills = {};\n legendData.forEach(function (d) {\n var _a;\n var _b, _c, _d;\n var _e, _f;\n var seriesType = (_b = _this.series.find(function (s) { return s.id === d.seriesId; })) === null || _b === void 0 ? void 0 : _b.type;\n if (!seriesType)\n return;\n var dc = d;\n (_c = labelMarkerFills[seriesType]) !== null && _c !== void 0 ? _c : (labelMarkerFills[seriesType] = (_a = {}, _a[dc.label.text] = new Set(), _a));\n (_d = (_e = labelMarkerFills[seriesType])[_f = dc.label.text]) !== null && _d !== void 0 ? _d : (_e[_f] = new Set());\n if (dc.marker.fill != null) {\n labelMarkerFills[seriesType][dc.label.text].add(dc.marker.fill);\n }\n });\n Object.keys(labelMarkerFills).forEach(function (seriesType) {\n Object.keys(labelMarkerFills[seriesType]).forEach(function (name) {\n var fills = labelMarkerFills[seriesType][name];\n if (fills.size > 1) {\n Logger.warnOnce(\"legend item '\" + name + \"' has multiple fill colors, this may cause unexpected behaviour.\");\n }\n });\n });\n };\n Chart.prototype.performLayout = function () {\n return __awaiter$c(this, void 0, void 0, function () {\n var _a, width, height, shrinkRect;\n return __generator$c(this, function (_b) {\n if (this.scene.root != null) {\n this.scene.root.visible = true;\n }\n _a = this.scene, width = _a.width, height = _a.height;\n shrinkRect = new BBox(0, 0, width, height);\n (shrinkRect = this.layoutService.dispatchPerformLayout('start-layout', { shrinkRect: shrinkRect }).shrinkRect);\n (shrinkRect = this.layoutService.dispatchPerformLayout('before-series', { shrinkRect: shrinkRect }).shrinkRect);\n return [2 /*return*/, shrinkRect];\n });\n });\n };\n Chart.prototype.positionPadding = function (shrinkRect) {\n var padding = this.padding;\n shrinkRect.shrink(padding.left, 'left');\n shrinkRect.shrink(padding.top, 'top');\n shrinkRect.shrink(padding.right, 'right');\n shrinkRect.shrink(padding.bottom, 'bottom');\n return { shrinkRect: shrinkRect };\n };\n Chart.prototype.positionCaptions = function (shrinkRect) {\n var _a;\n var _b = this, title = _b.title, subtitle = _b.subtitle, footnote = _b.footnote;\n var newShrinkRect = shrinkRect.clone();\n var updateCaption = function (caption) {\n var _a;\n var defaultCaptionHeight = shrinkRect.height / 10;\n var captionLineHeight = (_a = caption.lineHeight) !== null && _a !== void 0 ? _a : caption.fontSize * Text.defaultLineHeightRatio;\n var maxWidth = shrinkRect.width;\n var maxHeight = Math.max(captionLineHeight, defaultCaptionHeight);\n caption.computeTextWrap(maxWidth, maxHeight);\n };\n var positionTopAndShrinkBBox = function (caption) {\n var _a;\n var baseY = newShrinkRect.y;\n caption.node.x = newShrinkRect.x + newShrinkRect.width / 2;\n caption.node.y = baseY;\n caption.node.textBaseline = 'top';\n updateCaption(caption);\n var bbox = caption.node.computeBBox();\n // As the bbox (x,y) ends up at a different location than specified above, we need to\n // take it into consideration when calculating how much space needs to be reserved to\n // accommodate the caption.\n var bboxHeight = Math.ceil(bbox.y - baseY + bbox.height + ((_a = caption.spacing) !== null && _a !== void 0 ? _a : 0));\n newShrinkRect.shrink(bboxHeight, 'top');\n };\n var positionBottomAndShrinkBBox = function (caption) {\n var _a;\n var baseY = newShrinkRect.y + newShrinkRect.height;\n caption.node.x = newShrinkRect.x + newShrinkRect.width / 2;\n caption.node.y = baseY;\n caption.node.textBaseline = 'bottom';\n updateCaption(caption);\n var bbox = caption.node.computeBBox();\n var bboxHeight = Math.ceil(baseY - bbox.y + ((_a = caption.spacing) !== null && _a !== void 0 ? _a : 0));\n newShrinkRect.shrink(bboxHeight, 'bottom');\n };\n if (title) {\n title.node.visible = title.enabled;\n if (title.node.visible) {\n positionTopAndShrinkBBox(title);\n }\n }\n if (subtitle) {\n subtitle.node.visible = (_a = ((title === null || title === void 0 ? void 0 : title.enabled) && subtitle.enabled)) !== null && _a !== void 0 ? _a : false;\n if (subtitle.node.visible) {\n positionTopAndShrinkBBox(subtitle);\n }\n }\n if (footnote) {\n footnote.node.visible = footnote.enabled;\n if (footnote.node.visible) {\n positionBottomAndShrinkBBox(footnote);\n }\n }\n return { shrinkRect: newShrinkRect };\n };\n Chart.prototype.getSeriesRect = function () {\n return this.seriesRect;\n };\n // x/y are local canvas coordinates in CSS pixels, not actual pixels\n Chart.prototype.pickSeriesNode = function (point, exactMatchOnly, maxDistance) {\n var e_7, _a;\n var _b, _c;\n var start = performance.now();\n // Disable 'nearest match' options if looking for exact matches only\n var pickModes = exactMatchOnly ? [SeriesNodePickMode.EXACT_SHAPE_MATCH] : undefined;\n // Iterate through series in reverse, as later declared series appears on top of earlier\n // declared series.\n var reverseSeries = __spreadArray$t([], __read$Q(this.series)).reverse();\n var result = undefined;\n try {\n for (var reverseSeries_1 = __values$n(reverseSeries), reverseSeries_1_1 = reverseSeries_1.next(); !reverseSeries_1_1.done; reverseSeries_1_1 = reverseSeries_1.next()) {\n var series = reverseSeries_1_1.value;\n if (!series.visible || !series.rootGroup.visible) {\n continue;\n }\n var _d = (_b = series.pickNode(point, pickModes)) !== null && _b !== void 0 ? _b : {}, match = _d.match, distance = _d.distance;\n if (!match || distance == null) {\n continue;\n }\n if ((!result || result.distance > distance) && distance <= (maxDistance !== null && maxDistance !== void 0 ? maxDistance : Infinity)) {\n result = { series: series, distance: distance, datum: match };\n }\n if (distance === 0) {\n break;\n }\n }\n }\n catch (e_7_1) { e_7 = { error: e_7_1 }; }\n finally {\n try {\n if (reverseSeries_1_1 && !reverseSeries_1_1.done && (_a = reverseSeries_1.return)) _a.call(reverseSeries_1);\n }\n finally { if (e_7) throw e_7.error; }\n }\n this.extraDebugStats['pickSeriesNode'] = Math.round(((_c = this.extraDebugStats['pickSeriesNode']) !== null && _c !== void 0 ? _c : 0) + (performance.now() - start));\n return result;\n };\n Chart.prototype.onMouseMove = function (event) {\n this.lastInteractionEvent = event;\n this.pointerScheduler.schedule();\n this.extraDebugStats['mouseX'] = event.offsetX;\n this.extraDebugStats['mouseY'] = event.offsetY;\n this.update(ChartUpdateType.SCENE_RENDER);\n };\n Chart.prototype.onLeave = function (event) {\n if (this.tooltip.pointerLeftOntoTooltip(event)) {\n return;\n }\n this.disablePointer();\n };\n Chart.prototype.handlePointer = function (event) {\n var _this = this;\n var _a = this, lastPick = _a.lastPick, hoverRect = _a.hoverRect;\n var offsetX = event.offsetX, offsetY = event.offsetY;\n var disablePointer = function (highlightOnly) {\n if (highlightOnly === void 0) { highlightOnly = false; }\n if (lastPick) {\n // Cursor moved from a non-marker node to empty space.\n _this.disablePointer(highlightOnly);\n }\n };\n if (!(hoverRect === null || hoverRect === void 0 ? void 0 : hoverRect.containsPoint(offsetX, offsetY))) {\n disablePointer();\n return;\n }\n // Handle node highlighting and tooltip toggling when pointer within `tooltip.range`\n this.handlePointerTooltip(event, disablePointer);\n // Handle node highlighting and mouse cursor when pointer withing `series[].nodeClickRange`\n this.handlePointerNode(event);\n };\n Chart.prototype.handlePointerTooltip = function (event, disablePointer) {\n var _a, _b;\n var _c = this, lastPick = _c.lastPick, tooltip = _c.tooltip;\n var range = tooltip.range;\n var pageX = event.pageX, pageY = event.pageY, offsetX = event.offsetX, offsetY = event.offsetY;\n var pixelRange;\n if (typeof range === 'number' && Number.isFinite(range)) {\n pixelRange = range;\n }\n var pick = this.pickSeriesNode({ x: offsetX, y: offsetY }, range === 'exact', pixelRange);\n if (!pick) {\n this.tooltipManager.updateTooltip(this.id);\n if (this.highlight.range === 'tooltip')\n disablePointer(true);\n return;\n }\n var isNewDatum = this.highlight.range === 'node' || !lastPick || lastPick.datum !== pick.datum;\n var html;\n if (isNewDatum) {\n html = pick.series.getTooltipHtml(pick.datum);\n if (this.highlight.range === 'tooltip') {\n this.highlightManager.updateHighlight(this.id, pick.datum);\n }\n }\n else if (lastPick) {\n lastPick.event = event.sourceEvent;\n }\n var isPixelRange = pixelRange != null;\n var tooltipEnabled = this.tooltip.enabled && pick.series.tooltip.enabled;\n var exactlyMatched = range === 'exact' && pick.distance === 0;\n var rangeMatched = range === 'nearest' || isPixelRange || exactlyMatched;\n var shouldUpdateTooltip = tooltipEnabled && rangeMatched && (!isNewDatum || html !== undefined);\n var position = {\n xOffset: pick.datum.series.tooltip.position.xOffset,\n yOffset: pick.datum.series.tooltip.position.yOffset,\n };\n var meta = this.mergePointerDatum({ pageX: pageX, pageY: pageY, offsetX: offsetX, offsetY: offsetY, event: event, showArrow: pick.series.tooltip.showArrow, position: position }, pick.datum);\n meta.enableInteraction = (_b = (_a = pick.series.tooltip.interaction) === null || _a === void 0 ? void 0 : _a.enabled) !== null && _b !== void 0 ? _b : false;\n if (shouldUpdateTooltip) {\n this.tooltipManager.updateTooltip(this.id, meta, html);\n }\n };\n Chart.prototype.handlePointerNode = function (event) {\n var _this = this;\n var found = this.checkSeriesNodeRange(event, function (series, datum) {\n if (series.hasEventListener('nodeClick') || series.hasEventListener('nodeDoubleClick')) {\n _this.cursorManager.updateCursor('chart', 'pointer');\n }\n if (_this.highlight.range === 'node') {\n _this.highlightManager.updateHighlight(_this.id, datum);\n }\n });\n if (!found) {\n this.cursorManager.updateCursor('chart');\n if (this.highlight.range === 'node') {\n this.highlightManager.updateHighlight(this.id);\n }\n }\n };\n Chart.prototype.onClick = function (event) {\n if (this.checkSeriesNodeClick(event)) {\n this.update(ChartUpdateType.SERIES_UPDATE);\n return;\n }\n this.fireEvent({\n type: 'click',\n event: event.sourceEvent,\n });\n };\n Chart.prototype.onDoubleClick = function (event) {\n if (this.checkSeriesNodeDoubleClick(event)) {\n this.update(ChartUpdateType.SERIES_UPDATE);\n return;\n }\n this.fireEvent({\n type: 'doubleClick',\n event: event.sourceEvent,\n });\n };\n Chart.prototype.checkSeriesNodeClick = function (event) {\n return this.checkSeriesNodeRange(event, function (series, datum) {\n return series.fireNodeClickEvent(event.sourceEvent, datum);\n });\n };\n Chart.prototype.checkSeriesNodeDoubleClick = function (event) {\n return this.checkSeriesNodeRange(event, function (series, datum) {\n return series.fireNodeDoubleClickEvent(event.sourceEvent, datum);\n });\n };\n Chart.prototype.checkSeriesNodeRange = function (event, callback) {\n var nearestNode = this.pickSeriesNode({ x: event.offsetX, y: event.offsetY }, false);\n var datum = nearestNode === null || nearestNode === void 0 ? void 0 : nearestNode.datum;\n var nodeClickRange = datum === null || datum === void 0 ? void 0 : datum.series.nodeClickRange;\n // First check if we should trigger the callback based on nearest node\n if (datum && nodeClickRange === 'nearest') {\n callback(datum.series, datum);\n return true;\n }\n // Then check for an exact match or within the given range\n var pixelRange;\n if (typeof nodeClickRange === 'number' && Number.isFinite(nodeClickRange)) {\n pixelRange = nodeClickRange;\n }\n var pick = this.pickSeriesNode({ x: event.offsetX, y: event.offsetY }, nodeClickRange === 'exact', pixelRange);\n if (!pick)\n return false;\n // Then if we've picked a node within the pixel range, or exactly, trigger the callback\n var isPixelRange = pixelRange != null;\n var exactlyMatched = nodeClickRange === 'exact' && pick.distance === 0;\n if (isPixelRange || exactlyMatched) {\n callback(pick.series, pick.datum);\n return true;\n }\n return false;\n };\n Chart.prototype.mergePointerDatum = function (meta, datum) {\n var type = datum.series.tooltip.position.type;\n if (type === 'node' && datum.nodeMidPoint) {\n var _a = datum.nodeMidPoint, x = _a.x, y = _a.y;\n var canvas = this.scene.canvas;\n var point = datum.series.contentGroup.inverseTransformPoint(x, y);\n var canvasRect = canvas.element.getBoundingClientRect();\n return __assign$I(__assign$I({}, meta), { pageX: Math.round(canvasRect.left + window.scrollX + point.x), pageY: Math.round(canvasRect.top + window.scrollY + point.y), offsetX: Math.round(point.x), offsetY: Math.round(point.y) });\n }\n return meta;\n };\n Chart.prototype.changeHighlightDatum = function (event) {\n var _a, _b;\n var seriesToUpdate = new Set();\n var _c = (_a = event.currentHighlight) !== null && _a !== void 0 ? _a : {}, _d = _c.series, newSeries = _d === void 0 ? undefined : _d, newDatum = _c.datum;\n var _e = (_b = event.previousHighlight) !== null && _b !== void 0 ? _b : {}, _f = _e.series, lastSeries = _f === void 0 ? undefined : _f, lastDatum = _e.datum;\n if (lastSeries) {\n seriesToUpdate.add(lastSeries);\n }\n if (newSeries) {\n seriesToUpdate.add(newSeries);\n }\n // Adjust cursor if a specific datum is highlighted, rather than just a series.\n if ((lastSeries === null || lastSeries === void 0 ? void 0 : lastSeries.cursor) && lastDatum) {\n this.cursorManager.updateCursor(lastSeries.id);\n }\n if ((newSeries === null || newSeries === void 0 ? void 0 : newSeries.cursor) && newDatum) {\n this.cursorManager.updateCursor(newSeries.id, newSeries.cursor);\n }\n this.lastPick = event.currentHighlight ? { datum: event.currentHighlight } : undefined;\n var updateAll = newSeries == null || lastSeries == null;\n if (updateAll) {\n this.update(ChartUpdateType.SERIES_UPDATE);\n }\n else {\n this.update(ChartUpdateType.SERIES_UPDATE, { seriesToUpdate: seriesToUpdate });\n }\n };\n Chart.prototype.waitForUpdate = function (timeoutMs) {\n if (timeoutMs === void 0) { timeoutMs = 5000; }\n return __awaiter$c(this, void 0, void 0, function () {\n var start;\n return __generator$c(this, function (_a) {\n switch (_a.label) {\n case 0:\n start = performance.now();\n _a.label = 1;\n case 1:\n if (!(this._pendingFactoryUpdates.length > 0 || this.updatePending)) return [3 /*break*/, 3];\n if (performance.now() - start > timeoutMs) {\n throw new Error('waitForUpdate() timeout reached.');\n }\n return [4 /*yield*/, sleep(5)];\n case 2:\n _a.sent();\n return [3 /*break*/, 1];\n case 3: return [4 /*yield*/, this.awaitUpdateCompletion()];\n case 4:\n _a.sent();\n return [2 /*return*/];\n }\n });\n });\n };\n Chart.prototype.handleOverlays = function () {\n this.handleNoDataOverlay();\n };\n Chart.prototype.handleNoDataOverlay = function () {\n var shouldDisplayNoDataOverlay = !this.series.some(function (s) { return s.hasData(); });\n var rect = this.getSeriesRect();\n if (shouldDisplayNoDataOverlay && rect) {\n this.overlays.noData.show(rect);\n }\n else {\n this.overlays.noData.hide();\n }\n };\n __decorate$1N([\n ActionOnSet({\n newValue: function (value) {\n this.scene.debug.consoleLog = value;\n if (this.animationManager) {\n this.animationManager.debug = value;\n }\n },\n })\n ], Chart.prototype, \"debug\", void 0);\n __decorate$1N([\n ActionOnSet({\n newValue: function (value) {\n if (this.destroyed)\n return;\n value.appendChild(this.element);\n },\n oldValue: function (value) {\n value.removeChild(this.element);\n },\n })\n ], Chart.prototype, \"container\", void 0);\n __decorate$1N([\n ActionOnSet({\n newValue: function (value) {\n var _a;\n (_a = this.series) === null || _a === void 0 ? void 0 : _a.forEach(function (series) { return (series.data = value); });\n },\n })\n ], Chart.prototype, \"data\", void 0);\n __decorate$1N([\n ActionOnSet({\n newValue: function (value) {\n this.resize(value);\n },\n })\n ], Chart.prototype, \"width\", void 0);\n __decorate$1N([\n ActionOnSet({\n newValue: function (value) {\n this.resize(undefined, value);\n },\n })\n ], Chart.prototype, \"height\", void 0);\n __decorate$1N([\n ActionOnSet({\n changeValue: function (value) {\n this.autoSizeChanged(value);\n },\n }),\n Validate(BOOLEAN)\n ], Chart.prototype, \"autoSize\", void 0);\n __decorate$1N([\n ActionOnSet({\n newValue: function (value) {\n var _a;\n (_a = this.scene.root) === null || _a === void 0 ? void 0 : _a.appendChild(value.node);\n },\n oldValue: function (oldValue) {\n var _a;\n (_a = this.scene.root) === null || _a === void 0 ? void 0 : _a.removeChild(oldValue.node);\n },\n })\n ], Chart.prototype, \"title\", void 0);\n __decorate$1N([\n ActionOnSet({\n newValue: function (value) {\n var _a;\n (_a = this.scene.root) === null || _a === void 0 ? void 0 : _a.appendChild(value.node);\n },\n oldValue: function (oldValue) {\n var _a;\n (_a = this.scene.root) === null || _a === void 0 ? void 0 : _a.removeChild(oldValue.node);\n },\n })\n ], Chart.prototype, \"subtitle\", void 0);\n __decorate$1N([\n ActionOnSet({\n newValue: function (value) {\n var _a;\n (_a = this.scene.root) === null || _a === void 0 ? void 0 : _a.appendChild(value.node);\n },\n oldValue: function (oldValue) {\n var _a;\n (_a = this.scene.root) === null || _a === void 0 ? void 0 : _a.removeChild(oldValue.node);\n },\n })\n ], Chart.prototype, \"footnote\", void 0);\n __decorate$1N([\n Validate(STRING_UNION('standalone', 'integrated'))\n ], Chart.prototype, \"mode\", void 0);\n return Chart;\n}(Observable));\n\nvar __read$P = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nfunction clamp(x, min, max) {\n return Math.max(min, Math.min(max, x));\n}\n/**\n * Maps a discrete domain to a continuous numeric range.\n */\nvar BandScale$5 = /** @class */ (function () {\n function BandScale() {\n this.type = 'band';\n this.cache = null;\n this.cacheProps = ['_domain', 'range', '_paddingInner', '_paddingOuter', 'round', 'interval'];\n /**\n * Maps datum to its index in the {@link domain} array.\n * Used to check for duplicate datums (not allowed).\n */\n this.index = new Map();\n /**\n * The output range values for datum at each index.\n */\n this.ordinalRange = [];\n /**\n * Contains unique datums only. Since `{}` is used in place of `Map`\n * for IE11 compatibility, the datums are converted `toString` before\n * the uniqueness check.\n */\n this._domain = [];\n this.range = [0, 1];\n this._bandwidth = 1;\n this._rawBandwidth = 1;\n /**\n * The ratio of the range that is reserved for space between bands.\n */\n this._paddingInner = 0;\n /**\n * The ratio of the range that is reserved for space before the first\n * and after the last band.\n */\n this._paddingOuter = 0;\n this.round = false;\n }\n BandScale.prototype.didChange = function () {\n var _this = this;\n var cache = this.cache;\n var didChange = !cache || this.cacheProps.some(function (p) { return _this[p] !== cache[p]; });\n if (didChange) {\n this.cache = {};\n this.cacheProps.forEach(function (p) { return (_this.cache[p] = _this[p]); });\n return true;\n }\n return false;\n };\n BandScale.prototype.refresh = function () {\n if (this.didChange()) {\n this.update();\n }\n };\n Object.defineProperty(BandScale.prototype, \"domain\", {\n get: function () {\n return this._domain;\n },\n set: function (values) {\n var domain = [];\n this.index = new Map();\n var index = this.index;\n // In case one wants to have duplicate domain values, for example, two 'Italy' categories,\n // one should use objects rather than strings for domain values like so:\n // { toString: () => 'Italy' }\n // { toString: () => 'Italy' }\n values.forEach(function (value) {\n if (index.get(value) === undefined) {\n index.set(value, domain.push(value) - 1);\n }\n });\n this._domain = domain;\n },\n enumerable: false,\n configurable: true\n });\n BandScale.prototype.ticks = function () {\n this.refresh();\n var _a = this.interval, interval = _a === void 0 ? 1 : _a;\n var step = Math.abs(Math.round(interval));\n return this._domain.filter(function (_, i) { return i % step === 0; });\n };\n BandScale.prototype.convert = function (d) {\n this.refresh();\n var i = this.index.get(d);\n if (i === undefined) {\n return NaN;\n }\n var r = this.ordinalRange[i];\n if (r === undefined) {\n return NaN;\n }\n return r;\n };\n BandScale.prototype.invert = function (position) {\n this.refresh();\n var index = this.ordinalRange.findIndex(function (p) { return p === position; });\n return this.domain[index];\n };\n Object.defineProperty(BandScale.prototype, \"bandwidth\", {\n get: function () {\n this.refresh();\n return this._bandwidth;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BandScale.prototype, \"rawBandwidth\", {\n get: function () {\n this.refresh();\n return this._rawBandwidth;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BandScale.prototype, \"padding\", {\n get: function () {\n return this._paddingInner;\n },\n set: function (value) {\n value = clamp(value, 0, 1);\n this._paddingInner = value;\n this._paddingOuter = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BandScale.prototype, \"paddingInner\", {\n get: function () {\n return this._paddingInner;\n },\n set: function (value) {\n this._paddingInner = clamp(value, 0, 1);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BandScale.prototype, \"paddingOuter\", {\n get: function () {\n return this._paddingOuter;\n },\n set: function (value) {\n this._paddingOuter = clamp(value, 0, 1);\n },\n enumerable: false,\n configurable: true\n });\n BandScale.prototype.update = function () {\n var count = this._domain.length;\n if (count === 0) {\n return;\n }\n var round = this.round;\n var paddingInner = this._paddingInner;\n var paddingOuter = this._paddingOuter;\n var _a = __read$P(this.range, 2), r0 = _a[0], r1 = _a[1];\n var width = r1 - r0;\n var rawStep = width / Math.max(1, count + 2 * paddingOuter - paddingInner);\n var step = round ? Math.floor(rawStep) : rawStep;\n var fullBandWidth = step * (count - paddingInner);\n var x0 = r0 + (width - fullBandWidth) / 2;\n var start = round ? Math.round(x0) : x0;\n var bw = step * (1 - paddingInner);\n var bandwidth = round ? Math.round(bw) : bw;\n var rawBandwidth = rawStep * (1 - paddingInner);\n var values = [];\n for (var i = 0; i < count; i++) {\n values.push(start + step * i);\n }\n this._bandwidth = bandwidth;\n this._rawBandwidth = rawBandwidth;\n this.ordinalRange = values;\n };\n return BandScale;\n}());\n\nvar __extends$2r = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$1M = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar Line = /** @class */ (function (_super) {\n __extends$2r(Line, _super);\n function Line() {\n var _this = _super.call(this) || this;\n _this.x1 = 0;\n _this.y1 = 0;\n _this.x2 = 0;\n _this.y2 = 0;\n _this.restoreOwnStyles();\n return _this;\n }\n Line.prototype.computeBBox = function () {\n return new BBox(this.x1, this.y1, this.x2 - this.x1, this.y2 - this.y1);\n };\n Line.prototype.isPointInPath = function (_x, _y) {\n return false;\n };\n Line.prototype.render = function (renderCtx) {\n var _a;\n var ctx = renderCtx.ctx, forceRender = renderCtx.forceRender, stats = renderCtx.stats;\n if (this.dirty === RedrawType.NONE && !forceRender) {\n if (stats)\n stats.nodesSkipped += this.nodeCount.count;\n return;\n }\n this.computeTransformMatrix();\n this.matrix.toContext(ctx);\n var x1 = this.x1;\n var y1 = this.y1;\n var x2 = this.x2;\n var y2 = this.y2;\n // Align to the pixel grid if the line is strictly vertical\n // or horizontal (but not both, i.e. a dot).\n if (x1 === x2) {\n var x = Math.round(x1) + (Math.floor(this.strokeWidth) % 2) / 2;\n x1 = x;\n x2 = x;\n }\n else if (y1 === y2) {\n var y = Math.round(y1) + (Math.floor(this.strokeWidth) % 2) / 2;\n y1 = y;\n y2 = y;\n }\n ctx.beginPath();\n ctx.moveTo(x1, y1);\n ctx.lineTo(x2, y2);\n this.fillStroke(ctx);\n (_a = this.fillShadow) === null || _a === void 0 ? void 0 : _a.markClean();\n _super.prototype.render.call(this, renderCtx);\n };\n Line.className = 'Line';\n Line.defaultStyles = Object.assign({}, Shape.defaultStyles, {\n fill: undefined,\n strokeWidth: 1,\n });\n __decorate$1M([\n SceneChangeDetection({ redraw: RedrawType.MAJOR })\n ], Line.prototype, \"x1\", void 0);\n __decorate$1M([\n SceneChangeDetection({ redraw: RedrawType.MAJOR })\n ], Line.prototype, \"y1\", void 0);\n __decorate$1M([\n SceneChangeDetection({ redraw: RedrawType.MAJOR })\n ], Line.prototype, \"x2\", void 0);\n __decorate$1M([\n SceneChangeDetection({ redraw: RedrawType.MAJOR })\n ], Line.prototype, \"y2\", void 0);\n return Line;\n}(Shape));\n\nvar __decorate$1L = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar Caption = /** @class */ (function () {\n function Caption() {\n this.node = new Text();\n this.enabled = false;\n this.text = undefined;\n this.fontSize = 10;\n this.fontFamily = 'sans-serif';\n this.spacing = Caption.PADDING;\n this.lineHeight = undefined;\n this.maxWidth = undefined;\n this.maxHeight = undefined;\n this.wrapping = 'always';\n var node = this.node;\n node.textAlign = 'center';\n node.pointerEvents = PointerEvents.None;\n }\n Caption.prototype.computeTextWrap = function (containerWidth, containerHeight) {\n var _a, _b;\n var _c = this, text = _c.text, wrapping = _c.wrapping;\n var maxWidth = Math.min((_a = this.maxWidth) !== null && _a !== void 0 ? _a : Infinity, containerWidth);\n var maxHeight = (_b = this.maxHeight) !== null && _b !== void 0 ? _b : containerHeight;\n if (!isFinite(maxWidth) && !isFinite(maxHeight)) {\n this.node.text = text;\n return;\n }\n var wrapped = Text.wrap(text !== null && text !== void 0 ? text : '', maxWidth, maxHeight, this, wrapping);\n this.node.text = wrapped;\n };\n Caption.PADDING = 10;\n __decorate$1L([\n Validate(BOOLEAN)\n ], Caption.prototype, \"enabled\", void 0);\n __decorate$1L([\n Validate(OPT_STRING),\n ProxyPropertyOnWrite('node')\n ], Caption.prototype, \"text\", void 0);\n __decorate$1L([\n Validate(OPT_FONT_STYLE),\n ProxyPropertyOnWrite('node')\n ], Caption.prototype, \"fontStyle\", void 0);\n __decorate$1L([\n Validate(OPT_FONT_WEIGHT),\n ProxyPropertyOnWrite('node')\n ], Caption.prototype, \"fontWeight\", void 0);\n __decorate$1L([\n Validate(NUMBER(0)),\n ProxyPropertyOnWrite('node')\n ], Caption.prototype, \"fontSize\", void 0);\n __decorate$1L([\n Validate(STRING),\n ProxyPropertyOnWrite('node')\n ], Caption.prototype, \"fontFamily\", void 0);\n __decorate$1L([\n Validate(OPT_COLOR_STRING),\n ProxyPropertyOnWrite('node', 'fill')\n ], Caption.prototype, \"color\", void 0);\n __decorate$1L([\n Validate(OPT_NUMBER(0))\n ], Caption.prototype, \"spacing\", void 0);\n __decorate$1L([\n Validate(OPT_NUMBER(0))\n ], Caption.prototype, \"lineHeight\", void 0);\n __decorate$1L([\n Validate(OPT_NUMBER(0))\n ], Caption.prototype, \"maxWidth\", void 0);\n __decorate$1L([\n Validate(OPT_NUMBER(0))\n ], Caption.prototype, \"maxHeight\", void 0);\n __decorate$1L([\n Validate(TEXT_WRAP)\n ], Caption.prototype, \"wrapping\", void 0);\n return Caption;\n}());\n\nfunction areArrayNumbersEqual(arrA, arrB) {\n return arrA.length === arrB.length && arrA.every(function (item, i) { return Number(item) === Number(arrB[i]); });\n}\n\nvar __read$O = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar ContinuousScale = /** @class */ (function () {\n function ContinuousScale(domain, range) {\n this.domain = domain;\n this.range = range;\n this.nice = false;\n this.tickCount = ContinuousScale.defaultTickCount;\n this.minTickCount = 0;\n this.maxTickCount = Infinity;\n this.niceDomain = null;\n this.strictClampByDefault = false;\n this.cache = null;\n this.cacheProps = ['domain', 'range', 'nice', 'tickCount', 'minTickCount', 'maxTickCount'];\n }\n ContinuousScale.prototype.transform = function (x) {\n return x;\n };\n ContinuousScale.prototype.transformInvert = function (x) {\n return x;\n };\n ContinuousScale.prototype.fromDomain = function (d) {\n if (typeof d === 'number') {\n return d;\n }\n else if (d instanceof Date) {\n return d.getTime();\n }\n return NaN;\n };\n ContinuousScale.prototype.getDomain = function () {\n if (this.nice) {\n this.refresh();\n if (this.niceDomain) {\n return this.niceDomain;\n }\n }\n return this.domain;\n };\n ContinuousScale.prototype.convert = function (x, params) {\n var _this = this;\n var _a;\n if (!this.domain || this.domain.length < 2) {\n return NaN;\n }\n this.refresh();\n var strict = (_a = params === null || params === void 0 ? void 0 : params.strict) !== null && _a !== void 0 ? _a : this.strictClampByDefault;\n var domain = this.getDomain().map(function (d) { return _this.transform(d); });\n var _b = __read$O(domain, 2), d0 = _b[0], d1 = _b[1];\n var range = this.range;\n var _c = __read$O(range, 2), r0 = _c[0], r1 = _c[1];\n x = this.transform(x);\n if (x < d0) {\n return strict ? NaN : r0;\n }\n else if (x > d1) {\n return strict ? NaN : r1;\n }\n if (d0 === d1) {\n return (r0 + r1) / 2;\n }\n else if (x === d0) {\n return r0;\n }\n else if (x === d1) {\n return r1;\n }\n return (r0 + ((this.fromDomain(x) - this.fromDomain(d0)) / (this.fromDomain(d1) - this.fromDomain(d0))) * (r1 - r0));\n };\n ContinuousScale.prototype.invert = function (x) {\n var _this = this;\n this.refresh();\n var domain = this.getDomain().map(function (d) { return _this.transform(d); });\n var _a = __read$O(domain, 2), d0 = _a[0], d1 = _a[1];\n var range = this.range;\n var _b = __read$O(range, 2), r0 = _b[0], r1 = _b[1];\n var isReversed = r0 > r1;\n var rMin = isReversed ? r1 : r0;\n var rMax = isReversed ? r0 : r1;\n var d;\n if (x < rMin) {\n return isReversed ? d1 : d0;\n }\n else if (x > rMax) {\n return isReversed ? d0 : d1;\n }\n else if (r0 === r1) {\n d = this.toDomain((this.fromDomain(d0) + this.fromDomain(d1)) / 2);\n }\n else {\n d = this.toDomain(this.fromDomain(d0) + ((x - r0) / (r1 - r0)) * (this.fromDomain(d1) - this.fromDomain(d0)));\n }\n return this.transformInvert(d);\n };\n ContinuousScale.prototype.didChange = function () {\n var _this = this;\n var cache = this.cache;\n var didChange = !cache || this.cacheProps.some(function (p) { return _this[p] !== cache[p]; });\n if (didChange) {\n this.cache = {};\n this.cacheProps.forEach(function (p) { return (_this.cache[p] = _this[p]); });\n return true;\n }\n return false;\n };\n ContinuousScale.prototype.refresh = function () {\n if (this.didChange()) {\n this.update();\n }\n };\n ContinuousScale.prototype.isDenseInterval = function (_a) {\n var start = _a.start, stop = _a.stop, interval = _a.interval, count = _a.count;\n var range = this.range;\n var domain = stop - start;\n var min = Math.min(range[0], range[1]);\n var max = Math.max(range[0], range[1]);\n var availableRange = max - min;\n var step = typeof interval === 'number' ? interval : 1;\n count !== null && count !== void 0 ? count : (count = domain / step);\n if (count >= availableRange) {\n Logger.warn(\"the configured tick interval results in more than 1 tick per pixel, ignoring. Supply a larger tick interval or omit this configuration.\");\n return true;\n }\n return false;\n };\n ContinuousScale.defaultTickCount = 5;\n ContinuousScale.defaultMaxTickCount = 6;\n return ContinuousScale;\n}());\n\nvar __extends$2q = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nfunction ticks (start, stop, count, minCount, maxCount) {\n if (count < 2) {\n return range(start, stop, stop - start);\n }\n var step = tickStep(start, stop, count, minCount, maxCount);\n if (isNaN(step)) {\n return new NumericTicks(0);\n }\n start = Math.ceil(start / step) * step;\n stop = Math.floor(stop / step) * step;\n return range(start, stop, step);\n}\nvar tickMultipliers = [1, 2, 5, 10];\nfunction tickStep(a, b, count, minCount, maxCount) {\n if (minCount === void 0) { minCount = 0; }\n if (maxCount === void 0) { maxCount = Infinity; }\n var rawStep = (b - a) / count;\n var power = Math.floor(Math.log10(rawStep));\n var step = Math.pow(10, power);\n var m = tickMultipliers\n .map(function (multiplier) {\n var s = multiplier * step;\n var c = Math.ceil((b - a) / s);\n var isWithinBounds = c >= minCount && c <= maxCount;\n var diffCount = Math.abs(c - count);\n return { multiplier: multiplier, isWithinBounds: isWithinBounds, diffCount: diffCount };\n })\n .sort(function (a, b) {\n if (a.isWithinBounds !== b.isWithinBounds) {\n return a.isWithinBounds ? -1 : 1;\n }\n return a.diffCount - b.diffCount;\n })[0].multiplier;\n if (!m || isNaN(m)) {\n return NaN;\n }\n return m * step;\n}\nfunction singleTickDomain(a, b) {\n var power = Math.floor(Math.log10(b - a));\n var step = Math.pow(10, power);\n return tickMultipliers\n .map(function (multiplier) {\n var s = multiplier * step;\n var start = Math.floor(a / s) * s;\n var end = Math.ceil(b / s) * s;\n var error = 1 - (b - a) / (end - start);\n var domain = [start, end];\n return { error: error, domain: domain };\n })\n .sort(function (a, b) { return a.error - b.error; })[0].domain;\n}\nvar NumericTicks = /** @class */ (function (_super) {\n __extends$2q(NumericTicks, _super);\n function NumericTicks(fractionDigits, elements) {\n var _this = _super.call(this) || this;\n if (elements) {\n for (var i = 0, n = elements.length; i < n; i++) {\n _this[i] = elements[i];\n }\n }\n _this.fractionDigits = fractionDigits;\n return _this;\n }\n return NumericTicks;\n}(Array));\nfunction range(start, stop, step) {\n var countDigits = function (expNo) {\n var _a, _b;\n var parts = expNo.split('e');\n return Math.max(((_b = (_a = parts[0].split('.')[1]) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) - Number(parts[1]), 0);\n };\n var fractionalDigits = countDigits((step % 1).toExponential());\n var f = Math.pow(10, fractionalDigits);\n var n = Math.ceil((stop - start) / step);\n var values = new NumericTicks(fractionalDigits);\n for (var i = 0; i <= n; i++) {\n var value = start + step * i;\n values.push(Math.round(value * f) / f);\n }\n return values;\n}\n\nvar CONSTANTS = {\n periods: ['AM', 'PM'],\n days: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],\n shortDays: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],\n months: [\n 'January',\n 'February',\n 'March',\n 'April',\n 'May',\n 'June',\n 'July',\n 'August',\n 'September',\n 'October',\n 'November',\n 'December',\n ],\n shortMonths: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],\n};\nfunction dayOfYear(date, startOfYear) {\n if (startOfYear === void 0) { startOfYear = new Date(date.getFullYear(), 0, 1); }\n var startOffset = date.getTimezoneOffset() - startOfYear.getTimezoneOffset();\n var timeDiff = date.getTime() - startOfYear.getTime() + startOffset * 60000;\n var timeOneDay = 3600000 * 24;\n return Math.floor(timeDiff / timeOneDay);\n}\nfunction weekOfYear(date, startDay) {\n var startOfYear = new Date(date.getFullYear(), 0, 1);\n var startOfYearDay = startOfYear.getDay();\n var firstWeekStartOffset = (startDay - startOfYearDay + 7) % 7;\n var startOffset = new Date(date.getFullYear(), 0, firstWeekStartOffset + 1);\n if (startOffset <= date) {\n return Math.floor(dayOfYear(date, startOffset) / 7) + 1;\n }\n // Days before week 1 are in week 0.\n return 0;\n}\nvar SUNDAY = 0;\nvar MONDAY = 1;\nvar THURSDAY = 4;\nfunction isoWeekOfYear(date, year) {\n if (year === void 0) { year = date.getFullYear(); }\n var firstOfYear = new Date(year, 0, 1);\n var firstOfYearDay = firstOfYear.getDay();\n var firstThursdayOffset = (THURSDAY - firstOfYearDay + 7) % 7;\n var startOffset = new Date(year, 0, firstThursdayOffset - (THURSDAY - MONDAY) + 1);\n if (startOffset <= date) {\n return Math.floor(dayOfYear(date, startOffset) / 7) + 1;\n }\n // Days before week 1 are in week 52/53 of previous year.\n return isoWeekOfYear(date, year - 1);\n}\nfunction timezone(date) {\n var offset = date.getTimezoneOffset();\n var unsignedOffset = Math.abs(offset);\n var sign = offset > 0 ? '-' : '+';\n return \"\" + sign + pad(Math.floor(unsignedOffset / 60), 2, '0') + pad(Math.floor(unsignedOffset % 60), 2, '0');\n}\nvar FORMATTERS = {\n a: function (d) { return CONSTANTS.shortDays[d.getDay()]; },\n A: function (d) { return CONSTANTS.days[d.getDay()]; },\n b: function (d) { return CONSTANTS.shortMonths[d.getMonth()]; },\n B: function (d) { return CONSTANTS.months[d.getMonth()]; },\n c: '%x, %X',\n d: function (d, p) { return pad(d.getDate(), 2, p !== null && p !== void 0 ? p : '0'); },\n e: '%_d',\n f: function (d, p) { return pad(d.getMilliseconds() * 1000, 6, p !== null && p !== void 0 ? p : '0'); },\n H: function (d, p) { return pad(d.getHours(), 2, p !== null && p !== void 0 ? p : '0'); },\n I: function (d, p) {\n var hours = d.getHours() % 12;\n return hours === 0 ? '12' : pad(hours, 2, p !== null && p !== void 0 ? p : '0');\n },\n j: function (d, p) { return pad(dayOfYear(d) + 1, 3, p !== null && p !== void 0 ? p : '0'); },\n m: function (d, p) { return pad(d.getMonth() + 1, 2, p !== null && p !== void 0 ? p : '0'); },\n M: function (d, p) { return pad(d.getMinutes(), 2, p !== null && p !== void 0 ? p : '0'); },\n L: function (d, p) { return pad(d.getMilliseconds(), 3, p !== null && p !== void 0 ? p : '0'); },\n p: function (d) { return (d.getHours() < 12 ? 'AM' : 'PM'); },\n Q: function (d) { return String(d.getTime()); },\n s: function (d) { return String(Math.floor(d.getTime() / 1000)); },\n S: function (d, p) { return pad(d.getSeconds(), 2, p !== null && p !== void 0 ? p : '0'); },\n u: function (d) {\n var day = d.getDay();\n if (day < 1)\n day += 7;\n return String(day % 7);\n },\n U: function (d, p) { return pad(weekOfYear(d, SUNDAY), 2, p !== null && p !== void 0 ? p : '0'); },\n V: function (d, p) { return pad(isoWeekOfYear(d), 2, p !== null && p !== void 0 ? p : '0'); },\n w: function (d, p) { return pad(d.getDay(), 2, p !== null && p !== void 0 ? p : '0'); },\n W: function (d, p) { return pad(weekOfYear(d, MONDAY), 2, p !== null && p !== void 0 ? p : '0'); },\n x: '%-m/%-d/%Y',\n X: '%-I:%M:%S %p',\n y: function (d, p) { return pad(d.getFullYear() % 100, 2, p !== null && p !== void 0 ? p : '0'); },\n Y: function (d, p) { return pad(d.getFullYear(), 4, p !== null && p !== void 0 ? p : '0'); },\n Z: function (d) { return timezone(d); },\n '%': function () { return '%'; },\n};\nvar PADS = {\n _: ' ',\n '0': '0',\n '-': '',\n};\nfunction pad(value, size, padChar) {\n var output = String(Math.floor(value));\n if (output.length >= size) {\n return output;\n }\n return \"\" + padChar.repeat(size - output.length) + output;\n}\nfunction buildFormatter(formatString) {\n var formatParts = [];\n while (formatString.length > 0) {\n var nextEscapeIdx = formatString.indexOf('%');\n if (nextEscapeIdx !== 0) {\n var literalPart = nextEscapeIdx > 0 ? formatString.substring(0, nextEscapeIdx) : formatString;\n formatParts.push(literalPart);\n }\n if (nextEscapeIdx < 0)\n break;\n var maybePadSpecifier = formatString[nextEscapeIdx + 1];\n var maybePad = PADS[maybePadSpecifier];\n if (maybePad != null) {\n nextEscapeIdx++;\n }\n var maybeFormatterSpecifier = formatString[nextEscapeIdx + 1];\n var maybeFormatter = FORMATTERS[maybeFormatterSpecifier];\n if (typeof maybeFormatter === 'function') {\n formatParts.push([maybeFormatter, maybePad]);\n }\n else if (typeof maybeFormatter === 'string') {\n var formatter = buildFormatter(maybeFormatter);\n formatParts.push([formatter, maybePad]);\n }\n else {\n formatParts.push(\"\" + (maybePad !== null && maybePad !== void 0 ? maybePad : '') + maybeFormatterSpecifier);\n }\n formatString = formatString.substring(nextEscapeIdx + 2);\n }\n return function (dateTime) {\n var dateTimeAsDate = typeof dateTime === 'number' ? new Date(dateTime) : dateTime;\n return formatParts.map(function (c) { return (typeof c === 'string' ? c : c[0](dateTimeAsDate, c[1])); }).join('');\n };\n}\n\nvar __extends$2p = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __values$m = (undefined && undefined.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nvar __read$N = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray$s = (undefined && undefined.__spreadArray) || function (to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\n to[j] = from[i];\n return to;\n};\nvar _a$3;\nvar DefaultTimeFormats;\n(function (DefaultTimeFormats) {\n DefaultTimeFormats[DefaultTimeFormats[\"MILLISECOND\"] = 0] = \"MILLISECOND\";\n DefaultTimeFormats[DefaultTimeFormats[\"SECOND\"] = 1] = \"SECOND\";\n DefaultTimeFormats[DefaultTimeFormats[\"MINUTE\"] = 2] = \"MINUTE\";\n DefaultTimeFormats[DefaultTimeFormats[\"HOUR\"] = 3] = \"HOUR\";\n DefaultTimeFormats[DefaultTimeFormats[\"WEEK_DAY\"] = 4] = \"WEEK_DAY\";\n DefaultTimeFormats[DefaultTimeFormats[\"SHORT_MONTH\"] = 5] = \"SHORT_MONTH\";\n DefaultTimeFormats[DefaultTimeFormats[\"MONTH\"] = 6] = \"MONTH\";\n DefaultTimeFormats[DefaultTimeFormats[\"SHORT_YEAR\"] = 7] = \"SHORT_YEAR\";\n DefaultTimeFormats[DefaultTimeFormats[\"YEAR\"] = 8] = \"YEAR\";\n})(DefaultTimeFormats || (DefaultTimeFormats = {}));\nvar formatStrings = (_a$3 = {},\n _a$3[DefaultTimeFormats.MILLISECOND] = '.%L',\n _a$3[DefaultTimeFormats.SECOND] = ':%S',\n _a$3[DefaultTimeFormats.MINUTE] = '%I:%M',\n _a$3[DefaultTimeFormats.HOUR] = '%I %p',\n _a$3[DefaultTimeFormats.WEEK_DAY] = '%a',\n _a$3[DefaultTimeFormats.SHORT_MONTH] = '%b %d',\n _a$3[DefaultTimeFormats.MONTH] = '%B',\n _a$3[DefaultTimeFormats.SHORT_YEAR] = '%y',\n _a$3[DefaultTimeFormats.YEAR] = '%Y',\n _a$3);\nfunction toNumber(x) {\n return x instanceof Date ? x.getTime() : x;\n}\nvar TimeScale$1 = /** @class */ (function (_super) {\n __extends$2p(TimeScale, _super);\n function TimeScale() {\n var _this = _super.call(this, [new Date(2022, 11, 7), new Date(2022, 11, 8)], [0, 1]) || this;\n _this.type = 'time';\n _this.cacheProps = [\n 'domain',\n 'range',\n 'nice',\n 'tickCount',\n 'interval',\n 'minTickCount',\n 'maxTickCount',\n ];\n _this.year = year;\n _this.month = month;\n _this.week = sunday;\n _this.day = day;\n _this.hour = hour;\n _this.minute = minute;\n _this.second = second;\n _this.millisecond = millisecond;\n /**\n * Array of default tick intervals in the following format:\n *\n * [\n * interval (unit of time),\n * number of units (step),\n * the length of that number of units in milliseconds\n * ]\n */\n _this.tickIntervals = [\n [_this.second, 1, durationSecond],\n [_this.second, 5, 5 * durationSecond],\n [_this.second, 15, 15 * durationSecond],\n [_this.second, 30, 30 * durationSecond],\n [_this.minute, 1, durationMinute],\n [_this.minute, 5, 5 * durationMinute],\n [_this.minute, 15, 15 * durationMinute],\n [_this.minute, 30, 30 * durationMinute],\n [_this.hour, 1, durationHour],\n [_this.hour, 3, 3 * durationHour],\n [_this.hour, 6, 6 * durationHour],\n [_this.hour, 12, 12 * durationHour],\n [_this.day, 1, durationDay],\n [_this.day, 2, 2 * durationDay],\n [_this.week, 1, durationWeek],\n [_this.week, 2, 2 * durationWeek],\n [_this.week, 3, 3 * durationWeek],\n [_this.month, 1, durationMonth],\n [_this.month, 2, 2 * durationMonth],\n [_this.month, 3, 3 * durationMonth],\n [_this.month, 4, 4 * durationMonth],\n [_this.month, 6, 6 * durationMonth],\n [_this.year, 1, durationYear],\n ];\n return _this;\n }\n TimeScale.prototype.toDomain = function (d) {\n return new Date(d);\n };\n TimeScale.prototype.calculateDefaultTickFormat = function (ticks) {\n var e_1, _a;\n if (ticks === void 0) { ticks = []; }\n var defaultTimeFormat = DefaultTimeFormats.YEAR;\n var updateFormat = function (format) {\n if (format < defaultTimeFormat) {\n defaultTimeFormat = format;\n }\n };\n try {\n for (var ticks_1 = __values$m(ticks), ticks_1_1 = ticks_1.next(); !ticks_1_1.done; ticks_1_1 = ticks_1.next()) {\n var value = ticks_1_1.value;\n var format = this.getLowestGranularityFormat(value);\n updateFormat(format);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (ticks_1_1 && !ticks_1_1.done && (_a = ticks_1.return)) _a.call(ticks_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n var firstTick = toNumber(ticks[0]);\n var lastTick = toNumber(ticks[ticks.length - 1]);\n var startYear = new Date(firstTick).getFullYear();\n var stopYear = new Date(lastTick).getFullYear();\n var yearChange = stopYear - startYear > 0;\n return this.buildFormatString(defaultTimeFormat, yearChange);\n };\n TimeScale.prototype.buildFormatString = function (defaultTimeFormat, yearChange) {\n var formatStringArray = [formatStrings[defaultTimeFormat]];\n var timeEndIndex = 0;\n var domain = this.getDomain();\n var start = Math.min.apply(Math, __spreadArray$s([], __read$N(domain.map(toNumber))));\n var stop = Math.max.apply(Math, __spreadArray$s([], __read$N(domain.map(toNumber))));\n var extent = stop - start;\n switch (defaultTimeFormat) {\n case DefaultTimeFormats.SECOND:\n if (extent / durationMinute > 1) {\n formatStringArray.push(formatStrings[DefaultTimeFormats.MINUTE]);\n }\n // fall through deliberately\n case DefaultTimeFormats.MINUTE:\n if (extent / durationHour > 1) {\n formatStringArray.push(formatStrings[DefaultTimeFormats.HOUR]);\n }\n // fall through deliberately\n case DefaultTimeFormats.HOUR:\n timeEndIndex = formatStringArray.length;\n if (extent / durationDay > 1) {\n formatStringArray.push(formatStrings[DefaultTimeFormats.WEEK_DAY]);\n }\n // fall through deliberately\n case DefaultTimeFormats.WEEK_DAY:\n if (extent / durationWeek > 1 || yearChange) {\n // if it's more than a week or there is a year change, don't show week day\n var weekDayIndex = formatStringArray.indexOf(formatStrings[DefaultTimeFormats.WEEK_DAY]);\n if (weekDayIndex > -1) {\n formatStringArray.splice(weekDayIndex, 1, formatStrings[DefaultTimeFormats.SHORT_MONTH]);\n }\n }\n // fall through deliberately\n case DefaultTimeFormats.SHORT_MONTH:\n case DefaultTimeFormats.MONTH:\n if (extent / durationYear > 1 || yearChange) {\n formatStringArray.push(formatStrings[DefaultTimeFormats.YEAR]);\n }\n }\n if (timeEndIndex < formatStringArray.length) {\n // Insert a gap between all date components.\n formatStringArray = __spreadArray$s(__spreadArray$s([], __read$N(formatStringArray.slice(0, timeEndIndex))), [\n formatStringArray.slice(timeEndIndex).join(' '),\n ]);\n }\n if (timeEndIndex > 0) {\n // Reverse order of time components, since they should be displayed in descending\n // granularity.\n formatStringArray = __spreadArray$s(__spreadArray$s([], __read$N(formatStringArray.slice(0, timeEndIndex).reverse())), __read$N(formatStringArray.slice(timeEndIndex)));\n if (timeEndIndex < formatStringArray.length) {\n // Insert a gap between time and date components.\n formatStringArray.splice(timeEndIndex, 0, ' ');\n }\n }\n return formatStringArray.join('');\n };\n TimeScale.prototype.getLowestGranularityFormat = function (value) {\n if (this.second.floor(value) < value) {\n return DefaultTimeFormats.MILLISECOND;\n }\n else if (this.minute.floor(value) < value) {\n return DefaultTimeFormats.SECOND;\n }\n else if (this.hour.floor(value) < value) {\n return DefaultTimeFormats.MINUTE;\n }\n else if (this.day.floor(value) < value) {\n return DefaultTimeFormats.HOUR;\n }\n else if (this.month.floor(value) < value) {\n if (this.week.floor(value) < value) {\n return DefaultTimeFormats.WEEK_DAY;\n }\n return DefaultTimeFormats.SHORT_MONTH;\n }\n else if (this.year.floor(value) < value) {\n return DefaultTimeFormats.MONTH;\n }\n return DefaultTimeFormats.YEAR;\n };\n TimeScale.prototype.defaultTickFormat = function (ticks) {\n var formatString = this.calculateDefaultTickFormat(ticks);\n return function (date) { return buildFormatter(formatString)(date); };\n };\n /**\n * @param options Tick interval options.\n * @param options.start The start time (timestamp).\n * @param options.stop The end time (timestamp).\n * @param options.count Number of intervals between ticks.\n */\n TimeScale.prototype.getTickInterval = function (_a) {\n var _b;\n var start = _a.start, stop = _a.stop, count = _a.count, minCount = _a.minCount, maxCount = _a.maxCount;\n var tickIntervals = this.tickIntervals;\n var countableTimeInterval;\n var step;\n var tickCount = count !== null && count !== void 0 ? count : ContinuousScale.defaultTickCount;\n var target = Math.abs(stop - start) / Math.max(tickCount, 1);\n var i = 0;\n while (i < tickIntervals.length && target > tickIntervals[i][2]) {\n i++;\n }\n if (i === 0) {\n step = Math.max(tickStep(start, stop, tickCount, minCount, maxCount), 1);\n countableTimeInterval = this.millisecond;\n }\n else if (i === tickIntervals.length) {\n var y0 = start / durationYear;\n var y1 = stop / durationYear;\n step = tickStep(y0, y1, tickCount, minCount, maxCount);\n countableTimeInterval = this.year;\n }\n else {\n var diff0 = target - tickIntervals[i - 1][2];\n var diff1 = tickIntervals[i][2] - target;\n var index = diff0 < diff1 ? i - 1 : i;\n _b = __read$N(tickIntervals[index], 2), countableTimeInterval = _b[0], step = _b[1];\n }\n return countableTimeInterval.every(step);\n };\n TimeScale.prototype.invert = function (y) {\n return new Date(_super.prototype.invert.call(this, y));\n };\n /**\n * Returns uniformly-spaced dates that represent the scale's domain.\n */\n TimeScale.prototype.ticks = function () {\n if (!this.domain || this.domain.length < 2) {\n return [];\n }\n this.refresh();\n var _a = __read$N(this.getDomain().map(toNumber), 2), t0 = _a[0], t1 = _a[1];\n if (this.interval !== undefined) {\n return this.getTicksForInterval({ start: t0, stop: t1 });\n }\n if (this.nice) {\n var tickCount = this.tickCount;\n if (tickCount === 2) {\n return this.niceDomain;\n }\n if (tickCount === 1) {\n return this.niceDomain.slice(0, 1);\n }\n }\n return this.getDefaultTicks({ start: t0, stop: t1 });\n };\n TimeScale.prototype.getDefaultTicks = function (_a) {\n var start = _a.start, stop = _a.stop;\n var t = this.getTickInterval({\n start: start,\n stop: stop,\n count: this.tickCount,\n minCount: this.minTickCount,\n maxCount: this.maxTickCount,\n });\n return t ? t.range(new Date(start), new Date(stop)) : []; // inclusive stop\n };\n TimeScale.prototype.getTicksForInterval = function (_a) {\n var start = _a.start, stop = _a.stop;\n var _b = this, interval = _b.interval, tickIntervals = _b.tickIntervals;\n if (!interval) {\n return [];\n }\n if (interval instanceof TimeInterval) {\n var ticks_2 = interval.range(new Date(start), new Date(stop));\n if (this.isDenseInterval({ start: start, stop: stop, interval: interval, count: ticks_2.length })) {\n return this.getDefaultTicks({ start: start, stop: stop });\n }\n return ticks_2;\n }\n var absInterval = Math.abs(interval);\n if (this.isDenseInterval({ start: start, stop: stop, interval: absInterval })) {\n return this.getDefaultTicks({ start: start, stop: stop });\n }\n var reversedInterval = __spreadArray$s([], __read$N(tickIntervals));\n reversedInterval.reverse();\n var timeInterval = reversedInterval.find(function (tickInterval) { return absInterval % tickInterval[2] === 0; });\n if (timeInterval) {\n var i = timeInterval[0].every(absInterval / (timeInterval[2] / timeInterval[1]));\n return i.range(new Date(start), new Date(stop));\n }\n var date = new Date(start);\n var stopDate = new Date(stop);\n var ticks = [];\n while (date <= stopDate) {\n ticks.push(date);\n date = new Date(date);\n date.setMilliseconds(date.getMilliseconds() + absInterval);\n }\n return ticks;\n };\n /**\n * Returns a time format function suitable for displaying tick values.\n * @param specifier If the specifier string is provided, this method is equivalent to\n * the {@link TimeLocaleObject.format} method.\n * If no specifier is provided, this method returns the default time format function.\n */\n TimeScale.prototype.tickFormat = function (_a) {\n var ticks = _a.ticks, specifier = _a.specifier;\n return specifier == undefined ? this.defaultTickFormat(ticks) : buildFormatter(specifier);\n };\n TimeScale.prototype.update = function () {\n if (!this.domain || this.domain.length < 2) {\n return;\n }\n if (this.nice) {\n this.updateNiceDomain();\n }\n };\n /**\n * Extends the domain so that it starts and ends on nice round values.\n * This method typically modifies the scale’s domain, and may only extend the bounds to the nearest round value.\n */\n TimeScale.prototype.updateNiceDomain = function () {\n var maxAttempts = 4;\n var _a = __read$N(this.domain, 2), d0 = _a[0], d1 = _a[1];\n for (var i = 0; i < maxAttempts; i++) {\n this.updateNiceDomainIteration(d0, d1);\n var _b = __read$N(this.niceDomain, 2), n0 = _b[0], n1 = _b[1];\n if (toNumber(d0) === toNumber(n0) && toNumber(d1) === toNumber(n1)) {\n break;\n }\n d0 = n0;\n d1 = n1;\n }\n };\n TimeScale.prototype.updateNiceDomainIteration = function (d0, d1) {\n var start = toNumber(d0);\n var stop = toNumber(d1);\n var interval = this.interval;\n var i;\n if (interval instanceof TimeInterval) {\n i = interval;\n }\n else {\n var tickCount = typeof interval === 'number' ? (stop - start) / Math.max(interval, 1) : this.tickCount;\n i = this.getTickInterval({\n start: start,\n stop: stop,\n count: tickCount,\n minCount: this.minTickCount,\n maxCount: this.maxTickCount,\n });\n }\n if (i) {\n var intervalRange = i.range(d0, d1, true);\n var n0 = intervalRange[0];\n var n1 = intervalRange[intervalRange.length - 1];\n this.niceDomain = [n0, n1];\n }\n };\n return TimeScale;\n}(ContinuousScale));\n\nvar __read$M = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray$r = (undefined && undefined.__spreadArray) || function (to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\n to[j] = from[i];\n return to;\n};\nvar _a$2;\nvar group = function (content) { return \"(\" + content + \")\"; };\nvar optionalGroup = function (content) { return group(content) + \"?\"; };\nvar nonCapturingGroup = function (content) { return optionalGroup(\"?:\" + content); };\nvar formatRegEx = (function () {\n var fill = '.';\n var align = '[<>=^]';\n var sign = '[+\\\\-( ]';\n var symbol = '[$€£¥₣₹#]';\n var zero = '0';\n var width = '\\\\d+';\n var comma = ',';\n var precision = '\\\\d+';\n var tilde = '~';\n var type = '[%a-z]';\n return new RegExp([\n '^',\n nonCapturingGroup(\"\" + optionalGroup(fill) + group(align)),\n optionalGroup(sign),\n optionalGroup(symbol),\n optionalGroup(zero),\n optionalGroup(width),\n optionalGroup(comma),\n nonCapturingGroup(\"\\\\.\" + group(precision)),\n optionalGroup(tilde),\n optionalGroup(type),\n '$',\n ].join(''), 'i');\n})();\nvar surroundedRegEx = (function () {\n var prefix = '.*?';\n var content = '.+?';\n var suffix = '.*?';\n return new RegExp(['^', group(prefix), \"#\\\\{\" + group(content) + \"\\\\}\", group(suffix), '$'].join(''));\n})();\nfunction parseFormatter(formatter) {\n var _a;\n var prefix;\n var suffix;\n var surrounded = surroundedRegEx.exec(formatter);\n if (surrounded) {\n _a = __read$M(surrounded, 4), prefix = _a[1], formatter = _a[2], suffix = _a[3];\n }\n var match = formatRegEx.exec(formatter);\n if (!match) {\n throw new Error(\"The number formatter is invalid: \" + formatter);\n }\n var _b = __read$M(match, 11), fill = _b[1], align = _b[2], sign = _b[3], symbol = _b[4], zero = _b[5], width = _b[6], comma = _b[7], precision = _b[8], trim = _b[9], type = _b[10];\n return {\n fill: fill,\n align: align,\n sign: sign,\n symbol: symbol,\n zero: zero,\n width: parseInt(width),\n comma: comma,\n precision: parseInt(precision),\n trim: Boolean(trim),\n type: type,\n prefix: prefix,\n suffix: suffix,\n };\n}\nfunction format(formatter) {\n var options = typeof formatter === 'string' ? parseFormatter(formatter) : formatter;\n var fill = options.fill, align = options.align, _a = options.sign, sign = _a === void 0 ? '-' : _a, symbol = options.symbol, zero = options.zero, width = options.width, comma = options.comma, type = options.type, _b = options.prefix, prefix = _b === void 0 ? '' : _b, _c = options.suffix, suffix = _c === void 0 ? '' : _c, precision = options.precision;\n var trim = options.trim;\n var precisionIsNaN = precision === undefined || isNaN(precision);\n var formatBody;\n if (!type) {\n formatBody = decimalTypes['g'];\n trim = true;\n }\n else if (type in decimalTypes && type in integerTypes) {\n formatBody = precisionIsNaN ? integerTypes[type] : decimalTypes[type];\n }\n else if (type in decimalTypes) {\n formatBody = decimalTypes[type];\n }\n else if (type in integerTypes) {\n formatBody = integerTypes[type];\n }\n else {\n throw new Error(\"The number formatter type is invalid: \" + type);\n }\n var formatterPrecision;\n if (precision == null || precisionIsNaN) {\n formatterPrecision = type ? 6 : 12;\n }\n else {\n formatterPrecision = precision;\n }\n return function (n) {\n var result = formatBody(n, formatterPrecision);\n if (trim) {\n result = removeTrailingZeros(result);\n }\n if (comma) {\n result = insertSeparator(result, comma);\n }\n result = addSign(n, result, sign);\n if (symbol && symbol !== '#') {\n result = \"\" + symbol + result;\n }\n if (symbol === '#' && type === 'x') {\n result = \"0x\" + result;\n }\n if (type === 's') {\n result = \"\" + result + getSIPrefix(n);\n }\n if (type === '%' || type === 'p') {\n result = result + \"%\";\n }\n if (width != null && !isNaN(width)) {\n result = addPadding(result, width, fill !== null && fill !== void 0 ? fill : zero, align);\n }\n result = \"\" + prefix + result + suffix;\n return result;\n };\n}\nvar absFloor = function (n) { return Math.floor(Math.abs(n)); };\nvar integerTypes = {\n b: function (n) { return absFloor(n).toString(2); },\n c: function (n) { return String.fromCharCode(n); },\n d: function (n) { return Math.round(Math.abs(n)).toFixed(0); },\n o: function (n) { return absFloor(n).toString(8); },\n x: function (n) { return absFloor(n).toString(16); },\n X: function (n) { return integerTypes.x(n).toUpperCase(); },\n n: function (n) { return integerTypes.d(n); },\n '%': function (n) { return \"\" + absFloor(n * 100).toFixed(0); },\n};\nvar decimalTypes = {\n e: function (n, f) { return Math.abs(n).toExponential(f); },\n E: function (n, f) { return decimalTypes.e(n, f).toUpperCase(); },\n f: function (n, f) { return Math.abs(n).toFixed(f); },\n F: function (n, f) { return decimalTypes.f(n, f).toUpperCase(); },\n g: function (n, f) {\n if (n === 0) {\n return '0';\n }\n var a = Math.abs(n);\n var p = Math.floor(Math.log10(a));\n if (p >= -4 && p < f) {\n return a.toFixed(f - 1 - p);\n }\n return a.toExponential(f - 1);\n },\n G: function (n, f) { return decimalTypes.g(n, f).toUpperCase(); },\n n: function (n, f) { return decimalTypes.g(n, f); },\n p: function (n, f) { return decimalTypes.r(n * 100, f); },\n r: function (n, f) {\n if (n === 0) {\n return '0';\n }\n var a = Math.abs(n);\n var p = Math.floor(Math.log10(a));\n var q = p - (f - 1);\n if (q <= 0) {\n return a.toFixed(-q);\n }\n var x = Math.pow(10, q);\n return (Math.round(a / x) * x).toFixed();\n },\n s: function (n, f) {\n var p = getSIPrefixPower(n);\n return decimalTypes.r(n / Math.pow(10, p), f);\n },\n '%': function (n, f) { return decimalTypes.f(n * 100, f); },\n};\nfunction removeTrailingZeros(numString) {\n return numString.replace(/\\.0+$/, '').replace(/(\\.[1-9])0+$/, '$1');\n}\nfunction insertSeparator(numString, separator) {\n var dotIndex = numString.indexOf('.');\n if (dotIndex < 0) {\n dotIndex = numString.length;\n }\n var integerChars = numString.substring(0, dotIndex).split('');\n var fractionalPart = numString.substring(dotIndex);\n for (var i = integerChars.length - 3; i > 0; i -= 3) {\n integerChars.splice(i, 0, separator);\n }\n return \"\" + integerChars.join('') + fractionalPart;\n}\nfunction getSIPrefix(n) {\n return siPrefixes[getSIPrefixPower(n)];\n}\nfunction getSIPrefixPower(n) {\n var power = Math.log10(Math.abs(n));\n var p = Math.floor(power / 3) * 3;\n return Math.max(minSIPrefix, Math.min(maxSIPrefix, p));\n}\nvar minSIPrefix = -24;\nvar maxSIPrefix = 24;\nvar siPrefixes = (_a$2 = {},\n _a$2[minSIPrefix] = 'y',\n _a$2[-21] = 'z',\n _a$2[-18] = 'a',\n _a$2[-15] = 'f',\n _a$2[-12] = 'p',\n _a$2[-9] = 'n',\n _a$2[-6] = 'µ',\n _a$2[-3] = 'm',\n _a$2[0] = '',\n _a$2[3] = 'k',\n _a$2[6] = 'M',\n _a$2[9] = 'G',\n _a$2[12] = 'T',\n _a$2[15] = 'P',\n _a$2[18] = 'E',\n _a$2[21] = 'Z',\n _a$2[maxSIPrefix] = 'Y',\n _a$2);\nvar minusSign = '\\u2212';\nfunction addSign(num, numString, signType) {\n if (signType === void 0) { signType = ''; }\n if (signType === '(') {\n return num >= 0 ? numString : \"(\" + numString + \")\";\n }\n var plusSign = signType === '+' ? '+' : '';\n return \"\" + (num >= 0 ? plusSign : minusSign) + numString;\n}\nfunction addPadding(numString, width, fill, align) {\n if (fill === void 0) { fill = ' '; }\n if (align === void 0) { align = '>'; }\n var result = numString;\n if (align === '>' || !align) {\n result = result.padStart(width, fill);\n }\n else if (align === '<') {\n result = result.padEnd(width, fill);\n }\n else if (align === '^') {\n var padWidth = Math.max(0, width - result.length);\n var padLeft = Math.ceil(padWidth / 2);\n var padRight = Math.floor(padWidth / 2);\n result = result.padStart(padLeft + result.length, fill);\n result = result.padEnd(padRight + result.length, fill);\n }\n return result;\n}\nfunction tickFormat(ticks, formatter) {\n var options = parseFormatter(formatter !== null && formatter !== void 0 ? formatter : ',f');\n var precision = options.precision;\n if (precision == null || isNaN(precision)) {\n if (options.type === 'f' || options.type === '%') {\n options.precision = Math.max.apply(Math, __spreadArray$r([], __read$M(ticks.map(function (x) {\n if (typeof x !== 'number' || x === 0) {\n return 0;\n }\n var l = Math.floor(Math.log10(Math.abs(x)));\n var digits = options.type ? 6 : 12;\n var exp = x.toExponential(digits - 1).replace(/\\.?0+e/, 'e');\n var dotIndex = exp.indexOf('.');\n if (dotIndex < 0) {\n return l >= 0 ? 0 : -l;\n }\n var s = exp.indexOf('e') - dotIndex;\n return Math.max(0, s - l - 1);\n }))));\n }\n else if (!options.type || options.type in decimalTypes) {\n options.precision = Math.max.apply(Math, __spreadArray$r([], __read$M(ticks.map(function (x) {\n if (typeof x !== 'number') {\n return 0;\n }\n var exp = x.toExponential((options.type ? 6 : 12) - 1).replace(/\\.?0+e/, 'e');\n return exp.substring(0, exp.indexOf('e')).replace('.', '').length;\n }))));\n }\n }\n var f = format(options);\n return function (n) { return f(Number(n)); };\n}\n\nvar __extends$2o = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$1K = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __read$L = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray$q = (undefined && undefined.__spreadArray) || function (to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\n to[j] = from[i];\n return to;\n};\nvar identity = function (x) { return x; };\nvar LogScale = /** @class */ (function (_super) {\n __extends$2o(LogScale, _super);\n function LogScale() {\n var _this = _super.call(this, [1, 10], [0, 1]) || this;\n _this.type = 'log';\n _this.base = 10;\n _this.cacheProps = ['domain', 'range', 'nice', 'tickCount', 'base'];\n _this.baseLog = identity;\n _this.basePow = identity;\n _this.log = function (x) {\n return _this.domain[0] >= 0 ? _this.baseLog(x) : -_this.baseLog(-x);\n };\n _this.pow = function (x) {\n return _this.domain[0] >= 0 ? _this.basePow(x) : -_this.basePow(-x);\n };\n return _this;\n }\n LogScale.prototype.toDomain = function (d) {\n return d;\n };\n LogScale.prototype.transform = function (x) {\n return this.domain[0] >= 0 ? Math.log(x) : -Math.log(-x);\n };\n LogScale.prototype.transformInvert = function (x) {\n return this.domain[0] >= 0 ? Math.exp(x) : -Math.exp(-x);\n };\n LogScale.prototype.update = function () {\n if (!this.domain || this.domain.length < 2) {\n return;\n }\n this.updateLogFn();\n this.updatePowFn();\n if (this.nice) {\n this.updateNiceDomain();\n }\n };\n LogScale.prototype.updateLogFn = function () {\n var base = this.base;\n var log;\n if (base === 10) {\n log = Math.log10;\n }\n else if (base === Math.E) {\n log = Math.log;\n }\n else if (base === 2) {\n log = Math.log2;\n }\n else {\n var logBase_1 = Math.log(base);\n log = function (x) { return Math.log(x) / logBase_1; };\n }\n this.baseLog = log;\n };\n LogScale.prototype.updatePowFn = function () {\n var base = this.base;\n var pow;\n if (base === 10) {\n pow = LogScale.pow10;\n }\n else if (base === Math.E) {\n pow = Math.exp;\n }\n else {\n pow = function (x) { return Math.pow(base, x); };\n }\n this.basePow = pow;\n };\n LogScale.prototype.updateNiceDomain = function () {\n var _a = __read$L(this.domain, 2), d0 = _a[0], d1 = _a[1];\n var n0 = this.pow(Math.floor(this.log(d0)));\n var n1 = this.pow(Math.ceil(this.log(d1)));\n this.niceDomain = [n0, n1];\n };\n LogScale.pow10 = function (x) {\n return x >= 0 ? Math.pow(10, x) : 1 / Math.pow(10, -x);\n };\n LogScale.prototype.ticks = function () {\n var _this = this;\n var _a;\n var count = (_a = this.tickCount) !== null && _a !== void 0 ? _a : 10;\n if (!this.domain || this.domain.length < 2 || count < 1) {\n return [];\n }\n this.refresh();\n var base = this.base;\n var _b = __read$L(this.getDomain(), 2), d0 = _b[0], d1 = _b[1];\n var p0 = this.log(d0);\n var p1 = this.log(d1);\n if (this.interval) {\n var step = Math.abs(this.interval);\n var absDiff = Math.abs(p1 - p0);\n var ticks_1 = range(p0, p1, Math.min(absDiff, step))\n .map(function (x) { return _this.pow(x); })\n .filter(function (t) { return t >= d0 && t <= d1; });\n if (!this.isDenseInterval({ start: d0, stop: d1, interval: step, count: ticks_1.length })) {\n return ticks_1;\n }\n }\n var isBaseInteger = base % 1 === 0;\n var isDiffLarge = p1 - p0 >= count;\n if (!isBaseInteger || isDiffLarge) {\n // Returns [10^1, 10^2, 10^3, 10^4, ...]\n return ticks(p0, p1, Math.min(p1 - p0, count)).map(function (x) { return _this.pow(x); });\n }\n var ticks$1 = [];\n var isPositive = d0 > 0;\n p0 = Math.floor(p0) - 1;\n p1 = Math.round(p1) + 1;\n var min = Math.min.apply(Math, __spreadArray$q([], __read$L(this.range)));\n var max = Math.max.apply(Math, __spreadArray$q([], __read$L(this.range)));\n var availableSpacing = (max - min) / count;\n var lastTickPosition = Infinity;\n for (var p = p0; p <= p1; p++) {\n var nextMagnitudeTickPosition = this.convert(this.pow(p + 1));\n for (var k = 1; k < base; k++) {\n var q = isPositive ? k : base - k + 1;\n var t = this.pow(p) * q;\n var tickPosition = this.convert(t);\n var prevSpacing = Math.abs(lastTickPosition - tickPosition);\n var nextSpacing = Math.abs(tickPosition - nextMagnitudeTickPosition);\n var fits = prevSpacing >= availableSpacing && nextSpacing >= availableSpacing;\n if (t >= d0 && t <= d1 && (k === 1 || fits)) {\n ticks$1.push(t);\n lastTickPosition = tickPosition;\n }\n }\n }\n return ticks$1;\n };\n LogScale.prototype.tickFormat = function (_a) {\n var count = _a.count, ticks = _a.ticks, specifier = _a.specifier;\n var base = this.base;\n if (specifier == null) {\n specifier = base === 10 ? '.0e' : ',';\n }\n if (typeof specifier === 'string') {\n specifier = format(specifier);\n }\n if (count === Infinity) {\n return specifier;\n }\n if (ticks == null) {\n this.ticks();\n }\n return function (d) {\n return specifier(d);\n };\n };\n __decorate$1K([\n Validate(NUMBER(0))\n ], LogScale.prototype, \"base\", void 0);\n return LogScale;\n}(ContinuousScale));\n\nfunction extent$4(values) {\n var length = values.length;\n if (length === 0) {\n return undefined;\n }\n var min = Infinity;\n var max = -Infinity;\n for (var i = 0; i < length; i++) {\n var v = values[i];\n if (v instanceof Date) {\n v = v.getTime();\n }\n if (typeof v !== 'number') {\n continue;\n }\n if (v < min) {\n min = v;\n }\n if (v > max) {\n max = v;\n }\n }\n var extent = [min, max];\n if (extent.some(function (v) { return !isFinite(v); })) {\n return undefined;\n }\n return extent;\n}\nfunction normalisedExtent(d, min, max) {\n var _a;\n if (d.length > 2) {\n d = (_a = extent$4(d)) !== null && _a !== void 0 ? _a : [NaN, NaN];\n }\n if (!isNaN(min)) {\n d = [min, d[1]];\n }\n if (!isNaN(max)) {\n d = [d[0], max];\n }\n if (d[0] > d[1]) {\n d = [];\n }\n return d;\n}\n\nvar __decorate$1J = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar Label$1 = /** @class */ (function () {\n function Label() {\n this.enabled = true;\n this.fontSize = 12;\n this.fontFamily = 'Verdana, sans-serif';\n this.fontStyle = undefined;\n this.fontWeight = undefined;\n this.color = 'rgba(70, 70, 70, 1)';\n }\n Label.prototype.getFont = function () {\n return getFont(this);\n };\n __decorate$1J([\n Validate(BOOLEAN)\n ], Label.prototype, \"enabled\", void 0);\n __decorate$1J([\n Validate(NUMBER(0))\n ], Label.prototype, \"fontSize\", void 0);\n __decorate$1J([\n Validate(STRING)\n ], Label.prototype, \"fontFamily\", void 0);\n __decorate$1J([\n Validate(OPT_FONT_STYLE)\n ], Label.prototype, \"fontStyle\", void 0);\n __decorate$1J([\n Validate(OPT_FONT_WEIGHT)\n ], Label.prototype, \"fontWeight\", void 0);\n __decorate$1J([\n Validate(COLOR_STRING)\n ], Label.prototype, \"color\", void 0);\n return Label;\n}());\nfunction calculateLabelRotation(opts) {\n var _a = opts.parallelFlipRotation, parallelFlipRotation = _a === void 0 ? 0 : _a, _b = opts.regularFlipRotation, regularFlipRotation = _b === void 0 ? 0 : _b;\n var configuredRotation = opts.rotation ? normalizeAngle360(toRadians$1(opts.rotation)) : 0;\n var parallelFlipFlag = !configuredRotation && parallelFlipRotation >= 0 && parallelFlipRotation <= Math.PI ? -1 : 1;\n // Flip if the axis rotation angle is in the top hemisphere.\n var regularFlipFlag = !configuredRotation && regularFlipRotation >= 0 && regularFlipRotation <= Math.PI ? -1 : 1;\n var defaultRotation = 0;\n if (opts.parallel) {\n defaultRotation = (parallelFlipFlag * Math.PI) / 2;\n }\n else if (regularFlipFlag === -1) {\n defaultRotation = Math.PI;\n }\n return { configuredRotation: configuredRotation, defaultRotation: defaultRotation, parallelFlipFlag: parallelFlipFlag, regularFlipFlag: regularFlipFlag };\n}\nfunction getLabelSpacing(minSpacing, rotated) {\n if (!isNaN(minSpacing)) {\n return minSpacing;\n }\n return rotated ? 0 : 10;\n}\nfunction getTextBaseline(parallel, labelRotation, sideFlag, parallelFlipFlag) {\n if (parallel && !labelRotation) {\n if (sideFlag * parallelFlipFlag === -1) {\n return 'hanging';\n }\n else {\n return 'bottom';\n }\n }\n return 'middle';\n}\nfunction getTextAlign(parallel, labelRotation, labelAutoRotation, sideFlag, regularFlipFlag) {\n var labelRotated = labelRotation > 0 && labelRotation <= Math.PI;\n var labelAutoRotated = labelAutoRotation > 0 && labelAutoRotation <= Math.PI;\n var alignFlag = labelRotated || labelAutoRotated ? -1 : 1;\n if (parallel) {\n if (labelRotation || labelAutoRotation) {\n if (sideFlag * alignFlag === -1) {\n return 'end';\n }\n }\n else {\n return 'center';\n }\n }\n else if (sideFlag * regularFlipFlag === -1) {\n return 'end';\n }\n return 'start';\n}\nfunction calculateLabelBBox(text, bbox, labelX, labelY, labelMatrix) {\n // Text.computeBBox() does not take into account any of the transformations that have been applied to the label nodes, only the width and height are useful.\n // Rather than taking into account all transformations including those of parent nodes which would be the result of `computeTransformedBBox()`, giving the x and y in the entire axis coordinate space,\n // take into account only the rotation and translation applied to individual label nodes to get the x y coordinates of the labels relative to each other\n // this makes label collision detection a lot simpler\n var width = bbox.width, height = bbox.height;\n var translatedBBox = new BBox(labelX, labelY, 0, 0);\n labelMatrix.transformBBox(translatedBBox, bbox);\n var _a = bbox.x, x = _a === void 0 ? 0 : _a, _b = bbox.y, y = _b === void 0 ? 0 : _b;\n bbox.width = width;\n bbox.height = height;\n return {\n point: {\n x: x,\n y: y,\n size: 0,\n },\n label: {\n width: width,\n height: height,\n text: text,\n },\n };\n}\n\nfunction Default(defaultValue, replaces) {\n if (replaces === void 0) { replaces = [undefined]; }\n return addTransformToInstanceProperty(function (_, __, v) {\n if (replaces.includes(v)) {\n return defaultValue;\n }\n return v;\n });\n}\n\nvar __decorate$1I = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar AxisLabel = /** @class */ (function () {\n function AxisLabel() {\n this.enabled = true;\n /** If set to `false`, axis labels will not be wrapped on multiple lines. */\n this.autoWrap = false;\n /** Used to constrain the width of the label when `autoWrap` is `true`, if the label text width exceeds the `maxWidth`, it will be wrapped on multiple lines automatically. If `maxWidth` is omitted, a default width constraint will be applied. */\n this.maxWidth = undefined;\n /** Used to constrain the height of the multiline label, if the label text height exceeds the `maxHeight`, it will be truncated automatically. If `maxHeight` is omitted, a default height constraint will be applied. */\n this.maxHeight = undefined;\n this.fontStyle = undefined;\n this.fontWeight = undefined;\n this.fontSize = 12;\n this.fontFamily = 'Verdana, sans-serif';\n /**\n * The padding between the labels and the ticks.\n */\n this.padding = 5;\n /**\n * Minimum gap in pixels between the axis labels before being removed to avoid collisions.\n */\n this.minSpacing = NaN;\n /**\n * The color of the labels.\n * Use `undefined` rather than `rgba(0, 0, 0, 0)` to make labels invisible.\n */\n this.color = 'rgba(87, 87, 87, 1)';\n /**\n * Custom label rotation in degrees.\n * Labels are rendered perpendicular to the axis line by default.\n * Or parallel to the axis line, if the {@link parallel} is set to `true`.\n * The value of this config is used as the angular offset/deflection\n * from the default rotation.\n */\n this.rotation = undefined;\n /**\n * If specified and axis labels may collide, they are rotated to reduce collisions. If the\n * `rotation` property is specified, it takes precedence.\n */\n this.autoRotate = undefined;\n /**\n * Rotation angle to use when autoRotate is applied.\n */\n this.autoRotateAngle = 335;\n /**\n * Avoid axis label collision by automatically reducing the number of ticks displayed. If set to `false`, axis labels may collide.\n */\n this.avoidCollisions = true;\n /**\n * By default labels and ticks are positioned to the left of the axis line.\n * `true` positions the labels to the right of the axis line.\n * However, if the axis is rotated, it's easier to think in terms\n * of this side or the opposite side, rather than left and right.\n * We use the term `mirror` for conciseness, although it's not\n * true mirroring - for example, when a label is rotated, so that\n * it is inclined at the 45 degree angle, text flowing from north-west\n * to south-east, ending at the tick to the left of the axis line,\n * and then we set this config to `true`, the text will still be flowing\n * from north-west to south-east, _starting_ at the tick to the right\n * of the axis line.\n */\n this.mirrored = false;\n /**\n * Labels are rendered perpendicular to the axis line by default.\n * Setting this config to `true` makes labels render parallel to the axis line\n * and center aligns labels' text at the ticks.\n */\n this.parallel = false;\n /**\n * In case {@param value} is a number, the {@param fractionDigits} parameter will\n * be provided as well. The `fractionDigits` corresponds to the number of fraction\n * digits used by the tick step. For example, if the tick step is `0.0005`,\n * the `fractionDigits` is 4.\n */\n this.formatter = undefined;\n this.format = undefined;\n }\n /**\n * The side of the axis line to position the labels on.\n * -1 = left (default)\n * 1 = right\n */\n AxisLabel.prototype.getSideFlag = function () {\n return this.mirrored ? 1 : -1;\n };\n AxisLabel.prototype.getFont = function () {\n return getFont(this);\n };\n __decorate$1I([\n Validate(BOOLEAN)\n ], AxisLabel.prototype, \"enabled\", void 0);\n __decorate$1I([\n Validate(OPT_BOOLEAN)\n ], AxisLabel.prototype, \"autoWrap\", void 0);\n __decorate$1I([\n Validate(OPT_NUMBER(0))\n ], AxisLabel.prototype, \"maxWidth\", void 0);\n __decorate$1I([\n Validate(OPT_NUMBER(0))\n ], AxisLabel.prototype, \"maxHeight\", void 0);\n __decorate$1I([\n Validate(OPT_FONT_STYLE)\n ], AxisLabel.prototype, \"fontStyle\", void 0);\n __decorate$1I([\n Validate(OPT_FONT_WEIGHT)\n ], AxisLabel.prototype, \"fontWeight\", void 0);\n __decorate$1I([\n Validate(NUMBER(1))\n ], AxisLabel.prototype, \"fontSize\", void 0);\n __decorate$1I([\n Validate(STRING)\n ], AxisLabel.prototype, \"fontFamily\", void 0);\n __decorate$1I([\n Validate(NUMBER(0))\n ], AxisLabel.prototype, \"padding\", void 0);\n __decorate$1I([\n Validate(NUMBER_OR_NAN()),\n Default(NaN)\n ], AxisLabel.prototype, \"minSpacing\", void 0);\n __decorate$1I([\n Validate(OPT_COLOR_STRING)\n ], AxisLabel.prototype, \"color\", void 0);\n __decorate$1I([\n Validate(OPT_NUMBER(-360, 360))\n ], AxisLabel.prototype, \"rotation\", void 0);\n __decorate$1I([\n Validate(OPT_BOOLEAN)\n ], AxisLabel.prototype, \"autoRotate\", void 0);\n __decorate$1I([\n Validate(NUMBER(-360, 360))\n ], AxisLabel.prototype, \"autoRotateAngle\", void 0);\n __decorate$1I([\n Validate(BOOLEAN)\n ], AxisLabel.prototype, \"avoidCollisions\", void 0);\n __decorate$1I([\n Validate(BOOLEAN)\n ], AxisLabel.prototype, \"mirrored\", void 0);\n __decorate$1I([\n Validate(BOOLEAN)\n ], AxisLabel.prototype, \"parallel\", void 0);\n __decorate$1I([\n Validate(OPT_STRING)\n ], AxisLabel.prototype, \"format\", void 0);\n return AxisLabel;\n}());\n\nvar __decorate$1H = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar AxisLine = /** @class */ (function () {\n function AxisLine() {\n this.width = 1;\n this.color = 'rgba(195, 195, 195, 1)';\n }\n __decorate$1H([\n Validate(NUMBER(0))\n ], AxisLine.prototype, \"width\", void 0);\n __decorate$1H([\n Validate(OPT_COLOR_STRING)\n ], AxisLine.prototype, \"color\", void 0);\n return AxisLine;\n}());\n\nvar __decorate$1G = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar TICK_COUNT = predicateWithMessage(function (v, ctx) { return NUMBER(0)(v, ctx) || v instanceof TimeInterval; }, \"expecting a tick count Number value or, for a time axis, a Time Interval such as 'agCharts.time.month'\");\nvar OPT_TICK_COUNT = predicateWithMessage(function (v, ctx) { return OPTIONAL(v, ctx, TICK_COUNT); }, \"expecting an optional tick count Number value or, for a time axis, a Time Interval such as 'agCharts.time.month'\");\nvar OPT_TICK_INTERVAL = predicateWithMessage(function (v, ctx) { return OPTIONAL(v, ctx, function (v, ctx) { return (v !== 0 && NUMBER(0)(v, ctx)) || v instanceof TimeInterval; }); }, \"expecting an optional non-zero positive Number value or, for a time axis, a Time Interval such as 'agCharts.time.month'\");\nvar AxisTick = /** @class */ (function () {\n function AxisTick() {\n this.enabled = true;\n /**\n * The line width to be used by axis ticks.\n */\n this.width = 1;\n /**\n * The line length to be used by axis ticks.\n */\n this.size = 6;\n /**\n * The color of the axis ticks.\n * Use `undefined` rather than `rgba(0, 0, 0, 0)` to make the ticks invisible.\n */\n this.color = 'rgba(195, 195, 195, 1)';\n /**\n * A hint of how many ticks to use (the exact number of ticks might differ),\n * a `TimeInterval` or a `CountableTimeInterval`.\n * For example:\n *\n * axis.tick.count = 5;\n * axis.tick.count = year;\n * axis.tick.count = month.every(6);\n */\n this.count = undefined;\n this.interval = undefined;\n this.values = undefined;\n this.minSpacing = NaN;\n }\n __decorate$1G([\n Validate(BOOLEAN)\n ], AxisTick.prototype, \"enabled\", void 0);\n __decorate$1G([\n Validate(NUMBER(0))\n ], AxisTick.prototype, \"width\", void 0);\n __decorate$1G([\n Validate(NUMBER(0))\n ], AxisTick.prototype, \"size\", void 0);\n __decorate$1G([\n Validate(OPT_COLOR_STRING)\n ], AxisTick.prototype, \"color\", void 0);\n __decorate$1G([\n Validate(OPT_TICK_COUNT),\n Deprecated('Use tick.interval or tick.minSpacing and tick.maxSpacing instead')\n ], AxisTick.prototype, \"count\", void 0);\n __decorate$1G([\n Validate(OPT_TICK_INTERVAL)\n ], AxisTick.prototype, \"interval\", void 0);\n __decorate$1G([\n Validate(OPT_ARRAY())\n ], AxisTick.prototype, \"values\", void 0);\n __decorate$1G([\n Validate(AND(NUMBER_OR_NAN(1), LESS_THAN('maxSpacing'))),\n Default(NaN)\n ], AxisTick.prototype, \"minSpacing\", void 0);\n return AxisTick;\n}());\n\nvar StateMachine = /** @class */ (function () {\n function StateMachine(initialState, states) {\n this.state = initialState;\n this.states = states;\n if (StateMachine.DEBUG())\n Logger.debug(\"%c\" + this.constructor.name + \" | init -> \" + initialState, 'color: green');\n }\n StateMachine.prototype.transition = function (event, data) {\n var _a, _b, _c, _d, _e;\n var currentStateConfig = this.states[this.state];\n var destinationTransition = (_a = currentStateConfig === null || currentStateConfig === void 0 ? void 0 : currentStateConfig.on) === null || _a === void 0 ? void 0 : _a[event];\n if (!destinationTransition) {\n if (StateMachine.DEBUG()) {\n Logger.debug(\"%c\" + this.constructor.name + \" | \" + this.state + \" -> \" + event + \" -> \" + this.state, 'color: grey');\n }\n return;\n }\n var destinationState = destinationTransition.target;\n var destinationStateConfig = this.states[destinationState];\n if (StateMachine.DEBUG()) {\n Logger.debug(\"%c\" + this.constructor.name + \" | \" + this.state + \" -> \" + event + \" -> \" + destinationState, 'color: green');\n }\n destinationTransition.action(data);\n (_c = (_b = currentStateConfig === null || currentStateConfig === void 0 ? void 0 : currentStateConfig.actions) === null || _b === void 0 ? void 0 : _b.onExit) === null || _c === void 0 ? void 0 : _c.call(_b);\n (_e = (_d = destinationStateConfig === null || destinationStateConfig === void 0 ? void 0 : destinationStateConfig.actions) === null || _d === void 0 ? void 0 : _d.onEnter) === null || _e === void 0 ? void 0 : _e.call(_d);\n this.state = destinationState;\n return this.state;\n };\n StateMachine.DEBUG = function () { var _a; return (_a = [true, 'animation'].includes(windowValue('agChartsDebug'))) !== null && _a !== void 0 ? _a : false; };\n return StateMachine;\n}());\n\nvar __extends$2n = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign$H = (undefined && undefined.__assign) || function () {\n __assign$H = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$H.apply(this, arguments);\n};\nvar __decorate$1F = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __rest$3 = (undefined && undefined.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nvar __values$l = (undefined && undefined.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nvar __read$K = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray$p = (undefined && undefined.__spreadArray) || function (to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\n to[j] = from[i];\n return to;\n};\nvar GRID_STYLE_KEYS = ['stroke', 'lineDash'];\nvar GRID_STYLE = predicateWithMessage(ARRAY(undefined, function (o) {\n for (var key in o) {\n if (!GRID_STYLE_KEYS.includes(key)) {\n return false;\n }\n }\n return true;\n}), \"expecting an Array of objects with gridline style properties such as 'stroke' and 'lineDash'\");\nvar Tags;\n(function (Tags) {\n Tags[Tags[\"TickLine\"] = 0] = \"TickLine\";\n Tags[Tags[\"TickLabel\"] = 1] = \"TickLabel\";\n Tags[Tags[\"GridLine\"] = 2] = \"GridLine\";\n Tags[Tags[\"GridArc\"] = 3] = \"GridArc\";\n Tags[Tags[\"AxisLine\"] = 4] = \"AxisLine\";\n})(Tags || (Tags = {}));\nvar TickGenerationType;\n(function (TickGenerationType) {\n TickGenerationType[TickGenerationType[\"CREATE\"] = 0] = \"CREATE\";\n TickGenerationType[TickGenerationType[\"CREATE_SECONDARY\"] = 1] = \"CREATE_SECONDARY\";\n TickGenerationType[TickGenerationType[\"FILTER\"] = 2] = \"FILTER\";\n TickGenerationType[TickGenerationType[\"VALUES\"] = 3] = \"VALUES\";\n})(TickGenerationType || (TickGenerationType = {}));\nvar AxisStateMachine = /** @class */ (function (_super) {\n __extends$2n(AxisStateMachine, _super);\n function AxisStateMachine() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n return AxisStateMachine;\n}(StateMachine));\n/**\n * A general purpose linear axis with no notion of orientation.\n * The axis is always rendered vertically, with horizontal labels positioned to the left\n * of the axis line by default. The axis can be {@link rotation | rotated} by an arbitrary angle,\n * so that it can be used as a top, right, bottom, left, radial or any other kind\n * of linear axis.\n * The generic `D` parameter is the type of the domain of the axis' scale.\n * The output range of the axis' scale is always numeric (screen coordinates).\n */\nvar Axis = /** @class */ (function () {\n function Axis(moduleCtx, scale) {\n var _this = this;\n this.moduleCtx = moduleCtx;\n this.id = createId$1(this);\n this.nice = true;\n this.dataDomain = [];\n this.keys = [];\n this.boundSeries = [];\n this.includeInvisibleDomains = false;\n this.axisGroup = new Group({ name: this.id + \"-axis\", zIndex: Layers.AXIS_ZINDEX });\n this.lineNode = this.axisGroup.appendChild(new Line());\n this.tickLineGroup = this.axisGroup.appendChild(new Group({ name: this.id + \"-Axis-tick-lines\", zIndex: Layers.AXIS_ZINDEX }));\n this.tickLabelGroup = this.axisGroup.appendChild(new Group({ name: this.id + \"-Axis-tick-labels\", zIndex: Layers.AXIS_ZINDEX }));\n this.crossLineGroup = new Group({ name: this.id + \"-CrossLines\" });\n this.gridGroup = new Group({ name: this.id + \"-Axis-grid\" });\n this.gridLineGroup = this.gridGroup.appendChild(new Group({\n name: this.id + \"-gridLines\",\n zIndex: Layers.AXIS_GRID_ZINDEX,\n }));\n this.tickLineGroupSelection = Selection.select(this.tickLineGroup, Line, false);\n this.tickLabelGroupSelection = Selection.select(this.tickLabelGroup, Text, false);\n this.gridLineGroupSelection = Selection.select(this.gridLineGroup, Line, false);\n this.line = new AxisLine();\n this.tick = this.createTick();\n this.label = new AxisLabel();\n this.translation = { x: 0, y: 0 };\n this.rotation = 0; // axis rotation angle in degrees\n this.layout = {\n label: {\n fractionDigits: 0,\n padding: this.label.padding,\n format: this.label.format,\n },\n };\n this.modules = {};\n this.destroyFns = [];\n this.range = [0, 1];\n this.visibleRange = [0, 1];\n this.title = undefined;\n this._titleCaption = new Caption();\n /**\n * The length of the grid. The grid is only visible in case of a non-zero value.\n * In case {@link radialGrid} is `true`, the value is interpreted as an angle\n * (in degrees).\n */\n this._gridLength = 0;\n /**\n * The array of styles to cycle through when rendering grid lines.\n * For example, use two {@link GridStyle} objects for alternating styles.\n * Contains only one {@link GridStyle} object by default, meaning all grid lines\n * have the same style.\n */\n this.gridStyle = [\n {\n stroke: 'rgba(219, 219, 219, 1)',\n lineDash: [4, 2],\n },\n ];\n this.fractionDigits = 0;\n /**\n * The distance between the grid ticks and the axis ticks.\n */\n this.gridPadding = 0;\n /**\n * Is used to avoid collisions between axis labels and series.\n */\n this.seriesAreaPadding = 0;\n this.maxThickness = Infinity;\n this._scale = scale;\n this.refreshScale();\n this._titleCaption.node.rotation = -Math.PI / 2;\n this.axisGroup.appendChild(this._titleCaption.node);\n var axisHoverHandle = moduleCtx.interactionManager.addListener('hover', function (e) { return _this.checkAxisHover(e); });\n this.destroyFns.push(function () { return moduleCtx.interactionManager.removeListener(axisHoverHandle); });\n this.animationManager = moduleCtx.animationManager;\n this.animationState = new AxisStateMachine('empty', {\n empty: {\n on: {\n update: {\n target: 'align',\n action: function () { return _this.resetSelectionNodes(); },\n },\n },\n },\n align: {\n on: {\n update: {\n target: 'ready',\n action: function () { return _this.resetSelectionNodes(); },\n },\n },\n },\n ready: {\n on: {\n update: {\n target: 'ready',\n action: function (data) { return _this.animateReadyUpdate(data); },\n },\n },\n },\n });\n this._crossLines = [];\n this.assignCrossLineArrayConstructor(this._crossLines);\n }\n Object.defineProperty(Axis.prototype, \"scale\", {\n get: function () {\n return this._scale;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Axis.prototype, \"type\", {\n get: function () {\n var _a;\n return (_a = this.constructor.type) !== null && _a !== void 0 ? _a : '';\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Axis.prototype, \"crossLines\", {\n get: function () {\n return this._crossLines;\n },\n set: function (value) {\n var _this = this;\n var _a, _b;\n (_a = this._crossLines) === null || _a === void 0 ? void 0 : _a.forEach(function (crossLine) { return _this.detachCrossLine(crossLine); });\n if (value) {\n this.assignCrossLineArrayConstructor(value);\n }\n this._crossLines = value;\n (_b = this._crossLines) === null || _b === void 0 ? void 0 : _b.forEach(function (crossLine) {\n _this.attachCrossLine(crossLine);\n _this.initCrossLine(crossLine);\n });\n },\n enumerable: false,\n configurable: true\n });\n Axis.prototype.attachCrossLine = function (crossLine) {\n this.crossLineGroup.appendChild(crossLine.group);\n };\n Axis.prototype.detachCrossLine = function (crossLine) {\n this.crossLineGroup.removeChild(crossLine.group);\n };\n Axis.prototype.destroy = function () {\n var e_1, _a;\n try {\n for (var _b = __values$l(Object.entries(this.modules)), _c = _b.next(); !_c.done; _c = _b.next()) {\n var _d = __read$K(_c.value, 2), key = _d[0], module = _d[1];\n module.instance.destroy();\n delete this.modules[key];\n delete this[key];\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_1) throw e_1.error; }\n }\n this.destroyFns.forEach(function (f) { return f(); });\n };\n Axis.prototype.refreshScale = function () {\n var _this = this;\n var _a;\n this.range = this.scale.range.slice();\n (_a = this.crossLines) === null || _a === void 0 ? void 0 : _a.forEach(function (crossLine) {\n _this.initCrossLine(crossLine);\n });\n };\n Axis.prototype.updateRange = function () {\n var _a;\n var _b = this, rr = _b.range, vr = _b.visibleRange, scale = _b.scale;\n var span = (rr[1] - rr[0]) / (vr[1] - vr[0]);\n var shift = span * vr[0];\n var start = rr[0] - shift;\n scale.range = [start, start + span];\n (_a = this.crossLines) === null || _a === void 0 ? void 0 : _a.forEach(function (crossLine) {\n crossLine.clippedRange = [rr[0], rr[1]];\n });\n };\n Axis.prototype.setCrossLinesVisible = function (visible) {\n this.crossLineGroup.visible = visible;\n };\n Axis.prototype.attachAxis = function (node) {\n node.appendChild(this.gridGroup);\n node.appendChild(this.axisGroup);\n node.appendChild(this.crossLineGroup);\n };\n Axis.prototype.detachAxis = function (node) {\n node.removeChild(this.gridGroup);\n node.removeChild(this.axisGroup);\n node.removeChild(this.crossLineGroup);\n };\n /**\n * Checks if a point or an object is in range.\n * @param x A point (or object's starting point).\n * @param width Object's width.\n * @param tolerance Expands the range on both ends by this amount.\n */\n Axis.prototype.inRange = function (x, width, tolerance) {\n if (width === void 0) { width = 0; }\n if (tolerance === void 0) { tolerance = 0; }\n return this.inRangeEx(x, width, tolerance) === 0;\n };\n Axis.prototype.inRangeEx = function (x, width, tolerance) {\n if (width === void 0) { width = 0; }\n if (tolerance === void 0) { tolerance = 0; }\n var range = this.range;\n // Account for inverted ranges, for example [500, 100] as well as [100, 500]\n var min = Math.min(range[0], range[1]);\n var max = Math.max(range[0], range[1]);\n if (x + width < min - tolerance) {\n return -1; // left of range\n }\n if (x > max + tolerance) {\n return 1; // right of range\n }\n return 0; // in range\n };\n Axis.prototype.onLabelFormatChange = function (ticks, format) {\n var _a = this, scale = _a.scale, fractionDigits = _a.fractionDigits;\n var logScale = scale instanceof LogScale;\n var defaultLabelFormatter = !logScale && fractionDigits > 0\n ? function (x) { return (typeof x === 'number' ? x.toFixed(fractionDigits) : String(x)); }\n : function (x) { return String(x); };\n if (format && scale && scale.tickFormat) {\n try {\n this.labelFormatter = scale.tickFormat({\n ticks: ticks,\n specifier: format,\n });\n }\n catch (e) {\n this.labelFormatter = defaultLabelFormatter;\n Logger.warnOnce(\"the axis label format string \" + format + \" is invalid. No formatting will be applied\");\n }\n }\n else {\n this.labelFormatter = defaultLabelFormatter;\n }\n };\n Axis.prototype.setDomain = function () {\n var _a;\n var _b = this, scale = _b.scale, dataDomain = _b.dataDomain, tickValues = _b.tick.values;\n if (tickValues && scale instanceof ContinuousScale) {\n var _c = __read$K((_a = extent$4(tickValues)) !== null && _a !== void 0 ? _a : [Infinity, -Infinity], 2), tickMin = _c[0], tickMax = _c[1];\n var min = Math.min(scale.fromDomain(dataDomain[0]), tickMin);\n var max = Math.max(scale.fromDomain(dataDomain[1]), tickMax);\n scale.domain = [scale.toDomain(min), scale.toDomain(max)];\n }\n else {\n scale.domain = dataDomain;\n }\n };\n Axis.prototype.setTickInterval = function (interval) {\n var _a;\n this.scale.interval = (_a = this.tick.interval) !== null && _a !== void 0 ? _a : interval;\n };\n Axis.prototype.setTickCount = function (count, minTickCount, maxTickCount) {\n var scale = this.scale;\n if (!(count && scale instanceof ContinuousScale)) {\n return;\n }\n if (typeof count === 'number') {\n scale.tickCount = count;\n scale.minTickCount = minTickCount !== null && minTickCount !== void 0 ? minTickCount : 0;\n scale.maxTickCount = maxTickCount !== null && maxTickCount !== void 0 ? maxTickCount : Infinity;\n return;\n }\n if (scale instanceof TimeScale$1) {\n this.setTickInterval(count);\n }\n };\n Object.defineProperty(Axis.prototype, \"gridLength\", {\n get: function () {\n return this._gridLength;\n },\n set: function (value) {\n var _this = this;\n var _a;\n // Was visible and now invisible, or was invisible and now visible.\n if ((this._gridLength && !value) || (!this._gridLength && value)) {\n this.gridLineGroupSelection = this.gridLineGroupSelection.clear();\n }\n this._gridLength = value;\n (_a = this.crossLines) === null || _a === void 0 ? void 0 : _a.forEach(function (crossLine) {\n _this.initCrossLine(crossLine);\n });\n },\n enumerable: false,\n configurable: true\n });\n Axis.prototype.createTick = function () {\n return new AxisTick();\n };\n Axis.prototype.checkAxisHover = function (event) {\n var bbox = this.computeBBox();\n var isInAxis = bbox.containsPoint(event.offsetX, event.offsetY);\n if (!isInAxis)\n return;\n this.moduleCtx.chartEventManager.axisHover(this.id, this.direction);\n };\n /**\n * Creates/removes/updates the scene graph nodes that constitute the axis.\n */\n Axis.prototype.update = function (primaryTickCount) {\n var previous = this.tickLabelGroupSelection.nodes().map(function (node) { return node.datum.tickId; });\n var _a = this.calculateRotations(), rotation = _a.rotation, parallelFlipRotation = _a.parallelFlipRotation, regularFlipRotation = _a.regularFlipRotation;\n var sideFlag = this.label.getSideFlag();\n var labelX = sideFlag * (this.tick.size + this.label.padding + this.seriesAreaPadding);\n this.updateScale();\n this.updatePosition({ rotation: rotation, sideFlag: sideFlag });\n this.updateLine();\n var _b = this.generateTicks({\n primaryTickCount: primaryTickCount,\n parallelFlipRotation: parallelFlipRotation,\n regularFlipRotation: regularFlipRotation,\n labelX: labelX,\n sideFlag: sideFlag,\n }), tickData = _b.tickData, combinedRotation = _b.combinedRotation, textBaseline = _b.textBaseline, textAlign = _b.textAlign, ticksResult = __rest$3(_b, [\"tickData\", \"combinedRotation\", \"textBaseline\", \"textAlign\"]);\n this.updateSelections(tickData.ticks);\n if (this.animationManager.skipAnimations) {\n this.resetSelectionNodes();\n }\n else {\n var diff = this.calculateUpdateDiff(previous, tickData);\n this.animationState.transition('update', diff);\n }\n this.updateLabels({\n tickLabelGroupSelection: this.tickLabelGroupSelection,\n combinedRotation: combinedRotation,\n textBaseline: textBaseline,\n textAlign: textAlign,\n labelX: labelX,\n });\n this.updateVisibility();\n this.updateGridLines(sideFlag);\n this.updateTickLines(sideFlag);\n this.updateTitle({ anyTickVisible: tickData.ticks.length > 0, sideFlag: sideFlag });\n this.updateCrossLines({ rotation: rotation, parallelFlipRotation: parallelFlipRotation, regularFlipRotation: regularFlipRotation, sideFlag: sideFlag });\n this.updateLayoutState();\n primaryTickCount = ticksResult.primaryTickCount;\n return primaryTickCount;\n };\n Axis.prototype.updateLayoutState = function () {\n this.layout.label = {\n fractionDigits: this.fractionDigits,\n padding: this.label.padding,\n format: this.label.format,\n };\n };\n Axis.prototype.updateScale = function () {\n this.updateRange();\n this.calculateDomain();\n this.setDomain();\n this.setTickInterval(this.tick.interval);\n var _a = this, scale = _a.scale, nice = _a.nice;\n if (!(scale instanceof ContinuousScale)) {\n return;\n }\n this.setTickCount(this.tick.count);\n scale.nice = nice;\n scale.update();\n };\n Axis.prototype.calculateRotations = function () {\n var rotation = toRadians$1(this.rotation);\n // When labels are parallel to the axis line, the `parallelFlipFlag` is used to\n // flip the labels to avoid upside-down text, when the axis is rotated\n // such that it is in the right hemisphere, i.e. the angle of rotation\n // is in the [0, π] interval.\n // The rotation angle is normalized, so that we have an easier time checking\n // if it's in the said interval. Since the axis is always rendered vertically\n // and then rotated, zero rotation means 12 (not 3) o-clock.\n // -1 = flip\n // 1 = don't flip (default)\n var parallelFlipRotation = normalizeAngle360(rotation);\n var regularFlipRotation = normalizeAngle360(rotation - Math.PI / 2);\n return { rotation: rotation, parallelFlipRotation: parallelFlipRotation, regularFlipRotation: regularFlipRotation };\n };\n Axis.prototype.generateTicks = function (_a) {\n var e_2, _b, _c;\n var _d;\n var primaryTickCount = _a.primaryTickCount, parallelFlipRotation = _a.parallelFlipRotation, regularFlipRotation = _a.regularFlipRotation, labelX = _a.labelX, sideFlag = _a.sideFlag;\n var _e = this, scale = _e.scale, tick = _e.tick, _f = _e.label, parallel = _f.parallel, rotation = _f.rotation, fontFamily = _f.fontFamily, fontSize = _f.fontSize, fontStyle = _f.fontStyle, fontWeight = _f.fontWeight;\n var secondaryAxis = primaryTickCount !== undefined;\n var _g = calculateLabelRotation({\n rotation: rotation,\n parallel: parallel,\n regularFlipRotation: regularFlipRotation,\n parallelFlipRotation: parallelFlipRotation,\n }), defaultRotation = _g.defaultRotation, configuredRotation = _g.configuredRotation, parallelFlipFlag = _g.parallelFlipFlag, regularFlipFlag = _g.regularFlipFlag;\n var initialRotation = configuredRotation + defaultRotation;\n var labelMatrix = new Matrix();\n var maxTickCount = this.estimateTickCount({\n minSpacing: tick.minSpacing,\n maxSpacing: (_d = tick.maxSpacing) !== null && _d !== void 0 ? _d : NaN,\n }).maxTickCount;\n var continuous = scale instanceof ContinuousScale;\n var maxIterations = tick.count || !continuous || isNaN(maxTickCount) ? 10 : maxTickCount;\n var textAlign = getTextAlign(parallel, configuredRotation, 0, sideFlag, regularFlipFlag);\n var textBaseline = getTextBaseline(parallel, configuredRotation, sideFlag, parallelFlipFlag);\n var textProps = {\n fontFamily: fontFamily,\n fontSize: fontSize,\n fontStyle: fontStyle,\n fontWeight: fontWeight,\n textBaseline: textBaseline,\n textAlign: textAlign,\n };\n var tickData = {\n rawTicks: [],\n ticks: [],\n labelCount: 0,\n };\n var index = 0;\n var autoRotation = 0;\n var labelOverlap = true;\n var terminate = false;\n while (labelOverlap && index <= maxIterations) {\n if (terminate) {\n break;\n }\n autoRotation = 0;\n textAlign = getTextAlign(parallel, configuredRotation, 0, sideFlag, regularFlipFlag);\n var tickStrategies = this.getTickStrategies({ secondaryAxis: secondaryAxis, index: index });\n try {\n for (var tickStrategies_1 = (e_2 = void 0, __values$l(tickStrategies)), tickStrategies_1_1 = tickStrategies_1.next(); !tickStrategies_1_1.done; tickStrategies_1_1 = tickStrategies_1.next()) {\n var strategy = tickStrategies_1_1.value;\n (_c = strategy({\n index: index,\n tickData: tickData,\n textProps: textProps,\n labelOverlap: labelOverlap,\n terminate: terminate,\n primaryTickCount: primaryTickCount,\n }), tickData = _c.tickData, index = _c.index, autoRotation = _c.autoRotation, terminate = _c.terminate);\n var ticksResult = tickData.ticks;\n textAlign = getTextAlign(parallel, configuredRotation, autoRotation, sideFlag, regularFlipFlag);\n var rotated = configuredRotation !== 0 || autoRotation !== 0;\n var rotation_1 = initialRotation + autoRotation;\n labelOverlap = this.checkLabelOverlap(rotation_1, rotated, labelMatrix, ticksResult, labelX, __assign$H(__assign$H({}, textProps), { textAlign: textAlign }));\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (tickStrategies_1_1 && !tickStrategies_1_1.done && (_b = tickStrategies_1.return)) _b.call(tickStrategies_1);\n }\n finally { if (e_2) throw e_2.error; }\n }\n }\n var combinedRotation = defaultRotation + configuredRotation + autoRotation;\n if (!secondaryAxis && tickData.rawTicks.length > 0) {\n primaryTickCount = tickData.rawTicks.length;\n }\n return { tickData: tickData, primaryTickCount: primaryTickCount, combinedRotation: combinedRotation, textBaseline: textBaseline, textAlign: textAlign };\n };\n Axis.prototype.getTickStrategies = function (_a) {\n var _this = this;\n var index = _a.index, secondaryAxis = _a.secondaryAxis;\n var _b = this, scale = _b.scale, label = _b.label, tick = _b.tick;\n var continuous = scale instanceof ContinuousScale;\n var avoidLabelCollisions = label.enabled && label.avoidCollisions;\n var filterTicks = !(continuous && this.tick.count === undefined) && index !== 0 && avoidLabelCollisions;\n var autoRotate = label.autoRotate === true && label.rotation === undefined;\n var strategies = [];\n var tickGenerationType;\n if (this.tick.values) {\n tickGenerationType = TickGenerationType.VALUES;\n }\n else if (secondaryAxis) {\n tickGenerationType = TickGenerationType.CREATE_SECONDARY;\n }\n else if (filterTicks) {\n tickGenerationType = TickGenerationType.FILTER;\n }\n else {\n tickGenerationType = TickGenerationType.CREATE;\n }\n var tickGenerationStrategy = function (_a) {\n var index = _a.index, tickData = _a.tickData, primaryTickCount = _a.primaryTickCount, terminate = _a.terminate;\n return _this.createTickData(tickGenerationType, index, tickData, terminate, primaryTickCount);\n };\n strategies.push(tickGenerationStrategy);\n if (!continuous && !isNaN(tick.minSpacing)) {\n var tickFilterStrategy = function (_a) {\n var index = _a.index, tickData = _a.tickData, primaryTickCount = _a.primaryTickCount, terminate = _a.terminate;\n return _this.createTickData(TickGenerationType.FILTER, index, tickData, terminate, primaryTickCount);\n };\n strategies.push(tickFilterStrategy);\n }\n if (!avoidLabelCollisions) {\n return strategies;\n }\n if (label.autoWrap) {\n var autoWrapStrategy = function (_a) {\n var index = _a.index, tickData = _a.tickData, textProps = _a.textProps;\n return _this.wrapLabels(tickData, index, textProps);\n };\n strategies.push(autoWrapStrategy);\n }\n else if (autoRotate) {\n var autoRotateStrategy = function (_a) {\n var index = _a.index, tickData = _a.tickData, labelOverlap = _a.labelOverlap, terminate = _a.terminate;\n return ({\n index: index,\n tickData: tickData,\n autoRotation: _this.getAutoRotation(labelOverlap),\n terminate: terminate,\n });\n };\n strategies.push(autoRotateStrategy);\n }\n return strategies;\n };\n Axis.prototype.createTickData = function (tickGenerationType, index, tickData, terminate, primaryTickCount) {\n var _a, _b, _c;\n var _d = this, scale = _d.scale, tick = _d.tick;\n var _e = this.estimateTickCount({\n minSpacing: tick.minSpacing,\n maxSpacing: (_a = tick.maxSpacing) !== null && _a !== void 0 ? _a : NaN,\n }), maxTickCount = _e.maxTickCount, minTickCount = _e.minTickCount, defaultTickCount = _e.defaultTickCount;\n var continuous = scale instanceof ContinuousScale;\n var maxIterations = tick.count || !continuous || isNaN(maxTickCount) ? 10 : maxTickCount;\n var tickCount = (_b = tick.count) !== null && _b !== void 0 ? _b : (continuous ? Math.max(defaultTickCount - index, minTickCount) : maxTickCount);\n var regenerateTicks = tick.interval === undefined &&\n tick.values === undefined &&\n tick.count === undefined &&\n tickCount > minTickCount &&\n (continuous || tickGenerationType === TickGenerationType.FILTER);\n var unchanged = true;\n while (unchanged && index <= maxIterations) {\n var prevTicks = tickData.rawTicks;\n tickCount = (_c = tick.count) !== null && _c !== void 0 ? _c : (continuous ? Math.max(defaultTickCount - index, minTickCount) : maxTickCount);\n var _f = this.getTicks({\n tickGenerationType: tickGenerationType,\n previousTicks: prevTicks,\n tickCount: tickCount,\n minTickCount: minTickCount,\n maxTickCount: maxTickCount,\n primaryTickCount: primaryTickCount,\n }), rawTicks = _f.rawTicks, ticks = _f.ticks, labelCount = _f.labelCount;\n tickData.rawTicks = rawTicks;\n tickData.ticks = ticks;\n tickData.labelCount = labelCount;\n unchanged = regenerateTicks ? areArrayNumbersEqual(rawTicks, prevTicks) : false;\n index++;\n }\n var shouldTerminate = tick.interval !== undefined || tick.values !== undefined;\n terminate || (terminate = shouldTerminate);\n return { tickData: tickData, index: index, autoRotation: 0, terminate: terminate };\n };\n Axis.prototype.checkLabelOverlap = function (rotation, rotated, labelMatrix, tickData, labelX, textProps) {\n Matrix.updateTransformMatrix(labelMatrix, 1, 1, rotation, 0, 0);\n var labelData = this.createLabelData(tickData, labelX, textProps, labelMatrix);\n var labelSpacing = getLabelSpacing(this.label.minSpacing, rotated);\n return axisLabelsOverlap(labelData, labelSpacing);\n };\n Axis.prototype.createLabelData = function (tickData, labelX, textProps, labelMatrix) {\n var e_3, _a;\n var labelData = [];\n try {\n for (var tickData_1 = __values$l(tickData), tickData_1_1 = tickData_1.next(); !tickData_1_1.done; tickData_1_1 = tickData_1.next()) {\n var tickDatum = tickData_1_1.value;\n var tickLabel = tickDatum.tickLabel, translationY = tickDatum.translationY;\n if (tickLabel === '' || tickLabel == undefined) {\n // skip user hidden ticks\n continue;\n }\n var lines = splitText(tickLabel);\n var _b = measureText(lines, labelX, translationY, textProps), width = _b.width, height = _b.height;\n var bbox = new BBox(labelX, translationY, width, height);\n var labelDatum = calculateLabelBBox(tickLabel, bbox, labelX, translationY, labelMatrix);\n labelData.push(labelDatum);\n }\n }\n catch (e_3_1) { e_3 = { error: e_3_1 }; }\n finally {\n try {\n if (tickData_1_1 && !tickData_1_1.done && (_a = tickData_1.return)) _a.call(tickData_1);\n }\n finally { if (e_3) throw e_3.error; }\n }\n return labelData;\n };\n Axis.prototype.getAutoRotation = function (labelOveralap) {\n return labelOveralap ? normalizeAngle360(toRadians$1(this.label.autoRotateAngle)) : 0;\n };\n Axis.prototype.getTicks = function (_a) {\n var _b;\n var tickGenerationType = _a.tickGenerationType, previousTicks = _a.previousTicks, tickCount = _a.tickCount, minTickCount = _a.minTickCount, maxTickCount = _a.maxTickCount, primaryTickCount = _a.primaryTickCount;\n var scale = this.scale;\n var rawTicks = [];\n switch (tickGenerationType) {\n case TickGenerationType.VALUES:\n rawTicks = this.tick.values;\n break;\n case TickGenerationType.CREATE_SECONDARY:\n // `updateSecondaryAxisTicks` mutates `scale.domain` based on `primaryTickCount`\n rawTicks = this.updateSecondaryAxisTicks(primaryTickCount);\n break;\n case TickGenerationType.FILTER:\n rawTicks = this.filterTicks(previousTicks, tickCount);\n break;\n default:\n rawTicks = this.createTicks(tickCount, minTickCount, maxTickCount);\n break;\n }\n // When the scale domain or the ticks change, the label format may change\n this.onLabelFormatChange(rawTicks, this.label.format);\n // `ticks instanceof NumericTicks` doesn't work here, so we feature detect.\n this.fractionDigits = rawTicks.fractionDigits >= 0 ? rawTicks.fractionDigits : 0;\n var halfBandwidth = ((_b = this.scale.bandwidth) !== null && _b !== void 0 ? _b : 0) / 2;\n var ticks = [];\n var labelCount = 0;\n var tickIdCounts = new Map();\n for (var i = 0; i < rawTicks.length; i++) {\n var rawTick = rawTicks[i];\n var translationY = scale.convert(rawTick) + halfBandwidth;\n var tickLabel = this.formatTick(rawTick, i);\n // Create a tick id from the label, or as an increment of the last label if this tick label is blank\n var tickId = tickLabel;\n if (tickIdCounts.has(tickId)) {\n var count = tickIdCounts.get(tickId);\n tickIdCounts.set(tickId, count + 1);\n tickId = tickId + \"_\" + count;\n }\n else {\n tickIdCounts.set(tickId, 1);\n }\n ticks.push({ tick: rawTick, tickId: tickId, tickLabel: tickLabel, translationY: translationY });\n if (tickLabel === '' || tickLabel == undefined) {\n continue;\n }\n labelCount++;\n }\n return { rawTicks: rawTicks, ticks: ticks, labelCount: labelCount };\n };\n Axis.prototype.filterTicks = function (ticks, tickCount) {\n var _a;\n var tickSpacing = !isNaN(this.tick.minSpacing) || !isNaN((_a = this.tick.maxSpacing) !== null && _a !== void 0 ? _a : NaN);\n var keepEvery = tickSpacing ? Math.ceil(ticks.length / tickCount) : 2;\n return ticks.filter(function (_, i) { return i % keepEvery === 0; });\n };\n Axis.prototype.createTicks = function (tickCount, minTickCount, maxTickCount) {\n var _a, _b, _c;\n this.setTickCount(tickCount, minTickCount, maxTickCount);\n return (_c = (_b = (_a = this.scale).ticks) === null || _b === void 0 ? void 0 : _b.call(_a)) !== null && _c !== void 0 ? _c : [];\n };\n Axis.prototype.estimateTickCount = function (_a) {\n var minSpacing = _a.minSpacing, maxSpacing = _a.maxSpacing;\n var availableRange = this.calculateAvailableRange();\n var defaultMinSpacing = Math.max(Axis.defaultTickMinSpacing, availableRange / ContinuousScale.defaultMaxTickCount);\n if (isNaN(minSpacing) && isNaN(maxSpacing)) {\n minSpacing = defaultMinSpacing;\n maxSpacing = availableRange;\n if (minSpacing > maxSpacing) {\n // Take automatic minSpacing if there is a conflict.\n maxSpacing = minSpacing;\n }\n }\n else if (isNaN(minSpacing)) {\n minSpacing = defaultMinSpacing;\n if (minSpacing > maxSpacing) {\n // Take user-suplied maxSpacing if there is a conflict.\n minSpacing = maxSpacing;\n }\n }\n else if (isNaN(maxSpacing)) {\n maxSpacing = availableRange;\n if (minSpacing > maxSpacing) {\n // Take user-suplied minSpacing if there is a conflict.\n maxSpacing = minSpacing;\n }\n }\n var maxTickCount = Math.max(1, Math.floor(availableRange / minSpacing));\n var minTickCount = Math.min(maxTickCount, Math.ceil(availableRange / maxSpacing));\n var defaultTickCount = ContinuousScale.defaultTickCount;\n if (defaultTickCount > maxTickCount) {\n defaultTickCount = maxTickCount;\n }\n else if (defaultTickCount < minTickCount) {\n defaultTickCount = minTickCount;\n }\n return { minTickCount: minTickCount, maxTickCount: maxTickCount, defaultTickCount: defaultTickCount };\n };\n Axis.prototype.updateVisibility = function () {\n var requestedRange = this.range;\n var requestedRangeMin = Math.min.apply(Math, __spreadArray$p([], __read$K(requestedRange)));\n var requestedRangeMax = Math.max.apply(Math, __spreadArray$p([], __read$K(requestedRange)));\n var visibleFn = function (node) {\n var min = Math.floor(requestedRangeMin);\n var max = Math.ceil(requestedRangeMax);\n if (min === max) {\n node.visible = false;\n return;\n }\n // Fix an effect of rounding error\n if (node.translationY >= min - 1 && node.translationY < min) {\n node.translationY = min;\n }\n if (node.translationY > max && node.translationY <= max + 1) {\n node.translationY = max;\n }\n var visible = node.translationY >= min && node.translationY <= max;\n node.visible = visible;\n };\n var _a = this, gridLineGroupSelection = _a.gridLineGroupSelection, tickLineGroupSelection = _a.tickLineGroupSelection, tickLabelGroupSelection = _a.tickLabelGroupSelection;\n gridLineGroupSelection.each(visibleFn);\n tickLineGroupSelection.each(visibleFn);\n tickLabelGroupSelection.each(visibleFn);\n this.tickLineGroup.visible = this.tick.enabled;\n this.tickLabelGroup.visible = this.label.enabled;\n };\n Axis.prototype.updateCrossLines = function (_a) {\n var _this = this;\n var _b;\n var rotation = _a.rotation, parallelFlipRotation = _a.parallelFlipRotation, regularFlipRotation = _a.regularFlipRotation, sideFlag = _a.sideFlag;\n var anySeriesActive = this.isAnySeriesActive();\n (_b = this.crossLines) === null || _b === void 0 ? void 0 : _b.forEach(function (crossLine) {\n var _a;\n crossLine.sideFlag = -sideFlag;\n crossLine.direction = rotation === -Math.PI / 2 ? ChartAxisDirection.X : ChartAxisDirection.Y;\n crossLine.label.parallel = (_a = crossLine.label.parallel) !== null && _a !== void 0 ? _a : _this.label.parallel;\n crossLine.parallelFlipRotation = parallelFlipRotation;\n crossLine.regularFlipRotation = regularFlipRotation;\n crossLine.update(anySeriesActive);\n });\n };\n Axis.prototype.updateTickLines = function (sideFlag) {\n var tick = this.tick;\n this.tickLineGroupSelection.each(function (line) {\n line.strokeWidth = tick.width;\n line.stroke = tick.color;\n line.x1 = sideFlag * tick.size;\n line.x2 = 0;\n line.y1 = 0;\n line.y2 = 0;\n });\n };\n Axis.prototype.calculateAvailableRange = function () {\n var requestedRange = this.range;\n var min = Math.min.apply(Math, __spreadArray$p([], __read$K(requestedRange)));\n var max = Math.max.apply(Math, __spreadArray$p([], __read$K(requestedRange)));\n return max - min;\n };\n Axis.prototype.calculateDomain = function () {\n var e_4, _a, _b;\n var _c = this, direction = _c.direction, boundSeries = _c.boundSeries, includeInvisibleDomains = _c.includeInvisibleDomains;\n if (this.linkedTo) {\n this.dataDomain = this.linkedTo.dataDomain;\n }\n else {\n var domains = [];\n var visibleSeries = boundSeries.filter(function (s) { return includeInvisibleDomains || s.isEnabled(); });\n try {\n for (var visibleSeries_1 = __values$l(visibleSeries), visibleSeries_1_1 = visibleSeries_1.next(); !visibleSeries_1_1.done; visibleSeries_1_1 = visibleSeries_1.next()) {\n var series = visibleSeries_1_1.value;\n domains.push(series.getDomain(direction));\n }\n }\n catch (e_4_1) { e_4 = { error: e_4_1 }; }\n finally {\n try {\n if (visibleSeries_1_1 && !visibleSeries_1_1.done && (_a = visibleSeries_1.return)) _a.call(visibleSeries_1);\n }\n finally { if (e_4) throw e_4.error; }\n }\n var domain = (_b = new Array()).concat.apply(_b, __spreadArray$p([], __read$K(domains)));\n this.dataDomain = this.normaliseDataDomain(domain);\n }\n };\n Axis.prototype.updatePosition = function (_a) {\n var rotation = _a.rotation, sideFlag = _a.sideFlag;\n var _b = this, crossLineGroup = _b.crossLineGroup, axisGroup = _b.axisGroup, gridGroup = _b.gridGroup, translation = _b.translation, gridLineGroupSelection = _b.gridLineGroupSelection, gridPadding = _b.gridPadding, gridLength = _b.gridLength;\n var translationX = Math.floor(translation.x);\n var translationY = Math.floor(translation.y);\n crossLineGroup.translationX = translationX;\n crossLineGroup.translationY = translationY;\n crossLineGroup.rotation = rotation;\n axisGroup.translationX = translationX;\n axisGroup.translationY = translationY;\n axisGroup.rotation = rotation;\n gridGroup.translationX = translationX;\n gridGroup.translationY = translationY;\n gridGroup.rotation = rotation;\n gridLineGroupSelection.each(function (line) {\n line.x1 = gridPadding;\n line.x2 = -sideFlag * gridLength + gridPadding;\n line.y1 = 0;\n line.y2 = 0;\n });\n };\n Axis.prototype.updateSecondaryAxisTicks = function (_primaryTickCount) {\n throw new Error('AG Charts - unexpected call to updateSecondaryAxisTicks() - check axes configuration.');\n };\n Axis.prototype.updateSelections = function (data) {\n var gridData = this.gridLength ? data : [];\n var gridLineGroupSelection = this.gridLineGroupSelection.update(gridData, function (group) {\n var node = new Line();\n node.tag = Tags.GridLine;\n group.append(node);\n }, function (datum) { return datum.tickId; });\n var tickLineGroupSelection = this.tickLineGroupSelection.update(data, function (group) {\n var line = new Line();\n line.tag = Tags.TickLine;\n group.appendChild(line);\n }, function (datum) { return datum.tickId; });\n var tickLabelGroupSelection = this.tickLabelGroupSelection.update(data, function (group) {\n var text = new Text();\n text.tag = Tags.TickLabel;\n group.appendChild(text);\n }, function (datum) { return datum.tickId; });\n this.tickLineGroupSelection = tickLineGroupSelection;\n this.tickLabelGroupSelection = tickLabelGroupSelection;\n this.gridLineGroupSelection = gridLineGroupSelection;\n };\n Axis.prototype.updateGridLines = function (sideFlag) {\n var _a = this, gridStyle = _a.gridStyle, tick = _a.tick, gridPadding = _a.gridPadding, gridLength = _a.gridLength;\n if (gridLength === 0 || gridStyle.length === 0) {\n return;\n }\n var styleCount = gridStyle.length;\n this.gridLineGroupSelection.each(function (line, _, index) {\n var style = gridStyle[index % styleCount];\n line.x1 = gridPadding;\n line.x2 = -sideFlag * gridLength + gridPadding;\n line.y1 = 0;\n line.y2 = 0;\n line.stroke = style.stroke;\n line.strokeWidth = tick.width;\n line.lineDash = style.lineDash;\n line.fill = undefined;\n });\n };\n Axis.prototype.updateLabels = function (_a) {\n var tickLabelGroupSelection = _a.tickLabelGroupSelection, combinedRotation = _a.combinedRotation, textBaseline = _a.textBaseline, textAlign = _a.textAlign, labelX = _a.labelX;\n var _b = this, label = _b.label, labelsEnabled = _b.label.enabled;\n if (!labelsEnabled) {\n return;\n }\n // Apply label option values\n tickLabelGroupSelection.each(function (node, datum) {\n var tickLabel = datum.tickLabel;\n node.fontStyle = label.fontStyle;\n node.fontWeight = label.fontWeight;\n node.fontSize = label.fontSize;\n node.fontFamily = label.fontFamily;\n node.fill = label.color;\n node.text = tickLabel;\n var userHidden = node.text === '' || node.text == undefined;\n if (userHidden) {\n node.visible = false; // hide empty labels\n return;\n }\n // Position labels\n node.textBaseline = textBaseline;\n node.textAlign = textAlign;\n node.x = labelX;\n node.rotationCenterX = labelX;\n node.rotation = combinedRotation;\n node.visible = true;\n });\n };\n Axis.prototype.wrapLabels = function (tickData, index, labelProps) {\n var _a = this.label, parallel = _a.parallel, maxWidth = _a.maxWidth, maxHeight = _a.maxHeight;\n var defaultMaxLabelWidth = parallel\n ? Math.round(this.calculateAvailableRange() / tickData.labelCount)\n : this.maxThickness;\n var maxLabelWidth = maxWidth !== null && maxWidth !== void 0 ? maxWidth : defaultMaxLabelWidth;\n var defaultMaxLabelHeight = parallel\n ? this.maxThickness\n : Math.round(this.calculateAvailableRange() / tickData.labelCount);\n var maxLabelHeight = maxHeight !== null && maxHeight !== void 0 ? maxHeight : defaultMaxLabelHeight;\n tickData.ticks.forEach(function (tickDatum) {\n var tickLabel = tickDatum.tickLabel;\n var wrapping = 'hyphenate';\n var wrappedTickLabel = Text.wrap(tickLabel, maxLabelWidth, maxLabelHeight, labelProps, wrapping);\n tickDatum.tickLabel = wrappedTickLabel;\n });\n return { tickData: tickData, index: index, autoRotation: 0, terminate: true };\n };\n Axis.prototype.updateLine = function () {\n // Render axis line.\n var _a = this, lineNode = _a.lineNode, requestedRange = _a.range;\n lineNode.x1 = 0;\n lineNode.x2 = 0;\n lineNode.y1 = requestedRange[0];\n lineNode.y2 = requestedRange[1];\n lineNode.strokeWidth = this.line.width;\n lineNode.stroke = this.line.color;\n lineNode.visible = true;\n };\n Axis.prototype.updateTitle = function (_a) {\n var _b;\n var anyTickVisible = _a.anyTickVisible, sideFlag = _a.sideFlag;\n var identityFormatter = function (params) { return params.defaultValue; };\n var _c = this, rotation = _c.rotation, title = _c.title, _titleCaption = _c._titleCaption, lineNode = _c.lineNode, requestedRange = _c.range, tickLineGroup = _c.tickLineGroup, tickLabelGroup = _c.tickLabelGroup, callbackCache = _c.moduleCtx.callbackCache;\n var _d = ((_b = this.title) !== null && _b !== void 0 ? _b : {}).formatter, formatter = _d === void 0 ? identityFormatter : _d;\n if (!title) {\n _titleCaption.enabled = false;\n return;\n }\n _titleCaption.enabled = title.enabled;\n _titleCaption.fontFamily = title.fontFamily;\n _titleCaption.fontSize = title.fontSize;\n _titleCaption.fontStyle = title.fontStyle;\n _titleCaption.fontWeight = title.fontWeight;\n _titleCaption.color = title.color;\n _titleCaption.wrapping = title.wrapping;\n var titleVisible = false;\n var titleNode = _titleCaption.node;\n if (title.enabled && lineNode.visible) {\n titleVisible = true;\n var parallelFlipRotation = normalizeAngle360(rotation);\n var padding = Caption.PADDING;\n var titleRotationFlag = sideFlag === -1 && parallelFlipRotation > Math.PI && parallelFlipRotation < Math.PI * 2 ? -1 : 1;\n titleNode.rotation = (titleRotationFlag * sideFlag * Math.PI) / 2;\n titleNode.x = Math.floor((titleRotationFlag * sideFlag * (requestedRange[0] + requestedRange[1])) / 2);\n var bboxYDimension = 0;\n if (anyTickVisible) {\n var tickBBox = Group.computeBBox([tickLineGroup, tickLabelGroup]);\n var tickWidth = rotation === 0 ? tickBBox.width : tickBBox.height;\n if (Math.abs(tickWidth) < Infinity) {\n bboxYDimension += tickWidth;\n }\n }\n if (sideFlag === -1) {\n titleNode.y = Math.floor(titleRotationFlag * (-padding - bboxYDimension));\n }\n else {\n titleNode.y = Math.floor(-padding - bboxYDimension);\n }\n titleNode.textBaseline = titleRotationFlag === 1 ? 'bottom' : 'top';\n titleNode.text = callbackCache.call(formatter, this.getTitleFormatterParams());\n }\n titleNode.visible = titleVisible;\n };\n // For formatting (nice rounded) tick values.\n Axis.prototype.formatTick = function (datum, index) {\n var _a, _b;\n var _c = this, label = _c.label, labelFormatter = _c.labelFormatter, fractionDigits = _c.fractionDigits, callbackCache = _c.moduleCtx.callbackCache;\n if (label.formatter) {\n var defaultValue = fractionDigits > 0 ? datum : String(datum);\n return ((_a = callbackCache.call(label.formatter, {\n value: defaultValue,\n index: index,\n fractionDigits: fractionDigits,\n formatter: labelFormatter,\n })) !== null && _a !== void 0 ? _a : defaultValue);\n }\n else if (labelFormatter) {\n return (_b = callbackCache.call(labelFormatter, datum)) !== null && _b !== void 0 ? _b : String(datum);\n }\n // The axis is using a logScale or the`datum` is an integer, a string or an object\n return String(datum);\n };\n // For formatting arbitrary values between the ticks.\n Axis.prototype.formatDatum = function (datum) {\n return String(datum);\n };\n Axis.prototype.computeBBox = function () {\n return this.axisGroup.computeBBox();\n };\n Axis.prototype.initCrossLine = function (crossLine) {\n crossLine.scale = this.scale;\n crossLine.gridLength = this.gridLength;\n };\n Axis.prototype.isAnySeriesActive = function () {\n var _this = this;\n return this.boundSeries.some(function (s) { return _this.includeInvisibleDomains || s.isEnabled(); });\n };\n Axis.prototype.clipTickLines = function (x, y, width, height) {\n this.tickLineGroup.setClipRectInGroupCoordinateSpace(new BBox(x, y, width, height));\n };\n Axis.prototype.clipGrid = function (x, y, width, height) {\n this.gridGroup.setClipRectInGroupCoordinateSpace(new BBox(x, y, width, height));\n };\n Axis.prototype.calculatePadding = function (min, _max) {\n return [Math.abs(min * 0.01), Math.abs(min * 0.01)];\n };\n Axis.prototype.getTitleFormatterParams = function () {\n var _this = this;\n var _a;\n var boundSeries = this.boundSeries.reduce(function (acc, next) {\n var keys = next.getKeys(_this.direction);\n var names = next.getNames(_this.direction);\n for (var idx = 0; idx < keys.length; idx++) {\n acc.push({\n key: keys[idx],\n name: names[idx],\n });\n }\n return acc;\n }, []);\n return {\n direction: this.direction,\n boundSeries: boundSeries,\n defaultValue: (_a = this.title) === null || _a === void 0 ? void 0 : _a.text,\n };\n };\n Axis.prototype.normaliseDataDomain = function (d) {\n return d;\n };\n Axis.prototype.getLayoutState = function () {\n return __assign$H({ rect: this.computeBBox(), gridPadding: this.gridPadding, seriesAreaPadding: this.seriesAreaPadding, tickSize: this.tick.size }, this.layout);\n };\n Axis.prototype.createAxisContext = function () {\n var _this = this;\n var keys = function () {\n return _this.boundSeries\n .map(function (s) { return s.getKeys(_this.direction); })\n .reduce(function (keys, seriesKeys) {\n keys.push.apply(keys, __spreadArray$p([], __read$K(seriesKeys)));\n return keys;\n }, []);\n };\n return {\n axisId: this.id,\n direction: this.direction,\n continuous: this.scale instanceof ContinuousScale,\n keys: keys,\n scaleValueFormatter: function (specifier) { var _a, _b, _c; return (_c = (_b = (_a = _this.scale).tickFormat) === null || _b === void 0 ? void 0 : _b.call(_a, { specifier: specifier })) !== null && _c !== void 0 ? _c : undefined; },\n scaleBandwidth: function () { var _a; return (_a = _this.scale.bandwidth) !== null && _a !== void 0 ? _a : 0; },\n scaleConvert: function (val) { return _this.scale.convert(val); },\n scaleInvert: function (val) { var _a, _b, _c; return (_c = (_b = (_a = _this.scale).invert) === null || _b === void 0 ? void 0 : _b.call(_a, val)) !== null && _c !== void 0 ? _c : undefined; },\n };\n };\n Axis.prototype.addModule = function (module) {\n if (this.modules[module.optionsKey] != null) {\n throw new Error('AG Charts - module already initialised: ' + module.optionsKey);\n }\n if (this.axisContext == null) {\n this.axisContext = this.createAxisContext();\n }\n var moduleInstance = new module.instanceConstructor(__assign$H(__assign$H({}, this.moduleCtx), { parent: this.axisContext }));\n this.modules[module.optionsKey] = { instance: moduleInstance };\n this[module.optionsKey] = moduleInstance;\n };\n Axis.prototype.removeModule = function (module) {\n var _a, _b;\n (_b = (_a = this.modules[module.optionsKey]) === null || _a === void 0 ? void 0 : _a.instance) === null || _b === void 0 ? void 0 : _b.destroy();\n delete this.modules[module.optionsKey];\n delete this[module.optionsKey];\n };\n Axis.prototype.isModuleEnabled = function (module) {\n return this.modules[module.optionsKey] != null;\n };\n Axis.prototype.animateReadyUpdate = function (diff) {\n var _this = this;\n var _a, _b;\n if (!diff.changed) {\n this.resetSelectionNodes();\n return;\n }\n var _c = this, gridLineGroupSelection = _c.gridLineGroupSelection, tickLineGroupSelection = _c.tickLineGroupSelection, tickLabelGroupSelection = _c.tickLabelGroupSelection;\n var addedCount = Object.keys(diff.added).length;\n var removedCount = Object.keys(diff.removed).length;\n if (removedCount === diff.tickCount) {\n this.resetSelectionNodes();\n return;\n }\n var totalDuration = (_b = (_a = this.animationManager) === null || _a === void 0 ? void 0 : _a.defaultOptions.duration) !== null && _b !== void 0 ? _b : 1000;\n var sectionDuration = Math.floor(totalDuration / 2);\n if (addedCount > 0 && removedCount > 0) {\n sectionDuration = Math.floor(totalDuration / 3);\n }\n var options = {\n delay: removedCount > 0 ? sectionDuration : 0,\n duration: sectionDuration,\n };\n var animationGroup = this.id + \"_\" + Math.random();\n tickLabelGroupSelection.each(function (node, datum) {\n _this.animateSelectionNode(tickLabelGroupSelection, diff, options, node, datum, animationGroup);\n });\n gridLineGroupSelection.each(function (node, datum) {\n _this.animateSelectionNode(gridLineGroupSelection, diff, options, node, datum, animationGroup);\n });\n tickLineGroupSelection.each(function (node, datum) {\n _this.animateSelectionNode(tickLineGroupSelection, diff, options, node, datum, animationGroup);\n });\n };\n Axis.prototype.animateSelectionNode = function (selection, diff, options, node, datum, animationGroup) {\n var roundedTranslationY = Math.round(datum.translationY);\n var translate = { from: node.translationY, to: roundedTranslationY };\n var opacity = { from: 1, to: 1 };\n var duration = options.duration;\n var delay = options.delay;\n var datumId = datum.tickLabel;\n if (diff.added[datumId]) {\n translate = { from: roundedTranslationY, to: roundedTranslationY };\n opacity = { from: 0, to: 1 };\n delay += duration;\n }\n else if (diff.removed[datumId]) {\n opacity = { from: 1, to: 0 };\n delay = 0;\n }\n var props = [translate, opacity];\n this.animationManager.animateManyWithThrottle(this.id + \"_ready-update_\" + node.id, props, {\n disableInteractions: false,\n delay: delay,\n duration: duration,\n ease: easeOut,\n throttleId: this.id,\n throttleGroup: animationGroup,\n onUpdate: function (_a) {\n var _b = __read$K(_a, 2), translationY = _b[0], opacity = _b[1];\n node.translationY = translationY;\n node.opacity = opacity;\n },\n onComplete: function () {\n selection.cleanup();\n },\n });\n };\n Axis.prototype.resetSelectionNodes = function () {\n var _a = this, gridLineGroupSelection = _a.gridLineGroupSelection, tickLineGroupSelection = _a.tickLineGroupSelection, tickLabelGroupSelection = _a.tickLabelGroupSelection;\n gridLineGroupSelection.cleanup();\n tickLineGroupSelection.cleanup();\n tickLabelGroupSelection.cleanup();\n // We need raw `translationY` values on `datum` for accurate label collision detection in axes.update()\n // But node `translationY` values must be rounded to get pixel grid alignment\n var resetFn = function (node) {\n node.translationY = Math.round(node.datum.translationY);\n node.opacity = 1;\n };\n gridLineGroupSelection.each(resetFn);\n tickLineGroupSelection.each(resetFn);\n tickLabelGroupSelection.each(resetFn);\n };\n Axis.prototype.calculateUpdateDiff = function (previous, tickData) {\n var _a;\n var added = new Set();\n var removed = new Set();\n var tickCount = Math.max(previous.length, tickData.ticks.length);\n for (var i = 0; i < tickCount; i++) {\n var prev = previous[i];\n var tick = (_a = tickData.ticks[i]) === null || _a === void 0 ? void 0 : _a.tickId;\n if (prev === tick) {\n continue;\n }\n if (removed.has(tick)) {\n removed.delete(tick);\n }\n else if (tick) {\n added.add(tick);\n }\n if (added.has(prev)) {\n added.delete(prev);\n }\n else if (prev) {\n removed.add(prev);\n }\n }\n var addedKeys = {};\n var removedKeys = {};\n added.forEach(function (a) {\n addedKeys[a] = true;\n });\n removed.forEach(function (r) {\n removedKeys[r] = true;\n });\n return {\n changed: added.size > 0 || removed.size > 0,\n tickCount: tickCount,\n added: addedKeys,\n removed: removedKeys,\n };\n };\n Axis.defaultTickMinSpacing = 50;\n __decorate$1F([\n Validate(BOOLEAN)\n ], Axis.prototype, \"nice\", void 0);\n __decorate$1F([\n Validate(STRING_ARRAY)\n ], Axis.prototype, \"keys\", void 0);\n __decorate$1F([\n Validate(GRID_STYLE)\n ], Axis.prototype, \"gridStyle\", void 0);\n return Axis;\n}());\n\nvar __decorate$1E = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar AxisTitle = /** @class */ (function () {\n function AxisTitle() {\n this.enabled = false;\n this.text = undefined;\n this.fontStyle = undefined;\n this.fontWeight = undefined;\n this.fontSize = 10;\n this.fontFamily = 'sans-serif';\n this.color = undefined;\n this.wrapping = 'always';\n this.formatter = undefined;\n }\n __decorate$1E([\n Validate(BOOLEAN)\n ], AxisTitle.prototype, \"enabled\", void 0);\n __decorate$1E([\n Validate(OPT_STRING)\n ], AxisTitle.prototype, \"text\", void 0);\n __decorate$1E([\n Validate(OPT_FONT_STYLE)\n ], AxisTitle.prototype, \"fontStyle\", void 0);\n __decorate$1E([\n Validate(OPT_FONT_WEIGHT)\n ], AxisTitle.prototype, \"fontWeight\", void 0);\n __decorate$1E([\n Validate(NUMBER(0))\n ], AxisTitle.prototype, \"fontSize\", void 0);\n __decorate$1E([\n Validate(STRING)\n ], AxisTitle.prototype, \"fontFamily\", void 0);\n __decorate$1E([\n Validate(OPT_COLOR_STRING)\n ], AxisTitle.prototype, \"color\", void 0);\n __decorate$1E([\n Validate(TEXT_WRAP)\n ], AxisTitle.prototype, \"wrapping\", void 0);\n __decorate$1E([\n Validate(OPT_FUNCTION)\n ], AxisTitle.prototype, \"formatter\", void 0);\n return AxisTitle;\n}());\n\nvar __extends$2m = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$1D = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar DropShadow = /** @class */ (function (_super) {\n __extends$2m(DropShadow, _super);\n function DropShadow() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.enabled = true;\n _this.color = 'rgba(0, 0, 0, 0.5)';\n _this.xOffset = 0;\n _this.yOffset = 0;\n _this.blur = 5;\n return _this;\n }\n __decorate$1D([\n Validate(BOOLEAN),\n SceneChangeDetection({ redraw: RedrawType.MAJOR })\n ], DropShadow.prototype, \"enabled\", void 0);\n __decorate$1D([\n Validate(COLOR_STRING),\n SceneChangeDetection({ redraw: RedrawType.MAJOR })\n ], DropShadow.prototype, \"color\", void 0);\n __decorate$1D([\n Validate(NUMBER()),\n SceneChangeDetection({ redraw: RedrawType.MAJOR })\n ], DropShadow.prototype, \"xOffset\", void 0);\n __decorate$1D([\n Validate(NUMBER()),\n SceneChangeDetection({ redraw: RedrawType.MAJOR })\n ], DropShadow.prototype, \"yOffset\", void 0);\n __decorate$1D([\n Validate(NUMBER(0)),\n SceneChangeDetection({ redraw: RedrawType.MAJOR })\n ], DropShadow.prototype, \"blur\", void 0);\n return DropShadow;\n}(ChangeDetectable));\n\nvar __extends$2l = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __read$J = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\n/**\n * Maps continuous domain to a continuous range.\n */\nvar LinearScale$1 = /** @class */ (function (_super) {\n __extends$2l(LinearScale, _super);\n function LinearScale() {\n var _this = _super.call(this, [0, 1], [0, 1]) || this;\n _this.type = 'linear';\n return _this;\n }\n LinearScale.prototype.toDomain = function (d) {\n return d;\n };\n LinearScale.prototype.ticks = function () {\n var _a;\n var count = (_a = this.tickCount) !== null && _a !== void 0 ? _a : ContinuousScale.defaultTickCount;\n if (!this.domain || this.domain.length < 2 || count < 1 || this.domain.some(function (d) { return !isFinite(d); })) {\n return [];\n }\n this.refresh();\n var _b = __read$J(this.getDomain(), 2), d0 = _b[0], d1 = _b[1];\n var interval = this.interval;\n if (interval) {\n var step = Math.abs(interval);\n if (!this.isDenseInterval({ start: d0, stop: d1, interval: step })) {\n return range(d0, d1, step);\n }\n }\n return ticks(d0, d1, count, this.minTickCount, this.maxTickCount);\n };\n LinearScale.prototype.update = function () {\n if (!this.domain || this.domain.length < 2) {\n return;\n }\n if (this.nice) {\n this.updateNiceDomain();\n }\n };\n /**\n * Extends the domain so that it starts and ends on nice round values.\n * @param count Tick count.\n */\n LinearScale.prototype.updateNiceDomain = function () {\n var _a, _b;\n var count = (_a = this.tickCount) !== null && _a !== void 0 ? _a : ContinuousScale.defaultTickCount;\n var _c = __read$J(this.domain, 2), start = _c[0], stop = _c[1];\n if (count < 1) {\n this.niceDomain = [start, stop];\n return;\n }\n if (count === 1) {\n this.niceDomain = singleTickDomain(start, stop);\n return;\n }\n var maxAttempts = 4;\n var prev0 = start;\n var prev1 = stop;\n for (var i = 0; i < maxAttempts; i++) {\n var step = (_b = this.interval) !== null && _b !== void 0 ? _b : tickStep(start, stop, count, this.minTickCount, this.maxTickCount);\n var _d = __read$J(this.domain, 2), d0 = _d[0], d1 = _d[1];\n if (step >= 1) {\n start = Math.floor(d0 / step) * step;\n stop = Math.ceil(d1 / step) * step;\n }\n else {\n // Prevent floating point error\n var s = 1 / step;\n start = Math.floor(d0 * s) / s;\n stop = Math.ceil(d1 * s) / s;\n }\n if (start === prev0 && stop === prev1) {\n break;\n }\n prev0 = start;\n prev1 = stop;\n }\n this.niceDomain = [start, stop];\n };\n LinearScale.prototype.tickFormat = function (_a) {\n var ticks = _a.ticks, specifier = _a.specifier;\n return tickFormat(ticks !== null && ticks !== void 0 ? ticks : this.ticks(), specifier);\n };\n return LinearScale;\n}(ContinuousScale));\n\nfunction isEqual(a, b, epsilon) {\n if (epsilon === void 0) { epsilon = 1e-10; }\n return Math.abs(a - b) < epsilon;\n}\n/**\n * `Number.toFixed(n)` always formats a number so that it has `n` digits after the decimal point.\n * For example, `Number(0.00003427).toFixed(2)` returns `0.00`.\n * That's not very helpful, because all the meaningful information is lost.\n * In this case we would want the formatted value to have at least two significant digits: `0.000034`,\n * not two fraction digits.\n * @param value\n * @param fractionOrSignificantDigits\n */\nfunction toFixed(value, fractionOrSignificantDigits) {\n if (fractionOrSignificantDigits === void 0) { fractionOrSignificantDigits = 2; }\n var power = Math.floor(Math.log(Math.abs(value)) / Math.LN10);\n if (power >= 0 || !isFinite(power)) {\n return value.toFixed(fractionOrSignificantDigits); // fraction digits\n }\n return value.toFixed(Math.abs(power) - 1 + fractionOrSignificantDigits); // significant digits\n}\n/**\n * Returns the mathematically correct n modulus of m. For context, the JS % operator is remainder\n * NOT modulus, which is why this is needed.\n */\nfunction mod(n, m) {\n if (n >= 0) {\n return Math.floor(n % m);\n }\n return Math.floor((n % m) + m);\n}\n\nfunction isPointInSector(x, y, sector) {\n var radius = Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2));\n var innerRadius = sector.innerRadius, outerRadius = sector.outerRadius;\n if (radius < Math.min(innerRadius, outerRadius) || radius > Math.max(innerRadius, outerRadius)) {\n return false;\n }\n // Start and End angles are expected to be [-90, 270]\n // while Math.atan2 returns [-180, 180]\n var angle = Math.atan2(y, x);\n if (angle < -Math.PI / 2) {\n angle += 2 * Math.PI;\n }\n // Start is actually bigger than End clock-wise\n var startAngle = sector.startAngle, endAngle = sector.endAngle;\n if (endAngle === -Math.PI / 2) {\n return angle < startAngle;\n }\n if (startAngle === (3 * Math.PI) / 2) {\n return angle > endAngle;\n }\n return angle <= endAngle && angle >= startAngle;\n}\nfunction lineCollidesSector(line, sector) {\n var startAngle = sector.startAngle, endAngle = sector.endAngle, innerRadius = sector.innerRadius, outerRadius = sector.outerRadius;\n var outerStart = { x: outerRadius * Math.cos(startAngle), y: outerRadius * Math.sin(startAngle) };\n var outerEnd = { x: outerRadius * Math.cos(endAngle), y: outerRadius * Math.sin(endAngle) };\n var innerStart = innerRadius === 0\n ? { x: 0, y: 0 }\n : { x: innerRadius * Math.cos(startAngle), y: innerRadius * Math.sin(startAngle) };\n var innerEnd = innerRadius === 0\n ? { x: 0, y: 0 }\n : { x: innerRadius * Math.cos(endAngle), y: innerRadius * Math.sin(endAngle) };\n return (segmentIntersection(line.start.x, line.start.y, line.end.x, line.end.y, outerStart.x, outerStart.y, innerStart.x, innerStart.y) != null ||\n segmentIntersection(line.start.x, line.start.y, line.end.x, line.end.y, outerEnd.x, outerEnd.y, innerEnd.x, innerEnd.y) != null ||\n arcIntersections(0, 0, outerRadius, startAngle, endAngle, true, line.start.x, line.start.y, line.end.x, line.end.y).length > 0);\n}\nfunction boxCollidesSector(box, sector) {\n var topLeft = { x: box.x, y: box.y };\n var topRight = { x: box.x + box.width, y: box.y };\n var bottomLeft = { x: box.x, y: box.y + box.height };\n var bottomRight = { x: box.x + box.width, y: box.y + box.height };\n return (lineCollidesSector({ start: topLeft, end: topRight }, sector) ||\n lineCollidesSector({ start: bottomLeft, end: bottomRight }, sector));\n}\n\nvar __extends$2k = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$1C = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar Sector = /** @class */ (function (_super) {\n __extends$2k(Sector, _super);\n function Sector() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.centerX = 0;\n _this.centerY = 0;\n _this.innerRadius = 10;\n _this.outerRadius = 20;\n _this.startAngle = 0;\n _this.endAngle = Math.PI * 2;\n _this.angleOffset = 0;\n return _this;\n }\n Sector.prototype.computeBBox = function () {\n var radius = this.outerRadius;\n return new BBox(this.centerX - radius, this.centerY - radius, radius * 2, radius * 2);\n };\n Sector.prototype.updatePath = function () {\n var path = this.path;\n var angleOffset = this.angleOffset;\n var startAngle = this.startAngle + angleOffset;\n var endAngle = this.endAngle + angleOffset;\n var innerRadius = Math.min(this.innerRadius, this.outerRadius);\n var outerRadius = Math.max(this.innerRadius, this.outerRadius);\n var fullPie = isEqual(normalizeAngle360(this.startAngle), normalizeAngle360(this.endAngle));\n var centerX = this.centerX;\n var centerY = this.centerY;\n path.clear();\n if (fullPie) {\n path.arc(centerX, centerY, outerRadius, startAngle, endAngle);\n if (innerRadius > 0) {\n path.moveTo(centerX + innerRadius * Math.cos(endAngle), centerY + innerRadius * Math.sin(endAngle));\n path.arc(centerX, centerY, innerRadius, endAngle, startAngle, true);\n }\n }\n else {\n path.moveTo(centerX + innerRadius * Math.cos(startAngle), centerY + innerRadius * Math.sin(startAngle));\n path.arc(centerX, centerY, outerRadius, startAngle, endAngle);\n if (innerRadius > 0) {\n path.arc(centerX, centerY, innerRadius, endAngle, startAngle, true);\n }\n else {\n path.lineTo(centerX, centerY);\n }\n }\n path.closePath();\n this.dirtyPath = false;\n };\n Sector.prototype.isPointInPath = function (x, y) {\n var angleOffset = this.angleOffset;\n var startAngle = this.startAngle + angleOffset;\n var endAngle = this.endAngle + angleOffset;\n var innerRadius = Math.min(this.innerRadius, this.outerRadius);\n var outerRadius = Math.max(this.innerRadius, this.outerRadius);\n var point = this.transformPoint(x, y);\n return isPointInSector(point.x, point.y, { startAngle: startAngle, endAngle: endAngle, innerRadius: innerRadius, outerRadius: outerRadius });\n };\n Sector.className = 'Sector';\n __decorate$1C([\n ScenePathChangeDetection()\n ], Sector.prototype, \"centerX\", void 0);\n __decorate$1C([\n ScenePathChangeDetection()\n ], Sector.prototype, \"centerY\", void 0);\n __decorate$1C([\n ScenePathChangeDetection()\n ], Sector.prototype, \"innerRadius\", void 0);\n __decorate$1C([\n ScenePathChangeDetection()\n ], Sector.prototype, \"outerRadius\", void 0);\n __decorate$1C([\n ScenePathChangeDetection()\n ], Sector.prototype, \"startAngle\", void 0);\n __decorate$1C([\n ScenePathChangeDetection()\n ], Sector.prototype, \"endAngle\", void 0);\n __decorate$1C([\n ScenePathChangeDetection()\n ], Sector.prototype, \"angleOffset\", void 0);\n return Sector;\n}(Path));\n\nvar __extends$2j = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar PolarSeries = /** @class */ (function (_super) {\n __extends$2j(PolarSeries, _super);\n function PolarSeries(_a) {\n var _b, _c;\n var moduleCtx = _a.moduleCtx, _d = _a.useLabelLayer, useLabelLayer = _d === void 0 ? false : _d, _e = _a.pickModes, pickModes = _e === void 0 ? [SeriesNodePickMode.EXACT_SHAPE_MATCH] : _e;\n var _this = _super.call(this, {\n moduleCtx: moduleCtx,\n useLabelLayer: useLabelLayer,\n pickModes: pickModes,\n contentGroupVirtual: false,\n directionKeys: (_b = {},\n _b[ChartAxisDirection.X] = ['angleKey'],\n _b[ChartAxisDirection.Y] = ['radiusKey'],\n _b),\n directionNames: (_c = {},\n _c[ChartAxisDirection.X] = ['angleName'],\n _c[ChartAxisDirection.Y] = ['radiusName'],\n _c),\n }) || this;\n /**\n * The center of the polar series (for example, the center of a pie).\n * If the polar chart has multiple series, all of them will have their\n * center set to the same value as a result of the polar chart layout.\n * The center coordinates are not supposed to be set by the user.\n */\n _this.centerX = 0;\n _this.centerY = 0;\n /**\n * The maximum radius the series can use.\n * This value is set automatically as a result of the polar chart layout\n * and is not supposed to be set by the user.\n */\n _this.radius = 0;\n return _this;\n }\n PolarSeries.prototype.getLabelData = function () {\n return [];\n };\n PolarSeries.prototype.computeLabelsBBox = function (_options, _seriesRect) {\n return null;\n };\n return PolarSeries;\n}(Series));\n\nvar __extends$2i = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign$G = (undefined && undefined.__assign) || function () {\n __assign$G = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$G.apply(this, arguments);\n};\nvar __decorate$1B = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __awaiter$b = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator$b = (undefined && undefined.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nvar __read$I = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray$o = (undefined && undefined.__spreadArray) || function (to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\n to[j] = from[i];\n return to;\n};\nvar PieSeriesNodeBaseClickEvent = /** @class */ (function (_super) {\n __extends$2i(PieSeriesNodeBaseClickEvent, _super);\n function PieSeriesNodeBaseClickEvent(angleKey, calloutLabelKey, sectorLabelKey, radiusKey, nativeEvent, datum, series) {\n var _this = _super.call(this, nativeEvent, datum, series) || this;\n _this.angleKey = angleKey;\n _this.calloutLabelKey = calloutLabelKey;\n _this.sectorLabelKey = sectorLabelKey;\n _this.radiusKey = radiusKey;\n return _this;\n }\n return PieSeriesNodeBaseClickEvent;\n}(SeriesNodeBaseClickEvent));\nvar PieSeriesNodeClickEvent = /** @class */ (function (_super) {\n __extends$2i(PieSeriesNodeClickEvent, _super);\n function PieSeriesNodeClickEvent() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = 'nodeClick';\n return _this;\n }\n return PieSeriesNodeClickEvent;\n}(PieSeriesNodeBaseClickEvent));\nvar PieSeriesNodeDoubleClickEvent = /** @class */ (function (_super) {\n __extends$2i(PieSeriesNodeDoubleClickEvent, _super);\n function PieSeriesNodeDoubleClickEvent() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = 'nodeDoubleClick';\n return _this;\n }\n return PieSeriesNodeDoubleClickEvent;\n}(PieSeriesNodeBaseClickEvent));\nvar PieNodeTag;\n(function (PieNodeTag) {\n PieNodeTag[PieNodeTag[\"Sector\"] = 0] = \"Sector\";\n PieNodeTag[PieNodeTag[\"Callout\"] = 1] = \"Callout\";\n PieNodeTag[PieNodeTag[\"Label\"] = 2] = \"Label\";\n})(PieNodeTag || (PieNodeTag = {}));\nvar PieSeriesCalloutLabel = /** @class */ (function (_super) {\n __extends$2i(PieSeriesCalloutLabel, _super);\n function PieSeriesCalloutLabel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.offset = 3; // from the callout line\n _this.minAngle = 0; // in degrees\n _this.formatter = undefined;\n _this.minSpacing = 4;\n _this.maxCollisionOffset = 50;\n _this.avoidCollisions = true;\n return _this;\n }\n __decorate$1B([\n Validate(NUMBER(0))\n ], PieSeriesCalloutLabel.prototype, \"offset\", void 0);\n __decorate$1B([\n Validate(NUMBER(0))\n ], PieSeriesCalloutLabel.prototype, \"minAngle\", void 0);\n __decorate$1B([\n Validate(OPT_FUNCTION)\n ], PieSeriesCalloutLabel.prototype, \"formatter\", void 0);\n __decorate$1B([\n Validate(NUMBER(0))\n ], PieSeriesCalloutLabel.prototype, \"minSpacing\", void 0);\n __decorate$1B([\n Validate(NUMBER(0))\n ], PieSeriesCalloutLabel.prototype, \"maxCollisionOffset\", void 0);\n __decorate$1B([\n Validate(BOOLEAN)\n ], PieSeriesCalloutLabel.prototype, \"avoidCollisions\", void 0);\n return PieSeriesCalloutLabel;\n}(Label$1));\nvar PieSeriesSectorLabel = /** @class */ (function (_super) {\n __extends$2i(PieSeriesSectorLabel, _super);\n function PieSeriesSectorLabel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.positionOffset = 0;\n _this.positionRatio = 0.5;\n _this.formatter = undefined;\n return _this;\n }\n __decorate$1B([\n Validate(NUMBER())\n ], PieSeriesSectorLabel.prototype, \"positionOffset\", void 0);\n __decorate$1B([\n Validate(NUMBER(0, 1))\n ], PieSeriesSectorLabel.prototype, \"positionRatio\", void 0);\n __decorate$1B([\n Validate(OPT_FUNCTION)\n ], PieSeriesSectorLabel.prototype, \"formatter\", void 0);\n return PieSeriesSectorLabel;\n}(Label$1));\nvar PieSeriesCalloutLine = /** @class */ (function () {\n function PieSeriesCalloutLine() {\n this.colors = undefined;\n this.length = 10;\n this.strokeWidth = 1;\n }\n __decorate$1B([\n Validate(OPT_COLOR_STRING_ARRAY)\n ], PieSeriesCalloutLine.prototype, \"colors\", void 0);\n __decorate$1B([\n Validate(NUMBER(0))\n ], PieSeriesCalloutLine.prototype, \"length\", void 0);\n __decorate$1B([\n Validate(NUMBER(0))\n ], PieSeriesCalloutLine.prototype, \"strokeWidth\", void 0);\n return PieSeriesCalloutLine;\n}());\nvar PieSeriesTooltip = /** @class */ (function (_super) {\n __extends$2i(PieSeriesTooltip, _super);\n function PieSeriesTooltip() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.renderer = undefined;\n return _this;\n }\n __decorate$1B([\n Validate(OPT_FUNCTION)\n ], PieSeriesTooltip.prototype, \"renderer\", void 0);\n return PieSeriesTooltip;\n}(SeriesTooltip));\nvar PieTitle = /** @class */ (function (_super) {\n __extends$2i(PieTitle, _super);\n function PieTitle() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.showInLegend = false;\n return _this;\n }\n __decorate$1B([\n Validate(BOOLEAN)\n ], PieTitle.prototype, \"showInLegend\", void 0);\n return PieTitle;\n}(Caption));\nvar DoughnutInnerLabel = /** @class */ (function (_super) {\n __extends$2i(DoughnutInnerLabel, _super);\n function DoughnutInnerLabel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.text = '';\n _this.margin = 2;\n return _this;\n }\n __decorate$1B([\n Validate(STRING)\n ], DoughnutInnerLabel.prototype, \"text\", void 0);\n __decorate$1B([\n Validate(NUMBER())\n ], DoughnutInnerLabel.prototype, \"margin\", void 0);\n return DoughnutInnerLabel;\n}(Label$1));\nvar DoughnutInnerCircle = /** @class */ (function () {\n function DoughnutInnerCircle() {\n this.fill = 'transparent';\n this.fillOpacity = 1;\n }\n __decorate$1B([\n Validate(COLOR_STRING)\n ], DoughnutInnerCircle.prototype, \"fill\", void 0);\n __decorate$1B([\n Validate(OPT_NUMBER(0, 1))\n ], DoughnutInnerCircle.prototype, \"fillOpacity\", void 0);\n return DoughnutInnerCircle;\n}());\nvar PieStateMachine = /** @class */ (function (_super) {\n __extends$2i(PieStateMachine, _super);\n function PieStateMachine() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n return PieStateMachine;\n}(StateMachine));\nvar PieSeries = /** @class */ (function (_super) {\n __extends$2i(PieSeries, _super);\n function PieSeries(moduleCtx) {\n var _a, _b, _c;\n var _this = _super.call(this, { moduleCtx: moduleCtx, useLabelLayer: true }) || this;\n _this.radiusScale = new LinearScale$1();\n _this.groupSelection = Selection.select(_this.contentGroup, Group);\n _this.highlightSelection = Selection.select(_this.highlightGroup, Group);\n _this.nodeData = [];\n // When a user toggles a series item (e.g. from the legend), its boolean state is recorded here.\n _this.seriesItemEnabled = [];\n _this.title = undefined;\n _this.calloutLabel = new PieSeriesCalloutLabel();\n _this.sectorLabel = new PieSeriesSectorLabel();\n _this.calloutLine = new PieSeriesCalloutLine();\n _this.tooltip = new PieSeriesTooltip();\n /**\n * The key of the numeric field to use to determine the angle (for example,\n * a pie sector angle).\n */\n _this.angleKey = '';\n _this.angleName = '';\n _this.innerLabels = [];\n _this.innerCircle = undefined;\n /**\n * The key of the numeric field to use to determine the radii of pie sectors.\n * The largest value will correspond to the full radius and smaller values to\n * proportionally smaller radii.\n */\n _this.radiusKey = undefined;\n _this.radiusName = undefined;\n _this.radiusMin = undefined;\n _this.radiusMax = undefined;\n _this.calloutLabelKey = undefined;\n _this.calloutLabelName = undefined;\n _this.sectorLabelKey = undefined;\n _this.sectorLabelName = undefined;\n _this.legendItemKey = undefined;\n _this.fills = ['#c16068', '#a2bf8a', '#ebcc87', '#80a0c3', '#b58dae', '#85c0d1'];\n _this.strokes = ['#874349', '#718661', '#a48f5f', '#5a7088', '#7f637a', '#5d8692'];\n _this.fillOpacity = 1;\n _this.strokeOpacity = 1;\n _this.lineDash = [0];\n _this.lineDashOffset = 0;\n _this.formatter = undefined;\n /**\n * The series rotation in degrees.\n */\n _this.rotation = 0;\n _this.outerRadiusOffset = 0;\n _this.outerRadiusRatio = 1;\n _this.innerRadiusOffset = 0;\n _this.innerRadiusRatio = 1;\n _this.strokeWidth = 1;\n _this.shadow = undefined;\n _this.highlightStyle = new HighlightStyle();\n _this.surroundingRadius = undefined;\n _this.angleScale = new LinearScale$1();\n // Each sector is a ratio of the whole, where all ratios add up to 1.\n _this.angleScale.domain = [0, 1];\n // Add 90 deg to start the first pie at 12 o'clock.\n _this.angleScale.range = [-Math.PI, Math.PI].map(function (angle) { return angle + Math.PI / 2; });\n _this.backgroundGroup = _this.rootGroup.appendChild(new Group({\n name: _this.id + \"-background\",\n layer: true,\n zIndex: Layers.SERIES_BACKGROUND_ZINDEX,\n }));\n var pieCalloutLabels = new Group({ name: 'pieCalloutLabels' });\n var pieSectorLabels = new Group({ name: 'pieSectorLabels' });\n var innerLabels = new Group({ name: 'innerLabels' });\n (_a = _this.labelGroup) === null || _a === void 0 ? void 0 : _a.append(pieCalloutLabels);\n (_b = _this.labelGroup) === null || _b === void 0 ? void 0 : _b.append(pieSectorLabels);\n (_c = _this.labelGroup) === null || _c === void 0 ? void 0 : _c.append(innerLabels);\n _this.calloutLabelSelection = Selection.select(pieCalloutLabels, Group);\n _this.sectorLabelSelection = Selection.select(pieSectorLabels, Text);\n _this.innerLabelsSelection = Selection.select(innerLabels, Text);\n _this.animationState = new PieStateMachine('empty', {\n empty: {\n on: {\n update: {\n target: 'ready',\n action: function () { return _this.animateEmptyUpdateReady(); },\n },\n },\n },\n ready: {\n on: {\n update: {\n target: 'ready',\n action: function () { return _this.animateReadyUpdateReady(); },\n },\n },\n },\n });\n return _this;\n }\n Object.defineProperty(PieSeries.prototype, \"data\", {\n get: function () {\n return this._data;\n },\n set: function (input) {\n this._data = input;\n this.processSeriesItemEnabled();\n },\n enumerable: false,\n configurable: true\n });\n PieSeries.prototype.addChartEventListeners = function () {\n var _this = this;\n var _a;\n (_a = this.ctx.chartEventManager) === null || _a === void 0 ? void 0 : _a.addListener('legend-item-click', function (event) { return _this.onLegendItemClick(event); });\n };\n PieSeries.prototype.visibleChanged = function () {\n this.processSeriesItemEnabled();\n };\n PieSeries.prototype.processSeriesItemEnabled = function () {\n var _a;\n var _b = this, data = _b.data, visible = _b.visible;\n this.seriesItemEnabled = (_a = data === null || data === void 0 ? void 0 : data.map(function () { return visible; })) !== null && _a !== void 0 ? _a : [];\n };\n PieSeries.prototype.getDomain = function (direction) {\n if (direction === ChartAxisDirection.X) {\n return this.angleScale.domain;\n }\n else {\n return this.radiusScale.domain;\n }\n };\n PieSeries.prototype.processData = function (dataController) {\n var _a, _b;\n return __awaiter$b(this, void 0, void 0, function () {\n var _c, data, _d, angleKey, radiusKey, calloutLabelKey, sectorLabelKey, legendItemKey, seriesItemEnabled, extraProps, _e, dataModel, processedData;\n return __generator$b(this, function (_f) {\n switch (_f.label) {\n case 0:\n _c = this.data, data = _c === void 0 ? [] : _c;\n _d = this, angleKey = _d.angleKey, radiusKey = _d.radiusKey, calloutLabelKey = _d.calloutLabelKey, sectorLabelKey = _d.sectorLabelKey, legendItemKey = _d.legendItemKey, seriesItemEnabled = _d.seriesItemEnabled;\n if (!angleKey)\n return [2 /*return*/];\n extraProps = [];\n if (radiusKey) {\n extraProps.push(rangedValueProperty(this, radiusKey, {\n id: 'radiusValue',\n min: (_a = this.radiusMin) !== null && _a !== void 0 ? _a : 0,\n max: this.radiusMax,\n }), valueProperty(this, radiusKey, true, { id: \"radiusRaw\" }), // Raw value pass-through.\n normalisePropertyTo(this, { id: 'radiusValue' }, [0, 1], (_b = this.radiusMin) !== null && _b !== void 0 ? _b : 0, this.radiusMax));\n extraProps.push();\n }\n if (calloutLabelKey) {\n extraProps.push(valueProperty(this, calloutLabelKey, false, { id: \"calloutLabelValue\" }));\n }\n if (sectorLabelKey) {\n extraProps.push(valueProperty(this, sectorLabelKey, false, { id: \"sectorLabelValue\" }));\n }\n if (legendItemKey) {\n extraProps.push(valueProperty(this, legendItemKey, false, { id: \"legendItemValue\" }));\n }\n data = data.map(function (d, idx) {\n var _a;\n return (seriesItemEnabled[idx] ? d : __assign$G(__assign$G({}, d), (_a = {}, _a[angleKey] = 0, _a)));\n });\n return [4 /*yield*/, dataController.request(this.id, data, {\n props: __spreadArray$o([\n accumulativeValueProperty(this, angleKey, true, { id: \"angleValue\" }),\n valueProperty(this, angleKey, true, { id: \"angleRaw\" }),\n normalisePropertyTo(this, { id: 'angleValue' }, [0, 1], 0)\n ], __read$I(extraProps)),\n })];\n case 1:\n _e = _f.sent(), dataModel = _e.dataModel, processedData = _e.processedData;\n this.dataModel = dataModel;\n this.processedData = processedData;\n return [2 /*return*/];\n }\n });\n });\n };\n PieSeries.prototype.maybeRefreshNodeData = function () {\n if (!this.nodeDataRefresh)\n return;\n var _a = __read$I(this._createNodeData(), 1), _b = _a[0], _c = _b === void 0 ? {} : _b, _d = _c.nodeData, nodeData = _d === void 0 ? [] : _d;\n this.nodeData = nodeData;\n this.nodeDataRefresh = false;\n };\n PieSeries.prototype.createNodeData = function () {\n return __awaiter$b(this, void 0, void 0, function () {\n return __generator$b(this, function (_a) {\n return [2 /*return*/, this._createNodeData()];\n });\n });\n };\n PieSeries.prototype.getProcessedDataIndexes = function (dataModel) {\n var angleIdx = dataModel.resolveProcessedDataIndexById(this, \"angleValue\").index;\n var radiusIdx = this.radiusKey ? dataModel.resolveProcessedDataIndexById(this, \"radiusValue\").index : -1;\n var calloutLabelIdx = this.calloutLabelKey\n ? dataModel.resolveProcessedDataIndexById(this, \"calloutLabelValue\").index\n : -1;\n var sectorLabelIdx = this.sectorLabelKey\n ? dataModel.resolveProcessedDataIndexById(this, \"sectorLabelValue\").index\n : -1;\n var legendItemIdx = this.legendItemKey\n ? dataModel.resolveProcessedDataIndexById(this, \"legendItemValue\").index\n : -1;\n return { angleIdx: angleIdx, radiusIdx: radiusIdx, calloutLabelIdx: calloutLabelIdx, sectorLabelIdx: sectorLabelIdx, legendItemIdx: legendItemIdx };\n };\n PieSeries.prototype._createNodeData = function () {\n var _this = this;\n var _a = this, seriesId = _a.id, processedData = _a.processedData, dataModel = _a.dataModel, rotation = _a.rotation, angleScale = _a.angleScale;\n if (!processedData || !dataModel || processedData.type !== 'ungrouped')\n return [];\n var _b = this.getProcessedDataIndexes(dataModel), angleIdx = _b.angleIdx, radiusIdx = _b.radiusIdx, calloutLabelIdx = _b.calloutLabelIdx, sectorLabelIdx = _b.sectorLabelIdx, legendItemIdx = _b.legendItemIdx;\n var currentStart = 0;\n var nodeData = processedData.data.map(function (group, index) {\n var _a;\n var datum = group.datum, values = group.values;\n var currentValue = values[angleIdx];\n var startAngle = angleScale.convert(currentStart) + toRadians$1(rotation);\n currentStart = currentValue;\n var endAngle = angleScale.convert(currentStart) + toRadians$1(rotation);\n var span = Math.abs(endAngle - startAngle);\n var midAngle = startAngle + span / 2;\n var angleValue = values[angleIdx + 1];\n var radius = radiusIdx >= 0 ? (_a = values[radiusIdx]) !== null && _a !== void 0 ? _a : 1 : 1;\n var radiusValue = radiusIdx >= 0 ? values[radiusIdx + 1] : undefined;\n var legendItemValue = legendItemIdx >= 0 ? values[legendItemIdx] : undefined;\n var labels = _this.getLabels(datum, midAngle, span, true, currentValue, radiusValue, values[calloutLabelIdx], values[sectorLabelIdx], legendItemValue);\n var sectorFormat = _this.getSectorFormat(datum, index, index, false);\n return __assign$G({ itemId: index, series: _this, datum: datum, index: index, angleValue: angleValue, midAngle: midAngle, midCos: Math.cos(midAngle), midSin: Math.sin(midAngle), startAngle: startAngle, endAngle: endAngle, sectorFormat: sectorFormat, radius: radius, radiusValue: radiusValue, legendItemValue: legendItemValue }, labels);\n });\n return [\n {\n itemId: seriesId,\n nodeData: nodeData,\n labelData: nodeData,\n },\n ];\n };\n PieSeries.prototype.getLabels = function (datum, midAngle, span, skipDisabled, angleValue, radiusValue, calloutLabelValue, sectorLabelValue, legendItemValue) {\n var _a = this, calloutLabel = _a.calloutLabel, sectorLabel = _a.sectorLabel, legendItemKey = _a.legendItemKey, callbackCache = _a.ctx.callbackCache;\n var calloutLabelKey = !skipDisabled || calloutLabel.enabled ? this.calloutLabelKey : undefined;\n var sectorLabelKey = !skipDisabled || sectorLabel.enabled ? this.sectorLabelKey : undefined;\n if (!calloutLabelKey && !sectorLabelKey && !legendItemKey)\n return {};\n var labelFormatterParams = this.getLabelFormatterParams(datum, angleValue, radiusValue, calloutLabelValue, sectorLabelValue);\n var calloutLabelText;\n if (calloutLabelKey) {\n var calloutLabelMinAngle = toRadians$1(calloutLabel.minAngle);\n var calloutLabelVisible = span > calloutLabelMinAngle;\n if (!calloutLabelVisible) {\n calloutLabelText = undefined;\n }\n else if (calloutLabel.formatter) {\n calloutLabelText = callbackCache.call(calloutLabel.formatter, labelFormatterParams);\n }\n else {\n calloutLabelText = String(calloutLabelValue);\n }\n }\n var sectorLabelText;\n if (sectorLabelKey) {\n if (sectorLabel.formatter) {\n sectorLabelText = callbackCache.call(sectorLabel.formatter, labelFormatterParams);\n }\n else {\n sectorLabelText = String(sectorLabelValue);\n }\n }\n return __assign$G(__assign$G(__assign$G({}, (calloutLabelText != null\n ? {\n calloutLabel: __assign$G(__assign$G({}, this.getTextAlignment(midAngle)), { text: calloutLabelText, hidden: false, collisionTextAlign: undefined, collisionOffsetY: 0, box: undefined }),\n }\n : {})), (sectorLabelText != null ? { sectorLabel: { text: sectorLabelText } } : {})), (legendItemKey != null && legendItemValue != null\n ? { legendItem: { key: legendItemKey, text: legendItemValue } }\n : {}));\n };\n PieSeries.prototype.getLabelFormatterParams = function (datum, angleValue, radiusValue, calloutLabelValue, sectorLabelValue) {\n var _a = this, seriesId = _a.id, radiusKey = _a.radiusKey, radiusName = _a.radiusName, angleKey = _a.angleKey, angleName = _a.angleName, calloutLabelKey = _a.calloutLabelKey, calloutLabelName = _a.calloutLabelName, sectorLabelKey = _a.sectorLabelKey, sectorLabelName = _a.sectorLabelName;\n return {\n datum: datum,\n angleKey: angleKey,\n angleValue: angleValue,\n angleName: angleName,\n radiusKey: radiusKey,\n radiusValue: radiusValue,\n radiusName: radiusName,\n calloutLabelKey: calloutLabelKey,\n calloutLabelValue: calloutLabelValue,\n calloutLabelName: calloutLabelName,\n sectorLabelKey: sectorLabelKey,\n sectorLabelValue: sectorLabelValue,\n sectorLabelName: sectorLabelName,\n seriesId: seriesId,\n };\n };\n PieSeries.prototype.getTextAlignment = function (midAngle) {\n var quadrantTextOpts = [\n { textAlign: 'center', textBaseline: 'bottom' },\n { textAlign: 'left', textBaseline: 'middle' },\n { textAlign: 'center', textBaseline: 'hanging' },\n { textAlign: 'right', textBaseline: 'middle' },\n ];\n var midAngle180 = normalizeAngle180(midAngle);\n // Split the circle into quadrants like so: ⊗\n var quadrantStart = (-3 * Math.PI) / 4; // same as `normalizeAngle180(toRadians(-135))`\n var quadrantOffset = midAngle180 - quadrantStart;\n var quadrant = Math.floor(quadrantOffset / (Math.PI / 2));\n var quadrantIndex = mod(quadrant, quadrantTextOpts.length);\n return quadrantTextOpts[quadrantIndex];\n };\n PieSeries.prototype.getSectorFormat = function (datum, itemId, index, highlight) {\n var _a, _b, _c, _d, _e, _f, _g, _h;\n var _j = this, angleKey = _j.angleKey, radiusKey = _j.radiusKey, fills = _j.fills, strokes = _j.strokes, seriesFillOpacity = _j.fillOpacity, formatter = _j.formatter, seriesId = _j.id, _k = _j.ctx, callbackCache = _k.callbackCache, highlightManager = _k.highlightManager;\n var highlightedDatum = highlightManager === null || highlightManager === void 0 ? void 0 : highlightManager.getActiveHighlight();\n var isDatumHighlighted = highlight && (highlightedDatum === null || highlightedDatum === void 0 ? void 0 : highlightedDatum.series) === this && itemId === highlightedDatum.itemId;\n var highlightedStyle = isDatumHighlighted ? this.highlightStyle.item : null;\n var fill = (_a = highlightedStyle === null || highlightedStyle === void 0 ? void 0 : highlightedStyle.fill) !== null && _a !== void 0 ? _a : fills[index % fills.length];\n var fillOpacity = (_b = highlightedStyle === null || highlightedStyle === void 0 ? void 0 : highlightedStyle.fillOpacity) !== null && _b !== void 0 ? _b : seriesFillOpacity;\n var stroke = (_c = highlightedStyle === null || highlightedStyle === void 0 ? void 0 : highlightedStyle.stroke) !== null && _c !== void 0 ? _c : strokes[index % strokes.length];\n var strokeWidth = (_d = highlightedStyle === null || highlightedStyle === void 0 ? void 0 : highlightedStyle.strokeWidth) !== null && _d !== void 0 ? _d : this.getStrokeWidth(this.strokeWidth);\n var format;\n if (formatter) {\n format = callbackCache.call(formatter, {\n datum: datum,\n angleKey: angleKey,\n radiusKey: radiusKey,\n fill: fill,\n stroke: stroke,\n strokeWidth: strokeWidth,\n highlighted: isDatumHighlighted,\n seriesId: seriesId,\n });\n }\n return {\n fill: (_e = format === null || format === void 0 ? void 0 : format.fill) !== null && _e !== void 0 ? _e : fill,\n fillOpacity: (_f = format === null || format === void 0 ? void 0 : format.fillOpacity) !== null && _f !== void 0 ? _f : fillOpacity,\n stroke: (_g = format === null || format === void 0 ? void 0 : format.stroke) !== null && _g !== void 0 ? _g : stroke,\n strokeWidth: (_h = format === null || format === void 0 ? void 0 : format.strokeWidth) !== null && _h !== void 0 ? _h : strokeWidth,\n };\n };\n PieSeries.prototype.getInnerRadius = function () {\n var _a = this, radius = _a.radius, innerRadiusRatio = _a.innerRadiusRatio, innerRadiusOffset = _a.innerRadiusOffset;\n var innerRadius = radius * (innerRadiusRatio !== null && innerRadiusRatio !== void 0 ? innerRadiusRatio : 1) + (innerRadiusOffset ? innerRadiusOffset : 0);\n if (innerRadius === radius || innerRadius < 0) {\n return 0;\n }\n return innerRadius;\n };\n PieSeries.prototype.getOuterRadius = function () {\n var _a = this, radius = _a.radius, outerRadiusRatio = _a.outerRadiusRatio, outerRadiusOffset = _a.outerRadiusOffset;\n var outerRadius = radius * (outerRadiusRatio !== null && outerRadiusRatio !== void 0 ? outerRadiusRatio : 1) + (outerRadiusOffset ? outerRadiusOffset : 0);\n if (outerRadius < 0) {\n return 0;\n }\n return outerRadius;\n };\n PieSeries.prototype.updateRadiusScale = function () {\n var innerRadius = this.getInnerRadius();\n var outerRadius = this.getOuterRadius();\n this.radiusScale.range = [innerRadius, outerRadius];\n };\n PieSeries.prototype.getTitleTranslationY = function () {\n var _a, _b;\n var outerRadius = Math.max(0, this.radiusScale.range[1]);\n if (outerRadius === 0) {\n return NaN;\n }\n var spacing = (_b = (_a = this.title) === null || _a === void 0 ? void 0 : _a.spacing) !== null && _b !== void 0 ? _b : 0;\n var titleOffset = 2 + spacing;\n var dy = Math.max(0, -outerRadius);\n return -outerRadius - titleOffset - dy;\n };\n PieSeries.prototype.update = function (_a) {\n var seriesRect = _a.seriesRect;\n return __awaiter$b(this, void 0, void 0, function () {\n var title, dy, titleBox;\n return __generator$b(this, function (_b) {\n switch (_b.label) {\n case 0:\n title = this.title;\n this.maybeRefreshNodeData();\n this.updateTitleNodes();\n this.updateRadiusScale();\n this.updateInnerCircleNodes();\n this.contentGroup.translationX = this.centerX;\n this.contentGroup.translationY = this.centerY;\n this.highlightGroup.translationX = this.centerX;\n this.highlightGroup.translationY = this.centerY;\n this.backgroundGroup.translationX = this.centerX;\n this.backgroundGroup.translationY = this.centerY;\n if (this.labelGroup) {\n this.labelGroup.translationX = this.centerX;\n this.labelGroup.translationY = this.centerY;\n }\n if (title) {\n dy = this.getTitleTranslationY();\n titleBox = title.node.computeBBox();\n title.node.visible =\n title.enabled && isFinite(dy) && !this.bboxIntersectsSurroundingSeries(titleBox, 0, dy);\n title.node.translationY = isFinite(dy) ? dy : 0;\n }\n this.updateNodeMidPoint();\n return [4 /*yield*/, this.updateSelections()];\n case 1:\n _b.sent();\n return [4 /*yield*/, this.updateNodes(seriesRect)];\n case 2:\n _b.sent();\n return [2 /*return*/];\n }\n });\n });\n };\n PieSeries.prototype.updateTitleNodes = function () {\n var _a, _b;\n var _c = this, title = _c.title, oldTitle = _c.oldTitle;\n if (oldTitle !== title) {\n if (oldTitle) {\n (_a = this.labelGroup) === null || _a === void 0 ? void 0 : _a.removeChild(oldTitle.node);\n }\n if (title) {\n title.node.textBaseline = 'bottom';\n (_b = this.labelGroup) === null || _b === void 0 ? void 0 : _b.appendChild(title.node);\n }\n this.oldTitle = title;\n }\n };\n PieSeries.prototype.updateInnerCircleNodes = function () {\n var _a;\n var _b = this, innerCircle = _b.innerCircle, oldInnerCircle = _b.oldInnerCircle, oldNode = _b.innerCircleNode;\n if (oldInnerCircle !== innerCircle) {\n var circle = void 0;\n if (oldNode) {\n this.backgroundGroup.removeChild(oldNode);\n }\n if (innerCircle) {\n circle = new Circle();\n circle.fill = innerCircle.fill;\n circle.fillOpacity = (_a = innerCircle.fillOpacity) !== null && _a !== void 0 ? _a : 1;\n this.backgroundGroup.appendChild(circle);\n }\n this.oldInnerCircle = innerCircle;\n this.innerCircleNode = circle;\n }\n };\n PieSeries.prototype.updateNodeMidPoint = function () {\n var _this = this;\n this.nodeData.forEach(function (d) {\n var radius = _this.radiusScale.convert(d.radius);\n d.nodeMidPoint = {\n x: d.midCos * Math.max(0, radius / 2),\n y: d.midSin * Math.max(0, radius / 2),\n };\n });\n };\n PieSeries.prototype.updateSelections = function () {\n return __awaiter$b(this, void 0, void 0, function () {\n return __generator$b(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.updateGroupSelection()];\n case 1:\n _a.sent();\n return [2 /*return*/];\n }\n });\n });\n };\n PieSeries.prototype.updateGroupSelection = function () {\n return __awaiter$b(this, void 0, void 0, function () {\n var _a, groupSelection, highlightSelection, calloutLabelSelection, sectorLabelSelection, innerLabelsSelection, update;\n var _this = this;\n return __generator$b(this, function (_b) {\n _a = this, groupSelection = _a.groupSelection, highlightSelection = _a.highlightSelection, calloutLabelSelection = _a.calloutLabelSelection, sectorLabelSelection = _a.sectorLabelSelection, innerLabelsSelection = _a.innerLabelsSelection;\n update = function (selection) {\n return selection.update(_this.nodeData, function (group) {\n var sector = new Sector();\n sector.tag = PieNodeTag.Sector;\n group.appendChild(sector);\n });\n };\n this.groupSelection = update(groupSelection);\n this.highlightSelection = update(highlightSelection);\n calloutLabelSelection.update(this.nodeData, function (group) {\n var line = new Line();\n line.tag = PieNodeTag.Callout;\n line.pointerEvents = PointerEvents.None;\n group.appendChild(line);\n var text = new Text();\n text.tag = PieNodeTag.Label;\n text.pointerEvents = PointerEvents.None;\n group.appendChild(text);\n });\n sectorLabelSelection.update(this.nodeData, function (node) {\n node.pointerEvents = PointerEvents.None;\n });\n innerLabelsSelection.update(this.innerLabels, function (node) {\n node.pointerEvents = PointerEvents.None;\n });\n return [2 /*return*/];\n });\n });\n };\n PieSeries.prototype.updateNodes = function (seriesRect) {\n var _a;\n return __awaiter$b(this, void 0, void 0, function () {\n var highlightedDatum, isVisible, radiusScale, innerRadius, updateSectorFn;\n var _this = this;\n return __generator$b(this, function (_b) {\n highlightedDatum = (_a = this.ctx.highlightManager) === null || _a === void 0 ? void 0 : _a.getActiveHighlight();\n isVisible = this.seriesItemEnabled.indexOf(true) >= 0;\n this.rootGroup.visible = isVisible;\n this.backgroundGroup.visible = isVisible;\n this.contentGroup.visible = isVisible;\n this.highlightGroup.visible = isVisible && (highlightedDatum === null || highlightedDatum === void 0 ? void 0 : highlightedDatum.series) === this;\n if (this.labelGroup) {\n this.labelGroup.visible = isVisible;\n }\n this.contentGroup.opacity = this.getOpacity();\n this.updateInnerCircle();\n radiusScale = this.radiusScale;\n innerRadius = radiusScale.convert(0);\n updateSectorFn = function (sector, datum, index, isDatumHighlighted) {\n var radius = radiusScale.convert(datum.radius);\n // Bring highlighted sector's parent group to front.\n var sectorParent = sector.parent;\n var sectorGrandParent = sectorParent === null || sectorParent === void 0 ? void 0 : sectorParent.parent;\n if (isDatumHighlighted && sectorParent && sectorGrandParent) {\n sectorGrandParent.removeChild(sectorParent);\n sectorGrandParent.appendChild(sectorParent);\n }\n sector.innerRadius = Math.max(0, innerRadius);\n sector.outerRadius = Math.max(0, radius);\n if (isDatumHighlighted) {\n sector.startAngle = datum.startAngle;\n sector.endAngle = datum.endAngle;\n }\n var format = _this.getSectorFormat(datum.datum, datum.itemId, index, isDatumHighlighted);\n sector.fill = format.fill;\n sector.stroke = format.stroke;\n sector.strokeWidth = format.strokeWidth;\n sector.fillOpacity = format.fillOpacity;\n sector.strokeOpacity = _this.strokeOpacity;\n sector.lineDash = _this.lineDash;\n sector.lineDashOffset = _this.lineDashOffset;\n sector.fillShadow = _this.shadow;\n sector.lineJoin = 'round';\n sector.visible = _this.seriesItemEnabled[index];\n };\n this.groupSelection\n .selectByTag(PieNodeTag.Sector)\n .forEach(function (node, index) { return updateSectorFn(node, node.datum, index, false); });\n this.highlightSelection.selectByTag(PieNodeTag.Sector).forEach(function (node, index) {\n var isDatumHighlighted = (highlightedDatum === null || highlightedDatum === void 0 ? void 0 : highlightedDatum.series) === _this && node.datum.itemId === highlightedDatum.itemId;\n if (isDatumHighlighted) {\n updateSectorFn(node, node.datum, index, isDatumHighlighted);\n }\n else {\n node.visible = false;\n }\n });\n this.animationState.transition('update');\n this.updateCalloutLineNodes();\n this.updateCalloutLabelNodes(seriesRect);\n this.updateSectorLabelNodes();\n this.updateInnerLabelNodes();\n return [2 /*return*/];\n });\n });\n };\n PieSeries.prototype.updateCalloutLineNodes = function () {\n var _a;\n var _b = this, radiusScale = _b.radiusScale, calloutLine = _b.calloutLine;\n var calloutLength = calloutLine.length;\n var calloutStrokeWidth = calloutLine.strokeWidth;\n var calloutColors = (_a = calloutLine.colors) !== null && _a !== void 0 ? _a : this.strokes;\n var offset = this.calloutLabel.offset;\n this.calloutLabelSelection.selectByTag(PieNodeTag.Callout).forEach(function (line, index) {\n var datum = line.datum;\n var radius = radiusScale.convert(datum.radius);\n var outerRadius = Math.max(0, radius);\n var label = datum.calloutLabel;\n if ((label === null || label === void 0 ? void 0 : label.text) && !label.hidden && outerRadius !== 0) {\n line.visible = true;\n line.strokeWidth = calloutStrokeWidth;\n line.stroke = calloutColors[index % calloutColors.length];\n line.fill = undefined;\n var x1 = datum.midCos * outerRadius;\n var y1 = datum.midSin * outerRadius;\n var x2 = datum.midCos * (outerRadius + calloutLength);\n var y2 = datum.midSin * (outerRadius + calloutLength);\n var isMoved = label.collisionTextAlign || label.collisionOffsetY !== 0;\n if (isMoved && label.box != null) {\n // Get the closest point to the text bounding box\n var box = label.box;\n var cx = x2;\n var cy = y2;\n if (x2 < box.x) {\n cx = box.x;\n }\n else if (x2 > box.x + box.width) {\n cx = box.x + box.width;\n }\n if (y2 < box.y) {\n cy = box.y;\n }\n else if (y2 > box.y + box.height) {\n cy = box.y + box.height;\n }\n // Apply label offset\n var dx = cx - x2;\n var dy = cy - y2;\n var length_1 = Math.sqrt(Math.pow(dx, 2) + Math.pow(dy, 2));\n var paddedLength = length_1 - offset;\n if (paddedLength > 0) {\n x2 = x2 + (dx * paddedLength) / length_1;\n y2 = y2 + (dy * paddedLength) / length_1;\n }\n }\n line.x1 = x1;\n line.y1 = y1;\n line.x2 = x2;\n line.y2 = y2;\n }\n else {\n line.visible = false;\n }\n });\n };\n PieSeries.prototype.getLabelOverflow = function (text, box, seriesRect) {\n var seriesLeft = seriesRect.x - this.centerX;\n var seriesRight = seriesRect.x + seriesRect.width - this.centerX;\n var seriesTop = seriesRect.y - this.centerY;\n var seriesBottom = seriesRect.y + seriesRect.height - this.centerY;\n var errPx = 1; // Prevents errors related to floating point calculations\n var visibleTextPart = 1;\n if (box.x + errPx < seriesLeft) {\n visibleTextPart = (box.x + box.width - seriesLeft) / box.width;\n }\n else if (box.x + box.width - errPx > seriesRight) {\n visibleTextPart = (seriesRight - box.x) / box.width;\n }\n var hasVerticalOverflow = box.y + errPx < seriesTop || box.y + box.height - errPx > seriesBottom;\n var textLength = visibleTextPart === 1 ? text.length : Math.floor(text.length * visibleTextPart) - 1;\n var hasSurroundingSeriesOverflow = this.bboxIntersectsSurroundingSeries(box);\n return { textLength: textLength, hasVerticalOverflow: hasVerticalOverflow, hasSurroundingSeriesOverflow: hasSurroundingSeriesOverflow };\n };\n PieSeries.prototype.bboxIntersectsSurroundingSeries = function (box, dx, dy) {\n if (dx === void 0) { dx = 0; }\n if (dy === void 0) { dy = 0; }\n var surroundingRadius = this.surroundingRadius;\n if (surroundingRadius == null) {\n return false;\n }\n var corners = [\n { x: box.x + dx, y: box.y + dy },\n { x: box.x + box.width + dx, y: box.y + dy },\n { x: box.x + box.width + dx, y: box.y + box.height + dy },\n { x: box.x + dx, y: box.y + box.height + dy },\n ];\n var sur2 = Math.pow(surroundingRadius, 2);\n return corners.some(function (corner) { return Math.pow(corner.x, 2) + Math.pow(corner.y, 2) > sur2; });\n };\n PieSeries.prototype.computeCalloutLabelCollisionOffsets = function () {\n var _this = this;\n var _a = this, radiusScale = _a.radiusScale, calloutLabel = _a.calloutLabel, calloutLine = _a.calloutLine;\n var offset = calloutLabel.offset, minSpacing = calloutLabel.minSpacing;\n var innerRadius = radiusScale.convert(0);\n var shouldSkip = function (datum) {\n var label = datum.calloutLabel;\n var radius = radiusScale.convert(datum.radius);\n var outerRadius = Math.max(0, radius);\n return !label || outerRadius === 0;\n };\n var fullData = this.nodeData;\n var data = this.nodeData.filter(function (t) { return !shouldSkip(t); });\n data.forEach(function (datum) {\n var label = datum.calloutLabel;\n if (label == null)\n return;\n label.hidden = false;\n label.collisionTextAlign = undefined;\n label.collisionOffsetY = 0;\n });\n if (data.length <= 1) {\n return;\n }\n var leftLabels = data.filter(function (d) { return d.midCos < 0; }).sort(function (a, b) { return a.midSin - b.midSin; });\n var rightLabels = data.filter(function (d) { return d.midCos >= 0; }).sort(function (a, b) { return a.midSin - b.midSin; });\n var topLabels = data\n .filter(function (d) { var _a; return d.midSin < 0 && ((_a = d.calloutLabel) === null || _a === void 0 ? void 0 : _a.textAlign) === 'center'; })\n .sort(function (a, b) { return a.midCos - b.midCos; });\n var bottomLabels = data\n .filter(function (d) { var _a; return d.midSin >= 0 && ((_a = d.calloutLabel) === null || _a === void 0 ? void 0 : _a.textAlign) === 'center'; })\n .sort(function (a, b) { return a.midCos - b.midCos; });\n var tempTextNode = new Text();\n var getTextBBox = function (datum) {\n var _a;\n var label = datum.calloutLabel;\n if (label == null)\n return new BBox(0, 0, 0, 0);\n var radius = radiusScale.convert(datum.radius);\n var outerRadius = Math.max(0, radius);\n var labelRadius = outerRadius + calloutLine.length + offset;\n var x = datum.midCos * labelRadius;\n var y = datum.midSin * labelRadius + label.collisionOffsetY;\n tempTextNode.text = label.text;\n tempTextNode.x = x;\n tempTextNode.y = y;\n tempTextNode.setFont(_this.calloutLabel);\n tempTextNode.setAlign({\n textAlign: (_a = label.collisionTextAlign) !== null && _a !== void 0 ? _a : label.textAlign,\n textBaseline: label.textBaseline,\n });\n return tempTextNode.computeBBox();\n };\n var avoidNeighbourYCollision = function (label, next, direction) {\n var box = getTextBBox(label).grow(minSpacing / 2);\n var other = getTextBBox(next).grow(minSpacing / 2);\n // The full collision is not detected, because sometimes\n // the next label can appear behind the label with offset\n var collidesOrBehind = box.x < other.x + other.width &&\n box.x + box.width > other.x &&\n (direction === 'to-top' ? box.y < other.y + other.height : box.y + box.height > other.y);\n if (collidesOrBehind) {\n var dy = direction === 'to-top' ? box.y - other.y - other.height : box.y + box.height - other.y;\n next.calloutLabel.collisionOffsetY = dy;\n }\n };\n var avoidYCollisions = function (labels) {\n var midLabel = labels.slice().sort(function (a, b) { return Math.abs(a.midSin) - Math.abs(b.midSin); })[0];\n var midIndex = labels.indexOf(midLabel);\n for (var i = midIndex - 1; i >= 0; i--) {\n var prev = labels[i + 1];\n var next = labels[i];\n avoidNeighbourYCollision(prev, next, 'to-top');\n }\n for (var i = midIndex + 1; i < labels.length; i++) {\n var prev = labels[i - 1];\n var next = labels[i];\n avoidNeighbourYCollision(prev, next, 'to-bottom');\n }\n };\n var avoidXCollisions = function (labels) {\n var labelsCollideLabelsByY = data.some(function (datum) { return datum.calloutLabel.collisionOffsetY !== 0; });\n var boxes = labels.map(function (label) { return getTextBBox(label); });\n var paddedBoxes = boxes.map(function (box) { return box.clone().grow(minSpacing / 2); });\n var labelsCollideLabelsByX = false;\n for (var i = 0; i < paddedBoxes.length && !labelsCollideLabelsByX; i++) {\n var box = paddedBoxes[i];\n for (var j = i + 1; j < labels.length; j++) {\n var other = paddedBoxes[j];\n if (box.collidesBBox(other)) {\n labelsCollideLabelsByX = true;\n break;\n }\n }\n }\n var sectors = fullData.map(function (datum) {\n var startAngle = datum.startAngle, endAngle = datum.endAngle;\n var radius = radiusScale.convert(datum.radius);\n var outerRadius = Math.max(0, radius);\n return { startAngle: startAngle, endAngle: endAngle, innerRadius: innerRadius, outerRadius: outerRadius };\n });\n var labelsCollideSectors = boxes.some(function (box) {\n return sectors.some(function (sector) { return boxCollidesSector(box, sector); });\n });\n if (!labelsCollideLabelsByX && !labelsCollideLabelsByY && !labelsCollideSectors) {\n return;\n }\n labels\n .filter(function (d) { return d.calloutLabel.textAlign === 'center'; })\n .forEach(function (d) {\n var label = d.calloutLabel;\n if (d.midCos < 0) {\n label.collisionTextAlign = 'right';\n }\n else if (d.midCos > 0) {\n label.collisionTextAlign = 'left';\n }\n else {\n label.collisionTextAlign = 'center';\n }\n });\n };\n avoidYCollisions(leftLabels);\n avoidYCollisions(rightLabels);\n avoidXCollisions(topLabels);\n avoidXCollisions(bottomLabels);\n };\n PieSeries.prototype.updateCalloutLabelNodes = function (seriesRect) {\n var _this = this;\n var _a = this, radiusScale = _a.radiusScale, calloutLabel = _a.calloutLabel, calloutLine = _a.calloutLine;\n var calloutLength = calloutLine.length;\n var offset = calloutLabel.offset, color = calloutLabel.color;\n var tempTextNode = new Text();\n this.calloutLabelSelection.selectByTag(PieNodeTag.Label).forEach(function (text) {\n var _a;\n var datum = text.datum;\n var label = datum.calloutLabel;\n var radius = radiusScale.convert(datum.radius);\n var outerRadius = Math.max(0, radius);\n if (!(label === null || label === void 0 ? void 0 : label.text) || outerRadius === 0 || label.hidden) {\n text.visible = false;\n return;\n }\n var labelRadius = outerRadius + calloutLength + offset;\n var x = datum.midCos * labelRadius;\n var y = datum.midSin * labelRadius + label.collisionOffsetY;\n // Detect text overflow\n var align = { textAlign: (_a = label.collisionTextAlign) !== null && _a !== void 0 ? _a : label.textAlign, textBaseline: label.textBaseline };\n tempTextNode.text = label.text;\n tempTextNode.x = x;\n tempTextNode.y = y;\n tempTextNode.setFont(_this.calloutLabel);\n tempTextNode.setAlign(align);\n var box = tempTextNode.computeBBox();\n var displayText = label.text;\n var visible = true;\n if (calloutLabel.avoidCollisions) {\n var _b = _this.getLabelOverflow(label.text, box, seriesRect), textLength = _b.textLength, hasVerticalOverflow = _b.hasVerticalOverflow;\n displayText = label.text.length === textLength ? label.text : label.text.substring(0, textLength) + \"\\u2026\";\n visible = !hasVerticalOverflow;\n }\n text.text = displayText;\n text.x = x;\n text.y = y;\n text.setFont(_this.calloutLabel);\n text.setAlign(align);\n text.fill = color;\n text.visible = visible;\n });\n };\n PieSeries.prototype.computeLabelsBBox = function (options, seriesRect) {\n var _this = this;\n var _a;\n var _b = this, radiusScale = _b.radiusScale, calloutLabel = _b.calloutLabel, calloutLine = _b.calloutLine;\n var calloutLength = calloutLine.length;\n var offset = calloutLabel.offset, maxCollisionOffset = calloutLabel.maxCollisionOffset, minSpacing = calloutLabel.minSpacing;\n if (!calloutLabel.avoidCollisions) {\n return null;\n }\n this.maybeRefreshNodeData();\n this.updateRadiusScale();\n this.computeCalloutLabelCollisionOffsets();\n var textBoxes = [];\n var text = new Text();\n var titleBox;\n if (((_a = this.title) === null || _a === void 0 ? void 0 : _a.text) && this.title.enabled) {\n var dy = this.getTitleTranslationY();\n if (isFinite(dy)) {\n text.text = this.title.text;\n text.x = 0;\n text.y = dy;\n text.setFont(this.title);\n text.setAlign({\n textBaseline: 'bottom',\n textAlign: 'center',\n });\n titleBox = text.computeBBox();\n textBoxes.push(titleBox);\n }\n }\n this.nodeData.forEach(function (datum) {\n var _a;\n var label = datum.calloutLabel;\n var radius = radiusScale.convert(datum.radius);\n var outerRadius = Math.max(0, radius);\n if (!label || outerRadius === 0) {\n return null;\n }\n var labelRadius = outerRadius + calloutLength + offset;\n var x = datum.midCos * labelRadius;\n var y = datum.midSin * labelRadius + label.collisionOffsetY;\n text.text = label.text;\n text.x = x;\n text.y = y;\n text.setFont(_this.calloutLabel);\n text.setAlign({ textAlign: (_a = label.collisionTextAlign) !== null && _a !== void 0 ? _a : label.textAlign, textBaseline: label.textBaseline });\n var box = text.computeBBox();\n label.box = box;\n // Hide labels that where pushed too far by the collision avoidance algorithm\n if (Math.abs(label.collisionOffsetY) > maxCollisionOffset) {\n label.hidden = true;\n return;\n }\n // Hide labels intersecting or above the title\n if (titleBox) {\n var seriesTop = seriesRect.y - _this.centerY;\n var titleCleanArea = new BBox(titleBox.x - minSpacing, seriesTop, titleBox.width + 2 * minSpacing, titleBox.y + titleBox.height + minSpacing - seriesTop);\n if (box.collidesBBox(titleCleanArea)) {\n label.hidden = true;\n return;\n }\n }\n if (options.hideWhenNecessary) {\n var _b = _this.getLabelOverflow(label.text, box, seriesRect), textLength = _b.textLength, hasVerticalOverflow = _b.hasVerticalOverflow, hasSurroundingSeriesOverflow = _b.hasSurroundingSeriesOverflow;\n var isTooShort = label.text.length > 2 && textLength < 2;\n if (hasVerticalOverflow || isTooShort || hasSurroundingSeriesOverflow) {\n label.hidden = true;\n return;\n }\n }\n label.hidden = false;\n textBoxes.push(box);\n });\n if (textBoxes.length === 0) {\n return null;\n }\n return BBox.merge(textBoxes);\n };\n PieSeries.prototype.updateSectorLabelNodes = function () {\n var radiusScale = this.radiusScale;\n var innerRadius = radiusScale.convert(0);\n var _a = this.sectorLabel, fontSize = _a.fontSize, fontStyle = _a.fontStyle, fontWeight = _a.fontWeight, fontFamily = _a.fontFamily, positionOffset = _a.positionOffset, positionRatio = _a.positionRatio, color = _a.color;\n var isDoughnut = innerRadius > 0;\n var singleVisibleSector = this.seriesItemEnabled.filter(Boolean).length === 1;\n this.sectorLabelSelection.each(function (text, datum) {\n var sectorLabel = datum.sectorLabel;\n var radius = radiusScale.convert(datum.radius);\n var outerRadius = Math.max(0, radius);\n var isTextVisible = false;\n if (sectorLabel && outerRadius !== 0) {\n var labelRadius = innerRadius * (1 - positionRatio) + radius * positionRatio + positionOffset;\n text.fill = color;\n text.fontStyle = fontStyle;\n text.fontWeight = fontWeight;\n text.fontSize = fontSize;\n text.fontFamily = fontFamily;\n text.text = sectorLabel.text;\n var shouldPutTextInCenter = !isDoughnut && singleVisibleSector;\n if (shouldPutTextInCenter) {\n text.x = 0;\n text.y = 0;\n }\n else {\n text.x = datum.midCos * labelRadius;\n text.y = datum.midSin * labelRadius;\n }\n text.textAlign = 'center';\n text.textBaseline = 'middle';\n var bbox = text.computeBBox();\n var corners = [\n [bbox.x, bbox.y],\n [bbox.x + bbox.width, bbox.y],\n [bbox.x + bbox.width, bbox.y + bbox.height],\n [bbox.x, bbox.y + bbox.height],\n ];\n var startAngle = datum.startAngle, endAngle = datum.endAngle;\n var sectorBounds_1 = { startAngle: startAngle, endAngle: endAngle, innerRadius: innerRadius, outerRadius: outerRadius };\n if (corners.every(function (_a) {\n var _b = __read$I(_a, 2), x = _b[0], y = _b[1];\n return isPointInSector(x, y, sectorBounds_1);\n })) {\n isTextVisible = true;\n }\n }\n text.visible = isTextVisible;\n });\n };\n PieSeries.prototype.updateInnerCircle = function () {\n var circle = this.innerCircleNode;\n if (!circle) {\n return;\n }\n var innerRadius = this.getInnerRadius();\n if (innerRadius === 0) {\n circle.size = 0;\n }\n else {\n var circleRadius = Math.min(innerRadius, this.getOuterRadius());\n var antiAliasingPadding = 1;\n circle.size = Math.ceil(circleRadius * 2 + antiAliasingPadding);\n }\n };\n PieSeries.prototype.updateInnerLabelNodes = function () {\n var textBBoxes = [];\n var margins = [];\n this.innerLabelsSelection.each(function (text, datum) {\n var fontStyle = datum.fontStyle, fontWeight = datum.fontWeight, fontSize = datum.fontSize, fontFamily = datum.fontFamily, color = datum.color;\n text.fontStyle = fontStyle;\n text.fontWeight = fontWeight;\n text.fontSize = fontSize;\n text.fontFamily = fontFamily;\n text.text = datum.text;\n text.x = 0;\n text.y = 0;\n text.fill = color;\n text.textAlign = 'center';\n text.textBaseline = 'alphabetic';\n textBBoxes.push(text.computeBBox());\n margins.push(datum.margin);\n });\n var getMarginTop = function (index) { return (index === 0 ? 0 : margins[index]); };\n var getMarginBottom = function (index) { return (index === margins.length - 1 ? 0 : margins[index]); };\n var totalHeight = textBBoxes.reduce(function (sum, bbox, i) {\n return sum + bbox.height + getMarginTop(i) + getMarginBottom(i);\n }, 0);\n var totalWidth = Math.max.apply(Math, __spreadArray$o([], __read$I(textBBoxes.map(function (bbox) { return bbox.width; }))));\n var innerRadius = this.getInnerRadius();\n var labelRadius = Math.sqrt(Math.pow(totalWidth / 2, 2) + Math.pow(totalHeight / 2, 2));\n var labelsVisible = labelRadius <= (innerRadius > 0 ? innerRadius : this.getOuterRadius());\n var textBottoms = [];\n for (var i = 0, prev = -totalHeight / 2; i < textBBoxes.length; i++) {\n var bbox = textBBoxes[i];\n var bottom = bbox.height + prev + getMarginTop(i);\n textBottoms.push(bottom);\n prev = bottom + getMarginBottom(i);\n }\n this.innerLabelsSelection.each(function (text, _datum, index) {\n text.y = textBottoms[index];\n text.visible = labelsVisible;\n });\n };\n PieSeries.prototype.getNodeClickEvent = function (event, datum) {\n return new PieSeriesNodeClickEvent(this.angleKey, this.calloutLabelKey, this.sectorLabelKey, this.radiusKey, event, datum, this);\n };\n PieSeries.prototype.getNodeDoubleClickEvent = function (event, datum) {\n return new PieSeriesNodeDoubleClickEvent(this.angleKey, this.calloutLabelKey, this.sectorLabelKey, this.radiusKey, event, datum, this);\n };\n PieSeries.prototype.getTooltipHtml = function (nodeDatum) {\n var _a;\n var angleKey = this.angleKey;\n if (!angleKey) {\n return '';\n }\n var _b = this, tooltip = _b.tooltip, angleName = _b.angleName, radiusKey = _b.radiusKey, radiusName = _b.radiusName, calloutLabelKey = _b.calloutLabelKey, sectorLabelKey = _b.sectorLabelKey, calloutLabelName = _b.calloutLabelName, sectorLabelName = _b.sectorLabelName, seriesId = _b.id;\n var tooltipRenderer = tooltip.renderer;\n var datum = nodeDatum.datum, angleValue = nodeDatum.angleValue, radiusValue = nodeDatum.radiusValue, color = nodeDatum.sectorFormat.fill, _c = nodeDatum.calloutLabel, _d = _c === void 0 ? {} : _c, _e = _d.text, label = _e === void 0 ? '' : _e;\n var formattedAngleValue = typeof angleValue === 'number' ? toFixed(angleValue) : String(angleValue);\n var title = (_a = this.title) === null || _a === void 0 ? void 0 : _a.text;\n var content = \"\" + (label ? label + \": \" : '') + formattedAngleValue;\n var defaults = {\n title: title,\n backgroundColor: color,\n content: content,\n };\n if (tooltipRenderer) {\n return toTooltipHtml$1(tooltipRenderer({\n datum: datum,\n angleKey: angleKey,\n angleValue: angleValue,\n angleName: angleName,\n radiusKey: radiusKey,\n radiusValue: radiusValue,\n radiusName: radiusName,\n calloutLabelKey: calloutLabelKey,\n calloutLabelName: calloutLabelName,\n sectorLabelKey: sectorLabelKey,\n sectorLabelName: sectorLabelName,\n title: title,\n color: color,\n seriesId: seriesId,\n }), defaults);\n }\n return toTooltipHtml$1(defaults);\n };\n PieSeries.prototype.getLegendData = function () {\n var _a, _b, _c;\n var _d = this, processedData = _d.processedData, calloutLabelKey = _d.calloutLabelKey, legendItemKey = _d.legendItemKey, id = _d.id, dataModel = _d.dataModel;\n if (!dataModel || !processedData || processedData.data.length === 0)\n return [];\n if (!legendItemKey && !calloutLabelKey)\n return [];\n var _e = this.getProcessedDataIndexes(dataModel), angleIdx = _e.angleIdx, radiusIdx = _e.radiusIdx, calloutLabelIdx = _e.calloutLabelIdx, sectorLabelIdx = _e.sectorLabelIdx, legendItemIdx = _e.legendItemIdx;\n var titleText = ((_a = this.title) === null || _a === void 0 ? void 0 : _a.showInLegend) && this.title.text;\n var legendData = [];\n for (var index = 0; index < processedData.data.length; index++) {\n var _f = processedData.data[index], datum = _f.datum, values = _f.values;\n var labelParts = [];\n if (titleText) {\n labelParts.push(titleText);\n }\n var labels = this.getLabels(datum, 2 * Math.PI, 2 * Math.PI, false, values[angleIdx], values[radiusIdx], values[calloutLabelIdx], values[sectorLabelIdx], values[legendItemIdx]);\n if (legendItemKey && labels.legendItem !== undefined) {\n labelParts.push(labels.legendItem.text);\n }\n else if (calloutLabelKey && ((_b = labels.calloutLabel) === null || _b === void 0 ? void 0 : _b.text) !== undefined) {\n labelParts.push((_c = labels.calloutLabel) === null || _c === void 0 ? void 0 : _c.text);\n }\n if (labelParts.length === 0)\n continue;\n var sectorFormat = this.getSectorFormat(datum, index, index, false);\n legendData.push({\n legendType: 'category',\n id: id,\n itemId: index,\n seriesId: id,\n enabled: this.seriesItemEnabled[index],\n label: {\n text: labelParts.join(' - '),\n },\n marker: {\n fill: sectorFormat.fill,\n stroke: sectorFormat.stroke,\n fillOpacity: this.fillOpacity,\n strokeOpacity: this.strokeOpacity,\n },\n });\n }\n return legendData;\n };\n PieSeries.prototype.onLegendItemClick = function (event) {\n var enabled = event.enabled, itemId = event.itemId, series = event.series;\n if (series.id === this.id) {\n this.toggleSeriesItem(itemId, enabled);\n }\n else if (series.type === 'pie') {\n this.toggleOtherSeriesItems(series, itemId, enabled);\n }\n };\n PieSeries.prototype.toggleSeriesItem = function (itemId, enabled) {\n this.seriesItemEnabled[itemId] = enabled;\n this.nodeDataRefresh = true;\n };\n PieSeries.prototype.toggleOtherSeriesItems = function (series, itemId, enabled) {\n var _this = this;\n var _a, _b;\n var _c = this, legendItemKey = _c.legendItemKey, dataModel = _c.dataModel;\n if (!legendItemKey || !dataModel)\n return;\n var datumToggledLegendItemValue = series.legendItemKey && ((_a = series.data) === null || _a === void 0 ? void 0 : _a.find(function (_, index) { return index === itemId; })[series.legendItemKey]);\n if (!datumToggledLegendItemValue)\n return;\n var legendItemIdx = dataModel.resolveProcessedDataIndexById(this, \"legendItemValue\").index;\n (_b = this.processedData) === null || _b === void 0 ? void 0 : _b.data.forEach(function (_a, datumItemId) {\n var values = _a.values;\n if (values[legendItemIdx] === datumToggledLegendItemValue) {\n _this.toggleSeriesItem(datumItemId, enabled);\n }\n });\n };\n PieSeries.prototype.animateEmptyUpdateReady = function () {\n var _this = this;\n var _a, _b;\n var duration = (_b = (_a = this.ctx.animationManager) === null || _a === void 0 ? void 0 : _a.defaultOptions.duration) !== null && _b !== void 0 ? _b : 1000;\n var labelDuration = 200;\n var rotation = Math.PI / -2 + toRadians$1(this.rotation);\n this.groupSelection.selectByTag(PieNodeTag.Sector).forEach(function (node) {\n var _a;\n var datum = node.datum;\n (_a = _this.ctx.animationManager) === null || _a === void 0 ? void 0 : _a.animateMany(_this.id + \"_empty-update-ready_\" + node.id, [\n { from: rotation, to: datum.startAngle },\n { from: rotation, to: datum.endAngle },\n ], {\n duration: duration,\n ease: easeOut,\n onUpdate: function (_a) {\n var _b = __read$I(_a, 2), startAngle = _b[0], endAngle = _b[1];\n node.startAngle = startAngle;\n node.endAngle = endAngle;\n },\n });\n });\n var labelAnimationOptions = {\n from: 0,\n to: 1,\n delay: duration,\n duration: labelDuration,\n };\n this.calloutLabelSelection.each(function (label) {\n var _a;\n (_a = _this.ctx.animationManager) === null || _a === void 0 ? void 0 : _a.animate(_this.id + \"_empty-update-ready_\" + label.id, __assign$G(__assign$G({}, labelAnimationOptions), { onUpdate: function (opacity) {\n label.opacity = opacity;\n } }));\n });\n this.sectorLabelSelection.each(function (label) {\n var _a;\n (_a = _this.ctx.animationManager) === null || _a === void 0 ? void 0 : _a.animate(_this.id + \"_empty-update-ready_\" + label.id, __assign$G(__assign$G({}, labelAnimationOptions), { onUpdate: function (opacity) {\n label.opacity = opacity;\n } }));\n });\n this.innerLabelsSelection.each(function (label) {\n var _a;\n (_a = _this.ctx.animationManager) === null || _a === void 0 ? void 0 : _a.animate(_this.id + \"_empty-update-ready_\" + label.id, __assign$G(__assign$G({}, labelAnimationOptions), { onUpdate: function (opacity) {\n label.opacity = opacity;\n } }));\n });\n };\n PieSeries.prototype.animateReadyUpdateReady = function () {\n this.groupSelection.selectByTag(PieNodeTag.Sector).forEach(function (node) {\n var datum = node.datum;\n node.startAngle = datum.startAngle;\n node.endAngle = datum.endAngle;\n });\n };\n PieSeries.className = 'PieSeries';\n PieSeries.type = 'pie';\n __decorate$1B([\n Validate(STRING)\n ], PieSeries.prototype, \"angleKey\", void 0);\n __decorate$1B([\n Validate(STRING)\n ], PieSeries.prototype, \"angleName\", void 0);\n __decorate$1B([\n Validate(OPT_STRING)\n ], PieSeries.prototype, \"radiusKey\", void 0);\n __decorate$1B([\n Validate(OPT_STRING)\n ], PieSeries.prototype, \"radiusName\", void 0);\n __decorate$1B([\n Validate(OPT_NUMBER(0))\n ], PieSeries.prototype, \"radiusMin\", void 0);\n __decorate$1B([\n Validate(OPT_NUMBER(0))\n ], PieSeries.prototype, \"radiusMax\", void 0);\n __decorate$1B([\n Validate(OPT_STRING)\n ], PieSeries.prototype, \"calloutLabelKey\", void 0);\n __decorate$1B([\n Validate(OPT_STRING)\n ], PieSeries.prototype, \"calloutLabelName\", void 0);\n __decorate$1B([\n Validate(OPT_STRING)\n ], PieSeries.prototype, \"sectorLabelKey\", void 0);\n __decorate$1B([\n Validate(OPT_STRING)\n ], PieSeries.prototype, \"sectorLabelName\", void 0);\n __decorate$1B([\n Validate(OPT_STRING)\n ], PieSeries.prototype, \"legendItemKey\", void 0);\n __decorate$1B([\n Validate(COLOR_STRING_ARRAY)\n ], PieSeries.prototype, \"fills\", void 0);\n __decorate$1B([\n Validate(COLOR_STRING_ARRAY)\n ], PieSeries.prototype, \"strokes\", void 0);\n __decorate$1B([\n Validate(NUMBER(0, 1))\n ], PieSeries.prototype, \"fillOpacity\", void 0);\n __decorate$1B([\n Validate(NUMBER(0, 1))\n ], PieSeries.prototype, \"strokeOpacity\", void 0);\n __decorate$1B([\n Validate(OPT_LINE_DASH)\n ], PieSeries.prototype, \"lineDash\", void 0);\n __decorate$1B([\n Validate(NUMBER(0))\n ], PieSeries.prototype, \"lineDashOffset\", void 0);\n __decorate$1B([\n Validate(OPT_FUNCTION)\n ], PieSeries.prototype, \"formatter\", void 0);\n __decorate$1B([\n Validate(NUMBER(-360, 360))\n ], PieSeries.prototype, \"rotation\", void 0);\n __decorate$1B([\n Validate(NUMBER())\n ], PieSeries.prototype, \"outerRadiusOffset\", void 0);\n __decorate$1B([\n Validate(NUMBER(0))\n ], PieSeries.prototype, \"outerRadiusRatio\", void 0);\n __decorate$1B([\n Validate(NUMBER())\n ], PieSeries.prototype, \"innerRadiusOffset\", void 0);\n __decorate$1B([\n Validate(NUMBER(0))\n ], PieSeries.prototype, \"innerRadiusRatio\", void 0);\n __decorate$1B([\n Validate(NUMBER(0))\n ], PieSeries.prototype, \"strokeWidth\", void 0);\n return PieSeries;\n}(PolarSeries));\n\nvar __assign$F = (undefined && undefined.__assign) || function () {\n __assign$F = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$F.apply(this, arguments);\n};\nvar JSON_APPLY_PLUGINS = {\n constructors: {},\n constructedArrays: new WeakMap(),\n};\nfunction assignJsonApplyConstructedArray(array, ctor) {\n var _a;\n (_a = JSON_APPLY_PLUGINS.constructedArrays) === null || _a === void 0 ? void 0 : _a.set(array, ctor);\n}\nvar JSON_APPLY_OPTIONS = {\n constructors: {\n title: Caption,\n subtitle: Caption,\n footnote: Caption,\n shadow: DropShadow,\n innerCircle: DoughnutInnerCircle,\n 'axes[].title': AxisTitle,\n 'series[].innerLabels[]': DoughnutInnerLabel,\n },\n allowedTypes: {\n 'legend.pagination.marker.shape': ['primitive', 'function'],\n 'series[].marker.shape': ['primitive', 'function'],\n 'axis[].tick.count': ['primitive', 'class-instance'],\n },\n};\nfunction getJsonApplyOptions() {\n return {\n constructors: __assign$F(__assign$F({}, JSON_APPLY_OPTIONS.constructors), JSON_APPLY_PLUGINS.constructors),\n constructedArrays: JSON_APPLY_PLUGINS.constructedArrays,\n allowedTypes: __assign$F({}, JSON_APPLY_OPTIONS.allowedTypes),\n };\n}\n\nvar horizontalCrosslineTranslationDirections = {\n top: { xTranslationDirection: 0, yTranslationDirection: -1 },\n bottom: { xTranslationDirection: 0, yTranslationDirection: 1 },\n left: { xTranslationDirection: -1, yTranslationDirection: 0 },\n right: { xTranslationDirection: 1, yTranslationDirection: 0 },\n topLeft: { xTranslationDirection: 1, yTranslationDirection: -1 },\n topRight: { xTranslationDirection: -1, yTranslationDirection: -1 },\n bottomLeft: { xTranslationDirection: 1, yTranslationDirection: 1 },\n bottomRight: { xTranslationDirection: -1, yTranslationDirection: 1 },\n inside: { xTranslationDirection: 0, yTranslationDirection: 0 },\n insideLeft: { xTranslationDirection: 1, yTranslationDirection: 0 },\n insideRight: { xTranslationDirection: -1, yTranslationDirection: 0 },\n insideTop: { xTranslationDirection: 0, yTranslationDirection: 1 },\n insideBottom: { xTranslationDirection: 0, yTranslationDirection: -1 },\n insideTopLeft: { xTranslationDirection: 1, yTranslationDirection: 1 },\n insideBottomLeft: { xTranslationDirection: 1, yTranslationDirection: -1 },\n insideTopRight: { xTranslationDirection: -1, yTranslationDirection: 1 },\n insideBottomRight: { xTranslationDirection: -1, yTranslationDirection: -1 },\n};\nvar verticalCrossLineTranslationDirections = {\n top: { xTranslationDirection: 1, yTranslationDirection: 0 },\n bottom: { xTranslationDirection: -1, yTranslationDirection: 0 },\n left: { xTranslationDirection: 0, yTranslationDirection: -1 },\n right: { xTranslationDirection: 0, yTranslationDirection: 1 },\n topLeft: { xTranslationDirection: -1, yTranslationDirection: -1 },\n topRight: { xTranslationDirection: -1, yTranslationDirection: 1 },\n bottomLeft: { xTranslationDirection: 1, yTranslationDirection: -1 },\n bottomRight: { xTranslationDirection: 1, yTranslationDirection: 1 },\n inside: { xTranslationDirection: 0, yTranslationDirection: 0 },\n insideLeft: { xTranslationDirection: 0, yTranslationDirection: 1 },\n insideRight: { xTranslationDirection: 0, yTranslationDirection: -1 },\n insideTop: { xTranslationDirection: -1, yTranslationDirection: 0 },\n insideBottom: { xTranslationDirection: 1, yTranslationDirection: 0 },\n insideTopLeft: { xTranslationDirection: -1, yTranslationDirection: 1 },\n insideBottomLeft: { xTranslationDirection: 1, yTranslationDirection: 1 },\n insideTopRight: { xTranslationDirection: -1, yTranslationDirection: -1 },\n insideBottomRight: { xTranslationDirection: 1, yTranslationDirection: -1 },\n};\nfunction calculateLabelTranslation(_a) {\n var yDirection = _a.yDirection, _b = _a.padding, padding = _b === void 0 ? 0 : _b, _c = _a.position, position = _c === void 0 ? 'top' : _c, bbox = _a.bbox;\n var crossLineTranslationDirections = yDirection\n ? horizontalCrosslineTranslationDirections\n : verticalCrossLineTranslationDirections;\n var _d = crossLineTranslationDirections[position], xTranslationDirection = _d.xTranslationDirection, yTranslationDirection = _d.yTranslationDirection;\n var w = yDirection ? bbox.width : bbox.height;\n var h = yDirection ? bbox.height : bbox.width;\n var xTranslation = xTranslationDirection * (padding + w / 2);\n var yTranslation = yTranslationDirection * (padding + h / 2);\n var result = {\n xTranslation: xTranslation,\n yTranslation: yTranslation,\n };\n return result;\n}\nfunction calculateLabelChartPadding(_a) {\n var yDirection = _a.yDirection, bbox = _a.bbox, _b = _a.padding, padding = _b === void 0 ? 0 : _b, _c = _a.position, position = _c === void 0 ? 'top' : _c;\n var chartPadding = {};\n if (position.startsWith('inside'))\n return chartPadding;\n if (position === 'top' && !yDirection) {\n chartPadding.top = padding + bbox.height;\n }\n else if (position === 'bottom' && !yDirection) {\n chartPadding.bottom = padding + bbox.height;\n }\n else if (position === 'left' && yDirection) {\n chartPadding.left = padding + bbox.width;\n }\n else if (position === 'right' && yDirection) {\n chartPadding.right = padding + bbox.width;\n }\n return chartPadding;\n}\nvar POSITION_TOP_COORDINATES = function (_a) {\n var yDirection = _a.yDirection, xEnd = _a.xEnd, yStart = _a.yStart, yEnd = _a.yEnd;\n if (yDirection) {\n return { x: xEnd / 2, y: yStart };\n }\n else {\n return { x: xEnd, y: !isNaN(yEnd) ? (yStart + yEnd) / 2 : yStart };\n }\n};\nvar POSITION_LEFT_COORDINATES = function (_a) {\n var yDirection = _a.yDirection, xStart = _a.xStart, xEnd = _a.xEnd, yStart = _a.yStart, yEnd = _a.yEnd;\n if (yDirection) {\n return { x: xStart, y: !isNaN(yEnd) ? (yStart + yEnd) / 2 : yStart };\n }\n else {\n return { x: xEnd / 2, y: yStart };\n }\n};\nvar POSITION_RIGHT_COORDINATES = function (_a) {\n var yDirection = _a.yDirection, xEnd = _a.xEnd, yStart = _a.yStart, yEnd = _a.yEnd;\n if (yDirection) {\n return { x: xEnd, y: !isNaN(yEnd) ? (yStart + yEnd) / 2 : yStart };\n }\n else {\n return { x: xEnd / 2, y: !isNaN(yEnd) ? yEnd : yStart };\n }\n};\nvar POSITION_BOTTOM_COORDINATES = function (_a) {\n var yDirection = _a.yDirection, xStart = _a.xStart, xEnd = _a.xEnd, yStart = _a.yStart, yEnd = _a.yEnd;\n if (yDirection) {\n return { x: xEnd / 2, y: !isNaN(yEnd) ? yEnd : yStart };\n }\n else {\n return { x: xStart, y: !isNaN(yEnd) ? (yStart + yEnd) / 2 : yStart };\n }\n};\nvar POSITION_INSIDE_COORDINATES = function (_a) {\n var xEnd = _a.xEnd, yStart = _a.yStart, yEnd = _a.yEnd;\n return { x: xEnd / 2, y: !isNaN(yEnd) ? (yStart + yEnd) / 2 : yStart };\n};\nvar POSITION_TOP_LEFT_COORDINATES = function (_a) {\n var yDirection = _a.yDirection, xStart = _a.xStart, xEnd = _a.xEnd, yStart = _a.yStart;\n if (yDirection) {\n return { x: xStart / 2, y: yStart };\n }\n else {\n return { x: xEnd, y: yStart };\n }\n};\nvar POSITION_BOTTOM_LEFT_COORDINATES = function (_a) {\n var yDirection = _a.yDirection, xStart = _a.xStart, yStart = _a.yStart, yEnd = _a.yEnd;\n if (yDirection) {\n return { x: xStart, y: !isNaN(yEnd) ? yEnd : yStart };\n }\n else {\n return { x: xStart, y: yStart };\n }\n};\nvar POSITION_TOP_RIGHT_COORDINATES = function (_a) {\n var yDirection = _a.yDirection, xEnd = _a.xEnd, yStart = _a.yStart, yEnd = _a.yEnd;\n if (yDirection) {\n return { x: xEnd, y: yStart };\n }\n else {\n return { x: xEnd, y: !isNaN(yEnd) ? yEnd : yStart };\n }\n};\nvar POSITION_BOTTOM_RIGHT_COORDINATES = function (_a) {\n var yDirection = _a.yDirection, xStart = _a.xStart, xEnd = _a.xEnd, yStart = _a.yStart, yEnd = _a.yEnd;\n if (yDirection) {\n return { x: xEnd, y: !isNaN(yEnd) ? yEnd : yStart };\n }\n else {\n return { x: xStart, y: !isNaN(yEnd) ? yEnd : yStart };\n }\n};\nvar labeldDirectionHandling = {\n top: { c: POSITION_TOP_COORDINATES },\n bottom: { c: POSITION_BOTTOM_COORDINATES },\n left: { c: POSITION_LEFT_COORDINATES },\n right: { c: POSITION_RIGHT_COORDINATES },\n topLeft: { c: POSITION_TOP_LEFT_COORDINATES },\n topRight: { c: POSITION_TOP_RIGHT_COORDINATES },\n bottomLeft: { c: POSITION_BOTTOM_LEFT_COORDINATES },\n bottomRight: { c: POSITION_BOTTOM_RIGHT_COORDINATES },\n inside: { c: POSITION_INSIDE_COORDINATES },\n insideLeft: { c: POSITION_LEFT_COORDINATES },\n insideRight: { c: POSITION_RIGHT_COORDINATES },\n insideTop: { c: POSITION_TOP_COORDINATES },\n insideBottom: { c: POSITION_BOTTOM_COORDINATES },\n insideTopLeft: { c: POSITION_TOP_LEFT_COORDINATES },\n insideBottomLeft: { c: POSITION_BOTTOM_LEFT_COORDINATES },\n insideTopRight: { c: POSITION_TOP_RIGHT_COORDINATES },\n insideBottomRight: { c: POSITION_BOTTOM_RIGHT_COORDINATES },\n};\n\nvar __extends$2h = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign$E = (undefined && undefined.__assign) || function () {\n __assign$E = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$E.apply(this, arguments);\n};\nvar __decorate$1A = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar Range = /** @class */ (function (_super) {\n __extends$2h(Range, _super);\n function Range() {\n var _this = _super.call(this) || this;\n _this.x1 = 0;\n _this.y1 = 0;\n _this.x2 = 0;\n _this.y2 = 0;\n _this.startLine = false;\n _this.endLine = false;\n _this.isRange = false;\n _this.restoreOwnStyles();\n return _this;\n }\n Range.prototype.computeBBox = function () {\n return new BBox(this.x1, this.y1, this.x2 - this.x1, this.y2 - this.y1);\n };\n Range.prototype.isPointInPath = function (_x, _y) {\n return false;\n };\n Range.prototype.render = function (renderCtx) {\n var _a;\n var ctx = renderCtx.ctx, forceRender = renderCtx.forceRender, stats = renderCtx.stats;\n if (this.dirty === RedrawType.NONE && !forceRender) {\n if (stats)\n stats.nodesSkipped += this.nodeCount.count;\n return;\n }\n this.computeTransformMatrix();\n this.matrix.toContext(ctx);\n var _b = this, x1 = _b.x1, y1 = _b.y1, x2 = _b.x2, y2 = _b.y2;\n x1 = this.align(x1);\n y1 = this.align(y1);\n x2 = this.align(x2);\n y2 = this.align(y2);\n var _c = this, fill = _c.fill, opacity = _c.opacity, isRange = _c.isRange;\n var fillActive = !!(isRange && fill);\n if (fillActive) {\n var fillOpacity = this.fillOpacity;\n ctx.fillStyle = fill;\n ctx.globalAlpha = opacity * fillOpacity;\n ctx.beginPath();\n ctx.moveTo(x1, y1);\n ctx.lineTo(x2, y1);\n ctx.lineTo(x2, y2);\n ctx.lineTo(x1, y2);\n ctx.closePath();\n ctx.fill();\n }\n var _d = this, stroke = _d.stroke, strokeWidth = _d.strokeWidth, startLine = _d.startLine, endLine = _d.endLine;\n var strokeActive = !!((startLine || endLine) && stroke && strokeWidth);\n if (strokeActive) {\n var _e = this, strokeOpacity = _e.strokeOpacity, lineDash = _e.lineDash, lineDashOffset = _e.lineDashOffset, lineCap = _e.lineCap, lineJoin = _e.lineJoin;\n ctx.strokeStyle = stroke;\n ctx.globalAlpha = opacity * strokeOpacity;\n ctx.lineWidth = strokeWidth;\n if (lineDash) {\n ctx.setLineDash(lineDash);\n }\n if (lineDashOffset) {\n ctx.lineDashOffset = lineDashOffset;\n }\n if (lineCap) {\n ctx.lineCap = lineCap;\n }\n if (lineJoin) {\n ctx.lineJoin = lineJoin;\n }\n ctx.beginPath();\n if (startLine) {\n ctx.moveTo(x1, y1);\n ctx.lineTo(x2, y1);\n }\n if (endLine) {\n ctx.moveTo(x2, y2);\n ctx.lineTo(x1, y2);\n }\n ctx.stroke();\n }\n (_a = this.fillShadow) === null || _a === void 0 ? void 0 : _a.markClean();\n _super.prototype.render.call(this, renderCtx);\n };\n Range.className = 'Range';\n Range.defaultStyles = __assign$E(__assign$E({}, Shape.defaultStyles), { strokeWidth: 1 });\n __decorate$1A([\n SceneChangeDetection({ redraw: RedrawType.MINOR })\n ], Range.prototype, \"x1\", void 0);\n __decorate$1A([\n SceneChangeDetection({ redraw: RedrawType.MINOR })\n ], Range.prototype, \"y1\", void 0);\n __decorate$1A([\n SceneChangeDetection({ redraw: RedrawType.MINOR })\n ], Range.prototype, \"x2\", void 0);\n __decorate$1A([\n SceneChangeDetection({ redraw: RedrawType.MINOR })\n ], Range.prototype, \"y2\", void 0);\n __decorate$1A([\n SceneChangeDetection({ redraw: RedrawType.MINOR })\n ], Range.prototype, \"startLine\", void 0);\n __decorate$1A([\n SceneChangeDetection({ redraw: RedrawType.MINOR })\n ], Range.prototype, \"endLine\", void 0);\n __decorate$1A([\n SceneChangeDetection({ redraw: RedrawType.MINOR })\n ], Range.prototype, \"isRange\", void 0);\n return Range;\n}(Shape));\n\nvar __decorate$1z = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __read$H = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray$n = (undefined && undefined.__spreadArray) || function (to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\n to[j] = from[i];\n return to;\n};\nvar CROSSLINE_LABEL_POSITIONS = [\n 'top',\n 'left',\n 'right',\n 'bottom',\n 'topLeft',\n 'topRight',\n 'bottomLeft',\n 'bottomRight',\n 'inside',\n 'insideLeft',\n 'insideRight',\n 'insideTop',\n 'insideBottom',\n 'insideTopLeft',\n 'insideBottomLeft',\n 'insideTopRight',\n 'insideBottomRight',\n];\nvar OPT_CROSSLINE_LABEL_POSITION = predicateWithMessage(function (v, ctx) { return OPTIONAL(v, ctx, function (v) { return CROSSLINE_LABEL_POSITIONS.includes(v); }); }, \"expecting an optional crossLine label position keyword such as 'topLeft', 'topRight' or 'inside'\");\nvar OPT_CROSSLINE_TYPE = predicateWithMessage(function (v, ctx) { return OPTIONAL(v, ctx, function (v) { return v === 'range' || v === 'line'; }); }, \"expecting a crossLine type keyword such as 'range' or 'line'\");\nvar CartesianCrossLineLabel = /** @class */ (function () {\n function CartesianCrossLineLabel() {\n this.enabled = undefined;\n this.text = undefined;\n this.fontStyle = undefined;\n this.fontWeight = undefined;\n this.fontSize = 14;\n this.fontFamily = 'Verdana, sans-serif';\n /**\n * The padding between the label and the line.\n */\n this.padding = 5;\n /**\n * The color of the labels.\n */\n this.color = 'rgba(87, 87, 87, 1)';\n this.position = undefined;\n this.rotation = undefined;\n this.parallel = undefined;\n }\n __decorate$1z([\n Validate(OPT_BOOLEAN)\n ], CartesianCrossLineLabel.prototype, \"enabled\", void 0);\n __decorate$1z([\n Validate(OPT_STRING)\n ], CartesianCrossLineLabel.prototype, \"text\", void 0);\n __decorate$1z([\n Validate(OPT_FONT_STYLE)\n ], CartesianCrossLineLabel.prototype, \"fontStyle\", void 0);\n __decorate$1z([\n Validate(OPT_FONT_WEIGHT)\n ], CartesianCrossLineLabel.prototype, \"fontWeight\", void 0);\n __decorate$1z([\n Validate(NUMBER(0))\n ], CartesianCrossLineLabel.prototype, \"fontSize\", void 0);\n __decorate$1z([\n Validate(STRING)\n ], CartesianCrossLineLabel.prototype, \"fontFamily\", void 0);\n __decorate$1z([\n Validate(NUMBER(0))\n ], CartesianCrossLineLabel.prototype, \"padding\", void 0);\n __decorate$1z([\n Validate(OPT_COLOR_STRING)\n ], CartesianCrossLineLabel.prototype, \"color\", void 0);\n __decorate$1z([\n Validate(OPT_CROSSLINE_LABEL_POSITION)\n ], CartesianCrossLineLabel.prototype, \"position\", void 0);\n __decorate$1z([\n Validate(OPT_NUMBER(-360, 360))\n ], CartesianCrossLineLabel.prototype, \"rotation\", void 0);\n __decorate$1z([\n Validate(OPT_BOOLEAN)\n ], CartesianCrossLineLabel.prototype, \"parallel\", void 0);\n return CartesianCrossLineLabel;\n}());\nvar CartesianCrossLine = /** @class */ (function () {\n function CartesianCrossLine() {\n this.id = createId$1(this);\n this.enabled = undefined;\n this.type = undefined;\n this.range = undefined;\n this.value = undefined;\n this.fill = undefined;\n this.fillOpacity = undefined;\n this.stroke = undefined;\n this.strokeWidth = undefined;\n this.strokeOpacity = undefined;\n this.lineDash = undefined;\n this.label = new CartesianCrossLineLabel();\n this.scale = undefined;\n this.clippedRange = [-Infinity, Infinity];\n this.gridLength = 0;\n this.sideFlag = -1;\n this.parallelFlipRotation = 0;\n this.regularFlipRotation = 0;\n this.direction = ChartAxisDirection.X;\n this.group = new Group({ name: \"\" + this.id, layer: true, zIndex: CartesianCrossLine.LINE_LAYER_ZINDEX });\n this.crossLineRange = new Range();\n this.crossLineLabel = new Text();\n this.labelPoint = undefined;\n this.data = [];\n this.startLine = false;\n this.endLine = false;\n this.isRange = false;\n var _a = this, group = _a.group, crossLineRange = _a.crossLineRange, crossLineLabel = _a.crossLineLabel;\n group.append([crossLineRange, crossLineLabel]);\n crossLineRange.pointerEvents = PointerEvents.None;\n }\n CartesianCrossLine.prototype.update = function (visible) {\n if (!this.enabled) {\n return;\n }\n this.group.visible = visible;\n if (!visible) {\n return;\n }\n var dataCreated = this.createNodeData();\n if (!dataCreated) {\n this.group.visible = false;\n return;\n }\n this.updateNodes();\n this.group.zIndex = this.getZIndex(this.isRange);\n };\n CartesianCrossLine.prototype.updateNodes = function () {\n this.updateRangeNode();\n if (this.label.enabled) {\n this.updateLabel();\n this.positionLabel();\n }\n };\n CartesianCrossLine.prototype.createNodeData = function () {\n var _a, _b, _c;\n var _d, _e;\n var _f = this, scale = _f.scale, gridLength = _f.gridLength, sideFlag = _f.sideFlag, direction = _f.direction, _g = _f.label.position, position = _g === void 0 ? 'top' : _g, clippedRange = _f.clippedRange, _h = _f.strokeWidth, strokeWidth = _h === void 0 ? 0 : _h;\n if (!scale) {\n return false;\n }\n var bandwidth = (_d = scale.bandwidth) !== null && _d !== void 0 ? _d : 0;\n var clippedRangeClamper = function (x) {\n return Math.max(Math.min.apply(Math, __spreadArray$n([], __read$H(clippedRange))), Math.min(Math.max.apply(Math, __spreadArray$n([], __read$H(clippedRange))), x));\n };\n var _j = __read$H([0, sideFlag * gridLength], 2), xStart = _j[0], xEnd = _j[1];\n var _k = __read$H(this.getRange(), 2), yStart = _k[0], yEnd = _k[1];\n var _l = __read$H([\n Number(scale.convert(yStart, { strict: false })),\n scale.convert(yEnd, { strict: false }) + bandwidth,\n ], 2), clampedYStart = _l[0], clampedYEnd = _l[1];\n clampedYStart = clippedRangeClamper(clampedYStart);\n clampedYEnd = clippedRangeClamper(clampedYEnd);\n _a = __read$H([Number(scale.convert(yStart)), scale.convert(yEnd) + bandwidth], 2), yStart = _a[0], yEnd = _a[1];\n var validRange = !isNaN(clampedYStart) &&\n !isNaN(clampedYEnd) &&\n (yStart === clampedYStart || yEnd === clampedYEnd || clampedYStart !== clampedYEnd) &&\n Math.abs(clampedYEnd - clampedYStart) > 0;\n if (validRange) {\n var reverse = clampedYStart !== Math.min(clampedYStart, clampedYEnd);\n if (reverse) {\n _b = __read$H([\n Math.min(clampedYStart, clampedYEnd),\n Math.max(clampedYStart, clampedYEnd),\n ], 2), clampedYStart = _b[0], clampedYEnd = _b[1];\n _c = __read$H([yEnd, yStart], 2), yStart = _c[0], yEnd = _c[1];\n }\n }\n this.isRange = validRange;\n this.startLine = !isNaN(yStart) && strokeWidth > 0 && yStart === clampedYStart;\n this.endLine = !isNaN(yEnd) && strokeWidth > 0 && yEnd === clampedYEnd;\n if (!validRange && !this.startLine && !this.endLine) {\n return false;\n }\n this.data = [clampedYStart, clampedYEnd];\n if (this.label.enabled) {\n var yDirection = direction === ChartAxisDirection.Y;\n var _m = ((_e = labeldDirectionHandling[position]) !== null && _e !== void 0 ? _e : {}).c, c = _m === void 0 ? POSITION_TOP_COORDINATES : _m;\n var _o = c({ yDirection: yDirection, xStart: xStart, xEnd: xEnd, yStart: clampedYStart, yEnd: clampedYEnd }), labelX = _o.x, labelY = _o.y;\n this.labelPoint = {\n x: labelX,\n y: labelY,\n };\n }\n return true;\n };\n CartesianCrossLine.prototype.updateRangeNode = function () {\n var _a;\n var _b = this, crossLineRange = _b.crossLineRange, sideFlag = _b.sideFlag, gridLength = _b.gridLength, data = _b.data, startLine = _b.startLine, endLine = _b.endLine, isRange = _b.isRange, fill = _b.fill, fillOpacity = _b.fillOpacity, stroke = _b.stroke, strokeWidth = _b.strokeWidth, lineDash = _b.lineDash;\n crossLineRange.x1 = 0;\n crossLineRange.x2 = sideFlag * gridLength;\n crossLineRange.y1 = data[0];\n crossLineRange.y2 = data[1];\n crossLineRange.startLine = startLine;\n crossLineRange.endLine = endLine;\n crossLineRange.isRange = isRange;\n crossLineRange.fill = fill;\n crossLineRange.fillOpacity = fillOpacity !== null && fillOpacity !== void 0 ? fillOpacity : 1;\n crossLineRange.stroke = stroke;\n crossLineRange.strokeWidth = strokeWidth !== null && strokeWidth !== void 0 ? strokeWidth : 1;\n crossLineRange.strokeOpacity = (_a = this.strokeOpacity) !== null && _a !== void 0 ? _a : 1;\n crossLineRange.lineDash = lineDash;\n };\n CartesianCrossLine.prototype.updateLabel = function () {\n var _a = this, crossLineLabel = _a.crossLineLabel, label = _a.label;\n if (!label.text) {\n return;\n }\n crossLineLabel.fontStyle = label.fontStyle;\n crossLineLabel.fontWeight = label.fontWeight;\n crossLineLabel.fontSize = label.fontSize;\n crossLineLabel.fontFamily = label.fontFamily;\n crossLineLabel.fill = label.color;\n crossLineLabel.text = label.text;\n };\n CartesianCrossLine.prototype.positionLabel = function () {\n var _a = this, crossLineLabel = _a.crossLineLabel, _b = _a.labelPoint, _c = _b === void 0 ? {} : _b, _d = _c.x, x = _d === void 0 ? undefined : _d, _e = _c.y, y = _e === void 0 ? undefined : _e, _f = _a.label, parallel = _f.parallel, rotation = _f.rotation, _g = _f.position, position = _g === void 0 ? 'top' : _g, _h = _f.padding, padding = _h === void 0 ? 0 : _h, direction = _a.direction, parallelFlipRotation = _a.parallelFlipRotation, regularFlipRotation = _a.regularFlipRotation;\n if (x === undefined || y === undefined) {\n return;\n }\n var _j = calculateLabelRotation({\n rotation: rotation,\n parallel: parallel,\n regularFlipRotation: regularFlipRotation,\n parallelFlipRotation: parallelFlipRotation,\n }), defaultRotation = _j.defaultRotation, configuredRotation = _j.configuredRotation;\n crossLineLabel.rotation = defaultRotation + configuredRotation;\n crossLineLabel.textBaseline = 'middle';\n crossLineLabel.textAlign = 'center';\n var bbox = this.computeLabelBBox();\n if (!bbox) {\n return;\n }\n var yDirection = direction === ChartAxisDirection.Y;\n var _k = calculateLabelTranslation({ yDirection: yDirection, padding: padding, position: position, bbox: bbox }), xTranslation = _k.xTranslation, yTranslation = _k.yTranslation;\n crossLineLabel.translationX = x + xTranslation;\n crossLineLabel.translationY = y + yTranslation;\n };\n CartesianCrossLine.prototype.getZIndex = function (isRange) {\n if (isRange === void 0) { isRange = false; }\n if (isRange) {\n return CartesianCrossLine.RANGE_LAYER_ZINDEX;\n }\n return CartesianCrossLine.LINE_LAYER_ZINDEX;\n };\n CartesianCrossLine.prototype.getRange = function () {\n var _a = this, value = _a.value, range = _a.range, scale = _a.scale;\n var isContinuous = scale instanceof ContinuousScale;\n var _b = __read$H(range !== null && range !== void 0 ? range : [value, undefined], 2), start = _b[0], end = _b[1];\n if (!isContinuous && end === undefined) {\n end = start;\n }\n start = checkDatum(start, isContinuous) != null ? start : undefined;\n end = checkDatum(end, isContinuous) != null ? end : undefined;\n if (isContinuous && start === end) {\n end = undefined;\n }\n if (start === undefined && end !== undefined) {\n start = end;\n end = undefined;\n }\n return [start, end];\n };\n CartesianCrossLine.prototype.computeLabelBBox = function () {\n return this.crossLineLabel.computeTransformedBBox();\n };\n CartesianCrossLine.prototype.calculatePadding = function (padding) {\n var _a, _b, _c, _d, _e, _f, _g, _h;\n var _j = this, isRange = _j.isRange, startLine = _j.startLine, endLine = _j.endLine, direction = _j.direction, _k = _j.label, _l = _k.padding, labelPadding = _l === void 0 ? 0 : _l, _m = _k.position, position = _m === void 0 ? 'top' : _m;\n if (!isRange && !startLine && !endLine) {\n return;\n }\n var crossLineLabelBBox = this.computeLabelBBox();\n var labelX = crossLineLabelBBox === null || crossLineLabelBBox === void 0 ? void 0 : crossLineLabelBBox.x;\n var labelY = crossLineLabelBBox === null || crossLineLabelBBox === void 0 ? void 0 : crossLineLabelBBox.y;\n if (!crossLineLabelBBox || labelX == undefined || labelY == undefined) {\n return;\n }\n var chartPadding = calculateLabelChartPadding({\n yDirection: direction === ChartAxisDirection.Y,\n padding: labelPadding,\n position: position,\n bbox: crossLineLabelBBox,\n });\n padding.left = Math.max((_a = padding.left) !== null && _a !== void 0 ? _a : 0, (_b = chartPadding.left) !== null && _b !== void 0 ? _b : 0);\n padding.right = Math.max((_c = padding.right) !== null && _c !== void 0 ? _c : 0, (_d = chartPadding.right) !== null && _d !== void 0 ? _d : 0);\n padding.top = Math.max((_e = padding.top) !== null && _e !== void 0 ? _e : 0, (_f = chartPadding.top) !== null && _f !== void 0 ? _f : 0);\n padding.bottom = Math.max((_g = padding.bottom) !== null && _g !== void 0 ? _g : 0, (_h = chartPadding.bottom) !== null && _h !== void 0 ? _h : 0);\n };\n CartesianCrossLine.LINE_LAYER_ZINDEX = Layers.SERIES_CROSSLINE_LINE_ZINDEX;\n CartesianCrossLine.RANGE_LAYER_ZINDEX = Layers.SERIES_CROSSLINE_RANGE_ZINDEX;\n CartesianCrossLine.className = 'CrossLine';\n __decorate$1z([\n Validate(OPT_BOOLEAN)\n ], CartesianCrossLine.prototype, \"enabled\", void 0);\n __decorate$1z([\n Validate(OPT_CROSSLINE_TYPE)\n ], CartesianCrossLine.prototype, \"type\", void 0);\n __decorate$1z([\n Validate(OPT_ARRAY(2))\n ], CartesianCrossLine.prototype, \"range\", void 0);\n __decorate$1z([\n Validate(OPT_COLOR_STRING)\n ], CartesianCrossLine.prototype, \"fill\", void 0);\n __decorate$1z([\n Validate(OPT_NUMBER(0, 1))\n ], CartesianCrossLine.prototype, \"fillOpacity\", void 0);\n __decorate$1z([\n Validate(OPT_COLOR_STRING)\n ], CartesianCrossLine.prototype, \"stroke\", void 0);\n __decorate$1z([\n Validate(OPT_NUMBER())\n ], CartesianCrossLine.prototype, \"strokeWidth\", void 0);\n __decorate$1z([\n Validate(OPT_NUMBER(0, 1))\n ], CartesianCrossLine.prototype, \"strokeOpacity\", void 0);\n __decorate$1z([\n Validate(OPT_LINE_DASH)\n ], CartesianCrossLine.prototype, \"lineDash\", void 0);\n return CartesianCrossLine;\n}());\n\nvar __extends$2g = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign$D = (undefined && undefined.__assign) || function () {\n __assign$D = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$D.apply(this, arguments);\n};\nvar __decorate$1y = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar CartesianAxis = /** @class */ (function (_super) {\n __extends$2g(CartesianAxis, _super);\n function CartesianAxis() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.thickness = 0;\n _this.position = 'left';\n return _this;\n }\n Object.defineProperty(CartesianAxis.prototype, \"direction\", {\n get: function () {\n return ['top', 'bottom'].includes(this.position) ? ChartAxisDirection.X : ChartAxisDirection.Y;\n },\n enumerable: false,\n configurable: true\n });\n CartesianAxis.prototype.updateDirection = function () {\n switch (this.position) {\n case 'top':\n this.rotation = -90;\n this.label.mirrored = true;\n this.label.parallel = true;\n break;\n case 'right':\n this.rotation = 0;\n this.label.mirrored = true;\n this.label.parallel = false;\n break;\n case 'bottom':\n this.rotation = -90;\n this.label.mirrored = false;\n this.label.parallel = true;\n break;\n case 'left':\n this.rotation = 0;\n this.label.mirrored = false;\n this.label.parallel = false;\n break;\n }\n if (this.axisContext) {\n this.axisContext.position = this.position;\n this.axisContext.direction = this.direction;\n }\n };\n CartesianAxis.prototype.update = function (primaryTickCount) {\n this.updateDirection();\n return _super.prototype.update.call(this, primaryTickCount);\n };\n CartesianAxis.prototype.createAxisContext = function () {\n return __assign$D(__assign$D({}, _super.prototype.createAxisContext.call(this)), { position: this.position });\n };\n CartesianAxis.prototype.assignCrossLineArrayConstructor = function (crossLines) {\n assignJsonApplyConstructedArray(crossLines, CartesianCrossLine);\n };\n __decorate$1y([\n Validate(NUMBER(0))\n ], CartesianAxis.prototype, \"thickness\", void 0);\n __decorate$1y([\n Validate(POSITION)\n ], CartesianAxis.prototype, \"position\", void 0);\n return CartesianAxis;\n}(Axis));\n\nvar __extends$2f = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$1x = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __values$k = (undefined && undefined.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nvar __read$G = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray$m = (undefined && undefined.__spreadArray) || function (to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\n to[j] = from[i];\n return to;\n};\nvar CategoryAxis = /** @class */ (function (_super) {\n __extends$2f(CategoryAxis, _super);\n function CategoryAxis(moduleCtx) {\n var _this = _super.call(this, moduleCtx, new BandScale$5()) || this;\n _this._paddingOverrideEnabled = false;\n _this.groupPaddingInner = 0.1;\n _this.includeInvisibleDomains = true;\n return _this;\n }\n Object.defineProperty(CategoryAxis.prototype, \"paddingInner\", {\n get: function () {\n this._paddingOverrideEnabled = true;\n return this.scale.paddingInner;\n },\n set: function (value) {\n this._paddingOverrideEnabled = true;\n this.scale.paddingInner = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CategoryAxis.prototype, \"paddingOuter\", {\n get: function () {\n return this.scale.paddingOuter;\n },\n set: function (value) {\n this.scale.paddingOuter = value;\n },\n enumerable: false,\n configurable: true\n });\n CategoryAxis.prototype.normaliseDataDomain = function (d) {\n var e_1, _a;\n var _b;\n var _c;\n // Prevent duplicate categories.\n var valuesSet = {};\n try {\n for (var d_1 = __values$k(d), d_1_1 = d_1.next(); !d_1_1.done; d_1_1 = d_1.next()) {\n var next = d_1_1.value;\n (_b = valuesSet[_c = String(next)]) !== null && _b !== void 0 ? _b : (valuesSet[_c] = next);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (d_1_1 && !d_1_1.done && (_a = d_1.return)) _a.call(d_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n return Object.values(valuesSet);\n };\n CategoryAxis.prototype.calculateDomain = function () {\n if (!this._paddingOverrideEnabled) {\n var boundSeries = this.boundSeries;\n var paddings = boundSeries.map(function (s) { var _a; return (_a = s.getBandScalePadding) === null || _a === void 0 ? void 0 : _a.call(s); }).filter(function (p) { return p != null; });\n if (paddings.length > 0) {\n this.scale.paddingInner = Math.min.apply(Math, __spreadArray$m([], __read$G(paddings.map(function (p) { return p.inner; }))));\n this.scale.paddingOuter = Math.max.apply(Math, __spreadArray$m([], __read$G(paddings.map(function (p) { return p.outer; }))));\n }\n }\n return _super.prototype.calculateDomain.call(this);\n };\n CategoryAxis.className = 'CategoryAxis';\n CategoryAxis.type = 'category';\n __decorate$1x([\n Validate(NUMBER(0, 1))\n ], CategoryAxis.prototype, \"groupPaddingInner\", void 0);\n return CategoryAxis;\n}(CartesianAxis));\n\n/**\n * The tree layout is calculated in abstract x/y coordinates, where the root is at (0, 0)\n * and the tree grows downward from the root.\n */\nvar TreeNode = /** @class */ (function () {\n function TreeNode(label, parent, number) {\n if (label === void 0) { label = ''; }\n if (number === void 0) { number = 0; }\n this.x = 0;\n this.y = 0;\n this.subtreeLeft = NaN;\n this.subtreeRight = NaN;\n this.screenX = 0;\n this.screenY = 0;\n this.children = [];\n this.leafCount = 0;\n this.prelim = 0;\n this.mod = 0;\n this.ancestor = this;\n this.change = 0;\n this.shift = 0;\n this.label = label;\n // screenX and screenY are meant to be recomputed from (layout) x and y\n // when the tree is resized (without performing another layout)\n this.parent = parent;\n this.depth = parent ? parent.depth + 1 : 0;\n this.number = number;\n }\n TreeNode.prototype.getLeftSibling = function () {\n return this.number > 0 && this.parent ? this.parent.children[this.number - 1] : undefined;\n };\n TreeNode.prototype.getLeftmostSibling = function () {\n return this.number > 0 && this.parent ? this.parent.children[0] : undefined;\n };\n // traverse the left contour of a subtree, return the successor of v on this contour\n TreeNode.prototype.nextLeft = function () {\n return this.children ? this.children[0] : this.thread;\n };\n // traverse the right contour of a subtree, return the successor of v on this contour\n TreeNode.prototype.nextRight = function () {\n return this.children ? this.children[this.children.length - 1] : this.thread;\n };\n TreeNode.prototype.getSiblings = function () {\n var _this = this;\n return this.parent ? this.parent.children.filter(function (_, i) { return i !== _this.number; }) : [];\n };\n return TreeNode;\n}());\n/**\n * Converts an array of ticks, where each tick has an array of labels, to a label tree.\n * If `pad` is `true`, will ensure that every branch matches the depth of the tree by\n * creating empty labels.\n */\nfunction ticksToTree(ticks, pad) {\n if (pad === void 0) { pad = true; }\n var root = new TreeNode();\n var depth = 0;\n if (pad) {\n ticks.forEach(function (tick) { return (depth = Math.max(depth, tick.labels.length)); });\n }\n ticks.forEach(function (tick) {\n if (pad) {\n while (tick.labels.length < depth) {\n tick.labels.unshift('');\n }\n }\n insertTick(root, tick);\n });\n return root;\n}\nfunction insertTick(root, tick) {\n var pathParts = tick.labels.slice().reverse(); // path elements from root to leaf label\n var lastPartIndex = pathParts.length - 1;\n pathParts.forEach(function (pathPart, partIndex) {\n var children = root.children;\n var existingNode = children.find(function (child) { return child.label === pathPart; });\n var isNotLeaf = partIndex !== lastPartIndex;\n if (existingNode && isNotLeaf) {\n // the isNotLeaf check is to allow duplicate leafs\n root = existingNode;\n }\n else {\n var node = new TreeNode(pathPart, root);\n node.number = children.length;\n children.push(node);\n if (isNotLeaf) {\n root = node;\n }\n }\n });\n}\n// Shift the subtree.\nfunction moveSubtree(wm, wp, shift) {\n var subtrees = wp.number - wm.number;\n var ratio = shift / subtrees;\n wp.change -= ratio;\n wp.shift += shift;\n wm.change += ratio;\n wp.prelim += shift;\n wp.mod += shift;\n}\nfunction ancestor(vim, v, defaultAncestor) {\n return v.getSiblings().indexOf(vim.ancestor) >= 0 ? vim.ancestor : defaultAncestor;\n}\n// Spaces out the children.\nfunction executeShifts(v) {\n var children = v.children;\n if (children) {\n var shift = 0;\n var change = 0;\n for (var i = children.length - 1; i >= 0; i--) {\n var w = children[i];\n w.prelim += shift;\n w.mod += shift;\n change += w.change;\n shift += w.shift + change;\n }\n }\n}\n// Moves current subtree with v as the root if some nodes are conflicting in space.\nfunction apportion(v, defaultAncestor, distance) {\n var w = v.getLeftSibling();\n if (w) {\n var vop = v;\n var vip = v;\n var vim = w;\n var vom = vip.getLeftmostSibling();\n var sip = vip.mod;\n var sop = vop.mod;\n var sim = vim.mod;\n var som = vom.mod;\n while (vim.nextRight() && vip.nextLeft()) {\n vim = vim.nextRight();\n vip = vip.nextLeft();\n vom = vom.nextLeft();\n vop = vop.nextRight();\n vop.ancestor = v;\n var shift = vim.prelim + sim - (vip.prelim + sip) + distance;\n if (shift > 0) {\n moveSubtree(ancestor(vim, v, defaultAncestor), v, shift);\n sip += shift;\n sop += shift;\n }\n sim += vim.mod;\n sip += vip.mod;\n som += vom.mod;\n sop += vop.mod;\n }\n if (vim.nextRight() && !vop.nextRight()) {\n vop.thread = vim.nextRight();\n vop.mod += sim - sop;\n }\n else {\n if (vip.nextLeft() && !vom.nextLeft()) {\n vom.thread = vip.nextLeft();\n vom.mod += sip - som;\n }\n defaultAncestor = v;\n }\n }\n return defaultAncestor;\n}\n// Compute the preliminary x-coordinate of node and its children (recursively).\nfunction firstWalk(node, distance) {\n var children = node.children;\n if (children.length) {\n var defaultAncestor_1 = children[0];\n children.forEach(function (child) {\n firstWalk(child, distance);\n defaultAncestor_1 = apportion(child, defaultAncestor_1, distance);\n });\n executeShifts(node);\n var midpoint = (children[0].prelim + children[children.length - 1].prelim) / 2;\n var leftSibling = node.getLeftSibling();\n if (leftSibling) {\n node.prelim = leftSibling.prelim + distance;\n node.mod = node.prelim - midpoint;\n }\n else {\n node.prelim = midpoint;\n }\n }\n else {\n var leftSibling = node.getLeftSibling();\n node.prelim = leftSibling ? leftSibling.prelim + distance : 0;\n }\n}\nvar Dimensions = /** @class */ (function () {\n function Dimensions() {\n this.top = Infinity;\n this.right = -Infinity;\n this.bottom = -Infinity;\n this.left = Infinity;\n }\n Dimensions.prototype.update = function (node, xy) {\n var _a = xy(node), x = _a.x, y = _a.y;\n if (x > this.right) {\n this.right = x;\n }\n if (x < this.left) {\n this.left = x;\n }\n if (y > this.bottom) {\n this.bottom = y;\n }\n if (y < this.top) {\n this.top = y;\n }\n };\n return Dimensions;\n}());\nfunction secondWalk(v, m, layout) {\n v.x = v.prelim + m;\n v.y = v.depth;\n layout.update(v);\n v.children.forEach(function (w) { return secondWalk(w, m + v.mod, layout); });\n}\n// After the second walk the parent nodes are positioned at the center of their immediate children.\n// If we want the parent nodes to be positioned at the center of the subtree for which they are roots,\n// we need a third walk to adjust the positions.\nfunction thirdWalk(v) {\n var children = v.children;\n var leafCount = 0;\n children.forEach(function (w) {\n thirdWalk(w);\n if (w.children.length) {\n leafCount += w.leafCount;\n }\n else {\n leafCount++;\n }\n });\n v.leafCount = leafCount;\n if (children.length) {\n v.subtreeLeft = children[0].subtreeLeft;\n v.subtreeRight = children[v.children.length - 1].subtreeRight;\n v.x = (v.subtreeLeft + v.subtreeRight) / 2;\n }\n else {\n v.subtreeLeft = v.x;\n v.subtreeRight = v.x;\n }\n}\nfunction treeLayout(root) {\n var layout = new TreeLayout();\n firstWalk(root, 1);\n secondWalk(root, -root.prelim, layout);\n thirdWalk(root);\n return layout;\n}\nvar TreeLayout = /** @class */ (function () {\n function TreeLayout() {\n this.dimensions = new Dimensions();\n this.leafCount = 0;\n this.nodes = [];\n // One might want to process leaf nodes separately from the rest of the tree.\n // For example, position labels corresponding to leafs vertically, rather than horizontally.\n this.leafNodes = [];\n this.nonLeafNodes = [];\n this.depth = 0;\n }\n TreeLayout.prototype.update = function (node) {\n this.dimensions.update(node, function (node) { return ({ x: node.x, y: node.y }); });\n if (!node.children.length) {\n this.leafCount++;\n this.leafNodes.push(node);\n }\n else {\n this.nonLeafNodes.push(node);\n }\n if (node.depth > this.depth) {\n this.depth = node.depth;\n }\n this.nodes.push(node);\n };\n TreeLayout.prototype.resize = function (width, height, shiftX, shiftY, flipX) {\n if (shiftX === void 0) { shiftX = 0; }\n if (shiftY === void 0) { shiftY = 0; }\n if (flipX === void 0) { flipX = false; }\n var xSteps = this.leafCount - 1;\n var ySteps = this.depth;\n var dimensions = this.dimensions;\n var scalingX = 1;\n var scalingY = 1;\n if (width > 0 && xSteps) {\n var existingSpacingX = (dimensions.right - dimensions.left) / xSteps;\n var desiredSpacingX = width / xSteps;\n scalingX = desiredSpacingX / existingSpacingX;\n if (flipX) {\n scalingX = -scalingX;\n }\n }\n if (height > 0 && ySteps) {\n var existingSpacingY = (dimensions.bottom - dimensions.top) / ySteps;\n var desiredSpacingY = height / ySteps;\n scalingY = desiredSpacingY / existingSpacingY;\n }\n var screenDimensions = new Dimensions();\n this.nodes.forEach(function (node) {\n node.screenX = node.x * scalingX;\n node.screenY = node.y * scalingY;\n screenDimensions.update(node, function (node) { return ({ x: node.screenX, y: node.screenY }); });\n });\n // Normalize so that root top and leftmost leaf left start at zero.\n var offsetX = -screenDimensions.left;\n var offsetY = -screenDimensions.top;\n this.nodes.forEach(function (node) {\n node.screenX += offsetX + shiftX;\n node.screenY += offsetY + shiftY;\n });\n };\n return TreeLayout;\n}());\n\nvar __extends$2e = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$1w = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __read$F = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray$l = (undefined && undefined.__spreadArray) || function (to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\n to[j] = from[i];\n return to;\n};\nvar GroupedCategoryAxisLabel = /** @class */ (function (_super) {\n __extends$2e(GroupedCategoryAxisLabel, _super);\n function GroupedCategoryAxisLabel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.grid = false;\n return _this;\n }\n __decorate$1w([\n Validate(BOOLEAN)\n ], GroupedCategoryAxisLabel.prototype, \"grid\", void 0);\n return GroupedCategoryAxisLabel;\n}(AxisLabel));\nvar GroupedCategoryAxis = /** @class */ (function (_super) {\n __extends$2e(GroupedCategoryAxis, _super);\n function GroupedCategoryAxis(moduleCtx) {\n var _this = _super.call(this, moduleCtx, new BandScale$5()) || this;\n // Label scale (labels are positioned between ticks, tick count = label count + 1).\n // We don't call is `labelScale` for consistency with other axes.\n _this.tickScale = new BandScale$5();\n _this.translation = {\n x: 0,\n y: 0,\n };\n _this.line = new AxisLine();\n _this.label = new GroupedCategoryAxisLabel();\n /**\n * The color of the labels.\n * Use `undefined` rather than `rgba(0, 0, 0, 0)` to make labels invisible.\n */\n _this.labelColor = 'rgba(87, 87, 87, 1)';\n _this.includeInvisibleDomains = true;\n var _a = _this, tickLineGroup = _a.tickLineGroup, tickLabelGroup = _a.tickLabelGroup, gridLineGroup = _a.gridLineGroup, tickScale = _a.tickScale, scale = _a.scale;\n scale.paddingOuter = 0.1;\n scale.paddingInner = scale.paddingOuter * 2;\n _this.range = scale.range.slice();\n _this.refreshScale();\n tickScale.paddingInner = 1;\n tickScale.paddingOuter = 0;\n _this.gridLineSelection = Selection.select(gridLineGroup, Line);\n _this.axisLineSelection = Selection.select(tickLineGroup, Line);\n _this.separatorSelection = Selection.select(tickLineGroup, Line);\n _this.labelSelection = Selection.select(tickLabelGroup, Text);\n return _this;\n }\n GroupedCategoryAxis.prototype.updateRange = function () {\n var _a = this, rr = _a.range, vr = _a.visibleRange, scale = _a.scale;\n var span = (rr[1] - rr[0]) / (vr[1] - vr[0]);\n var shift = span * vr[0];\n var start = rr[0] - shift;\n this.tickScale.range = scale.range = [start, start + span];\n this.resizeTickTree();\n };\n GroupedCategoryAxis.prototype.resizeTickTree = function () {\n var _a;\n var s = this.scale;\n var range = s.domain.length ? [s.convert(s.domain[0]), s.convert(s.domain[s.domain.length - 1])] : s.range;\n var layout = this.tickTreeLayout;\n var lineHeight = this.lineHeight;\n if (layout) {\n layout.resize(Math.abs(range[1] - range[0]), layout.depth * lineHeight, (Math.min(range[0], range[1]) || 0) + ((_a = s.bandwidth) !== null && _a !== void 0 ? _a : 0) / 2, -layout.depth * lineHeight, range[1] - range[0] < 0);\n }\n };\n Object.defineProperty(GroupedCategoryAxis.prototype, \"lineHeight\", {\n get: function () {\n return this.label.fontSize * 1.5;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(GroupedCategoryAxis.prototype, \"gridLength\", {\n get: function () {\n return this._gridLength;\n },\n /**\n * The length of the grid. The grid is only visible in case of a non-zero value.\n */\n set: function (value) {\n // Was visible and now invisible, or was invisible and now visible.\n if ((this._gridLength && !value) || (!this._gridLength && value)) {\n this.gridLineSelection.clear();\n this.labelSelection.clear();\n }\n this._gridLength = value;\n },\n enumerable: false,\n configurable: true\n });\n GroupedCategoryAxis.prototype.calculateDomain = function () {\n var _a;\n var _b;\n var _c = this, direction = _c.direction, boundSeries = _c.boundSeries;\n var domains = [];\n var isNumericX = undefined;\n boundSeries\n .filter(function (s) { return s.visible; })\n .forEach(function (series) {\n if (direction === ChartAxisDirection.X) {\n if (isNumericX === undefined) {\n // always add first X domain\n var domain_1 = series.getDomain(direction);\n domains.push(domain_1);\n isNumericX = typeof domain_1[0] === 'number';\n }\n else if (isNumericX) {\n // only add further X domains if the axis is numeric\n domains.push(series.getDomain(direction));\n }\n }\n else {\n domains.push(series.getDomain(direction));\n }\n });\n var domain = (_a = new Array()).concat.apply(_a, __spreadArray$l([], __read$F(domains)));\n var values = (_b = extent$4(domain)) !== null && _b !== void 0 ? _b : domain;\n this.dataDomain = this.normaliseDataDomain(values);\n this.scale.domain = this.dataDomain;\n };\n GroupedCategoryAxis.prototype.normaliseDataDomain = function (d) {\n // Prevent duplicate categories.\n var values = d.filter(function (s, i, arr) { return arr.indexOf(s) === i; });\n var tickTree = ticksToTree(values);\n this.tickTreeLayout = treeLayout(tickTree);\n var tickScaleDomain = values.slice();\n tickScaleDomain.push('');\n this.tickScale.domain = tickScaleDomain;\n this.resizeTickTree();\n return values;\n };\n /**\n * Creates/removes/updates the scene graph nodes that constitute the axis.\n * Supposed to be called _manually_ after changing _any_ of the axis properties.\n * This allows to bulk set axis properties before updating the nodes.\n * The node changes made by this method are rendered on the next animation frame.\n * We could schedule this method call automatically on the next animation frame\n * when any of the axis properties change (the way we do when properties of scene graph's\n * nodes change), but this will mean that we first wait for the next animation\n * frame to make changes to the nodes of the axis, then wait for another animation\n * frame to render those changes. It's nice to have everything update automatically,\n * but this extra level of async indirection will not just introduce an unwanted delay,\n * it will also make it harder to reason about the program.\n */\n GroupedCategoryAxis.prototype.update = function (primaryTickCount) {\n var _this = this;\n this.updateDirection();\n this.calculateDomain();\n this.updateRange();\n var _a = this, scale = _a.scale, label = _a.label, parallel = _a.label.parallel, callbackCache = _a.moduleCtx.callbackCache, tickScale = _a.tickScale, requestedRange = _a.range, title = _a.title, _b = _a.title, _c = _b === void 0 ? {} : _b, _d = _c.formatter, formatter = _d === void 0 ? function (p) { return p.defaultValue; } : _d, _titleCaption = _a._titleCaption;\n var rangeStart = scale.range[0];\n var rangeEnd = scale.range[1];\n var rangeLength = Math.abs(rangeEnd - rangeStart);\n var bandwidth = rangeLength / scale.domain.length || 0;\n var rotation = toRadians$1(this.rotation);\n var isHorizontal = Math.abs(Math.cos(rotation)) < 1e-8;\n var sideFlag = label.getSideFlag();\n this.updatePosition({ rotation: rotation, sideFlag: sideFlag });\n // The Text `node` of the Caption is not used to render the title of the grouped category axis.\n // The phantom root of the tree layout is used instead.\n _titleCaption.node.visible = false;\n var lineHeight = this.lineHeight;\n // Render ticks and labels.\n var tickTreeLayout = this.tickTreeLayout;\n var labels = scale.ticks();\n var treeLabels = tickTreeLayout ? tickTreeLayout.nodes : [];\n var isLabelTree = tickTreeLayout ? tickTreeLayout.depth > 1 : false;\n var ticks = tickScale.ticks();\n // When labels are parallel to the axis line, the `parallelFlipFlag` is used to\n // flip the labels to avoid upside-down text, when the axis is rotated\n // such that it is in the right hemisphere, i.e. the angle of rotation\n // is in the [0, π] interval.\n // The rotation angle is normalized, so that we have an easier time checking\n // if it's in the said interval. Since the axis is always rendered vertically\n // and then rotated, zero rotation means 12 (not 3) o-clock.\n // -1 = flip\n // 1 = don't flip (default)\n var _e = calculateLabelRotation({\n rotation: label.rotation,\n parallel: parallel,\n regularFlipRotation: normalizeAngle360(rotation - Math.PI / 2),\n parallelFlipRotation: normalizeAngle360(rotation),\n }), defaultRotation = _e.defaultRotation, configuredRotation = _e.configuredRotation, parallelFlipFlag = _e.parallelFlipFlag;\n var gridLineSelection = this.gridLineSelection.update(this.gridLength ? ticks : []);\n var labelSelection = this.labelSelection.update(treeLabels);\n var labelFormatter = label.formatter;\n var labelBBoxes = new Map();\n var maxLeafLabelWidth = 0;\n labelSelection.each(function (node, datum, index) {\n var _a;\n node.fontStyle = label.fontStyle;\n node.fontWeight = label.fontWeight;\n node.fontSize = label.fontSize;\n node.fontFamily = label.fontFamily;\n node.fill = label.color;\n node.textBaseline = parallelFlipFlag === -1 ? 'bottom' : 'hanging';\n node.textAlign = 'center';\n node.translationX = datum.screenY - label.fontSize * 0.25;\n node.translationY = datum.screenX;\n if (index === 0) {\n // use the phantom root as the axis title\n if ((title === null || title === void 0 ? void 0 : title.enabled) && labels.length > 0) {\n node.visible = true;\n node.text = callbackCache.call(formatter, _this.getTitleFormatterParams());\n node.fontSize = title.fontSize;\n node.fontStyle = title.fontStyle;\n node.fontWeight = title.fontWeight;\n node.fontFamily = title.fontFamily;\n node.textBaseline = 'hanging';\n }\n else {\n node.visible = false;\n }\n }\n else if (labelFormatter) {\n node.text =\n (_a = callbackCache.call(labelFormatter, {\n value: String(datum.label),\n index: index,\n })) !== null && _a !== void 0 ? _a : String(datum.label);\n node.visible = datum.screenX >= requestedRange[0] && datum.screenX <= requestedRange[1];\n }\n else {\n node.text = String(datum.label);\n node.visible = datum.screenX >= requestedRange[0] && datum.screenX <= requestedRange[1];\n }\n var bbox = node.computeBBox();\n labelBBoxes.set(node.id, bbox);\n if (bbox.width > maxLeafLabelWidth) {\n maxLeafLabelWidth = bbox.width;\n }\n });\n var labelX = sideFlag * label.padding;\n var labelGrid = this.label.grid;\n var separatorData = [];\n labelSelection.each(function (label, datum, index) {\n label.x = labelX;\n label.rotationCenterX = labelX;\n if (!datum.children.length) {\n label.rotation = configuredRotation;\n label.textAlign = 'end';\n label.textBaseline = 'middle';\n var bbox = labelBBoxes.get(label.id);\n if (bbox && bbox.height > bandwidth) {\n label.visible = false;\n }\n }\n else {\n label.translationX -= maxLeafLabelWidth - lineHeight + _this.label.padding;\n var availableRange = datum.leafCount * bandwidth;\n var bbox = labelBBoxes.get(label.id);\n if (bbox && bbox.width > availableRange) {\n label.visible = false;\n }\n else if (isHorizontal) {\n label.rotation = defaultRotation;\n }\n else {\n label.rotation = -Math.PI / 2;\n }\n }\n // Calculate positions of label separators for all nodes except the root.\n // Each separator is placed to the top of the current label.\n if (datum.parent && isLabelTree) {\n var y = !datum.children.length\n ? datum.screenX - bandwidth / 2\n : datum.screenX - (datum.leafCount * bandwidth) / 2;\n if (!datum.children.length) {\n if (datum.number !== datum.children.length - 1 || labelGrid) {\n separatorData.push({\n y: y,\n x1: 0,\n x2: -maxLeafLabelWidth - _this.label.padding * 2,\n toString: function () { return String(index); },\n });\n }\n }\n else {\n var x = -maxLeafLabelWidth - _this.label.padding * 2 + datum.screenY;\n separatorData.push({\n y: y,\n x1: x + lineHeight,\n x2: x,\n toString: function () { return String(index); },\n });\n }\n }\n });\n // Calculate the position of the long separator on the far bottom of the axis.\n var minX = 0;\n separatorData.forEach(function (d) { return (minX = Math.min(minX, d.x2)); });\n separatorData.push({\n y: Math.max(rangeStart, rangeEnd),\n x1: 0,\n x2: minX,\n toString: function () { return String(separatorData.length); },\n });\n var separatorSelection = this.separatorSelection.update(separatorData);\n var epsilon = 0.0000001;\n separatorSelection.each(function (line, datum) {\n line.x1 = datum.x1;\n line.x2 = datum.x2;\n line.y1 = datum.y;\n line.y2 = datum.y;\n line.visible = datum.y >= requestedRange[0] - epsilon && datum.y <= requestedRange[1] + epsilon;\n line.stroke = _this.tick.color;\n line.fill = undefined;\n line.strokeWidth = 1;\n });\n this.gridLineSelection = gridLineSelection;\n this.labelSelection = labelSelection;\n // Render axis lines.\n var lineCount = tickTreeLayout ? tickTreeLayout.depth + 1 : 1;\n var lines = [];\n for (var i = 0; i < lineCount; i++) {\n lines.push(i);\n }\n var axisLineSelection = this.axisLineSelection.update(lines);\n axisLineSelection.each(function (line, _, index) {\n var x = index > 0 ? -maxLeafLabelWidth - _this.label.padding * 2 - (index - 1) * lineHeight : 0;\n line.x1 = x;\n line.x2 = x;\n line.y1 = requestedRange[0];\n line.y2 = requestedRange[1];\n line.strokeWidth = _this.line.width;\n line.stroke = _this.line.color;\n line.visible = labels.length > 0 && (index === 0 || (labelGrid && isLabelTree));\n });\n if (this.gridLength) {\n var styles_1 = this.gridStyle;\n var styleCount_1 = styles_1.length;\n gridLineSelection.each(function (line, datum, index) {\n var y = Math.round(tickScale.convert(datum));\n line.x1 = 0;\n line.x2 = -sideFlag * _this.gridLength;\n line.y1 = y;\n line.y2 = y;\n line.visible = y >= requestedRange[0] && y <= requestedRange[1];\n var style = styles_1[index % styleCount_1];\n line.stroke = style.stroke;\n line.strokeWidth = _this.tick.width;\n line.lineDash = style.lineDash;\n line.fill = undefined;\n });\n }\n return primaryTickCount;\n };\n GroupedCategoryAxis.className = 'GroupedCategoryAxis';\n GroupedCategoryAxis.type = 'groupedCategory';\n __decorate$1w([\n Validate(OPT_COLOR_STRING)\n ], GroupedCategoryAxis.prototype, \"labelColor\", void 0);\n return GroupedCategoryAxis;\n}(CartesianAxis));\n\nvar __extends$2d = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign$C = (undefined && undefined.__assign) || function () {\n __assign$C = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$C.apply(this, arguments);\n};\nvar __awaiter$a = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator$a = (undefined && undefined.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nvar __values$j = (undefined && undefined.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nvar __read$E = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar directions = ['top', 'right', 'bottom', 'left'];\nvar CartesianChart = /** @class */ (function (_super) {\n __extends$2d(CartesianChart, _super);\n function CartesianChart(document, overrideDevicePixelRatio, resources) {\n if (document === void 0) { document = window.document; }\n var _this = _super.call(this, document, overrideDevicePixelRatio, resources) || this;\n /** Integrated Charts feature state - not used in Standalone Charts. */\n _this.paired = true;\n _this._lastAxisWidths = {\n top: 0,\n bottom: 0,\n left: 0,\n right: 0,\n };\n _this._lastVisibility = {\n crossLines: true,\n series: true,\n };\n return _this;\n }\n CartesianChart.prototype.performLayout = function () {\n return __awaiter$a(this, void 0, void 0, function () {\n var shrinkRect, _a, seriesRect, visibility, clipSeries, _b, seriesRoot, seriesAreaPadding, seriesPaddedRect, hoverRectPadding, hoverRect;\n return __generator$a(this, function (_c) {\n switch (_c.label) {\n case 0: return [4 /*yield*/, _super.prototype.performLayout.call(this)];\n case 1:\n shrinkRect = _c.sent();\n _a = this.updateAxes(shrinkRect), seriesRect = _a.seriesRect, visibility = _a.visibility, clipSeries = _a.clipSeries;\n this.seriesRoot.visible = visibility.series;\n this.seriesRect = seriesRect;\n this.seriesRoot.translationX = Math.floor(seriesRect.x);\n this.seriesRoot.translationY = Math.floor(seriesRect.y);\n _b = this, seriesRoot = _b.seriesRoot, seriesAreaPadding = _b.seriesAreaPadding;\n seriesPaddedRect = seriesRect.clone().grow({\n top: seriesAreaPadding.top,\n right: seriesAreaPadding.right,\n bottom: seriesAreaPadding.bottom,\n left: seriesAreaPadding.left,\n });\n hoverRectPadding = 20;\n hoverRect = seriesPaddedRect.clone().grow(hoverRectPadding);\n this.hoverRect = hoverRect;\n this.layoutService.dispatchLayoutComplete({\n type: 'layout-complete',\n chart: { width: this.scene.width, height: this.scene.height },\n series: { rect: seriesRect, paddedRect: seriesPaddedRect, hoverRect: hoverRect, visible: visibility.series },\n axes: this.axes.map(function (axis) { return (__assign$C({ id: axis.id }, axis.getLayoutState())); }),\n });\n if (clipSeries) {\n seriesRoot.setClipRectInGroupCoordinateSpace(seriesRect);\n }\n else {\n seriesRoot.setClipRectInGroupCoordinateSpace();\n }\n return [2 /*return*/, shrinkRect];\n }\n });\n });\n };\n CartesianChart.prototype.updateAxes = function (inputShrinkRect) {\n var e_1, _a;\n var _b;\n // Start with a good approximation from the last update - this should mean that in many resize\n // cases that only a single pass is needed \\o/.\n var axisWidths = __assign$C({}, this._lastAxisWidths);\n var visibility = __assign$C({}, this._lastVisibility);\n // Clean any positions which aren't valid with the current axis status (otherwise we end up\n // never being able to find a stable result).\n var liveAxisWidths = new Set(this._axes.map(function (a) { return a.position; }));\n try {\n for (var _c = __values$j(Object.keys(axisWidths)), _d = _c.next(); !_d.done; _d = _c.next()) {\n var position = _d.value;\n if (!liveAxisWidths.has(position)) {\n delete axisWidths[position];\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_d && !_d.done && (_a = _c.return)) _a.call(_c);\n }\n finally { if (e_1) throw e_1.error; }\n }\n var stableOutputs = function (otherAxisWidths, otherVisibility) {\n // Check for new axis positions.\n if (Object.keys(otherAxisWidths).some(function (k) { return axisWidths[k] == null; })) {\n return false;\n }\n return (visibility.crossLines === otherVisibility.crossLines &&\n visibility.series === otherVisibility.series &&\n // Check for existing axis positions and equality.\n Object.entries(axisWidths).every(function (_a) {\n var _b = __read$E(_a, 2), p = _b[0], w = _b[1];\n var otherW = otherAxisWidths[p];\n if (w != null || otherW != null) {\n return w === otherW;\n }\n return true;\n }));\n };\n var ceilValues = function (records) {\n return Object.entries(records).reduce(function (out, _a) {\n var _b = __read$E(_a, 2), key = _b[0], value = _b[1];\n if (value && Math.abs(value) === Infinity) {\n value = 0;\n }\n out[key] = value != null ? Math.ceil(value) : value;\n return out;\n }, {});\n };\n // Iteratively try to resolve axis widths - since X axis width affects Y axis range,\n // and vice-versa, we need to iteratively try and find a fit for the axes and their\n // ticks/labels.\n var lastPassAxisWidths = {};\n var lastPassVisibility = {};\n var clipSeries = false;\n var seriesRect = (_b = this.seriesRect) === null || _b === void 0 ? void 0 : _b.clone();\n var count = 0;\n do {\n Object.assign(axisWidths, lastPassAxisWidths);\n Object.assign(visibility, lastPassVisibility);\n var result = this.updateAxesPass(axisWidths, inputShrinkRect.clone(), seriesRect);\n lastPassAxisWidths = ceilValues(result.axisWidths);\n lastPassVisibility = result.visibility;\n clipSeries = result.clipSeries;\n seriesRect = result.seriesRect;\n if (count++ > 10) {\n Logger.warn('unable to find stable axis layout.');\n break;\n }\n } while (!stableOutputs(lastPassAxisWidths, lastPassVisibility));\n var clipRectPadding = 5;\n this.axes.forEach(function (axis) {\n // update visibility of crosslines\n axis.setCrossLinesVisible(visibility.crossLines);\n if (!seriesRect) {\n return;\n }\n axis.clipGrid(seriesRect.x, seriesRect.y, seriesRect.width + clipRectPadding, seriesRect.height + clipRectPadding);\n switch (axis.position) {\n case 'left':\n case 'right':\n axis.clipTickLines(inputShrinkRect.x, seriesRect.y, inputShrinkRect.width + clipRectPadding, seriesRect.height + clipRectPadding);\n break;\n case 'top':\n case 'bottom':\n axis.clipTickLines(seriesRect.x, inputShrinkRect.y, seriesRect.width + clipRectPadding, inputShrinkRect.height + clipRectPadding);\n break;\n }\n });\n this._lastAxisWidths = axisWidths;\n this._lastVisibility = visibility;\n return { seriesRect: seriesRect, visibility: visibility, clipSeries: clipSeries };\n };\n CartesianChart.prototype.updateAxesPass = function (axisWidths, bounds, lastPassSeriesRect) {\n var _this = this;\n var axes = this.axes;\n var visited = {};\n var newAxisWidths = {};\n var visibility = {\n series: true,\n crossLines: true,\n };\n var clipSeries = false;\n var primaryTickCounts = {};\n var paddedBounds = this.applySeriesPadding(bounds);\n var crossLinePadding = lastPassSeriesRect ? this.buildCrossLinePadding(axisWidths) : {};\n var axisBound = this.buildAxisBound(paddedBounds, axisWidths, crossLinePadding, visibility);\n var seriesRect = this.buildSeriesRect(axisBound, axisWidths);\n // Set the number of ticks for continuous axes based on the available range\n // before updating the axis domain via `this.updateAxes()` as the tick count has an effect on the calculated `nice` domain extent\n axes.forEach(function (axis) {\n var _a, _b;\n var _c = axis.position, position = _c === void 0 ? 'left' : _c;\n var _d = _this.calculateAxisDimensions({\n axis: axis,\n seriesRect: seriesRect,\n paddedBounds: paddedBounds,\n axisWidths: axisWidths,\n newAxisWidths: newAxisWidths,\n primaryTickCounts: primaryTickCounts,\n clipSeries: clipSeries,\n addInterAxisPadding: ((_a = visited[position]) !== null && _a !== void 0 ? _a : 0) > 0,\n }), newClipSeries = _d.clipSeries, axisThickness = _d.axisThickness, axisOffset = _d.axisOffset;\n visited[position] = ((_b = visited[position]) !== null && _b !== void 0 ? _b : 0) + 1;\n clipSeries = clipSeries || newClipSeries;\n _this.positionAxis({\n axis: axis,\n axisBound: axisBound,\n axisOffset: axisOffset,\n axisThickness: axisThickness,\n axisWidths: axisWidths,\n primaryTickCounts: primaryTickCounts,\n seriesRect: seriesRect,\n });\n });\n return { clipSeries: clipSeries, seriesRect: seriesRect, axisWidths: newAxisWidths, visibility: visibility };\n };\n CartesianChart.prototype.buildCrossLinePadding = function (axisWidths) {\n var e_2, _a;\n var _b;\n var crossLinePadding = {};\n this.axes.forEach(function (axis) {\n if (axis.crossLines) {\n axis.crossLines.forEach(function (crossLine) {\n crossLine.calculatePadding(crossLinePadding);\n });\n }\n });\n try {\n // Reduce cross-line padding to account for overlap with axes.\n for (var _c = __values$j(Object.entries(crossLinePadding)), _d = _c.next(); !_d.done; _d = _c.next()) {\n var _e = __read$E(_d.value, 2), side = _e[0], _f = _e[1], padding = _f === void 0 ? 0 : _f;\n crossLinePadding[side] = Math.max(padding - ((_b = axisWidths[side]) !== null && _b !== void 0 ? _b : 0), 0);\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (_d && !_d.done && (_a = _c.return)) _a.call(_c);\n }\n finally { if (e_2) throw e_2.error; }\n }\n return crossLinePadding;\n };\n CartesianChart.prototype.applySeriesPadding = function (bounds) {\n var _this = this;\n var paddedRect = bounds.clone();\n var reversedAxes = this.axes.slice().reverse();\n directions.forEach(function (dir) {\n var padding = _this.seriesAreaPadding[dir];\n var axis = reversedAxes.find(function (axis) { return axis.position === dir; });\n if (axis) {\n axis.seriesAreaPadding = padding;\n }\n else {\n paddedRect.shrink(padding, dir);\n }\n });\n return paddedRect;\n };\n CartesianChart.prototype.buildAxisBound = function (bounds, axisWidths, crossLinePadding, visibility) {\n var _a, _b, _c, _d;\n var result = bounds.clone();\n var _e = crossLinePadding.top, top = _e === void 0 ? 0 : _e, _f = crossLinePadding.right, right = _f === void 0 ? 0 : _f, _g = crossLinePadding.bottom, bottom = _g === void 0 ? 0 : _g, _h = crossLinePadding.left, left = _h === void 0 ? 0 : _h;\n var horizontalPadding = left + right;\n var verticalPadding = top + bottom;\n var totalWidth = ((_a = axisWidths.left) !== null && _a !== void 0 ? _a : 0) + ((_b = axisWidths.right) !== null && _b !== void 0 ? _b : 0) + horizontalPadding;\n var totalHeight = ((_c = axisWidths.top) !== null && _c !== void 0 ? _c : 0) + ((_d = axisWidths.bottom) !== null && _d !== void 0 ? _d : 0) + verticalPadding;\n if (result.width <= totalWidth || result.height <= totalHeight) {\n // Not enough space for crossLines and series\n visibility.crossLines = false;\n visibility.series = false;\n return result;\n }\n result.x += left;\n result.y += top;\n result.width -= horizontalPadding;\n result.height -= verticalPadding;\n return result;\n };\n CartesianChart.prototype.buildSeriesRect = function (axisBound, axisWidths) {\n var result = axisBound.clone();\n var top = axisWidths.top, bottom = axisWidths.bottom, left = axisWidths.left, right = axisWidths.right;\n result.x += left !== null && left !== void 0 ? left : 0;\n result.y += top !== null && top !== void 0 ? top : 0;\n result.width -= (left !== null && left !== void 0 ? left : 0) + (right !== null && right !== void 0 ? right : 0);\n result.height -= (top !== null && top !== void 0 ? top : 0) + (bottom !== null && bottom !== void 0 ? bottom : 0);\n // Width and height should not be negative.\n result.width = Math.max(0, result.width);\n result.height = Math.max(0, result.height);\n return result;\n };\n CartesianChart.prototype.clampToOutsideSeriesRect = function (seriesRect, value, dimension, direction) {\n var x = seriesRect.x, y = seriesRect.y, width = seriesRect.width, height = seriesRect.height;\n var clampBounds = [x, y, x + width, y + height];\n var fn = direction === 1 ? Math.min : Math.max;\n var compareTo = clampBounds[(dimension === 'x' ? 0 : 1) + (direction === 1 ? 0 : 2)];\n return fn(value, compareTo);\n };\n CartesianChart.prototype.calculateAxisDimensions = function (opts) {\n var _a, _b, _c, _d, _e;\n var axis = opts.axis, seriesRect = opts.seriesRect, paddedBounds = opts.paddedBounds, axisWidths = opts.axisWidths, newAxisWidths = opts.newAxisWidths, primaryTickCounts = opts.primaryTickCounts, addInterAxisPadding = opts.addInterAxisPadding;\n var clipSeries = opts.clipSeries;\n var _f = axis.position, position = _f === void 0 ? 'left' : _f, direction = axis.direction;\n var axisLeftRightRange = function (axis) {\n if (axis instanceof CategoryAxis || axis instanceof GroupedCategoryAxis) {\n return [0, seriesRect.height];\n }\n return [seriesRect.height, 0];\n };\n var axisOffset = (_a = newAxisWidths[position]) !== null && _a !== void 0 ? _a : 0;\n switch (position) {\n case 'top':\n case 'bottom':\n axis.range = [0, seriesRect.width];\n axis.gridLength = seriesRect.height;\n break;\n case 'right':\n case 'left':\n axis.range = axisLeftRightRange(axis);\n axis.gridLength = seriesRect.width;\n break;\n }\n var zoom = this.zoomManager.getAxisZoom(axis.id);\n var _g = zoom !== null && zoom !== void 0 ? zoom : {}, _h = _g.min, min = _h === void 0 ? 0 : _h, _j = _g.max, max = _j === void 0 ? 1 : _j;\n axis.visibleRange = [min, max];\n if (!clipSeries && (axis.visibleRange[0] > 0 || axis.visibleRange[1] < 1)) {\n clipSeries = true;\n }\n var primaryTickCount = axis.nice ? primaryTickCounts[direction] : undefined;\n var paddedBoundsCoefficient = 0.3;\n if (axis.thickness != null && axis.thickness > 0) {\n axis.maxThickness = axis.thickness;\n }\n else if (direction === ChartAxisDirection.Y) {\n axis.maxThickness = paddedBounds.width * paddedBoundsCoefficient;\n }\n else {\n axis.maxThickness = paddedBounds.height * paddedBoundsCoefficient;\n }\n primaryTickCount = axis.update(primaryTickCount);\n primaryTickCounts[direction] = (_b = primaryTickCounts[direction]) !== null && _b !== void 0 ? _b : primaryTickCount;\n var axisThickness = 0;\n if (axis.thickness != null && axis.thickness > 0) {\n axisThickness = axis.thickness;\n }\n else {\n var bbox = axis.computeBBox();\n axisThickness = direction === ChartAxisDirection.X ? bbox.height : bbox.width;\n }\n // for multiple axes in the same direction and position, apply padding at the top of each inner axis (i.e. between axes).\n var axisPadding = 15;\n if (addInterAxisPadding) {\n axisThickness += axisPadding;\n }\n axisThickness = Math.ceil(axisThickness);\n newAxisWidths[position] = ((_c = newAxisWidths[position]) !== null && _c !== void 0 ? _c : 0) + axisThickness;\n axis.gridPadding = ((_d = axisWidths[position]) !== null && _d !== void 0 ? _d : 0) - ((_e = newAxisWidths[position]) !== null && _e !== void 0 ? _e : 0);\n return { clipSeries: clipSeries, axisThickness: axisThickness, axisOffset: axisOffset };\n };\n CartesianChart.prototype.positionAxis = function (opts) {\n var _a, _b, _c, _d;\n var axis = opts.axis, axisBound = opts.axisBound, axisWidths = opts.axisWidths, seriesRect = opts.seriesRect, axisOffset = opts.axisOffset, axisThickness = opts.axisThickness;\n var position = axis.position;\n switch (position) {\n case 'top':\n axis.translation.x = axisBound.x + ((_a = axisWidths.left) !== null && _a !== void 0 ? _a : 0);\n axis.translation.y = this.clampToOutsideSeriesRect(seriesRect, axisBound.y + 1 + axisOffset + axisThickness, 'y', 1);\n break;\n case 'bottom':\n axis.translation.x = axisBound.x + ((_b = axisWidths.left) !== null && _b !== void 0 ? _b : 0);\n axis.translation.y = this.clampToOutsideSeriesRect(seriesRect, axisBound.y + axisBound.height + 1 - axisThickness - axisOffset, 'y', -1);\n break;\n case 'left':\n axis.translation.y = axisBound.y + ((_c = axisWidths.top) !== null && _c !== void 0 ? _c : 0);\n axis.translation.x = this.clampToOutsideSeriesRect(seriesRect, axisBound.x + axisOffset + axisThickness, 'x', 1);\n break;\n case 'right':\n axis.translation.y = axisBound.y + ((_d = axisWidths.top) !== null && _d !== void 0 ? _d : 0);\n axis.translation.x = this.clampToOutsideSeriesRect(seriesRect, axisBound.x + axisBound.width - axisThickness - axisOffset, 'x', -1);\n break;\n }\n axis.updatePosition({ rotation: toRadians$1(axis.rotation), sideFlag: axis.label.getSideFlag() });\n };\n CartesianChart.className = 'CartesianChart';\n CartesianChart.type = 'cartesian';\n return CartesianChart;\n}(Chart));\n\nvar __extends$2c = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar PolarAxis = /** @class */ (function (_super) {\n __extends$2c(PolarAxis, _super);\n function PolarAxis() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.shape = 'polygon';\n return _this;\n }\n PolarAxis.prototype.computeLabelsBBox = function (_options, _seriesRect) {\n return null;\n };\n return PolarAxis;\n}(Axis));\n\nvar __extends$2b = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __awaiter$9 = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator$9 = (undefined && undefined.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nvar __read$D = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray$k = (undefined && undefined.__spreadArray) || function (to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\n to[j] = from[i];\n return to;\n};\nvar __values$i = (undefined && undefined.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nvar PolarChart = /** @class */ (function (_super) {\n __extends$2b(PolarChart, _super);\n function PolarChart(document, overrideDevicePixelRatio, resources) {\n if (document === void 0) { document = window.document; }\n var _this = _super.call(this, document, overrideDevicePixelRatio, resources) || this;\n _this.padding = new Padding$1(40);\n return _this;\n }\n PolarChart.prototype.performLayout = function () {\n return __awaiter$9(this, void 0, void 0, function () {\n var shrinkRect, fullSeriesRect, hoverRectPadding, hoverRect;\n return __generator$9(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, _super.prototype.performLayout.call(this)];\n case 1:\n shrinkRect = _a.sent();\n fullSeriesRect = shrinkRect.clone();\n this.computeSeriesRect(shrinkRect);\n this.computeCircle(shrinkRect);\n this.axes.forEach(function (axis) { return axis.update(); });\n hoverRectPadding = 20;\n hoverRect = shrinkRect.clone().grow(hoverRectPadding);\n this.hoverRect = hoverRect;\n this.layoutService.dispatchLayoutComplete({\n type: 'layout-complete',\n chart: { width: this.scene.width, height: this.scene.height },\n series: { rect: fullSeriesRect, paddedRect: shrinkRect, hoverRect: hoverRect, visible: true },\n axes: [],\n });\n return [2 /*return*/, shrinkRect];\n }\n });\n });\n };\n PolarChart.prototype.updateAxes = function (cx, cy, radius) {\n var _a;\n this.axes.forEach(function (axis) {\n var _a;\n if (axis.direction === ChartAxisDirection.X) {\n var rotation = toRadians$1((_a = axis.rotation) !== null && _a !== void 0 ? _a : 0);\n axis.range = [-Math.PI / 2 + rotation, (3 * Math.PI) / 2 + rotation];\n axis.gridLength = radius;\n axis.translation.x = cx;\n axis.translation.y = cy;\n }\n else if (axis.direction === ChartAxisDirection.Y) {\n axis.range = [radius, 0];\n axis.translation.x = cx;\n axis.translation.y = cy - radius;\n }\n axis.updateScale();\n });\n var angleAxis = this.axes.find(function (axis) { return axis.direction === ChartAxisDirection.X; });\n var scale = angleAxis === null || angleAxis === void 0 ? void 0 : angleAxis.scale;\n var angles = (_a = scale === null || scale === void 0 ? void 0 : scale.ticks) === null || _a === void 0 ? void 0 : _a.call(scale).map(function (value) { return scale.convert(value); });\n this.axes\n .filter(function (axis) { return axis instanceof PolarAxis; })\n .forEach(function (axis) { return (axis.gridAngles = angles); });\n };\n PolarChart.prototype.computeSeriesRect = function (shrinkRect) {\n var seriesAreaPadding = this.seriesAreaPadding;\n shrinkRect.shrink(seriesAreaPadding.left, 'left');\n shrinkRect.shrink(seriesAreaPadding.top, 'top');\n shrinkRect.shrink(seriesAreaPadding.right, 'right');\n shrinkRect.shrink(seriesAreaPadding.bottom, 'bottom');\n this.seriesRect = shrinkRect;\n };\n PolarChart.prototype.computeCircle = function (seriesBox) {\n var _this = this;\n var polarSeries = this.series.filter(function (series) {\n return series instanceof PolarSeries;\n });\n var polarAxes = this.axes.filter(function (axis) {\n return axis instanceof PolarAxis;\n });\n var setSeriesCircle = function (cx, cy, r) {\n _this.updateAxes(cx, cy, r);\n polarSeries.forEach(function (series) {\n series.centerX = cx;\n series.centerY = cy;\n series.radius = r;\n });\n var pieSeries = polarSeries.filter(function (series) { return series instanceof PieSeries; });\n if (pieSeries.length > 1) {\n var innerRadii = pieSeries\n .map(function (series) {\n var innerRadius = series.getInnerRadius();\n return { series: series, innerRadius: innerRadius };\n })\n .sort(function (a, b) { return a.innerRadius - b.innerRadius; });\n innerRadii[innerRadii.length - 1].series.surroundingRadius = undefined;\n for (var i = 0; i < innerRadii.length - 1; i++) {\n innerRadii[i].series.surroundingRadius = innerRadii[i + 1].innerRadius;\n }\n }\n };\n var centerX = seriesBox.x + seriesBox.width / 2;\n var centerY = seriesBox.y + seriesBox.height / 2;\n var initialRadius = Math.max(0, Math.min(seriesBox.width, seriesBox.height) / 2);\n var radius = initialRadius;\n setSeriesCircle(centerX, centerY, radius);\n var shake = function (_a) {\n var e_1, _b;\n var _c = _a === void 0 ? {} : _a, _d = _c.hideWhenNecessary, hideWhenNecessary = _d === void 0 ? false : _d;\n var labelBoxes = [];\n try {\n for (var _e = __values$i(__spreadArray$k(__spreadArray$k([], __read$D(polarAxes)), __read$D(polarSeries))), _f = _e.next(); !_f.done; _f = _e.next()) {\n var series = _f.value;\n var box = series.computeLabelsBBox({ hideWhenNecessary: hideWhenNecessary }, seriesBox);\n if (box) {\n labelBoxes.push(box);\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_f && !_f.done && (_b = _e.return)) _b.call(_e);\n }\n finally { if (e_1) throw e_1.error; }\n }\n if (labelBoxes.length === 0) {\n setSeriesCircle(centerX, centerY, initialRadius);\n return;\n }\n var labelBox = BBox.merge(labelBoxes);\n var refined = _this.refineCircle(labelBox, radius, seriesBox);\n setSeriesCircle(refined.centerX, refined.centerY, refined.radius);\n if (refined.radius === radius) {\n return;\n }\n radius = refined.radius;\n };\n shake(); // Initial attempt\n shake(); // Precise attempt\n shake(); // Just in case\n shake({ hideWhenNecessary: true }); // Hide unnecessary labels\n shake({ hideWhenNecessary: true }); // Final result\n return { radius: radius, centerX: centerX, centerY: centerY };\n };\n PolarChart.prototype.refineCircle = function (labelsBox, radius, seriesBox) {\n var minCircleRatio = 0.5; // Prevents reduced circle to be too small\n var circleLeft = -radius;\n var circleTop = -radius;\n var circleRight = radius;\n var circleBottom = radius;\n // Label padding around the circle\n var padLeft = Math.max(0, circleLeft - labelsBox.x);\n var padTop = Math.max(0, circleTop - labelsBox.y);\n var padRight = Math.max(0, labelsBox.x + labelsBox.width - circleRight);\n var padBottom = Math.max(0, labelsBox.y + labelsBox.height - circleBottom);\n // Available area for the circle (after the padding will be applied)\n var availCircleWidth = seriesBox.width - padLeft - padRight;\n var availCircleHeight = seriesBox.height - padTop - padBottom;\n var newRadius = Math.min(availCircleWidth, availCircleHeight) / 2;\n var minHorizontalRadius = (minCircleRatio * seriesBox.width) / 2;\n var minVerticalRadius = (minCircleRatio * seriesBox.height) / 2;\n var minRadius = Math.min(minHorizontalRadius, minVerticalRadius);\n if (newRadius < minRadius) {\n // If the radius is too small, reduce the label padding\n newRadius = minRadius;\n var horizontalPadding = padLeft + padRight;\n var verticalPadding = padTop + padBottom;\n if (2 * newRadius + verticalPadding > seriesBox.height) {\n var padHeight = seriesBox.height - 2 * newRadius;\n if (Math.min(padTop, padBottom) * 2 > padHeight) {\n padTop = padHeight / 2;\n padBottom = padHeight / 2;\n }\n else if (padTop > padBottom) {\n padTop = padHeight - padBottom;\n }\n else {\n padBottom = padHeight - padTop;\n }\n }\n if (2 * newRadius + horizontalPadding > seriesBox.width) {\n var padWidth = seriesBox.width - 2 * newRadius;\n if (Math.min(padLeft, padRight) * 2 > padWidth) {\n padLeft = padWidth / 2;\n padRight = padWidth / 2;\n }\n else if (padLeft > padRight) {\n padLeft = padWidth - padRight;\n }\n else {\n padRight = padWidth - padLeft;\n }\n }\n }\n var newWidth = padLeft + 2 * newRadius + padRight;\n var newHeight = padTop + 2 * newRadius + padBottom;\n return {\n centerX: seriesBox.x + (seriesBox.width - newWidth) / 2 + padLeft + newRadius,\n centerY: seriesBox.y + (seriesBox.height - newHeight) / 2 + padTop + newRadius,\n radius: newRadius,\n };\n };\n PolarChart.className = 'PolarChart';\n PolarChart.type = 'polar';\n return PolarChart;\n}(Chart));\n\nvar __extends$2a = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __awaiter$8 = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator$8 = (undefined && undefined.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nvar HierarchyChart = /** @class */ (function (_super) {\n __extends$2a(HierarchyChart, _super);\n function HierarchyChart(document, overrideDevicePixelRatio, resources) {\n if (document === void 0) { document = window.document; }\n var _this = _super.call(this, document, overrideDevicePixelRatio, resources) || this;\n _this._data = {};\n return _this;\n }\n HierarchyChart.prototype.performLayout = function () {\n return __awaiter$8(this, void 0, void 0, function () {\n var shrinkRect, seriesAreaPadding, fullSeriesRect, hoverRectPadding, hoverRect, seriesRoot;\n var _this = this;\n return __generator$8(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, _super.prototype.performLayout.call(this)];\n case 1:\n shrinkRect = _a.sent();\n seriesAreaPadding = this.seriesAreaPadding;\n fullSeriesRect = shrinkRect.clone();\n shrinkRect.shrink(seriesAreaPadding.left, 'left');\n shrinkRect.shrink(seriesAreaPadding.top, 'top');\n shrinkRect.shrink(seriesAreaPadding.right, 'right');\n shrinkRect.shrink(seriesAreaPadding.bottom, 'bottom');\n this.seriesRect = shrinkRect;\n hoverRectPadding = 20;\n hoverRect = shrinkRect.clone().grow(hoverRectPadding);\n this.hoverRect = hoverRect;\n this.seriesRoot.translationX = Math.floor(shrinkRect.x);\n this.seriesRoot.translationY = Math.floor(shrinkRect.y);\n return [4 /*yield*/, Promise.all(this.series.map(function (series) { return __awaiter$8(_this, void 0, void 0, function () {\n return __generator$8(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, series.update({ seriesRect: shrinkRect })];\n case 1:\n _a.sent(); // this has to happen after the `updateAxes` call\n return [2 /*return*/];\n }\n });\n }); }))];\n case 2:\n _a.sent();\n seriesRoot = this.seriesRoot;\n seriesRoot.setClipRectInGroupCoordinateSpace(new BBox(shrinkRect.x, shrinkRect.y, shrinkRect.width, shrinkRect.height));\n this.layoutService.dispatchLayoutComplete({\n type: 'layout-complete',\n chart: { width: this.scene.width, height: this.scene.height },\n series: { rect: fullSeriesRect, paddedRect: shrinkRect, hoverRect: hoverRect, visible: true },\n axes: [],\n });\n return [2 /*return*/, shrinkRect];\n }\n });\n });\n };\n HierarchyChart.className = 'HierarchyChart';\n HierarchyChart.type = 'hierarchy';\n return HierarchyChart;\n}(Chart));\n\nfunction calculateNiceSecondaryAxis(domain, primaryTickCount) {\n // Make secondary axis domain nice using strict tick count, matching the tick count from the primary axis.\n // This is to make the secondary axis grid lines/ tick positions align with the ones from the primary axis.\n var start = Math.floor(domain[0]);\n var stop = domain[1];\n start = calculateNiceStart(start, stop, primaryTickCount);\n var step = getTickStep(start, stop, primaryTickCount);\n var segments = primaryTickCount - 1;\n stop = start + segments * step;\n var d = [start, stop];\n var ticks = getTicks(start, step, primaryTickCount);\n return [d, ticks];\n}\nfunction calculateNiceStart(a, b, count) {\n var rawStep = Math.abs(b - a) / (count - 1);\n var order = Math.floor(Math.log10(rawStep));\n var magnitude = Math.pow(10, order);\n return Math.floor(a / magnitude) * magnitude;\n}\nfunction getTicks(start, step, count) {\n // power of the step will be negative if the step is a fraction (between 0 and 1)\n var stepPower = Math.floor(Math.log10(step));\n var fractionDigits = step > 0 && step < 1 ? Math.abs(stepPower) : 0;\n var f = Math.pow(10, fractionDigits);\n var ticks = new NumericTicks(fractionDigits);\n for (var i = 0; i < count; i++) {\n var tick = start + step * i;\n ticks[i] = Math.round(tick * f) / f;\n }\n return ticks;\n}\nfunction getTickStep(start, stop, count) {\n var segments = count - 1;\n var rawStep = (stop - start) / segments;\n return calculateNextNiceStep(rawStep);\n}\nfunction calculateNextNiceStep(rawStep) {\n var order = Math.floor(Math.log10(rawStep));\n var magnitude = Math.pow(10, order);\n // Make order 1\n var step = (rawStep / magnitude) * 10;\n if (step > 0 && step <= 1) {\n return magnitude / 10;\n }\n if (step > 1 && step <= 2) {\n return (2 * magnitude) / 10;\n }\n if (step > 1 && step <= 5) {\n return (5 * magnitude) / 10;\n }\n if (step > 5 && step <= 10) {\n return (10 * magnitude) / 10;\n }\n if (step > 10 && step <= 20) {\n return (20 * magnitude) / 10;\n }\n if (step > 20 && step <= 40) {\n return (40 * magnitude) / 10;\n }\n if (step > 40 && step <= 50) {\n return (50 * magnitude) / 10;\n }\n if (step > 50 && step <= 100) {\n return (100 * magnitude) / 10;\n }\n return step;\n}\n\nvar __extends$29 = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$1v = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __read$C = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar NumberAxisTick = /** @class */ (function (_super) {\n __extends$29(NumberAxisTick, _super);\n function NumberAxisTick() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.maxSpacing = NaN;\n return _this;\n }\n __decorate$1v([\n Validate(AND(NUMBER_OR_NAN(1), GREATER_THAN('minSpacing'))),\n Default(NaN)\n ], NumberAxisTick.prototype, \"maxSpacing\", void 0);\n return NumberAxisTick;\n}(AxisTick));\nvar NumberAxis = /** @class */ (function (_super) {\n __extends$29(NumberAxis, _super);\n function NumberAxis(moduleCtx, scale) {\n if (scale === void 0) { scale = new LinearScale$1(); }\n var _this = _super.call(this, moduleCtx, scale) || this;\n _this.min = NaN;\n _this.max = NaN;\n scale.strictClampByDefault = true;\n return _this;\n }\n NumberAxis.prototype.normaliseDataDomain = function (d) {\n var _a = this, min = _a.min, max = _a.max;\n return normalisedExtent(d, min, max);\n };\n NumberAxis.prototype.formatDatum = function (datum) {\n if (typeof datum === 'number') {\n return datum.toFixed(2);\n }\n else {\n Logger.warnOnce('data contains Date objects which are being plotted against a number axis, please only use a number axis for numbers.');\n return String(datum);\n }\n };\n NumberAxis.prototype.createTick = function () {\n return new NumberAxisTick();\n };\n NumberAxis.prototype.updateSecondaryAxisTicks = function (primaryTickCount) {\n if (this.dataDomain == null) {\n throw new Error('AG Charts - dataDomain not calculated, cannot perform tick calculation.');\n }\n var _a = __read$C(calculateNiceSecondaryAxis(this.dataDomain, primaryTickCount !== null && primaryTickCount !== void 0 ? primaryTickCount : 0), 2), d = _a[0], ticks = _a[1];\n this.scale.nice = false;\n this.scale.domain = d;\n this.scale.update();\n return ticks;\n };\n NumberAxis.className = 'NumberAxis';\n NumberAxis.type = 'number';\n __decorate$1v([\n Validate(AND(NUMBER_OR_NAN(), LESS_THAN('max'))),\n Default(NaN)\n ], NumberAxis.prototype, \"min\", void 0);\n __decorate$1v([\n Validate(AND(NUMBER_OR_NAN(), GREATER_THAN('min'))),\n Default(NaN)\n ], NumberAxis.prototype, \"max\", void 0);\n return NumberAxis;\n}(CartesianAxis));\n\nvar __extends$28 = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$1u = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nfunction NON_ZERO_NUMBER() {\n // Cannot be 0\n var message = \"expecting a non-zero Number\";\n return predicateWithMessage(function (v) { return typeof v === 'number' && v !== 0; }, message);\n}\nvar LogAxis = /** @class */ (function (_super) {\n __extends$28(LogAxis, _super);\n function LogAxis(moduleCtx) {\n var _this = _super.call(this, moduleCtx, new LogScale()) || this;\n _this.min = NaN;\n _this.max = NaN;\n _this.scale.strictClampByDefault = true;\n return _this;\n }\n LogAxis.prototype.normaliseDataDomain = function (d) {\n var _a;\n var _b = this, min = _b.min, max = _b.max;\n if (d.length > 2) {\n d = (_a = extent$4(d)) !== null && _a !== void 0 ? _a : [NaN, NaN];\n }\n if (!isNaN(min)) {\n d = [min, d[1]];\n }\n if (!isNaN(max)) {\n d = [d[0], max];\n }\n var isInverted = d[0] > d[1];\n var crossesZero = d[0] < 0 && d[1] > 0;\n var hasZeroExtent = d[0] === 0 && d[1] === 0;\n var invalidDomain = isInverted || crossesZero || hasZeroExtent;\n if (invalidDomain) {\n d = [];\n if (crossesZero) {\n Logger.warn(\"the data domain crosses zero, the chart data cannot be rendered. See log axis documentation for more information.\");\n }\n else if (hasZeroExtent) {\n Logger.warn(\"the data domain has 0 extent, no data is rendered.\");\n }\n }\n if (d[0] === 0) {\n d[0] = 1;\n }\n if (d[1] === 0) {\n d[1] = -1;\n }\n return d;\n };\n Object.defineProperty(LogAxis.prototype, \"base\", {\n get: function () {\n return this.scale.base;\n },\n set: function (value) {\n this.scale.base = value;\n },\n enumerable: false,\n configurable: true\n });\n LogAxis.className = 'LogAxis';\n LogAxis.type = 'log';\n __decorate$1u([\n Validate(AND(NUMBER_OR_NAN(), LESS_THAN('max'), NON_ZERO_NUMBER())),\n Default(NaN)\n ], LogAxis.prototype, \"min\", void 0);\n __decorate$1u([\n Validate(AND(NUMBER_OR_NAN(), GREATER_THAN('min'), NON_ZERO_NUMBER())),\n Default(NaN)\n ], LogAxis.prototype, \"max\", void 0);\n return LogAxis;\n}(NumberAxis));\n\nvar __extends$27 = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$1t = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar TimeAxisTick = /** @class */ (function (_super) {\n __extends$27(TimeAxisTick, _super);\n function TimeAxisTick() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.maxSpacing = NaN;\n return _this;\n }\n __decorate$1t([\n Validate(AND(NUMBER_OR_NAN(1), GREATER_THAN('minSpacing'))),\n Default(NaN)\n ], TimeAxisTick.prototype, \"maxSpacing\", void 0);\n return TimeAxisTick;\n}(AxisTick));\nvar TimeAxis = /** @class */ (function (_super) {\n __extends$27(TimeAxis, _super);\n function TimeAxis(moduleCtx) {\n var _this = _super.call(this, moduleCtx, new TimeScale$1()) || this;\n _this.datumFormat = '%m/%d/%y, %H:%M:%S';\n _this.min = undefined;\n _this.max = undefined;\n var scale = _this.scale;\n scale.strictClampByDefault = true;\n _this.refreshScale();\n _this.datumFormatter = scale.tickFormat({\n specifier: _this.datumFormat,\n });\n return _this;\n }\n TimeAxis.prototype.normaliseDataDomain = function (d) {\n var _a;\n var _b = this, min = _b.min, max = _b.max;\n if (typeof min === 'number') {\n min = new Date(min);\n }\n if (typeof max === 'number') {\n max = new Date(max);\n }\n if (d.length > 2) {\n d = ((_a = extent$4(d)) !== null && _a !== void 0 ? _a : [0, 1000]).map(function (x) { return new Date(x); });\n }\n if (min instanceof Date) {\n d = [min, d[1]];\n }\n if (max instanceof Date) {\n d = [d[0], max];\n }\n if (d[0] > d[1]) {\n d = [];\n }\n return d;\n };\n TimeAxis.prototype.createTick = function () {\n return new TimeAxisTick();\n };\n TimeAxis.prototype.onLabelFormatChange = function (ticks, format) {\n if (format) {\n _super.prototype.onLabelFormatChange.call(this, ticks, format);\n }\n else {\n // For time axis labels to look nice, even if date format wasn't set.\n this.labelFormatter = this.scale.tickFormat({ ticks: ticks });\n }\n };\n TimeAxis.prototype.formatDatum = function (datum) {\n var _a;\n return (_a = this.moduleCtx.callbackCache.call(this.datumFormatter, datum)) !== null && _a !== void 0 ? _a : String(datum);\n };\n TimeAxis.prototype.calculatePadding = function (_min, _max) {\n // numbers in domain correspond to Unix timestamps\n // automatically expand domain by 1 in forward direction\n return [0, 1];\n };\n TimeAxis.className = 'TimeAxis';\n TimeAxis.type = 'time';\n __decorate$1t([\n Validate(AND(OPT_DATE_OR_DATETIME_MS, LESS_THAN('max')))\n ], TimeAxis.prototype, \"min\", void 0);\n __decorate$1t([\n Validate(AND(OPT_DATE_OR_DATETIME_MS, GREATER_THAN('min')))\n ], TimeAxis.prototype, \"max\", void 0);\n return TimeAxis;\n}(CartesianAxis));\n\nvar _a$1;\nvar AXIS_CONSTRUCTORS = (_a$1 = {},\n _a$1[NumberAxis.type] = NumberAxis,\n _a$1[CategoryAxis.type] = CategoryAxis,\n _a$1[TimeAxis.type] = TimeAxis,\n _a$1[GroupedCategoryAxis.type] = GroupedCategoryAxis,\n _a$1[LogAxis.type] = LogAxis,\n _a$1);\nfunction registerAxis(axisType, ctor) {\n AXIS_CONSTRUCTORS[axisType] = ctor;\n}\nfunction getAxis(axisType, moduleCtx) {\n var axisConstructor = AXIS_CONSTRUCTORS[axisType];\n if (axisConstructor) {\n return new axisConstructor(moduleCtx);\n }\n throw new Error(\"AG Charts - unknown axis type: \" + axisType);\n}\nvar AXIS_TYPES = {\n has: function (axisType) {\n return Object.prototype.hasOwnProperty.call(AXIS_CONSTRUCTORS, axisType);\n },\n get axesTypes() {\n return Object.keys(AXIS_CONSTRUCTORS);\n },\n};\nvar AXIS_THEME_TEMPLATES = {};\nfunction registerAxisThemeTemplate(axisType, theme) {\n AXIS_THEME_TEMPLATES[axisType] = theme;\n}\nfunction getAxisThemeTemplate(axisType) {\n var _a;\n return (_a = AXIS_THEME_TEMPLATES[axisType]) !== null && _a !== void 0 ? _a : {};\n}\n\nvar __extends$26 = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$1s = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar MARKER_SHAPES = ['circle', 'cross', 'diamond', 'heart', 'plus', 'square', 'triangle'];\nvar MARKER_SHAPE = predicateWithMessage(function (v) { return MARKER_SHAPES.includes(v) || Object.getPrototypeOf(v) === Marker; }, \"expecting a marker shape keyword such as 'circle', 'diamond' or 'square' or an object extending the Marker class\");\nvar SeriesMarker = /** @class */ (function (_super) {\n __extends$26(SeriesMarker, _super);\n function SeriesMarker() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.enabled = true;\n /**\n * One of the predefined marker names, or a marker constructor function (for user-defined markers).\n * A series will create one marker instance per data point.\n */\n _this.shape = Circle;\n _this.size = 6;\n /**\n * In case a series has the `sizeKey` set, the `sizeKey` values along with the `size` and `maxSize` configs\n * will be used to determine the size of the marker. All values will be mapped to a marker size\n * within the `[size, maxSize]` range, where the largest values will correspond to the `maxSize`\n * and the lowest to the `size`.\n */\n _this.maxSize = 30;\n _this.domain = undefined;\n _this.fill = undefined;\n _this.stroke = undefined;\n _this.strokeWidth = 1;\n _this.fillOpacity = undefined;\n _this.strokeOpacity = undefined;\n return _this;\n }\n __decorate$1s([\n Validate(BOOLEAN),\n SceneChangeDetection({ redraw: RedrawType.MAJOR })\n ], SeriesMarker.prototype, \"enabled\", void 0);\n __decorate$1s([\n Validate(MARKER_SHAPE),\n SceneChangeDetection({ redraw: RedrawType.MAJOR })\n ], SeriesMarker.prototype, \"shape\", void 0);\n __decorate$1s([\n Validate(NUMBER(0)),\n SceneChangeDetection({ redraw: RedrawType.MAJOR })\n ], SeriesMarker.prototype, \"size\", void 0);\n __decorate$1s([\n Validate(NUMBER(0)),\n SceneChangeDetection({ redraw: RedrawType.MAJOR })\n ], SeriesMarker.prototype, \"maxSize\", void 0);\n __decorate$1s([\n Validate(OPT_NUMBER_ARRAY),\n SceneChangeDetection({ redraw: RedrawType.MAJOR })\n ], SeriesMarker.prototype, \"domain\", void 0);\n __decorate$1s([\n Validate(OPT_COLOR_STRING),\n SceneChangeDetection({ redraw: RedrawType.MAJOR })\n ], SeriesMarker.prototype, \"fill\", void 0);\n __decorate$1s([\n Validate(OPT_COLOR_STRING),\n SceneChangeDetection({ redraw: RedrawType.MAJOR })\n ], SeriesMarker.prototype, \"stroke\", void 0);\n __decorate$1s([\n Validate(OPT_NUMBER(0)),\n SceneChangeDetection({ redraw: RedrawType.MAJOR })\n ], SeriesMarker.prototype, \"strokeWidth\", void 0);\n __decorate$1s([\n Validate(OPT_NUMBER(0, 1)),\n SceneChangeDetection({ redraw: RedrawType.MAJOR })\n ], SeriesMarker.prototype, \"fillOpacity\", void 0);\n __decorate$1s([\n Validate(OPT_NUMBER(0, 1)),\n SceneChangeDetection({ redraw: RedrawType.MAJOR })\n ], SeriesMarker.prototype, \"strokeOpacity\", void 0);\n return SeriesMarker;\n}(ChangeDetectable));\n\nvar __extends$25 = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign$B = (undefined && undefined.__assign) || function () {\n __assign$B = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$B.apply(this, arguments);\n};\nvar __decorate$1r = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __awaiter$7 = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator$7 = (undefined && undefined.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nvar __values$h = (undefined && undefined.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nvar __read$B = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar _a, _b;\nvar DEFAULT_DIRECTION_KEYS = (_a = {},\n _a[ChartAxisDirection.X] = ['xKey'],\n _a[ChartAxisDirection.Y] = ['yKey'],\n _a);\nvar DEFAULT_DIRECTION_NAMES = (_b = {},\n _b[ChartAxisDirection.X] = ['xName'],\n _b[ChartAxisDirection.Y] = ['yName'],\n _b);\nvar CartesianSeriesNodeBaseClickEvent = /** @class */ (function (_super) {\n __extends$25(CartesianSeriesNodeBaseClickEvent, _super);\n function CartesianSeriesNodeBaseClickEvent(xKey, yKey, nativeEvent, datum, series) {\n var _this = _super.call(this, nativeEvent, datum, series) || this;\n _this.xKey = xKey;\n _this.yKey = yKey;\n return _this;\n }\n return CartesianSeriesNodeBaseClickEvent;\n}(SeriesNodeBaseClickEvent));\nvar CartesianSeriesNodeClickEvent = /** @class */ (function (_super) {\n __extends$25(CartesianSeriesNodeClickEvent, _super);\n function CartesianSeriesNodeClickEvent() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = 'nodeClick';\n return _this;\n }\n return CartesianSeriesNodeClickEvent;\n}(CartesianSeriesNodeBaseClickEvent));\nvar CartesianSeriesNodeDoubleClickEvent = /** @class */ (function (_super) {\n __extends$25(CartesianSeriesNodeDoubleClickEvent, _super);\n function CartesianSeriesNodeDoubleClickEvent() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = 'nodeDoubleClick';\n return _this;\n }\n return CartesianSeriesNodeDoubleClickEvent;\n}(CartesianSeriesNodeBaseClickEvent));\nvar CartesianStateMachine = /** @class */ (function (_super) {\n __extends$25(CartesianStateMachine, _super);\n function CartesianStateMachine() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n return CartesianStateMachine;\n}(StateMachine));\nvar CartesianSeries = /** @class */ (function (_super) {\n __extends$25(CartesianSeries, _super);\n function CartesianSeries(opts) {\n var _this = _super.call(this, __assign$B(__assign$B({}, opts), { useSeriesGroupLayer: true, directionKeys: DEFAULT_DIRECTION_KEYS, directionNames: DEFAULT_DIRECTION_NAMES })) || this;\n _this.legendItemName = undefined;\n _this._contextNodeData = [];\n _this.nodeDataDependencies = {};\n _this.highlightSelection = Selection.select(_this.highlightNode, function () {\n return _this.opts.hasMarkers ? _this.markerFactory() : _this.nodeFactory();\n });\n _this.highlightLabelSelection = Selection.select(_this.highlightLabel, Text);\n _this.subGroups = [];\n _this.subGroupId = 0;\n _this.datumSelectionGarbageCollection = true;\n var _a = opts.pathsPerSeries, pathsPerSeries = _a === void 0 ? 1 : _a, _b = opts.hasMarkers, hasMarkers = _b === void 0 ? false : _b, _c = opts.hasHighlightedLabels, hasHighlightedLabels = _c === void 0 ? false : _c, _d = opts.pathsZIndexSubOrderOffset, pathsZIndexSubOrderOffset = _d === void 0 ? [] : _d;\n _this.opts = { pathsPerSeries: pathsPerSeries, hasMarkers: hasMarkers, hasHighlightedLabels: hasHighlightedLabels, pathsZIndexSubOrderOffset: pathsZIndexSubOrderOffset };\n _this.animationState = new CartesianStateMachine('empty', {\n empty: {\n on: {\n update: {\n target: 'ready',\n action: function (data) { return _this.animateEmptyUpdateReady(data); },\n },\n },\n },\n ready: {\n on: {\n updateData: {\n target: 'waiting',\n action: function () { },\n },\n update: {\n target: 'ready',\n action: function (data) { return _this.animateReadyUpdate(data); },\n },\n highlight: {\n target: 'ready',\n action: function (data) { return _this.animateReadyHighlight(data); },\n },\n highlightMarkers: {\n target: 'ready',\n action: function (data) { return _this.animateReadyHighlightMarkers(data); },\n },\n resize: {\n target: 'ready',\n action: function (data) { return _this.animateReadyResize(data); },\n },\n },\n },\n waiting: {\n on: {\n update: {\n target: 'ready',\n action: function (data) { return _this.animateWaitingUpdateReady(data); },\n },\n },\n },\n });\n return _this;\n }\n Object.defineProperty(CartesianSeries.prototype, \"contextNodeData\", {\n get: function () {\n var _a;\n return (_a = this._contextNodeData) === null || _a === void 0 ? void 0 : _a.slice();\n },\n enumerable: false,\n configurable: true\n });\n CartesianSeries.prototype.addChartEventListeners = function () {\n var _this = this;\n var _a, _b;\n (_a = this.ctx.chartEventManager) === null || _a === void 0 ? void 0 : _a.addListener('legend-item-click', function (event) { return _this.onLegendItemClick(event); });\n (_b = this.ctx.chartEventManager) === null || _b === void 0 ? void 0 : _b.addListener('legend-item-double-click', function (event) {\n return _this.onLegendItemDoubleClick(event);\n });\n };\n CartesianSeries.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n this._contextNodeData.splice(0, this._contextNodeData.length);\n this.subGroups.splice(0, this.subGroups.length);\n };\n /**\n * Note: we are passing `isContinuousX` and `isContinuousY` into this method because it will\n * typically be called inside a loop and this check only needs to happen once.\n * @param x A domain value to be plotted along the x-axis.\n * @param y A domain value to be plotted along the y-axis.\n * @param isContinuousX Typically this will be the value of `xAxis.scale instanceof ContinuousScale`.\n * @param isContinuousY Typically this will be the value of `yAxis.scale instanceof ContinuousScale`.\n * @returns `[x, y]`, if both x and y are valid domain values for their respective axes/scales, or `undefined`.\n */\n CartesianSeries.prototype.checkDomainXY = function (x, y, isContinuousX, isContinuousY) {\n var isValidDatum = ((isContinuousX && isContinuous(x)) || (!isContinuousX && isDiscrete(x))) &&\n ((isContinuousY && isContinuous(y)) || (!isContinuousY && isDiscrete(y)));\n return isValidDatum ? [x, y] : undefined;\n };\n /**\n * Note: we are passing the xAxis and yAxis because the calling code is supposed to make sure\n * that series has both of them defined, and also to avoid one level of indirection,\n * e.g. `this.xAxis!.inRange(x)`, both of which are suboptimal in tight loops where this method is used.\n * @param x A range value to be plotted along the x-axis.\n * @param y A range value to be plotted along the y-axis.\n * @param xAxis The series' x-axis.\n * @param yAxis The series' y-axis.\n * @returns\n */\n CartesianSeries.prototype.checkRangeXY = function (x, y, xAxis, yAxis) {\n return !isNaN(x) && !isNaN(y) && xAxis.inRange(x) && yAxis.inRange(y);\n };\n CartesianSeries.prototype.update = function (_a) {\n var _b, _c;\n var seriesRect = _a.seriesRect;\n return __awaiter$7(this, void 0, void 0, function () {\n var visible, series, seriesHighlighted, newNodeDataDependencies, resize;\n return __generator$7(this, function (_d) {\n switch (_d.label) {\n case 0:\n visible = this.visible;\n series = ((_c = (_b = this.ctx.highlightManager) === null || _b === void 0 ? void 0 : _b.getActiveHighlight()) !== null && _c !== void 0 ? _c : {}).series;\n seriesHighlighted = series ? series === this : undefined;\n newNodeDataDependencies = {\n seriesRectWidth: seriesRect === null || seriesRect === void 0 ? void 0 : seriesRect.width,\n seriesRectHeight: seriesRect === null || seriesRect === void 0 ? void 0 : seriesRect.height,\n };\n resize = jsonDiff(this.nodeDataDependencies, newNodeDataDependencies) != null;\n if (resize) {\n this.nodeDataDependencies = newNodeDataDependencies;\n this.markNodeDataDirty();\n }\n return [4 /*yield*/, this.updateSelections(seriesHighlighted, visible)];\n case 1:\n _d.sent();\n return [4 /*yield*/, this.updateNodes(seriesHighlighted, visible)];\n case 2:\n _d.sent();\n if (resize) {\n this.animationState.transition('resize', {\n datumSelections: this.subGroups.map(function (_a) {\n var datumSelection = _a.datumSelection;\n return datumSelection;\n }),\n markerSelections: this.subGroups.map(function (_a) {\n var markerSelection = _a.markerSelection;\n return markerSelection;\n }),\n contextData: this._contextNodeData,\n paths: this.subGroups.map(function (_a) {\n var paths = _a.paths;\n return paths;\n }),\n });\n }\n this.animationState.transition('update', {\n datumSelections: this.subGroups.map(function (_a) {\n var datumSelection = _a.datumSelection;\n return datumSelection;\n }),\n markerSelections: this.subGroups.map(function (_a) {\n var markerSelection = _a.markerSelection;\n return markerSelection;\n }),\n labelSelections: this.subGroups.map(function (_a) {\n var labelSelection = _a.labelSelection;\n return labelSelection;\n }),\n contextData: this._contextNodeData,\n paths: this.subGroups.map(function (_a) {\n var paths = _a.paths;\n return paths;\n }),\n seriesRect: seriesRect,\n });\n return [2 /*return*/];\n }\n });\n });\n };\n CartesianSeries.prototype.updateSelections = function (seriesHighlighted, anySeriesItemEnabled) {\n var _a;\n return __awaiter$7(this, void 0, void 0, function () {\n var _b;\n var _this = this;\n return __generator$7(this, function (_c) {\n switch (_c.label) {\n case 0: return [4 /*yield*/, this.updateHighlightSelection(seriesHighlighted)];\n case 1:\n _c.sent();\n if (!anySeriesItemEnabled) {\n return [2 /*return*/];\n }\n if (!this.nodeDataRefresh && !this.isPathOrSelectionDirty()) {\n return [2 /*return*/];\n }\n if (!this.nodeDataRefresh) return [3 /*break*/, 4];\n this.nodeDataRefresh = false;\n if ((_a = this.chart) === null || _a === void 0 ? void 0 : _a.debug) {\n Logger.debug(\"CartesianSeries.updateSelections() - calling createNodeData() for\", this.id);\n }\n _b = this;\n return [4 /*yield*/, this.createNodeData()];\n case 2:\n _b._contextNodeData = _c.sent();\n return [4 /*yield*/, this.updateSeriesGroups()];\n case 3:\n _c.sent();\n _c.label = 4;\n case 4: return [4 /*yield*/, Promise.all(this.subGroups.map(function (g, i) { return _this.updateSeriesGroupSelections(g, i); }))];\n case 5:\n _c.sent();\n return [2 /*return*/];\n }\n });\n });\n };\n CartesianSeries.prototype.updateSeriesGroupSelections = function (subGroup, seriesIdx) {\n return __awaiter$7(this, void 0, void 0, function () {\n var datumSelection, labelSelection, markerSelection, contextData, nodeData, labelData, _a, _b, _c;\n return __generator$7(this, function (_d) {\n switch (_d.label) {\n case 0:\n datumSelection = subGroup.datumSelection, labelSelection = subGroup.labelSelection, markerSelection = subGroup.markerSelection;\n contextData = this._contextNodeData[seriesIdx];\n nodeData = contextData.nodeData, labelData = contextData.labelData;\n _a = subGroup;\n return [4 /*yield*/, this.updateDatumSelection({ nodeData: nodeData, datumSelection: datumSelection, seriesIdx: seriesIdx })];\n case 1:\n _a.datumSelection = _d.sent();\n _b = subGroup;\n return [4 /*yield*/, this.updateLabelSelection({ labelData: labelData, labelSelection: labelSelection, seriesIdx: seriesIdx })];\n case 2:\n _b.labelSelection = _d.sent();\n if (!markerSelection) return [3 /*break*/, 4];\n _c = subGroup;\n return [4 /*yield*/, this.updateMarkerSelection({\n nodeData: nodeData,\n markerSelection: markerSelection,\n seriesIdx: seriesIdx,\n })];\n case 3:\n _c.markerSelection = _d.sent();\n _d.label = 4;\n case 4: return [2 /*return*/];\n }\n });\n });\n };\n CartesianSeries.prototype.nodeFactory = function () {\n return new Group();\n };\n CartesianSeries.prototype.markerFactory = function () {\n var MarkerShape = getMarker$1();\n return new MarkerShape();\n };\n CartesianSeries.prototype.updateSeriesGroups = function () {\n return __awaiter$7(this, void 0, void 0, function () {\n var _a, contextNodeData, contentGroup, subGroups, _b, pathsPerSeries, hasMarkers, totalGroups, layer, subGroupId, dataNodeGroup, markerGroup, labelGroup, paths, index;\n var _this = this;\n return __generator$7(this, function (_c) {\n _a = this, contextNodeData = _a._contextNodeData, contentGroup = _a.contentGroup, subGroups = _a.subGroups, _b = _a.opts, pathsPerSeries = _b.pathsPerSeries, hasMarkers = _b.hasMarkers;\n if (contextNodeData.length === subGroups.length) {\n return [2 /*return*/];\n }\n if (contextNodeData.length < subGroups.length) {\n subGroups.splice(contextNodeData.length).forEach(function (_a) {\n var e_1, _b;\n var dataNodeGroup = _a.dataNodeGroup, markerGroup = _a.markerGroup, labelGroup = _a.labelGroup, paths = _a.paths;\n contentGroup.removeChild(dataNodeGroup);\n if (markerGroup) {\n contentGroup.removeChild(markerGroup);\n }\n if (labelGroup) {\n contentGroup.removeChild(labelGroup);\n }\n try {\n for (var paths_1 = __values$h(paths), paths_1_1 = paths_1.next(); !paths_1_1.done; paths_1_1 = paths_1.next()) {\n var path = paths_1_1.value;\n contentGroup.removeChild(path);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (paths_1_1 && !paths_1_1.done && (_b = paths_1.return)) _b.call(paths_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n });\n }\n totalGroups = contextNodeData.length;\n while (totalGroups > subGroups.length) {\n layer = false;\n subGroupId = this.subGroupId++;\n dataNodeGroup = new Group({\n name: this.id + \"-series-sub\" + subGroupId + \"-dataNodes\",\n layer: layer,\n zIndex: Layers.SERIES_LAYER_ZINDEX,\n zIndexSubOrder: this.getGroupZIndexSubOrder('data', subGroupId),\n });\n markerGroup = hasMarkers\n ? new Group({\n name: this.id + \"-series-sub\" + this.subGroupId++ + \"-markers\",\n layer: layer,\n zIndex: Layers.SERIES_LAYER_ZINDEX,\n zIndexSubOrder: this.getGroupZIndexSubOrder('marker', subGroupId),\n })\n : undefined;\n labelGroup = new Group({\n name: this.id + \"-series-sub\" + this.subGroupId++ + \"-labels\",\n layer: layer,\n zIndex: Layers.SERIES_LABEL_ZINDEX,\n zIndexSubOrder: this.getGroupZIndexSubOrder('labels', subGroupId),\n });\n contentGroup.appendChild(dataNodeGroup);\n contentGroup.appendChild(labelGroup);\n if (markerGroup) {\n contentGroup.appendChild(markerGroup);\n }\n paths = [];\n for (index = 0; index < pathsPerSeries; index++) {\n paths[index] = new Path();\n paths[index].zIndex = Layers.SERIES_LAYER_ZINDEX;\n paths[index].zIndexSubOrder = this.getGroupZIndexSubOrder('paths', index);\n contentGroup.appendChild(paths[index]);\n }\n subGroups.push({\n paths: paths,\n dataNodeGroup: dataNodeGroup,\n markerGroup: markerGroup,\n labelGroup: labelGroup,\n labelSelection: Selection.select(labelGroup, Text),\n datumSelection: Selection.select(dataNodeGroup, function () { return _this.nodeFactory(); }, this.datumSelectionGarbageCollection),\n markerSelection: markerGroup ? Selection.select(markerGroup, function () { return _this.markerFactory(); }) : undefined,\n });\n }\n return [2 /*return*/];\n });\n });\n };\n CartesianSeries.prototype.getGroupZIndexSubOrder = function (type, subIndex) {\n var _a;\n if (subIndex === void 0) { subIndex = 0; }\n var result = _super.prototype.getGroupZIndexSubOrder.call(this, type, subIndex);\n if (type === 'paths') {\n var pathOffset_1 = (_a = this.opts.pathsZIndexSubOrderOffset[subIndex]) !== null && _a !== void 0 ? _a : 0;\n var superFn_1 = result[0];\n if (typeof superFn_1 === 'function') {\n result[0] = function () { return +superFn_1() + pathOffset_1; };\n }\n else {\n result[0] = +superFn_1 + pathOffset_1;\n }\n }\n return result;\n };\n CartesianSeries.prototype.updateNodes = function (seriesHighlighted, anySeriesItemEnabled) {\n var _a;\n return __awaiter$7(this, void 0, void 0, function () {\n var _b, highlightSelection, highlightLabelSelection, contextNodeData, _c, hasMarkers, hasHighlightedLabels, visible, subGroupOpacities;\n var _this = this;\n return __generator$7(this, function (_d) {\n switch (_d.label) {\n case 0:\n _b = this, highlightSelection = _b.highlightSelection, highlightLabelSelection = _b.highlightLabelSelection, contextNodeData = _b._contextNodeData, _c = _b.opts, hasMarkers = _c.hasMarkers, hasHighlightedLabels = _c.hasHighlightedLabels;\n visible = this.visible && ((_a = this._contextNodeData) === null || _a === void 0 ? void 0 : _a.length) > 0 && anySeriesItemEnabled;\n this.rootGroup.visible = visible;\n this.contentGroup.visible = visible;\n this.highlightGroup.visible = visible && !!seriesHighlighted;\n subGroupOpacities = this.subGroups.map(function (_, index) {\n var itemId = contextNodeData[index].itemId;\n return _this.getOpacity({ itemId: itemId });\n });\n if (!hasMarkers) return [3 /*break*/, 2];\n return [4 /*yield*/, this.updateMarkerNodes({\n markerSelection: highlightSelection,\n isHighlight: true,\n seriesIdx: -1,\n })];\n case 1:\n _d.sent();\n this.animationState.transition('highlightMarkers', highlightSelection);\n return [3 /*break*/, 4];\n case 2: return [4 /*yield*/, this.updateDatumNodes({ datumSelection: highlightSelection, isHighlight: true, seriesIdx: -1 })];\n case 3:\n _d.sent();\n this.animationState.transition('highlight', highlightSelection);\n _d.label = 4;\n case 4:\n if (!hasHighlightedLabels) return [3 /*break*/, 6];\n return [4 /*yield*/, this.updateLabelNodes({ labelSelection: highlightLabelSelection, seriesIdx: -1 })];\n case 5:\n _d.sent();\n _d.label = 6;\n case 6: return [4 /*yield*/, Promise.all(this.subGroups.map(function (subGroup, seriesIdx) { return __awaiter$7(_this, void 0, void 0, function () {\n var dataNodeGroup, markerGroup, datumSelection, labelSelection, markerSelection, paths, labelGroup, subGroupVisible, subGroupOpacity, paths_2, paths_2_1, path;\n var e_2, _a;\n return __generator$7(this, function (_b) {\n switch (_b.label) {\n case 0:\n dataNodeGroup = subGroup.dataNodeGroup, markerGroup = subGroup.markerGroup, datumSelection = subGroup.datumSelection, labelSelection = subGroup.labelSelection, markerSelection = subGroup.markerSelection, paths = subGroup.paths, labelGroup = subGroup.labelGroup;\n subGroupVisible = visible;\n subGroupOpacity = subGroupOpacities[seriesIdx];\n dataNodeGroup.opacity = subGroupOpacity;\n dataNodeGroup.visible = subGroupVisible;\n labelGroup.visible = subGroupVisible;\n if (markerGroup) {\n markerGroup.opacity = subGroupOpacity;\n markerGroup.zIndex =\n dataNodeGroup.zIndex >= Layers.SERIES_LAYER_ZINDEX\n ? dataNodeGroup.zIndex\n : dataNodeGroup.zIndex + 1;\n markerGroup.visible = subGroupVisible;\n }\n if (labelGroup) {\n labelGroup.opacity = subGroupOpacity;\n }\n try {\n for (paths_2 = __values$h(paths), paths_2_1 = paths_2.next(); !paths_2_1.done; paths_2_1 = paths_2.next()) {\n path = paths_2_1.value;\n path.opacity = subGroupOpacity;\n path.visible = subGroupVisible;\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (paths_2_1 && !paths_2_1.done && (_a = paths_2.return)) _a.call(paths_2);\n }\n finally { if (e_2) throw e_2.error; }\n }\n if (!dataNodeGroup.visible) {\n return [2 /*return*/];\n }\n return [4 /*yield*/, this.updateDatumNodes({ datumSelection: datumSelection, isHighlight: false, seriesIdx: seriesIdx })];\n case 1:\n _b.sent();\n return [4 /*yield*/, this.updateLabelNodes({ labelSelection: labelSelection, seriesIdx: seriesIdx })];\n case 2:\n _b.sent();\n if (!(hasMarkers && markerSelection)) return [3 /*break*/, 4];\n return [4 /*yield*/, this.updateMarkerNodes({ markerSelection: markerSelection, isHighlight: false, seriesIdx: seriesIdx })];\n case 3:\n _b.sent();\n _b.label = 4;\n case 4: return [2 /*return*/];\n }\n });\n }); }))];\n case 7:\n _d.sent();\n return [2 /*return*/];\n }\n });\n });\n };\n CartesianSeries.prototype.updateHighlightSelection = function (seriesHighlighted) {\n var _a;\n return __awaiter$7(this, void 0, void 0, function () {\n var _b, highlightSelection, highlightLabelSelection, contextNodeData, highlightedDatum, item, _c, labelItem, _d, itemId_1, contextNodeData_1, contextNodeData_1_1, labelData, _e;\n var e_3, _f;\n return __generator$7(this, function (_g) {\n switch (_g.label) {\n case 0:\n _b = this, highlightSelection = _b.highlightSelection, highlightLabelSelection = _b.highlightLabelSelection, contextNodeData = _b._contextNodeData;\n highlightedDatum = (_a = this.ctx.highlightManager) === null || _a === void 0 ? void 0 : _a.getActiveHighlight();\n item = seriesHighlighted && (highlightedDatum === null || highlightedDatum === void 0 ? void 0 : highlightedDatum.datum) ? highlightedDatum : undefined;\n _c = this;\n return [4 /*yield*/, this.updateHighlightSelectionItem({ item: item, highlightSelection: highlightSelection })];\n case 1:\n _c.highlightSelection = _g.sent();\n if (this.isLabelEnabled() && item != null) {\n _d = item.itemId, itemId_1 = _d === void 0 ? undefined : _d;\n try {\n for (contextNodeData_1 = __values$h(contextNodeData), contextNodeData_1_1 = contextNodeData_1.next(); !contextNodeData_1_1.done; contextNodeData_1_1 = contextNodeData_1.next()) {\n labelData = contextNodeData_1_1.value.labelData;\n labelItem = labelData.find(function (ld) { return ld.datum === item.datum && ld.itemId === itemId_1; });\n if (labelItem != null) {\n break;\n }\n }\n }\n catch (e_3_1) { e_3 = { error: e_3_1 }; }\n finally {\n try {\n if (contextNodeData_1_1 && !contextNodeData_1_1.done && (_f = contextNodeData_1.return)) _f.call(contextNodeData_1);\n }\n finally { if (e_3) throw e_3.error; }\n }\n }\n _e = this;\n return [4 /*yield*/, this.updateHighlightSelectionLabel({\n item: labelItem,\n highlightLabelSelection: highlightLabelSelection,\n })];\n case 2:\n _e.highlightLabelSelection = _g.sent();\n return [2 /*return*/];\n }\n });\n });\n };\n CartesianSeries.prototype.pickNodeExactShape = function (point) {\n var e_4, _a;\n var result = _super.prototype.pickNodeExactShape.call(this, point);\n if (result) {\n return result;\n }\n var x = point.x, y = point.y;\n var hasMarkers = this.opts.hasMarkers;\n try {\n for (var _b = __values$h(this.subGroups), _c = _b.next(); !_c.done; _c = _b.next()) {\n var _d = _c.value, dataNodeGroup = _d.dataNodeGroup, markerGroup = _d.markerGroup;\n var match = dataNodeGroup.pickNode(x, y);\n if (!match && hasMarkers) {\n match = markerGroup === null || markerGroup === void 0 ? void 0 : markerGroup.pickNode(x, y);\n }\n if (match) {\n return { datum: match.datum, distance: 0 };\n }\n }\n }\n catch (e_4_1) { e_4 = { error: e_4_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_4) throw e_4.error; }\n }\n };\n CartesianSeries.prototype.pickNodeClosestDatum = function (point) {\n var e_5, _a, e_6, _b;\n var _c, _d;\n var x = point.x, y = point.y;\n var _e = this, axes = _e.axes, rootGroup = _e.rootGroup, contextNodeData = _e._contextNodeData;\n var xAxis = axes[ChartAxisDirection.X];\n var yAxis = axes[ChartAxisDirection.Y];\n var hitPoint = rootGroup.transformPoint(x, y);\n var minDistance = Infinity;\n var closestDatum;\n try {\n for (var contextNodeData_2 = __values$h(contextNodeData), contextNodeData_2_1 = contextNodeData_2.next(); !contextNodeData_2_1.done; contextNodeData_2_1 = contextNodeData_2.next()) {\n var context = contextNodeData_2_1.value;\n try {\n for (var _f = (e_6 = void 0, __values$h(context.nodeData)), _g = _f.next(); !_g.done; _g = _f.next()) {\n var datum = _g.value;\n var _h = datum.point, _j = _h === void 0 ? {} : _h, _k = _j.x, datumX = _k === void 0 ? NaN : _k, _l = _j.y, datumY = _l === void 0 ? NaN : _l;\n if (isNaN(datumX) || isNaN(datumY)) {\n continue;\n }\n var isInRange = (xAxis === null || xAxis === void 0 ? void 0 : xAxis.inRange(datumX)) && (yAxis === null || yAxis === void 0 ? void 0 : yAxis.inRange(datumY));\n if (!isInRange) {\n continue;\n }\n // No need to use Math.sqrt() since x < y implies Math.sqrt(x) < Math.sqrt(y) for\n // values > 1\n var distance = Math.max(Math.pow((hitPoint.x - datumX), 2) + Math.pow((hitPoint.y - datumY), 2), 0);\n if (distance < minDistance) {\n minDistance = distance;\n closestDatum = datum;\n }\n }\n }\n catch (e_6_1) { e_6 = { error: e_6_1 }; }\n finally {\n try {\n if (_g && !_g.done && (_b = _f.return)) _b.call(_f);\n }\n finally { if (e_6) throw e_6.error; }\n }\n }\n }\n catch (e_5_1) { e_5 = { error: e_5_1 }; }\n finally {\n try {\n if (contextNodeData_2_1 && !contextNodeData_2_1.done && (_a = contextNodeData_2.return)) _a.call(contextNodeData_2);\n }\n finally { if (e_5) throw e_5.error; }\n }\n if (closestDatum) {\n var distance = Math.max(Math.sqrt(minDistance) - ((_d = (_c = closestDatum.point) === null || _c === void 0 ? void 0 : _c.size) !== null && _d !== void 0 ? _d : 0), 0);\n return { datum: closestDatum, distance: distance };\n }\n };\n CartesianSeries.prototype.pickNodeMainAxisFirst = function (point, requireCategoryAxis) {\n var e_7, _a, e_8, _b;\n var _c, _d;\n var x = point.x, y = point.y;\n var _e = this, axes = _e.axes, rootGroup = _e.rootGroup, contextNodeData = _e._contextNodeData;\n var xAxis = axes[ChartAxisDirection.X];\n var yAxis = axes[ChartAxisDirection.Y];\n // Prefer to start search with any available category axis.\n var directions = [xAxis, yAxis]\n .filter(function (a) { return a instanceof CategoryAxis; })\n .map(function (a) { return a.direction; });\n if (requireCategoryAxis && directions.length === 0) {\n return;\n }\n // Default to X-axis unless we found a suitable category axis.\n var _f = __read$B(directions, 1), _g = _f[0], primaryDirection = _g === void 0 ? ChartAxisDirection.X : _g;\n var hitPoint = rootGroup.transformPoint(x, y);\n var hitPointCoords = primaryDirection === ChartAxisDirection.X ? [hitPoint.x, hitPoint.y] : [hitPoint.y, hitPoint.x];\n var minDistance = [Infinity, Infinity];\n var closestDatum = undefined;\n try {\n for (var contextNodeData_3 = __values$h(contextNodeData), contextNodeData_3_1 = contextNodeData_3.next(); !contextNodeData_3_1.done; contextNodeData_3_1 = contextNodeData_3.next()) {\n var context = contextNodeData_3_1.value;\n try {\n for (var _h = (e_8 = void 0, __values$h(context.nodeData)), _j = _h.next(); !_j.done; _j = _h.next()) {\n var datum = _j.value;\n var _k = datum.point, _l = _k === void 0 ? {} : _k, _m = _l.x, datumX = _m === void 0 ? NaN : _m, _o = _l.y, datumY = _o === void 0 ? NaN : _o;\n if (isNaN(datumX) || isNaN(datumY)) {\n continue;\n }\n var isInRange = (xAxis === null || xAxis === void 0 ? void 0 : xAxis.inRange(datumX)) && (yAxis === null || yAxis === void 0 ? void 0 : yAxis.inRange(datumY));\n if (!isInRange) {\n continue;\n }\n var point_1 = primaryDirection === ChartAxisDirection.X ? [datumX, datumY] : [datumY, datumX];\n // Compare distances from most significant dimension to least.\n var newMinDistance = true;\n for (var i = 0; i < point_1.length; i++) {\n var dist = Math.abs(point_1[i] - hitPointCoords[i]);\n if (dist > minDistance[i]) {\n newMinDistance = false;\n break;\n }\n if (dist < minDistance[i]) {\n minDistance[i] = dist;\n minDistance.fill(Infinity, i + 1, minDistance.length);\n }\n }\n if (newMinDistance) {\n closestDatum = datum;\n }\n }\n }\n catch (e_8_1) { e_8 = { error: e_8_1 }; }\n finally {\n try {\n if (_j && !_j.done && (_b = _h.return)) _b.call(_h);\n }\n finally { if (e_8) throw e_8.error; }\n }\n }\n }\n catch (e_7_1) { e_7 = { error: e_7_1 }; }\n finally {\n try {\n if (contextNodeData_3_1 && !contextNodeData_3_1.done && (_a = contextNodeData_3.return)) _a.call(contextNodeData_3);\n }\n finally { if (e_7) throw e_7.error; }\n }\n if (closestDatum) {\n var distance = Math.max(Math.sqrt(Math.pow(minDistance[0], 2) + Math.pow(minDistance[1], 2)) - ((_d = (_c = closestDatum.point) === null || _c === void 0 ? void 0 : _c.size) !== null && _d !== void 0 ? _d : 0), 0);\n return { datum: closestDatum, distance: distance };\n }\n };\n CartesianSeries.prototype.onLegendItemClick = function (event) {\n var enabled = event.enabled, itemId = event.itemId, series = event.series, legendItemName = event.legendItemName;\n var matchedLegendItemName = this.legendItemName != null && this.legendItemName === legendItemName;\n if (series.id === this.id) {\n this.toggleSeriesItem(itemId, enabled);\n }\n else if (matchedLegendItemName) {\n this.toggleSeriesItem(itemId, enabled);\n }\n };\n CartesianSeries.prototype.onLegendItemDoubleClick = function (event) {\n var enabled = event.enabled, itemId = event.itemId, series = event.series, numVisibleItems = event.numVisibleItems, legendItemName = event.legendItemName;\n var totalVisibleItems = Object.values(numVisibleItems).reduce(function (p, v) { return p + v; }, 0);\n var matchedLegendItemName = this.legendItemName != null && this.legendItemName === legendItemName;\n if (series.id === this.id || matchedLegendItemName) {\n // Double-clicked item should always become visible.\n this.toggleSeriesItem(itemId, true);\n }\n else if (enabled && totalVisibleItems === 1) {\n // Other items should become visible if there is only one existing visible item.\n this.toggleSeriesItem(itemId, true);\n }\n else {\n // Disable other items if not exactly one enabled.\n this.toggleSeriesItem(itemId, false);\n }\n };\n CartesianSeries.prototype.isPathOrSelectionDirty = function () {\n // Override point to allow more sophisticated dirty selection detection.\n return false;\n };\n CartesianSeries.prototype.getLabelData = function () {\n return [];\n };\n CartesianSeries.prototype.updateHighlightSelectionItem = function (opts) {\n return __awaiter$7(this, void 0, void 0, function () {\n var hasMarkers, item, highlightSelection, nodeData, markerSelection;\n return __generator$7(this, function (_a) {\n hasMarkers = this.opts.hasMarkers;\n item = opts.item, highlightSelection = opts.highlightSelection;\n nodeData = item ? [item] : [];\n if (hasMarkers) {\n markerSelection = highlightSelection;\n return [2 /*return*/, this.updateMarkerSelection({ nodeData: nodeData, markerSelection: markerSelection, seriesIdx: -1 })];\n }\n else {\n return [2 /*return*/, this.updateDatumSelection({ nodeData: nodeData, datumSelection: highlightSelection, seriesIdx: -1 })];\n }\n });\n });\n };\n CartesianSeries.prototype.updateHighlightSelectionLabel = function (opts) {\n return __awaiter$7(this, void 0, void 0, function () {\n var item, highlightLabelSelection, labelData;\n return __generator$7(this, function (_a) {\n item = opts.item, highlightLabelSelection = opts.highlightLabelSelection;\n labelData = item ? [item] : [];\n return [2 /*return*/, this.updateLabelSelection({ labelData: labelData, labelSelection: highlightLabelSelection, seriesIdx: -1 })];\n });\n });\n };\n CartesianSeries.prototype.updateDatumSelection = function (opts) {\n return __awaiter$7(this, void 0, void 0, function () {\n return __generator$7(this, function (_a) {\n // Override point for sub-classes.\n return [2 /*return*/, opts.datumSelection];\n });\n });\n };\n CartesianSeries.prototype.updateDatumNodes = function (_opts) {\n return __awaiter$7(this, void 0, void 0, function () {\n return __generator$7(this, function (_a) {\n return [2 /*return*/];\n });\n });\n };\n CartesianSeries.prototype.updateMarkerSelection = function (opts) {\n return __awaiter$7(this, void 0, void 0, function () {\n return __generator$7(this, function (_a) {\n // Override point for sub-classes.\n return [2 /*return*/, opts.markerSelection];\n });\n });\n };\n CartesianSeries.prototype.updateMarkerNodes = function (_opts) {\n return __awaiter$7(this, void 0, void 0, function () {\n return __generator$7(this, function (_a) {\n return [2 /*return*/];\n });\n });\n };\n CartesianSeries.prototype.animateEmptyUpdateReady = function (_data) {\n // Override point for sub-classes.\n };\n CartesianSeries.prototype.animateReadyUpdate = function (_data) {\n // Override point for sub-classes.\n };\n CartesianSeries.prototype.animateWaitingUpdateReady = function (_data) {\n // Override point for sub-classes.\n };\n CartesianSeries.prototype.animateReadyHighlight = function (_data) {\n // Override point for sub-classes.\n };\n CartesianSeries.prototype.animateReadyHighlightMarkers = function (_data) {\n // Override point for sub-classes.\n };\n CartesianSeries.prototype.animateReadyResize = function (_data) {\n // Override point for sub-classes.\n };\n __decorate$1r([\n Validate(OPT_STRING)\n ], CartesianSeries.prototype, \"legendItemName\", void 0);\n return CartesianSeries;\n}(Series));\nvar CartesianSeriesMarker = /** @class */ (function (_super) {\n __extends$25(CartesianSeriesMarker, _super);\n function CartesianSeriesMarker() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.formatter = undefined;\n return _this;\n }\n __decorate$1r([\n Validate(OPT_FUNCTION),\n SceneChangeDetection({ redraw: RedrawType.MAJOR })\n ], CartesianSeriesMarker.prototype, \"formatter\", void 0);\n return CartesianSeriesMarker;\n}(SeriesMarker));\n\nvar __read$A = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar interpolatePattern = /(#\\{(.*?)\\})/g;\nfunction interpolate(input, values, formats) {\n return input.replace(interpolatePattern, function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var name = args[2];\n var _a = __read$A(name.split(':'), 2), valueName = _a[0], formatName = _a[1];\n var value = values[valueName];\n if (typeof value === 'number') {\n var format = formatName && formats && formats[formatName];\n if (format) {\n var _b = format, locales = _b.locales, options = _b.options;\n return value.toLocaleString(locales, options);\n }\n return String(value);\n }\n if (value instanceof Date) {\n var format = formatName && formats && formats[formatName];\n if (typeof format === 'string') {\n var formatter = buildFormatter(format);\n return formatter(value);\n }\n return value.toDateString();\n }\n if (typeof value === 'string' || (value === null || value === void 0 ? void 0 : value.toString)) {\n return String(value);\n }\n return '';\n });\n}\n\nvar element = null;\nfunction sanitizeHtml(text) {\n element = element !== null && element !== void 0 ? element : document.createElement('div');\n if (!text) {\n return '';\n }\n element.textContent = text;\n return element.innerHTML;\n}\n\nvar __extends$24 = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign$A = (undefined && undefined.__assign) || function () {\n __assign$A = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$A.apply(this, arguments);\n};\nvar __decorate$1q = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __awaiter$6 = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator$6 = (undefined && undefined.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nvar __read$z = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray$j = (undefined && undefined.__spreadArray) || function (to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\n to[j] = from[i];\n return to;\n};\nvar AreaSeriesLabel = /** @class */ (function (_super) {\n __extends$24(AreaSeriesLabel, _super);\n function AreaSeriesLabel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.formatter = undefined;\n return _this;\n }\n __decorate$1q([\n Validate(OPT_FUNCTION)\n ], AreaSeriesLabel.prototype, \"formatter\", void 0);\n return AreaSeriesLabel;\n}(Label$1));\nvar AreaSeriesTooltip = /** @class */ (function (_super) {\n __extends$24(AreaSeriesTooltip, _super);\n function AreaSeriesTooltip() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.renderer = undefined;\n _this.format = undefined;\n return _this;\n }\n __decorate$1q([\n Validate(OPT_FUNCTION)\n ], AreaSeriesTooltip.prototype, \"renderer\", void 0);\n __decorate$1q([\n Validate(OPT_STRING)\n ], AreaSeriesTooltip.prototype, \"format\", void 0);\n return AreaSeriesTooltip;\n}(SeriesTooltip));\nvar AreaSeriesTag;\n(function (AreaSeriesTag) {\n AreaSeriesTag[AreaSeriesTag[\"Fill\"] = 0] = \"Fill\";\n AreaSeriesTag[AreaSeriesTag[\"Stroke\"] = 1] = \"Stroke\";\n AreaSeriesTag[AreaSeriesTag[\"Marker\"] = 2] = \"Marker\";\n AreaSeriesTag[AreaSeriesTag[\"Label\"] = 3] = \"Label\";\n})(AreaSeriesTag || (AreaSeriesTag = {}));\nvar AreaSeries = /** @class */ (function (_super) {\n __extends$24(AreaSeries, _super);\n function AreaSeries(moduleCtx) {\n var _this = _super.call(this, {\n moduleCtx: moduleCtx,\n pathsPerSeries: 2,\n pathsZIndexSubOrderOffset: [0, 1000],\n hasMarkers: true,\n }) || this;\n _this.tooltip = new AreaSeriesTooltip();\n _this.marker = new CartesianSeriesMarker();\n _this.label = new AreaSeriesLabel();\n _this.fill = '#c16068';\n _this.stroke = '#874349';\n _this.fillOpacity = 1;\n _this.strokeOpacity = 1;\n _this.lineDash = [0];\n _this.lineDashOffset = 0;\n _this.xKey = undefined;\n _this.xName = undefined;\n _this.strokeWidth = 2;\n _this.shadow = undefined;\n var _a = _this, marker = _a.marker, label = _a.label;\n marker.enabled = false;\n label.enabled = false;\n return _this;\n }\n AreaSeries.prototype.processData = function (dataController) {\n return __awaiter$6(this, void 0, void 0, function () {\n var _a, xKey, yKey, axes, normalizedTo, data, visible, _b, _c, _d, groupIndex, xAxis, yAxis, isContinuousX, isContinuousY, ids, extraProps, normaliseTo, _e, dataModel, processedData;\n return __generator$6(this, function (_f) {\n switch (_f.label) {\n case 0:\n _a = this, xKey = _a.xKey, yKey = _a.yKey, axes = _a.axes, normalizedTo = _a.normalizedTo, data = _a.data, visible = _a.visible, _b = _a.seriesGrouping, _c = _b === void 0 ? {} : _b, _d = _c.groupIndex, groupIndex = _d === void 0 ? this.id : _d;\n if (!xKey || !yKey || !data)\n return [2 /*return*/];\n xAxis = axes[ChartAxisDirection.X];\n yAxis = axes[ChartAxisDirection.Y];\n isContinuousX = (xAxis === null || xAxis === void 0 ? void 0 : xAxis.scale) instanceof ContinuousScale;\n isContinuousY = (yAxis === null || yAxis === void 0 ? void 0 : yAxis.scale) instanceof ContinuousScale;\n ids = [\n \"area-stack-\" + groupIndex + \"-yValues\",\n \"area-stack-\" + groupIndex + \"-yValues-trailing\",\n \"area-stack-\" + groupIndex + \"-yValues-prev\",\n \"area-stack-\" + groupIndex + \"-yValues-trailing-prev\",\n \"area-stack-\" + groupIndex + \"-yValues-marker\",\n ];\n extraProps = [];\n normaliseTo = normalizedTo && isFinite(normalizedTo) ? normalizedTo : undefined;\n if (normaliseTo) {\n extraProps.push(normaliseGroupTo(this, [ids[0], ids[1], ids[4]], normaliseTo, 'range'));\n extraProps.push(normaliseGroupTo(this, [ids[2], ids[3]], normaliseTo, 'range'));\n }\n return [4 /*yield*/, dataController.request(this.id, data, {\n props: __spreadArray$j(__spreadArray$j(__spreadArray$j(__spreadArray$j(__spreadArray$j(__spreadArray$j([\n keyProperty(this, xKey, isContinuousX, { id: 'xValue' }),\n valueProperty(this, yKey, isContinuousY, { id: \"yValue-raw\", invalidValue: null })\n ], __read$z(groupAccumulativeValueProperty(this, yKey, isContinuousY, 'window', 'current', {\n id: \"yValue-end\",\n invalidValue: null,\n groupId: ids[0],\n }))), __read$z(groupAccumulativeValueProperty(this, yKey, isContinuousY, 'window-trailing', 'current', {\n id: \"yValue-start\",\n invalidValue: null,\n groupId: ids[1],\n }))), __read$z(groupAccumulativeValueProperty(this, yKey, isContinuousY, 'window', 'last', {\n id: \"yValue-previous-end\",\n invalidValue: null,\n groupId: ids[2],\n }))), __read$z(groupAccumulativeValueProperty(this, yKey, isContinuousY, 'window-trailing', 'last', {\n id: \"yValue-previous-start\",\n invalidValue: null,\n groupId: ids[3],\n }))), __read$z(groupAccumulativeValueProperty(this, yKey, isContinuousY, 'normal', 'current', {\n id: \"yValue-cumulative\",\n invalidValue: null,\n groupId: ids[4],\n }))), __read$z(extraProps)),\n groupByKeys: true,\n dataVisible: visible,\n })];\n case 1:\n _e = _f.sent(), dataModel = _e.dataModel, processedData = _e.processedData;\n this.dataModel = dataModel;\n this.processedData = processedData;\n return [2 /*return*/];\n }\n });\n });\n };\n AreaSeries.prototype.getDomain = function (direction) {\n var _a = this, processedData = _a.processedData, dataModel = _a.dataModel, axes = _a.axes;\n if (!processedData || !dataModel)\n return [];\n var xAxis = axes[ChartAxisDirection.X];\n var yAxis = axes[ChartAxisDirection.Y];\n var keyDef = dataModel.resolveProcessedDataDefById(this, \"xValue\");\n var keys = dataModel.getDomain(this, \"xValue\", 'key', processedData);\n var yExtent = dataModel.getDomain(this, /yValue-(previous-)?end/, 'value', processedData);\n if (direction === ChartAxisDirection.X) {\n if ((keyDef === null || keyDef === void 0 ? void 0 : keyDef.def.type) === 'key' && keyDef.def.valueType === 'category') {\n return keys;\n }\n return this.fixNumericExtent(extent$4(keys), xAxis);\n }\n else if (yAxis instanceof LogAxis || yAxis instanceof TimeAxis) {\n return this.fixNumericExtent(yExtent, yAxis);\n }\n else {\n var fixedYExtent = [yExtent[0] > 0 ? 0 : yExtent[0], yExtent[1] < 0 ? 0 : yExtent[1]];\n return this.fixNumericExtent(fixedYExtent, yAxis);\n }\n };\n AreaSeries.prototype.createNodeData = function () {\n var _a;\n return __awaiter$6(this, void 0, void 0, function () {\n var _b, axes, data, _c, _d, groupedData, dataModel, callbackCache, xAxis, yAxis, _e, _f, yKey, _g, xKey, marker, label, fill, stroke, seriesId, xScale, yScale, continuousY, xOffset, yStartIndex, yEndIndex, yRawIndex, yPreviousStartIndex, yPreviousEndIndex, yCumulativeIndex, createPathCoordinates, createMarkerCoordinate, labelSelectionData, markerSelectionData, strokeSelectionData, fillSelectionData, context, fillPoints, fillPhantomPoints, strokePoints, yValues, datumIdx, lastXDatum, i;\n var _this = this;\n return __generator$6(this, function (_h) {\n _b = this, axes = _b.axes, data = _b.data, _c = _b.processedData, _d = _c === void 0 ? {} : _c, groupedData = _d.data, dataModel = _b.dataModel, callbackCache = _b.ctx.callbackCache;\n xAxis = axes[ChartAxisDirection.X];\n yAxis = axes[ChartAxisDirection.Y];\n if (!xAxis || !yAxis || !data || !dataModel) {\n return [2 /*return*/, []];\n }\n _e = this, _f = _e.yKey, yKey = _f === void 0 ? '' : _f, _g = _e.xKey, xKey = _g === void 0 ? '' : _g, marker = _e.marker, label = _e.label, fill = _e.fill, stroke = _e.stroke, seriesId = _e.id;\n xScale = xAxis.scale;\n yScale = yAxis.scale;\n continuousY = yScale instanceof ContinuousScale;\n xOffset = ((_a = xScale.bandwidth) !== null && _a !== void 0 ? _a : 0) / 2;\n yStartIndex = dataModel.resolveProcessedDataIndexById(this, \"yValue-start\").index;\n yEndIndex = dataModel.resolveProcessedDataIndexById(this, \"yValue-end\").index;\n yRawIndex = dataModel.resolveProcessedDataIndexById(this, \"yValue-raw\").index;\n yPreviousStartIndex = dataModel.resolveProcessedDataIndexById(this, \"yValue-previous-start\").index;\n yPreviousEndIndex = dataModel.resolveProcessedDataIndexById(this, \"yValue-previous-end\").index;\n yCumulativeIndex = dataModel.resolveProcessedDataIndexById(this, \"yValue-cumulative\").index;\n createPathCoordinates = function (xDatum, lastYEnd, yEnd) {\n var x = xScale.convert(xDatum) + xOffset;\n var prevYCoordinate = yScale.convert(lastYEnd, { strict: false });\n var currYCoordinate = yScale.convert(yEnd, { strict: false });\n return [\n { x: x, y: currYCoordinate, size: marker.size },\n { x: x, y: prevYCoordinate, size: marker.size },\n ];\n };\n createMarkerCoordinate = function (xDatum, yEnd, rawYDatum) {\n var currY;\n // if not normalized, the invalid data points will be processed as `undefined` in processData()\n // if normalized, the invalid data points will be processed as 0 rather than `undefined`\n // check if unprocessed datum is valid as we only want to show markers for valid points\n var normalized = _this.normalizedTo && isFinite(_this.normalizedTo);\n var normalizedAndValid = normalized && continuousY && isContinuous(rawYDatum);\n var valid = (!normalized && !isNaN(rawYDatum)) || normalizedAndValid;\n if (valid) {\n currY = yEnd;\n }\n var x = xScale.convert(xDatum) + xOffset;\n var y = yScale.convert(currY, { strict: false });\n return { x: x, y: y, size: marker.size };\n };\n labelSelectionData = [];\n markerSelectionData = [];\n strokeSelectionData = { itemId: yKey, points: [], yValues: [] };\n fillSelectionData = { itemId: yKey, points: [] };\n context = {\n itemId: yKey,\n fillSelectionData: fillSelectionData,\n labelData: labelSelectionData,\n nodeData: markerSelectionData,\n strokeSelectionData: strokeSelectionData,\n };\n fillPoints = fillSelectionData.points;\n fillPhantomPoints = [];\n strokePoints = strokeSelectionData.points;\n yValues = strokeSelectionData.yValues;\n datumIdx = -1;\n groupedData === null || groupedData === void 0 ? void 0 : groupedData.forEach(function (datumGroup) {\n var _a = __read$z(datumGroup.keys, 1), xDatum = _a[0], datumArray = datumGroup.datum, valuesArray = datumGroup.values;\n valuesArray.forEach(function (values, valueIdx) {\n var _a;\n datumIdx++;\n var seriesDatum = datumArray[valueIdx];\n var yRawDatum = values[yRawIndex];\n var yStart = values[yStartIndex];\n var yEnd = values[yEndIndex];\n var yPreviousStart = values[yPreviousStartIndex];\n var yPreviousEnd = values[yPreviousEndIndex];\n var yCumulative = values[yCumulativeIndex];\n var validPoint = yRawDatum != null;\n // marker data\n var point = createMarkerCoordinate(xDatum, +yCumulative, yRawDatum);\n if (validPoint && marker) {\n markerSelectionData.push({\n index: datumIdx,\n series: _this,\n itemId: yKey,\n datum: seriesDatum,\n nodeMidPoint: { x: point.x, y: point.y },\n cumulativeValue: yEnd,\n yValue: yRawDatum,\n xValue: xDatum,\n yKey: yKey,\n xKey: xKey,\n point: point,\n fill: fill,\n stroke: stroke,\n });\n }\n // label data\n if (validPoint && label) {\n var labelText = void 0;\n if (label.formatter) {\n labelText = (_a = callbackCache.call(label.formatter, { value: yRawDatum, seriesId: seriesId })) !== null && _a !== void 0 ? _a : '';\n }\n else {\n labelText = isNumber$4(yRawDatum) ? Number(yRawDatum).toFixed(2) : String(yRawDatum);\n }\n labelSelectionData.push({\n index: datumIdx,\n itemId: yKey,\n point: point,\n label: labelText\n ? {\n text: labelText,\n fontStyle: label.fontStyle,\n fontWeight: label.fontWeight,\n fontSize: label.fontSize,\n fontFamily: label.fontFamily,\n textAlign: 'center',\n textBaseline: 'bottom',\n fill: label.color,\n }\n : undefined,\n });\n }\n // fill data\n // Handle data in pairs of current and next x and y values\n var windowX = [lastXDatum, xDatum];\n var windowYStart = [yPreviousStart, yStart];\n var windowYEnd = [yPreviousEnd, yEnd];\n if (windowX.some(function (v) { return v == undefined; })) {\n lastXDatum = xDatum;\n return;\n }\n if (windowYStart.some(function (v) { return v == undefined; })) {\n windowYStart[0] = 0;\n windowYStart[1] = 0;\n }\n if (windowYEnd.some(function (v) { return v == undefined; })) {\n windowYEnd[0] = 0;\n windowYEnd[1] = 0;\n }\n var prevCoordinates = createPathCoordinates(lastXDatum, +windowYStart[0], +windowYEnd[0]);\n fillPoints.push(prevCoordinates[0]);\n fillPhantomPoints.push(prevCoordinates[1]);\n var nextCoordinates = createPathCoordinates(xDatum, +windowYStart[1], +windowYEnd[1]);\n fillPoints.push(nextCoordinates[0]);\n fillPhantomPoints.push(nextCoordinates[1]);\n // stroke data\n strokePoints.push({ x: NaN, y: NaN }); // moveTo\n yValues.push(undefined);\n if (yPreviousEnd != null) {\n strokePoints.push(prevCoordinates[0]);\n yValues.push(yPreviousEnd);\n }\n if (yEnd != undefined) {\n strokePoints.push(nextCoordinates[0]);\n yValues.push(yEnd);\n }\n lastXDatum = xDatum;\n });\n });\n for (i = fillPhantomPoints.length - 1; i >= 0; i--) {\n fillPoints.push(fillPhantomPoints[i]);\n }\n return [2 /*return*/, [context]];\n });\n });\n };\n AreaSeries.prototype.isPathOrSelectionDirty = function () {\n return this.marker.isDirty();\n };\n AreaSeries.prototype.markerFactory = function () {\n var shape = this.marker.shape;\n var MarkerShape = getMarker$1(shape);\n return new MarkerShape();\n };\n AreaSeries.prototype.updateMarkerSelection = function (opts) {\n return __awaiter$6(this, void 0, void 0, function () {\n var nodeData, markerSelection, enabled, data;\n return __generator$6(this, function (_a) {\n nodeData = opts.nodeData, markerSelection = opts.markerSelection;\n enabled = this.marker.enabled;\n data = enabled && nodeData ? nodeData : [];\n if (this.marker.isDirty()) {\n markerSelection.clear();\n }\n return [2 /*return*/, markerSelection.update(data, function (marker) {\n marker.tag = AreaSeriesTag.Marker;\n })];\n });\n });\n };\n AreaSeries.prototype.updateMarkerNodes = function (opts) {\n var _a;\n return __awaiter$6(this, void 0, void 0, function () {\n var markerSelection, isDatumHighlighted, _b, seriesId, _c, xKey, marker, seriesFill, seriesStroke, seriesFillOpacity, _d, markerFillOpacity, strokeOpacity, _e, highlightedFill, _f, highlightFillOpacity, highlightedStroke, highlightedDatumStrokeWidth, visible, callbackCache, size, formatter, markerStrokeWidth, customMarker;\n return __generator$6(this, function (_g) {\n markerSelection = opts.markerSelection, isDatumHighlighted = opts.isHighlight;\n _b = this, seriesId = _b.id, _c = _b.xKey, xKey = _c === void 0 ? '' : _c, marker = _b.marker, seriesFill = _b.fill, seriesStroke = _b.stroke, seriesFillOpacity = _b.fillOpacity, _d = _b.marker.fillOpacity, markerFillOpacity = _d === void 0 ? seriesFillOpacity : _d, strokeOpacity = _b.strokeOpacity, _e = _b.highlightStyle.item, highlightedFill = _e.fill, _f = _e.fillOpacity, highlightFillOpacity = _f === void 0 ? markerFillOpacity : _f, highlightedStroke = _e.stroke, highlightedDatumStrokeWidth = _e.strokeWidth, visible = _b.visible, callbackCache = _b.ctx.callbackCache;\n size = marker.size, formatter = marker.formatter;\n markerStrokeWidth = (_a = marker.strokeWidth) !== null && _a !== void 0 ? _a : this.strokeWidth;\n customMarker = typeof marker.shape === 'function';\n markerSelection.each(function (node, datum) {\n var _a, _b, _c, _d, _e, _f, _g, _h;\n var fill = isDatumHighlighted && highlightedFill !== undefined ? highlightedFill : (_a = marker.fill) !== null && _a !== void 0 ? _a : seriesFill;\n var fillOpacity = isDatumHighlighted ? highlightFillOpacity : markerFillOpacity;\n var stroke = isDatumHighlighted && highlightedStroke !== undefined\n ? highlightedStroke\n : (_b = marker.stroke) !== null && _b !== void 0 ? _b : seriesStroke;\n var strokeWidth = isDatumHighlighted && highlightedDatumStrokeWidth !== undefined\n ? highlightedDatumStrokeWidth\n : markerStrokeWidth;\n var format = undefined;\n if (formatter) {\n format = callbackCache.call(formatter, {\n datum: datum.datum,\n xKey: xKey,\n yKey: datum.yKey,\n fill: fill,\n stroke: stroke,\n strokeWidth: strokeWidth,\n size: size,\n highlighted: isDatumHighlighted,\n seriesId: seriesId,\n });\n }\n node.fill = (_c = format === null || format === void 0 ? void 0 : format.fill) !== null && _c !== void 0 ? _c : fill;\n node.stroke = (_d = format === null || format === void 0 ? void 0 : format.stroke) !== null && _d !== void 0 ? _d : stroke;\n node.strokeWidth = (_e = format === null || format === void 0 ? void 0 : format.strokeWidth) !== null && _e !== void 0 ? _e : strokeWidth;\n node.fillOpacity = fillOpacity !== null && fillOpacity !== void 0 ? fillOpacity : 1;\n node.strokeOpacity = (_g = (_f = marker.strokeOpacity) !== null && _f !== void 0 ? _f : strokeOpacity) !== null && _g !== void 0 ? _g : 1;\n node.size = (_h = format === null || format === void 0 ? void 0 : format.size) !== null && _h !== void 0 ? _h : size;\n node.translationX = datum.point.x;\n node.translationY = datum.point.y;\n node.visible = node.size > 0 && visible && !isNaN(datum.point.x) && !isNaN(datum.point.y);\n if (!customMarker || node.dirtyPath) {\n return;\n }\n // Only for custom marker shapes\n node.path.clear({ trackChanges: true });\n node.updatePath();\n node.checkPathDirty();\n });\n if (!isDatumHighlighted) {\n this.marker.markClean();\n }\n return [2 /*return*/];\n });\n });\n };\n AreaSeries.prototype.updateLabelSelection = function (opts) {\n return __awaiter$6(this, void 0, void 0, function () {\n var labelData, labelSelection;\n return __generator$6(this, function (_a) {\n labelData = opts.labelData, labelSelection = opts.labelSelection;\n return [2 /*return*/, labelSelection.update(labelData, function (text) {\n text.tag = AreaSeriesTag.Label;\n })];\n });\n });\n };\n AreaSeries.prototype.updateLabelNodes = function (opts) {\n return __awaiter$6(this, void 0, void 0, function () {\n var labelSelection, _a, labelEnabled, fontStyle, fontWeight, fontSize, fontFamily, color;\n return __generator$6(this, function (_b) {\n labelSelection = opts.labelSelection;\n _a = this.label, labelEnabled = _a.enabled, fontStyle = _a.fontStyle, fontWeight = _a.fontWeight, fontSize = _a.fontSize, fontFamily = _a.fontFamily, color = _a.color;\n labelSelection.each(function (text, datum) {\n var point = datum.point, label = datum.label;\n if (label && labelEnabled) {\n text.fontStyle = fontStyle;\n text.fontWeight = fontWeight;\n text.fontSize = fontSize;\n text.fontFamily = fontFamily;\n text.textAlign = label.textAlign;\n text.textBaseline = label.textBaseline;\n text.text = label.text;\n text.x = point.x;\n text.y = point.y - 10;\n text.fill = color;\n text.visible = true;\n }\n else {\n text.visible = false;\n }\n });\n return [2 /*return*/];\n });\n });\n };\n AreaSeries.prototype.getNodeClickEvent = function (event, datum) {\n var _a;\n return new CartesianSeriesNodeClickEvent((_a = this.xKey) !== null && _a !== void 0 ? _a : '', datum.yKey, event, datum, this);\n };\n AreaSeries.prototype.getNodeDoubleClickEvent = function (event, datum) {\n var _a;\n return new CartesianSeriesNodeDoubleClickEvent((_a = this.xKey) !== null && _a !== void 0 ? _a : '', datum.yKey, event, datum, this);\n };\n AreaSeries.prototype.getTooltipHtml = function (nodeDatum) {\n var _a, _b, _c;\n var _d = this, xKey = _d.xKey, seriesId = _d.id, axes = _d.axes, xName = _d.xName, yName = _d.yName, seriesFill = _d.fill, seriesStroke = _d.stroke, tooltip = _d.tooltip, marker = _d.marker, dataModel = _d.dataModel;\n var yKey = nodeDatum.yKey, xValue = nodeDatum.xValue, yValue = nodeDatum.yValue, datum = nodeDatum.datum;\n var xAxis = axes[ChartAxisDirection.X];\n var yAxis = axes[ChartAxisDirection.Y];\n if (!(xKey && yKey) || !(xAxis && yAxis && isNumber$4(yValue)) || !dataModel) {\n return '';\n }\n var yRawIndex = dataModel.resolveProcessedDataIndexById(this, \"yValue-raw\").index;\n var size = marker.size, markerFormatter = marker.formatter, markerStrokeWidth = marker.strokeWidth, markerFill = marker.fill, markerStroke = marker.stroke;\n var xString = xAxis.formatDatum(xValue);\n var yString = yAxis.formatDatum(yValue);\n var processedYValue = (_b = (_a = this.processedData) === null || _a === void 0 ? void 0 : _a.data[nodeDatum.index]) === null || _b === void 0 ? void 0 : _b.values[0][yRawIndex];\n var title = sanitizeHtml(yName);\n var content = sanitizeHtml(xString + ': ' + yString);\n var strokeWidth = markerStrokeWidth !== null && markerStrokeWidth !== void 0 ? markerStrokeWidth : this.strokeWidth;\n var fill = markerFill !== null && markerFill !== void 0 ? markerFill : seriesFill;\n var stroke = markerStroke !== null && markerStroke !== void 0 ? markerStroke : seriesStroke;\n var format = undefined;\n if (markerFormatter) {\n format = markerFormatter({\n datum: datum,\n xKey: xKey,\n yKey: yKey,\n fill: fill,\n stroke: stroke,\n strokeWidth: strokeWidth,\n size: size,\n highlighted: false,\n seriesId: seriesId,\n });\n }\n var color = (_c = format === null || format === void 0 ? void 0 : format.fill) !== null && _c !== void 0 ? _c : fill;\n var defaults = {\n title: title,\n backgroundColor: color,\n content: content,\n };\n var tooltipRenderer = tooltip.renderer, tooltipFormat = tooltip.format;\n if (tooltipFormat || tooltipRenderer) {\n var params = {\n datum: datum,\n xKey: xKey,\n xName: xName,\n xValue: xValue,\n yKey: yKey,\n yValue: yValue,\n processedYValue: processedYValue,\n yName: yName,\n color: color,\n title: title,\n seriesId: seriesId,\n };\n if (tooltipFormat) {\n return toTooltipHtml$1({\n content: interpolate(tooltipFormat, params),\n }, defaults);\n }\n if (tooltipRenderer) {\n return toTooltipHtml$1(tooltipRenderer(params), defaults);\n }\n }\n return toTooltipHtml$1(defaults);\n };\n AreaSeries.prototype.getLegendData = function () {\n var _a, _b, _c, _d;\n var _e = this, data = _e.data, id = _e.id, xKey = _e.xKey, yKey = _e.yKey, yName = _e.yName, marker = _e.marker, fill = _e.fill, stroke = _e.stroke, fillOpacity = _e.fillOpacity, strokeOpacity = _e.strokeOpacity, visible = _e.visible;\n if (!(data === null || data === void 0 ? void 0 : data.length) || !xKey || !yKey) {\n return [];\n }\n // Area stacks should be listed in the legend in reverse order, for symmetry with the\n // vertical stack display order.\n return [\n {\n legendType: 'category',\n id: id,\n itemId: yKey,\n seriesId: id,\n enabled: visible,\n label: {\n text: yName !== null && yName !== void 0 ? yName : yKey,\n },\n marker: {\n shape: marker.shape,\n fill: (_a = marker.fill) !== null && _a !== void 0 ? _a : fill,\n stroke: (_b = marker.stroke) !== null && _b !== void 0 ? _b : stroke,\n fillOpacity: (_c = marker.fillOpacity) !== null && _c !== void 0 ? _c : fillOpacity,\n strokeOpacity: (_d = marker.strokeOpacity) !== null && _d !== void 0 ? _d : strokeOpacity,\n },\n },\n ];\n };\n AreaSeries.prototype.animateEmptyUpdateReady = function (_a) {\n var _this = this;\n var markerSelections = _a.markerSelections, labelSelections = _a.labelSelections, contextData = _a.contextData, paths = _a.paths, seriesRect = _a.seriesRect;\n var _b = this, seriesStroke = _b.stroke, seriesFill = _b.fill, fillOpacity = _b.fillOpacity, lineDash = _b.lineDash, lineDashOffset = _b.lineDashOffset, strokeOpacity = _b.strokeOpacity, strokeWidth = _b.strokeWidth, shadow = _b.shadow;\n contextData.forEach(function (_a, seriesIdx) {\n var _b, _c, _d, _e, _f;\n var fillSelectionData = _a.fillSelectionData, strokeSelectionData = _a.strokeSelectionData, itemId = _a.itemId;\n var _g = __read$z(paths[seriesIdx], 2), fill = _g[0], stroke = _g[1];\n var duration = (_c = (_b = _this.ctx.animationManager) === null || _b === void 0 ? void 0 : _b.defaultOptions.duration) !== null && _c !== void 0 ? _c : 1000;\n var markerDuration = 200;\n var animationOptions = {\n from: 0,\n to: (_d = seriesRect === null || seriesRect === void 0 ? void 0 : seriesRect.width) !== null && _d !== void 0 ? _d : 0,\n duration: duration,\n };\n // Stroke\n {\n var points_1 = strokeSelectionData.points, yValues_1 = strokeSelectionData.yValues;\n stroke.tag = AreaSeriesTag.Stroke;\n stroke.fill = undefined;\n stroke.lineJoin = stroke.lineCap = 'round';\n stroke.pointerEvents = PointerEvents.None;\n stroke.stroke = seriesStroke;\n stroke.strokeWidth = _this.getStrokeWidth(_this.strokeWidth, { itemId: itemId });\n stroke.strokeOpacity = strokeOpacity;\n stroke.lineDash = lineDash;\n stroke.lineDashOffset = lineDashOffset;\n (_e = _this.ctx.animationManager) === null || _e === void 0 ? void 0 : _e.animate(_this.id + \"_empty-update-ready_stroke_\" + seriesIdx, __assign$A(__assign$A({}, animationOptions), { onUpdate: function (xValue) {\n stroke.path.clear({ trackChanges: true });\n var moveTo = true;\n points_1.forEach(function (point, index) {\n // Draw/move the full segment if past the end of this segment\n if (yValues_1[index] === undefined || isNaN(point.x) || isNaN(point.y)) {\n moveTo = true;\n }\n else if (point.x <= xValue) {\n if (moveTo) {\n stroke.path.moveTo(point.x, point.y);\n moveTo = false;\n }\n else {\n stroke.path.lineTo(point.x, point.y);\n }\n }\n else if (index > 0 &&\n yValues_1[index] !== undefined &&\n yValues_1[index - 1] !== undefined &&\n points_1[index - 1].x <= xValue) {\n // Draw/move partial line if in between the start and end of this segment\n var start = points_1[index - 1];\n var end = point;\n var x = xValue;\n var y = start.y + ((x - start.x) * (end.y - start.y)) / (end.x - start.x);\n stroke.path.lineTo(x, y);\n }\n });\n stroke.checkPathDirty();\n } }));\n }\n // Fill\n {\n var allPoints = fillSelectionData.points;\n var points_2 = allPoints.slice(0, allPoints.length / 2);\n var bottomPoints_1 = allPoints.slice(allPoints.length / 2);\n fill.tag = AreaSeriesTag.Fill;\n fill.stroke = undefined;\n fill.lineJoin = 'round';\n fill.pointerEvents = PointerEvents.None;\n fill.fill = seriesFill;\n fill.fillOpacity = fillOpacity;\n fill.strokeOpacity = strokeOpacity;\n fill.strokeWidth = strokeWidth;\n fill.lineDash = lineDash;\n fill.lineDashOffset = lineDashOffset;\n fill.fillShadow = shadow;\n (_f = _this.ctx.animationManager) === null || _f === void 0 ? void 0 : _f.animate(_this.id + \"_empty-update-ready_fill_\" + seriesIdx, __assign$A(__assign$A({}, animationOptions), { onUpdate: function (xValue) {\n fill.path.clear({ trackChanges: true });\n var x = 0;\n var y = 0;\n points_2.forEach(function (point, index) {\n if (point.x <= xValue) {\n // Draw/move the full segment if past the end of this segment\n x = point.x;\n y = point.y;\n fill.path.lineTo(point.x, point.y);\n }\n else if (index > 0 && points_2[index - 1].x < xValue) {\n // Draw/move partial line if in between the start and end of this segment\n var start = points_2[index - 1];\n var end = point;\n x = xValue;\n y = start.y + ((x - start.x) * (end.y - start.y)) / (end.x - start.x);\n fill.path.lineTo(x, y);\n }\n });\n bottomPoints_1.forEach(function (point, index) {\n var reverseIndex = bottomPoints_1.length - index - 1;\n if (point.x <= xValue) {\n fill.path.lineTo(point.x, point.y);\n }\n else if (reverseIndex > 0 && points_2[reverseIndex - 1].x < xValue) {\n var start = point;\n var end = bottomPoints_1[index + 1];\n var bottomY = start.y + ((x - start.x) * (end.y - start.y)) / (end.x - start.x);\n fill.path.lineTo(x, bottomY);\n }\n });\n if (bottomPoints_1.length > 0) {\n fill.path.lineTo(bottomPoints_1[bottomPoints_1.length - 1].x, bottomPoints_1[bottomPoints_1.length - 1].y);\n }\n fill.path.closePath();\n fill.checkPathDirty();\n } }));\n }\n markerSelections[seriesIdx].each(function (marker, datum) {\n var _a, _b, _c, _d;\n var delay = (seriesRect === null || seriesRect === void 0 ? void 0 : seriesRect.width) ? (datum.point.x / seriesRect.width) * duration : 0;\n var format = _this.animateFormatter(datum);\n var size = (_b = (_a = datum.point) === null || _a === void 0 ? void 0 : _a.size) !== null && _b !== void 0 ? _b : 0;\n (_c = _this.ctx.animationManager) === null || _c === void 0 ? void 0 : _c.animate(_this.id + \"_empty-update-ready_\" + marker.id, __assign$A(__assign$A({}, animationOptions), { to: (_d = format === null || format === void 0 ? void 0 : format.size) !== null && _d !== void 0 ? _d : size, delay: delay, duration: markerDuration, onUpdate: function (size) {\n marker.size = size;\n } }));\n });\n labelSelections[seriesIdx].each(function (label, datum) {\n var _a;\n var delay = (seriesRect === null || seriesRect === void 0 ? void 0 : seriesRect.width) ? (datum.point.x / seriesRect.width) * duration : 0;\n (_a = _this.ctx.animationManager) === null || _a === void 0 ? void 0 : _a.animate(_this.id + \"_empty-update-ready_\" + label.id, {\n from: 0,\n to: 1,\n delay: delay,\n duration: markerDuration,\n onUpdate: function (opacity) {\n label.opacity = opacity;\n },\n });\n });\n });\n };\n AreaSeries.prototype.animateReadyUpdate = function (_a) {\n var _this = this;\n var contextData = _a.contextData, paths = _a.paths;\n var _b = this, seriesStroke = _b.stroke, seriesFill = _b.fill, fillOpacity = _b.fillOpacity, lineDash = _b.lineDash, lineDashOffset = _b.lineDashOffset, strokeOpacity = _b.strokeOpacity, strokeWidth = _b.strokeWidth, shadow = _b.shadow;\n contextData.forEach(function (_a, seriesIdx) {\n var strokeSelectionData = _a.strokeSelectionData, fillSelectionData = _a.fillSelectionData, itemId = _a.itemId;\n var _b = __read$z(paths[seriesIdx], 2), fill = _b[0], stroke = _b[1];\n // Stroke\n stroke.stroke = seriesStroke;\n stroke.strokeWidth = _this.getStrokeWidth(_this.strokeWidth, { itemId: itemId });\n stroke.strokeOpacity = strokeOpacity;\n stroke.lineDash = lineDash;\n stroke.lineDashOffset = lineDashOffset;\n stroke.path.clear({ trackChanges: true });\n var moveTo = true;\n strokeSelectionData.points.forEach(function (point, index) {\n if (strokeSelectionData.yValues[index] === undefined || isNaN(point.x) || isNaN(point.y)) {\n moveTo = true;\n }\n else if (moveTo) {\n stroke.path.moveTo(point.x, point.y);\n moveTo = false;\n }\n else {\n stroke.path.lineTo(point.x, point.y);\n }\n });\n stroke.checkPathDirty();\n // Fill\n fill.fill = seriesFill;\n fill.fillOpacity = fillOpacity;\n fill.strokeOpacity = strokeOpacity;\n fill.strokeWidth = strokeWidth;\n fill.lineDash = lineDash;\n fill.lineDashOffset = lineDashOffset;\n fill.fillShadow = shadow;\n fill.path.clear({ trackChanges: true });\n fillSelectionData.points.forEach(function (point) {\n fill.path.lineTo(point.x, point.y);\n });\n fill.path.closePath();\n fill.checkPathDirty();\n });\n };\n AreaSeries.prototype.animateFormatter = function (datum) {\n var _a, _b, _c;\n var _d = this, marker = _d.marker, seriesFill = _d.fill, seriesStroke = _d.stroke, _e = _d.xKey, xKey = _e === void 0 ? '' : _e, seriesId = _d.id, callbackCache = _d.ctx.callbackCache;\n var size = marker.size, formatter = marker.formatter;\n var fill = (_a = marker.fill) !== null && _a !== void 0 ? _a : seriesFill;\n var stroke = (_b = marker.stroke) !== null && _b !== void 0 ? _b : seriesStroke;\n var strokeWidth = (_c = marker.strokeWidth) !== null && _c !== void 0 ? _c : this.strokeWidth;\n var format = undefined;\n if (formatter) {\n format = callbackCache.call(formatter, {\n datum: datum.datum,\n xKey: xKey,\n yKey: datum.yKey,\n fill: fill,\n stroke: stroke,\n strokeWidth: strokeWidth,\n size: size,\n highlighted: false,\n seriesId: seriesId,\n });\n }\n return format;\n };\n AreaSeries.prototype.isLabelEnabled = function () {\n return this.label.enabled;\n };\n AreaSeries.className = 'AreaSeries';\n AreaSeries.type = 'area';\n __decorate$1q([\n Validate(COLOR_STRING)\n ], AreaSeries.prototype, \"fill\", void 0);\n __decorate$1q([\n Validate(COLOR_STRING)\n ], AreaSeries.prototype, \"stroke\", void 0);\n __decorate$1q([\n Validate(NUMBER(0, 1))\n ], AreaSeries.prototype, \"fillOpacity\", void 0);\n __decorate$1q([\n Validate(NUMBER(0, 1))\n ], AreaSeries.prototype, \"strokeOpacity\", void 0);\n __decorate$1q([\n Validate(OPT_LINE_DASH)\n ], AreaSeries.prototype, \"lineDash\", void 0);\n __decorate$1q([\n Validate(NUMBER(0))\n ], AreaSeries.prototype, \"lineDashOffset\", void 0);\n __decorate$1q([\n Validate(OPT_STRING)\n ], AreaSeries.prototype, \"xKey\", void 0);\n __decorate$1q([\n Validate(OPT_STRING)\n ], AreaSeries.prototype, \"xName\", void 0);\n __decorate$1q([\n Validate(OPT_STRING)\n ], AreaSeries.prototype, \"yKey\", void 0);\n __decorate$1q([\n Validate(OPT_STRING)\n ], AreaSeries.prototype, \"yName\", void 0);\n __decorate$1q([\n Validate(OPT_NUMBER(0))\n ], AreaSeries.prototype, \"normalizedTo\", void 0);\n __decorate$1q([\n Validate(NUMBER(0))\n ], AreaSeries.prototype, \"strokeWidth\", void 0);\n return AreaSeries;\n}(CartesianSeries));\n\nvar __extends$23 = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$1p = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar Rect = /** @class */ (function (_super) {\n __extends$23(Rect, _super);\n function Rect() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.borderPath = new Path2D();\n _this.x = 0;\n _this.y = 0;\n _this.width = 10;\n _this.height = 10;\n _this.radius = 0;\n /**\n * If `true`, the rect is aligned to the pixel grid for crisp looking lines.\n * Animated rects may not look nice with this option enabled, for example\n * when a rect is translated by a sub-pixel value on each frame.\n */\n _this.crisp = false;\n _this.lastUpdatePathStrokeWidth = Shape.defaultStyles.strokeWidth;\n _this.effectiveStrokeWidth = Shape.defaultStyles.strokeWidth;\n /**\n * When the rectangle's width or height is less than a pixel\n * and crisp mode is on, the rectangle will still fit into the pixel,\n * but will be less opaque to make an effect of holding less space.\n */\n _this.microPixelEffectOpacity = 1;\n return _this;\n }\n Rect.prototype.isDirtyPath = function () {\n var _a;\n if (this.lastUpdatePathStrokeWidth !== this.strokeWidth) {\n return true;\n }\n if (this.path.isDirty() || this.borderPath.isDirty() || ((_a = this.clipPath) === null || _a === void 0 ? void 0 : _a.isDirty())) {\n return true;\n }\n return false;\n };\n Rect.prototype.updatePath = function () {\n var _a, _b, _c;\n var _d = this, path = _d.path, borderPath = _d.borderPath, crisp = _d.crisp;\n var _e = this, x = _e.x, y = _e.y, w = _e.width, h = _e.height, strokeWidth = _e.strokeWidth;\n var pixelRatio = (_b = (_a = this.layerManager) === null || _a === void 0 ? void 0 : _a.canvas.pixelRatio) !== null && _b !== void 0 ? _b : 1;\n var pixelSize = 1 / pixelRatio;\n var microPixelEffectOpacity = 1;\n path.clear({ trackChanges: true });\n borderPath.clear({ trackChanges: true });\n if (crisp) {\n if (w <= pixelSize) {\n microPixelEffectOpacity *= w / pixelSize;\n }\n if (h <= pixelSize) {\n microPixelEffectOpacity *= h / pixelSize;\n }\n w = this.align(x, w);\n h = this.align(y, h);\n x = this.align(x);\n y = this.align(y);\n }\n if (strokeWidth) {\n if (w < pixelSize) {\n // Too narrow, draw a vertical stroke\n var lx = x + pixelSize / 2;\n borderPath.moveTo(lx, y);\n borderPath.lineTo(lx, y + h);\n strokeWidth = pixelSize;\n this.borderClipPath = undefined;\n }\n else if (h < pixelSize) {\n // Too narrow, draw a horizontal stroke\n var ly = y + pixelSize / 2;\n borderPath.moveTo(x, ly);\n borderPath.lineTo(x + w, ly);\n strokeWidth = pixelSize;\n this.borderClipPath = undefined;\n }\n else if (strokeWidth < w && strokeWidth < h) {\n var halfStrokeWidth = strokeWidth / 2;\n x += halfStrokeWidth;\n y += halfStrokeWidth;\n w -= strokeWidth;\n h -= strokeWidth;\n // Clipping not needed in this case; fill to center of stroke.\n this.borderClipPath = undefined;\n path.rect(x, y, w, h);\n borderPath.rect(x, y, w, h);\n }\n else {\n // Skip the fill and just render the stroke.\n this.borderClipPath = (_c = this.borderClipPath) !== null && _c !== void 0 ? _c : new Path2D();\n this.borderClipPath.clear({ trackChanges: true });\n this.borderClipPath.rect(x, y, w, h);\n borderPath.rect(x, y, w, h);\n }\n }\n else {\n // No borderPath needed, and thus no clipPath needed either. Fill to full extent of\n // Rect.\n this.borderClipPath = undefined;\n path.rect(x, y, w, h);\n }\n this.effectiveStrokeWidth = strokeWidth;\n this.lastUpdatePathStrokeWidth = strokeWidth;\n this.microPixelEffectOpacity = microPixelEffectOpacity;\n };\n Rect.prototype.computeBBox = function () {\n var _a = this, x = _a.x, y = _a.y, width = _a.width, height = _a.height;\n return new BBox(x, y, width, height);\n };\n Rect.prototype.isPointInPath = function (x, y) {\n var point = this.transformPoint(x, y);\n var bbox = this.computeBBox();\n return bbox.containsPoint(point.x, point.y);\n };\n Rect.prototype.applyFillAlpha = function (ctx) {\n var _a = this, fillOpacity = _a.fillOpacity, microPixelEffectOpacity = _a.microPixelEffectOpacity, opacity = _a.opacity;\n var globalAlpha = ctx.globalAlpha;\n ctx.globalAlpha = globalAlpha * opacity * fillOpacity * microPixelEffectOpacity;\n };\n Rect.prototype.renderStroke = function (ctx) {\n var _a = this, stroke = _a.stroke, effectiveStrokeWidth = _a.effectiveStrokeWidth, borderPath = _a.borderPath, borderClipPath = _a.borderClipPath, opacity = _a.opacity, microPixelEffectOpacity = _a.microPixelEffectOpacity;\n var borderActive = !!stroke && !!effectiveStrokeWidth;\n if (borderActive) {\n var _b = this, strokeOpacity = _b.strokeOpacity, lineDash = _b.lineDash, lineDashOffset = _b.lineDashOffset, lineCap = _b.lineCap, lineJoin = _b.lineJoin;\n if (borderClipPath) {\n // strokeWidth is larger than width or height, so use clipping to render correctly.\n // This is the simplest way to achieve the correct rendering due to nuances with ~0\n // width/height lines in Canvas operations.\n borderClipPath.draw(ctx);\n ctx.clip();\n }\n borderPath.draw(ctx);\n var globalAlpha = ctx.globalAlpha;\n ctx.strokeStyle = stroke;\n ctx.globalAlpha = globalAlpha * opacity * strokeOpacity * microPixelEffectOpacity;\n ctx.lineWidth = effectiveStrokeWidth;\n if (lineDash) {\n ctx.setLineDash(lineDash);\n }\n if (lineDashOffset) {\n ctx.lineDashOffset = lineDashOffset;\n }\n if (lineCap) {\n ctx.lineCap = lineCap;\n }\n if (lineJoin) {\n ctx.lineJoin = lineJoin;\n }\n ctx.stroke();\n ctx.globalAlpha = globalAlpha;\n }\n };\n Rect.className = 'Rect';\n __decorate$1p([\n ScenePathChangeDetection()\n ], Rect.prototype, \"x\", void 0);\n __decorate$1p([\n ScenePathChangeDetection()\n ], Rect.prototype, \"y\", void 0);\n __decorate$1p([\n ScenePathChangeDetection()\n ], Rect.prototype, \"width\", void 0);\n __decorate$1p([\n ScenePathChangeDetection()\n ], Rect.prototype, \"height\", void 0);\n __decorate$1p([\n ScenePathChangeDetection()\n ], Rect.prototype, \"radius\", void 0);\n __decorate$1p([\n ScenePathChangeDetection()\n ], Rect.prototype, \"crisp\", void 0);\n return Rect;\n}(Path));\n\nvar __assign$z = (undefined && undefined.__assign) || function () {\n __assign$z = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$z.apply(this, arguments);\n};\nvar __rest$2 = (undefined && undefined.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nvar __read$y = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nfunction createLabelData(_a) {\n var value = _a.value, rect = _a.rect, placement = _a.placement, seriesId = _a.seriesId, _b = _a.padding, padding = _b === void 0 ? 0 : _b, formatter = _a.formatter, barAlongX = _a.barAlongX, callbackCache = _a.ctx.callbackCache;\n var labelText;\n if (formatter) {\n labelText = callbackCache.call(formatter, {\n value: isNumber$4(value) ? value : undefined,\n seriesId: seriesId,\n });\n }\n if (labelText === undefined) {\n labelText = isNumber$4(value) ? value.toFixed(2) : '';\n }\n var labelX = rect.x + rect.width / 2;\n var labelY = rect.y + rect.height / 2;\n var labelTextAlign = 'center';\n var labelTextBaseline = 'middle';\n var isPositive = value >= 0;\n switch (placement) {\n case 'start': {\n if (barAlongX) {\n labelX = isPositive ? rect.x - padding : rect.x + rect.width + padding;\n labelTextAlign = isPositive ? 'start' : 'end';\n }\n else {\n labelY = isPositive ? rect.y + rect.height + padding : rect.y - padding;\n labelTextBaseline = isPositive ? 'top' : 'bottom';\n }\n break;\n }\n case 'outside':\n case 'end': {\n if (barAlongX) {\n labelX = isPositive ? rect.x + rect.width + padding : rect.x - padding;\n labelTextAlign = isPositive ? 'start' : 'end';\n }\n else {\n labelY = isPositive ? rect.y - padding : rect.y + rect.height + padding;\n labelTextBaseline = isPositive ? 'bottom' : 'top';\n }\n break;\n }\n case 'inside':\n default: {\n labelTextBaseline = 'middle';\n break;\n }\n }\n return {\n text: labelText,\n textAlign: labelTextAlign,\n textBaseline: labelTextBaseline,\n x: labelX,\n y: labelY,\n };\n}\nfunction updateRect(_a) {\n var rect = _a.rect, config = _a.config;\n var _b = config.crisp, crisp = _b === void 0 ? true : _b, fill = config.fill, stroke = config.stroke, strokeWidth = config.strokeWidth, fillOpacity = config.fillOpacity, strokeOpacity = config.strokeOpacity, lineDash = config.lineDash, lineDashOffset = config.lineDashOffset, fillShadow = config.fillShadow, _c = config.visible, visible = _c === void 0 ? true : _c;\n rect.crisp = crisp;\n rect.fill = fill;\n rect.stroke = stroke;\n rect.strokeWidth = strokeWidth;\n rect.fillOpacity = fillOpacity;\n rect.strokeOpacity = strokeOpacity;\n rect.lineDash = lineDash;\n rect.lineDashOffset = lineDashOffset;\n rect.fillShadow = fillShadow;\n rect.visible = visible;\n}\nfunction getRectConfig(_a) {\n var _b, _c, _d, _e, _f, _g, _h;\n var datum = _a.datum, isHighlighted = _a.isHighlighted, style = _a.style, highlightStyle = _a.highlightStyle, formatter = _a.formatter, seriesId = _a.seriesId, stackGroup = _a.stackGroup, callbackCache = _a.ctx.callbackCache, opts = __rest$2(_a, [\"datum\", \"isHighlighted\", \"style\", \"highlightStyle\", \"formatter\", \"seriesId\", \"stackGroup\", \"ctx\"]);\n var itemFill = isHighlighted ? (_b = highlightStyle.fill) !== null && _b !== void 0 ? _b : style.fill : style.fill;\n var itemStroke = isHighlighted ? (_c = highlightStyle.stroke) !== null && _c !== void 0 ? _c : style.stroke : style.stroke;\n var itemStrokeWidth = isHighlighted ? (_d = highlightStyle.strokeWidth) !== null && _d !== void 0 ? _d : style.strokeWidth : style.strokeWidth;\n var fillOpacity = isHighlighted ? (_e = highlightStyle.fillOpacity) !== null && _e !== void 0 ? _e : style.fillOpacity : style.fillOpacity;\n var strokeOpacity = style.strokeOpacity, fillShadow = style.fillShadow, lineDash = style.lineDash, lineDashOffset = style.lineDashOffset;\n var format = undefined;\n if (formatter) {\n format = callbackCache.call(formatter, __assign$z({ datum: datum.datum, xKey: datum.xKey, yKey: datum.yKey, fill: itemFill, stroke: itemStroke, strokeWidth: itemStrokeWidth, highlighted: isHighlighted, seriesId: seriesId, stackGroup: stackGroup }, opts));\n }\n return {\n fill: (_f = format === null || format === void 0 ? void 0 : format.fill) !== null && _f !== void 0 ? _f : itemFill,\n stroke: (_g = format === null || format === void 0 ? void 0 : format.stroke) !== null && _g !== void 0 ? _g : itemStroke,\n strokeWidth: (_h = format === null || format === void 0 ? void 0 : format.strokeWidth) !== null && _h !== void 0 ? _h : itemStrokeWidth,\n fillOpacity: fillOpacity,\n strokeOpacity: strokeOpacity,\n lineDash: lineDash,\n lineDashOffset: lineDashOffset,\n fillShadow: fillShadow,\n };\n}\nfunction checkCrisp(visibleRange) {\n if (visibleRange === void 0) { visibleRange = []; }\n var _a = __read$y(visibleRange, 2), visibleMin = _a[0], visibleMax = _a[1];\n var isZoomed = visibleMin !== 0 || visibleMax !== 1;\n var crisp = !isZoomed;\n return crisp;\n}\nfunction updateLabel(_a) {\n var labelNode = _a.labelNode, labelDatum = _a.labelDatum, config = _a.config, visible = _a.visible;\n if (labelDatum && config && config.enabled) {\n var x = labelDatum.x, y = labelDatum.y, text = labelDatum.text, textAlign = labelDatum.textAlign, textBaseline = labelDatum.textBaseline;\n var fontStyle = config.fontStyle, fontWeight = config.fontWeight, fontSize = config.fontSize, fontFamily = config.fontFamily, color = config.color;\n labelNode.fontStyle = fontStyle;\n labelNode.fontWeight = fontWeight;\n labelNode.fontSize = fontSize;\n labelNode.fontFamily = fontFamily;\n labelNode.textAlign = textAlign;\n labelNode.textBaseline = textBaseline;\n labelNode.text = text;\n labelNode.x = x;\n labelNode.y = y;\n labelNode.fill = color;\n labelNode.visible = visible;\n }\n else {\n labelNode.visible = false;\n }\n}\n\nvar __extends$22 = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$1o = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __awaiter$5 = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator$5 = (undefined && undefined.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nvar __read$x = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray$i = (undefined && undefined.__spreadArray) || function (to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\n to[j] = from[i];\n return to;\n};\nvar BAR_LABEL_PLACEMENTS = ['inside', 'outside'];\nvar OPT_BAR_LABEL_PLACEMENT = function (v, ctx) {\n return OPTIONAL(v, ctx, function (v) { return BAR_LABEL_PLACEMENTS.includes(v); });\n};\nvar BarSeriesNodeTag;\n(function (BarSeriesNodeTag) {\n BarSeriesNodeTag[BarSeriesNodeTag[\"Bar\"] = 0] = \"Bar\";\n BarSeriesNodeTag[BarSeriesNodeTag[\"Label\"] = 1] = \"Label\";\n})(BarSeriesNodeTag || (BarSeriesNodeTag = {}));\nvar BarSeriesLabel = /** @class */ (function (_super) {\n __extends$22(BarSeriesLabel, _super);\n function BarSeriesLabel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.formatter = undefined;\n _this.placement = 'inside';\n return _this;\n }\n __decorate$1o([\n Validate(OPT_FUNCTION)\n ], BarSeriesLabel.prototype, \"formatter\", void 0);\n __decorate$1o([\n Validate(OPT_BAR_LABEL_PLACEMENT)\n ], BarSeriesLabel.prototype, \"placement\", void 0);\n return BarSeriesLabel;\n}(Label$1));\nvar BarSeriesTooltip = /** @class */ (function (_super) {\n __extends$22(BarSeriesTooltip, _super);\n function BarSeriesTooltip() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.renderer = undefined;\n return _this;\n }\n __decorate$1o([\n Validate(OPT_FUNCTION)\n ], BarSeriesTooltip.prototype, \"renderer\", void 0);\n return BarSeriesTooltip;\n}(SeriesTooltip));\nvar BarSeries = /** @class */ (function (_super) {\n __extends$22(BarSeries, _super);\n function BarSeries(moduleCtx) {\n var _this = _super.call(this, {\n moduleCtx: moduleCtx,\n pickModes: [SeriesNodePickMode.EXACT_SHAPE_MATCH],\n pathsPerSeries: 0,\n hasHighlightedLabels: true,\n }) || this;\n _this.label = new BarSeriesLabel();\n _this.tooltip = new BarSeriesTooltip();\n _this.fill = '#c16068';\n _this.stroke = '#874349';\n _this.fillOpacity = 1;\n _this.strokeOpacity = 1;\n _this.lineDash = [0];\n _this.lineDashOffset = 0;\n _this.formatter = undefined;\n _this.xKey = undefined;\n _this.xName = undefined;\n _this.yKey = undefined;\n _this.yName = undefined;\n /**\n * Used to get the position of bars within each group.\n */\n _this.groupScale = new BandScale$5();\n _this.stackGroup = undefined;\n _this.strokeWidth = 1;\n _this.shadow = undefined;\n _this.smallestDataInterval = undefined;\n _this.datumSelectionGarbageCollection = false;\n _this.label.enabled = false;\n return _this;\n }\n BarSeries.prototype.resolveKeyDirection = function (direction) {\n if (this.getBarDirection() === ChartAxisDirection.X) {\n if (direction === ChartAxisDirection.X) {\n return ChartAxisDirection.Y;\n }\n return ChartAxisDirection.X;\n }\n return direction;\n };\n BarSeries.prototype.processData = function (dataController) {\n var _a, _b, _c, _d, _e;\n return __awaiter$5(this, void 0, void 0, function () {\n var _f, xKey, yKey, normalizedTo, _g, _h, _j, groupIndex, _k, data, normalizedToAbs, isContinuousX, isContinuousY, stackGroupName, stackGroupTrailingName, normaliseTo, extraProps, _l, dataModel, processedData;\n return __generator$5(this, function (_m) {\n switch (_m.label) {\n case 0:\n _f = this, xKey = _f.xKey, yKey = _f.yKey, normalizedTo = _f.normalizedTo, _g = _f.seriesGrouping, _h = _g === void 0 ? {} : _g, _j = _h.groupIndex, groupIndex = _j === void 0 ? this.id : _j, _k = _f.data, data = _k === void 0 ? [] : _k;\n normalizedToAbs = Math.abs(normalizedTo !== null && normalizedTo !== void 0 ? normalizedTo : NaN);\n isContinuousX = ((_a = this.getCategoryAxis()) === null || _a === void 0 ? void 0 : _a.scale) instanceof ContinuousScale;\n isContinuousY = ((_b = this.getValueAxis()) === null || _b === void 0 ? void 0 : _b.scale) instanceof ContinuousScale;\n stackGroupName = \"bar-stack-\" + groupIndex + \"-yValues\";\n stackGroupTrailingName = stackGroupName + \"-trailing\";\n normaliseTo = normalizedToAbs && isFinite(normalizedToAbs) ? normalizedToAbs : undefined;\n extraProps = [];\n if (normaliseTo) {\n extraProps.push(normaliseGroupTo(this, [stackGroupName, stackGroupTrailingName], normaliseTo, 'range'));\n }\n if (!((_c = this.ctx.animationManager) === null || _c === void 0 ? void 0 : _c.skipAnimations) && this.processedData) {\n extraProps.push(diff(this.processedData));\n }\n return [4 /*yield*/, dataController.request(this.id, data, {\n props: __spreadArray$i(__spreadArray$i(__spreadArray$i(__spreadArray$i([\n keyProperty(this, xKey, isContinuousX, { id: 'xValue' }),\n valueProperty(this, yKey, isContinuousY, { id: \"yValue-raw\", invalidValue: null })\n ], __read$x(groupAccumulativeValueProperty(this, yKey, isContinuousY, 'normal', 'current', {\n id: \"yValue-end\",\n invalidValue: null,\n groupId: stackGroupName,\n }))), __read$x(groupAccumulativeValueProperty(this, yKey, isContinuousY, 'trailing', 'current', {\n id: \"yValue-start\",\n invalidValue: null,\n groupId: stackGroupTrailingName,\n }))), __read$x((isContinuousX ? [SMALLEST_KEY_INTERVAL] : []))), __read$x(extraProps)),\n groupByKeys: true,\n dataVisible: this.visible,\n })];\n case 1:\n _l = _m.sent(), dataModel = _l.dataModel, processedData = _l.processedData;\n this.dataModel = dataModel;\n this.processedData = processedData;\n this.smallestDataInterval = {\n x: (_e = (_d = processedData.reduced) === null || _d === void 0 ? void 0 : _d[SMALLEST_KEY_INTERVAL.property]) !== null && _e !== void 0 ? _e : Infinity,\n y: Infinity,\n };\n this.animationState.transition('updateData');\n return [2 /*return*/];\n }\n });\n });\n };\n BarSeries.prototype.getDomain = function (direction) {\n var _a;\n var _b = this, processedData = _b.processedData, dataModel = _b.dataModel;\n if (!processedData || !dataModel)\n return [];\n var _c = processedData, _d = _c.reduced, _e = _d === void 0 ? {} : _d, _f = SMALLEST_KEY_INTERVAL.property, smallestX = _e[_f];\n var categoryAxis = this.getCategoryAxis();\n var valueAxis = this.getValueAxis();\n var keyDef = dataModel.resolveProcessedDataDefById(this, \"xValue\");\n var keys = dataModel.getDomain(this, \"xValue\", 'key', processedData);\n var yExtent = dataModel.getDomain(this, \"yValue-end\", 'value', processedData);\n if (direction === this.getCategoryDirection()) {\n if ((keyDef === null || keyDef === void 0 ? void 0 : keyDef.def.type) === 'key' && (keyDef === null || keyDef === void 0 ? void 0 : keyDef.def.valueType) === 'category') {\n return keys;\n }\n var scalePadding = isFinite(smallestX) ? smallestX : 0;\n var keysExtent = (_a = extent$4(keys)) !== null && _a !== void 0 ? _a : [NaN, NaN];\n if (direction === ChartAxisDirection.Y) {\n return this.fixNumericExtent([keysExtent[0] + -scalePadding, keysExtent[1]], categoryAxis);\n }\n return this.fixNumericExtent([keysExtent[0], keysExtent[1] + scalePadding], categoryAxis);\n }\n else if (this.getValueAxis() instanceof LogAxis) {\n return this.fixNumericExtent(yExtent, valueAxis);\n }\n else {\n var fixedYExtent = [yExtent[0] > 0 ? 0 : yExtent[0], yExtent[1] < 0 ? 0 : yExtent[1]];\n return this.fixNumericExtent(fixedYExtent, valueAxis);\n }\n };\n BarSeries.prototype.getNodeClickEvent = function (event, datum) {\n var _a;\n return new CartesianSeriesNodeClickEvent((_a = this.xKey) !== null && _a !== void 0 ? _a : '', datum.yKey, event, datum, this);\n };\n BarSeries.prototype.getNodeDoubleClickEvent = function (event, datum) {\n var _a;\n return new CartesianSeriesNodeDoubleClickEvent((_a = this.xKey) !== null && _a !== void 0 ? _a : '', datum.yKey, event, datum, this);\n };\n BarSeries.prototype.getCategoryAxis = function () {\n var direction = this.getCategoryDirection();\n return this.axes[direction];\n };\n BarSeries.prototype.getValueAxis = function () {\n var direction = this.getBarDirection();\n return this.axes[direction];\n };\n BarSeries.prototype.calculateStep = function (range) {\n var _a;\n var smallestInterval = this.smallestDataInterval;\n var xAxis = this.getCategoryAxis();\n if (!xAxis) {\n return;\n }\n // calculate step\n var domainLength = xAxis.dataDomain[1] - xAxis.dataDomain[0];\n var intervals = domainLength / ((_a = smallestInterval === null || smallestInterval === void 0 ? void 0 : smallestInterval.x) !== null && _a !== void 0 ? _a : 1) + 1;\n // The number of intervals/bands is used to determine the width of individual bands by dividing the available range.\n // Allow a maximum number of bands to ensure the step does not fall below 1 pixel.\n // This means there could be some overlap of the bands in the chart.\n var maxBands = Math.floor(range); // A minimum of 1px per bar/column means the maximum number of bands will equal the available range\n var bands = Math.min(intervals, maxBands);\n var step = range / Math.max(1, bands);\n return step;\n };\n BarSeries.prototype.createNodeData = function () {\n return __awaiter$5(this, void 0, void 0, function () {\n var _a, visible, dataModel, xAxis, yAxis, xScale, yScale, _b, groupScale, _c, yKey, _d, xKey, fill, stroke, strokeWidth, label, seriesId, processedData, ctx, seriesStateManager, xBandWidth, availableRange, step, domain, _e, groupIndex, visibleGroupCount, groupIdx, barWidth, xIndex, yRawIndex, yStartIndex, yEndIndex, context;\n var _this = this;\n return __generator$5(this, function (_f) {\n _a = this, visible = _a.visible, dataModel = _a.dataModel;\n xAxis = this.getCategoryAxis();\n yAxis = this.getValueAxis();\n if (!(dataModel && visible && xAxis && yAxis)) {\n return [2 /*return*/, []];\n }\n xScale = xAxis.scale;\n yScale = yAxis.scale;\n _b = this, groupScale = _b.groupScale, _c = _b.yKey, yKey = _c === void 0 ? '' : _c, _d = _b.xKey, xKey = _d === void 0 ? '' : _d, fill = _b.fill, stroke = _b.stroke, strokeWidth = _b.strokeWidth, label = _b.label, seriesId = _b.id, processedData = _b.processedData, ctx = _b.ctx, seriesStateManager = _b.ctx.seriesStateManager;\n xBandWidth = xScale.bandwidth;\n if (xScale instanceof ContinuousScale) {\n availableRange = Math.max(xAxis.range[0], xAxis.range[1]);\n step = this.calculateStep(availableRange);\n xBandWidth = step;\n }\n domain = [];\n _e = seriesStateManager.getVisiblePeerGroupIndex(this), groupIndex = _e.index, visibleGroupCount = _e.visibleGroupCount;\n for (groupIdx = 0; groupIdx < visibleGroupCount; groupIdx++) {\n domain.push(String(groupIdx));\n }\n groupScale.domain = domain;\n groupScale.range = [0, xBandWidth !== null && xBandWidth !== void 0 ? xBandWidth : 0];\n if (xAxis instanceof CategoryAxis) {\n groupScale.padding = xAxis.groupPaddingInner;\n }\n else if (xAxis instanceof GroupedCategoryAxis) {\n groupScale.padding = 0.1;\n }\n else {\n // Number or Time axis\n groupScale.padding = 0;\n }\n // To get exactly `0` padding we need to turn off rounding\n if (groupScale.padding === 0) {\n groupScale.round = false;\n }\n else {\n groupScale.round = true;\n }\n barWidth = groupScale.bandwidth >= 1\n ? // Pixel-rounded value for low-volume bar charts.\n groupScale.bandwidth\n : // Handle high-volume bar charts gracefully.\n groupScale.rawBandwidth;\n xIndex = dataModel.resolveProcessedDataIndexById(this, \"xValue\", 'key').index;\n yRawIndex = dataModel.resolveProcessedDataIndexById(this, \"yValue-raw\").index;\n yStartIndex = dataModel.resolveProcessedDataIndexById(this, \"yValue-start\").index;\n yEndIndex = dataModel.resolveProcessedDataIndexById(this, \"yValue-end\").index;\n context = {\n itemId: yKey,\n nodeData: [],\n labelData: [],\n };\n processedData === null || processedData === void 0 ? void 0 : processedData.data.forEach(function (_a, dataIndex) {\n var keys = _a.keys, seriesDatum = _a.datum, values = _a.values;\n var xValue = keys[xIndex];\n var x = xScale.convert(xValue);\n var currY = +values[0][yEndIndex];\n var prevY = +values[0][yStartIndex];\n var yRawValue = values[0][yRawIndex];\n var barX = x + groupScale.convert(String(groupIndex));\n // Bars outside of visible range are not rendered, so we create node data\n // only for the visible subset of user data.\n if (!xAxis.inRange(barX, barWidth)) {\n return;\n }\n if (isNaN(currY)) {\n return;\n }\n var y = yScale.convert(currY, { strict: false });\n var bottomY = yScale.convert(prevY, { strict: false });\n var barAlongX = _this.getBarDirection() === ChartAxisDirection.X;\n var rect = {\n x: barAlongX ? Math.min(y, bottomY) : barX,\n y: barAlongX ? barX : Math.min(y, bottomY),\n width: barAlongX ? Math.abs(bottomY - y) : barWidth,\n height: barAlongX ? barWidth : Math.abs(bottomY - y),\n };\n var nodeMidPoint = {\n x: rect.x + rect.width / 2,\n y: rect.y + rect.height / 2,\n };\n var labelFontStyle = label.fontStyle, labelFontWeight = label.fontWeight, labelFontSize = label.fontSize, labelFontFamily = label.fontFamily, labelColor = label.color, formatter = label.formatter, placement = label.placement;\n var _b = createLabelData({ value: yRawValue, rect: rect, formatter: formatter, placement: placement, seriesId: seriesId, barAlongX: barAlongX, ctx: ctx }), labelText = _b.text, labelTextAlign = _b.textAlign, labelTextBaseline = _b.textBaseline, labelX = _b.x, labelY = _b.y;\n var nodeData = {\n index: dataIndex,\n series: _this,\n itemId: yKey,\n datum: seriesDatum[0],\n cumulativeValue: prevY + currY,\n xValue: xValue,\n yValue: yRawValue,\n yKey: yKey,\n xKey: xKey,\n x: rect.x,\n y: rect.y,\n width: rect.width,\n height: rect.height,\n nodeMidPoint: nodeMidPoint,\n fill: fill,\n stroke: stroke,\n strokeWidth: strokeWidth,\n label: labelText\n ? {\n text: labelText,\n fontStyle: labelFontStyle,\n fontWeight: labelFontWeight,\n fontSize: labelFontSize,\n fontFamily: labelFontFamily,\n textAlign: labelTextAlign,\n textBaseline: labelTextBaseline,\n fill: labelColor,\n x: labelX,\n y: labelY,\n }\n : undefined,\n };\n context.nodeData.push(nodeData);\n context.labelData.push(nodeData);\n });\n return [2 /*return*/, [context]];\n });\n });\n };\n BarSeries.prototype.nodeFactory = function () {\n return new Rect();\n };\n BarSeries.prototype.updateDatumSelection = function (opts) {\n return __awaiter$5(this, void 0, void 0, function () {\n var nodeData, datumSelection, getDatumId;\n return __generator$5(this, function (_a) {\n nodeData = opts.nodeData, datumSelection = opts.datumSelection;\n getDatumId = function (datum) { return datum.xValue; };\n return [2 /*return*/, datumSelection.update(nodeData, function (rect) { return (rect.tag = BarSeriesNodeTag.Bar); }, getDatumId)];\n });\n });\n };\n BarSeries.prototype.updateDatumNodes = function (opts) {\n return __awaiter$5(this, void 0, void 0, function () {\n var datumSelection, isHighlight, _a, fill, stroke, fillOpacity, strokeOpacity, lineDash, lineDashOffset, shadow, formatter, seriesId, itemHighlightStyle, ctx, stackGroup, xAxis, crisp, categoryAlongX;\n var _this = this;\n return __generator$5(this, function (_b) {\n datumSelection = opts.datumSelection, isHighlight = opts.isHighlight;\n _a = this, fill = _a.fill, stroke = _a.stroke, fillOpacity = _a.fillOpacity, strokeOpacity = _a.strokeOpacity, lineDash = _a.lineDash, lineDashOffset = _a.lineDashOffset, shadow = _a.shadow, formatter = _a.formatter, seriesId = _a.id, itemHighlightStyle = _a.highlightStyle.item, ctx = _a.ctx, stackGroup = _a.stackGroup;\n xAxis = this.axes[ChartAxisDirection.X];\n crisp = checkCrisp(xAxis === null || xAxis === void 0 ? void 0 : xAxis.visibleRange);\n categoryAlongX = this.getCategoryDirection() === ChartAxisDirection.X;\n datumSelection.each(function (rect, datum) {\n var style = {\n fill: fill,\n stroke: stroke,\n fillOpacity: fillOpacity,\n strokeOpacity: strokeOpacity,\n lineDash: lineDash,\n lineDashOffset: lineDashOffset,\n fillShadow: shadow,\n strokeWidth: _this.getStrokeWidth(_this.strokeWidth, datum),\n };\n var visible = categoryAlongX ? datum.width > 0 : datum.height > 0;\n var config = getRectConfig({\n datum: datum,\n isHighlighted: isHighlight,\n style: style,\n highlightStyle: itemHighlightStyle,\n formatter: formatter,\n seriesId: seriesId,\n stackGroup: stackGroup,\n ctx: ctx,\n });\n config.crisp = crisp;\n config.visible = visible;\n updateRect({ rect: rect, config: config });\n });\n return [2 /*return*/];\n });\n });\n };\n BarSeries.prototype.updateLabelSelection = function (opts) {\n return __awaiter$5(this, void 0, void 0, function () {\n var labelData, labelSelection, enabled, data;\n return __generator$5(this, function (_a) {\n labelData = opts.labelData, labelSelection = opts.labelSelection;\n enabled = this.label.enabled;\n data = enabled ? labelData : [];\n return [2 /*return*/, labelSelection.update(data, function (text) {\n text.tag = BarSeriesNodeTag.Label;\n text.pointerEvents = PointerEvents.None;\n })];\n });\n });\n };\n BarSeries.prototype.updateLabelNodes = function (opts) {\n return __awaiter$5(this, void 0, void 0, function () {\n var labelSelection;\n var _this = this;\n return __generator$5(this, function (_a) {\n labelSelection = opts.labelSelection;\n labelSelection.each(function (text, datum) {\n var labelDatum = datum.label;\n updateLabel({ labelNode: text, labelDatum: labelDatum, config: _this.label, visible: true });\n });\n return [2 /*return*/];\n });\n });\n };\n BarSeries.prototype.getTooltipHtml = function (nodeDatum) {\n var _a;\n var _b = this, xKey = _b.xKey, yKey = _b.yKey, processedData = _b.processedData, callbackCache = _b.ctx.callbackCache;\n var xAxis = this.getCategoryAxis();\n var yAxis = this.getValueAxis();\n var xValue = nodeDatum.xValue, yValue = nodeDatum.yValue, datum = nodeDatum.datum;\n if (!processedData || !xKey || !yKey || !xAxis || !yAxis) {\n return '';\n }\n var _c = this, xName = _c.xName, yName = _c.yName, fill = _c.fill, stroke = _c.stroke, tooltip = _c.tooltip, formatter = _c.formatter, seriesId = _c.id, stackGroup = _c.stackGroup;\n var tooltipRenderer = tooltip.renderer;\n var strokeWidth = this.getStrokeWidth(this.strokeWidth);\n var xString = sanitizeHtml(xAxis.formatDatum(xValue));\n var yString = sanitizeHtml(yAxis.formatDatum(yValue));\n var title = sanitizeHtml(yName);\n var content = xString + ': ' + yString;\n var format = undefined;\n if (formatter) {\n format = callbackCache.call(formatter, {\n datum: datum,\n fill: fill,\n stroke: stroke,\n strokeWidth: strokeWidth,\n highlighted: false,\n xKey: xKey,\n yKey: yKey,\n seriesId: seriesId,\n stackGroup: stackGroup,\n });\n }\n var color = (_a = format === null || format === void 0 ? void 0 : format.fill) !== null && _a !== void 0 ? _a : fill;\n var defaults = {\n title: title,\n backgroundColor: color,\n content: content,\n };\n if (tooltipRenderer) {\n return toTooltipHtml$1(tooltipRenderer({\n datum: datum,\n xKey: xKey,\n xValue: xValue,\n xName: xName,\n yKey: yKey,\n yValue: yValue,\n yName: yName,\n color: color,\n title: title,\n seriesId: seriesId,\n stackGroup: stackGroup,\n }), defaults);\n }\n return toTooltipHtml$1(defaults);\n };\n BarSeries.prototype.getLegendData = function () {\n var _a;\n var _b = this, id = _b.id, data = _b.data, xKey = _b.xKey, yKey = _b.yKey, yName = _b.yName, legendItemName = _b.legendItemName, fill = _b.fill, stroke = _b.stroke, fillOpacity = _b.fillOpacity, strokeOpacity = _b.strokeOpacity, visible = _b.visible, showInLegend = _b.showInLegend;\n if (!showInLegend || !(data === null || data === void 0 ? void 0 : data.length) || !xKey || !yKey) {\n return [];\n }\n var legendData = [];\n legendData.push({\n legendType: 'category',\n id: id,\n itemId: yKey,\n seriesId: id,\n enabled: visible,\n label: {\n text: (_a = legendItemName !== null && legendItemName !== void 0 ? legendItemName : yName) !== null && _a !== void 0 ? _a : yKey,\n },\n legendItemName: legendItemName,\n marker: {\n fill: fill,\n stroke: stroke,\n fillOpacity: fillOpacity,\n strokeOpacity: strokeOpacity,\n },\n });\n return legendData;\n };\n BarSeries.prototype.animateEmptyUpdateReady = function (_a) {\n var _this = this;\n var _b, _c;\n var datumSelections = _a.datumSelections, labelSelections = _a.labelSelections;\n var duration = (_c = (_b = this.ctx.animationManager) === null || _b === void 0 ? void 0 : _b.defaultOptions.duration) !== null && _c !== void 0 ? _c : 1000;\n var labelDuration = 200;\n var _d = this.getDirectionStartingValues(datumSelections), startingX = _d.startingX, startingY = _d.startingY;\n datumSelections.forEach(function (datumSelection) {\n datumSelection.each(function (rect, datum) {\n var _a;\n var contextX = startingX;\n var contextWidth = 0;\n var contextY = datum.y;\n var contextHeight = datum.height;\n if (_this.getBarDirection() === ChartAxisDirection.Y) {\n contextX = datum.x;\n contextWidth = datum.width;\n contextY = startingY;\n contextHeight = 0;\n }\n var props = [\n { from: contextX, to: datum.x },\n { from: contextWidth, to: datum.width },\n { from: contextY, to: datum.y },\n { from: contextHeight, to: datum.height },\n ];\n (_a = _this.ctx.animationManager) === null || _a === void 0 ? void 0 : _a.animateMany(_this.id + \"_empty-update-ready_\" + rect.id, props, {\n duration: duration,\n ease: easeOut,\n onUpdate: function (_a) {\n var _b = __read$x(_a, 4), x = _b[0], width = _b[1], y = _b[2], height = _b[3];\n rect.x = x;\n rect.width = width;\n rect.y = y;\n rect.height = height;\n },\n });\n });\n });\n labelSelections.forEach(function (labelSelection) {\n labelSelection.each(function (label) {\n var _a;\n (_a = _this.ctx.animationManager) === null || _a === void 0 ? void 0 : _a.animate(_this.id + \"_empty-update-ready_\" + label.id, {\n from: 0,\n to: 1,\n delay: duration,\n duration: labelDuration,\n onUpdate: function (opacity) {\n label.opacity = opacity;\n },\n });\n });\n });\n };\n BarSeries.prototype.animateReadyHighlight = function (highlightSelection) {\n this.resetSelectionRects(highlightSelection);\n };\n BarSeries.prototype.animateReadyResize = function (_a) {\n var _this = this;\n var _b;\n var datumSelections = _a.datumSelections;\n (_b = this.ctx.animationManager) === null || _b === void 0 ? void 0 : _b.reset();\n datumSelections.forEach(function (datumSelection) {\n _this.resetSelectionRects(datumSelection);\n });\n };\n BarSeries.prototype.animateWaitingUpdateReady = function (_a) {\n var _this = this;\n var _b, _c, _d, _e, _f;\n var datumSelections = _a.datumSelections, labelSelections = _a.labelSelections;\n var processedData = this.processedData;\n var diff = (_b = processedData === null || processedData === void 0 ? void 0 : processedData.reduced) === null || _b === void 0 ? void 0 : _b.diff;\n if (!(diff === null || diff === void 0 ? void 0 : diff.changed)) {\n datumSelections.forEach(function (datumSelection) {\n _this.resetSelectionRects(datumSelection);\n });\n return;\n }\n var totalDuration = (_d = (_c = this.ctx.animationManager) === null || _c === void 0 ? void 0 : _c.defaultOptions.duration) !== null && _d !== void 0 ? _d : 1000;\n var labelDuration = 200;\n var sectionDuration = totalDuration;\n if (diff.added.length > 0 || diff.removed.length > 0) {\n sectionDuration = Math.floor(totalDuration / 2);\n }\n var _g = this.getDirectionStartingValues(datumSelections), startingX = _g.startingX, startingY = _g.startingY;\n var datumIdKey = (_f = (_e = this.processedData) === null || _e === void 0 ? void 0 : _e.defs.keys) === null || _f === void 0 ? void 0 : _f[0];\n var addedIds = {};\n diff.added.forEach(function (d) {\n addedIds[d[0]] = true;\n });\n var removedIds = {};\n diff.removed.forEach(function (d) {\n removedIds[d[0]] = true;\n });\n var rectThrottleGroup = this.id + \"_\" + Math.random();\n var labelThrottleGroup = this.id + \"_\" + Math.random();\n datumSelections.forEach(function (datumSelection) {\n datumSelection.each(function (rect, datum) {\n var _a;\n var props = [\n { from: rect.x, to: datum.x },\n { from: rect.width, to: datum.width },\n { from: rect.y, to: datum.y },\n { from: rect.height, to: datum.height },\n ];\n var delay = diff.removed.length > 0 ? sectionDuration : 0;\n var duration = sectionDuration;\n var cleanup = false;\n var datumId = datumIdKey ? datum.xValue : '';\n var contextX = startingX;\n var contextWidth = 0;\n var contextY = datum.y;\n var contextHeight = datum.height;\n if (_this.getBarDirection() === ChartAxisDirection.Y) {\n contextX = datum.x;\n contextWidth = datum.width;\n contextY = startingY;\n contextHeight = 0;\n }\n var isAdded = datumId !== undefined && addedIds[datumId] !== undefined;\n var isRemoved = datumId !== undefined && removedIds[datumId] !== undefined;\n if (isAdded) {\n props = [\n { from: contextX, to: datum.x },\n { from: contextWidth, to: datum.width },\n { from: contextY, to: datum.y },\n { from: contextHeight, to: datum.height },\n ];\n duration = sectionDuration;\n }\n else if (isRemoved) {\n props = [\n { from: datum.x, to: contextX },\n { from: datum.width, to: contextWidth },\n { from: datum.y, to: contextY },\n { from: datum.height, to: contextHeight },\n ];\n delay = 0;\n duration = sectionDuration;\n cleanup = true;\n }\n (_a = _this.ctx.animationManager) === null || _a === void 0 ? void 0 : _a.animateManyWithThrottle(_this.id + \"_waiting-update-ready_\" + rect.id, props, {\n delay: delay,\n duration: duration,\n ease: easeOut,\n throttleId: _this.id + \"_rects\",\n throttleGroup: rectThrottleGroup,\n onUpdate: function (_a) {\n var _b = __read$x(_a, 4), x = _b[0], width = _b[1], y = _b[2], height = _b[3];\n rect.x = x;\n rect.width = width;\n rect.y = y;\n rect.height = height;\n },\n onComplete: function () {\n if (cleanup)\n datumSelection.cleanup();\n },\n });\n });\n });\n labelSelections.forEach(function (labelSelection) {\n labelSelection.each(function (label) {\n var _a;\n label.opacity = 0;\n (_a = _this.ctx.animationManager) === null || _a === void 0 ? void 0 : _a.animateWithThrottle(_this.id + \"_waiting-update-ready_\" + label.id, {\n from: 0,\n to: 1,\n delay: totalDuration,\n duration: labelDuration,\n throttleId: _this.id + \"_labels\",\n throttleGroup: labelThrottleGroup,\n onUpdate: function (opacity) {\n label.opacity = opacity;\n },\n });\n });\n });\n };\n BarSeries.prototype.resetSelectionRects = function (selection) {\n selection.each(function (rect, datum) {\n rect.x = datum.x;\n rect.y = datum.y;\n rect.width = datum.width;\n rect.height = datum.height;\n });\n selection.cleanup();\n };\n BarSeries.prototype.getDirectionStartingValues = function (datumSelections) {\n var isColumnSeries = this.getBarDirection() === ChartAxisDirection.Y;\n var xAxis = this.axes[ChartAxisDirection.X];\n var yAxis = this.axes[ChartAxisDirection.Y];\n var isContinuousX = (xAxis === null || xAxis === void 0 ? void 0 : xAxis.scale) instanceof ContinuousScale;\n var isContinuousY = (yAxis === null || yAxis === void 0 ? void 0 : yAxis.scale) instanceof ContinuousScale;\n var startingX = Infinity;\n var startingY = 0;\n if (yAxis && isColumnSeries) {\n if (isContinuousY) {\n startingY = yAxis.scale.convert(0);\n }\n else {\n datumSelections.forEach(function (datumSelection) {\n return datumSelection.each(function (_, datum) {\n if (datum.yValue >= 0) {\n startingY = Math.max(startingY, datum.height + datum.y);\n }\n });\n });\n }\n }\n if (xAxis && !isColumnSeries) {\n if (isContinuousX) {\n startingX = xAxis.scale.convert(0);\n }\n else {\n datumSelections.forEach(function (datumSelection) {\n return datumSelection.each(function (_, datum) {\n if (datum.yValue >= 0) {\n startingX = Math.min(startingX, datum.x);\n }\n });\n });\n }\n }\n return { startingX: startingX, startingY: startingY };\n };\n BarSeries.prototype.isLabelEnabled = function () {\n return this.label.enabled;\n };\n BarSeries.prototype.getBandScalePadding = function () {\n return { inner: 0.2, outer: 0.3 };\n };\n BarSeries.prototype.getBarDirection = function () {\n return ChartAxisDirection.X;\n };\n BarSeries.prototype.getCategoryDirection = function () {\n return ChartAxisDirection.Y;\n };\n BarSeries.className = 'BarSeries';\n BarSeries.type = 'bar';\n __decorate$1o([\n Validate(OPT_COLOR_STRING)\n ], BarSeries.prototype, \"fill\", void 0);\n __decorate$1o([\n Validate(OPT_COLOR_STRING)\n ], BarSeries.prototype, \"stroke\", void 0);\n __decorate$1o([\n Validate(NUMBER(0, 1))\n ], BarSeries.prototype, \"fillOpacity\", void 0);\n __decorate$1o([\n Validate(NUMBER(0, 1))\n ], BarSeries.prototype, \"strokeOpacity\", void 0);\n __decorate$1o([\n Validate(OPT_LINE_DASH)\n ], BarSeries.prototype, \"lineDash\", void 0);\n __decorate$1o([\n Validate(NUMBER(0))\n ], BarSeries.prototype, \"lineDashOffset\", void 0);\n __decorate$1o([\n Validate(OPT_FUNCTION)\n ], BarSeries.prototype, \"formatter\", void 0);\n __decorate$1o([\n Validate(OPT_STRING)\n ], BarSeries.prototype, \"xKey\", void 0);\n __decorate$1o([\n Validate(OPT_STRING)\n ], BarSeries.prototype, \"xName\", void 0);\n __decorate$1o([\n Validate(OPT_STRING)\n ], BarSeries.prototype, \"yKey\", void 0);\n __decorate$1o([\n Validate(OPT_STRING)\n ], BarSeries.prototype, \"yName\", void 0);\n __decorate$1o([\n Validate(OPT_STRING)\n ], BarSeries.prototype, \"stackGroup\", void 0);\n __decorate$1o([\n Validate(OPT_NUMBER())\n ], BarSeries.prototype, \"normalizedTo\", void 0);\n __decorate$1o([\n Validate(NUMBER(0))\n ], BarSeries.prototype, \"strokeWidth\", void 0);\n return BarSeries;\n}(CartesianSeries));\nvar ColumnSeries = /** @class */ (function (_super) {\n __extends$22(ColumnSeries, _super);\n function ColumnSeries() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n ColumnSeries.prototype.getBarDirection = function () {\n return ChartAxisDirection.Y;\n };\n ColumnSeries.prototype.getCategoryDirection = function () {\n return ChartAxisDirection.X;\n };\n ColumnSeries.type = 'column';\n ColumnSeries.className = 'ColumnSeries';\n return ColumnSeries;\n}(BarSeries));\n\nvar __extends$21 = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$1n = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __awaiter$4 = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator$4 = (undefined && undefined.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nvar __read$w = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray$h = (undefined && undefined.__spreadArray) || function (to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\n to[j] = from[i];\n return to;\n};\nvar HISTOGRAM_AGGREGATIONS = ['count', 'sum', 'mean'];\nvar HISTOGRAM_AGGREGATION = predicateWithMessage(function (v) { return HISTOGRAM_AGGREGATIONS.includes(v); }, \"expecting a histogram aggregation keyword such as 'count', 'sum' or 'mean\");\nvar HistogramSeriesNodeTag;\n(function (HistogramSeriesNodeTag) {\n HistogramSeriesNodeTag[HistogramSeriesNodeTag[\"Bin\"] = 0] = \"Bin\";\n HistogramSeriesNodeTag[HistogramSeriesNodeTag[\"Label\"] = 1] = \"Label\";\n})(HistogramSeriesNodeTag || (HistogramSeriesNodeTag = {}));\nvar HistogramSeriesLabel = /** @class */ (function (_super) {\n __extends$21(HistogramSeriesLabel, _super);\n function HistogramSeriesLabel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.formatter = undefined;\n return _this;\n }\n __decorate$1n([\n Validate(OPT_FUNCTION)\n ], HistogramSeriesLabel.prototype, \"formatter\", void 0);\n return HistogramSeriesLabel;\n}(Label$1));\nvar defaultBinCount = 10;\nvar HistogramSeriesTooltip = /** @class */ (function (_super) {\n __extends$21(HistogramSeriesTooltip, _super);\n function HistogramSeriesTooltip() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.renderer = undefined;\n return _this;\n }\n __decorate$1n([\n Validate(OPT_FUNCTION)\n ], HistogramSeriesTooltip.prototype, \"renderer\", void 0);\n return HistogramSeriesTooltip;\n}(SeriesTooltip));\nvar HistogramSeries = /** @class */ (function (_super) {\n __extends$21(HistogramSeries, _super);\n function HistogramSeries(moduleCtx) {\n var _this = _super.call(this, { moduleCtx: moduleCtx, pickModes: [SeriesNodePickMode.EXACT_SHAPE_MATCH] }) || this;\n _this.label = new HistogramSeriesLabel();\n _this.tooltip = new HistogramSeriesTooltip();\n _this.fill = undefined;\n _this.stroke = undefined;\n _this.fillOpacity = 1;\n _this.strokeOpacity = 1;\n _this.lineDash = [0];\n _this.lineDashOffset = 0;\n _this.xKey = undefined;\n _this.areaPlot = false;\n _this.bins = undefined;\n _this.aggregation = 'count';\n _this.binCount = undefined;\n _this.xName = undefined;\n _this.yKey = undefined;\n _this.yName = undefined;\n _this.strokeWidth = 1;\n _this.shadow = undefined;\n _this.calculatedBins = [];\n _this.datumSelectionGarbageCollection = false;\n _this.label.enabled = false;\n return _this;\n }\n // During processData phase, used to unify different ways of the user specifying\n // the bins. Returns bins in format[[min1, max1], [min2, max2], ... ].\n HistogramSeries.prototype.deriveBins = function (xDomain) {\n if (this.binCount === undefined) {\n var binStarts = ticks(xDomain[0], xDomain[1], defaultBinCount);\n var binSize_1 = tickStep(xDomain[0], xDomain[1], defaultBinCount);\n var firstBinEnd = binStarts[0];\n var expandStartToBin = function (n) { return [n, n + binSize_1]; };\n return __spreadArray$h([[firstBinEnd - binSize_1, firstBinEnd]], __read$w(binStarts.map(expandStartToBin)));\n }\n else {\n return this.calculateNiceBins(xDomain, this.binCount);\n }\n };\n HistogramSeries.prototype.calculateNiceBins = function (domain, binCount) {\n var startGuess = Math.floor(domain[0]);\n var stop = domain[1];\n var segments = binCount || 1;\n var _a = this.calculateNiceStart(startGuess, stop, segments), start = _a.start, binSize = _a.binSize;\n return this.getBins(start, stop, binSize, segments);\n };\n HistogramSeries.prototype.getBins = function (start, stop, step, count) {\n var bins = [];\n for (var i = 0; i < count; i++) {\n var a = Math.round((start + i * step) * 10) / 10;\n var b = Math.round((start + (i + 1) * step) * 10) / 10;\n if (i === count - 1) {\n b = Math.max(b, stop);\n }\n bins[i] = [a, b];\n }\n return bins;\n };\n HistogramSeries.prototype.calculateNiceStart = function (a, b, segments) {\n var binSize = Math.abs(b - a) / segments;\n var order = Math.floor(Math.log10(binSize));\n var magnitude = Math.pow(10, order);\n var start = Math.floor(a / magnitude) * magnitude;\n return {\n start: start,\n binSize: binSize,\n };\n };\n HistogramSeries.prototype.processData = function (dataController) {\n var _a;\n return __awaiter$4(this, void 0, void 0, function () {\n var _b, xKey, yKey, data, areaPlot, aggregation, props, aggProp, aggProp, groupByFn, _c, dataModel, processedData;\n var _this = this;\n return __generator$4(this, function (_d) {\n switch (_d.label) {\n case 0:\n _b = this, xKey = _b.xKey, yKey = _b.yKey, data = _b.data, areaPlot = _b.areaPlot, aggregation = _b.aggregation;\n props = [keyProperty(this, xKey, true), SORT_DOMAIN_GROUPS];\n if (yKey) {\n aggProp = groupCount(this, 'groupCount');\n if (aggregation === 'count') ;\n else if (aggregation === 'sum') {\n aggProp = groupSum(this, 'groupAgg');\n }\n else if (aggregation === 'mean') {\n aggProp = groupAverage(this, 'groupAgg');\n }\n if (areaPlot) {\n aggProp = area(this, 'groupAgg', aggProp);\n }\n props.push(valueProperty(this, yKey, true, { invalidValue: undefined }), aggProp);\n }\n else {\n aggProp = groupCount(this, 'groupAgg');\n if (areaPlot) {\n aggProp = area(this, 'groupAgg', aggProp);\n }\n props.push(aggProp);\n }\n groupByFn = function (dataSet) {\n var _a;\n var xExtent = fixNumericExtent(dataSet.domain.keys[0]);\n if (xExtent.length === 0) {\n // No buckets can be calculated.\n dataSet.domain.groups = [];\n return function () { return []; };\n }\n var bins = (_a = _this.bins) !== null && _a !== void 0 ? _a : _this.deriveBins(xExtent);\n var binCount = bins.length;\n _this.calculatedBins = __spreadArray$h([], __read$w(bins));\n return function (item) {\n var xValue = item.keys[0];\n for (var i = 0; i < binCount; i++) {\n var nextBin = bins[i];\n if (xValue >= nextBin[0] && xValue < nextBin[1]) {\n return nextBin;\n }\n if (i === binCount - 1 && xValue <= nextBin[1]) {\n // Handle edge case of a value being at the maximum extent, and the\n // final bin aligning with it.\n return nextBin;\n }\n }\n return [];\n };\n };\n if (!((_a = this.ctx.animationManager) === null || _a === void 0 ? void 0 : _a.skipAnimations) && this.processedData) {\n props.push(diff(this.processedData, false));\n }\n return [4 /*yield*/, dataController.request(this.id, data !== null && data !== void 0 ? data : [], {\n props: props,\n dataVisible: this.visible,\n groupByFn: groupByFn,\n })];\n case 1:\n _c = _d.sent(), dataModel = _c.dataModel, processedData = _c.processedData;\n this.dataModel = dataModel;\n this.processedData = processedData;\n this.animationState.transition('updateData');\n return [2 /*return*/];\n }\n });\n });\n };\n HistogramSeries.prototype.getDomain = function (direction) {\n var _a, _b, _c, _d;\n var _e = this, processedData = _e.processedData, dataModel = _e.dataModel;\n if (!processedData || !dataModel)\n return [];\n var yDomain = dataModel.getDomain(this, \"groupAgg\", 'aggregate', processedData);\n var xDomainMin = (_a = this.calculatedBins) === null || _a === void 0 ? void 0 : _a[0][0];\n var xDomainMax = (_b = this.calculatedBins) === null || _b === void 0 ? void 0 : _b[((_d = (_c = this.calculatedBins) === null || _c === void 0 ? void 0 : _c.length) !== null && _d !== void 0 ? _d : 0) - 1][1];\n if (direction === ChartAxisDirection.X) {\n return fixNumericExtent([xDomainMin, xDomainMax]);\n }\n return fixNumericExtent(yDomain);\n };\n HistogramSeries.prototype.getNodeClickEvent = function (event, datum) {\n var _a, _b;\n return new CartesianSeriesNodeClickEvent((_a = this.xKey) !== null && _a !== void 0 ? _a : '', (_b = this.yKey) !== null && _b !== void 0 ? _b : '', event, datum, this);\n };\n HistogramSeries.prototype.getNodeDoubleClickEvent = function (event, datum) {\n var _a, _b;\n return new CartesianSeriesNodeDoubleClickEvent((_a = this.xKey) !== null && _a !== void 0 ? _a : '', (_b = this.yKey) !== null && _b !== void 0 ? _b : '', event, datum, this);\n };\n HistogramSeries.prototype.createNodeData = function () {\n var _a;\n return __awaiter$4(this, void 0, void 0, function () {\n var _b, axes, processedData, callbackCache, xAxis, yAxis, xScale, yScale, _c, fill, stroke, strokeWidth, seriesId, _d, yKey, _e, xKey, nodeData, defaultLabelFormatter, _f, _g, labelFormatter, labelFontStyle, labelFontWeight, labelFontSize, labelFontFamily, labelColor;\n var _this = this;\n return __generator$4(this, function (_h) {\n _b = this, axes = _b.axes, processedData = _b.processedData, callbackCache = _b.ctx.callbackCache;\n xAxis = axes[ChartAxisDirection.X];\n yAxis = axes[ChartAxisDirection.Y];\n if (!this.visible || !xAxis || !yAxis || !processedData || processedData.type !== 'grouped') {\n return [2 /*return*/, []];\n }\n xScale = xAxis.scale;\n yScale = yAxis.scale;\n _c = this, fill = _c.fill, stroke = _c.stroke, strokeWidth = _c.strokeWidth, seriesId = _c.id, _d = _c.yKey, yKey = _d === void 0 ? '' : _d, _e = _c.xKey, xKey = _e === void 0 ? '' : _e;\n nodeData = [];\n defaultLabelFormatter = function (params) { return String(params.value); };\n _f = this.label, _g = _f.formatter, labelFormatter = _g === void 0 ? defaultLabelFormatter : _g, labelFontStyle = _f.fontStyle, labelFontWeight = _f.fontWeight, labelFontSize = _f.fontSize, labelFontFamily = _f.fontFamily, labelColor = _f.color;\n processedData.data.forEach(function (group) {\n var _a;\n var _b = group.aggValues, _c = _b === void 0 ? [[0, 0]] : _b, _d = __read$w(_c, 1), _e = __read$w(_d[0], 2), negativeAgg = _e[0], positiveAgg = _e[1], datum = group.datum, frequency = group.datum.length, domain = group.keys, _f = __read$w(group.keys, 2), xDomainMin = _f[0], xDomainMax = _f[1];\n var xMinPx = xScale.convert(xDomainMin);\n var xMaxPx = xScale.convert(xDomainMax);\n var total = negativeAgg + positiveAgg;\n var yZeroPx = yScale.convert(0);\n var yMaxPx = yScale.convert(total);\n var w = xMaxPx - xMinPx;\n var h = Math.abs(yMaxPx - yZeroPx);\n var selectionDatumLabel = total !== 0\n ? {\n text: (_a = callbackCache.call(labelFormatter, { value: total, seriesId: seriesId })) !== null && _a !== void 0 ? _a : String(total),\n fontStyle: labelFontStyle,\n fontWeight: labelFontWeight,\n fontSize: labelFontSize,\n fontFamily: labelFontFamily,\n fill: labelColor,\n x: xMinPx + w / 2,\n y: yMaxPx + h / 2,\n }\n : undefined;\n var nodeMidPoint = {\n x: xMinPx + w / 2,\n y: yMaxPx + h / 2,\n };\n nodeData.push({\n series: _this,\n datum: datum,\n // since each selection is an aggregation of multiple data.\n aggregatedValue: total,\n frequency: frequency,\n domain: domain,\n yKey: yKey,\n xKey: xKey,\n x: xMinPx,\n y: yMaxPx,\n xValue: xMinPx,\n yValue: yMaxPx,\n width: w,\n height: h,\n nodeMidPoint: nodeMidPoint,\n fill: fill,\n stroke: stroke,\n strokeWidth: strokeWidth,\n label: selectionDatumLabel,\n });\n });\n return [2 /*return*/, [{ itemId: (_a = this.yKey) !== null && _a !== void 0 ? _a : this.id, nodeData: nodeData, labelData: nodeData }]];\n });\n });\n };\n HistogramSeries.prototype.nodeFactory = function () {\n return new Rect();\n };\n HistogramSeries.prototype.updateDatumSelection = function (opts) {\n return __awaiter$4(this, void 0, void 0, function () {\n var nodeData, datumSelection;\n return __generator$4(this, function (_a) {\n nodeData = opts.nodeData, datumSelection = opts.datumSelection;\n return [2 /*return*/, datumSelection.update(nodeData, function (rect) {\n rect.tag = HistogramSeriesNodeTag.Bin;\n rect.crisp = true;\n }, function (datum) { return datum.domain.join('_'); })];\n });\n });\n };\n HistogramSeries.prototype.updateDatumNodes = function (opts) {\n return __awaiter$4(this, void 0, void 0, function () {\n var datumSelection, isDatumHighlighted, _a, seriesFillOpacity, strokeOpacity, shadow, _b, highlightedFill, _c, highlightFillOpacity, highlightedStroke, highlightedDatumStrokeWidth;\n var _this = this;\n return __generator$4(this, function (_d) {\n datumSelection = opts.datumSelection, isDatumHighlighted = opts.isHighlight;\n _a = this, seriesFillOpacity = _a.fillOpacity, strokeOpacity = _a.strokeOpacity, shadow = _a.shadow, _b = _a.highlightStyle.item, highlightedFill = _b.fill, _c = _b.fillOpacity, highlightFillOpacity = _c === void 0 ? seriesFillOpacity : _c, highlightedStroke = _b.stroke, highlightedDatumStrokeWidth = _b.strokeWidth;\n datumSelection.each(function (rect, datum, index) {\n var _a, _b;\n var strokeWidth = isDatumHighlighted && highlightedDatumStrokeWidth !== undefined\n ? highlightedDatumStrokeWidth\n : datum.strokeWidth;\n var fillOpacity = isDatumHighlighted ? highlightFillOpacity : seriesFillOpacity;\n rect.fill = (_a = (isDatumHighlighted ? highlightedFill : undefined)) !== null && _a !== void 0 ? _a : datum.fill;\n rect.stroke = (_b = (isDatumHighlighted ? highlightedStroke : undefined)) !== null && _b !== void 0 ? _b : datum.stroke;\n rect.fillOpacity = fillOpacity;\n rect.strokeOpacity = strokeOpacity;\n rect.strokeWidth = strokeWidth;\n rect.lineDash = _this.lineDash;\n rect.lineDashOffset = _this.lineDashOffset;\n rect.fillShadow = shadow;\n rect.zIndex = isDatumHighlighted ? Series.highlightedZIndex : index;\n rect.visible = datum.height > 0; // prevent stroke from rendering for zero height columns\n });\n return [2 /*return*/];\n });\n });\n };\n HistogramSeries.prototype.updateLabelSelection = function (opts) {\n return __awaiter$4(this, void 0, void 0, function () {\n var labelData, labelSelection;\n return __generator$4(this, function (_a) {\n labelData = opts.labelData, labelSelection = opts.labelSelection;\n return [2 /*return*/, labelSelection.update(labelData, function (text) {\n text.tag = HistogramSeriesNodeTag.Label;\n text.pointerEvents = PointerEvents.None;\n text.textAlign = 'center';\n text.textBaseline = 'middle';\n })];\n });\n });\n };\n HistogramSeries.prototype.updateLabelNodes = function (opts) {\n return __awaiter$4(this, void 0, void 0, function () {\n var labelSelection, labelEnabled;\n return __generator$4(this, function (_a) {\n labelSelection = opts.labelSelection;\n labelEnabled = this.label.enabled;\n labelSelection.each(function (text, datum) {\n var label = datum.label;\n if (label && labelEnabled) {\n text.text = label.text;\n text.x = label.x;\n text.y = label.y;\n text.fontStyle = label.fontStyle;\n text.fontWeight = label.fontWeight;\n text.fontSize = label.fontSize;\n text.fontFamily = label.fontFamily;\n text.fill = label.fill;\n text.visible = true;\n }\n else {\n text.visible = false;\n }\n });\n return [2 /*return*/];\n });\n });\n };\n HistogramSeries.prototype.getTooltipHtml = function (nodeDatum) {\n var _a = this, xKey = _a.xKey, _b = _a.yKey, yKey = _b === void 0 ? '' : _b, axes = _a.axes;\n var xAxis = axes[ChartAxisDirection.X];\n var yAxis = axes[ChartAxisDirection.Y];\n if (!xKey || !xAxis || !yAxis) {\n return '';\n }\n var _c = this, xName = _c.xName, yName = _c.yName, color = _c.fill, tooltip = _c.tooltip, aggregation = _c.aggregation, seriesId = _c.id;\n var tooltipRenderer = tooltip.renderer;\n var aggregatedValue = nodeDatum.aggregatedValue, frequency = nodeDatum.frequency, domain = nodeDatum.domain, _d = __read$w(nodeDatum.domain, 2), rangeMin = _d[0], rangeMax = _d[1];\n var title = sanitizeHtml(xName !== null && xName !== void 0 ? xName : xKey) + \": \" + xAxis.formatDatum(rangeMin) + \" - \" + xAxis.formatDatum(rangeMax);\n var content = yKey\n ? \"\" + sanitizeHtml(yName !== null && yName !== void 0 ? yName : yKey) + \" (\" + aggregation + \"): \" + yAxis.formatDatum(aggregatedValue) + \"
\"\n : '';\n content += \"Frequency: \" + frequency;\n var defaults = {\n title: title,\n backgroundColor: color,\n content: content,\n };\n if (tooltipRenderer) {\n return toTooltipHtml$1(tooltipRenderer({\n datum: {\n data: nodeDatum.datum,\n aggregatedValue: nodeDatum.aggregatedValue,\n domain: nodeDatum.domain,\n frequency: nodeDatum.frequency,\n },\n xKey: xKey,\n xValue: domain,\n xName: xName,\n yKey: yKey,\n yValue: aggregatedValue,\n yName: yName,\n color: color,\n title: title,\n seriesId: seriesId,\n }), defaults);\n }\n return toTooltipHtml$1(defaults);\n };\n HistogramSeries.prototype.getLegendData = function () {\n var _a;\n var _b = this, id = _b.id, data = _b.data, xKey = _b.xKey, yName = _b.yName, visible = _b.visible, fill = _b.fill, stroke = _b.stroke, fillOpacity = _b.fillOpacity, strokeOpacity = _b.strokeOpacity;\n if (!data || data.length === 0) {\n return [];\n }\n var legendData = [\n {\n legendType: 'category',\n id: id,\n itemId: xKey,\n seriesId: id,\n enabled: visible,\n label: {\n text: (_a = yName !== null && yName !== void 0 ? yName : xKey) !== null && _a !== void 0 ? _a : 'Frequency',\n },\n marker: {\n fill: fill !== null && fill !== void 0 ? fill : 'rgba(0, 0, 0, 0)',\n stroke: stroke !== null && stroke !== void 0 ? stroke : 'rgba(0, 0, 0, 0)',\n fillOpacity: fillOpacity,\n strokeOpacity: strokeOpacity,\n },\n },\n ];\n return legendData;\n };\n HistogramSeries.prototype.animateEmptyUpdateReady = function (_a) {\n var _this = this;\n var _b, _c;\n var datumSelections = _a.datumSelections, labelSelections = _a.labelSelections;\n var duration = (_c = (_b = this.ctx.animationManager) === null || _b === void 0 ? void 0 : _b.defaultOptions.duration) !== null && _c !== void 0 ? _c : 1000;\n var labelDuration = 200;\n var startingY = 0;\n datumSelections.forEach(function (datumSelection) {\n return datumSelection.each(function (_, datum) {\n startingY = Math.max(startingY, datum.height + datum.y);\n });\n });\n datumSelections.forEach(function (datumSelection) {\n datumSelection.each(function (rect, datum) {\n var _a;\n (_a = _this.ctx.animationManager) === null || _a === void 0 ? void 0 : _a.animateMany(_this.id + \"_empty-update-ready_\" + rect.id, [\n { from: startingY, to: datum.y },\n { from: 0, to: datum.height },\n ], {\n duration: duration,\n ease: easeOut,\n onUpdate: function (_a) {\n var _b = __read$w(_a, 2), y = _b[0], height = _b[1];\n rect.y = y;\n rect.height = height;\n rect.x = datum.x;\n rect.width = datum.width;\n },\n });\n });\n });\n labelSelections.forEach(function (labelSelection) {\n labelSelection.each(function (label) {\n var _a;\n (_a = _this.ctx.animationManager) === null || _a === void 0 ? void 0 : _a.animate(_this.id + \"_empty-update-ready_\" + label.id, {\n from: 0,\n to: 1,\n delay: duration,\n duration: labelDuration,\n onUpdate: function (opacity) {\n label.opacity = opacity;\n },\n });\n });\n });\n };\n HistogramSeries.prototype.animateReadyUpdate = function (_a) {\n var _this = this;\n var datumSelections = _a.datumSelections;\n datumSelections.forEach(function (datumSelection) {\n _this.resetSelectionRects(datumSelection);\n });\n };\n HistogramSeries.prototype.animateReadyHighlight = function (highlightSelection) {\n this.resetSelectionRects(highlightSelection);\n };\n HistogramSeries.prototype.animateReadyResize = function (_a) {\n var _this = this;\n var _b;\n var datumSelections = _a.datumSelections;\n (_b = this.ctx.animationManager) === null || _b === void 0 ? void 0 : _b.reset();\n datumSelections.forEach(function (datumSelection) {\n _this.resetSelectionRects(datumSelection);\n });\n };\n HistogramSeries.prototype.animateWaitingUpdateReady = function (_a) {\n var _this = this;\n var _b, _c, _d;\n var datumSelections = _a.datumSelections, labelSelections = _a.labelSelections;\n var processedData = this.processedData;\n var diff = (_b = processedData === null || processedData === void 0 ? void 0 : processedData.reduced) === null || _b === void 0 ? void 0 : _b.diff;\n if (!(diff === null || diff === void 0 ? void 0 : diff.changed)) {\n datumSelections.forEach(function (datumSelection) {\n _this.resetSelectionRects(datumSelection);\n });\n return;\n }\n var totalDuration = (_d = (_c = this.ctx.animationManager) === null || _c === void 0 ? void 0 : _c.defaultOptions.duration) !== null && _d !== void 0 ? _d : 1000;\n var labelDuration = 200;\n var sectionDuration = totalDuration;\n if (diff.added.length > 0 && diff.removed.length > 0) {\n sectionDuration = Math.floor(totalDuration / 3);\n }\n else if (diff.added.length > 0 || diff.removed.length > 0) {\n sectionDuration = Math.floor(totalDuration / 2);\n }\n var startingY = 0;\n datumSelections.forEach(function (datumSelection) {\n return datumSelection.each(function (_, datum) {\n startingY = Math.max(startingY, datum.height + datum.y);\n });\n });\n var addedIds = {};\n diff.added.forEach(function (d) {\n addedIds[d.join('_')] = true;\n });\n var removedIds = {};\n diff.removed.forEach(function (d) {\n removedIds[d.join('_')] = true;\n });\n datumSelections.forEach(function (datumSelection) {\n datumSelection.each(function (rect, datum) {\n var _a;\n var props = [\n { from: rect.x, to: datum.x },\n { from: rect.width, to: datum.width },\n { from: rect.y, to: datum.y },\n { from: rect.height, to: datum.height },\n ];\n var delay = diff.removed.length > 0 ? sectionDuration : 0;\n var cleanup = false;\n var datumId = datum.domain.join('_');\n var contextY = startingY;\n var contextHeight = 0;\n if (datumId !== undefined && addedIds[datumId] !== undefined) {\n props = [\n { from: datum.x, to: datum.x },\n { from: datum.width, to: datum.width },\n { from: contextY, to: datum.y },\n { from: contextHeight, to: datum.height },\n ];\n delay += sectionDuration;\n }\n else if (datumId !== undefined && removedIds[datumId] !== undefined) {\n props = [\n { from: rect.x, to: datum.x },\n { from: rect.width, to: datum.width },\n { from: datum.y, to: contextY },\n { from: datum.height, to: contextHeight },\n ];\n delay = 0;\n cleanup = true;\n }\n (_a = _this.ctx.animationManager) === null || _a === void 0 ? void 0 : _a.animateMany(_this.id + \"_waiting-update-ready_\" + rect.id, props, {\n disableInteractions: true,\n delay: delay,\n duration: sectionDuration,\n ease: easeOut,\n repeat: 0,\n onUpdate: function (_a) {\n var _b = __read$w(_a, 4), x = _b[0], width = _b[1], y = _b[2], height = _b[3];\n rect.x = x;\n rect.width = width;\n rect.y = y;\n rect.height = height;\n },\n onComplete: function () {\n if (cleanup)\n datumSelection.cleanup();\n },\n });\n });\n });\n labelSelections.forEach(function (labelSelection) {\n labelSelection.each(function (label) {\n var _a;\n label.opacity = 0;\n (_a = _this.ctx.animationManager) === null || _a === void 0 ? void 0 : _a.animate(_this.id + \"_waiting-update-ready_\" + label.id, {\n from: 0,\n to: 1,\n delay: totalDuration,\n duration: labelDuration,\n ease: linear,\n repeat: 0,\n onUpdate: function (opacity) {\n label.opacity = opacity;\n },\n });\n });\n });\n };\n HistogramSeries.prototype.resetSelectionRects = function (selection) {\n selection.each(function (rect, datum) {\n rect.x = datum.x;\n rect.y = datum.y;\n rect.width = datum.width;\n rect.height = datum.height;\n });\n };\n HistogramSeries.prototype.isLabelEnabled = function () {\n return this.label.enabled;\n };\n HistogramSeries.className = 'HistogramSeries';\n HistogramSeries.type = 'histogram';\n __decorate$1n([\n Validate(OPT_COLOR_STRING)\n ], HistogramSeries.prototype, \"fill\", void 0);\n __decorate$1n([\n Validate(OPT_COLOR_STRING)\n ], HistogramSeries.prototype, \"stroke\", void 0);\n __decorate$1n([\n Validate(NUMBER(0, 1))\n ], HistogramSeries.prototype, \"fillOpacity\", void 0);\n __decorate$1n([\n Validate(NUMBER(0, 1))\n ], HistogramSeries.prototype, \"strokeOpacity\", void 0);\n __decorate$1n([\n Validate(OPT_LINE_DASH)\n ], HistogramSeries.prototype, \"lineDash\", void 0);\n __decorate$1n([\n Validate(NUMBER(0))\n ], HistogramSeries.prototype, \"lineDashOffset\", void 0);\n __decorate$1n([\n Validate(OPT_STRING)\n ], HistogramSeries.prototype, \"xKey\", void 0);\n __decorate$1n([\n Validate(BOOLEAN)\n ], HistogramSeries.prototype, \"areaPlot\", void 0);\n __decorate$1n([\n Validate(OPT_ARRAY())\n ], HistogramSeries.prototype, \"bins\", void 0);\n __decorate$1n([\n Validate(HISTOGRAM_AGGREGATION)\n ], HistogramSeries.prototype, \"aggregation\", void 0);\n __decorate$1n([\n Validate(OPT_NUMBER(0))\n ], HistogramSeries.prototype, \"binCount\", void 0);\n __decorate$1n([\n Validate(OPT_STRING)\n ], HistogramSeries.prototype, \"xName\", void 0);\n __decorate$1n([\n Validate(OPT_STRING)\n ], HistogramSeries.prototype, \"yKey\", void 0);\n __decorate$1n([\n Validate(OPT_STRING)\n ], HistogramSeries.prototype, \"yName\", void 0);\n __decorate$1n([\n Validate(NUMBER(0))\n ], HistogramSeries.prototype, \"strokeWidth\", void 0);\n return HistogramSeries;\n}(CartesianSeries));\n\nvar __extends$20 = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign$y = (undefined && undefined.__assign) || function () {\n __assign$y = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$y.apply(this, arguments);\n};\nvar __decorate$1m = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __awaiter$3 = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator$3 = (undefined && undefined.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nvar __read$v = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar LineSeriesLabel = /** @class */ (function (_super) {\n __extends$20(LineSeriesLabel, _super);\n function LineSeriesLabel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.formatter = undefined;\n return _this;\n }\n __decorate$1m([\n Validate(OPT_FUNCTION)\n ], LineSeriesLabel.prototype, \"formatter\", void 0);\n return LineSeriesLabel;\n}(Label$1));\nvar LineSeriesTooltip = /** @class */ (function (_super) {\n __extends$20(LineSeriesTooltip, _super);\n function LineSeriesTooltip() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.renderer = undefined;\n _this.format = undefined;\n return _this;\n }\n __decorate$1m([\n Validate(OPT_FUNCTION)\n ], LineSeriesTooltip.prototype, \"renderer\", void 0);\n __decorate$1m([\n Validate(OPT_STRING)\n ], LineSeriesTooltip.prototype, \"format\", void 0);\n return LineSeriesTooltip;\n}(SeriesTooltip));\nvar LineSeries = /** @class */ (function (_super) {\n __extends$20(LineSeries, _super);\n function LineSeries(moduleCtx) {\n var _this = _super.call(this, {\n moduleCtx: moduleCtx,\n hasMarkers: true,\n pickModes: [\n SeriesNodePickMode.NEAREST_BY_MAIN_CATEGORY_AXIS_FIRST,\n SeriesNodePickMode.NEAREST_NODE,\n SeriesNodePickMode.EXACT_SHAPE_MATCH,\n ],\n }) || this;\n _this.marker = new CartesianSeriesMarker();\n _this.label = new LineSeriesLabel();\n _this.title = undefined;\n _this.stroke = '#874349';\n _this.lineDash = [0];\n _this.lineDashOffset = 0;\n _this.strokeWidth = 2;\n _this.strokeOpacity = 1;\n _this.tooltip = new LineSeriesTooltip();\n _this.xKey = undefined;\n _this.xName = undefined;\n _this.yKey = undefined;\n _this.yName = undefined;\n var _a = _this, marker = _a.marker, label = _a.label;\n marker.fill = '#c16068';\n marker.stroke = '#874349';\n label.enabled = false;\n return _this;\n }\n LineSeries.prototype.processData = function (dataController) {\n return __awaiter$3(this, void 0, void 0, function () {\n var _a, axes, _b, xKey, _c, yKey, data, xAxis, yAxis, isContinuousX, isContinuousY, _d, dataModel, processedData;\n return __generator$3(this, function (_e) {\n switch (_e.label) {\n case 0:\n _a = this, axes = _a.axes, _b = _a.xKey, xKey = _b === void 0 ? '' : _b, _c = _a.yKey, yKey = _c === void 0 ? '' : _c;\n data = xKey && yKey && this.data ? this.data : [];\n xAxis = axes[ChartAxisDirection.X];\n yAxis = axes[ChartAxisDirection.Y];\n isContinuousX = (xAxis === null || xAxis === void 0 ? void 0 : xAxis.scale) instanceof ContinuousScale;\n isContinuousY = (yAxis === null || yAxis === void 0 ? void 0 : yAxis.scale) instanceof ContinuousScale;\n return [4 /*yield*/, dataController.request(this.id, data !== null && data !== void 0 ? data : [], {\n props: [\n valueProperty(this, xKey, isContinuousX, { id: 'xValue' }),\n valueProperty(this, yKey, isContinuousY, { id: 'yValue', invalidValue: undefined }),\n ],\n dataVisible: this.visible,\n })];\n case 1:\n _d = _e.sent(), dataModel = _d.dataModel, processedData = _d.processedData;\n this.dataModel = dataModel;\n this.processedData = processedData;\n return [2 /*return*/];\n }\n });\n });\n };\n LineSeries.prototype.getDomain = function (direction) {\n var _a = this, axes = _a.axes, dataModel = _a.dataModel, processedData = _a.processedData;\n if (!processedData || !dataModel)\n return [];\n var xAxis = axes[ChartAxisDirection.X];\n var yAxis = axes[ChartAxisDirection.Y];\n var xDef = dataModel.resolveProcessedDataDefById(this, \"xValue\");\n if (direction === ChartAxisDirection.X) {\n var domain = dataModel.getDomain(this, \"xValue\", 'value', processedData);\n if ((xDef === null || xDef === void 0 ? void 0 : xDef.def.type) === 'value' && xDef.def.valueType === 'category') {\n return domain;\n }\n return this.fixNumericExtent(extent$4(domain), xAxis);\n }\n else {\n var domain = dataModel.getDomain(this, \"yValue\", 'value', processedData);\n return this.fixNumericExtent(domain, yAxis);\n }\n };\n LineSeries.prototype.createNodeData = function () {\n var _a, _b, _c, _d, _e;\n return __awaiter$3(this, void 0, void 0, function () {\n var _f, processedData, dataModel, axes, _g, markerEnabled, markerSize, strokeWidth, callbackCache, xAxis, yAxis, _h, label, _j, yKey, _k, xKey, seriesId, xScale, yScale, xOffset, yOffset, nodeData, size, xIdx, yIdx, moveTo, prevXInRange, nextPoint, actualLength, i, _l, datum, values, xDatum, yDatum, x, tolerance, nextXDatum, xInRange, nextXInRange, y, labelText;\n return __generator$3(this, function (_m) {\n _f = this, processedData = _f.processedData, dataModel = _f.dataModel, axes = _f.axes, _g = _f.marker, markerEnabled = _g.enabled, markerSize = _g.size, strokeWidth = _g.strokeWidth, callbackCache = _f.ctx.callbackCache;\n xAxis = axes[ChartAxisDirection.X];\n yAxis = axes[ChartAxisDirection.Y];\n if (!processedData || !dataModel || !xAxis || !yAxis) {\n return [2 /*return*/, []];\n }\n _h = this, label = _h.label, _j = _h.yKey, yKey = _j === void 0 ? '' : _j, _k = _h.xKey, xKey = _k === void 0 ? '' : _k, seriesId = _h.id;\n xScale = xAxis.scale;\n yScale = yAxis.scale;\n xOffset = ((_a = xScale.bandwidth) !== null && _a !== void 0 ? _a : 0) / 2;\n yOffset = ((_b = yScale.bandwidth) !== null && _b !== void 0 ? _b : 0) / 2;\n nodeData = new Array(processedData.data.length);\n size = markerEnabled ? markerSize : 0;\n xIdx = dataModel.resolveProcessedDataIndexById(this, \"xValue\").index;\n yIdx = dataModel.resolveProcessedDataIndexById(this, \"yValue\").index;\n moveTo = true;\n prevXInRange = undefined;\n nextPoint = undefined;\n actualLength = 0;\n for (i = 0; i < processedData.data.length; i++) {\n _l = nextPoint !== null && nextPoint !== void 0 ? nextPoint : processedData.data[i], datum = _l.datum, values = _l.values;\n xDatum = values[xIdx];\n yDatum = values[yIdx];\n if (yDatum === undefined) {\n prevXInRange = undefined;\n moveTo = true;\n }\n else {\n x = xScale.convert(xDatum) + xOffset;\n if (isNaN(x)) {\n prevXInRange = undefined;\n moveTo = true;\n nextPoint = undefined;\n continue;\n }\n tolerance = ((_c = xScale.bandwidth) !== null && _c !== void 0 ? _c : markerSize * 0.5 + (strokeWidth !== null && strokeWidth !== void 0 ? strokeWidth : 0)) + 1;\n nextPoint =\n ((_d = processedData.data[i + 1]) === null || _d === void 0 ? void 0 : _d.values[yIdx]) === undefined ? undefined : processedData.data[i + 1];\n nextXDatum = (_e = processedData.data[i + 1]) === null || _e === void 0 ? void 0 : _e.values[xIdx];\n xInRange = xAxis.inRangeEx(x, 0, tolerance);\n nextXInRange = nextPoint && xAxis.inRangeEx(xScale.convert(nextXDatum) + xOffset, 0, tolerance);\n if (xInRange === -1 && nextXInRange === -1) {\n moveTo = true;\n continue;\n }\n if (xInRange === 1 && prevXInRange === 1) {\n moveTo = true;\n continue;\n }\n prevXInRange = xInRange;\n y = yScale.convert(yDatum) + yOffset;\n labelText = void 0;\n if (label.formatter) {\n labelText = callbackCache.call(label.formatter, { value: yDatum, seriesId: seriesId });\n }\n if (labelText !== undefined) ;\n else if (typeof yDatum === 'number' && isFinite(yDatum)) {\n labelText = yDatum.toFixed(2);\n }\n else if (yDatum) {\n labelText = String(yDatum);\n }\n nodeData[actualLength++] = {\n series: this,\n datum: datum,\n yKey: yKey,\n xKey: xKey,\n point: { x: x, y: y, moveTo: moveTo, size: size },\n nodeMidPoint: { x: x, y: y },\n yValue: yDatum,\n xValue: xDatum,\n label: labelText\n ? {\n text: labelText,\n fontStyle: label.fontStyle,\n fontWeight: label.fontWeight,\n fontSize: label.fontSize,\n fontFamily: label.fontFamily,\n textAlign: 'center',\n textBaseline: 'bottom',\n fill: label.color,\n }\n : undefined,\n };\n moveTo = false;\n }\n }\n nodeData.length = actualLength;\n return [2 /*return*/, [{ itemId: yKey, nodeData: nodeData, labelData: nodeData }]];\n });\n });\n };\n LineSeries.prototype.isPathOrSelectionDirty = function () {\n return this.marker.isDirty();\n };\n LineSeries.prototype.markerFactory = function () {\n var shape = this.marker.shape;\n var MarkerShape = getMarker$1(shape);\n return new MarkerShape();\n };\n LineSeries.prototype.updateMarkerSelection = function (opts) {\n return __awaiter$3(this, void 0, void 0, function () {\n var nodeData, markerSelection, _a, shape, enabled;\n return __generator$3(this, function (_b) {\n nodeData = opts.nodeData;\n markerSelection = opts.markerSelection;\n _a = this.marker, shape = _a.shape, enabled = _a.enabled;\n nodeData = shape && enabled ? nodeData : [];\n if (this.marker.isDirty()) {\n markerSelection.clear();\n }\n return [2 /*return*/, markerSelection.update(nodeData)];\n });\n });\n };\n LineSeries.prototype.updateMarkerNodes = function (opts) {\n var _a;\n return __awaiter$3(this, void 0, void 0, function () {\n var markerSelection, isDatumHighlighted, _b, marker, markerFillOpacity, _c, xKey, _d, yKey, lineStroke, strokeOpacity, _e, highlightedFill, _f, highlightFillOpacity, highlightedStroke, highlightedDatumStrokeWidth, seriesId, callbackCache, size, formatter, markerStrokeWidth, customMarker;\n return __generator$3(this, function (_g) {\n markerSelection = opts.markerSelection, isDatumHighlighted = opts.isHighlight;\n _b = this, marker = _b.marker, markerFillOpacity = _b.marker.fillOpacity, _c = _b.xKey, xKey = _c === void 0 ? '' : _c, _d = _b.yKey, yKey = _d === void 0 ? '' : _d, lineStroke = _b.stroke, strokeOpacity = _b.strokeOpacity, _e = _b.highlightStyle.item, highlightedFill = _e.fill, _f = _e.fillOpacity, highlightFillOpacity = _f === void 0 ? markerFillOpacity : _f, highlightedStroke = _e.stroke, highlightedDatumStrokeWidth = _e.strokeWidth, seriesId = _b.id, callbackCache = _b.ctx.callbackCache;\n size = marker.size, formatter = marker.formatter;\n markerStrokeWidth = (_a = marker.strokeWidth) !== null && _a !== void 0 ? _a : this.strokeWidth;\n customMarker = typeof marker.shape === 'function';\n markerSelection.each(function (node, datum) {\n var _a, _b, _c, _d, _e, _f, _g;\n var fill = isDatumHighlighted && highlightedFill !== undefined ? highlightedFill : marker.fill;\n var fillOpacity = isDatumHighlighted ? highlightFillOpacity : markerFillOpacity;\n var stroke = isDatumHighlighted && highlightedStroke !== undefined ? highlightedStroke : (_a = marker.stroke) !== null && _a !== void 0 ? _a : lineStroke;\n var strokeWidth = isDatumHighlighted && highlightedDatumStrokeWidth !== undefined\n ? highlightedDatumStrokeWidth\n : markerStrokeWidth;\n var format = undefined;\n if (formatter) {\n format = callbackCache.call(formatter, {\n datum: datum.datum,\n xKey: xKey,\n yKey: yKey,\n fill: fill,\n stroke: stroke,\n strokeWidth: strokeWidth,\n size: size,\n highlighted: isDatumHighlighted,\n seriesId: seriesId,\n });\n }\n node.fill = (_b = format === null || format === void 0 ? void 0 : format.fill) !== null && _b !== void 0 ? _b : fill;\n node.stroke = (_c = format === null || format === void 0 ? void 0 : format.stroke) !== null && _c !== void 0 ? _c : stroke;\n node.strokeWidth = (_d = format === null || format === void 0 ? void 0 : format.strokeWidth) !== null && _d !== void 0 ? _d : strokeWidth;\n node.fillOpacity = fillOpacity !== null && fillOpacity !== void 0 ? fillOpacity : 1;\n node.strokeOpacity = (_f = (_e = marker.strokeOpacity) !== null && _e !== void 0 ? _e : strokeOpacity) !== null && _f !== void 0 ? _f : 1;\n node.size = (_g = format === null || format === void 0 ? void 0 : format.size) !== null && _g !== void 0 ? _g : size;\n node.translationX = datum.point.x;\n node.translationY = datum.point.y;\n node.visible = node.size > 0 && !isNaN(datum.point.x) && !isNaN(datum.point.y);\n if (!customMarker || node.dirtyPath) {\n return;\n }\n // Only for cutom marker shapes\n node.path.clear({ trackChanges: true });\n node.updatePath();\n node.checkPathDirty();\n });\n if (!isDatumHighlighted) {\n this.marker.markClean();\n }\n return [2 /*return*/];\n });\n });\n };\n LineSeries.prototype.updateLabelSelection = function (opts) {\n return __awaiter$3(this, void 0, void 0, function () {\n var labelData, labelSelection, _a, shape, enabled;\n return __generator$3(this, function (_b) {\n labelData = opts.labelData;\n labelSelection = opts.labelSelection;\n _a = this.marker, shape = _a.shape, enabled = _a.enabled;\n labelData = shape && enabled ? labelData : [];\n return [2 /*return*/, labelSelection.update(labelData)];\n });\n });\n };\n LineSeries.prototype.updateLabelNodes = function (opts) {\n return __awaiter$3(this, void 0, void 0, function () {\n var labelSelection, _a, labelEnabled, fontStyle, fontWeight, fontSize, fontFamily, color;\n return __generator$3(this, function (_b) {\n labelSelection = opts.labelSelection;\n _a = this.label, labelEnabled = _a.enabled, fontStyle = _a.fontStyle, fontWeight = _a.fontWeight, fontSize = _a.fontSize, fontFamily = _a.fontFamily, color = _a.color;\n labelSelection.each(function (text, datum) {\n var point = datum.point, label = datum.label;\n if (datum && label && labelEnabled) {\n text.fontStyle = fontStyle;\n text.fontWeight = fontWeight;\n text.fontSize = fontSize;\n text.fontFamily = fontFamily;\n text.textAlign = label.textAlign;\n text.textBaseline = label.textBaseline;\n text.text = label.text;\n text.x = point.x;\n text.y = point.y - 10;\n text.fill = color;\n text.visible = true;\n }\n else {\n text.visible = false;\n }\n });\n return [2 /*return*/];\n });\n });\n };\n LineSeries.prototype.getNodeClickEvent = function (event, datum) {\n var _a, _b;\n return new CartesianSeriesNodeClickEvent((_a = this.xKey) !== null && _a !== void 0 ? _a : '', (_b = this.yKey) !== null && _b !== void 0 ? _b : '', event, datum, this);\n };\n LineSeries.prototype.getNodeDoubleClickEvent = function (event, datum) {\n var _a, _b;\n return new CartesianSeriesNodeDoubleClickEvent((_a = this.xKey) !== null && _a !== void 0 ? _a : '', (_b = this.yKey) !== null && _b !== void 0 ? _b : '', event, datum, this);\n };\n LineSeries.prototype.getTooltipHtml = function (nodeDatum) {\n var _a, _b;\n var _c = this, xKey = _c.xKey, yKey = _c.yKey, axes = _c.axes;\n var xAxis = axes[ChartAxisDirection.X];\n var yAxis = axes[ChartAxisDirection.Y];\n if (!xKey || !yKey || !xAxis || !yAxis) {\n return '';\n }\n var _d = this, xName = _d.xName, yName = _d.yName, tooltip = _d.tooltip, marker = _d.marker, seriesId = _d.id;\n var tooltipRenderer = tooltip.renderer, tooltipFormat = tooltip.format;\n var datum = nodeDatum.datum, xValue = nodeDatum.xValue, yValue = nodeDatum.yValue;\n var xString = xAxis.formatDatum(xValue);\n var yString = yAxis.formatDatum(yValue);\n var title = sanitizeHtml((_a = this.title) !== null && _a !== void 0 ? _a : yName);\n var content = sanitizeHtml(xString + ': ' + yString);\n var markerFormatter = marker.formatter, fill = marker.fill, stroke = marker.stroke, markerStrokeWidth = marker.strokeWidth, size = marker.size;\n var strokeWidth = markerStrokeWidth !== null && markerStrokeWidth !== void 0 ? markerStrokeWidth : this.strokeWidth;\n var format = undefined;\n if (markerFormatter) {\n format = markerFormatter({\n datum: datum,\n xKey: xKey,\n yKey: yKey,\n fill: fill,\n stroke: stroke,\n strokeWidth: strokeWidth,\n size: size,\n highlighted: false,\n seriesId: seriesId,\n });\n }\n var color = (_b = format === null || format === void 0 ? void 0 : format.fill) !== null && _b !== void 0 ? _b : fill;\n var defaults = {\n title: title,\n backgroundColor: color,\n content: content,\n };\n if (tooltipFormat || tooltipRenderer) {\n var params = {\n datum: datum,\n xKey: xKey,\n xValue: xValue,\n xName: xName,\n yKey: yKey,\n yValue: yValue,\n yName: yName,\n title: title,\n color: color,\n seriesId: seriesId,\n };\n if (tooltipFormat) {\n return toTooltipHtml$1({\n content: interpolate(tooltipFormat, params),\n }, defaults);\n }\n if (tooltipRenderer) {\n return toTooltipHtml$1(tooltipRenderer(params), defaults);\n }\n }\n return toTooltipHtml$1(defaults);\n };\n LineSeries.prototype.getLegendData = function () {\n var _a, _b, _c, _d, _e, _f, _g;\n var _h = this, id = _h.id, data = _h.data, xKey = _h.xKey, yKey = _h.yKey, yName = _h.yName, visible = _h.visible, title = _h.title, marker = _h.marker, stroke = _h.stroke, strokeOpacity = _h.strokeOpacity;\n if (!((data === null || data === void 0 ? void 0 : data.length) && xKey && yKey)) {\n return [];\n }\n var legendData = [\n {\n legendType: 'category',\n id: id,\n itemId: yKey,\n seriesId: id,\n enabled: visible,\n label: {\n text: (_a = title !== null && title !== void 0 ? title : yName) !== null && _a !== void 0 ? _a : yKey,\n },\n marker: {\n shape: marker.shape,\n fill: (_b = marker.fill) !== null && _b !== void 0 ? _b : 'rgba(0, 0, 0, 0)',\n stroke: (_d = (_c = marker.stroke) !== null && _c !== void 0 ? _c : stroke) !== null && _d !== void 0 ? _d : 'rgba(0, 0, 0, 0)',\n fillOpacity: (_e = marker.fillOpacity) !== null && _e !== void 0 ? _e : 1,\n strokeOpacity: (_g = (_f = marker.strokeOpacity) !== null && _f !== void 0 ? _f : strokeOpacity) !== null && _g !== void 0 ? _g : 1,\n },\n },\n ];\n return legendData;\n };\n LineSeries.prototype.animateEmptyUpdateReady = function (_a) {\n var _this = this;\n var markerSelections = _a.markerSelections, labelSelections = _a.labelSelections, contextData = _a.contextData, paths = _a.paths;\n contextData.forEach(function (_a, contextDataIndex) {\n var _b, _c, _d;\n var nodeData = _a.nodeData;\n var _e = __read$v(paths[contextDataIndex], 1), lineNode = _e[0];\n var linePath = lineNode.path;\n var nodeLengths = [0];\n var lineLength = nodeData.reduce(function (sum, datum, index) {\n if (index === 0)\n return sum;\n var prev = nodeData[index - 1];\n if (isNaN(datum.point.x) || isNaN(datum.point.y) || isNaN(prev.point.x) || isNaN(prev.point.y)) {\n nodeLengths.push(sum);\n return sum;\n }\n var length = Math.sqrt(Math.pow(datum.point.x - prev.point.x, 2) + Math.pow(datum.point.y - prev.point.y, 2));\n nodeLengths.push(sum + length);\n return sum + length;\n }, 0);\n lineNode.fill = undefined;\n lineNode.lineJoin = 'round';\n lineNode.pointerEvents = PointerEvents.None;\n lineNode.stroke = _this.stroke;\n lineNode.strokeWidth = _this.getStrokeWidth(_this.strokeWidth);\n lineNode.strokeOpacity = _this.strokeOpacity;\n lineNode.lineDash = _this.lineDash;\n lineNode.lineDashOffset = _this.lineDashOffset;\n var duration = (_c = (_b = _this.ctx.animationManager) === null || _b === void 0 ? void 0 : _b.defaultOptions.duration) !== null && _c !== void 0 ? _c : 1000;\n var markerDuration = 200;\n var animationOptions = {\n from: 0,\n to: lineLength,\n };\n (_d = _this.ctx.animationManager) === null || _d === void 0 ? void 0 : _d.animate(_this.id + \"_empty-update-ready\", __assign$y(__assign$y({}, animationOptions), { duration: duration, onUpdate: function (length) {\n linePath.clear({ trackChanges: true });\n nodeData.forEach(function (datum, index) {\n if (nodeLengths[index] <= length) {\n // Draw/move the full segment if past the end of this segment\n if (datum.point.moveTo) {\n linePath.moveTo(datum.point.x, datum.point.y);\n }\n else {\n linePath.lineTo(datum.point.x, datum.point.y);\n }\n }\n else if (index > 0 && nodeLengths[index - 1] < length) {\n // Draw/move partial line if in between the start and end of this segment\n var start = nodeData[index - 1].point;\n var end = datum.point;\n var segmentLength = nodeLengths[index] - nodeLengths[index - 1];\n var remainingLength = nodeLengths[index] - length;\n var ratio = (segmentLength - remainingLength) / segmentLength;\n var x = (1 - ratio) * start.x + ratio * end.x;\n var y = (1 - ratio) * start.y + ratio * end.y;\n if (datum.point.moveTo) {\n linePath.moveTo(x, y);\n }\n else {\n linePath.lineTo(x, y);\n }\n }\n });\n lineNode.checkPathDirty();\n } }));\n markerSelections[contextDataIndex].each(function (marker, datum, index) {\n var _a, _b, _c, _d;\n var delay = lineLength > 0 ? (nodeLengths[index] / lineLength) * duration : 0;\n var format = _this.animateFormatter(datum);\n var size = (_b = (_a = datum.point) === null || _a === void 0 ? void 0 : _a.size) !== null && _b !== void 0 ? _b : 0;\n (_c = _this.ctx.animationManager) === null || _c === void 0 ? void 0 : _c.animate(_this.id + \"_empty-update-ready_\" + marker.id, __assign$y(__assign$y({}, animationOptions), { to: (_d = format === null || format === void 0 ? void 0 : format.size) !== null && _d !== void 0 ? _d : size, delay: delay, duration: markerDuration, onUpdate: function (size) {\n marker.size = size;\n } }));\n });\n labelSelections[contextDataIndex].each(function (label, _, index) {\n var _a;\n var delay = (nodeLengths[index] / lineLength) * duration;\n (_a = _this.ctx.animationManager) === null || _a === void 0 ? void 0 : _a.animate(_this.id + \"_empty-update-ready_\" + label.id, {\n from: 0,\n to: 1,\n delay: delay,\n duration: markerDuration,\n onUpdate: function (opacity) {\n label.opacity = opacity;\n },\n });\n });\n });\n };\n LineSeries.prototype.animateReadyUpdate = function (data) {\n this.resetMarkersAndPaths(data);\n };\n LineSeries.prototype.animateReadyResize = function (data) {\n var _a;\n (_a = this.ctx.animationManager) === null || _a === void 0 ? void 0 : _a.reset();\n this.resetMarkersAndPaths(data);\n };\n LineSeries.prototype.resetMarkersAndPaths = function (_a) {\n var _this = this;\n var markerSelections = _a.markerSelections, contextData = _a.contextData, paths = _a.paths;\n contextData.forEach(function (_a, contextDataIndex) {\n var nodeData = _a.nodeData;\n var _b = __read$v(paths[contextDataIndex], 1), lineNode = _b[0];\n var linePath = lineNode.path;\n lineNode.stroke = _this.stroke;\n lineNode.strokeWidth = _this.getStrokeWidth(_this.strokeWidth);\n lineNode.strokeOpacity = _this.strokeOpacity;\n lineNode.lineDash = _this.lineDash;\n lineNode.lineDashOffset = _this.lineDashOffset;\n linePath.clear({ trackChanges: true });\n nodeData.forEach(function (datum) {\n if (datum.point.moveTo) {\n linePath.moveTo(datum.point.x, datum.point.y);\n }\n else {\n linePath.lineTo(datum.point.x, datum.point.y);\n }\n });\n lineNode.checkPathDirty();\n markerSelections[contextDataIndex].each(function (marker, datum) {\n var _a, _b, _c;\n var format = _this.animateFormatter(datum);\n var size = (_b = (_a = datum.point) === null || _a === void 0 ? void 0 : _a.size) !== null && _b !== void 0 ? _b : 0;\n marker.size = (_c = format === null || format === void 0 ? void 0 : format.size) !== null && _c !== void 0 ? _c : size;\n });\n });\n };\n LineSeries.prototype.animateFormatter = function (datum) {\n var _a, _b;\n var _c = this, marker = _c.marker, _d = _c.xKey, xKey = _d === void 0 ? '' : _d, _e = _c.yKey, yKey = _e === void 0 ? '' : _e, lineStroke = _c.stroke, seriesId = _c.id, callbackCache = _c.ctx.callbackCache;\n var size = marker.size, formatter = marker.formatter;\n var fill = marker.fill;\n var stroke = (_a = marker.stroke) !== null && _a !== void 0 ? _a : lineStroke;\n var strokeWidth = (_b = marker.strokeWidth) !== null && _b !== void 0 ? _b : this.strokeWidth;\n var format = undefined;\n if (formatter) {\n format = callbackCache.call(formatter, {\n datum: datum.datum,\n xKey: xKey,\n yKey: yKey,\n fill: fill,\n stroke: stroke,\n strokeWidth: strokeWidth,\n size: size,\n highlighted: false,\n seriesId: seriesId,\n });\n }\n return format;\n };\n LineSeries.prototype.isLabelEnabled = function () {\n return this.label.enabled;\n };\n LineSeries.className = 'LineSeries';\n LineSeries.type = 'line';\n __decorate$1m([\n Validate(OPT_STRING)\n ], LineSeries.prototype, \"title\", void 0);\n __decorate$1m([\n Validate(OPT_COLOR_STRING)\n ], LineSeries.prototype, \"stroke\", void 0);\n __decorate$1m([\n Validate(OPT_LINE_DASH)\n ], LineSeries.prototype, \"lineDash\", void 0);\n __decorate$1m([\n Validate(NUMBER(0))\n ], LineSeries.prototype, \"lineDashOffset\", void 0);\n __decorate$1m([\n Validate(NUMBER(0))\n ], LineSeries.prototype, \"strokeWidth\", void 0);\n __decorate$1m([\n Validate(NUMBER(0, 1))\n ], LineSeries.prototype, \"strokeOpacity\", void 0);\n __decorate$1m([\n Validate(OPT_STRING)\n ], LineSeries.prototype, \"xKey\", void 0);\n __decorate$1m([\n Validate(OPT_STRING)\n ], LineSeries.prototype, \"xName\", void 0);\n __decorate$1m([\n Validate(OPT_STRING)\n ], LineSeries.prototype, \"yKey\", void 0);\n __decorate$1m([\n Validate(OPT_STRING)\n ], LineSeries.prototype, \"yName\", void 0);\n return LineSeries;\n}(CartesianSeries));\n\nvar ColorScale = /** @class */ (function () {\n function ColorScale() {\n this.domain = [0, 1];\n this.range = ['red', 'blue'];\n this.parsedRange = this.range.map(function (v) { return Color.fromString(v); });\n }\n ColorScale.prototype.update = function () {\n var _a = this, domain = _a.domain, range = _a.range;\n if (domain.length < 2) {\n Logger.warnOnce('`colorDomain` should have at least 2 values.');\n if (domain.length === 0) {\n domain.push(0, 1);\n }\n else if (domain.length === 1) {\n domain.push(domain[0] + 1);\n }\n }\n for (var i = 1; i < domain.length; i++) {\n var a = domain[i - 1];\n var b = domain[i];\n if (a >= b) {\n Logger.warnOnce('`colorDomain` values should be supplied in ascending order.');\n domain.sort(function (a, b) { return a - b; });\n break;\n }\n }\n var isSmallRange = range.length < domain.length;\n if (isSmallRange || (domain.length > 2 && range.length > domain.length)) {\n Logger.warnOnce('Number of elements in `colorRange` needs to match the number of elements in `colorDomain`.');\n if (isSmallRange) {\n for (var i = range.length; i < domain.length; i++) {\n range.push('black');\n }\n }\n else {\n range.splice(domain.length);\n }\n }\n this.parsedRange = this.range.map(function (v) { return Color.fromString(v); });\n };\n ColorScale.prototype.convert = function (x) {\n var _a = this, domain = _a.domain, range = _a.range, parsedRange = _a.parsedRange;\n var d0 = domain[0];\n var d1 = domain[domain.length - 1];\n var r0 = range[0];\n var r1 = range[range.length - 1];\n if (x <= d0) {\n return r0;\n }\n if (x >= d1) {\n return r1;\n }\n var index;\n var q;\n if (domain.length === 2) {\n var t = (x - d0) / (d1 - d0);\n var step = 1 / (range.length - 1);\n index = range.length <= 2 ? 0 : Math.min(Math.floor(t * (range.length - 1)), range.length - 2);\n q = (t - index * step) / step;\n }\n else {\n for (index = 0; index < domain.length - 2; index++) {\n if (x < domain[index + 1]) {\n break;\n }\n }\n var a = domain[index];\n var b = domain[index + 1];\n q = (x - a) / (b - a);\n }\n var c0 = parsedRange[index];\n var c1 = parsedRange[index + 1];\n return interpolateColor(c0, c1)(q);\n };\n return ColorScale;\n}());\n\nvar __extends$1$ = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign$x = (undefined && undefined.__assign) || function () {\n __assign$x = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$x.apply(this, arguments);\n};\nvar __decorate$1l = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __awaiter$2 = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator$2 = (undefined && undefined.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nvar __read$u = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray$g = (undefined && undefined.__spreadArray) || function (to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\n to[j] = from[i];\n return to;\n};\nvar __values$g = (undefined && undefined.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nvar ScatterSeriesLabel = /** @class */ (function (_super) {\n __extends$1$(ScatterSeriesLabel, _super);\n function ScatterSeriesLabel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.formatter = undefined;\n return _this;\n }\n __decorate$1l([\n Validate(OPT_FUNCTION)\n ], ScatterSeriesLabel.prototype, \"formatter\", void 0);\n return ScatterSeriesLabel;\n}(Label$1));\nvar ScatterSeriesNodeBaseClickEvent = /** @class */ (function (_super) {\n __extends$1$(ScatterSeriesNodeBaseClickEvent, _super);\n function ScatterSeriesNodeBaseClickEvent(sizeKey, xKey, yKey, nativeEvent, datum, series) {\n var _this = _super.call(this, xKey, yKey, nativeEvent, datum, series) || this;\n _this.sizeKey = sizeKey;\n return _this;\n }\n return ScatterSeriesNodeBaseClickEvent;\n}(CartesianSeriesNodeBaseClickEvent));\nvar ScatterSeriesNodeClickEvent = /** @class */ (function (_super) {\n __extends$1$(ScatterSeriesNodeClickEvent, _super);\n function ScatterSeriesNodeClickEvent() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = 'nodeClick';\n return _this;\n }\n return ScatterSeriesNodeClickEvent;\n}(ScatterSeriesNodeBaseClickEvent));\nvar ScatterSeriesNodeDoubleClickEvent = /** @class */ (function (_super) {\n __extends$1$(ScatterSeriesNodeDoubleClickEvent, _super);\n function ScatterSeriesNodeDoubleClickEvent() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = 'nodeDoubleClick';\n return _this;\n }\n return ScatterSeriesNodeDoubleClickEvent;\n}(ScatterSeriesNodeBaseClickEvent));\nvar ScatterSeriesTooltip = /** @class */ (function (_super) {\n __extends$1$(ScatterSeriesTooltip, _super);\n function ScatterSeriesTooltip() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.renderer = undefined;\n return _this;\n }\n __decorate$1l([\n Validate(OPT_FUNCTION)\n ], ScatterSeriesTooltip.prototype, \"renderer\", void 0);\n return ScatterSeriesTooltip;\n}(SeriesTooltip));\nvar ScatterSeries = /** @class */ (function (_super) {\n __extends$1$(ScatterSeries, _super);\n function ScatterSeries(moduleCtx) {\n var _this = _super.call(this, {\n moduleCtx: moduleCtx,\n pickModes: [\n SeriesNodePickMode.NEAREST_BY_MAIN_CATEGORY_AXIS_FIRST,\n SeriesNodePickMode.NEAREST_NODE,\n SeriesNodePickMode.EXACT_SHAPE_MATCH,\n ],\n pathsPerSeries: 0,\n hasMarkers: true,\n }) || this;\n _this.sizeScale = new LinearScale$1();\n _this.marker = new CartesianSeriesMarker();\n _this.label = new ScatterSeriesLabel();\n _this.title = undefined;\n _this.labelKey = undefined;\n _this.xName = undefined;\n _this.yName = undefined;\n _this.sizeName = 'Size';\n _this.labelName = 'Label';\n _this.xKey = undefined;\n _this.yKey = undefined;\n _this.sizeKey = undefined;\n _this.colorKey = undefined;\n _this.colorName = 'Color';\n _this.colorDomain = undefined;\n _this.colorRange = ['#ffff00', '#00ff00', '#0000ff'];\n _this.colorScale = new ColorScale();\n _this.tooltip = new ScatterSeriesTooltip();\n var label = _this.label;\n label.enabled = false;\n return _this;\n }\n ScatterSeries.prototype.processData = function (dataController) {\n var _a, _b;\n return __awaiter$2(this, void 0, void 0, function () {\n var _c, _d, xKey, _e, yKey, sizeKey, labelKey, axes, marker, data, xAxis, yAxis, isContinuousX, isContinuousY, _f, colorScale, colorDomain, colorRange, colorKey, _g, dataModel, processedData, sizeKeyIdx, processedSize, colorKeyIdx;\n return __generator$2(this, function (_h) {\n switch (_h.label) {\n case 0:\n _c = this, _d = _c.xKey, xKey = _d === void 0 ? '' : _d, _e = _c.yKey, yKey = _e === void 0 ? '' : _e, sizeKey = _c.sizeKey, labelKey = _c.labelKey, axes = _c.axes, marker = _c.marker, data = _c.data;\n xAxis = axes[ChartAxisDirection.X];\n yAxis = axes[ChartAxisDirection.Y];\n isContinuousX = (xAxis === null || xAxis === void 0 ? void 0 : xAxis.scale) instanceof ContinuousScale;\n isContinuousY = (yAxis === null || yAxis === void 0 ? void 0 : yAxis.scale) instanceof ContinuousScale;\n _f = this, colorScale = _f.colorScale, colorDomain = _f.colorDomain, colorRange = _f.colorRange, colorKey = _f.colorKey;\n return [4 /*yield*/, dataController.request(this.id, data !== null && data !== void 0 ? data : [], {\n props: __spreadArray$g(__spreadArray$g(__spreadArray$g([\n valueProperty(this, xKey, isContinuousX, { id: \"xValue\" }),\n valueProperty(this, yKey, isContinuousY, { id: \"yValue\" })\n ], __read$u((sizeKey ? [valueProperty(this, sizeKey, true, { id: \"sizeValue\" })] : []))), __read$u((colorKey ? [valueProperty(this, colorKey, true, { id: \"colorValue\" })] : []))), __read$u((labelKey ? [valueProperty(this, labelKey, false, { id: \"labelValue\" })] : []))),\n dataVisible: this.visible,\n })];\n case 1:\n _g = _h.sent(), dataModel = _g.dataModel, processedData = _g.processedData;\n this.dataModel = dataModel;\n this.processedData = processedData;\n if (sizeKey) {\n sizeKeyIdx = dataModel.resolveProcessedDataIndexById(this, \"sizeValue\").index;\n processedSize = (_a = processedData.domain.values[sizeKeyIdx]) !== null && _a !== void 0 ? _a : [];\n this.sizeScale.domain = marker.domain ? marker.domain : processedSize;\n }\n if (colorKey) {\n colorKeyIdx = dataModel.resolveProcessedDataIndexById(this, \"colorValue\").index;\n colorScale.domain = (_b = colorDomain !== null && colorDomain !== void 0 ? colorDomain : processedData.domain.values[colorKeyIdx]) !== null && _b !== void 0 ? _b : [];\n colorScale.range = colorRange;\n colorScale.update();\n }\n return [2 /*return*/];\n }\n });\n });\n };\n ScatterSeries.prototype.getDomain = function (direction) {\n var _a = this, dataModel = _a.dataModel, processedData = _a.processedData;\n if (!processedData || !dataModel)\n return [];\n var id = direction === ChartAxisDirection.X ? \"xValue\" : \"yValue\";\n var dataDef = dataModel.resolveProcessedDataDefById(this, id, 'value');\n var domain = dataModel.getDomain(this, id, 'value', processedData);\n if ((dataDef === null || dataDef === void 0 ? void 0 : dataDef.def.type) === 'value' && (dataDef === null || dataDef === void 0 ? void 0 : dataDef.def.valueType) === 'category') {\n return domain;\n }\n var axis = this.axes[direction];\n return this.fixNumericExtent(extent$4(domain), axis);\n };\n ScatterSeries.prototype.getNodeClickEvent = function (event, datum) {\n var _a, _b;\n return new ScatterSeriesNodeClickEvent(this.sizeKey, (_a = this.xKey) !== null && _a !== void 0 ? _a : '', (_b = this.yKey) !== null && _b !== void 0 ? _b : '', event, datum, this);\n };\n ScatterSeries.prototype.getNodeDoubleClickEvent = function (event, datum) {\n var _a, _b;\n return new ScatterSeriesNodeDoubleClickEvent(this.sizeKey, (_a = this.xKey) !== null && _a !== void 0 ? _a : '', (_b = this.yKey) !== null && _b !== void 0 ? _b : '', event, datum, this);\n };\n ScatterSeries.prototype.createNodeData = function () {\n var _a, _b, _c, _d, _e, _f;\n return __awaiter$2(this, void 0, void 0, function () {\n var _g, visible, axes, _h, yKey, _j, xKey, label, labelKey, callbackCache, dataModel, processedData, xAxis, yAxis, xDataIdx, yDataIdx, sizeDataIdx, colorDataIdx, labelDataIdx, _k, colorScale, sizeKey, colorKey, seriesId, xScale, yScale, xOffset, yOffset, _l, sizeScale, marker, nodeData, font, actualLength, _m, _o, _p, values, datum, xDatum, yDatum, x, y, text, size, markerSize, fill;\n var e_1, _q;\n return __generator$2(this, function (_r) {\n _g = this, visible = _g.visible, axes = _g.axes, _h = _g.yKey, yKey = _h === void 0 ? '' : _h, _j = _g.xKey, xKey = _j === void 0 ? '' : _j, label = _g.label, labelKey = _g.labelKey, callbackCache = _g.ctx.callbackCache, dataModel = _g.dataModel, processedData = _g.processedData;\n xAxis = axes[ChartAxisDirection.X];\n yAxis = axes[ChartAxisDirection.Y];\n if (!(dataModel && processedData && visible && xAxis && yAxis))\n return [2 /*return*/, []];\n xDataIdx = dataModel.resolveProcessedDataIndexById(this, \"xValue\").index;\n yDataIdx = dataModel.resolveProcessedDataIndexById(this, \"yValue\").index;\n sizeDataIdx = this.sizeKey ? dataModel.resolveProcessedDataIndexById(this, \"sizeValue\").index : -1;\n colorDataIdx = this.colorKey ? dataModel.resolveProcessedDataIndexById(this, \"colorValue\").index : -1;\n labelDataIdx = this.labelKey ? dataModel.resolveProcessedDataIndexById(this, \"labelValue\").index : -1;\n _k = this, colorScale = _k.colorScale, sizeKey = _k.sizeKey, colorKey = _k.colorKey, seriesId = _k.id;\n xScale = xAxis.scale;\n yScale = yAxis.scale;\n xOffset = ((_a = xScale.bandwidth) !== null && _a !== void 0 ? _a : 0) / 2;\n yOffset = ((_b = yScale.bandwidth) !== null && _b !== void 0 ? _b : 0) / 2;\n _l = this, sizeScale = _l.sizeScale, marker = _l.marker;\n nodeData = new Array((_d = (_c = this.processedData) === null || _c === void 0 ? void 0 : _c.data.length) !== null && _d !== void 0 ? _d : 0);\n sizeScale.range = [marker.size, marker.maxSize];\n font = label.getFont();\n actualLength = 0;\n try {\n for (_m = __values$g((_e = processedData.data) !== null && _e !== void 0 ? _e : []), _o = _m.next(); !_o.done; _o = _m.next()) {\n _p = _o.value, values = _p.values, datum = _p.datum;\n xDatum = values[xDataIdx];\n yDatum = values[yDataIdx];\n x = xScale.convert(xDatum) + xOffset;\n y = yScale.convert(yDatum) + yOffset;\n if (!this.checkRangeXY(x, y, xAxis, yAxis)) {\n continue;\n }\n text = void 0;\n if (label.formatter) {\n text = callbackCache.call(label.formatter, { value: yDatum, seriesId: seriesId, datum: datum });\n }\n if (text === undefined) {\n text = labelKey ? String(values[labelDataIdx]) : '';\n }\n size = HdpiCanvas.getTextSize(text, font);\n markerSize = sizeKey ? sizeScale.convert(values[sizeDataIdx]) : marker.size;\n fill = colorKey ? colorScale.convert(values[colorDataIdx]) : undefined;\n nodeData[actualLength++] = {\n series: this,\n itemId: yKey,\n yKey: yKey,\n xKey: xKey,\n datum: datum,\n xValue: xDatum,\n yValue: yDatum,\n sizeValue: values[sizeDataIdx],\n point: { x: x, y: y, size: markerSize },\n nodeMidPoint: { x: x, y: y },\n fill: fill,\n label: __assign$x({ text: text }, size),\n };\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_o && !_o.done && (_q = _m.return)) _q.call(_m);\n }\n finally { if (e_1) throw e_1.error; }\n }\n nodeData.length = actualLength;\n return [2 /*return*/, [{ itemId: (_f = this.yKey) !== null && _f !== void 0 ? _f : this.id, nodeData: nodeData, labelData: nodeData }]];\n });\n });\n };\n ScatterSeries.prototype.isPathOrSelectionDirty = function () {\n return this.marker.isDirty();\n };\n ScatterSeries.prototype.getLabelData = function () {\n var _a;\n return (_a = this.contextNodeData) === null || _a === void 0 ? void 0 : _a.reduce(function (r, n) { return r.concat(n.labelData); }, []);\n };\n ScatterSeries.prototype.markerFactory = function () {\n var shape = this.marker.shape;\n var MarkerShape = getMarker$1(shape);\n return new MarkerShape();\n };\n ScatterSeries.prototype.updateMarkerSelection = function (opts) {\n return __awaiter$2(this, void 0, void 0, function () {\n var nodeData, markerSelection, enabled, data;\n return __generator$2(this, function (_a) {\n nodeData = opts.nodeData, markerSelection = opts.markerSelection;\n enabled = this.marker.enabled;\n if (this.marker.isDirty()) {\n markerSelection.clear();\n }\n data = enabled ? nodeData : [];\n return [2 /*return*/, markerSelection.update(data)];\n });\n });\n };\n ScatterSeries.prototype.updateMarkerNodes = function (opts) {\n return __awaiter$2(this, void 0, void 0, function () {\n var markerSelection, isDatumHighlighted, _a, marker, _b, xKey, _c, yKey, sizeScale, _d, markerFillOpacity, markerStrokeOpacity, markerStrokeWidth, _e, highlightedFill, _f, highlightFillOpacity, highlightedStroke, highlightedDatumStrokeWidth, seriesId, callbackCache, formatter, customMarker;\n return __generator$2(this, function (_g) {\n markerSelection = opts.markerSelection, isDatumHighlighted = opts.isHighlight;\n _a = this, marker = _a.marker, _b = _a.xKey, xKey = _b === void 0 ? '' : _b, _c = _a.yKey, yKey = _c === void 0 ? '' : _c, sizeScale = _a.sizeScale, _d = _a.marker, markerFillOpacity = _d.fillOpacity, markerStrokeOpacity = _d.strokeOpacity, markerStrokeWidth = _d.strokeWidth, _e = _a.highlightStyle.item, highlightedFill = _e.fill, _f = _e.fillOpacity, highlightFillOpacity = _f === void 0 ? markerFillOpacity : _f, highlightedStroke = _e.stroke, highlightedDatumStrokeWidth = _e.strokeWidth, seriesId = _a.id, callbackCache = _a.ctx.callbackCache;\n formatter = marker.formatter;\n sizeScale.range = [marker.size, marker.maxSize];\n customMarker = typeof marker.shape === 'function';\n markerSelection.each(function (node, datum) {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;\n var fill = isDatumHighlighted && highlightedFill !== undefined ? highlightedFill : (_a = datum.fill) !== null && _a !== void 0 ? _a : marker.fill;\n var fillOpacity = isDatumHighlighted ? highlightFillOpacity : markerFillOpacity;\n var stroke = isDatumHighlighted && highlightedStroke !== undefined ? highlightedStroke : marker.stroke;\n var strokeOpacity = markerStrokeOpacity;\n var strokeWidth = isDatumHighlighted && highlightedDatumStrokeWidth !== undefined\n ? highlightedDatumStrokeWidth\n : markerStrokeWidth !== null && markerStrokeWidth !== void 0 ? markerStrokeWidth : 1;\n var size = (_c = (_b = datum.point) === null || _b === void 0 ? void 0 : _b.size) !== null && _c !== void 0 ? _c : 0;\n var format = undefined;\n if (formatter) {\n format = callbackCache.call(formatter, {\n datum: datum.datum,\n xKey: xKey,\n yKey: yKey,\n fill: fill,\n stroke: stroke,\n strokeWidth: strokeWidth,\n size: size,\n highlighted: isDatumHighlighted,\n seriesId: seriesId,\n });\n }\n node.fill = (_d = format === null || format === void 0 ? void 0 : format.fill) !== null && _d !== void 0 ? _d : fill;\n node.stroke = (_e = format === null || format === void 0 ? void 0 : format.stroke) !== null && _e !== void 0 ? _e : stroke;\n node.strokeWidth = (_f = format === null || format === void 0 ? void 0 : format.strokeWidth) !== null && _f !== void 0 ? _f : strokeWidth;\n node.fillOpacity = fillOpacity !== null && fillOpacity !== void 0 ? fillOpacity : 1;\n node.strokeOpacity = strokeOpacity !== null && strokeOpacity !== void 0 ? strokeOpacity : 1;\n node.translationX = (_h = (_g = datum.point) === null || _g === void 0 ? void 0 : _g.x) !== null && _h !== void 0 ? _h : 0;\n node.translationY = (_k = (_j = datum.point) === null || _j === void 0 ? void 0 : _j.y) !== null && _k !== void 0 ? _k : 0;\n node.visible = node.size > 0;\n if (!customMarker || node.dirtyPath) {\n return;\n }\n // Only for custom marker shapes.\n node.path.clear({ trackChanges: true });\n node.updatePath();\n node.checkPathDirty();\n });\n if (!isDatumHighlighted) {\n this.marker.markClean();\n }\n return [2 /*return*/];\n });\n });\n };\n ScatterSeries.prototype.updateLabelSelection = function (opts) {\n var _a, _b;\n return __awaiter$2(this, void 0, void 0, function () {\n var labelSelection, enabled, placedLabels, placedNodeDatum;\n return __generator$2(this, function (_c) {\n labelSelection = opts.labelSelection;\n enabled = this.label.enabled;\n placedLabels = enabled ? (_b = (_a = this.chart) === null || _a === void 0 ? void 0 : _a.placeLabels().get(this)) !== null && _b !== void 0 ? _b : [] : [];\n placedNodeDatum = placedLabels.map(function (v) { return (__assign$x(__assign$x({}, v.datum), { point: {\n x: v.x,\n y: v.y,\n size: v.datum.point.size,\n } })); });\n return [2 /*return*/, labelSelection.update(placedNodeDatum)];\n });\n });\n };\n ScatterSeries.prototype.updateLabelNodes = function (opts) {\n return __awaiter$2(this, void 0, void 0, function () {\n var labelSelection, label;\n return __generator$2(this, function (_a) {\n labelSelection = opts.labelSelection;\n label = this.label;\n labelSelection.each(function (text, datum) {\n var _a, _b, _c, _d;\n text.text = datum.label.text;\n text.fill = label.color;\n text.x = (_b = (_a = datum.point) === null || _a === void 0 ? void 0 : _a.x) !== null && _b !== void 0 ? _b : 0;\n text.y = (_d = (_c = datum.point) === null || _c === void 0 ? void 0 : _c.y) !== null && _d !== void 0 ? _d : 0;\n text.fontStyle = label.fontStyle;\n text.fontWeight = label.fontWeight;\n text.fontSize = label.fontSize;\n text.fontFamily = label.fontFamily;\n text.textAlign = 'left';\n text.textBaseline = 'top';\n });\n return [2 /*return*/];\n });\n });\n };\n ScatterSeries.prototype.getTooltipHtml = function (nodeDatum) {\n var _a, _b, _c, _d, _e, _f, _g;\n var _h = this, xKey = _h.xKey, yKey = _h.yKey, axes = _h.axes;\n var xAxis = axes[ChartAxisDirection.X];\n var yAxis = axes[ChartAxisDirection.Y];\n if (!xKey || !yKey || !xAxis || !yAxis) {\n return '';\n }\n var _j = this, marker = _j.marker, tooltip = _j.tooltip, xName = _j.xName, yName = _j.yName, sizeKey = _j.sizeKey, sizeName = _j.sizeName, labelKey = _j.labelKey, labelName = _j.labelName, seriesId = _j.id, callbackCache = _j.ctx.callbackCache;\n var stroke = marker.stroke;\n var fill = (_a = nodeDatum.fill) !== null && _a !== void 0 ? _a : marker.fill;\n var strokeWidth = this.getStrokeWidth((_b = marker.strokeWidth) !== null && _b !== void 0 ? _b : 1);\n var formatter = this.marker.formatter;\n var format = undefined;\n if (formatter) {\n format = callbackCache.call(formatter, {\n datum: nodeDatum,\n xKey: xKey,\n yKey: yKey,\n fill: fill,\n stroke: stroke,\n strokeWidth: strokeWidth,\n size: (_d = (_c = nodeDatum.point) === null || _c === void 0 ? void 0 : _c.size) !== null && _d !== void 0 ? _d : 0,\n highlighted: false,\n seriesId: seriesId,\n });\n }\n var color = (_f = (_e = format === null || format === void 0 ? void 0 : format.fill) !== null && _e !== void 0 ? _e : fill) !== null && _f !== void 0 ? _f : 'gray';\n var title = (_g = this.title) !== null && _g !== void 0 ? _g : yName;\n var datum = nodeDatum.datum, xValue = nodeDatum.xValue, yValue = nodeDatum.yValue, sizeValue = nodeDatum.sizeValue, labelText = nodeDatum.label.text;\n var xString = sanitizeHtml(xAxis.formatDatum(xValue));\n var yString = sanitizeHtml(yAxis.formatDatum(yValue));\n var content = \"\" + sanitizeHtml(xName !== null && xName !== void 0 ? xName : xKey) + \": \" + xString + \"
\" +\n (\"\" + sanitizeHtml(yName !== null && yName !== void 0 ? yName : yKey) + \": \" + yString);\n if (sizeKey) {\n content += \"
\" + sanitizeHtml(sizeName !== null && sizeName !== void 0 ? sizeName : sizeKey) + \": \" + sanitizeHtml(sizeValue);\n }\n if (labelKey) {\n content = \"\" + sanitizeHtml(labelName !== null && labelName !== void 0 ? labelName : labelKey) + \": \" + sanitizeHtml(labelText) + \"
\" + content;\n }\n var defaults = {\n title: title,\n backgroundColor: color,\n content: content,\n };\n var tooltipRenderer = tooltip.renderer;\n if (tooltipRenderer) {\n return toTooltipHtml$1(tooltipRenderer({\n datum: datum,\n xKey: xKey,\n xValue: xValue,\n xName: xName,\n yKey: yKey,\n yValue: yValue,\n yName: yName,\n sizeKey: sizeKey,\n sizeName: sizeName,\n labelKey: labelKey,\n labelName: labelName,\n title: title,\n color: color,\n seriesId: seriesId,\n }), defaults);\n }\n return toTooltipHtml$1(defaults);\n };\n ScatterSeries.prototype.getLegendData = function () {\n var _a, _b, _c, _d, _e;\n var _f = this, id = _f.id, data = _f.data, xKey = _f.xKey, yKey = _f.yKey, yName = _f.yName, title = _f.title, visible = _f.visible, marker = _f.marker;\n var fill = marker.fill, stroke = marker.stroke, fillOpacity = marker.fillOpacity, strokeOpacity = marker.strokeOpacity;\n if (!((data === null || data === void 0 ? void 0 : data.length) && xKey && yKey)) {\n return [];\n }\n var legendData = [\n {\n legendType: 'category',\n id: id,\n itemId: yKey,\n seriesId: id,\n enabled: visible,\n label: {\n text: (_a = title !== null && title !== void 0 ? title : yName) !== null && _a !== void 0 ? _a : yKey,\n },\n marker: {\n shape: marker.shape,\n fill: (_c = (_b = marker.fill) !== null && _b !== void 0 ? _b : fill) !== null && _c !== void 0 ? _c : 'rgba(0, 0, 0, 0)',\n stroke: (_e = (_d = marker.stroke) !== null && _d !== void 0 ? _d : stroke) !== null && _e !== void 0 ? _e : 'rgba(0, 0, 0, 0)',\n fillOpacity: fillOpacity !== null && fillOpacity !== void 0 ? fillOpacity : 1,\n strokeOpacity: strokeOpacity !== null && strokeOpacity !== void 0 ? strokeOpacity : 1,\n },\n },\n ];\n return legendData;\n };\n ScatterSeries.prototype.animateEmptyUpdateReady = function (_a) {\n var _this = this;\n var _b, _c;\n var markerSelections = _a.markerSelections, labelSelections = _a.labelSelections;\n var duration = (_c = (_b = this.ctx.animationManager) === null || _b === void 0 ? void 0 : _b.defaultOptions.duration) !== null && _c !== void 0 ? _c : 1000;\n var labelDuration = 200;\n markerSelections.forEach(function (markerSelection) {\n markerSelection.each(function (marker, datum) {\n var _a, _b, _c, _d;\n var format = _this.animateFormatter(marker, datum);\n var size = (_b = (_a = datum.point) === null || _a === void 0 ? void 0 : _a.size) !== null && _b !== void 0 ? _b : 0;\n var to = (_c = format === null || format === void 0 ? void 0 : format.size) !== null && _c !== void 0 ? _c : size;\n (_d = _this.ctx.animationManager) === null || _d === void 0 ? void 0 : _d.animate(_this.id + \"_empty-update-ready_\" + marker.id, {\n from: 0,\n to: to,\n duration: duration,\n onUpdate: function (size) {\n marker.size = size;\n },\n });\n });\n });\n labelSelections.forEach(function (labelSelection) {\n labelSelection.each(function (label) {\n var _a;\n (_a = _this.ctx.animationManager) === null || _a === void 0 ? void 0 : _a.animate(_this.id + \"_empty-update-ready_\" + label.id, {\n from: 0,\n to: 1,\n delay: duration,\n duration: labelDuration,\n onUpdate: function (opacity) {\n label.opacity = opacity;\n },\n });\n });\n });\n };\n ScatterSeries.prototype.animateReadyUpdate = function (_a) {\n var _this = this;\n var markerSelections = _a.markerSelections;\n markerSelections.forEach(function (markerSelection) {\n _this.resetMarkers(markerSelection);\n });\n };\n ScatterSeries.prototype.animateReadyHighlightMarkers = function (markerSelection) {\n this.resetMarkers(markerSelection);\n };\n ScatterSeries.prototype.resetMarkers = function (markerSelection) {\n var _this = this;\n markerSelection.each(function (marker, datum) {\n var _a, _b, _c;\n var format = _this.animateFormatter(marker, datum);\n var size = (_b = (_a = datum.point) === null || _a === void 0 ? void 0 : _a.size) !== null && _b !== void 0 ? _b : 0;\n marker.size = (_c = format === null || format === void 0 ? void 0 : format.size) !== null && _c !== void 0 ? _c : size;\n });\n };\n ScatterSeries.prototype.animateFormatter = function (marker, datum) {\n var _a, _b, _c;\n var _d = this, _e = _d.xKey, xKey = _e === void 0 ? '' : _e, _f = _d.yKey, yKey = _f === void 0 ? '' : _f, markerStrokeWidth = _d.marker.strokeWidth, seriesId = _d.id, callbackCache = _d.ctx.callbackCache;\n var formatter = this.marker.formatter;\n var fill = (_a = datum.fill) !== null && _a !== void 0 ? _a : marker.fill;\n var stroke = marker.stroke;\n var strokeWidth = markerStrokeWidth !== null && markerStrokeWidth !== void 0 ? markerStrokeWidth : 1;\n var size = (_c = (_b = datum.point) === null || _b === void 0 ? void 0 : _b.size) !== null && _c !== void 0 ? _c : 0;\n var format = undefined;\n if (formatter) {\n format = callbackCache.call(formatter, {\n datum: datum.datum,\n xKey: xKey,\n yKey: yKey,\n fill: fill,\n stroke: stroke,\n strokeWidth: strokeWidth,\n size: size,\n highlighted: false,\n seriesId: seriesId,\n });\n }\n return format;\n };\n ScatterSeries.prototype.isLabelEnabled = function () {\n return this.label.enabled;\n };\n ScatterSeries.className = 'ScatterSeries';\n ScatterSeries.type = 'scatter';\n __decorate$1l([\n Validate(OPT_STRING)\n ], ScatterSeries.prototype, \"title\", void 0);\n __decorate$1l([\n Validate(OPT_STRING)\n ], ScatterSeries.prototype, \"labelKey\", void 0);\n __decorate$1l([\n Validate(OPT_STRING)\n ], ScatterSeries.prototype, \"xName\", void 0);\n __decorate$1l([\n Validate(OPT_STRING)\n ], ScatterSeries.prototype, \"yName\", void 0);\n __decorate$1l([\n Validate(OPT_STRING)\n ], ScatterSeries.prototype, \"sizeName\", void 0);\n __decorate$1l([\n Validate(OPT_STRING)\n ], ScatterSeries.prototype, \"labelName\", void 0);\n __decorate$1l([\n Validate(OPT_STRING)\n ], ScatterSeries.prototype, \"xKey\", void 0);\n __decorate$1l([\n Validate(OPT_STRING)\n ], ScatterSeries.prototype, \"yKey\", void 0);\n __decorate$1l([\n Validate(OPT_STRING)\n ], ScatterSeries.prototype, \"sizeKey\", void 0);\n __decorate$1l([\n Validate(OPT_STRING)\n ], ScatterSeries.prototype, \"colorKey\", void 0);\n __decorate$1l([\n Validate(OPT_STRING)\n ], ScatterSeries.prototype, \"colorName\", void 0);\n __decorate$1l([\n Validate(OPT_NUMBER_ARRAY)\n ], ScatterSeries.prototype, \"colorDomain\", void 0);\n __decorate$1l([\n Validate(COLOR_STRING_ARRAY)\n ], ScatterSeries.prototype, \"colorRange\", void 0);\n return ScatterSeries;\n}(CartesianSeries));\n\nvar __extends$1_ = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar HierarchySeries = /** @class */ (function (_super) {\n __extends$1_(HierarchySeries, _super);\n function HierarchySeries(moduleCtx) {\n return _super.call(this, { moduleCtx: moduleCtx, pickModes: [SeriesNodePickMode.EXACT_SHAPE_MATCH] }) || this;\n }\n HierarchySeries.prototype.getLabelData = function () {\n return [];\n };\n return HierarchySeries;\n}(Series));\n\nvar __extends$1Z = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign$w = (undefined && undefined.__assign) || function () {\n __assign$w = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$w.apply(this, arguments);\n};\nvar __decorate$1k = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __awaiter$1 = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator$1 = (undefined && undefined.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nvar __values$f = (undefined && undefined.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nvar TreemapSeriesTooltip = /** @class */ (function (_super) {\n __extends$1Z(TreemapSeriesTooltip, _super);\n function TreemapSeriesTooltip() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.renderer = undefined;\n return _this;\n }\n __decorate$1k([\n Validate(OPT_FUNCTION)\n ], TreemapSeriesTooltip.prototype, \"renderer\", void 0);\n return TreemapSeriesTooltip;\n}(SeriesTooltip));\nvar TreemapSeriesNodeBaseClickEvent = /** @class */ (function (_super) {\n __extends$1Z(TreemapSeriesNodeBaseClickEvent, _super);\n function TreemapSeriesNodeBaseClickEvent(labelKey, sizeKey, colorKey, nativeEvent, datum, series) {\n var _this = _super.call(this, nativeEvent, datum, series) || this;\n _this.labelKey = labelKey;\n _this.sizeKey = sizeKey;\n _this.colorKey = colorKey;\n return _this;\n }\n return TreemapSeriesNodeBaseClickEvent;\n}(SeriesNodeBaseClickEvent));\nvar TreemapSeriesNodeClickEvent = /** @class */ (function (_super) {\n __extends$1Z(TreemapSeriesNodeClickEvent, _super);\n function TreemapSeriesNodeClickEvent() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = 'nodeClick';\n return _this;\n }\n return TreemapSeriesNodeClickEvent;\n}(TreemapSeriesNodeBaseClickEvent));\nvar TreemapSeriesNodeDoubleClickEvent = /** @class */ (function (_super) {\n __extends$1Z(TreemapSeriesNodeDoubleClickEvent, _super);\n function TreemapSeriesNodeDoubleClickEvent() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = 'nodeDoubleClick';\n return _this;\n }\n return TreemapSeriesNodeDoubleClickEvent;\n}(TreemapSeriesNodeBaseClickEvent));\nvar TreemapSeriesLabel = /** @class */ (function (_super) {\n __extends$1Z(TreemapSeriesLabel, _super);\n function TreemapSeriesLabel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.padding = 10;\n return _this;\n }\n __decorate$1k([\n Validate(NUMBER(0))\n ], TreemapSeriesLabel.prototype, \"padding\", void 0);\n return TreemapSeriesLabel;\n}(Label$1));\nvar TreemapSeriesTileLabel = /** @class */ (function (_super) {\n __extends$1Z(TreemapSeriesTileLabel, _super);\n function TreemapSeriesTileLabel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.wrapping = 'on-space';\n return _this;\n }\n __decorate$1k([\n Validate(TEXT_WRAP)\n ], TreemapSeriesTileLabel.prototype, \"wrapping\", void 0);\n return TreemapSeriesTileLabel;\n}(Label$1));\nvar TreemapValueLabel = /** @class */ (function () {\n function TreemapValueLabel() {\n this.style = (function () {\n var label = new Label$1();\n label.color = 'white';\n return label;\n })();\n }\n __decorate$1k([\n Validate(OPT_STRING)\n ], TreemapValueLabel.prototype, \"key\", void 0);\n __decorate$1k([\n Validate(OPT_STRING)\n ], TreemapValueLabel.prototype, \"name\", void 0);\n __decorate$1k([\n Validate(OPT_FUNCTION)\n ], TreemapValueLabel.prototype, \"formatter\", void 0);\n return TreemapValueLabel;\n}());\nvar TextNodeTag;\n(function (TextNodeTag) {\n TextNodeTag[TextNodeTag[\"Name\"] = 0] = \"Name\";\n TextNodeTag[TextNodeTag[\"Value\"] = 1] = \"Value\";\n})(TextNodeTag || (TextNodeTag = {}));\nvar tempText = new Text();\nfunction getTextSize(text, style) {\n var fontStyle = style.fontStyle, fontWeight = style.fontWeight, fontSize = style.fontSize, fontFamily = style.fontFamily;\n tempText.fontStyle = fontStyle;\n tempText.fontWeight = fontWeight;\n tempText.fontSize = fontSize;\n tempText.fontFamily = fontFamily;\n tempText.text = text;\n tempText.x = 0;\n tempText.y = 0;\n tempText.textAlign = 'left';\n tempText.textBaseline = 'top';\n var _a = tempText.computeBBox(), width = _a.width, height = _a.height;\n return { width: width, height: height };\n}\nfunction validateColor(color) {\n if (typeof color === 'string' && !Color.validColorString(color)) {\n var fallbackColor = 'black';\n Logger.warnOnce(\"invalid Treemap tile colour string \\\"\" + color + \"\\\". Affected treemap tiles will be coloured \" + fallbackColor + \".\");\n return 'black';\n }\n return color;\n}\nvar TreemapTextHighlightStyle = /** @class */ (function () {\n function TreemapTextHighlightStyle() {\n this.color = 'black';\n }\n __decorate$1k([\n Validate(OPT_COLOR_STRING)\n ], TreemapTextHighlightStyle.prototype, \"color\", void 0);\n return TreemapTextHighlightStyle;\n}());\nvar TreemapHighlightStyle = /** @class */ (function (_super) {\n __extends$1Z(TreemapHighlightStyle, _super);\n function TreemapHighlightStyle() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.text = new TreemapTextHighlightStyle();\n return _this;\n }\n return TreemapHighlightStyle;\n}(HighlightStyle));\nvar TreemapSeries = /** @class */ (function (_super) {\n __extends$1Z(TreemapSeries, _super);\n function TreemapSeries() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.groupSelection = Selection.select(_this.contentGroup, Group);\n _this.highlightSelection = Selection.select(_this.highlightGroup, Group);\n _this.title = (function () {\n var label = new TreemapSeriesLabel();\n label.color = 'white';\n label.fontWeight = 'bold';\n label.fontSize = 12;\n label.fontFamily = 'Verdana, sans-serif';\n label.padding = 15;\n return label;\n })();\n _this.subtitle = (function () {\n var label = new TreemapSeriesLabel();\n label.color = 'white';\n label.fontSize = 9;\n label.fontFamily = 'Verdana, sans-serif';\n label.padding = 13;\n return label;\n })();\n _this.labels = {\n large: (function () {\n var label = new TreemapSeriesTileLabel();\n label.color = 'white';\n label.fontWeight = 'bold';\n label.fontSize = 18;\n return label;\n })(),\n medium: (function () {\n var label = new TreemapSeriesTileLabel();\n label.color = 'white';\n label.fontWeight = 'bold';\n label.fontSize = 14;\n return label;\n })(),\n small: (function () {\n var label = new TreemapSeriesTileLabel();\n label.color = 'white';\n label.fontWeight = 'bold';\n label.fontSize = 10;\n return label;\n })(),\n formatter: undefined,\n value: new TreemapValueLabel(),\n };\n _this.nodePadding = 2;\n _this.nodeGap = 0;\n _this.labelKey = 'label';\n _this.sizeKey = 'size';\n _this.colorKey = 'color';\n _this.colorDomain = [-5, 5];\n _this.colorRange = ['#cb4b3f', '#6acb64'];\n _this.groupFill = '#272931';\n _this.groupStroke = 'black';\n _this.groupStrokeWidth = 1;\n _this.tileStroke = 'black';\n _this.tileStrokeWidth = 1;\n _this.gradient = true;\n _this.formatter = undefined;\n _this.colorName = 'Change';\n _this.rootName = 'Root';\n _this.highlightGroups = true;\n _this.tileShadow = new DropShadow();\n _this.labelShadow = new DropShadow();\n _this.tooltip = new TreemapSeriesTooltip();\n _this.highlightStyle = new TreemapHighlightStyle();\n return _this;\n }\n TreemapSeries.prototype.getNodePaddingTop = function (nodeDatum, bbox) {\n var _a;\n var _b = this, title = _b.title, subtitle = _b.subtitle, nodePadding = _b.nodePadding;\n var label = nodeDatum.label;\n if (nodeDatum.isLeaf || !label || nodeDatum.depth === 0) {\n return nodePadding;\n }\n var font = nodeDatum.depth > 1 ? subtitle : title;\n var textSize = getTextSize(label, font);\n var heightRatioThreshold = 3;\n if (font.fontSize > bbox.width / heightRatioThreshold || font.fontSize > bbox.height / heightRatioThreshold) {\n return nodePadding;\n }\n if (textSize.height >= bbox.height) {\n return nodePadding;\n }\n return textSize.height + nodePadding + ((_a = font.padding) !== null && _a !== void 0 ? _a : 0);\n };\n TreemapSeries.prototype.getNodePadding = function (nodeDatum, bbox) {\n var nodePadding = this.nodePadding;\n var top = this.getNodePaddingTop(nodeDatum, bbox);\n return {\n top: top,\n right: nodePadding,\n bottom: nodePadding,\n left: nodePadding,\n };\n };\n /**\n * Squarified Treemap algorithm\n * https://www.win.tue.nl/~vanwijk/stm.pdf\n */\n TreemapSeries.prototype.squarify = function (nodeDatum, bbox, outputNodesBoxes) {\n if (outputNodesBoxes === void 0) { outputNodesBoxes = new Map(); }\n if (bbox.width <= 0 || bbox.height <= 0) {\n return outputNodesBoxes;\n }\n outputNodesBoxes.set(nodeDatum, bbox);\n var targetTileAspectRatio = 1; // The width and height will tend to this ratio\n var padding = this.getNodePadding(nodeDatum, bbox);\n var width = bbox.width - padding.left - padding.right;\n var height = bbox.height - padding.top - padding.bottom;\n if (width <= 0 || height <= 0 || nodeDatum.value <= 0) {\n return outputNodesBoxes;\n }\n var stackSum = 0;\n var startIndex = 0;\n var minRatioDiff = Infinity;\n var partitionSum = nodeDatum.value;\n var children = nodeDatum.children;\n var innerBox = new BBox(bbox.x + padding.left, bbox.y + padding.top, width, height);\n var partition = innerBox.clone();\n for (var i = 0; i < children.length; i++) {\n var value = children[i].value;\n var firstValue = children[startIndex].value;\n var isVertical_1 = partition.width < partition.height;\n stackSum += value;\n var partThickness = isVertical_1 ? partition.height : partition.width;\n var partLength = isVertical_1 ? partition.width : partition.height;\n var firstTileLength = (partLength * firstValue) / stackSum;\n var stackThickness = (partThickness * stackSum) / partitionSum;\n var ratio = Math.max(firstTileLength, stackThickness) / Math.min(firstTileLength, stackThickness);\n var diff = Math.abs(targetTileAspectRatio - ratio);\n if (diff < minRatioDiff) {\n minRatioDiff = diff;\n continue;\n }\n // Go one step back and process the best match\n stackSum -= value;\n stackThickness = (partThickness * stackSum) / partitionSum;\n var start_1 = isVertical_1 ? partition.x : partition.y;\n for (var j = startIndex; j < i; j++) {\n var child = children[j];\n var x = isVertical_1 ? start_1 : partition.x;\n var y = isVertical_1 ? partition.y : start_1;\n var length_1 = (partLength * child.value) / stackSum;\n var width_1 = isVertical_1 ? length_1 : stackThickness;\n var height_1 = isVertical_1 ? stackThickness : length_1;\n var childBox = new BBox(x, y, width_1, height_1);\n this.applyGap(innerBox, childBox);\n this.squarify(child, childBox, outputNodesBoxes);\n partitionSum -= child.value;\n start_1 += length_1;\n }\n if (isVertical_1) {\n partition.y += stackThickness;\n partition.height -= stackThickness;\n }\n else {\n partition.x += stackThickness;\n partition.width -= stackThickness;\n }\n startIndex = i;\n stackSum = 0;\n minRatioDiff = Infinity;\n i--;\n }\n // Process remaining space\n var isVertical = partition.width < partition.height;\n var start = isVertical ? partition.x : partition.y;\n for (var i = startIndex; i < children.length; i++) {\n var x = isVertical ? start : partition.x;\n var y = isVertical ? partition.y : start;\n var part = children[i].value / partitionSum;\n var width_2 = partition.width * (isVertical ? part : 1);\n var height_2 = partition.height * (isVertical ? 1 : part);\n var childBox = new BBox(x, y, width_2, height_2);\n this.applyGap(innerBox, childBox);\n this.squarify(children[i], childBox, outputNodesBoxes);\n start += isVertical ? width_2 : height_2;\n }\n return outputNodesBoxes;\n };\n TreemapSeries.prototype.applyGap = function (innerBox, childBox) {\n var gap = this.nodeGap / 2;\n var getBounds = function (box) {\n return {\n left: box.x,\n top: box.y,\n right: box.x + box.width,\n bottom: box.y + box.height,\n };\n };\n var innerBounds = getBounds(innerBox);\n var childBounds = getBounds(childBox);\n var sides = Object.keys(innerBounds);\n sides.forEach(function (side) {\n if (!isEqual(innerBounds[side], childBounds[side])) {\n childBox.shrink(gap, side);\n }\n });\n };\n TreemapSeries.prototype.processData = function () {\n return __awaiter$1(this, void 0, void 0, function () {\n var _a, data, sizeKey, labelKey, colorKey, colorDomain, colorRange, groupFill, labelFormatter, colorScale, createTreeNodeDatum;\n var _this = this;\n return __generator$1(this, function (_b) {\n if (!this.data) {\n return [2 /*return*/];\n }\n _a = this, data = _a.data, sizeKey = _a.sizeKey, labelKey = _a.labelKey, colorKey = _a.colorKey, colorDomain = _a.colorDomain, colorRange = _a.colorRange, groupFill = _a.groupFill;\n labelFormatter = this.labels.formatter;\n colorScale = new ColorScale();\n colorScale.domain = colorDomain;\n colorScale.range = colorRange;\n colorScale.update();\n createTreeNodeDatum = function (datum, depth, parent) {\n var _a, _b, _c, _d;\n if (depth === void 0) { depth = 0; }\n var label;\n if (labelFormatter) {\n label = _this.ctx.callbackCache.call(labelFormatter, { datum: datum });\n }\n if (label !== undefined) ;\n else if (labelKey) {\n label = (_a = datum[labelKey]) !== null && _a !== void 0 ? _a : '';\n }\n else {\n label = '';\n }\n var colorScaleValue = colorKey ? (_b = datum[colorKey]) !== null && _b !== void 0 ? _b : depth : depth;\n colorScaleValue = validateColor(colorScaleValue);\n var isLeaf = !datum.children;\n var fill = groupFill;\n if (typeof colorScaleValue === 'string') {\n fill = colorScaleValue;\n }\n else if (isLeaf || !groupFill) {\n fill = colorScale.convert(colorScaleValue);\n }\n var nodeDatum = {\n datum: datum,\n depth: depth,\n parent: parent,\n value: 0,\n label: label,\n fill: fill,\n series: _this,\n isLeaf: isLeaf,\n children: [],\n };\n if (isLeaf) {\n nodeDatum.value = sizeKey ? (_c = datum[sizeKey]) !== null && _c !== void 0 ? _c : 1 : 1;\n }\n else {\n (_d = datum.children) === null || _d === void 0 ? void 0 : _d.forEach(function (child) {\n var childNodeDatum = createTreeNodeDatum(child, depth + 1, nodeDatum);\n var value = childNodeDatum.value;\n if (isNaN(value) || !isFinite(value) || value === 0) {\n return;\n }\n nodeDatum.value += value;\n nodeDatum.children.push(childNodeDatum);\n });\n nodeDatum.children.sort(function (a, b) {\n return b.value - a.value;\n });\n }\n return nodeDatum;\n };\n this.dataRoot = createTreeNodeDatum(data);\n return [2 /*return*/];\n });\n });\n };\n TreemapSeries.prototype.createNodeData = function () {\n return __awaiter$1(this, void 0, void 0, function () {\n return __generator$1(this, function (_a) {\n return [2 /*return*/, []];\n });\n });\n };\n TreemapSeries.prototype.update = function () {\n return __awaiter$1(this, void 0, void 0, function () {\n return __generator$1(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.updateSelections()];\n case 1:\n _a.sent();\n return [4 /*yield*/, this.updateNodes()];\n case 2:\n _a.sent();\n return [2 /*return*/];\n }\n });\n });\n };\n TreemapSeries.prototype.updateSelections = function () {\n return __awaiter$1(this, void 0, void 0, function () {\n var _a, chart, dataRoot, seriesRect, descendants, traverse, _b, groupSelection, highlightSelection, update;\n return __generator$1(this, function (_c) {\n if (!this.nodeDataRefresh) {\n return [2 /*return*/];\n }\n this.nodeDataRefresh = false;\n _a = this, chart = _a.chart, dataRoot = _a.dataRoot;\n if (!chart || !dataRoot) {\n return [2 /*return*/];\n }\n seriesRect = chart.getSeriesRect();\n if (!seriesRect) {\n return [2 /*return*/];\n }\n descendants = [];\n traverse = function (datum) {\n var _a;\n descendants.push(datum);\n (_a = datum.children) === null || _a === void 0 ? void 0 : _a.forEach(traverse);\n };\n traverse(dataRoot);\n _b = this, groupSelection = _b.groupSelection, highlightSelection = _b.highlightSelection;\n update = function (selection) {\n return selection.update(descendants, function (group) {\n var rect = new Rect();\n var nameLabel = new Text();\n nameLabel.tag = TextNodeTag.Name;\n var valueLabel = new Text();\n valueLabel.tag = TextNodeTag.Value;\n group.append([rect, nameLabel, valueLabel]);\n });\n };\n this.groupSelection = update(groupSelection);\n this.highlightSelection = update(highlightSelection);\n return [2 /*return*/];\n });\n });\n };\n TreemapSeries.prototype.isDatumHighlighted = function (datum) {\n var _a;\n var highlightedDatum = (_a = this.ctx.highlightManager) === null || _a === void 0 ? void 0 : _a.getActiveHighlight();\n return datum === highlightedDatum && (datum.isLeaf || this.highlightGroups);\n };\n TreemapSeries.prototype.getTileFormat = function (datum, isHighlighted) {\n var _a;\n var _b = this, formatter = _b.formatter, callbackCache = _b.ctx.callbackCache;\n if (!formatter) {\n return {};\n }\n var _c = this, gradient = _c.gradient, colorKey = _c.colorKey, labelKey = _c.labelKey, sizeKey = _c.sizeKey, tileStroke = _c.tileStroke, tileStrokeWidth = _c.tileStrokeWidth, groupStroke = _c.groupStroke, groupStrokeWidth = _c.groupStrokeWidth;\n var stroke = datum.isLeaf ? tileStroke : groupStroke;\n var strokeWidth = datum.isLeaf ? tileStrokeWidth : groupStrokeWidth;\n var result = callbackCache.call(formatter, {\n seriesId: this.id,\n datum: datum.datum,\n depth: datum.depth,\n parent: (_a = datum.parent) === null || _a === void 0 ? void 0 : _a.datum,\n colorKey: colorKey,\n sizeKey: sizeKey,\n labelKey: labelKey,\n fill: datum.fill,\n stroke: stroke,\n strokeWidth: strokeWidth,\n gradient: gradient,\n highlighted: isHighlighted,\n });\n return result !== null && result !== void 0 ? result : {};\n };\n TreemapSeries.prototype.updateNodes = function () {\n return __awaiter$1(this, void 0, void 0, function () {\n var _a, gradient, _b, _c, highlightedFill, highlightedFillOpacity, highlightedStroke, highlightedDatumStrokeWidth, highlightedTextColor, tileStroke, tileStrokeWidth, groupStroke, groupStrokeWidth, tileShadow, labelShadow, dataRoot, seriesRect, boxes, labelMeta, highlightedSubtree, updateRectFn, updateLabelFn;\n var _this = this;\n return __generator$1(this, function (_d) {\n if (!this.chart)\n return [2 /*return*/];\n _a = this, gradient = _a.gradient, _b = _a.highlightStyle, _c = _b.item, highlightedFill = _c.fill, highlightedFillOpacity = _c.fillOpacity, highlightedStroke = _c.stroke, highlightedDatumStrokeWidth = _c.strokeWidth, highlightedTextColor = _b.text.color, tileStroke = _a.tileStroke, tileStrokeWidth = _a.tileStrokeWidth, groupStroke = _a.groupStroke, groupStrokeWidth = _a.groupStrokeWidth, tileShadow = _a.tileShadow, labelShadow = _a.labelShadow, dataRoot = _a.dataRoot;\n if (!dataRoot)\n return [2 /*return*/];\n seriesRect = this.chart.getSeriesRect();\n boxes = this.squarify(dataRoot, new BBox(0, 0, seriesRect.width, seriesRect.height));\n labelMeta = this.buildLabelMeta(boxes);\n highlightedSubtree = this.getHighlightedSubtree(dataRoot);\n this.updateNodeMidPoint(boxes);\n updateRectFn = function (rect, datum, isDatumHighlighted) {\n var _a, _b, _c, _d, _e, _f;\n var box = boxes.get(datum);\n if (!box) {\n rect.visible = false;\n return;\n }\n var fill = isDatumHighlighted && highlightedFill !== undefined ? highlightedFill : datum.fill;\n var fillOpacity = (_a = (isDatumHighlighted ? highlightedFillOpacity : 1)) !== null && _a !== void 0 ? _a : 1;\n var stroke = groupStroke;\n if (isDatumHighlighted && highlightedStroke !== undefined) {\n stroke = highlightedStroke;\n }\n else if (datum.isLeaf) {\n stroke = tileStroke;\n }\n var strokeWidth = groupStrokeWidth;\n if (isDatumHighlighted && highlightedDatumStrokeWidth !== undefined) {\n strokeWidth = highlightedDatumStrokeWidth;\n }\n else if (datum.isLeaf) {\n strokeWidth = tileStrokeWidth;\n }\n var format = _this.getTileFormat(datum, isDatumHighlighted);\n var fillColor = validateColor((_b = format === null || format === void 0 ? void 0 : format.fill) !== null && _b !== void 0 ? _b : fill);\n if ((_c = format === null || format === void 0 ? void 0 : format.gradient) !== null && _c !== void 0 ? _c : gradient) {\n var start = Color.tryParseFromString(fill).brighter().toString();\n var end = Color.tryParseFromString(fill).darker().toString();\n rect.fill = \"linear-gradient(180deg, \" + start + \", \" + end + \")\";\n }\n else {\n rect.fill = fillColor;\n }\n rect.fillOpacity = (_d = format === null || format === void 0 ? void 0 : format.fillOpacity) !== null && _d !== void 0 ? _d : fillOpacity;\n rect.stroke = validateColor((_e = format === null || format === void 0 ? void 0 : format.stroke) !== null && _e !== void 0 ? _e : stroke);\n rect.strokeWidth = (_f = format === null || format === void 0 ? void 0 : format.strokeWidth) !== null && _f !== void 0 ? _f : strokeWidth;\n rect.fillShadow = tileShadow;\n rect.crisp = true;\n rect.x = box.x;\n rect.y = box.y;\n rect.width = box.width;\n rect.height = box.height;\n rect.visible = true;\n };\n this.groupSelection.selectByClass(Rect).forEach(function (rect) { return updateRectFn(rect, rect.datum, false); });\n this.highlightSelection.selectByClass(Rect).forEach(function (rect) {\n var isDatumHighlighted = _this.isDatumHighlighted(rect.datum);\n rect.visible = isDatumHighlighted || highlightedSubtree.has(rect.datum);\n if (rect.visible) {\n updateRectFn(rect, rect.datum, isDatumHighlighted);\n }\n });\n updateLabelFn = function (text, datum, highlighted, key) {\n var meta = labelMeta.get(datum);\n var label = meta === null || meta === void 0 ? void 0 : meta[key];\n if (!label) {\n text.visible = false;\n return;\n }\n text.text = label.text;\n text.fontFamily = label.style.fontFamily;\n text.fontSize = label.style.fontSize;\n text.fontWeight = label.style.fontWeight;\n text.fill = highlighted ? highlightedTextColor !== null && highlightedTextColor !== void 0 ? highlightedTextColor : label.style.color : label.style.color;\n text.fillShadow = highlighted ? undefined : labelShadow;\n text.textAlign = label.hAlign;\n text.textBaseline = label.vAlign;\n text.x = label.x;\n text.y = label.y;\n text.visible = true;\n };\n this.groupSelection\n .selectByTag(TextNodeTag.Name)\n .forEach(function (text) { return updateLabelFn(text, text.datum, false, 'label'); });\n this.highlightSelection.selectByTag(TextNodeTag.Name).forEach(function (text) {\n var isDatumHighlighted = _this.isDatumHighlighted(text.datum);\n text.visible = isDatumHighlighted || highlightedSubtree.has(text.datum);\n if (text.visible) {\n updateLabelFn(text, text.datum, isDatumHighlighted, 'label');\n }\n });\n this.groupSelection\n .selectByTag(TextNodeTag.Value)\n .forEach(function (text) { return updateLabelFn(text, text.datum, false, 'value'); });\n this.highlightSelection.selectByTag(TextNodeTag.Value).forEach(function (text) {\n var isDatumHighlighted = _this.isDatumHighlighted(text.datum);\n text.visible = isDatumHighlighted || highlightedSubtree.has(text.datum);\n if (text.visible) {\n updateLabelFn(text, text.datum, isDatumHighlighted, 'value');\n }\n });\n return [2 /*return*/];\n });\n });\n };\n TreemapSeries.prototype.updateNodeMidPoint = function (boxes) {\n boxes.forEach(function (box, treeNodeDatum) {\n treeNodeDatum.nodeMidPoint = {\n x: box.x + box.width / 2,\n y: box.y,\n };\n });\n };\n TreemapSeries.prototype.getHighlightedSubtree = function (dataRoot) {\n var _this = this;\n var items = new Set();\n var traverse = function (datum) {\n var _a;\n if (_this.isDatumHighlighted(datum) || (datum.parent && items.has(datum.parent))) {\n items.add(datum);\n }\n (_a = datum.children) === null || _a === void 0 ? void 0 : _a.forEach(traverse);\n };\n traverse(dataRoot);\n return items;\n };\n TreemapSeries.prototype.buildLabelMeta = function (boxes) {\n var _a = this, labels = _a.labels, title = _a.title, subtitle = _a.subtitle, nodePadding = _a.nodePadding, labelKey = _a.labelKey, callbackCache = _a.ctx.callbackCache;\n var wrappedRegExp = /-$/m;\n var labelMeta = new Map();\n boxes.forEach(function (box, datum) {\n var _a, _b, _c;\n if (!labelKey || datum.depth === 0) {\n return;\n }\n var availTextWidth = box.width - 2 * nodePadding;\n var availTextHeight = box.height - 2 * nodePadding;\n var isBoxTooSmall = function (labelStyle) {\n var minSizeRatio = 3;\n return (labelStyle.fontSize > box.width / minSizeRatio || labelStyle.fontSize > box.height / minSizeRatio);\n };\n var labelText = datum.isLeaf ? datum.label : datum.label.toUpperCase();\n var valueText = '';\n var valueConfig = labels.value;\n var valueStyle = valueConfig.style;\n var valueMargin = Math.ceil(valueStyle.fontSize * 2 * (Text.defaultLineHeightRatio - 1));\n if (datum.isLeaf) {\n if (valueConfig.formatter) {\n valueText = (_a = callbackCache.call(valueConfig.formatter, { datum: datum.datum })) !== null && _a !== void 0 ? _a : '';\n }\n else if (valueConfig.key) {\n valueText = datum.datum[valueConfig.key];\n }\n }\n var valueSize = getTextSize(valueText, valueStyle);\n if (valueText && valueSize.width > availTextWidth) {\n valueText = '';\n }\n var labelStyle;\n var wrappedText = '';\n if (datum.isLeaf) {\n var pickStyle = function () {\n var e_1, _a;\n var availHeight = availTextHeight - (valueText ? valueStyle.fontSize + valueMargin : 0);\n var labelStyles = [labels.large, labels.medium, labels.small];\n try {\n for (var labelStyles_1 = __values$f(labelStyles), labelStyles_1_1 = labelStyles_1.next(); !labelStyles_1_1.done; labelStyles_1_1 = labelStyles_1.next()) {\n var style = labelStyles_1_1.value;\n var _b = getTextSize(labelText, style), width = _b.width, height = _b.height;\n if (height > availHeight || isBoxTooSmall(style)) {\n continue;\n }\n if (width <= availTextWidth) {\n return { style: style, wrappedText: undefined };\n }\n // Avoid hyphens and ellipsis for large and medium label styles\n var wrapped = Text.wrap(labelText, availTextWidth, availHeight, style, style.wrapping);\n if (wrapped &&\n wrapped !== '\\u2026' &&\n (style === labels.small || !(wrappedRegExp.exec(wrapped) || wrapped.endsWith('\\u2026')))) {\n return { style: style, wrappedText: wrapped };\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (labelStyles_1_1 && !labelStyles_1_1.done && (_a = labelStyles_1.return)) _a.call(labelStyles_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n // Check if small font fits by height\n var smallSize = getTextSize(labelText, labels.small);\n if (smallSize.height <= availHeight && !isBoxTooSmall(labels.small)) {\n return { style: labels.small, wrappedText: undefined };\n }\n return { style: undefined, wrappedText: undefined };\n };\n var result = pickStyle();\n if (!result.style && valueText) {\n valueText = '';\n result = pickStyle();\n }\n labelStyle = (_b = result.style) !== null && _b !== void 0 ? _b : labels.small;\n wrappedText = (_c = result.wrappedText) !== null && _c !== void 0 ? _c : '';\n }\n else if (datum.depth === 1) {\n labelStyle = title;\n }\n else {\n labelStyle = subtitle;\n }\n var labelSize = getTextSize(wrappedText || labelText, labelStyle);\n if (isBoxTooSmall(labelStyle)) {\n // Avoid labels on too small tiles\n return;\n }\n // Crop text if not enough space\n if (labelSize.width > availTextWidth) {\n var textLength = Math.floor((labelText.length * availTextWidth) / labelSize.width) - 1;\n labelText = labelText.substring(0, textLength).trim() + \"\\u2026\";\n }\n valueSize = getTextSize(valueText, valueStyle);\n var hasValueText = valueText &&\n valueSize.width < availTextWidth &&\n valueSize.height + labelSize.height + valueMargin < availTextHeight;\n labelMeta.set(datum, {\n label: __assign$w({ text: wrappedText || labelText, style: labelStyle }, (datum.isLeaf\n ? {\n hAlign: 'center',\n vAlign: 'middle',\n x: box.x + box.width / 2,\n y: box.y + box.height / 2 - (hasValueText ? valueSize.height / 2 + valueMargin / 2 : 0),\n }\n : {\n hAlign: 'left',\n vAlign: 'top',\n x: box.x + nodePadding,\n y: box.y + nodePadding,\n })),\n value: hasValueText\n ? {\n text: valueText,\n style: valueStyle,\n hAlign: 'center',\n vAlign: 'middle',\n x: box.x + box.width / 2,\n y: box.y + box.height / 2 + labelSize.height / 2 + valueMargin / 2,\n }\n : undefined,\n });\n });\n return labelMeta;\n };\n TreemapSeries.prototype.getDomain = function (_direction) {\n return [0, 1];\n };\n TreemapSeries.prototype.getNodeClickEvent = function (event, datum) {\n return new TreemapSeriesNodeClickEvent(this.labelKey, this.sizeKey, this.colorKey, event, datum, this);\n };\n TreemapSeries.prototype.getNodeDoubleClickEvent = function (event, datum) {\n return new TreemapSeriesNodeDoubleClickEvent(this.labelKey, this.sizeKey, this.colorKey, event, datum, this);\n };\n TreemapSeries.prototype.getTooltipHtml = function (nodeDatum) {\n var _a, _b, _c, _d;\n if (!this.highlightGroups && !nodeDatum.isLeaf) {\n return '';\n }\n var _e = this, tooltip = _e.tooltip, sizeKey = _e.sizeKey, labelKey = _e.labelKey, colorKey = _e.colorKey, rootName = _e.rootName, seriesId = _e.id, labels = _e.labels, callbackCache = _e.ctx.callbackCache;\n var datum = nodeDatum.datum;\n var tooltipRenderer = tooltip.renderer;\n var title = nodeDatum.depth ? datum[labelKey] : (_a = datum[labelKey]) !== null && _a !== void 0 ? _a : rootName;\n var content = '';\n var format = this.getTileFormat(nodeDatum, false);\n var color = (_c = (_b = format === null || format === void 0 ? void 0 : format.fill) !== null && _b !== void 0 ? _b : nodeDatum.fill) !== null && _c !== void 0 ? _c : 'gray';\n var valueKey = labels.value.key;\n var valueFormatter = labels.value.formatter;\n if (valueKey || valueFormatter) {\n var valueText = '';\n if (valueFormatter) {\n valueText = callbackCache.call(valueFormatter, { datum: datum });\n }\n else if (valueKey != null) {\n var value = datum[valueKey];\n if (typeof value === 'number' && isFinite(value)) {\n valueText = toFixed(value);\n }\n }\n if (valueText) {\n if (labels.value.name) {\n content += \"\" + labels.value.name + \": \";\n }\n content += valueText;\n }\n }\n var defaults = {\n title: title,\n backgroundColor: color,\n content: content,\n };\n if (tooltipRenderer) {\n return toTooltipHtml$1(tooltipRenderer({\n datum: nodeDatum.datum,\n parent: (_d = nodeDatum.parent) === null || _d === void 0 ? void 0 : _d.datum,\n depth: nodeDatum.depth,\n sizeKey: sizeKey,\n labelKey: labelKey,\n colorKey: colorKey,\n title: title,\n color: color,\n seriesId: seriesId,\n }), defaults);\n }\n if (!title && !content) {\n return '';\n }\n return toTooltipHtml$1(defaults);\n };\n TreemapSeries.prototype.getLegendData = function () {\n // Override point for subclasses.\n return [];\n };\n TreemapSeries.className = 'TreemapSeries';\n TreemapSeries.type = 'treemap';\n __decorate$1k([\n Validate(NUMBER(0))\n ], TreemapSeries.prototype, \"nodePadding\", void 0);\n __decorate$1k([\n Validate(NUMBER(0))\n ], TreemapSeries.prototype, \"nodeGap\", void 0);\n __decorate$1k([\n Validate(STRING)\n ], TreemapSeries.prototype, \"labelKey\", void 0);\n __decorate$1k([\n Validate(OPT_STRING)\n ], TreemapSeries.prototype, \"sizeKey\", void 0);\n __decorate$1k([\n Validate(OPT_STRING)\n ], TreemapSeries.prototype, \"colorKey\", void 0);\n __decorate$1k([\n Validate(NUMBER_ARRAY)\n ], TreemapSeries.prototype, \"colorDomain\", void 0);\n __decorate$1k([\n Validate(COLOR_STRING_ARRAY)\n ], TreemapSeries.prototype, \"colorRange\", void 0);\n __decorate$1k([\n Validate(OPT_STRING)\n ], TreemapSeries.prototype, \"groupFill\", void 0);\n __decorate$1k([\n Validate(OPT_COLOR_STRING)\n ], TreemapSeries.prototype, \"groupStroke\", void 0);\n __decorate$1k([\n Validate(OPT_NUMBER(0))\n ], TreemapSeries.prototype, \"groupStrokeWidth\", void 0);\n __decorate$1k([\n Validate(OPT_COLOR_STRING)\n ], TreemapSeries.prototype, \"tileStroke\", void 0);\n __decorate$1k([\n Validate(OPT_NUMBER(0))\n ], TreemapSeries.prototype, \"tileStrokeWidth\", void 0);\n __decorate$1k([\n Validate(BOOLEAN)\n ], TreemapSeries.prototype, \"gradient\", void 0);\n __decorate$1k([\n Validate(OPT_FUNCTION)\n ], TreemapSeries.prototype, \"formatter\", void 0);\n __decorate$1k([\n Validate(STRING)\n ], TreemapSeries.prototype, \"colorName\", void 0);\n __decorate$1k([\n Validate(STRING)\n ], TreemapSeries.prototype, \"rootName\", void 0);\n __decorate$1k([\n Validate(OPT_BOOLEAN)\n ], TreemapSeries.prototype, \"highlightGroups\", void 0);\n return TreemapSeries;\n}(HierarchySeries));\n\nvar TYPES = {\n area: 'cartesian',\n bar: 'cartesian',\n column: 'cartesian',\n histogram: 'cartesian',\n line: 'cartesian',\n scatter: 'cartesian',\n treemap: 'hierarchy',\n pie: 'polar',\n};\nvar DEFAULTS = {};\nvar CHART_TYPES = {\n has: function (seriesType) {\n return Object.prototype.hasOwnProperty.call(TYPES, seriesType);\n },\n isCartesian: function (seriesType) {\n return TYPES[seriesType] === 'cartesian';\n },\n isPolar: function (seriesType) {\n return TYPES[seriesType] === 'polar';\n },\n isHierarchy: function (seriesType) {\n return TYPES[seriesType] === 'hierarchy';\n },\n get seriesTypes() {\n return Object.keys(TYPES);\n },\n get cartesianTypes() {\n var _this = this;\n return this.seriesTypes.filter(function (t) { return _this.isCartesian(t); });\n },\n get polarTypes() {\n var _this = this;\n return this.seriesTypes.filter(function (t) { return _this.isPolar(t); });\n },\n get hierarchyTypes() {\n var _this = this;\n return this.seriesTypes.filter(function (t) { return _this.isHierarchy(t); });\n },\n};\nfunction registerChartSeriesType(seriesType, chartType) {\n TYPES[seriesType] = chartType;\n}\nfunction registerChartDefaults(chartType, defaults) {\n var _a;\n DEFAULTS[chartType] = jsonMerge([(_a = DEFAULTS[chartType]) !== null && _a !== void 0 ? _a : {}, defaults]);\n}\nfunction getChartDefaults(chartType) {\n var _a;\n return (_a = DEFAULTS[chartType]) !== null && _a !== void 0 ? _a : {};\n}\n\nvar BUILT_IN_SERIES_FACTORIES = {\n area: AreaSeries,\n bar: BarSeries,\n column: ColumnSeries,\n histogram: HistogramSeries,\n line: LineSeries,\n pie: PieSeries,\n scatter: ScatterSeries,\n treemap: TreemapSeries,\n};\nvar SERIES_FACTORIES = {};\nvar SERIES_DEFAULTS = {};\nvar SERIES_THEME_TEMPLATES = {};\nvar SERIES_PALETTE_FACTORIES = {};\nfunction registerSeries(seriesType, chartType, cstr, defaults, theme, paletteFactory) {\n SERIES_FACTORIES[seriesType] = cstr;\n SERIES_DEFAULTS[seriesType] = defaults;\n SERIES_THEME_TEMPLATES[seriesType] = theme;\n if (paletteFactory) {\n addSeriesPaletteFactory(seriesType, paletteFactory);\n }\n registerChartSeriesType(seriesType, chartType);\n}\nfunction getSeries(chartType, moduleCtx) {\n var _a;\n var seriesConstructor = (_a = SERIES_FACTORIES[chartType]) !== null && _a !== void 0 ? _a : BUILT_IN_SERIES_FACTORIES[chartType];\n if (seriesConstructor) {\n return new seriesConstructor(moduleCtx);\n }\n throw new Error(\"AG Charts - unknown series type: \" + chartType);\n}\nfunction getSeriesDefaults(chartType) {\n return SERIES_DEFAULTS[chartType];\n}\nfunction getSeriesThemeTemplate(chartType) {\n return SERIES_THEME_TEMPLATES[chartType];\n}\nfunction addSeriesPaletteFactory(seriesType, factory) {\n SERIES_PALETTE_FACTORIES[seriesType] = factory;\n}\nfunction getSeriesPaletteFactory(seriesType) {\n return SERIES_PALETTE_FACTORIES[seriesType];\n}\n\nvar DEFAULT_CARTESIAN_CHART_OVERRIDES = {\n axes: [\n {\n type: NumberAxis.type,\n position: 'left',\n },\n {\n type: CategoryAxis.type,\n position: 'bottom',\n },\n ],\n};\nvar DEFAULT_BAR_CHART_OVERRIDES = {\n axes: [\n {\n type: 'number',\n position: 'bottom',\n },\n {\n type: 'category',\n position: 'left',\n },\n ],\n};\nvar DEFAULT_SCATTER_HISTOGRAM_CHART_OVERRIDES = {\n axes: [\n {\n type: 'number',\n position: 'bottom',\n },\n {\n type: 'number',\n position: 'left',\n },\n ],\n};\n\nfunction deepMerge$1(target, source) {\n if (isPlainObject(target) && isPlainObject(source)) {\n var result_1 = {};\n Object.keys(target).forEach(function (key) {\n if (key in source) {\n result_1[key] = deepMerge$1(target[key], source[key]);\n }\n else {\n result_1[key] = target[key];\n }\n });\n Object.keys(source).forEach(function (key) {\n if (!(key in target)) {\n result_1[key] = source[key];\n }\n });\n return result_1;\n }\n if ((Array.isArray(target) && !Array.isArray(source)) || (isObject(target) && !isObject(source))) {\n return target;\n }\n return source;\n}\nfunction isObject(value) {\n return value && typeof value === 'object';\n}\nfunction isPlainObject(x) {\n return isObject(x) && x.constructor === Object;\n}\n\nvar __assign$v = (undefined && undefined.__assign) || function () {\n __assign$v = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$v.apply(this, arguments);\n};\nvar __read$t = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __values$e = (undefined && undefined.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nvar palette$8 = {\n fills: ['#f3622d', '#fba71b', '#57b757', '#41a9c9', '#4258c9', '#9a42c8', '#c84164', '#888888'],\n strokes: ['#aa4520', '#b07513', '#3d803d', '#2d768d', '#2e3e8d', '#6c2e8c', '#8c2d46', '#5f5f5f'],\n};\nvar EXTENDS_AXES_DEFAULTS = Symbol('extends-axes-defaults');\nvar EXTENDS_AXES_LABEL_DEFAULTS = Symbol('extends-axes-label-defaults');\nvar EXTENDS_AXES_LINE_DEFAULTS = Symbol('extends-axes-line-defaults');\nvar EXTENDS_SERIES_DEFAULTS = Symbol('extends-series-defaults');\nvar OVERRIDE_SERIES_LABEL_DEFAULTS = Symbol('override-series-label-defaults');\nvar DEFAULT_FONT_FAMILY = Symbol('default-font');\nvar BOLD = 'bold';\nvar INSIDE = 'inside';\nvar BOTTOM = 'bottom';\nvar ChartTheme = /** @class */ (function () {\n function ChartTheme(options) {\n options = deepMerge$1({}, options !== null && options !== void 0 ? options : {});\n var _a = options.overrides, overrides = _a === void 0 ? null : _a, _b = options.palette, palette = _b === void 0 ? null : _b;\n var defaults = this.createChartConfigPerChartType(this.getDefaults());\n if (overrides) {\n var common = overrides.common, cartesian = overrides.cartesian, polar = overrides.polar, hierarchy = overrides.hierarchy;\n var applyOverrides = function (type, seriesTypes, overrideOpts) {\n if (overrideOpts) {\n defaults[type] = deepMerge$1(defaults[type], overrideOpts);\n seriesTypes.forEach(function (s) {\n var seriesType = s;\n defaults[seriesType] = deepMerge$1(defaults[seriesType], overrideOpts);\n });\n }\n };\n applyOverrides('common', Object.keys(defaults), common);\n applyOverrides('cartesian', CHART_TYPES.cartesianTypes, cartesian);\n applyOverrides('polar', CHART_TYPES.polarTypes, polar);\n applyOverrides('hierarchy', CHART_TYPES.hierarchyTypes, hierarchy);\n CHART_TYPES.seriesTypes.forEach(function (s) {\n var _a;\n var seriesType = s;\n var chartConfig = overrides[seriesType];\n if (chartConfig) {\n if (chartConfig.series) {\n chartConfig.series = (_a = {}, _a[seriesType] = chartConfig.series, _a);\n }\n defaults[seriesType] = deepMerge$1(defaults[seriesType], chartConfig);\n }\n });\n }\n this.palette = palette !== null && palette !== void 0 ? palette : this.getPalette();\n this.config = Object.freeze(defaults);\n }\n ChartTheme.prototype.getPalette = function () {\n return palette$8;\n };\n ChartTheme.getAxisDefaults = function () {\n return {\n top: {},\n right: {},\n bottom: {},\n left: {},\n title: {\n enabled: false,\n text: 'Axis Title',\n fontStyle: undefined,\n fontWeight: BOLD,\n fontSize: 12,\n fontFamily: this.fontFamily,\n color: 'rgb(70, 70, 70)',\n },\n label: {\n fontStyle: undefined,\n fontWeight: undefined,\n fontSize: 12,\n fontFamily: this.fontFamily,\n padding: 5,\n rotation: undefined,\n color: 'rgb(87, 87, 87)',\n formatter: undefined,\n autoRotate: false,\n avoidCollisions: true,\n },\n line: {\n width: 1,\n color: 'rgb(195, 195, 195)',\n },\n tick: {\n width: 1,\n size: 6,\n color: 'rgb(195, 195, 195)',\n },\n gridStyle: [\n {\n stroke: 'rgb(219, 219, 219)',\n lineDash: [4, 2],\n },\n ],\n crossLines: {\n enabled: false,\n fill: 'rgb(187,221,232)',\n stroke: 'rgb(70,162,192)',\n strokeWidth: 1,\n label: {\n enabled: false,\n fontStyle: undefined,\n fontWeight: undefined,\n fontSize: 12,\n fontFamily: this.fontFamily,\n padding: 5,\n color: 'rgb(87, 87, 87)',\n rotation: undefined,\n },\n },\n };\n };\n ChartTheme.getSeriesDefaults = function () {\n return {\n tooltip: {\n enabled: true,\n renderer: undefined,\n },\n visible: true,\n showInLegend: true,\n highlightStyle: {\n item: {\n fill: 'yellow',\n fillOpacity: 1,\n },\n series: {\n dimOpacity: 1,\n },\n text: {\n color: 'black',\n },\n },\n nodeClickRange: 'exact',\n };\n };\n ChartTheme.getBarSeriesDefaults = function () {\n return __assign$v(__assign$v({}, this.getSeriesDefaults()), { fillOpacity: 1, strokeOpacity: 1, normalizedTo: undefined, strokeWidth: 1, lineDash: [0], lineDashOffset: 0, label: {\n enabled: false,\n fontStyle: undefined,\n fontWeight: undefined,\n fontSize: 12,\n fontFamily: this.fontFamily,\n color: 'rgb(70, 70, 70)',\n formatter: undefined,\n placement: INSIDE,\n }, shadow: {\n enabled: false,\n color: 'rgba(0, 0, 0, 0.5)',\n xOffset: 3,\n yOffset: 3,\n blur: 5,\n } });\n };\n ChartTheme.getLineSeriesDefaults = function () {\n var seriesDefaults = this.getSeriesDefaults();\n return __assign$v(__assign$v({}, seriesDefaults), { tooltip: __assign$v(__assign$v({}, seriesDefaults.tooltip), { format: undefined, position: {\n type: 'node',\n } }) });\n };\n ChartTheme.getAreaSeriesDefaults = function () {\n var seriesDefaults = this.getSeriesDefaults();\n return __assign$v(__assign$v({}, seriesDefaults), { nodeClickRange: 'nearest', tooltip: __assign$v(__assign$v({}, seriesDefaults.tooltip), { position: {\n type: 'node',\n } }) });\n };\n ChartTheme.getScatterSeriesDefaults = function () {\n var seriesDefaults = this.getSeriesDefaults();\n return __assign$v(__assign$v({}, seriesDefaults), { tooltip: __assign$v(__assign$v({}, seriesDefaults.tooltip), { position: {\n type: 'node',\n } }) });\n };\n ChartTheme.getCartesianSeriesMarkerDefaults = function () {\n return {\n enabled: true,\n shape: 'circle',\n size: 6,\n maxSize: 30,\n strokeWidth: 1,\n formatter: undefined,\n };\n };\n ChartTheme.getCaptionWrappingDefaults = function () {\n return 'hyphenate';\n };\n ChartTheme.getChartDefaults = function () {\n return {\n background: {\n visible: true,\n fill: 'white',\n },\n padding: {\n top: 20,\n right: 20,\n bottom: 20,\n left: 20,\n },\n title: {\n enabled: false,\n text: 'Title',\n fontStyle: undefined,\n fontWeight: BOLD,\n fontSize: 16,\n fontFamily: this.fontFamily,\n color: 'rgb(70, 70, 70)',\n wrapping: ChartTheme.getCaptionWrappingDefaults(),\n },\n subtitle: {\n enabled: false,\n text: 'Subtitle',\n fontStyle: undefined,\n fontWeight: undefined,\n fontSize: 12,\n fontFamily: this.fontFamily,\n color: 'rgb(140, 140, 140)',\n wrapping: ChartTheme.getCaptionWrappingDefaults(),\n },\n footnote: {\n enabled: false,\n text: 'Footnote',\n fontStyle: undefined,\n fontWeight: undefined,\n fontSize: 12,\n fontFamily: this.fontFamily,\n color: 'rgb(140, 140, 140)',\n spacing: 30,\n wrapping: ChartTheme.getCaptionWrappingDefaults(),\n },\n legend: {\n position: BOTTOM,\n spacing: 20,\n listeners: {},\n item: {\n paddingX: 16,\n paddingY: 8,\n marker: {\n shape: undefined,\n size: 15,\n strokeWidth: 1,\n padding: 8,\n },\n label: {\n color: 'black',\n fontStyle: undefined,\n fontWeight: undefined,\n fontSize: 12,\n fontFamily: this.fontFamily,\n formatter: undefined,\n },\n },\n reverseOrder: false,\n pagination: {\n marker: {\n size: 12,\n },\n activeStyle: {\n fill: 'rgb(70, 70, 70)',\n },\n inactiveStyle: {\n fill: 'rgb(219, 219, 219)',\n },\n highlightStyle: {\n fill: 'rgb(70, 70, 70)',\n },\n label: {\n color: 'rgb(70, 70, 70)',\n },\n },\n },\n tooltip: {\n enabled: true,\n range: 'nearest',\n delay: 0,\n },\n listeners: {},\n };\n };\n ChartTheme.prototype.createChartConfigPerChartType = function (config) {\n var _this = this;\n var typeToAliases = {\n cartesian: CHART_TYPES.cartesianTypes,\n polar: CHART_TYPES.polarTypes,\n hierarchy: CHART_TYPES.hierarchyTypes,\n groupedCategory: [],\n };\n Object.entries(typeToAliases).forEach(function (_a) {\n var _b = __read$t(_a, 2), nextType = _b[0], aliases = _b[1];\n var type = nextType;\n var typeDefaults = _this.templateTheme(getChartDefaults(type));\n aliases.forEach(function (next) {\n var alias = next;\n if (!config[alias]) {\n config[alias] = deepMerge$1({}, config[type]);\n deepMerge$1(config[alias], typeDefaults);\n }\n });\n });\n return config;\n };\n ChartTheme.prototype.getDefaults = function () {\n var _this = this;\n var defaults = deepMerge$1({}, ChartTheme.defaults);\n var getOverridesByType = function (chartType, seriesTypes) {\n var result = _this.templateTheme(getChartDefaults(chartType));\n result.series = seriesTypes.reduce(function (obj, seriesType) {\n var template = getSeriesThemeTemplate(seriesType);\n if (template) {\n obj[seriesType] = _this.templateTheme(template);\n }\n return obj;\n }, {});\n if (chartType === 'cartesian' || chartType === 'polar') {\n result.axes = AXIS_TYPES.axesTypes.reduce(function (obj, axisType) {\n var template = getAxisThemeTemplate(axisType);\n if (template) {\n obj[axisType] = _this.templateTheme(template);\n }\n return obj;\n }, {});\n }\n return result;\n };\n var extension = {\n cartesian: getOverridesByType('cartesian', CHART_TYPES.cartesianTypes),\n groupedCategory: getOverridesByType('cartesian', CHART_TYPES.cartesianTypes),\n polar: getOverridesByType('polar', CHART_TYPES.polarTypes),\n hierarchy: getOverridesByType('hierarchy', CHART_TYPES.hierarchyTypes),\n };\n return deepMerge$1(defaults, extension);\n };\n ChartTheme.prototype.templateTheme = function (themeTemplate) {\n var themeInstance = jsonMerge([themeTemplate]);\n var _a = this.getTemplateParameters(), extensions = _a.extensions, properties = _a.properties;\n jsonWalk(themeInstance, function (_, node) {\n var e_1, _a;\n if (node['__extends__']) {\n var key = node['__extends__'];\n var source_1 = extensions.get(key);\n if (source_1 == null) {\n throw new Error('AG Charts - no template variable provided for: ' + key);\n }\n Object.keys(source_1).forEach(function (key) {\n if (!(key in node)) {\n node[key] = source_1[key];\n }\n });\n delete node['__extends__'];\n }\n if (node['__overrides__']) {\n var key = node['__overrides__'];\n var source = extensions.get(key);\n if (source == null) {\n throw new Error('AG Charts - no template variable provided for: ' + key);\n }\n Object.assign(node, source);\n delete node['__overrides__'];\n }\n try {\n for (var _b = __values$e(Object.entries(node)), _c = _b.next(); !_c.done; _c = _b.next()) {\n var _d = __read$t(_c.value, 2), name_1 = _d[0], value = _d[1];\n if (properties.has(value)) {\n node[name_1] = properties.get(value);\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_1) throw e_1.error; }\n }\n }, {});\n return themeInstance;\n };\n ChartTheme.prototype.getTemplateParameters = function () {\n var extensions = new Map();\n extensions.set(EXTENDS_AXES_DEFAULTS, ChartTheme.getAxisDefaults());\n extensions.set(EXTENDS_AXES_LABEL_DEFAULTS, ChartTheme.getAxisDefaults().label);\n extensions.set(EXTENDS_AXES_LINE_DEFAULTS, ChartTheme.getAxisDefaults().line);\n extensions.set(EXTENDS_SERIES_DEFAULTS, ChartTheme.getSeriesDefaults());\n extensions.set(OVERRIDE_SERIES_LABEL_DEFAULTS, {});\n var properties = new Map();\n properties.set(DEFAULT_FONT_FAMILY, ChartTheme.fontFamily);\n return {\n extensions: extensions,\n properties: properties,\n };\n };\n ChartTheme.prototype.mergeWithParentDefaults = function (parentDefaults, defaults) {\n return deepMerge$1(parentDefaults, defaults);\n };\n ChartTheme.fontFamily = 'Verdana, sans-serif';\n ChartTheme.cartesianDefaults = __assign$v(__assign$v({}, ChartTheme.getChartDefaults()), { axes: {\n number: __assign$v({}, ChartTheme.getAxisDefaults()),\n log: __assign$v(__assign$v({}, ChartTheme.getAxisDefaults()), { base: 10 }),\n category: __assign$v(__assign$v({}, ChartTheme.getAxisDefaults()), { groupPaddingInner: 0.1, label: __assign$v(__assign$v({}, ChartTheme.getAxisDefaults().label), { autoRotate: true }) }),\n groupedCategory: __assign$v({}, ChartTheme.getAxisDefaults()),\n time: __assign$v({}, ChartTheme.getAxisDefaults()),\n }, series: {\n column: __assign$v({}, ChartTheme.getBarSeriesDefaults()),\n bar: __assign$v({}, ChartTheme.getBarSeriesDefaults()),\n line: __assign$v(__assign$v({}, ChartTheme.getLineSeriesDefaults()), { title: undefined, strokeWidth: 2, strokeOpacity: 1, lineDash: [0], lineDashOffset: 0, marker: __assign$v(__assign$v({}, ChartTheme.getCartesianSeriesMarkerDefaults()), { fillOpacity: 1, strokeOpacity: 1 }), label: {\n enabled: false,\n fontStyle: undefined,\n fontWeight: undefined,\n fontSize: 12,\n fontFamily: ChartTheme.fontFamily,\n color: 'rgb(70, 70, 70)',\n formatter: undefined,\n } }),\n scatter: __assign$v(__assign$v({}, ChartTheme.getScatterSeriesDefaults()), { sizeName: 'Size', labelName: 'Label', marker: __assign$v({}, ChartTheme.getCartesianSeriesMarkerDefaults()), label: {\n enabled: false,\n fontStyle: undefined,\n fontWeight: undefined,\n fontSize: 12,\n fontFamily: ChartTheme.fontFamily,\n color: 'rgb(70, 70, 70)',\n } }),\n area: __assign$v(__assign$v({}, ChartTheme.getAreaSeriesDefaults()), { normalizedTo: undefined, fillOpacity: 0.8, strokeOpacity: 1, strokeWidth: 2, lineDash: [0], lineDashOffset: 0, shadow: {\n enabled: false,\n color: 'rgba(0, 0, 0, 0.5)',\n xOffset: 3,\n yOffset: 3,\n blur: 5,\n }, marker: __assign$v(__assign$v({}, ChartTheme.getCartesianSeriesMarkerDefaults()), { fillOpacity: 1, strokeOpacity: 1, enabled: false }), label: {\n enabled: false,\n fontStyle: undefined,\n fontWeight: undefined,\n fontSize: 12,\n fontFamily: ChartTheme.fontFamily,\n color: 'rgb(70, 70, 70)',\n formatter: undefined,\n } }),\n histogram: __assign$v(__assign$v({}, ChartTheme.getSeriesDefaults()), { strokeWidth: 1, fillOpacity: 1, strokeOpacity: 1, lineDash: [0], lineDashOffset: 0, areaPlot: false, bins: undefined, aggregation: 'sum', label: {\n enabled: false,\n fontStyle: undefined,\n fontWeight: undefined,\n fontSize: 12,\n fontFamily: ChartTheme.fontFamily,\n color: 'rgb(70, 70, 70)',\n formatter: undefined,\n }, shadow: {\n enabled: true,\n color: 'rgba(0, 0, 0, 0.5)',\n xOffset: 0,\n yOffset: 0,\n blur: 5,\n } }),\n } });\n ChartTheme.polarDefaults = __assign$v(__assign$v({}, ChartTheme.getChartDefaults()), { series: {\n pie: __assign$v(__assign$v({}, ChartTheme.getSeriesDefaults()), { title: {\n enabled: true,\n fontStyle: undefined,\n fontWeight: 'bold',\n fontSize: 14,\n fontFamily: ChartTheme.fontFamily,\n color: 'rgb(70, 70, 70)',\n spacing: 0,\n }, radiusKey: undefined, radiusName: undefined, calloutLabelKey: undefined, calloutLabelName: undefined, sectorLabelKey: undefined, sectorLabelName: undefined, calloutLabel: {\n enabled: true,\n fontStyle: undefined,\n fontWeight: undefined,\n fontSize: 12,\n fontFamily: ChartTheme.fontFamily,\n color: 'rgb(70, 70, 70)',\n offset: 3,\n minAngle: 0,\n }, sectorLabel: {\n enabled: true,\n fontStyle: undefined,\n fontWeight: undefined,\n fontSize: 12,\n fontFamily: ChartTheme.fontFamily,\n color: 'rgb(70, 70, 70)',\n positionOffset: 0,\n positionRatio: 0.5,\n }, calloutLine: {\n length: 10,\n strokeWidth: 2,\n }, fillOpacity: 1, strokeOpacity: 1, strokeWidth: 1, lineDash: [0], lineDashOffset: 0, rotation: 0, outerRadiusOffset: 0, innerRadiusOffset: 0, shadow: {\n enabled: false,\n color: 'rgba(0, 0, 0, 0.5)',\n xOffset: 3,\n yOffset: 3,\n blur: 5,\n }, innerLabels: {\n fontStyle: undefined,\n fontWeight: undefined,\n fontSize: 12,\n fontFamily: ChartTheme.fontFamily,\n color: 'rgb(70, 70, 70)',\n margin: 2,\n } }),\n } });\n ChartTheme.hierarchyDefaults = __assign$v(__assign$v({}, ChartTheme.getChartDefaults()), { series: {\n treemap: __assign$v(__assign$v({}, ChartTheme.getSeriesDefaults()), { showInLegend: false, labelKey: 'label', sizeKey: 'size', colorKey: 'color', colorDomain: [-5, 5], colorRange: ['#cb4b3f', '#6acb64'], groupFill: '#272931', groupStroke: 'black', groupStrokeWidth: 1, tileStroke: 'black', tileStrokeWidth: 1, gradient: true, tileShadow: {\n enabled: false,\n color: 'rgba(0, 0, 0, 0.5)',\n xOffset: 3,\n yOffset: 3,\n blur: 5,\n }, labelShadow: {\n enabled: true,\n color: 'rgba(0, 0, 0, 0.4)',\n xOffset: 1.5,\n yOffset: 1.5,\n blur: 5,\n }, highlightGroups: true, nodePadding: 2, nodeGap: 0, title: {\n enabled: true,\n color: 'white',\n fontStyle: undefined,\n fontWeight: 'bold',\n fontSize: 12,\n fontFamily: 'Verdana, sans-serif',\n padding: 2,\n }, subtitle: {\n enabled: true,\n color: 'white',\n fontStyle: undefined,\n fontWeight: undefined,\n fontSize: 9,\n fontFamily: 'Verdana, sans-serif',\n padding: 2,\n }, labels: {\n large: {\n enabled: true,\n fontStyle: undefined,\n fontWeight: 'bold',\n fontSize: 18,\n fontFamily: 'Verdana, sans-serif',\n color: 'white',\n wrapping: 'on-space',\n },\n medium: {\n enabled: true,\n fontStyle: undefined,\n fontWeight: 'bold',\n fontSize: 14,\n fontFamily: 'Verdana, sans-serif',\n color: 'white',\n wrapping: 'on-space',\n },\n small: {\n enabled: true,\n fontStyle: undefined,\n fontWeight: 'bold',\n fontSize: 10,\n fontFamily: 'Verdana, sans-serif',\n color: 'white',\n wrapping: 'on-space',\n },\n value: {\n style: {\n enabled: true,\n fontStyle: undefined,\n fontWeight: undefined,\n fontSize: 12,\n fontFamily: 'Verdana, sans-serif',\n color: 'white',\n },\n },\n } }),\n } });\n ChartTheme.defaults = {\n cartesian: ChartTheme.cartesianDefaults,\n groupedCategory: ChartTheme.cartesianDefaults,\n polar: ChartTheme.polarDefaults,\n hierarchy: ChartTheme.hierarchyDefaults,\n };\n return ChartTheme;\n}());\n\nvar __extends$1Y = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign$u = (undefined && undefined.__assign) || function () {\n __assign$u = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$u.apply(this, arguments);\n};\nvar DarkTheme = /** @class */ (function (_super) {\n __extends$1Y(DarkTheme, _super);\n function DarkTheme(options) {\n return _super.call(this, options) || this;\n }\n DarkTheme.prototype.getDefaults = function () {\n var _this = this;\n var fontColor = DarkTheme.fontColor;\n var mutedFontColor = DarkTheme.mutedFontColor;\n var axisDefaults = {\n title: {\n color: fontColor,\n },\n label: {\n color: fontColor,\n },\n gridStyle: [\n {\n stroke: 'rgb(88, 88, 88)',\n lineDash: [4, 2],\n },\n ],\n };\n var seriesLabelDefaults = {\n label: {\n color: fontColor,\n },\n };\n var chartAxesDefaults = {\n axes: {\n number: __assign$u({}, axisDefaults),\n category: __assign$u({}, axisDefaults),\n time: __assign$u({}, axisDefaults),\n },\n };\n var chartDefaults = {\n background: {\n fill: 'rgb(34, 38, 41)',\n },\n title: {\n color: fontColor,\n },\n subtitle: {\n color: mutedFontColor,\n },\n legend: {\n item: {\n label: {\n color: fontColor,\n },\n },\n pagination: {\n activeStyle: {\n fill: fontColor,\n },\n inactiveStyle: {\n fill: mutedFontColor,\n },\n highlightStyle: {\n fill: fontColor,\n },\n label: {\n color: fontColor,\n },\n },\n },\n };\n var getOverridesByType = function (seriesTypes) {\n return seriesTypes.reduce(function (obj, seriesType) {\n var template = getSeriesThemeTemplate(seriesType);\n if (template) {\n obj[seriesType] = _this.templateTheme(template);\n }\n return obj;\n }, {});\n };\n return this.mergeWithParentDefaults(_super.prototype.getDefaults.call(this), {\n cartesian: __assign$u(__assign$u(__assign$u({}, chartDefaults), chartAxesDefaults), { series: __assign$u({ line: __assign$u({}, seriesLabelDefaults), bar: __assign$u({}, seriesLabelDefaults), column: __assign$u({}, seriesLabelDefaults), histogram: __assign$u({}, seriesLabelDefaults) }, getOverridesByType(CHART_TYPES.cartesianTypes)) }),\n groupedCategory: __assign$u(__assign$u(__assign$u({}, chartDefaults), chartAxesDefaults), { series: __assign$u({ bar: __assign$u({}, seriesLabelDefaults), column: __assign$u({}, seriesLabelDefaults), histogram: __assign$u({}, seriesLabelDefaults) }, getOverridesByType(CHART_TYPES.cartesianTypes)) }),\n polar: __assign$u(__assign$u({}, chartDefaults), { series: __assign$u({ pie: {\n calloutLabel: {\n color: fontColor,\n },\n sectorLabel: {\n color: fontColor,\n },\n title: {\n color: fontColor,\n },\n innerLabels: {\n color: fontColor,\n },\n } }, getOverridesByType(CHART_TYPES.polarTypes)) }),\n hierarchy: __assign$u(__assign$u({}, chartDefaults), { series: __assign$u({ treemap: {\n tileStroke: 'white',\n groupStroke: 'white',\n title: {\n color: fontColor,\n },\n subtitle: {\n color: mutedFontColor,\n },\n labels: {\n large: {\n color: fontColor,\n },\n medium: {\n color: fontColor,\n },\n small: {\n color: fontColor,\n },\n value: {\n style: {\n color: fontColor,\n },\n },\n },\n } }, getOverridesByType(CHART_TYPES.hierarchyTypes)) }),\n });\n };\n DarkTheme.prototype.getTemplateParameters = function () {\n var result = _super.prototype.getTemplateParameters.call(this);\n result.extensions.set(OVERRIDE_SERIES_LABEL_DEFAULTS, DarkTheme.seriesLabelDefaults.label);\n return result;\n };\n DarkTheme.fontColor = 'rgb(200, 200, 200)';\n DarkTheme.mutedFontColor = 'rgb(150, 150, 150)';\n DarkTheme.seriesLabelDefaults = {\n label: {\n color: DarkTheme.fontColor,\n },\n };\n return DarkTheme;\n}(ChartTheme));\n\nvar __extends$1X = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar palette$7 = {\n fills: [\n '#f44336',\n '#e91e63',\n '#9c27b0',\n '#673ab7',\n '#3f51b5',\n '#2196f3',\n '#03a9f4',\n '#00bcd4',\n '#009688',\n '#4caf50',\n '#8bc34a',\n '#cddc39',\n '#ffeb3b',\n '#ffc107',\n '#ff9800',\n '#ff5722',\n ],\n strokes: [\n '#ab2f26',\n '#a31545',\n '#6d1b7b',\n '#482980',\n '#2c397f',\n '#1769aa',\n '#0276ab',\n '#008494',\n '#00695f',\n '#357a38',\n '#618834',\n '#909a28',\n '#b3a429',\n '#b38705',\n '#b36a00',\n '#b33d18',\n ],\n};\nvar MaterialLight = /** @class */ (function (_super) {\n __extends$1X(MaterialLight, _super);\n function MaterialLight() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n MaterialLight.prototype.getPalette = function () {\n return palette$7;\n };\n return MaterialLight;\n}(ChartTheme));\n\nvar __extends$1W = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar palette$6 = {\n fills: [\n '#f44336',\n '#e91e63',\n '#9c27b0',\n '#673ab7',\n '#3f51b5',\n '#2196f3',\n '#03a9f4',\n '#00bcd4',\n '#009688',\n '#4caf50',\n '#8bc34a',\n '#cddc39',\n '#ffeb3b',\n '#ffc107',\n '#ff9800',\n '#ff5722',\n ],\n strokes: [\n '#ab2f26',\n '#a31545',\n '#6d1b7b',\n '#482980',\n '#2c397f',\n '#1769aa',\n '#0276ab',\n '#008494',\n '#00695f',\n '#357a38',\n '#618834',\n '#909a28',\n '#b3a429',\n '#b38705',\n '#b36a00',\n '#b33d18',\n ],\n};\nvar MaterialDark = /** @class */ (function (_super) {\n __extends$1W(MaterialDark, _super);\n function MaterialDark() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n MaterialDark.prototype.getPalette = function () {\n return palette$6;\n };\n return MaterialDark;\n}(DarkTheme));\n\nvar __extends$1V = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar palette$5 = {\n fills: ['#c16068', '#a2bf8a', '#ebcc87', '#80a0c3', '#b58dae', '#85c0d1'],\n strokes: ['#874349', '#718661', '#a48f5f', '#5a7088', '#7f637a', '#5d8692'],\n};\nvar PastelLight = /** @class */ (function (_super) {\n __extends$1V(PastelLight, _super);\n function PastelLight() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n PastelLight.prototype.getPalette = function () {\n return palette$5;\n };\n return PastelLight;\n}(ChartTheme));\n\nvar __extends$1U = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar palette$4 = {\n fills: ['#c16068', '#a2bf8a', '#ebcc87', '#80a0c3', '#b58dae', '#85c0d1'],\n strokes: ['#874349', '#718661', '#a48f5f', '#5a7088', '#7f637a', '#5d8692'],\n};\nvar PastelDark = /** @class */ (function (_super) {\n __extends$1U(PastelDark, _super);\n function PastelDark() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n PastelDark.prototype.getPalette = function () {\n return palette$4;\n };\n return PastelDark;\n}(DarkTheme));\n\nvar __extends$1T = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar palette$3 = {\n fills: [\n '#febe76',\n '#ff7979',\n '#badc58',\n '#f9ca23',\n '#f0932b',\n '#eb4c4b',\n '#6ab04c',\n '#7ed6df',\n '#e056fd',\n '#686de0',\n ],\n strokes: [\n '#b28553',\n '#b35555',\n '#829a3e',\n '#ae8d19',\n '#a8671e',\n '#a43535',\n '#4a7b35',\n '#58969c',\n '#9d3cb1',\n '#494c9d',\n ],\n};\nvar SolarLight = /** @class */ (function (_super) {\n __extends$1T(SolarLight, _super);\n function SolarLight() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n SolarLight.prototype.getPalette = function () {\n return palette$3;\n };\n return SolarLight;\n}(ChartTheme));\n\nvar __extends$1S = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar palette$2 = {\n fills: [\n '#febe76',\n '#ff7979',\n '#badc58',\n '#f9ca23',\n '#f0932b',\n '#eb4c4b',\n '#6ab04c',\n '#7ed6df',\n '#e056fd',\n '#686de0',\n ],\n strokes: [\n '#b28553',\n '#b35555',\n '#829a3e',\n '#ae8d19',\n '#a8671e',\n '#a43535',\n '#4a7b35',\n '#58969c',\n '#9d3cb1',\n '#494c9d',\n ],\n};\nvar SolarDark = /** @class */ (function (_super) {\n __extends$1S(SolarDark, _super);\n function SolarDark() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n SolarDark.prototype.getPalette = function () {\n return palette$2;\n };\n return SolarDark;\n}(DarkTheme));\n\nvar __extends$1R = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar palette$1 = {\n fills: ['#5BC0EB', '#FDE74C', '#9BC53D', '#E55934', '#FA7921', '#fa3081'],\n strokes: ['#4086a4', '#b1a235', '#6c8a2b', '#a03e24', '#af5517', '#af225a'],\n};\nvar VividLight = /** @class */ (function (_super) {\n __extends$1R(VividLight, _super);\n function VividLight() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n VividLight.prototype.getPalette = function () {\n return palette$1;\n };\n return VividLight;\n}(ChartTheme));\n\nvar __extends$1Q = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar palette = {\n fills: ['#5BC0EB', '#FDE74C', '#9BC53D', '#E55934', '#FA7921', '#fa3081'],\n strokes: ['#4086a4', '#b1a235', '#6c8a2b', '#a03e24', '#af5517', '#af225a'],\n};\nvar VividDark = /** @class */ (function (_super) {\n __extends$1Q(VividDark, _super);\n function VividDark() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n VividDark.prototype.getPalette = function () {\n return palette;\n };\n return VividDark;\n}(DarkTheme));\n\nvar __assign$t = (undefined && undefined.__assign) || function () {\n __assign$t = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$t.apply(this, arguments);\n};\nvar lightTheme = function () { return new ChartTheme(); };\nvar darkTheme = function () { return new DarkTheme(); };\nvar lightThemes = {\n undefined: lightTheme,\n null: lightTheme,\n 'ag-default': lightTheme,\n 'ag-material': function () { return new MaterialLight(); },\n 'ag-pastel': function () { return new PastelLight(); },\n 'ag-solar': function () { return new SolarLight(); },\n 'ag-vivid': function () { return new VividLight(); },\n};\nvar darkThemes = {\n undefined: darkTheme,\n null: darkTheme,\n 'ag-default-dark': darkTheme,\n 'ag-material-dark': function () { return new MaterialDark(); },\n 'ag-pastel-dark': function () { return new PastelDark(); },\n 'ag-solar-dark': function () { return new SolarDark(); },\n 'ag-vivid-dark': function () { return new VividDark(); },\n};\nvar themes$1 = __assign$t(__assign$t({}, darkThemes), lightThemes);\nfunction getChartTheme(value) {\n var _a;\n if (value instanceof ChartTheme) {\n return value;\n }\n var stockTheme = themes$1[value];\n if (stockTheme) {\n return stockTheme();\n }\n value = value;\n // Flatten recursive themes.\n var overrides = [];\n var palette;\n while (typeof value === 'object') {\n overrides.push((_a = value.overrides) !== null && _a !== void 0 ? _a : {});\n // Use first palette found, they can't be merged.\n if (value.palette && palette == null) {\n palette = value.palette;\n }\n value = value.baseTheme;\n }\n overrides.reverse();\n var flattenedTheme = __assign$t({ baseTheme: value, overrides: jsonMerge(overrides) }, (palette ? { palette: palette } : {}));\n if (flattenedTheme.baseTheme || flattenedTheme.overrides) {\n var baseTheme = getChartTheme(flattenedTheme.baseTheme);\n return new baseTheme.constructor(flattenedTheme);\n }\n return lightTheme();\n}\n\nvar __assign$s = (undefined && undefined.__assign) || function () {\n __assign$s = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$s.apply(this, arguments);\n};\nvar __values$d = (undefined && undefined.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nvar __read$s = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray$f = (undefined && undefined.__spreadArray) || function (to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\n to[j] = from[i];\n return to;\n};\nvar STACKABLE_SERIES_TYPES = ['bar', 'column', 'area'];\nvar GROUPABLE_SERIES_TYPES = ['bar', 'column'];\n/**\n * Groups the series options objects if they are of type `column` or `bar` and places them in an array at the index where the first instance of this series type was found.\n * Returns an array of arrays containing the ordered and grouped series options objects.\n */\nfunction groupSeriesByType(seriesOptions) {\n var e_1, _a, e_2, _b;\n var _c, _d, _e, _f, _g, _h;\n var groupMap = {};\n var stackMap = {};\n var anyStacked = {};\n var defaultUnstackedGroup = 'default-ag-charts-group';\n var result = [];\n try {\n for (var seriesOptions_1 = __values$d(seriesOptions), seriesOptions_1_1 = seriesOptions_1.next(); !seriesOptions_1_1.done; seriesOptions_1_1 = seriesOptions_1.next()) {\n var s = seriesOptions_1_1.value;\n var type = (_c = s.type) !== null && _c !== void 0 ? _c : 'line';\n var stackable = STACKABLE_SERIES_TYPES.includes(type);\n var groupable = GROUPABLE_SERIES_TYPES.includes(type);\n if (!stackable && !groupable) {\n // No need to use index for these cases.\n result.push({ type: 'ungrouped', opts: [s] });\n continue;\n }\n var _j = s, sStacked = _j.stacked, sStackGroup = _j.stackGroup, _k = _j.grouped, sGrouped = _k === void 0 ? undefined : _k, xKey = _j.xKey;\n var stacked = sStackGroup != null || sStacked === true;\n (_d = anyStacked[type]) !== null && _d !== void 0 ? _d : (anyStacked[type] = false);\n anyStacked[type] || (anyStacked[type] = stacked);\n var grouped = sGrouped === true;\n var groupingKey = [sStackGroup !== null && sStackGroup !== void 0 ? sStackGroup : (sStacked === true ? 'stacked' : undefined), grouped ? 'grouped' : undefined]\n .filter(function (v) { return v != null; })\n .join('-');\n if (!groupingKey) {\n groupingKey = defaultUnstackedGroup;\n }\n var indexKey = type + \"-\" + xKey + \"-\" + groupingKey;\n if (stacked && stackable) {\n var updated = ((_e = stackMap[indexKey]) !== null && _e !== void 0 ? _e : (stackMap[indexKey] = { type: 'stack', opts: [] }));\n if (updated.opts.length === 0)\n result.push(updated);\n updated.opts.push(s);\n }\n else if (grouped && groupable) {\n var updated = ((_f = groupMap[indexKey]) !== null && _f !== void 0 ? _f : (groupMap[indexKey] = { type: 'group', opts: [] }));\n if (updated.opts.length === 0)\n result.push(updated);\n updated.opts.push(s);\n }\n else {\n result.push({ type: 'ungrouped', opts: [s] });\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (seriesOptions_1_1 && !seriesOptions_1_1.done && (_a = seriesOptions_1.return)) _a.call(seriesOptions_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n if (!Object.values(anyStacked).some(function (v) { return v; })) {\n return result;\n }\n try {\n for (var _l = __values$d(Object.entries(groupMap)), _m = _l.next(); !_m.done; _m = _l.next()) {\n var _o = __read$s(_m.value, 2), group = _o[1];\n var type = (_h = (_g = group.opts[0]) === null || _g === void 0 ? void 0 : _g.type) !== null && _h !== void 0 ? _h : 'line';\n if (anyStacked[type] !== true)\n continue;\n group.type = 'stack';\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (_m && !_m.done && (_b = _l.return)) _b.call(_l);\n }\n finally { if (e_2) throw e_2.error; }\n }\n return result;\n}\nvar DEBUG = function () { return [true, 'opts'].includes(windowValue('agChartsDebug')); };\n/**\n * Transforms provided series options array into an array containing series options which are compatible with standalone charts series options.\n */\nfunction processSeriesOptions(_opts, seriesOptions) {\n var e_3, _a;\n var result = [];\n var preprocessed = seriesOptions.map(function (series) {\n var _a;\n // Change the default for bar/columns when yKey is used to be grouped rather than stacked.\n if ((series.type === 'bar' || series.type === 'column') && series.yKey != null && !series.stacked) {\n return __assign$s(__assign$s({}, series), { grouped: (_a = series.grouped) !== null && _a !== void 0 ? _a : true });\n }\n return series;\n });\n var grouped = groupSeriesByType(preprocessed);\n var groupCount = grouped.reduce(function (result, next) {\n var _a, _b;\n if (next.type === 'ungrouped')\n return result;\n var seriesType = (_a = next.opts[0].type) !== null && _a !== void 0 ? _a : 'line';\n (_b = result[seriesType]) !== null && _b !== void 0 ? _b : (result[seriesType] = 0);\n result[seriesType] += next.type === 'stack' ? 1 : next.opts.length;\n return result;\n }, {});\n var groupIdx = {};\n var addSeriesGroupingMeta = function (group) {\n var e_4, _a, e_5, _b, e_6, _c;\n var _d, _e;\n var stackIdx = 0;\n var seriesType = (_d = group.opts[0].type) !== null && _d !== void 0 ? _d : 'line';\n (_e = groupIdx[seriesType]) !== null && _e !== void 0 ? _e : (groupIdx[seriesType] = 0);\n if (group.type === 'stack') {\n try {\n for (var _f = __values$d(group.opts), _g = _f.next(); !_g.done; _g = _f.next()) {\n var opts = _g.value;\n opts.seriesGrouping = {\n groupIndex: groupIdx[seriesType],\n groupCount: groupCount[seriesType],\n stackIndex: stackIdx++,\n stackCount: group.opts.length,\n };\n }\n }\n catch (e_4_1) { e_4 = { error: e_4_1 }; }\n finally {\n try {\n if (_g && !_g.done && (_a = _f.return)) _a.call(_f);\n }\n finally { if (e_4) throw e_4.error; }\n }\n groupIdx[seriesType]++;\n }\n else if (group.type === 'group') {\n try {\n for (var _h = __values$d(group.opts), _j = _h.next(); !_j.done; _j = _h.next()) {\n var opts = _j.value;\n opts.seriesGrouping = {\n groupIndex: groupIdx[seriesType],\n groupCount: groupCount[seriesType],\n stackIndex: 0,\n stackCount: 0,\n };\n groupIdx[seriesType]++;\n }\n }\n catch (e_5_1) { e_5 = { error: e_5_1 }; }\n finally {\n try {\n if (_j && !_j.done && (_b = _h.return)) _b.call(_h);\n }\n finally { if (e_5) throw e_5.error; }\n }\n }\n else {\n try {\n for (var _k = __values$d(group.opts), _l = _k.next(); !_l.done; _l = _k.next()) {\n var opts = _l.value;\n opts.seriesGrouping = undefined;\n }\n }\n catch (e_6_1) { e_6 = { error: e_6_1 }; }\n finally {\n try {\n if (_l && !_l.done && (_c = _k.return)) _c.call(_k);\n }\n finally { if (e_6) throw e_6.error; }\n }\n }\n return group.opts;\n };\n if (DEBUG()) {\n Logger.debug('processSeriesOptions() - series grouping: ', grouped);\n }\n try {\n for (var grouped_1 = __values$d(grouped), grouped_1_1 = grouped_1.next(); !grouped_1_1.done; grouped_1_1 = grouped_1.next()) {\n var group = grouped_1_1.value;\n switch (group.opts[0].type) {\n case 'column':\n case 'bar':\n case 'area':\n result.push.apply(result, __spreadArray$f([], __read$s(addSeriesGroupingMeta(group))));\n break;\n case 'line':\n default:\n if (group.opts.length > 1) {\n Logger.warn('unexpected grouping of series type: ' + group.opts[0].type);\n }\n result.push.apply(result, __spreadArray$f([], __read$s(group.opts)));\n break;\n }\n }\n }\n catch (e_3_1) { e_3 = { error: e_3_1 }; }\n finally {\n try {\n if (grouped_1_1 && !grouped_1_1.done && (_a = grouped_1.return)) _a.call(grouped_1);\n }\n finally { if (e_3) throw e_3.error; }\n }\n return result;\n}\n\nvar __assign$r = (undefined && undefined.__assign) || function () {\n __assign$r = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$r.apply(this, arguments);\n};\nvar __values$c = (undefined && undefined.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nvar __read$r = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray$e = (undefined && undefined.__spreadArray) || function (to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\n to[j] = from[i];\n return to;\n};\nfunction optionsType(input) {\n var _a, _b, _c, _d;\n return (_d = (_a = input.type) !== null && _a !== void 0 ? _a : (_c = (_b = input.series) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.type) !== null && _d !== void 0 ? _d : 'line';\n}\nfunction isAgCartesianChartOptions(input) {\n var specifiedType = optionsType(input);\n if (specifiedType == null) {\n return true;\n }\n if (specifiedType === 'cartesian') {\n Logger.warnOnce(\"type '\" + specifiedType + \"' is deprecated, use a series type instead\");\n return true;\n }\n return CHART_TYPES.isCartesian(specifiedType);\n}\nfunction isAgHierarchyChartOptions(input) {\n var specifiedType = optionsType(input);\n if (specifiedType == null) {\n return false;\n }\n if (specifiedType === 'hierarchy') {\n Logger.warnOnce(\"type '\" + specifiedType + \"' is deprecated, use a series type instead\");\n return true;\n }\n return CHART_TYPES.isHierarchy(specifiedType);\n}\nfunction isAgPolarChartOptions(input) {\n var specifiedType = optionsType(input);\n if (specifiedType == null) {\n return false;\n }\n if (specifiedType === 'polar') {\n Logger.warnOnce(\"type '\" + specifiedType + \"' is deprecated, use a series type instead\");\n return true;\n }\n return CHART_TYPES.isPolar(specifiedType);\n}\nfunction isSeriesOptionType(input) {\n if (input == null) {\n return false;\n }\n return CHART_TYPES.has(input);\n}\nfunction isAxisOptionType(input) {\n if (input == null) {\n return false;\n }\n return AXIS_TYPES.has(input);\n}\nfunction countArrayElements(input) {\n var e_1, _a;\n var count = 0;\n try {\n for (var input_1 = __values$c(input), input_1_1 = input_1.next(); !input_1_1.done; input_1_1 = input_1.next()) {\n var next = input_1_1.value;\n if (next instanceof Array) {\n count += countArrayElements(next);\n }\n if (next != null) {\n count++;\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (input_1_1 && !input_1_1.done && (_a = input_1.return)) _a.call(input_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n return count;\n}\nfunction takeColours(context, colours, maxCount) {\n var result = [];\n for (var count = 0; count < maxCount; count++) {\n result.push(colours[(count + context.colourIndex) % colours.length]);\n }\n return result;\n}\nvar noDataCloneMergeOptions = {\n avoidDeepClone: ['data'],\n};\nfunction prepareOptions(newOptions, fallbackOptions) {\n var e_2, _a, e_3, _b;\n var _c, _d, _e, _f, _g, _h;\n var options = jsonMerge([fallbackOptions, newOptions], noDataCloneMergeOptions);\n sanityCheckOptions(options);\n // Determine type and ensure it's explicit in the options config.\n var userSuppliedOptionsType = options.type;\n var type = optionsType(options);\n var globalTooltipPositionOptions = (_d = (_c = options.tooltip) === null || _c === void 0 ? void 0 : _c.position) !== null && _d !== void 0 ? _d : {};\n var checkSeriesType = function (type) {\n if (type != null && !(isSeriesOptionType(type) || getSeriesDefaults(type))) {\n throw new Error(\"AG Charts - unknown series type: \" + type + \"; expected one of: \" + CHART_TYPES.seriesTypes);\n }\n };\n checkSeriesType(type);\n try {\n for (var _j = __values$c((_e = options.series) !== null && _e !== void 0 ? _e : []), _k = _j.next(); !_k.done; _k = _j.next()) {\n var seriesType = _k.value.type;\n if (seriesType == null)\n continue;\n checkSeriesType(seriesType);\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (_k && !_k.done && (_a = _j.return)) _a.call(_j);\n }\n finally { if (e_2) throw e_2.error; }\n }\n options = __assign$r(__assign$r({}, options), { type: type });\n var defaultSeriesType = 'line';\n if (isAgCartesianChartOptions(options)) {\n defaultSeriesType = 'line';\n }\n else if (isAgHierarchyChartOptions(options)) {\n defaultSeriesType = 'treemap';\n }\n else if (isAgPolarChartOptions(options)) {\n defaultSeriesType = 'pie';\n }\n var defaultOverrides = {};\n var seriesDefaults = getSeriesDefaults(type);\n if (seriesDefaults) {\n defaultOverrides = seriesDefaults;\n }\n else if (type === 'bar') {\n defaultOverrides = DEFAULT_BAR_CHART_OVERRIDES;\n }\n else if (type === 'scatter' || type === 'histogram') {\n defaultOverrides = DEFAULT_SCATTER_HISTOGRAM_CHART_OVERRIDES;\n }\n else if (isAgCartesianChartOptions(options)) {\n defaultOverrides = DEFAULT_CARTESIAN_CHART_OVERRIDES;\n }\n removeDisabledOptions(options);\n var _l = prepareMainOptions(defaultOverrides, options), context = _l.context, mergedOptions = _l.mergedOptions, axesThemes = _l.axesThemes, seriesThemes = _l.seriesThemes;\n // Special cases where we have arrays of elements which need their own defaults.\n // Apply series themes before calling processSeriesOptions() as it reduces and renames some\n // properties, and in that case then cannot correctly have themes applied.\n mergedOptions.series = processSeriesOptions(mergedOptions, ((_f = mergedOptions.series) !== null && _f !== void 0 ? _f : []).map(function (s) {\n var type = defaultSeriesType;\n if (s.type) {\n type = s.type;\n }\n else if (isSeriesOptionType(userSuppliedOptionsType)) {\n type = userSuppliedOptionsType;\n }\n var mergedSeries = mergeSeriesOptions(s, type, seriesThemes, globalTooltipPositionOptions);\n if (type === 'pie') {\n preparePieOptions(seriesThemes.pie, s, mergedSeries);\n }\n return mergedSeries;\n })).map(function (s) { return prepareSeries(context, s); });\n var checkAxisType = function (type) {\n var isAxisType = isAxisOptionType(type);\n if (!isAxisType) {\n Logger.warnOnce(\"AG Charts - unknown axis type: \" + type + \"; expected one of: \" + AXIS_TYPES.axesTypes + \", ignoring.\");\n }\n return isAxisType;\n };\n if ('axes' in mergedOptions) {\n var validAxesTypes = true;\n try {\n for (var _m = __values$c((_g = mergedOptions.axes) !== null && _g !== void 0 ? _g : []), _o = _m.next(); !_o.done; _o = _m.next()) {\n var axisType = _o.value.type;\n if (!checkAxisType(axisType)) {\n validAxesTypes = false;\n }\n }\n }\n catch (e_3_1) { e_3 = { error: e_3_1 }; }\n finally {\n try {\n if (_o && !_o.done && (_b = _m.return)) _b.call(_m);\n }\n finally { if (e_3) throw e_3.error; }\n }\n if (!validAxesTypes) {\n mergedOptions.axes = defaultOverrides.axes;\n }\n else {\n mergedOptions.axes = (_h = mergedOptions.axes) === null || _h === void 0 ? void 0 : _h.map(function (axis) {\n var _a, _b;\n var axisType = axis.type;\n var axesTheme = jsonMerge([\n axesThemes[axisType],\n (_b = axesThemes[axisType][(_a = axis.position) !== null && _a !== void 0 ? _a : 'unknown']) !== null && _b !== void 0 ? _b : {},\n ]);\n return prepareAxis(axis, axesTheme);\n });\n }\n prepareLegendEnabledOption(options, mergedOptions);\n }\n prepareEnabledOptions(options, mergedOptions);\n return mergedOptions;\n}\nfunction sanityCheckOptions(options) {\n var deprecatedArrayProps = {\n yKeys: 'yKey',\n yNames: 'yName',\n };\n Object.entries(deprecatedArrayProps).forEach(function (_a) {\n var _b;\n var _c = __read$r(_a, 2), oldProp = _c[0], newProp = _c[1];\n if ((_b = options.series) === null || _b === void 0 ? void 0 : _b.some(function (s) { return s[oldProp] != null; })) {\n Logger.warnOnce(\"property [series.\" + oldProp + \"] is deprecated, please use [series.\" + newProp + \"] and multiple series instead.\");\n }\n });\n}\nfunction mergeSeriesOptions(series, type, seriesThemes, globalTooltipPositionOptions) {\n var _a, _b;\n var mergedTooltipPosition = jsonMerge([__assign$r({}, globalTooltipPositionOptions), (_a = series.tooltip) === null || _a === void 0 ? void 0 : _a.position], noDataCloneMergeOptions);\n var mergedSeries = jsonMerge([\n (_b = seriesThemes[type]) !== null && _b !== void 0 ? _b : {},\n __assign$r(__assign$r({}, series), { type: type, tooltip: __assign$r(__assign$r({}, series.tooltip), { position: mergedTooltipPosition }) }),\n ], noDataCloneMergeOptions);\n return mergedSeries;\n}\nfunction prepareMainOptions(defaultOverrides, options) {\n var _a = prepareTheme(options), theme = _a.theme, cleanedTheme = _a.cleanedTheme, axesThemes = _a.axesThemes, seriesThemes = _a.seriesThemes;\n var context = { colourIndex: 0, palette: theme.palette };\n var mergedOptions = jsonMerge([defaultOverrides, cleanedTheme, options], noDataCloneMergeOptions);\n return { context: context, mergedOptions: mergedOptions, axesThemes: axesThemes, seriesThemes: seriesThemes };\n}\nfunction prepareTheme(options) {\n var _a, _b;\n var theme = getChartTheme(options.theme);\n var themeConfig = theme.config[(_a = optionsType(options)) !== null && _a !== void 0 ? _a : 'cartesian'];\n var seriesThemes = Object.entries(theme.config).reduce(function (result, _a) {\n var _b = __read$r(_a, 2), seriesType = _b[0], series = _b[1].series;\n result[seriesType] = series === null || series === void 0 ? void 0 : series[seriesType];\n return result;\n }, {});\n return {\n theme: theme,\n axesThemes: (_b = themeConfig['axes']) !== null && _b !== void 0 ? _b : {},\n seriesThemes: seriesThemes,\n cleanedTheme: jsonMerge([themeConfig, { axes: DELETE, series: DELETE }]),\n };\n}\nfunction prepareSeries(context, input) {\n var defaults = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n defaults[_i - 2] = arguments[_i];\n }\n var paletteOptions = calculateSeriesPalette(context, input);\n // Part of the options interface, but not directly consumed by the series implementations.\n var removeOptions = { stacked: DELETE, grouped: DELETE };\n return jsonMerge(__spreadArray$e(__spreadArray$e([], __read$r(defaults)), [paletteOptions, input, removeOptions]), noDataCloneMergeOptions);\n}\naddSeriesPaletteFactory('pie', function (_a) {\n var takeColors = _a.takeColors, colorsCount = _a.colorsCount;\n return takeColors(colorsCount);\n});\nvar singleSeriesPaletteFactory = function (_a) {\n var takeColors = _a.takeColors;\n var _b = takeColors(1), _c = __read$r(_b.fills, 1), fill = _c[0], _d = __read$r(_b.strokes, 1), stroke = _d[0];\n return { fill: fill, stroke: stroke };\n};\naddSeriesPaletteFactory('area', singleSeriesPaletteFactory);\naddSeriesPaletteFactory('bar', singleSeriesPaletteFactory);\naddSeriesPaletteFactory('column', singleSeriesPaletteFactory);\naddSeriesPaletteFactory('histogram', singleSeriesPaletteFactory);\naddSeriesPaletteFactory('scatter', function (params) {\n var _a = singleSeriesPaletteFactory(params), fill = _a.fill, stroke = _a.stroke;\n return { marker: { fill: fill, stroke: stroke } };\n});\naddSeriesPaletteFactory('line', function (params) {\n var _a = singleSeriesPaletteFactory(params), fill = _a.fill, stroke = _a.stroke;\n return {\n stroke: fill,\n marker: { fill: fill, stroke: stroke },\n };\n});\nfunction calculateSeriesPalette(context, input) {\n var _a;\n var paletteFactory = getSeriesPaletteFactory(input.type);\n if (!paletteFactory) {\n return {};\n }\n var _b = context.palette, fills = _b.fills, strokes = _b.strokes;\n var inputAny = input;\n var seriesCount = countArrayElements((_a = inputAny['yKeys']) !== null && _a !== void 0 ? _a : []) || 1; // Defaults to 1 if no yKeys.\n var colorsCount = Math.max(fills.length, strokes.length);\n return paletteFactory({\n seriesCount: seriesCount,\n colorsCount: colorsCount,\n takeColors: function (count) {\n var colors = {\n fills: takeColours(context, fills, count),\n strokes: takeColours(context, strokes, count),\n };\n context.colourIndex += count;\n return colors;\n },\n });\n}\nfunction prepareAxis(axis, axisTheme) {\n // Remove redundant theme overload keys.\n var removeOptions = { top: DELETE, bottom: DELETE, left: DELETE, right: DELETE };\n // Special cross lines case where we have an array of cross line elements which need their own defaults.\n if (axis.crossLines) {\n if (!Array.isArray(axis.crossLines)) {\n Logger.warn('axis[].crossLines should be an array.');\n axis.crossLines = [];\n }\n var crossLinesTheme_1 = axisTheme.crossLines;\n axis.crossLines = axis.crossLines.map(function (crossLine) { return jsonMerge([crossLinesTheme_1, crossLine]); });\n }\n var cleanTheme = { crossLines: DELETE };\n return jsonMerge([axisTheme, cleanTheme, axis, removeOptions], noDataCloneMergeOptions);\n}\nfunction removeDisabledOptions(options) {\n // Remove configurations from all option objects with a `false` value for the `enabled` property.\n jsonWalk(options, function (_, visitingUserOpts) {\n if (!('enabled' in visitingUserOpts))\n return;\n if (visitingUserOpts.enabled === false) {\n Object.entries(visitingUserOpts).forEach(function (_a) {\n var _b = __read$r(_a, 1), key = _b[0];\n if (key === 'enabled')\n return;\n delete visitingUserOpts[key];\n });\n }\n }, { skip: ['data', 'theme'] });\n}\nfunction prepareLegendEnabledOption(options, mergedOptions) {\n var _a, _b, _c, _d;\n // Disable legend by default for single series cartesian charts\n if (((_a = options.legend) === null || _a === void 0 ? void 0 : _a.enabled) !== undefined || ((_b = mergedOptions.legend) === null || _b === void 0 ? void 0 : _b.enabled) !== undefined) {\n return;\n }\n (_c = mergedOptions.legend) !== null && _c !== void 0 ? _c : (mergedOptions.legend = {});\n if (((_d = options.series) !== null && _d !== void 0 ? _d : []).length > 1) {\n mergedOptions.legend.enabled = true;\n return;\n }\n mergedOptions.legend.enabled = false;\n}\nfunction prepareEnabledOptions(options, mergedOptions) {\n // Set `enabled: true` for all option objects where the user has provided values.\n jsonWalk(options, function (_, visitingUserOpts, visitingMergedOpts) {\n if (!visitingMergedOpts)\n return;\n var _enabledFromTheme = visitingMergedOpts._enabledFromTheme;\n if (_enabledFromTheme != null) {\n // Do not apply special handling, base enablement on theme.\n delete visitingMergedOpts._enabledFromTheme;\n }\n if (!('enabled' in visitingMergedOpts))\n return;\n if (_enabledFromTheme)\n return;\n if (visitingUserOpts.enabled == null) {\n visitingMergedOpts.enabled = true;\n }\n }, { skip: ['data', 'theme'] }, mergedOptions);\n // Cleanup any special properties.\n jsonWalk(mergedOptions, function (_, visitingMergedOpts) {\n if (visitingMergedOpts._enabledFromTheme != null) {\n // Do not apply special handling, base enablement on theme.\n delete visitingMergedOpts._enabledFromTheme;\n }\n }, { skip: ['data', 'theme'] });\n}\nfunction preparePieOptions(pieSeriesTheme, seriesOptions, mergedSeries) {\n if (Array.isArray(seriesOptions.innerLabels)) {\n mergedSeries.innerLabels = seriesOptions.innerLabels.map(function (ln) {\n return jsonMerge([pieSeriesTheme.innerLabels, ln]);\n });\n }\n else {\n mergedSeries.innerLabels = DELETE;\n }\n}\n\nvar __values$b = (undefined && undefined.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nvar BaseModuleInstance = /** @class */ (function () {\n function BaseModuleInstance() {\n this.destroyFns = [];\n }\n BaseModuleInstance.prototype.destroy = function () {\n var e_1, _a;\n try {\n for (var _b = __values$b(this.destroyFns), _c = _b.next(); !_c.done; _c = _b.next()) {\n var destroyFn = _c.value;\n destroyFn();\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_1) throw e_1.error; }\n }\n };\n return BaseModuleInstance;\n}());\nvar REGISTERED_MODULES = [];\nfunction registerModule(module) {\n var otherModule = REGISTERED_MODULES.find(function (other) {\n return (module.type === other.type &&\n module.optionsKey === other.optionsKey &&\n module.identifier === other.identifier);\n });\n if (otherModule) {\n if (module.packageType === 'enterprise' && otherModule.packageType === 'community') {\n // Replace the community module with an enterprise version\n var index = REGISTERED_MODULES.indexOf(otherModule);\n REGISTERED_MODULES.splice(index, 1, module);\n }\n }\n else {\n // Simply register the module\n REGISTERED_MODULES.push(module);\n }\n}\n\nvar __extends$1P = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$1j = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar RangeHandle$1 = /** @class */ (function (_super) {\n __extends$1P(RangeHandle, _super);\n function RangeHandle() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this._fill = '#f2f2f2';\n _this._stroke = '#999999';\n _this._strokeWidth = 1;\n _this._lineCap = 'square';\n _this._centerX = 0;\n _this._centerY = 0;\n // Use an even number for better looking results.\n _this._width = 8;\n // Use an even number for better looking results.\n _this._gripLineGap = 2;\n // Use an even number for better looking results.\n _this._gripLineLength = 8;\n _this._height = 16;\n return _this;\n }\n Object.defineProperty(RangeHandle.prototype, \"centerX\", {\n get: function () {\n return this._centerX;\n },\n set: function (value) {\n if (this._centerX !== value) {\n this._centerX = value;\n this.dirtyPath = true;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(RangeHandle.prototype, \"centerY\", {\n get: function () {\n return this._centerY;\n },\n set: function (value) {\n if (this._centerY !== value) {\n this._centerY = value;\n this.dirtyPath = true;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(RangeHandle.prototype, \"width\", {\n get: function () {\n return this._width;\n },\n set: function (value) {\n if (this._width !== value) {\n this._width = value;\n this.dirtyPath = true;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(RangeHandle.prototype, \"gripLineGap\", {\n get: function () {\n return this._gripLineGap;\n },\n set: function (value) {\n if (this._gripLineGap !== value) {\n this._gripLineGap = value;\n this.dirtyPath = true;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(RangeHandle.prototype, \"gripLineLength\", {\n get: function () {\n return this._gripLineLength;\n },\n set: function (value) {\n if (this._gripLineLength !== value) {\n this._gripLineLength = value;\n this.dirtyPath = true;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(RangeHandle.prototype, \"height\", {\n get: function () {\n return this._height;\n },\n set: function (value) {\n if (this._height !== value) {\n this._height = value;\n this.dirtyPath = true;\n }\n },\n enumerable: false,\n configurable: true\n });\n RangeHandle.prototype.computeBBox = function () {\n var _a = this, centerX = _a.centerX, centerY = _a.centerY, width = _a.width, height = _a.height;\n var x = centerX - width / 2;\n var y = centerY - height / 2;\n return new BBox(x, y, width, height);\n };\n RangeHandle.prototype.isPointInPath = function (x, y) {\n var point = this.transformPoint(x, y);\n var bbox = this.computeBBox();\n return bbox.containsPoint(point.x, point.y);\n };\n RangeHandle.prototype.updatePath = function () {\n var _a = this, path = _a.path, centerX = _a.centerX, centerY = _a.centerY, width = _a.width, height = _a.height;\n path.clear();\n var x = centerX - width / 2;\n var y = centerY - height / 2;\n var ax = this.align(x);\n var ay = this.align(y);\n var axw = ax + this.align(x, width);\n var ayh = ay + this.align(y, height);\n // Handle.\n path.moveTo(ax, ay);\n path.lineTo(axw, ay);\n path.lineTo(axw, ayh);\n path.lineTo(ax, ayh);\n path.lineTo(ax, ay);\n // Grip lines.\n var dx = this.gripLineGap / 2;\n var dy = this.gripLineLength / 2;\n path.moveTo(this.align(centerX - dx), this.align(centerY - dy));\n path.lineTo(this.align(centerX - dx), this.align(centerY + dy));\n path.moveTo(this.align(centerX + dx), this.align(centerY - dy));\n path.lineTo(this.align(centerX + dx), this.align(centerY + dy));\n };\n RangeHandle.className = 'RangeHandle';\n __decorate$1j([\n Validate(COLOR_STRING)\n ], RangeHandle.prototype, \"_fill\", void 0);\n __decorate$1j([\n Validate(COLOR_STRING)\n ], RangeHandle.prototype, \"_stroke\", void 0);\n __decorate$1j([\n Validate(NUMBER(0))\n ], RangeHandle.prototype, \"_strokeWidth\", void 0);\n __decorate$1j([\n Validate(LINE_CAP)\n ], RangeHandle.prototype, \"_lineCap\", void 0);\n __decorate$1j([\n Validate(NUMBER(0))\n ], RangeHandle.prototype, \"_width\", void 0);\n __decorate$1j([\n Validate(NUMBER(0))\n ], RangeHandle.prototype, \"_gripLineGap\", void 0);\n __decorate$1j([\n Validate(NUMBER(0))\n ], RangeHandle.prototype, \"_gripLineLength\", void 0);\n __decorate$1j([\n Validate(NUMBER(0))\n ], RangeHandle.prototype, \"_height\", void 0);\n return RangeHandle;\n}(Path));\n\nvar __extends$1O = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$1i = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar RangeMask = /** @class */ (function (_super) {\n __extends$1O(RangeMask, _super);\n function RangeMask() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this._stroke = '#999999';\n _this._strokeWidth = 1;\n _this._fill = '#999999';\n _this._fillOpacity = 0.2;\n _this._lineCap = 'square';\n _this._x = 0;\n _this._y = 0;\n _this._width = 200;\n _this._height = 30;\n _this.minRange = 0.05;\n _this._min = 0;\n _this._max = 1;\n return _this;\n }\n Object.defineProperty(RangeMask.prototype, \"x\", {\n get: function () {\n return this._x;\n },\n set: function (value) {\n if (this._x !== value) {\n this._x = value;\n this.dirtyPath = true;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(RangeMask.prototype, \"y\", {\n get: function () {\n return this._y;\n },\n set: function (value) {\n if (this._y !== value) {\n this._y = value;\n this.dirtyPath = true;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(RangeMask.prototype, \"width\", {\n get: function () {\n return this._width;\n },\n set: function (value) {\n if (this._width !== value) {\n this._width = value;\n this.dirtyPath = true;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(RangeMask.prototype, \"height\", {\n get: function () {\n return this._height;\n },\n set: function (value) {\n if (this._height !== value) {\n this._height = value;\n this.dirtyPath = true;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(RangeMask.prototype, \"min\", {\n get: function () {\n return this._min;\n },\n set: function (value) {\n var _a;\n value = Math.min(Math.max(value, 0), this.max - this.minRange);\n if (isNaN(value)) {\n return;\n }\n if (this._min !== value) {\n this._min = value;\n this.dirtyPath = true;\n (_a = this.onRangeChange) === null || _a === void 0 ? void 0 : _a.call(this);\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(RangeMask.prototype, \"max\", {\n get: function () {\n return this._max;\n },\n set: function (value) {\n var _a;\n value = Math.max(Math.min(value, 1), this.min + this.minRange);\n if (isNaN(value)) {\n return;\n }\n if (this._max !== value) {\n this._max = value;\n this.dirtyPath = true;\n (_a = this.onRangeChange) === null || _a === void 0 ? void 0 : _a.call(this);\n }\n },\n enumerable: false,\n configurable: true\n });\n RangeMask.prototype.computeBBox = function () {\n var _a = this, x = _a.x, y = _a.y, width = _a.width, height = _a.height;\n return new BBox(x, y, width, height);\n };\n RangeMask.prototype.computeVisibleRangeBBox = function () {\n var _a = this, x = _a.x, y = _a.y, width = _a.width, height = _a.height, min = _a.min, max = _a.max;\n var minX = x + width * min;\n var maxX = x + width * max;\n return new BBox(minX, y, maxX - minX, height);\n };\n RangeMask.prototype.updatePath = function () {\n var _a = this, path = _a.path, x = _a.x, y = _a.y, width = _a.width, height = _a.height, min = _a.min, max = _a.max;\n path.clear();\n var ax = this.align(x);\n var ay = this.align(y);\n var axw = ax + this.align(x, width);\n var ayh = ay + this.align(y, height);\n // Whole range.\n path.moveTo(ax, ay);\n path.lineTo(axw, ay);\n path.lineTo(axw, ayh);\n path.lineTo(ax, ayh);\n path.lineTo(ax, ay);\n var minX = this.align(x + width * min);\n var maxX = this.align(x + width * max);\n // Visible range.\n path.moveTo(minX, ay);\n path.lineTo(minX, ayh);\n path.lineTo(maxX, ayh);\n path.lineTo(maxX, ay);\n path.lineTo(minX, ay);\n };\n RangeMask.className = 'RangeMask';\n __decorate$1i([\n Validate(COLOR_STRING)\n ], RangeMask.prototype, \"_stroke\", void 0);\n __decorate$1i([\n Validate(NUMBER(0))\n ], RangeMask.prototype, \"_strokeWidth\", void 0);\n __decorate$1i([\n Validate(COLOR_STRING)\n ], RangeMask.prototype, \"_fill\", void 0);\n __decorate$1i([\n Validate(NUMBER(0, 1))\n ], RangeMask.prototype, \"_fillOpacity\", void 0);\n __decorate$1i([\n Validate(LINE_CAP)\n ], RangeMask.prototype, \"_lineCap\", void 0);\n __decorate$1i([\n Validate(NUMBER(0))\n ], RangeMask.prototype, \"_width\", void 0);\n __decorate$1i([\n Validate(NUMBER(0))\n ], RangeMask.prototype, \"_height\", void 0);\n __decorate$1i([\n Validate(NUMBER())\n ], RangeMask.prototype, \"_min\", void 0);\n __decorate$1i([\n Validate(NUMBER())\n ], RangeMask.prototype, \"_max\", void 0);\n return RangeMask;\n}(Path));\n\nvar __extends$1N = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign$q = (undefined && undefined.__assign) || function () {\n __assign$q = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$q.apply(this, arguments);\n};\nvar RangeSelector = /** @class */ (function (_super) {\n __extends$1N(RangeSelector, _super);\n function RangeSelector() {\n var _this = _super.call(this, { name: 'rangeSelectorGroup' }) || this;\n _this.minHandle = new RangeHandle$1();\n _this.maxHandle = new RangeHandle$1();\n _this.mask = (function () {\n var _a = RangeSelector.defaults, x = _a.x, y = _a.y, width = _a.width, height = _a.height, min = _a.min, max = _a.max;\n var mask = new RangeMask();\n mask.x = x;\n mask.y = y;\n mask.width = width;\n mask.height = height;\n mask.min = min;\n mask.max = max;\n var _b = _this, minHandle = _b.minHandle, maxHandle = _b.maxHandle;\n minHandle.centerX = x;\n maxHandle.centerX = x + width;\n minHandle.centerY = maxHandle.centerY = y + height / 2;\n _this.append([mask, minHandle, maxHandle]);\n mask.onRangeChange = function () {\n var _a;\n _this.updateHandles();\n (_a = _this.onRangeChange) === null || _a === void 0 ? void 0 : _a.call(_this);\n };\n return mask;\n })();\n _this._x = RangeSelector.defaults.x;\n _this._y = RangeSelector.defaults.y;\n _this._width = RangeSelector.defaults.width;\n _this._height = RangeSelector.defaults.height;\n _this._min = RangeSelector.defaults.min;\n _this._max = RangeSelector.defaults.max;\n _this.isContainerNode = true;\n return _this;\n }\n Object.defineProperty(RangeSelector.prototype, \"x\", {\n get: function () {\n return this.mask.x;\n },\n set: function (value) {\n this.mask.x = value;\n this.updateHandles();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(RangeSelector.prototype, \"y\", {\n get: function () {\n return this.mask.y;\n },\n set: function (value) {\n this.mask.y = value;\n this.updateHandles();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(RangeSelector.prototype, \"width\", {\n get: function () {\n return this.mask.width;\n },\n set: function (value) {\n this.mask.width = value;\n this.updateHandles();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(RangeSelector.prototype, \"height\", {\n get: function () {\n return this.mask.height;\n },\n set: function (value) {\n this.mask.height = value;\n this.updateHandles();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(RangeSelector.prototype, \"min\", {\n get: function () {\n return this.mask.min;\n },\n set: function (value) {\n this.mask.min = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(RangeSelector.prototype, \"max\", {\n get: function () {\n return this.mask.max;\n },\n set: function (value) {\n this.mask.max = value;\n },\n enumerable: false,\n configurable: true\n });\n RangeSelector.prototype.updateHandles = function () {\n var _a = this, minHandle = _a.minHandle, maxHandle = _a.maxHandle, x = _a.x, y = _a.y, width = _a.width, height = _a.height, mask = _a.mask;\n minHandle.centerX = x + width * mask.min;\n maxHandle.centerX = x + width * mask.max;\n minHandle.centerY = maxHandle.centerY = y + height / 2;\n };\n RangeSelector.prototype.computeBBox = function () {\n return this.mask.computeBBox();\n };\n RangeSelector.prototype.computeVisibleRangeBBox = function () {\n return this.mask.computeVisibleRangeBBox();\n };\n RangeSelector.prototype.render = function (renderCtx) {\n var ctx = renderCtx.ctx, forceRender = renderCtx.forceRender, stats = renderCtx.stats;\n if (this.dirty === RedrawType.NONE && !forceRender) {\n if (stats)\n stats.nodesSkipped++;\n return;\n }\n this.computeTransformMatrix();\n this.matrix.toContext(ctx);\n var _a = this, mask = _a.mask, minHandle = _a.minHandle, maxHandle = _a.maxHandle;\n [mask, minHandle, maxHandle].forEach(function (child) {\n if (child.visible && (forceRender || child.dirty > RedrawType.NONE)) {\n ctx.save();\n child.render(__assign$q(__assign$q({}, renderCtx), { ctx: ctx, forceRender: forceRender }));\n ctx.restore();\n }\n });\n this.markClean({ force: true });\n if (stats)\n stats.nodesRendered++;\n };\n RangeSelector.className = 'Range';\n RangeSelector.defaults = {\n x: 0,\n y: 0,\n width: 200,\n height: 30,\n min: 0,\n max: 1,\n };\n return RangeSelector;\n}(Group));\n\nvar NavigatorMask = /** @class */ (function () {\n function NavigatorMask(rangeMask) {\n this.rm = rangeMask;\n }\n Object.defineProperty(NavigatorMask.prototype, \"fill\", {\n get: function () {\n return this.rm.fill;\n },\n set: function (value) {\n this.rm.fill = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(NavigatorMask.prototype, \"stroke\", {\n get: function () {\n return this.rm.stroke;\n },\n set: function (value) {\n this.rm.stroke = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(NavigatorMask.prototype, \"strokeWidth\", {\n get: function () {\n return this.rm.strokeWidth;\n },\n set: function (value) {\n this.rm.strokeWidth = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(NavigatorMask.prototype, \"fillOpacity\", {\n get: function () {\n return this.rm.fillOpacity;\n },\n set: function (value) {\n this.rm.fillOpacity = value;\n },\n enumerable: false,\n configurable: true\n });\n return NavigatorMask;\n}());\n\nvar NavigatorHandle = /** @class */ (function () {\n function NavigatorHandle(rangeHandle) {\n this.rh = rangeHandle;\n }\n Object.defineProperty(NavigatorHandle.prototype, \"fill\", {\n get: function () {\n return this.rh.fill;\n },\n set: function (value) {\n this.rh.fill = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(NavigatorHandle.prototype, \"stroke\", {\n get: function () {\n return this.rh.stroke;\n },\n set: function (value) {\n this.rh.stroke = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(NavigatorHandle.prototype, \"strokeWidth\", {\n get: function () {\n return this.rh.strokeWidth;\n },\n set: function (value) {\n this.rh.strokeWidth = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(NavigatorHandle.prototype, \"width\", {\n get: function () {\n return this.rh.width;\n },\n set: function (value) {\n this.rh.width = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(NavigatorHandle.prototype, \"height\", {\n get: function () {\n return this.rh.height;\n },\n set: function (value) {\n this.rh.height = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(NavigatorHandle.prototype, \"gripLineGap\", {\n get: function () {\n return this.rh.gripLineGap;\n },\n set: function (value) {\n this.rh.gripLineGap = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(NavigatorHandle.prototype, \"gripLineLength\", {\n get: function () {\n return this.rh.gripLineLength;\n },\n set: function (value) {\n this.rh.gripLineLength = value;\n },\n enumerable: false,\n configurable: true\n });\n return NavigatorHandle;\n}());\n\nvar __extends$1M = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$1h = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar Navigator = /** @class */ (function (_super) {\n __extends$1M(Navigator, _super);\n function Navigator(ctx) {\n var _a;\n var _this = _super.call(this) || this;\n _this.ctx = ctx;\n _this.rs = new RangeSelector();\n // Wrappers to allow option application to the scene graph nodes.\n _this.mask = new NavigatorMask(_this.rs.mask);\n _this.minHandle = new NavigatorHandle(_this.rs.minHandle);\n _this.maxHandle = new NavigatorHandle(_this.rs.maxHandle);\n _this.minHandleDragging = false;\n _this.maxHandleDragging = false;\n _this.panHandleOffset = NaN;\n _this._enabled = false;\n _this.margin = 10;\n _this._visible = true;\n _this.rs.onRangeChange = function () {\n return _this.ctx.zoomManager.updateZoom('navigator', { x: { min: _this.rs.min, max: _this.rs.max } });\n };\n [\n ctx.interactionManager.addListener('drag-start', function (event) { return _this.onDragStart(event); }),\n ctx.interactionManager.addListener('drag', function (event) { return _this.onDrag(event); }),\n ctx.interactionManager.addListener('hover', function (event) { return _this.onDrag(event); }),\n ctx.interactionManager.addListener('drag-end', function () { return _this.onDragStop(); }),\n ].forEach(function (s) { return _this.destroyFns.push(function () { return ctx.interactionManager.removeListener(s); }); });\n [\n ctx.layoutService.addListener('before-series', function (event) { return _this.layout(event); }),\n ctx.layoutService.addListener('layout-complete', function (event) { return _this.layoutComplete(event); }),\n ].forEach(function (s) { return _this.destroyFns.push(function () { return ctx.layoutService.removeListener(s); }); });\n (_a = ctx.scene.root) === null || _a === void 0 ? void 0 : _a.appendChild(_this.rs);\n _this.destroyFns.push(function () { var _a; return (_a = ctx.scene.root) === null || _a === void 0 ? void 0 : _a.removeChild(_this.rs); });\n _this.destroyFns.push(function () { return _this.ctx.zoomManager.updateZoom('navigator'); });\n _this.updateGroupVisibility();\n return _this;\n }\n Object.defineProperty(Navigator.prototype, \"enabled\", {\n get: function () {\n return this._enabled;\n },\n set: function (value) {\n this._enabled = value;\n this.updateGroupVisibility();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Navigator.prototype, \"width\", {\n get: function () {\n return this.rs.width;\n },\n set: function (value) {\n this.rs.width = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Navigator.prototype, \"height\", {\n get: function () {\n return this.rs.height;\n },\n set: function (value) {\n this.rs.height = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Navigator.prototype, \"min\", {\n get: function () {\n return this.rs.min;\n },\n set: function (value) {\n this.rs.min = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Navigator.prototype, \"max\", {\n get: function () {\n return this.rs.max;\n },\n set: function (value) {\n this.rs.max = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Navigator.prototype, \"visible\", {\n get: function () {\n return this._visible;\n },\n set: function (value) {\n this._visible = value;\n this.updateGroupVisibility();\n },\n enumerable: false,\n configurable: true\n });\n Navigator.prototype.updateGroupVisibility = function () {\n var visible = this.enabled && this.visible;\n this.rs.visible = visible;\n if (visible) {\n this.ctx.zoomManager.updateZoom('navigator', { x: { min: this.rs.min, max: this.rs.max } });\n }\n else {\n this.ctx.zoomManager.updateZoom('navigator');\n }\n };\n Navigator.prototype.layout = function (_a) {\n var shrinkRect = _a.shrinkRect;\n if (this.enabled) {\n var navigatorTotalHeight = this.rs.height + this.margin;\n shrinkRect.shrink(navigatorTotalHeight, 'bottom');\n this.rs.y = shrinkRect.y + shrinkRect.height + this.margin;\n }\n return { shrinkRect: shrinkRect };\n };\n Navigator.prototype.layoutComplete = function (_a) {\n var _b = _a.series, rect = _b.rect, visible = _b.visible;\n if (this.enabled && visible) {\n this.rs.x = rect.x;\n this.rs.width = rect.width;\n }\n this.visible = visible;\n };\n Navigator.prototype.onDragStart = function (offset) {\n if (!this.enabled) {\n return;\n }\n var offsetX = offset.offsetX, offsetY = offset.offsetY;\n var rs = this.rs;\n var minHandle = rs.minHandle, maxHandle = rs.maxHandle, x = rs.x, width = rs.width, min = rs.min;\n var visibleRange = rs.computeVisibleRangeBBox();\n if (!(this.minHandleDragging || this.maxHandleDragging)) {\n if (minHandle.containsPoint(offsetX, offsetY)) {\n this.minHandleDragging = true;\n }\n else if (maxHandle.containsPoint(offsetX, offsetY)) {\n this.maxHandleDragging = true;\n }\n else if (visibleRange.containsPoint(offsetX, offsetY)) {\n this.panHandleOffset = (offsetX - x) / width - min;\n }\n }\n };\n Navigator.prototype.onDrag = function (offset) {\n if (!this.enabled) {\n return;\n }\n var _a = this, rs = _a.rs, panHandleOffset = _a.panHandleOffset;\n var x = rs.x, y = rs.y, width = rs.width, height = rs.height, minHandle = rs.minHandle, maxHandle = rs.maxHandle;\n var offsetX = offset.offsetX, offsetY = offset.offsetY;\n var minX = x + width * rs.min;\n var maxX = x + width * rs.max;\n var visibleRange = new BBox(minX, y, maxX - minX, height);\n var getRatio = function () { return Math.min(Math.max((offsetX - x) / width, 0), 1); };\n if (minHandle.containsPoint(offsetX, offsetY) || maxHandle.containsPoint(offsetX, offsetY)) {\n this.ctx.cursorManager.updateCursor('navigator', 'ew-resize');\n }\n else if (visibleRange.containsPoint(offsetX, offsetY)) {\n this.ctx.cursorManager.updateCursor('navigator', 'grab');\n }\n else {\n this.ctx.cursorManager.updateCursor('navigator');\n }\n if (this.minHandleDragging) {\n rs.min = getRatio();\n }\n else if (this.maxHandleDragging) {\n rs.max = getRatio();\n }\n else if (!isNaN(panHandleOffset)) {\n var span = rs.max - rs.min;\n var min = Math.min(getRatio() - panHandleOffset, 1 - span);\n if (min <= rs.min) {\n // pan left\n rs.min = min;\n rs.max = rs.min + span;\n }\n else {\n // pan right\n rs.max = min + span;\n rs.min = rs.max - span;\n }\n }\n };\n Navigator.prototype.onDragStop = function () {\n this.stopHandleDragging();\n };\n Navigator.prototype.stopHandleDragging = function () {\n this.minHandleDragging = this.maxHandleDragging = false;\n this.panHandleOffset = NaN;\n };\n __decorate$1h([\n Validate(BOOLEAN)\n ], Navigator.prototype, \"_enabled\", void 0);\n __decorate$1h([\n Validate(NUMBER(0))\n ], Navigator.prototype, \"margin\", void 0);\n return Navigator;\n}(BaseModuleInstance));\n\nvar CHART_NAVIGATOR_MODULE = {\n type: 'root',\n optionsKey: 'navigator',\n packageType: 'community',\n chartTypes: ['cartesian'],\n instanceConstructor: Navigator,\n themeTemplate: {\n navigator: {\n enabled: false,\n height: 30,\n mask: {\n fill: '#999999',\n stroke: '#999999',\n strokeWidth: 1,\n fillOpacity: 0.2,\n },\n minHandle: {\n fill: '#f2f2f2',\n stroke: '#999999',\n strokeWidth: 1,\n width: 8,\n height: 16,\n gripLineGap: 2,\n gripLineLength: 8,\n },\n maxHandle: {\n fill: '#f2f2f2',\n stroke: '#999999',\n strokeWidth: 1,\n width: 8,\n height: 16,\n gripLineGap: 2,\n gripLineLength: 8,\n },\n },\n },\n};\nregisterModule(CHART_NAVIGATOR_MODULE);\n\nvar __extends$1L = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$1g = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar Background = /** @class */ (function (_super) {\n __extends$1L(Background, _super);\n function Background(ctx) {\n var _a;\n var _this = _super.call(this) || this;\n _this.onLayoutComplete = function (e) {\n var _a = e.chart, width = _a.width, height = _a.height;\n _this.rectNode.width = width;\n _this.rectNode.height = height;\n };\n _this.node = new Group({ name: 'background' });\n _this.node.zIndex = Layers.SERIES_BACKGROUND_ZINDEX;\n _this.rectNode = new Rect();\n _this.node.appendChild(_this.rectNode);\n _this.fill = 'white';\n _this.visible = true;\n (_a = ctx.scene.root) === null || _a === void 0 ? void 0 : _a.appendChild(_this.node);\n _this.destroyFns.push(function () { var _a; return (_a = ctx.scene.root) === null || _a === void 0 ? void 0 : _a.removeChild(_this.node); });\n var layoutHandle = ctx.layoutService.addListener('layout-complete', _this.onLayoutComplete);\n _this.destroyFns.push(function () { return ctx.layoutService.removeListener(layoutHandle); });\n return _this;\n }\n __decorate$1g([\n Validate(BOOLEAN),\n ProxyPropertyOnWrite('node', 'visible')\n ], Background.prototype, \"visible\", void 0);\n __decorate$1g([\n Validate(OPT_COLOR_STRING),\n ProxyPropertyOnWrite('rectNode', 'fill')\n ], Background.prototype, \"fill\", void 0);\n return Background;\n}(BaseModuleInstance));\n\nvar CHART_BACKGROUND_MODULE = {\n type: 'root',\n optionsKey: 'background',\n packageType: 'community',\n chartTypes: ['cartesian', 'polar', 'hierarchy'],\n instanceConstructor: Background,\n};\nregisterModule(CHART_BACKGROUND_MODULE);\n\nvar __values$a = (undefined && undefined.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nfunction setupModules() {\n var e_1, _a, e_2, _b, e_3, _c;\n try {\n for (var REGISTERED_MODULES_1 = __values$a(REGISTERED_MODULES), REGISTERED_MODULES_1_1 = REGISTERED_MODULES_1.next(); !REGISTERED_MODULES_1_1.done; REGISTERED_MODULES_1_1 = REGISTERED_MODULES_1.next()) {\n var m = REGISTERED_MODULES_1_1.value;\n if (JSON_APPLY_PLUGINS.constructors != null && m.optionConstructors != null) {\n Object.assign(JSON_APPLY_PLUGINS.constructors, m.optionConstructors);\n }\n if (m.type === 'root') {\n if (m.themeTemplate) {\n try {\n for (var _d = (e_2 = void 0, __values$a(m.chartTypes)), _e = _d.next(); !_e.done; _e = _d.next()) {\n var chartType = _e.value;\n registerChartDefaults(chartType, m.themeTemplate);\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (_e && !_e.done && (_b = _d.return)) _b.call(_d);\n }\n finally { if (e_2) throw e_2.error; }\n }\n }\n }\n if (m.type === 'series') {\n if (m.chartTypes.length > 1)\n throw new Error('AG Charts - Module definition error: ' + m.identifier);\n registerSeries(m.identifier, m.chartTypes[0], m.instanceConstructor, m.seriesDefaults, m.themeTemplate, m.paletteFactory);\n }\n if (m.type === 'axis-option') {\n if (m.themeTemplate) {\n try {\n for (var _f = (e_3 = void 0, __values$a(m.axisTypes)), _g = _f.next(); !_g.done; _g = _f.next()) {\n var axisType = _g.value;\n registerAxisThemeTemplate(axisType, m.themeTemplate);\n }\n }\n catch (e_3_1) { e_3 = { error: e_3_1 }; }\n finally {\n try {\n if (_g && !_g.done && (_c = _f.return)) _c.call(_f);\n }\n finally { if (e_3) throw e_3.error; }\n }\n }\n }\n if (m.type === 'axis') {\n registerAxis(m.identifier, m.instanceConstructor);\n if (m.themeTemplate) {\n registerAxisThemeTemplate(m.identifier, m.themeTemplate);\n }\n }\n if (m.type === 'legend') {\n registerLegend(m.identifier, m.instanceConstructor);\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (REGISTERED_MODULES_1_1 && !REGISTERED_MODULES_1_1.done && (_a = REGISTERED_MODULES_1.return)) _a.call(REGISTERED_MODULES_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n}\n\nvar __assign$p = (undefined && undefined.__assign) || function () {\n __assign$p = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$p.apply(this, arguments);\n};\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (undefined && undefined.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nvar __read$q = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray$d = (undefined && undefined.__spreadArray) || function (to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\n to[j] = from[i];\n return to;\n};\nvar __values$9 = (undefined && undefined.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nfunction chartType(options) {\n if (isAgCartesianChartOptions(options)) {\n return 'cartesian';\n }\n else if (isAgPolarChartOptions(options)) {\n return 'polar';\n }\n else if (isAgHierarchyChartOptions(options)) {\n return 'hierarchy';\n }\n throw new Error(\"AG Chart - unknown type of chart for options with type: \" + options.type);\n}\n/**\n * Factory for creating and updating instances of AgChartInstance.\n *\n * @docsInterface\n */\nvar AgChart = /** @class */ (function () {\n function AgChart() {\n }\n /**\n * Create a new `AgChartInstance` based upon the given configuration options.\n */\n AgChart.create = function (options) {\n return AgChartInternal.createOrUpdate(options);\n };\n /**\n * Update an existing `AgChartInstance`. Options provided should be complete and not\n * partial.\n *
\n *
\n * **NOTE**: As each call could trigger a chart redraw, multiple calls to update options in\n * quick succession could result in undesirable flickering, so callers should batch up and/or\n * debounce changes to avoid unintended partial update renderings.\n */\n AgChart.update = function (chart, options) {\n if (!AgChartInstanceProxy.isInstance(chart)) {\n throw new Error('AG Charts - invalid chart reference passed');\n }\n AgChartInternal.createOrUpdate(options, chart);\n };\n /**\n * Update an existing `AgChartInstance` by applying a partial set of option changes.\n *
\n *
\n * **NOTE**: As each call could trigger a chart redraw, each individual delta options update\n * should leave the chart in a valid options state. Also, multiple calls to update options in\n * quick succession could result in undesirable flickering, so callers should batch up and/or\n * debounce changes to avoid unintended partial update renderings.\n */\n AgChart.updateDelta = function (chart, deltaOptions) {\n if (!AgChartInstanceProxy.isInstance(chart)) {\n throw new Error('AG Charts - invalid chart reference passed');\n }\n return AgChartInternal.updateUserDelta(chart, deltaOptions);\n };\n /**\n * Starts a browser-based image download for the given `AgChartInstance`.\n */\n AgChart.download = function (chart, options) {\n if (!(chart instanceof AgChartInstanceProxy)) {\n throw new Error('AG Charts - invalid chart reference passed');\n }\n return AgChartInternal.download(chart, options);\n };\n /**\n * Returns a base64-encoded image data URL for the given `AgChartInstance`.\n */\n AgChart.getImageDataURL = function (chart, options) {\n if (!(chart instanceof AgChartInstanceProxy)) {\n throw new Error('AG Charts - invalid chart reference passed');\n }\n return AgChartInternal.getImageDataURL(chart, options);\n };\n return AgChart;\n}());\n/**\n * Proxy class, to allow library users to keep a stable reference to their chart, even if we need\n * to switch concrete class (e.g. when switching between CartesianChart vs. PolarChart).\n */\nvar AgChartInstanceProxy = /** @class */ (function () {\n function AgChartInstanceProxy(chart) {\n this.chart = chart;\n }\n AgChartInstanceProxy.isInstance = function (x) {\n var _a, _b;\n if (x instanceof AgChartInstanceProxy) {\n // Simple case.\n return true;\n }\n if (((_a = x.constructor) === null || _a === void 0 ? void 0 : _a.name) === 'AgChartInstanceProxy' && x.chart != null) {\n // instanceof can fail if mixing bundles (e.g. grid all-modules vs. standalone).\n return true;\n }\n var signatureProps = Object.keys((_b = x.constructor) === null || _b === void 0 ? void 0 : _b.prototype);\n var heuristicTypeCheck = Object.keys(AgChartInstanceProxy.prototype).every(function (prop) {\n return signatureProps.includes(prop);\n });\n if (heuristicTypeCheck && x.chart != null) {\n // minimised code case - the constructor name is mangled but prototype names are not :P\n return true;\n }\n return false;\n };\n AgChartInstanceProxy.prototype.getOptions = function () {\n return this.chart.getOptions();\n };\n AgChartInstanceProxy.prototype.destroy = function () {\n this.chart.destroy();\n };\n return AgChartInstanceProxy;\n}());\nvar AgChartInternal = /** @class */ (function () {\n function AgChartInternal() {\n }\n AgChartInternal.initialiseModules = function () {\n if (AgChartInternal.initialised)\n return;\n setupModules();\n AgChartInternal.initialised = true;\n };\n AgChartInternal.createOrUpdate = function (userOptions, proxy) {\n var _this = this;\n AgChartInternal.initialiseModules();\n debug('>>> AgChartV2.createOrUpdate() user options', userOptions);\n var mixinOpts = {};\n if (AgChartInternal.DEBUG() === true) {\n mixinOpts['debug'] = true;\n }\n var overrideDevicePixelRatio = userOptions.overrideDevicePixelRatio;\n delete userOptions['overrideDevicePixelRatio'];\n var processedOptions = prepareOptions(userOptions, mixinOpts);\n var chart = proxy === null || proxy === void 0 ? void 0 : proxy.chart;\n if (chart == null || chartType(userOptions) !== chartType(chart.processedOptions)) {\n chart = AgChartInternal.createChartInstance(processedOptions, overrideDevicePixelRatio, chart);\n }\n if (proxy == null) {\n proxy = new AgChartInstanceProxy(chart);\n }\n else {\n proxy.chart = chart;\n }\n var chartToUpdate = chart;\n chartToUpdate.queuedUserOptions.push(userOptions);\n var dequeue = function () {\n // If there are a lot of update calls, `requestFactoryUpdate()` may skip callbacks,\n // so we need to remove all queue items up to the last successfully applied item.\n var queuedOptionsIdx = chartToUpdate.queuedUserOptions.indexOf(userOptions);\n chartToUpdate.queuedUserOptions.splice(0, queuedOptionsIdx);\n };\n chartToUpdate.requestFactoryUpdate(function () { return __awaiter(_this, void 0, void 0, function () {\n var deltaOptions;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n // Chart destroyed, skip processing.\n if (chartToUpdate.destroyed)\n return [2 /*return*/];\n deltaOptions = jsonDiff(chartToUpdate.processedOptions, processedOptions);\n if (deltaOptions == null) {\n dequeue();\n return [2 /*return*/];\n }\n return [4 /*yield*/, AgChartInternal.updateDelta(chartToUpdate, deltaOptions, userOptions)];\n case 1:\n _a.sent();\n dequeue();\n return [2 /*return*/];\n }\n });\n }); });\n return proxy;\n };\n AgChartInternal.updateUserDelta = function (proxy, deltaOptions) {\n var _a;\n var chart = proxy.chart, queuedUserOptions = proxy.chart.queuedUserOptions;\n var lastUpdateOptions = (_a = queuedUserOptions[queuedUserOptions.length - 1]) !== null && _a !== void 0 ? _a : chart.userOptions;\n var userOptions = jsonMerge([lastUpdateOptions, deltaOptions]);\n debug('>>> AgChartV2.updateUserDelta() user delta', deltaOptions);\n debug('AgChartV2.updateUserDelta() - base options', lastUpdateOptions);\n AgChartInternal.createOrUpdate(userOptions, proxy);\n };\n /**\n * Returns the content of the current canvas as an image.\n * @param opts The download options including `width` and `height` of the image as well as `fileName` and `fileFormat`.\n */\n AgChartInternal.download = function (proxy, opts) {\n var _this = this;\n var asyncDownload = function () { return __awaiter(_this, void 0, void 0, function () {\n var maybeClone, chart;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, AgChartInternal.prepareResizedChart(proxy, opts)];\n case 1:\n maybeClone = _a.sent();\n chart = maybeClone.chart;\n chart.scene.download(opts === null || opts === void 0 ? void 0 : opts.fileName, opts === null || opts === void 0 ? void 0 : opts.fileFormat);\n if (maybeClone !== proxy) {\n maybeClone.destroy();\n }\n return [2 /*return*/];\n }\n });\n }); };\n asyncDownload().catch(function (e) { return Logger.errorOnce(e); });\n };\n AgChartInternal.getImageDataURL = function (proxy, opts) {\n return __awaiter(this, void 0, void 0, function () {\n var maybeClone, chart, result;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, AgChartInternal.prepareResizedChart(proxy, opts)];\n case 1:\n maybeClone = _a.sent();\n chart = maybeClone.chart;\n result = chart.scene.canvas.getDataURL(opts === null || opts === void 0 ? void 0 : opts.fileFormat);\n if (maybeClone !== proxy) {\n maybeClone.destroy();\n }\n return [2 /*return*/, result];\n }\n });\n });\n };\n AgChartInternal.prepareResizedChart = function (proxy, opts) {\n return __awaiter(this, void 0, void 0, function () {\n var chart, _a, width, height, currentWidth, currentHeight, unchanged, options, clonedChart;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n chart = proxy.chart;\n _a = opts !== null && opts !== void 0 ? opts : {}, width = _a.width, height = _a.height;\n currentWidth = chart.width;\n currentHeight = chart.height;\n unchanged = (width === undefined && height === undefined) ||\n (chart.scene.canvas.pixelRatio === 1 && currentWidth === width && currentHeight === height);\n if (unchanged) {\n return [2 /*return*/, proxy];\n }\n width = width !== null && width !== void 0 ? width : currentWidth;\n height = height !== null && height !== void 0 ? height : currentHeight;\n options = __assign$p(__assign$p({}, chart.userOptions), { container: document.createElement('div'), width: width, height: height, autoSize: false, overrideDevicePixelRatio: 1 });\n clonedChart = AgChartInternal.createOrUpdate(options);\n return [4 /*yield*/, clonedChart.chart.waitForUpdate()];\n case 1:\n _b.sent();\n return [2 /*return*/, clonedChart];\n }\n });\n });\n };\n AgChartInternal.createChartInstance = function (options, overrideDevicePixelRatio, oldChart) {\n var transferableResource = oldChart === null || oldChart === void 0 ? void 0 : oldChart.destroy({ keepTransferableResources: true });\n if (isAgCartesianChartOptions(options)) {\n return new CartesianChart(document, overrideDevicePixelRatio, transferableResource);\n }\n else if (isAgHierarchyChartOptions(options)) {\n return new HierarchyChart(document, overrideDevicePixelRatio, transferableResource);\n }\n else if (isAgPolarChartOptions(options)) {\n return new PolarChart(document, overrideDevicePixelRatio, transferableResource);\n }\n throw new Error(\"AG Charts - couldn't apply configuration, check type of options: \" + options['type']);\n };\n AgChartInternal.updateDelta = function (chart, processedOptions, userOptions) {\n var _a;\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n if (processedOptions.type == null) {\n processedOptions = __assign$p(__assign$p({}, processedOptions), { type: (_a = chart.processedOptions.type) !== null && _a !== void 0 ? _a : optionsType(processedOptions) });\n }\n return [4 /*yield*/, chart.awaitUpdateCompletion()];\n case 1:\n _b.sent();\n if (chart.destroyed)\n return [2 /*return*/];\n debug('AgChartV2.updateDelta() - applying delta', processedOptions);\n applyChartOptions(chart, processedOptions, userOptions);\n return [2 /*return*/];\n }\n });\n });\n };\n AgChartInternal.DEBUG = function () { var _a; return (_a = windowValue('agChartsDebug')) !== null && _a !== void 0 ? _a : false; };\n AgChartInternal.initialised = false;\n return AgChartInternal;\n}());\nfunction debug(message) {\n var optionalParams = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n optionalParams[_i - 1] = arguments[_i];\n }\n if ([true, 'opts'].includes(AgChartInternal.DEBUG())) {\n Logger.debug.apply(Logger, __spreadArray$d([message], __read$q(optionalParams)));\n }\n}\nfunction applyChartOptions(chart, processedOptions, userOptions) {\n var _a, _b, _c, _d;\n var completeOptions = jsonMerge([(_a = chart.processedOptions) !== null && _a !== void 0 ? _a : {}, processedOptions], noDataCloneMergeOptions);\n var modulesChanged = applyModules(chart, completeOptions);\n var skip = ['type', 'data', 'series', 'listeners', 'theme', 'legend'];\n if (isAgCartesianChartOptions(processedOptions) || isAgPolarChartOptions(processedOptions)) {\n // Append axes to defaults.\n skip.push('axes');\n }\n else if (isAgHierarchyChartOptions(processedOptions)) ;\n else {\n throw new Error(\"AG Charts - couldn't apply configuration, check type of options and chart: \" + processedOptions['type']);\n }\n // Needs to be done before applying the series to detect if a seriesNode[Double]Click listener has been added\n if (processedOptions.listeners) {\n registerListeners(chart, processedOptions.listeners);\n }\n applyOptionValues(chart, processedOptions, { skip: skip });\n var forceNodeDataRefresh = false;\n if (processedOptions.series && processedOptions.series.length > 0) {\n applySeries(chart, processedOptions);\n forceNodeDataRefresh = true;\n }\n if ('axes' in processedOptions && Array.isArray(processedOptions.axes)) {\n var axesPresent = applyAxes(chart, processedOptions);\n if (axesPresent) {\n forceNodeDataRefresh = true;\n }\n }\n applyLegend(chart, processedOptions);\n var seriesOpts = processedOptions.series;\n var seriesDataUpdate = !!processedOptions.data || (seriesOpts === null || seriesOpts === void 0 ? void 0 : seriesOpts.some(function (s) { return s.data != null; }));\n var otherRefreshUpdate = (_c = (_b = processedOptions.legend) !== null && _b !== void 0 ? _b : processedOptions.title) !== null && _c !== void 0 ? _c : processedOptions.subtitle;\n forceNodeDataRefresh = forceNodeDataRefresh || seriesDataUpdate || !!otherRefreshUpdate;\n if (processedOptions.data) {\n chart.data = processedOptions.data;\n }\n if (processedOptions.listeners) {\n chart.updateAllSeriesListeners();\n }\n chart.processedOptions = completeOptions;\n chart.userOptions = jsonMerge([(_d = chart.userOptions) !== null && _d !== void 0 ? _d : {}, userOptions], noDataCloneMergeOptions);\n var majorChange = forceNodeDataRefresh || modulesChanged;\n var updateType = majorChange ? ChartUpdateType.PROCESS_DATA : ChartUpdateType.PERFORM_LAYOUT;\n debug('AgChartV2.applyChartOptions() - update type', ChartUpdateType[updateType]);\n chart.update(updateType, { forceNodeDataRefresh: forceNodeDataRefresh });\n}\nfunction applyModules(chart, options) {\n var e_1, _a;\n var matchingChartType = function (module) {\n return ((chart instanceof CartesianChart && module.chartTypes.includes('cartesian')) ||\n (chart instanceof PolarChart && module.chartTypes.includes('polar')) ||\n (chart instanceof HierarchyChart && module.chartTypes.includes('hierarchy')));\n };\n var modulesChanged = false;\n var rootModules = REGISTERED_MODULES.filter(function (m) { return m.type === 'root'; });\n try {\n for (var rootModules_1 = __values$9(rootModules), rootModules_1_1 = rootModules_1.next(); !rootModules_1_1.done; rootModules_1_1 = rootModules_1.next()) {\n var next = rootModules_1_1.value;\n var shouldBeEnabled = matchingChartType(next) && options[next.optionsKey] != null;\n var isEnabled = chart.isModuleEnabled(next);\n if (shouldBeEnabled === isEnabled)\n continue;\n modulesChanged = true;\n if (shouldBeEnabled) {\n chart.addModule(next);\n }\n else {\n chart.removeModule(next);\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (rootModules_1_1 && !rootModules_1_1.done && (_a = rootModules_1.return)) _a.call(rootModules_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n return modulesChanged;\n}\nfunction applySeries(chart, options) {\n var optSeries = options.series;\n if (!optSeries) {\n return;\n }\n var matchingTypes = chart.series.length === optSeries.length && chart.series.every(function (s, i) { var _a; return s.type === ((_a = optSeries[i]) === null || _a === void 0 ? void 0 : _a.type); });\n // Try to optimise series updates if series count and types didn't change.\n if (matchingTypes) {\n chart.series.forEach(function (s, i) {\n var _a, _b, _c, _d;\n var previousOpts = (_c = (_b = (_a = chart.processedOptions) === null || _a === void 0 ? void 0 : _a.series) === null || _b === void 0 ? void 0 : _b[i]) !== null && _c !== void 0 ? _c : {};\n var seriesDiff = jsonDiff(previousOpts, (_d = optSeries[i]) !== null && _d !== void 0 ? _d : {});\n if (!seriesDiff) {\n return;\n }\n debug(\"AgChartV2.applySeries() - applying series diff idx \" + i, seriesDiff);\n applySeriesValues(s, seriesDiff, { path: \"series[\" + i + \"]\", index: i });\n s.markNodeDataDirty();\n });\n return;\n }\n chart.series = createSeries(chart, optSeries);\n}\nfunction applyAxes(chart, options) {\n var optAxes = options.axes;\n if (!optAxes) {\n return false;\n }\n var matchingTypes = chart.axes.length === optAxes.length && chart.axes.every(function (a, i) { return a.type === optAxes[i].type; });\n // Try to optimise series updates if series count and types didn't change.\n if (matchingTypes) {\n var oldOpts_1 = chart.processedOptions;\n if (isAgCartesianChartOptions(oldOpts_1)) {\n chart.axes.forEach(function (a, i) {\n var _a, _b;\n var previousOpts = (_b = (_a = oldOpts_1.axes) === null || _a === void 0 ? void 0 : _a[i]) !== null && _b !== void 0 ? _b : {};\n var axisDiff = jsonDiff(previousOpts, optAxes[i]);\n debug(\"AgChartV2.applyAxes() - applying axis diff idx \" + i, axisDiff);\n var path = \"axes[\" + i + \"]\";\n var skip = ['axes[].type'];\n applyOptionValues(a, axisDiff, { path: path, skip: skip });\n });\n return true;\n }\n }\n chart.axes = createAxis(chart, optAxes);\n return true;\n}\nfunction applyLegend(chart, options) {\n var skip = ['listeners'];\n chart.setLegendInit(function (legend) {\n var _a, _b, _c, _d;\n applyOptionValues(legend, (_a = options.legend) !== null && _a !== void 0 ? _a : {}, { skip: skip });\n if ((_b = options.legend) === null || _b === void 0 ? void 0 : _b.listeners) {\n Object.assign((_c = chart.legend) === null || _c === void 0 ? void 0 : _c.listeners, (_d = options.legend.listeners) !== null && _d !== void 0 ? _d : {});\n }\n });\n}\nfunction createSeries(chart, options) {\n var e_2, _a;\n var _b;\n var series = [];\n var moduleContext = chart.getModuleContext();\n var index = 0;\n try {\n for (var _c = __values$9(options !== null && options !== void 0 ? options : []), _d = _c.next(); !_d.done; _d = _c.next()) {\n var seriesOptions = _d.value;\n var path = \"series[\" + index++ + \"]\";\n var seriesInstance = getSeries((_b = seriesOptions.type) !== null && _b !== void 0 ? _b : 'unknown', moduleContext);\n applySeriesValues(seriesInstance, seriesOptions, { path: path, index: index });\n series.push(seriesInstance);\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (_d && !_d.done && (_a = _c.return)) _a.call(_c);\n }\n finally { if (e_2) throw e_2.error; }\n }\n return series;\n}\nfunction createAxis(chart, options) {\n var e_3, _a;\n var axes = [];\n var skip = ['axes[].type'];\n var moduleContext = chart.getModuleContext();\n var index = 0;\n try {\n for (var _b = __values$9(options !== null && options !== void 0 ? options : []), _c = _b.next(); !_c.done; _c = _b.next()) {\n var axisOptions = _c.value;\n var axis = getAxis(axisOptions.type, moduleContext);\n var path = \"axes[\" + index++ + \"]\";\n applyAxisModules(axis, axisOptions);\n applyOptionValues(axis, axisOptions, { path: path, skip: skip });\n axes.push(axis);\n }\n }\n catch (e_3_1) { e_3 = { error: e_3_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_3) throw e_3.error; }\n }\n return axes;\n}\nfunction applyAxisModules(axis, options) {\n var e_4, _a;\n var modulesChanged = false;\n var rootModules = REGISTERED_MODULES.filter(function (m) { return m.type === 'axis-option'; });\n try {\n for (var rootModules_2 = __values$9(rootModules), rootModules_2_1 = rootModules_2.next(); !rootModules_2_1.done; rootModules_2_1 = rootModules_2.next()) {\n var next = rootModules_2_1.value;\n var shouldBeEnabled = options[next.optionsKey] != null;\n var isEnabled = axis.isModuleEnabled(next);\n if (shouldBeEnabled === isEnabled)\n continue;\n modulesChanged = true;\n if (shouldBeEnabled) {\n axis.addModule(next);\n }\n else {\n axis.removeModule(next);\n }\n }\n }\n catch (e_4_1) { e_4 = { error: e_4_1 }; }\n finally {\n try {\n if (rootModules_2_1 && !rootModules_2_1.done && (_a = rootModules_2.return)) _a.call(rootModules_2);\n }\n finally { if (e_4) throw e_4.error; }\n }\n return modulesChanged;\n}\nfunction registerListeners(source, listeners) {\n source.clearEventListeners();\n for (var property in listeners) {\n var listener = listeners[property];\n if (typeof listener !== 'function')\n continue;\n source.addEventListener(property, listener);\n }\n}\nfunction applyOptionValues(target, options, _a) {\n var _b = _a === void 0 ? {} : _a, skip = _b.skip, path = _b.path;\n var applyOpts = __assign$p(__assign$p(__assign$p({}, getJsonApplyOptions()), { skip: skip }), (path ? { path: path } : {}));\n return jsonApply(target, options, applyOpts);\n}\nfunction applySeriesValues(target, options, _a) {\n var _b, _c;\n var _d = _a === void 0 ? {} : _a, path = _d.path, index = _d.index;\n var skip = ['series[].listeners', 'series[].seriesGrouping'];\n var jsonApplyOptions = getJsonApplyOptions();\n var ctrs = (_b = jsonApplyOptions.constructors) !== null && _b !== void 0 ? _b : {};\n var seriesTypeOverrides = {\n constructors: __assign$p(__assign$p({}, ctrs), { title: target.type === 'pie' ? PieTitle : ctrs['title'] }),\n };\n var applyOpts = __assign$p(__assign$p(__assign$p(__assign$p(__assign$p({}, jsonApplyOptions), seriesTypeOverrides), { skip: __spreadArray$d(['series[].type'], __read$q((skip !== null && skip !== void 0 ? skip : []))) }), (path ? { path: path } : {})), { idx: index !== null && index !== void 0 ? index : -1 });\n var result = jsonApply(target, options, applyOpts);\n var listeners = options === null || options === void 0 ? void 0 : options.listeners;\n if (listeners != null) {\n registerListeners(target, listeners);\n }\n var seriesGrouping = options.seriesGrouping;\n if ('seriesGrouping' in (options !== null && options !== void 0 ? options : {})) {\n if (seriesGrouping) {\n var newSeriesGroup = Object.freeze(__assign$p(__assign$p({}, ((_c = target.seriesGrouping) !== null && _c !== void 0 ? _c : {})), seriesGrouping));\n target.seriesGrouping = newSeriesGroup;\n }\n else {\n target.seriesGrouping = seriesGrouping;\n }\n }\n return result;\n}\n\n// DO NOT UPDATE MANUALLY: Generated from script during build time\nvar VERSION$b = '8.0.6';\n\nvar __extends$1K = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$1f = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar ArcType;\n(function (ArcType) {\n ArcType[ArcType[\"Open\"] = 0] = \"Open\";\n ArcType[ArcType[\"Chord\"] = 1] = \"Chord\";\n ArcType[ArcType[\"Round\"] = 2] = \"Round\";\n})(ArcType || (ArcType = {}));\n/**\n * Elliptical arc node.\n */\nvar Arc = /** @class */ (function (_super) {\n __extends$1K(Arc, _super);\n function Arc() {\n var _this = _super.call(this) || this;\n _this.centerX = 0;\n _this.centerY = 0;\n _this.radius = 10;\n _this.startAngle = 0;\n _this.endAngle = Math.PI * 2;\n _this.counterClockwise = false;\n /**\n * The type of arc to render:\n * - {@link ArcType.Open} - end points of the arc segment are not connected (default)\n * - {@link ArcType.Chord} - end points of the arc segment are connected by a line segment\n * - {@link ArcType.Round} - each of the end points of the arc segment are connected\n * to the center of the arc\n * Arcs with {@link ArcType.Open} do not support hit testing, even if they have their\n * {@link Shape.fillStyle} set, because they are not closed paths. Hit testing support\n * would require using two paths - one for rendering, another for hit testing - and there\n * doesn't seem to be a compelling reason to do that, when one can just use {@link ArcType.Chord}\n * to create a closed path.\n */\n _this.type = ArcType.Open;\n _this.restoreOwnStyles();\n return _this;\n }\n Object.defineProperty(Arc.prototype, \"fullPie\", {\n get: function () {\n return isEqual(normalizeAngle360(this.startAngle), normalizeAngle360(this.endAngle));\n },\n enumerable: false,\n configurable: true\n });\n Arc.prototype.updatePath = function () {\n var path = this.path;\n path.clear(); // No need to recreate the Path, can simply clear the existing one.\n path.arc(this.centerX, this.centerY, this.radius, this.startAngle, this.endAngle, this.counterClockwise);\n if (this.type === ArcType.Chord) {\n path.closePath();\n }\n else if (this.type === ArcType.Round && !this.fullPie) {\n path.lineTo(this.centerX, this.centerY);\n path.closePath();\n }\n };\n Arc.prototype.computeBBox = function () {\n // Only works with full arcs (circles) and untransformed ellipses.\n return new BBox(this.centerX - this.radius, this.centerY - this.radius, this.radius * 2, this.radius * 2);\n };\n Arc.prototype.isPointInPath = function (x, y) {\n var point = this.transformPoint(x, y);\n var bbox = this.computeBBox();\n return (this.type !== ArcType.Open &&\n bbox.containsPoint(point.x, point.y) &&\n this.path.isPointInPath(point.x, point.y));\n };\n Arc.className = 'Arc';\n Arc.defaultStyles = Object.assign({}, Shape.defaultStyles, {\n lineWidth: 1,\n fillStyle: null,\n });\n __decorate$1f([\n ScenePathChangeDetection()\n ], Arc.prototype, \"centerX\", void 0);\n __decorate$1f([\n ScenePathChangeDetection()\n ], Arc.prototype, \"centerY\", void 0);\n __decorate$1f([\n ScenePathChangeDetection()\n ], Arc.prototype, \"radius\", void 0);\n __decorate$1f([\n ScenePathChangeDetection()\n ], Arc.prototype, \"startAngle\", void 0);\n __decorate$1f([\n ScenePathChangeDetection()\n ], Arc.prototype, \"endAngle\", void 0);\n __decorate$1f([\n ScenePathChangeDetection()\n ], Arc.prototype, \"counterClockwise\", void 0);\n __decorate$1f([\n ScenePathChangeDetection()\n ], Arc.prototype, \"type\", void 0);\n return Arc;\n}(Path));\n\nvar __extends$1J = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$1e = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\n/** @class */ ((function (_super) {\n __extends$1J(Image, _super);\n function Image(sourceImage) {\n var _this = _super.call(this) || this;\n _this.x = 0;\n _this.y = 0;\n _this.width = 0;\n _this.height = 0;\n _this.opacity = 1;\n _this.sourceImage = sourceImage;\n return _this;\n }\n Image.prototype.render = function (renderCtx) {\n var ctx = renderCtx.ctx, forceRender = renderCtx.forceRender, stats = renderCtx.stats;\n if (this.dirty === RedrawType.NONE && !forceRender) {\n if (stats)\n stats.nodesSkipped++;\n return;\n }\n this.computeTransformMatrix();\n this.matrix.toContext(ctx);\n var image = this.sourceImage;\n ctx.globalAlpha = this.opacity;\n ctx.drawImage(image, 0, 0, image.width, image.height, this.x, this.y, this.width, this.height);\n _super.prototype.render.call(this, renderCtx);\n };\n __decorate$1e([\n SceneChangeDetection({ redraw: RedrawType.MAJOR })\n ], Image.prototype, \"x\", void 0);\n __decorate$1e([\n SceneChangeDetection({ redraw: RedrawType.MAJOR })\n ], Image.prototype, \"y\", void 0);\n __decorate$1e([\n SceneChangeDetection({ redraw: RedrawType.MAJOR })\n ], Image.prototype, \"width\", void 0);\n __decorate$1e([\n SceneChangeDetection({ redraw: RedrawType.MAJOR })\n ], Image.prototype, \"height\", void 0);\n __decorate$1e([\n SceneChangeDetection({ redraw: RedrawType.MAJOR })\n ], Image.prototype, \"opacity\", void 0);\n return Image;\n})(Node));\n\nvar __read$p = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar themes = Object.entries(themes$1).reduce(function (obj, _a) {\n var _b = __read$p(_a, 2), name = _b[0], factory = _b[1];\n obj[name] = factory();\n return obj;\n}, {});\n\nvar VALID_SERIES_TYPES = [\n 'area',\n 'bar',\n 'column',\n 'histogram',\n 'line',\n 'pie',\n 'scatter',\n];\nfunction getSeriesType(chartType) {\n switch (chartType) {\n case 'bar':\n case 'groupedBar':\n case 'stackedBar':\n case 'normalizedBar':\n return 'bar';\n case 'column':\n case 'groupedColumn':\n case 'stackedColumn':\n case 'normalizedColumn':\n return 'column';\n case 'line':\n return 'line';\n case 'area':\n case 'stackedArea':\n case 'normalizedArea':\n return 'area';\n case 'scatter':\n case 'bubble':\n return 'scatter';\n case 'histogram':\n return 'histogram';\n case 'pie':\n case 'doughnut':\n return 'pie';\n default:\n return 'cartesian';\n }\n}\n\nvar ALL_AXIS_TYPES = ['number', 'category', 'groupedCategory', 'log', 'time'];\nfunction getLegacyAxisType(chartType) {\n switch (chartType) {\n case 'bar':\n case 'stackedBar':\n case 'normalizedBar':\n return ['number', 'category'];\n case 'groupedBar':\n return ['number', 'groupedCategory'];\n case 'column':\n case 'stackedColumn':\n case 'normalizedColumn':\n case 'line':\n case 'area':\n case 'stackedArea':\n case 'normalizedArea':\n case 'histogram':\n return ['category', 'number'];\n case 'groupedColumn':\n return ['groupedCategory', 'number'];\n case 'scatter':\n case 'bubble':\n return ['number', 'number'];\n default:\n return undefined;\n }\n}\n\nvar __assign$o = (undefined && undefined.__assign) || function () {\n __assign$o = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$o.apply(this, arguments);\n};\nfunction createAgChartTheme(chartProxyParams, proxy) {\n var _a;\n var chartOptionsToRestore = chartProxyParams.chartOptionsToRestore, chartPaletteToRestore = chartProxyParams.chartPaletteToRestore, chartThemeToRestore = chartProxyParams.chartThemeToRestore;\n var themeName = getSelectedTheme(chartProxyParams);\n var stockTheme = isStockTheme(themeName);\n var rootTheme = stockTheme\n ? { baseTheme: themeName }\n : (_a = lookupCustomChartTheme(chartProxyParams, themeName)) !== null && _a !== void 0 ? _a : {};\n var gridOptionsThemeOverrides = chartProxyParams.getGridOptionsChartThemeOverrides();\n var apiThemeOverrides = chartProxyParams.apiChartThemeOverrides;\n var standaloneChartType = getSeriesType(chartProxyParams.chartType);\n var crossFilterThemeOverridePoint = standaloneChartType === 'pie' ? 'polar' : 'cartesian';\n var crossFilteringOverrides = chartProxyParams.crossFiltering\n ? createCrossFilterThemeOverrides(proxy, chartProxyParams, crossFilterThemeOverridePoint)\n : undefined;\n var formattingPanelOverrides = __assign$o({}, (chartOptionsToRestore !== null && chartOptionsToRestore !== void 0 ? chartOptionsToRestore : {}));\n var isTitleEnabled = function () {\n var isTitleEnabled = function (obj) {\n if (!obj) {\n return false;\n }\n return Object.keys(obj).some(function (key) { return _.get(obj[key], 'title.enabled', false); });\n };\n return isTitleEnabled(gridOptionsThemeOverrides) || isTitleEnabled(apiThemeOverrides);\n };\n // Overrides in ascending precedence ordering.\n var overrides = [\n stockTheme ? inbuiltStockThemeOverrides(chartProxyParams, isTitleEnabled()) : undefined,\n crossFilteringOverrides,\n gridOptionsThemeOverrides,\n apiThemeOverrides,\n formattingPanelOverrides,\n ];\n // Recursively nest theme overrides so they are applied with correct precedence in\n // Standalone Charts - this is an undocumented feature.\n // Outermost theme overrides will be the formatting panel configured values, so they are\n // differentiated from grid-config and inbuilt overrides.\n var theme = overrides\n .filter(function (v) { return !!v; })\n .reduce(function (r, n) { return ({\n baseTheme: r,\n overrides: n,\n }); }, rootTheme);\n // Avoid explicitly setting the `theme.palette` property unless we're using the restored theme\n // AND the palette is actually different.\n if (chartPaletteToRestore && themeName === chartThemeToRestore) {\n var rootThemePalette = getChartTheme(rootTheme).palette;\n if (!isIdenticalPalette(chartPaletteToRestore, rootThemePalette)) {\n theme.palette = chartPaletteToRestore;\n }\n }\n return theme;\n}\nfunction isIdenticalPalette(paletteA, paletteB) {\n var arrayCompare = function (arrA, arrB) {\n if (arrA.length !== arrB.length)\n return false;\n return arrA.every(function (v, i) { return v === arrB[i]; });\n };\n return arrayCompare(paletteA.fills, paletteB.fills) &&\n arrayCompare(paletteA.strokes, paletteB.strokes);\n}\nfunction isStockTheme(themeName) {\n return _.includes(Object.keys(themes), themeName);\n}\nfunction createCrossFilterThemeOverrides(proxy, chartProxyParams, overrideType) {\n var _a;\n var legend = {\n listeners: {\n legendItemClick: function (e) {\n var chart = proxy.getChart();\n chart.series.forEach(function (s) {\n s.toggleSeriesItem(e.itemId, e.enabled);\n s.toggleSeriesItem(e.itemId + \"-filtered-out\", e.enabled);\n });\n },\n },\n };\n var series = {};\n if (overrideType === 'polar') {\n series.pie = {\n tooltip: {\n renderer: function (_a) {\n var angleName = _a.angleName, datum = _a.datum, calloutLabelKey = _a.calloutLabelKey, radiusKey = _a.radiusKey, angleValue = _a.angleValue;\n var title = angleName;\n var label = datum[calloutLabelKey];\n var ratio = datum[radiusKey];\n var totalValue = angleValue;\n return { title: title, content: label + \": \" + totalValue * ratio };\n },\n },\n };\n }\n return _a = {},\n _a[overrideType] = {\n tooltip: {\n delay: 500,\n },\n legend: legend,\n listeners: {\n click: function (e) { return chartProxyParams.crossFilterCallback(e, true); },\n },\n series: series,\n },\n _a;\n}\nvar STATIC_INBUILT_STOCK_THEME_AXES_OVERRIDES = ALL_AXIS_TYPES.reduce(function (r, n) {\n var _a;\n return (__assign$o(__assign$o({}, r), (_a = {}, _a[n] = { title: { _enabledFromTheme: true } }, _a)));\n}, {});\nfunction inbuiltStockThemeOverrides(params, titleEnabled) {\n var extraPadding = params.getExtraPaddingDirections();\n return {\n common: {\n axes: STATIC_INBUILT_STOCK_THEME_AXES_OVERRIDES,\n padding: {\n // don't add extra padding when a title is present!\n top: !titleEnabled && extraPadding.includes('top') ? 40 : 20,\n right: extraPadding.includes('right') ? 30 : 20,\n bottom: extraPadding.includes('bottom') ? 40 : 20,\n left: extraPadding.includes('left') ? 30 : 20,\n },\n },\n pie: {\n series: {\n title: { _enabledFromTheme: true },\n calloutLabel: { _enabledFromTheme: true },\n sectorLabel: {\n enabled: false,\n _enabledFromTheme: true,\n },\n },\n },\n };\n}\nfunction getSelectedTheme(chartProxyParams) {\n var chartThemeName = chartProxyParams.getChartThemeName();\n var availableThemes = chartProxyParams.getChartThemes();\n if (!_.includes(availableThemes, chartThemeName)) {\n chartThemeName = availableThemes[0];\n }\n return chartThemeName;\n}\nfunction lookupCustomChartTheme(chartProxyParams, name) {\n var customChartThemes = chartProxyParams.customChartThemes;\n var customChartTheme = customChartThemes && customChartThemes[name];\n if (!customChartTheme) {\n console.warn(\"AG Grid: no stock theme exists with the name '\" + name + \"' and no \" +\n \"custom chart theme with that name was supplied to 'customChartThemes'\");\n }\n return customChartTheme;\n}\n\nvar __read$o = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray$c = (undefined && undefined.__spreadArray) || function (to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\n to[j] = from[i];\n return to;\n};\nvar __values$8 = (undefined && undefined.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nvar validateIfDefined = function (validationFn) {\n return function (value) {\n if (value === undefined)\n return true;\n return validationFn(value);\n };\n};\nvar isString$1 = function (value) { return typeof value === 'string'; };\nvar isBoolean = function (value) { return typeof value === 'boolean'; };\nvar isValidSeriesChartType = function (value) { return typeof value === 'object'; };\nvar createWarnMessage = function (property, expectedType) {\n return function (value) { return \"AG Grid - unable to update chart as invalid params supplied: `\" + property + \": \" + value + \"`, expected \" + expectedType + \".\"; };\n};\nvar UpdateParamsValidator = /** @class */ (function () {\n function UpdateParamsValidator() {\n }\n UpdateParamsValidator.validateChartParams = function (params) {\n var paramsToValidate = params;\n switch (paramsToValidate.type) {\n case 'rangeChartUpdate':\n return UpdateParamsValidator.validateUpdateRangeChartParams(params);\n case 'pivotChartUpdate':\n return UpdateParamsValidator.validateUpdatePivotChartParams(params);\n case 'crossFilterChartUpdate':\n return UpdateParamsValidator.validateUpdateCrossFilterChartParams(params);\n default:\n console.warn(\"AG Grid - Invalid value supplied for 'type': \" + params.type + \". It must be either 'rangeChartUpdate', 'pivotChartUpdate', or 'crossFilterChartUpdate'.\");\n return false;\n }\n };\n UpdateParamsValidator.validateUpdateRangeChartParams = function (params) {\n var validations = __spreadArray$c(__spreadArray$c(__spreadArray$c([], __read$o(UpdateParamsValidator.commonValidations)), __read$o(UpdateParamsValidator.cellRangeValidations)), [\n {\n property: 'seriesChartTypes',\n validationFn: function (value) { return value === undefined || (Array.isArray(value) && value.every(isValidSeriesChartType)); },\n warnMessage: createWarnMessage('seriesChartTypes', 'Array of SeriesChartType'),\n },\n ]);\n return UpdateParamsValidator.validateProperties(params, validations, ['type', 'chartId', 'chartType', 'chartThemeName', 'chartThemeOverrides', 'unlinkChart', 'cellRange', 'suppressChartRanges', 'aggFunc', 'seriesChartTypes'], 'UpdateRangeChartParams');\n };\n UpdateParamsValidator.validateUpdatePivotChartParams = function (params) {\n var validations = __spreadArray$c([], __read$o(UpdateParamsValidator.commonValidations));\n return UpdateParamsValidator.validateProperties(params, validations, ['type', 'chartId', 'chartType', 'chartThemeName', 'chartThemeOverrides', 'unlinkChart'], 'UpdatePivotChartParams');\n };\n UpdateParamsValidator.validateUpdateCrossFilterChartParams = function (params) {\n var validations = __spreadArray$c(__spreadArray$c([], __read$o(UpdateParamsValidator.commonValidations)), __read$o(UpdateParamsValidator.cellRangeValidations));\n return UpdateParamsValidator.validateProperties(params, validations, ['type', 'chartId', 'chartType', 'chartThemeName', 'chartThemeOverrides', 'unlinkChart', 'cellRange', 'suppressChartRanges', 'aggFunc'], 'UpdateCrossFilterChartParams');\n };\n UpdateParamsValidator.validateProperties = function (params, validations, validPropertyNames, paramsType) {\n var e_1, _a;\n try {\n for (var validations_1 = __values$8(validations), validations_1_1 = validations_1.next(); !validations_1_1.done; validations_1_1 = validations_1.next()) {\n var validation = validations_1_1.value;\n var property = validation.property, validationFn = validation.validationFn, warnMessage = validation.warnMessage;\n if (property in params) {\n var value = params[property];\n if (!validationFn(value)) {\n console.warn(warnMessage(value));\n return false;\n }\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (validations_1_1 && !validations_1_1.done && (_a = validations_1.return)) _a.call(validations_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n // Check for unexpected properties\n for (var property in params) {\n if (!validPropertyNames.includes(property)) {\n console.warn(\"AG Grid - Unexpected property supplied. \" + paramsType + \" does not contain: `\" + property + \"`.\");\n return false;\n }\n }\n return true;\n };\n UpdateParamsValidator.validChartTypes = [\n 'column',\n 'groupedColumn',\n 'stackedColumn',\n 'normalizedColumn',\n 'bar',\n 'groupedBar',\n 'stackedBar',\n 'normalizedBar',\n 'line',\n 'scatter',\n 'bubble',\n 'pie',\n 'doughnut',\n 'area',\n 'stackedArea',\n 'normalizedArea',\n 'histogram',\n 'columnLineCombo',\n 'areaColumnCombo',\n 'customCombo'\n ];\n UpdateParamsValidator.validateChartType = validateIfDefined(function (chartType) {\n return UpdateParamsValidator.validChartTypes.includes(chartType);\n });\n UpdateParamsValidator.validateAgChartThemeOverrides = validateIfDefined(function (themeOverrides) {\n // ensure supplied AgChartThemeOverrides is an object - can be improved if necessary?\n return typeof themeOverrides === 'object';\n });\n UpdateParamsValidator.validateChartParamsCellRange = validateIfDefined(function (cellRange) {\n // ensure supplied ChartParamsCellRange is an object - can be improved if necessary?\n return typeof cellRange === 'object';\n });\n UpdateParamsValidator.validateAggFunc = validateIfDefined(function (aggFunc) {\n // ensure supplied aggFunc is a `string` or `function` - can be improved if necessary?\n return typeof aggFunc === 'string' || typeof aggFunc === 'function';\n });\n UpdateParamsValidator.commonValidations = [\n { property: 'chartId', validationFn: isString$1, warnMessage: createWarnMessage('chartId', 'string') },\n {\n property: 'chartType',\n validationFn: UpdateParamsValidator.validateChartType,\n warnMessage: createWarnMessage('chartType', UpdateParamsValidator.validChartTypes.join(', '))\n },\n {\n property: 'chartThemeName',\n validationFn: isString$1,\n warnMessage: createWarnMessage('chartThemeName', 'string')\n },\n {\n property: 'chartThemeOverrides',\n validationFn: UpdateParamsValidator.validateAgChartThemeOverrides,\n warnMessage: createWarnMessage('chartThemeOverrides', 'AgChartThemeOverrides')\n },\n { property: 'unlinkChart', validationFn: isBoolean, warnMessage: createWarnMessage('unlinkChart', 'boolean') },\n ];\n UpdateParamsValidator.cellRangeValidations = [\n {\n property: 'cellRange',\n validationFn: UpdateParamsValidator.validateChartParamsCellRange,\n warnMessage: createWarnMessage('cellRange', 'ChartParamsCellRange')\n },\n {\n property: 'suppressChartRanges',\n validationFn: isBoolean,\n warnMessage: createWarnMessage('suppressChartRanges', 'boolean')\n },\n {\n property: 'aggFunc',\n validationFn: UpdateParamsValidator.validateAggFunc,\n warnMessage: createWarnMessage('aggFunc', 'string or IAggFunc')\n },\n ];\n return UpdateParamsValidator;\n}());\n\nvar __extends$1I = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign$n = (undefined && undefined.__assign) || function () {\n __assign$n = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$n.apply(this, arguments);\n};\nvar __decorate$1d = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar DEFAULT_THEMES = ['ag-default', 'ag-material', 'ag-pastel', 'ag-vivid', 'ag-solar'];\nvar ChartController = /** @class */ (function (_super) {\n __extends$1I(ChartController, _super);\n function ChartController(model) {\n var _this = _super.call(this) || this;\n _this.model = model;\n return _this;\n }\n ChartController.prototype.init = function () {\n var _this = this;\n this.setChartRange();\n this.addManagedListener(this.eventService, Events.EVENT_RANGE_SELECTION_CHANGED, function (event) {\n if (event.id && event.id === _this.model.chartId) {\n _this.updateForRangeChange();\n }\n });\n if (this.model.unlinked) {\n if (this.rangeService) {\n this.rangeService.setCellRanges([]);\n }\n }\n this.addManagedListener(this.eventService, Events.EVENT_COLUMN_MOVED, this.updateForGridChange.bind(this));\n this.addManagedListener(this.eventService, Events.EVENT_COLUMN_PINNED, this.updateForGridChange.bind(this));\n this.addManagedListener(this.eventService, Events.EVENT_COLUMN_VISIBLE, this.updateForGridChange.bind(this));\n this.addManagedListener(this.eventService, Events.EVENT_COLUMN_ROW_GROUP_CHANGED, this.updateForGridChange.bind(this));\n this.addManagedListener(this.eventService, Events.EVENT_MODEL_UPDATED, this.updateForGridChange.bind(this));\n this.addManagedListener(this.eventService, Events.EVENT_CELL_VALUE_CHANGED, this.updateForDataChange.bind(this));\n };\n ChartController.prototype.update = function (params) {\n var _a, _b, _c, _d, _e, _f, _g;\n if (!this.validUpdateType(params) || !UpdateParamsValidator.validateChartParams(params)) {\n return false;\n }\n var chartId = params.chartId, chartType = params.chartType, chartThemeName = params.chartThemeName, unlinkChart = params.unlinkChart;\n // create a common base for the chart model parameters (this covers pivot chart updates)\n var common = {\n chartId: chartId,\n pivotChart: this.model.pivotChart,\n chartType: chartType !== null && chartType !== void 0 ? chartType : this.model.chartType,\n chartThemeName: chartThemeName !== null && chartThemeName !== void 0 ? chartThemeName : this.model.chartThemeName,\n unlinkChart: unlinkChart !== null && unlinkChart !== void 0 ? unlinkChart : this.model.unlinked,\n cellRange: this.model.suppliedCellRange,\n aggFunc: this.model.aggFunc,\n seriesChartTypes: undefined,\n suppressChartRanges: false,\n crossFiltering: false\n };\n var chartModelParams = __assign$n({}, common);\n // modify the chart model properties based on the type of update\n switch (params.type) {\n case 'rangeChartUpdate':\n chartModelParams.cellRange = (_a = this.createCellRange(params)) !== null && _a !== void 0 ? _a : this.model.suppliedCellRange;\n chartModelParams.aggFunc = (_b = params.aggFunc) !== null && _b !== void 0 ? _b : this.model.aggFunc;\n chartModelParams.seriesChartTypes = params.seriesChartTypes;\n chartModelParams.suppressChartRanges = (_c = params.suppressChartRanges) !== null && _c !== void 0 ? _c : this.model.suppressChartRanges;\n break;\n case 'crossFilterChartUpdate':\n chartModelParams.cellRange = (_d = this.createCellRange(params)) !== null && _d !== void 0 ? _d : this.model.suppliedCellRange;\n chartModelParams.aggFunc = (_e = params.aggFunc) !== null && _e !== void 0 ? _e : this.model.aggFunc;\n chartModelParams.crossFiltering = true;\n chartModelParams.suppressChartRanges = (_f = params.suppressChartRanges) !== null && _f !== void 0 ? _f : this.model.suppressChartRanges;\n break;\n }\n this.model.updateModel(chartModelParams);\n // if the chart should be unlinked or chart ranges suppressed, remove all cell ranges; otherwise, set the chart range\n var removeChartCellRanges = chartModelParams.unlinkChart || chartModelParams.suppressChartRanges;\n removeChartCellRanges ? (_g = this.rangeService) === null || _g === void 0 ? void 0 : _g.setCellRanges([]) : this.setChartRange();\n return true;\n };\n ChartController.prototype.updateForGridChange = function () {\n if (this.model.unlinked) {\n return;\n }\n this.model.updateCellRanges();\n this.model.updateData();\n this.setChartRange();\n };\n ChartController.prototype.updateForDataChange = function () {\n if (this.model.unlinked) {\n return;\n }\n this.model.updateData();\n this.raiseChartModelUpdateEvent();\n };\n ChartController.prototype.updateForRangeChange = function () {\n this.updateForGridChange();\n this.raiseChartRangeSelectionChangedEvent();\n };\n ChartController.prototype.updateForPanelChange = function (updatedCol) {\n this.model.updateCellRanges(updatedCol);\n this.model.updateData();\n this.setChartRange();\n this.raiseChartRangeSelectionChangedEvent();\n };\n ChartController.prototype.getChartUpdateParams = function (updatedOverrides) {\n var selectedCols = this.getSelectedValueColState();\n var fields = selectedCols.map(function (c) { return ({ colId: c.colId, displayName: c.displayName }); });\n var data = this.getChartData();\n var selectedDimension = this.getSelectedDimension();\n return {\n data: data,\n grouping: this.isGrouping(),\n category: {\n id: selectedDimension.colId,\n name: selectedDimension.displayName,\n chartDataType: this.model.getChartDataType(selectedDimension.colId)\n },\n fields: fields,\n chartId: this.getChartId(),\n getCrossFilteringContext: function () { return ({ lastSelectedChartId: 'xxx' }); },\n seriesChartTypes: this.getSeriesChartTypes(),\n updatedOverrides: updatedOverrides\n };\n };\n ChartController.prototype.getChartModel = function () {\n var modelType = this.model.pivotChart ? 'pivot' : 'range';\n var seriesChartTypes = this.isComboChart() ? this.model.comboChartModel.seriesChartTypes : undefined;\n return {\n modelType: modelType,\n chartId: this.model.chartId,\n chartType: this.model.chartType,\n chartThemeName: this.getChartThemeName(),\n chartOptions: this.chartProxy.getChartThemeOverrides(),\n chartPalette: this.chartProxy.getChartPalette(),\n cellRange: this.getCellRangeParams(),\n suppressChartRanges: this.model.suppressChartRanges,\n aggFunc: this.model.aggFunc,\n unlinkChart: this.model.unlinked,\n seriesChartTypes: seriesChartTypes\n };\n };\n ChartController.prototype.getChartId = function () {\n return this.model.chartId;\n };\n ChartController.prototype.getChartData = function () {\n return this.model.chartData;\n };\n ChartController.prototype.getChartType = function () {\n return this.model.chartType;\n };\n ChartController.prototype.setChartType = function (chartType) {\n this.model.chartType = chartType;\n this.model.comboChartModel.updateSeriesChartTypes();\n this.raiseChartModelUpdateEvent();\n this.raiseChartOptionsChangedEvent();\n };\n ChartController.prototype.setChartThemeName = function (chartThemeName) {\n this.model.chartThemeName = chartThemeName;\n this.raiseChartModelUpdateEvent();\n this.raiseChartOptionsChangedEvent();\n };\n ChartController.prototype.getChartThemeName = function () {\n return this.model.chartThemeName;\n };\n ChartController.prototype.isPivotChart = function () {\n return this.model.pivotChart;\n };\n ChartController.prototype.isPivotMode = function () {\n return this.model.isPivotMode();\n };\n ChartController.prototype.isGrouping = function () {\n return this.model.isGrouping();\n };\n ChartController.prototype.isCrossFilterChart = function () {\n return this.model.crossFiltering;\n };\n ChartController.prototype.getThemes = function () {\n return this.gridOptionsService.get('chartThemes') || DEFAULT_THEMES;\n };\n ChartController.prototype.getPalettes = function () {\n var _this = this;\n var themeNames = this.getThemes();\n return themeNames.map(function (themeName) {\n var stockTheme = isStockTheme(themeName);\n var theme = stockTheme ? themeName : _this.chartProxy.lookupCustomChartTheme(themeName);\n return getChartTheme(theme).palette;\n });\n };\n ChartController.prototype.getValueColState = function () {\n return this.model.valueColState.map(this.displayNameMapper.bind(this));\n };\n ChartController.prototype.getSelectedValueColState = function () {\n return this.getValueColState().filter(function (cs) { return cs.selected; });\n };\n ChartController.prototype.getSelectedDimension = function () {\n return this.model.getSelectedDimension();\n };\n ChartController.prototype.displayNameMapper = function (col) {\n var columnNames = this.model.columnNames[col.colId];\n col.displayName = columnNames ? columnNames.join(' - ') : this.model.getColDisplayName(col.column);\n return col;\n };\n ChartController.prototype.getColStateForMenu = function () {\n return { dimensionCols: this.model.dimensionColState, valueCols: this.getValueColState() };\n };\n ChartController.prototype.setChartRange = function (silent) {\n if (silent === void 0) { silent = false; }\n if (this.rangeService && !this.model.suppressChartRanges && !this.model.unlinked) {\n this.rangeService.setCellRanges(this.getCellRanges());\n }\n if (!silent) {\n this.raiseChartModelUpdateEvent();\n }\n };\n ChartController.prototype.detachChartRange = function () {\n // when chart is detached it won't listen to changes from the grid\n this.model.unlinked = !this.model.unlinked;\n if (this.model.unlinked) {\n // remove range from grid\n if (this.rangeService) {\n this.rangeService.setCellRanges([]);\n }\n }\n else {\n // update chart data may have changed\n this.updateForGridChange();\n }\n };\n ChartController.prototype.setChartProxy = function (chartProxy) {\n this.chartProxy = chartProxy;\n };\n ChartController.prototype.getChartProxy = function () {\n return this.chartProxy;\n };\n ChartController.prototype.isActiveXYChart = function () {\n return _.includes(['scatter', 'bubble'], this.getChartType());\n };\n ChartController.prototype.isChartLinked = function () {\n return !this.model.unlinked;\n };\n ChartController.prototype.customComboExists = function () {\n var savedCustomSeriesChartTypes = this.model.comboChartModel.savedCustomSeriesChartTypes;\n return savedCustomSeriesChartTypes && savedCustomSeriesChartTypes.length > 0;\n };\n ChartController.prototype.getSeriesChartTypes = function () {\n return this.model.comboChartModel.seriesChartTypes;\n };\n ChartController.prototype.isComboChart = function () {\n return this.model.isComboChart();\n };\n ChartController.prototype.updateSeriesChartType = function (colId, chartType, secondaryAxis) {\n var seriesChartType = this.model.comboChartModel.seriesChartTypes.find(function (s) { return s.colId === colId; });\n if (seriesChartType) {\n // once a combo chart has been modified it is now a 'customCombo' chart\n var updateChartType = this.model.chartType !== 'customCombo';\n if (updateChartType) {\n this.model.chartType = 'customCombo';\n }\n var prevSeriesChartType = seriesChartType.chartType;\n if (chartType != null) {\n seriesChartType.chartType = chartType;\n }\n if (secondaryAxis != null) {\n seriesChartType.secondaryAxis = secondaryAxis;\n }\n // replace existing custom series types with this latest version\n this.model.comboChartModel.savedCustomSeriesChartTypes = this.model.comboChartModel.seriesChartTypes;\n // series chart types can be modified, i.e. column chart types should be moved to primary axis\n this.model.comboChartModel.updateSeriesChartTypes();\n this.updateForDataChange();\n if (updateChartType) {\n // update the settings panel by raising an EVENT_CHART_TYPE_CHANGED event\n this.dispatchEvent({\n type: ChartController.EVENT_CHART_TYPE_CHANGED\n });\n }\n if (prevSeriesChartType !== chartType) {\n // update the format panel by raising an EVENT_CHART_SERIES_CHART_TYPE_CHANGED event\n this.dispatchEvent({\n type: ChartController.EVENT_CHART_SERIES_CHART_TYPE_CHANGED\n });\n }\n this.raiseChartOptionsChangedEvent();\n }\n };\n ChartController.prototype.getActiveSeriesChartTypes = function () {\n var selectedColIds = this.getSelectedValueColState().map(function (c) { return c.colId; });\n return this.getSeriesChartTypes().filter(function (s) { return selectedColIds.includes(s.colId); });\n };\n ChartController.prototype.getChartSeriesTypes = function () {\n var supportedComboSeriesTypes = ['line', 'column', 'area'];\n return this.isComboChart() ? supportedComboSeriesTypes : [getSeriesType(this.getChartType())];\n };\n ChartController.prototype.getCellRanges = function () {\n return [this.model.dimensionCellRange, this.model.valueCellRange].filter(function (r) { return r; });\n };\n ChartController.prototype.createCellRange = function (params) {\n var _a;\n return params.cellRange && ((_a = this.rangeService) === null || _a === void 0 ? void 0 : _a.createCellRangeFromCellRangeParams(params.cellRange));\n };\n ChartController.prototype.validUpdateType = function (params) {\n var _this = this;\n var _a;\n if (!params.type) {\n console.warn(\"AG Grid - Unable to update chart as the 'type' is missing. It must be either 'rangeChartUpdate', 'pivotChartUpdate', or 'crossFilterChartUpdate'.\");\n return false;\n }\n var chartTypeMap = {\n 'Range Chart': function () { return !_this.isPivotChart() && !_this.isCrossFilterChart(); },\n 'Pivot Chart': function () { return _this.isPivotChart(); },\n 'Cross Filter Chart': function () { return _this.isCrossFilterChart(); }\n };\n var currentChartType = (_a = Object.keys(chartTypeMap).find(function (type) { return chartTypeMap[type](); })) !== null && _a !== void 0 ? _a : 'Range Chart';\n var valid = params.type ===\n \"\" + currentChartType[0].toLowerCase() + currentChartType.slice(1).replace(/ /g, '') + \"Update\";\n if (!valid) {\n console.warn(\"AG Grid - Unable to update chart as a '\" + params.type + \"' update type is not permitted on a \" + currentChartType + \".\");\n }\n return valid;\n };\n ChartController.prototype.getCellRangeParams = function () {\n var cellRanges = this.getCellRanges();\n var firstCellRange = cellRanges[0];\n var startRow = (firstCellRange && firstCellRange.startRow) || null;\n var endRow = (firstCellRange && firstCellRange.endRow) || null;\n return {\n rowStartIndex: startRow && startRow.rowIndex,\n rowStartPinned: startRow && startRow.rowPinned,\n rowEndIndex: endRow && endRow.rowIndex,\n rowEndPinned: endRow && endRow.rowPinned,\n columns: cellRanges.reduce(function (columns, value) { return columns.concat(value.columns.map(function (c) { return c.getId(); })); }, [])\n };\n };\n ChartController.prototype.raiseChartModelUpdateEvent = function () {\n var event = {\n type: ChartController.EVENT_CHART_MODEL_UPDATE\n };\n this.dispatchEvent(event);\n };\n ChartController.prototype.raiseChartUpdatedEvent = function () {\n var event = {\n type: ChartController.EVENT_CHART_UPDATED\n };\n this.dispatchEvent(event);\n };\n ChartController.prototype.raiseChartApiUpdateEvent = function () {\n var event = {\n type: ChartController.EVENT_CHART_API_UPDATE\n };\n this.dispatchEvent(event);\n };\n ChartController.prototype.raiseChartOptionsChangedEvent = function () {\n var _a = this.getChartModel(), chartId = _a.chartId, chartType = _a.chartType;\n var event = {\n type: Events.EVENT_CHART_OPTIONS_CHANGED,\n chartId: chartId,\n chartType: chartType,\n chartThemeName: this.getChartThemeName(),\n chartOptions: this.chartProxy.getChartThemeOverrides()\n };\n this.eventService.dispatchEvent(event);\n };\n ChartController.prototype.raiseChartRangeSelectionChangedEvent = function () {\n var event = {\n type: Events.EVENT_CHART_RANGE_SELECTION_CHANGED,\n id: this.model.chartId,\n chartId: this.model.chartId,\n cellRange: this.getCellRangeParams()\n };\n this.eventService.dispatchEvent(event);\n };\n ChartController.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n if (this.rangeService) {\n this.rangeService.setCellRanges([]);\n }\n };\n ChartController.EVENT_CHART_UPDATED = 'chartUpdated';\n ChartController.EVENT_CHART_API_UPDATE = 'chartApiUpdate';\n ChartController.EVENT_CHART_MODEL_UPDATE = 'chartModelUpdate';\n ChartController.EVENT_CHART_TYPE_CHANGED = 'chartTypeChanged';\n ChartController.EVENT_CHART_SERIES_CHART_TYPE_CHANGED = 'chartSeriesChartTypeChanged';\n __decorate$1d([\n Autowired('rangeService')\n ], ChartController.prototype, \"rangeService\", void 0);\n __decorate$1d([\n PostConstruct\n ], ChartController.prototype, \"init\", null);\n return ChartController;\n}(BeanStub));\n\nvar __extends$1H = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$1c = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __read$n = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray$b = (undefined && undefined.__spreadArray) || function (to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\n to[j] = from[i];\n return to;\n};\nvar __values$7 = (undefined && undefined.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nvar DefaultDataPanelDef = {\n groups: [\n { type: 'categories', isOpen: true },\n { type: 'series', isOpen: true },\n { type: 'seriesChartType', isOpen: true }\n ]\n};\nvar ChartDataPanel = /** @class */ (function (_super) {\n __extends$1H(ChartDataPanel, _super);\n function ChartDataPanel(chartController, chartOptionsService) {\n var _this = _super.call(this, ChartDataPanel.TEMPLATE) || this;\n _this.chartController = chartController;\n _this.chartOptionsService = chartOptionsService;\n _this.columnComps = new Map();\n return _this;\n }\n ChartDataPanel.prototype.init = function () {\n this.updatePanels();\n this.addManagedListener(this.chartController, ChartController.EVENT_CHART_MODEL_UPDATE, this.updatePanels.bind(this));\n this.addManagedListener(this.chartController, ChartController.EVENT_CHART_API_UPDATE, this.updatePanels.bind(this));\n this.createAutoScrollService();\n };\n ChartDataPanel.prototype.destroy = function () {\n this.clearComponents();\n _super.prototype.destroy.call(this);\n };\n ChartDataPanel.prototype.updatePanels = function () {\n var _this = this;\n var _a, _b;\n var currentChartType = this.chartType;\n var _c = this.chartController.getColStateForMenu(), dimensionCols = _c.dimensionCols, valueCols = _c.valueCols;\n var colIds = dimensionCols.map(function (c) { return c.colId; }).concat(valueCols.map(function (c) { return c.colId; }));\n this.chartType = this.chartController.getChartType();\n var groupExpandedState = this.getGroupExpandedState();\n if (_.areEqual(_.keys(this.columnComps), colIds) && this.chartType === currentChartType) {\n // if possible, we just update existing components\n __spreadArray$b(__spreadArray$b([], __read$n(dimensionCols)), __read$n(valueCols)).forEach(function (col) {\n _this.columnComps.get(col.colId).setValue(col.selected, true);\n });\n if (this.chartController.isActiveXYChart()) {\n var getSeriesLabel_1 = this.generateGetSeriesLabel();\n valueCols.forEach(function (col) {\n _this.columnComps.get(col.colId).setLabel(getSeriesLabel_1(col));\n });\n }\n // recreate series chart type group if it exists as series may be added or removed via series group panel\n _.removeFromParent(this.getGui().querySelector('#seriesChartTypeGroup'));\n this.seriesChartTypeGroupComp = this.destroyBean(this.seriesChartTypeGroupComp);\n var seriesChartTypeIndex = (_a = this.getDataPanelDef().groups) === null || _a === void 0 ? void 0 : _a.reduce(function (prevVal, _a, index) {\n var type = _a.type;\n if (type === 'seriesChartType') {\n return index;\n }\n return prevVal;\n }, -1);\n if (seriesChartTypeIndex !== -1) {\n this.createSeriesChartTypeGroup(valueCols, seriesChartTypeIndex);\n }\n }\n else {\n // otherwise, we re-create everything\n this.clearComponents();\n (_b = this.getDataPanelDef().groups) === null || _b === void 0 ? void 0 : _b.forEach(function (_a) {\n var type = _a.type;\n if (type === 'categories') {\n _this.createCategoriesGroup(dimensionCols);\n }\n else if (type === 'series') {\n _this.createSeriesGroup(valueCols);\n }\n else if (type === 'seriesChartType') {\n _this.createSeriesChartTypeGroup(valueCols);\n }\n else {\n console.warn(\"AG Grid: invalid charts data panel group name supplied: '\" + type + \"'\");\n }\n });\n }\n this.restoreGroupExpandedState(groupExpandedState);\n };\n ChartDataPanel.prototype.getGroupExpandedState = function () {\n var _this = this;\n var groups = [\n { groupType: 'categories', comp: this.categoriesGroupComp },\n { groupType: 'series', comp: this.seriesGroupComp },\n { groupType: 'seriesChartType', comp: this.seriesChartTypeGroupComp }\n ];\n return groups.map(function (_a) {\n var _b, _c;\n var groupType = _a.groupType, comp = _a.comp;\n var defaultExpanded = Boolean((_c = (_b = _this.getDataPanelDef().groups) === null || _b === void 0 ? void 0 : _b.find(function (_a) {\n var type = _a.type;\n return type === groupType;\n })) === null || _c === void 0 ? void 0 : _c.isOpen);\n return !comp ? defaultExpanded : comp.isExpanded();\n });\n };\n ChartDataPanel.prototype.restoreGroupExpandedState = function (groupExpandedState) {\n [\n this.categoriesGroupComp,\n this.seriesGroupComp,\n this.seriesChartTypeGroupComp\n ].forEach(function (group, idx) {\n if (!group) {\n return;\n }\n group.toggleGroupExpand(groupExpandedState[idx]);\n });\n };\n ChartDataPanel.prototype.createAutoScrollService = function () {\n var eGui = this.getGui();\n this.autoScrollService = new AutoScrollService({\n scrollContainer: eGui,\n scrollAxis: 'y',\n getVerticalPosition: function () { return eGui.scrollTop; },\n setVerticalPosition: function (position) { return eGui.scrollTop = position; }\n });\n };\n ChartDataPanel.prototype.createComponent = function (component, id) {\n var eDiv = document.createElement('div');\n eDiv.id = id;\n eDiv.className = 'ag-chart-data-section';\n eDiv.appendChild(component.getGui());\n return eDiv;\n };\n ChartDataPanel.prototype.addComponent = function (parent, component, id) {\n var eDiv = this.createComponent(component, id);\n parent.appendChild(eDiv);\n };\n ChartDataPanel.prototype.addComponentAtIndex = function (parent, component, id, index) {\n var eDiv = this.createComponent(component, id);\n parent.insertBefore(eDiv, parent.children[index]);\n };\n ChartDataPanel.prototype.addChangeListener = function (component, columnState) {\n var _this = this;\n this.addManagedListener(component, AgAbstractField.EVENT_CHANGED, function () {\n columnState.selected = component.getValue();\n _this.chartController.updateForPanelChange(columnState);\n });\n };\n ChartDataPanel.prototype.createCategoriesGroup = function (columns) {\n var _this = this;\n this.categoriesGroupComp = this.createBean(new AgGroupComponent({\n title: this.getCategoryGroupTitle(),\n enabled: true,\n suppressEnabledCheckbox: true,\n suppressOpenCloseIcons: false,\n cssIdentifier: 'charts-data'\n }));\n var inputName = \"chartDimension\" + this.getCompId();\n columns.forEach(function (col) {\n var comp = _this.categoriesGroupComp.createManagedBean(new AgRadioButton());\n comp.setLabel(_.escapeString(col.displayName));\n comp.setValue(col.selected);\n comp.setInputName(inputName);\n _this.addChangeListener(comp, col);\n _this.categoriesGroupComp.addItem(comp);\n _this.columnComps.set(col.colId, comp);\n });\n this.addComponent(this.getGui(), this.categoriesGroupComp, 'categoriesGroup');\n };\n ChartDataPanel.prototype.createSeriesGroup = function (columns) {\n var _this = this;\n this.seriesGroupComp = this.createManagedBean(new AgGroupComponent({\n title: this.getSeriesGroupTitle(),\n enabled: true,\n suppressEnabledCheckbox: true,\n suppressOpenCloseIcons: false,\n cssIdentifier: 'charts-data'\n }));\n if (this.chartController.isActiveXYChart()) {\n var pairedModeToggle = this.seriesGroupComp.createManagedBean(new AgToggleButton());\n pairedModeToggle\n .setLabel(this.chartTranslationService.translate('paired'))\n .setLabelAlignment('left')\n .setLabelWidth('flex')\n .setInputWidth(45)\n .setValue(this.chartOptionsService.getPairedMode())\n .onValueChange(function (newValue) {\n _this.chartOptionsService.setPairedMode(!!newValue);\n _this.chartController.updateForGridChange();\n });\n this.seriesGroupComp.addItem(pairedModeToggle);\n }\n var getSeriesLabel = this.generateGetSeriesLabel();\n columns.forEach(function (col) {\n var comp = _this.seriesGroupComp.createManagedBean(new AgCheckbox());\n comp.addCssClass('ag-data-select-checkbox');\n var label = getSeriesLabel(col);\n comp.setLabel(label);\n comp.setValue(col.selected);\n _this.addChangeListener(comp, col);\n _this.seriesGroupComp.addItem(comp);\n _this.columnComps.set(col.colId, comp);\n _this.addDragHandle(comp, col);\n });\n var eGui = this.getGui();\n var seriesGroupGui = this.seriesGroupComp.getGui();\n this.addComponent(eGui, this.seriesGroupComp, 'seriesGroup');\n var dropTarget = {\n getIconName: function () { return DragAndDropService.ICON_MOVE; },\n getContainer: function () { return seriesGroupGui; },\n onDragging: function (params) { return _this.onDragging(params); },\n onDragLeave: function () { return _this.onDragLeave(); },\n isInterestedIn: this.isInterestedIn.bind(this),\n targetContainsSource: true\n };\n this.dragAndDropService.addDropTarget(dropTarget);\n this.addDestroyFunc(function () { return _this.dragAndDropService.removeDropTarget(dropTarget); });\n };\n ChartDataPanel.prototype.createSeriesChartTypeGroup = function (columns, index) {\n var _this = this;\n if (!this.chartController.isComboChart()) {\n return;\n }\n this.seriesChartTypeGroupComp = this.createManagedBean(new AgGroupComponent({\n title: this.chartTranslationService.translate('seriesChartType'),\n enabled: true,\n suppressEnabledCheckbox: true,\n suppressOpenCloseIcons: false,\n cssIdentifier: 'charts-data'\n }));\n var seriesChartTypes = this.chartController.getSeriesChartTypes();\n columns.forEach(function (col) {\n if (!col.selected) {\n return;\n }\n var seriesChartType = seriesChartTypes.filter(function (s) { return s.colId === col.colId; })[0];\n if (!seriesChartType) {\n return;\n }\n var seriesItemGroup = _this.seriesChartTypeGroupComp.createManagedBean(new AgGroupComponent({\n title: col.displayName,\n enabled: true,\n suppressEnabledCheckbox: true,\n suppressOpenCloseIcons: true,\n cssIdentifier: 'charts-format-sub-level'\n }));\n var secondaryAxisComp = _this.seriesChartTypeGroupComp\n .createManagedBean(new AgCheckbox())\n .setLabel(_this.chartTranslationService.translate('secondaryAxis'))\n .setLabelWidth(\"flex\")\n .setDisabled(['groupedColumn', 'stackedColumn', 'stackedArea'].includes(seriesChartType.chartType))\n .setValue(!!seriesChartType.secondaryAxis)\n .onValueChange(function (enabled) { return _this.chartController.updateSeriesChartType(col.colId, undefined, enabled); });\n seriesItemGroup.addItem(secondaryAxisComp);\n var translate = function (key, defaultText) {\n return _this.chartTranslationService.translate(key, defaultText);\n };\n var availableChartTypes = [\n { value: 'line', text: translate('line', 'Line') },\n { value: 'area', text: translate('area', 'Area') },\n { value: 'stackedArea', text: translate('stackedArea', 'StackedArea') },\n { value: 'groupedColumn', text: translate('groupedColumn', 'Grouped Column') },\n { value: 'stackedColumn', text: translate('stackedColumn', 'Stacked Column') },\n ];\n var chartTypeComp = seriesItemGroup.createManagedBean(new AgSelect());\n chartTypeComp\n .setLabelAlignment('left')\n .setLabelWidth(\"flex\")\n .addOptions(availableChartTypes)\n .setValue(seriesChartType.chartType)\n .onValueChange(function (chartType) { return _this.chartController.updateSeriesChartType(col.colId, chartType); });\n seriesItemGroup.addItem(chartTypeComp);\n _this.seriesChartTypeGroupComp.addItem(seriesItemGroup);\n });\n if (index === undefined) {\n this.addComponent(this.getGui(), this.seriesChartTypeGroupComp, 'seriesChartTypeGroup');\n }\n else {\n this.addComponentAtIndex(this.getGui(), this.seriesChartTypeGroupComp, 'seriesChartTypeGroup', index);\n }\n };\n ChartDataPanel.prototype.addDragHandle = function (comp, col) {\n var _this = this;\n var eDragHandle = _.createIconNoSpan('columnDrag', this.gridOptionsService);\n eDragHandle.classList.add('ag-drag-handle', 'ag-chart-data-column-drag-handle');\n comp.getGui().insertAdjacentElement('beforeend', eDragHandle);\n var dragSource = {\n type: DragSourceType.ChartPanel,\n eElement: eDragHandle,\n dragItemName: col.displayName,\n getDragItem: function () { return ({ columns: [col.column] }); },\n onDragStopped: function () { return _this.onDragStop(); }\n };\n this.dragAndDropService.addDragSource(dragSource, true);\n this.addDestroyFunc(function () { return _this.dragAndDropService.removeDragSource(dragSource); });\n };\n ChartDataPanel.prototype.generateGetSeriesLabel = function () {\n if (!this.chartController.isActiveXYChart()) {\n return function (col) { return _.escapeString(col.displayName); };\n }\n var isBubble = this.chartType === 'bubble';\n var isInPairedMode = this.isInPairedMode();\n var selectedValuesCount = 0;\n var indexToAxisLabel = new Map();\n indexToAxisLabel.set(0, 'X');\n indexToAxisLabel.set(1, 'Y');\n indexToAxisLabel.set(2, 'size');\n return function (col) {\n var escapedLabel = _.escapeString(col.displayName);\n if (!col.selected) {\n return escapedLabel;\n }\n var axisLabel;\n if (isInPairedMode) {\n axisLabel = indexToAxisLabel.get(selectedValuesCount % (isBubble ? 3 : 2));\n }\n else {\n if (selectedValuesCount === 0) {\n axisLabel = 'X';\n }\n else {\n axisLabel = isBubble && selectedValuesCount % 2 === 0 ? 'size' : 'Y';\n }\n }\n selectedValuesCount++;\n return escapedLabel + \" (\" + axisLabel + \")\";\n };\n };\n ChartDataPanel.prototype.getCategoryGroupTitle = function () {\n return this.chartTranslationService.translate(this.chartController.isActiveXYChart() ? 'labels' : 'categories');\n };\n ChartDataPanel.prototype.getSeriesGroupTitle = function () {\n return this.chartTranslationService.translate(this.chartController.isActiveXYChart() ? 'xyValues' : 'series');\n };\n ChartDataPanel.prototype.getDataPanelDef = function () {\n var _a;\n var userProvidedDataPanelDef = (_a = this.gridOptionsService.get('chartToolPanelsDef')) === null || _a === void 0 ? void 0 : _a.dataPanel;\n return userProvidedDataPanelDef ? userProvidedDataPanelDef : DefaultDataPanelDef;\n };\n ChartDataPanel.prototype.isInPairedMode = function () {\n return this.chartController.isActiveXYChart() && this.chartOptionsService.getSeriesOption('paired', 'scatter');\n };\n ChartDataPanel.prototype.clearComponents = function () {\n _.clearElement(this.getGui());\n this.categoriesGroupComp = this.destroyBean(this.categoriesGroupComp);\n this.seriesGroupComp = this.destroyBean(this.seriesGroupComp);\n this.seriesChartTypeGroupComp = this.destroyBean(this.seriesChartTypeGroupComp);\n this.columnComps.clear();\n };\n ChartDataPanel.prototype.onDragging = function (draggingEvent) {\n var itemHovered = this.checkHoveredItem(draggingEvent);\n if (!itemHovered) {\n return;\n }\n this.lastDraggedColumn = draggingEvent.dragItem.columns[0];\n var comp = itemHovered.comp, position = itemHovered.position;\n var _a = this.lastHoveredItem || {}, lastHoveredComp = _a.comp, lastHoveredPosition = _a.position;\n if (comp === lastHoveredComp && position === lastHoveredPosition) {\n return;\n }\n this.autoScrollService.check(draggingEvent.event);\n this.clearHoveredItems();\n this.lastHoveredItem = { comp: comp, position: position };\n var eGui = comp.getGui();\n eGui.classList.add('ag-list-item-hovered', \"ag-item-highlight-\" + position);\n };\n ChartDataPanel.prototype.checkHoveredItem = function (draggingEvent) {\n var e_1, _a;\n if (_.missing(draggingEvent.vDirection)) {\n return null;\n }\n var mouseEvent = draggingEvent.event;\n try {\n for (var _b = __values$7(this.columnComps.values()), _c = _b.next(); !_c.done; _c = _b.next()) {\n var comp = _c.value;\n var eGui = comp.getGui();\n if (!eGui.querySelector('.ag-chart-data-column-drag-handle')) {\n continue;\n }\n var rect = eGui.getBoundingClientRect();\n var isOverComp = mouseEvent.clientY >= rect.top && mouseEvent.clientY <= rect.bottom;\n if (isOverComp) {\n var height = eGui.clientHeight;\n var position = mouseEvent.clientY > rect.top + (height / 2) ? 'bottom' : 'top';\n return { comp: comp, position: position };\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_1) throw e_1.error; }\n }\n return null;\n };\n ChartDataPanel.prototype.onDragLeave = function () {\n this.clearHoveredItems();\n };\n ChartDataPanel.prototype.onDragStop = function () {\n var _this = this;\n if (this.lastHoveredItem) {\n var _a = this.chartController.getColStateForMenu(), dimensionCols = _a.dimensionCols, valueCols = _a.valueCols;\n var draggedColumnState = __spreadArray$b(__spreadArray$b([], __read$n(dimensionCols)), __read$n(valueCols)).find(function (state) { return state.column === _this.lastDraggedColumn; });\n if (draggedColumnState) {\n var targetIndex = Array.from(this.columnComps.values()).indexOf(this.lastHoveredItem.comp);\n if (this.lastHoveredItem.position === 'bottom') {\n targetIndex++;\n }\n draggedColumnState.order = targetIndex;\n this.chartController.updateForPanelChange(draggedColumnState);\n }\n }\n this.clearHoveredItems();\n this.lastDraggedColumn = undefined;\n this.autoScrollService.ensureCleared();\n };\n ChartDataPanel.prototype.clearHoveredItems = function () {\n this.columnComps.forEach(function (columnComp) {\n columnComp.getGui().classList.remove('ag-list-item-hovered', 'ag-item-highlight-top', 'ag-item-highlight-bottom');\n });\n this.lastHoveredItem = undefined;\n };\n ChartDataPanel.prototype.isInterestedIn = function (type) {\n return type === DragSourceType.ChartPanel;\n };\n ChartDataPanel.TEMPLATE = \"
\";\n __decorate$1c([\n Autowired('dragAndDropService')\n ], ChartDataPanel.prototype, \"dragAndDropService\", void 0);\n __decorate$1c([\n Autowired('chartTranslationService')\n ], ChartDataPanel.prototype, \"chartTranslationService\", void 0);\n __decorate$1c([\n PostConstruct\n ], ChartDataPanel.prototype, \"init\", null);\n return ChartDataPanel;\n}(Component));\n\nvar __extends$1G = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$1b = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar FontPanel = /** @class */ (function (_super) {\n __extends$1G(FontPanel, _super);\n function FontPanel(params) {\n var _this = _super.call(this) || this;\n _this.activeComps = [];\n _this.params = params;\n return _this;\n }\n FontPanel.prototype.init = function () {\n var groupParams = {\n cssIdentifier: 'charts-format-sub-level',\n direction: 'vertical',\n suppressOpenCloseIcons: true\n };\n this.setTemplate(FontPanel.TEMPLATE, { fontGroup: groupParams });\n this.initGroup();\n this.initFontFamilySelect();\n this.initFontWeightStyleSelect();\n this.initFontSizeSelect();\n this.initFontColorPicker();\n };\n FontPanel.prototype.addCompToPanel = function (comp) {\n this.fontGroup.addItem(comp);\n this.activeComps.push(comp);\n };\n FontPanel.prototype.setEnabled = function (enabled) {\n this.fontGroup.setEnabled(enabled);\n };\n FontPanel.prototype.initGroup = function () {\n var _this = this;\n this.fontGroup\n .setTitle(this.params.name || this.chartTranslationService.translate('font'))\n .setEnabled(this.params.enabled)\n .hideEnabledCheckbox(!!this.params.suppressEnabledCheckbox)\n .hideOpenCloseIcons(true)\n .onEnableChange(function (enabled) {\n if (_this.params.setEnabled) {\n _this.params.setEnabled(enabled);\n }\n });\n };\n FontPanel.prototype.initFontFamilySelect = function () {\n var _this = this;\n var families = [\n 'Arial, sans-serif',\n 'Aria Black, sans-serif',\n 'Book Antiqua, serif',\n 'Charcoal, sans-serif',\n 'Comic Sans MS, cursive',\n 'Courier, monospace',\n 'Courier New, monospace',\n 'Gadget, sans-serif',\n 'Geneva, sans-serif',\n 'Helvetica, sans-serif',\n 'Impact, sans-serif',\n 'Lucida Console, monospace',\n 'Lucida Grande, sans-serif',\n 'Lucida Sans Unicode, sans-serif',\n 'Monaco, monospace',\n 'Palatino Linotype, serif',\n 'Palatino, serif',\n 'Times New Roman, serif',\n 'Times, serif',\n 'Verdana, sans-serif'\n ];\n var family = this.params.initialFont.family;\n var initialValue = families[0];\n if (family) {\n // check for known values using lowercase\n var lowerCaseValues = families.map(function (f) { return f.toLowerCase(); });\n var valueIndex = lowerCaseValues.indexOf(family.toLowerCase());\n if (valueIndex >= 0) {\n initialValue = families[valueIndex];\n }\n else {\n // add user provided value to list\n var capitalisedFontValue = _.capitalise(family);\n families.push(capitalisedFontValue);\n initialValue = capitalisedFontValue;\n }\n }\n var options = families.sort().map(function (value) { return ({ value: value, text: value }); });\n this.familySelect.addOptions(options)\n .setInputWidth('flex')\n .setValue(\"\" + initialValue)\n .onValueChange(function (newValue) { return _this.params.setFont({ family: newValue }); });\n };\n FontPanel.prototype.initFontSizeSelect = function () {\n var _this = this;\n var sizes = [8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36];\n var size = this.params.initialFont.size;\n if (!_.includes(sizes, size)) {\n sizes.push(size);\n }\n var options = sizes.sort(function (a, b) { return a - b; }).map(function (value) { return ({ value: \"\" + value, text: \"\" + value }); });\n this.sizeSelect.addOptions(options)\n .setInputWidth('flex')\n .setValue(\"\" + size)\n .onValueChange(function (newValue) { return _this.params.setFont({ size: parseInt(newValue, 10) }); });\n this.sizeSelect.setLabel(this.chartTranslationService.translate('size'));\n };\n FontPanel.prototype.initFontWeightStyleSelect = function () {\n var _this = this;\n var _a = this.params.initialFont, _b = _a.weight, weight = _b === void 0 ? 'normal' : _b, _c = _a.style, style = _c === void 0 ? 'normal' : _c;\n var weightStyles = [\n { name: 'normal', weight: 'normal', style: 'normal' },\n { name: 'bold', weight: 'bold', style: 'normal' },\n { name: 'italic', weight: 'normal', style: 'italic' },\n { name: 'boldItalic', weight: 'bold', style: 'italic' }\n ];\n var selectedOption = weightStyles.find(function (x) { return x.weight === weight && x.style === style; });\n if (!selectedOption) {\n selectedOption = { name: 'predefined', weight: weight, style: style };\n weightStyles.unshift(selectedOption);\n }\n var options = weightStyles.map(function (ws) { return ({\n value: ws.name,\n text: _this.chartTranslationService.translate(ws.name),\n }); });\n this.weightStyleSelect.addOptions(options)\n .setInputWidth('flex')\n .setValue(selectedOption.name)\n .onValueChange(function (newValue) {\n var selectedWeightStyle = weightStyles.find(function (x) { return x.name === newValue; });\n _this.params.setFont({ weight: selectedWeightStyle.weight, style: selectedWeightStyle.style });\n });\n };\n FontPanel.prototype.initFontColorPicker = function () {\n var _this = this;\n this.colorPicker\n .setLabel(this.chartTranslationService.translate('color'))\n .setInputWidth(45)\n .setValue(\"\" + this.params.initialFont.color)\n .onValueChange(function (newColor) { return _this.params.setFont({ color: newColor }); });\n };\n FontPanel.prototype.addItemToPanel = function (item) {\n this.fontGroup.addItem(item);\n this.activeComps.push(item);\n };\n FontPanel.prototype.destroyActiveComps = function () {\n var _this = this;\n this.activeComps.forEach(function (comp) {\n _.removeFromParent(comp.getGui());\n _this.destroyBean(comp);\n });\n };\n FontPanel.prototype.destroy = function () {\n this.destroyActiveComps();\n _super.prototype.destroy.call(this);\n };\n FontPanel.TEMPLATE = \"
\\n \\n \\n \\n
\\n \\n \\n
\\n
\\n
\";\n __decorate$1b([\n RefSelector('fontGroup')\n ], FontPanel.prototype, \"fontGroup\", void 0);\n __decorate$1b([\n RefSelector('familySelect')\n ], FontPanel.prototype, \"familySelect\", void 0);\n __decorate$1b([\n RefSelector('weightStyleSelect')\n ], FontPanel.prototype, \"weightStyleSelect\", void 0);\n __decorate$1b([\n RefSelector('sizeSelect')\n ], FontPanel.prototype, \"sizeSelect\", void 0);\n __decorate$1b([\n RefSelector('colorPicker')\n ], FontPanel.prototype, \"colorPicker\", void 0);\n __decorate$1b([\n Autowired('chartTranslationService')\n ], FontPanel.prototype, \"chartTranslationService\", void 0);\n __decorate$1b([\n PostConstruct\n ], FontPanel.prototype, \"init\", null);\n return FontPanel;\n}(Component));\n\nvar __extends$1F = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$1a = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar LegendPanel = /** @class */ (function (_super) {\n __extends$1F(LegendPanel, _super);\n function LegendPanel(_a) {\n var chartOptionsService = _a.chartOptionsService, _b = _a.isExpandedOnInit, isExpandedOnInit = _b === void 0 ? false : _b;\n var _this = _super.call(this) || this;\n _this.activePanels = [];\n _this.chartOptionsService = chartOptionsService;\n _this.isExpandedOnInit = isExpandedOnInit;\n return _this;\n }\n LegendPanel.prototype.init = function () {\n var groupParams = {\n cssIdentifier: 'charts-format-top-level',\n direction: 'vertical'\n };\n this.setTemplate(LegendPanel.TEMPLATE, { legendGroup: groupParams });\n this.initLegendGroup();\n this.initLegendPosition();\n this.initLegendPadding();\n this.initLegendItems();\n this.initLabelPanel();\n };\n LegendPanel.prototype.initLegendGroup = function () {\n var _this = this;\n this.legendGroup\n .setTitle(this.chartTranslationService.translate(\"legend\"))\n .hideEnabledCheckbox(false)\n .setEnabled(this.chartOptionsService.getChartOption(\"legend.enabled\") || false)\n .toggleGroupExpand(this.isExpandedOnInit)\n .onEnableChange(function (enabled) {\n _this.chartOptionsService.setChartOption(\"legend.enabled\", enabled);\n _this.legendGroup.toggleGroupExpand(true);\n });\n };\n LegendPanel.prototype.initLegendPosition = function () {\n var _this = this;\n var positions = ['top', 'right', 'bottom', 'left'];\n this.legendPositionSelect\n .setLabel(this.chartTranslationService.translate(\"position\"))\n .setLabelWidth(\"flex\")\n .setInputWidth(80)\n .addOptions(positions.map(function (position) { return ({\n value: position,\n text: _this.chartTranslationService.translate(position)\n }); }))\n .setValue(this.chartOptionsService.getChartOption(\"legend.position\"))\n .onValueChange(function (newValue) { return _this.chartOptionsService.setChartOption(\"legend.position\", newValue); });\n };\n LegendPanel.prototype.initLegendPadding = function () {\n var _this = this;\n var currentValue = this.chartOptionsService.getChartOption(\"legend.spacing\");\n this.legendPaddingSlider\n .setLabel(this.chartTranslationService.translate(\"spacing\"))\n .setMaxValue(getMaxValue(currentValue, 200))\n .setValue(\"\" + currentValue)\n .setTextFieldWidth(45)\n .onValueChange(function (newValue) { return _this.chartOptionsService.setChartOption(\"legend.spacing\", newValue); });\n };\n LegendPanel.prototype.initLegendItems = function () {\n var _this = this;\n var initSlider = function (expression, labelKey, input, defaultMaxValue) {\n var currentValue = _this.chartOptionsService.getChartOption(\"legend.\" + expression);\n input.setLabel(_this.chartTranslationService.translate(labelKey))\n .setMaxValue(getMaxValue(currentValue, defaultMaxValue))\n .setValue(\"\" + currentValue)\n .setTextFieldWidth(45)\n .onValueChange(function (newValue) {\n _this.chartOptionsService.setChartOption(\"legend.\" + expression, newValue);\n });\n };\n initSlider(\"item.marker.size\", \"markerSize\", this.markerSizeSlider, 40);\n initSlider(\"item.marker.strokeWidth\", \"markerStroke\", this.markerStrokeSlider, 10);\n initSlider(\"item.marker.padding\", \"itemSpacing\", this.markerPaddingSlider, 20);\n initSlider(\"item.paddingX\", \"layoutHorizontalSpacing\", this.itemPaddingXSlider, 50);\n initSlider(\"item.paddingY\", \"layoutVerticalSpacing\", this.itemPaddingYSlider, 50);\n };\n LegendPanel.prototype.initLabelPanel = function () {\n var _this = this;\n var chartProxy = this.chartOptionsService;\n var initialFont = {\n family: chartProxy.getChartOption(\"legend.item.label.fontFamily\"),\n style: chartProxy.getChartOption(\"legend.item.label.fontStyle\"),\n weight: chartProxy.getChartOption(\"legend.item.label.fontWeight\"),\n size: chartProxy.getChartOption(\"legend.item.label.fontSize\"),\n color: chartProxy.getChartOption(\"legend.item.label.color\")\n };\n var setFont = function (font) {\n var proxy = _this.chartOptionsService;\n if (font.family) {\n proxy.setChartOption(\"legend.item.label.fontFamily\", font.family);\n }\n if (font.weight) {\n proxy.setChartOption(\"legend.item.label.fontWeight\", font.weight);\n }\n if (font.style) {\n proxy.setChartOption(\"legend.item.label.fontStyle\", font.style);\n }\n if (font.size) {\n proxy.setChartOption(\"legend.item.label.fontSize\", font.size);\n }\n if (font.color) {\n proxy.setChartOption(\"legend.item.label.color\", font.color);\n }\n };\n var params = {\n enabled: true,\n suppressEnabledCheckbox: true,\n initialFont: initialFont,\n setFont: setFont\n };\n var fontPanelComp = this.createBean(new FontPanel(params));\n this.legendGroup.addItem(fontPanelComp);\n this.activePanels.push(fontPanelComp);\n };\n LegendPanel.prototype.destroyActivePanels = function () {\n var _this = this;\n this.activePanels.forEach(function (panel) {\n _.removeFromParent(panel.getGui());\n _this.destroyBean(panel);\n });\n };\n LegendPanel.prototype.destroy = function () {\n this.destroyActivePanels();\n _super.prototype.destroy.call(this);\n };\n LegendPanel.TEMPLATE = \"
\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n
\";\n __decorate$1a([\n RefSelector('legendGroup')\n ], LegendPanel.prototype, \"legendGroup\", void 0);\n __decorate$1a([\n RefSelector('legendPositionSelect')\n ], LegendPanel.prototype, \"legendPositionSelect\", void 0);\n __decorate$1a([\n RefSelector('legendPaddingSlider')\n ], LegendPanel.prototype, \"legendPaddingSlider\", void 0);\n __decorate$1a([\n RefSelector('markerSizeSlider')\n ], LegendPanel.prototype, \"markerSizeSlider\", void 0);\n __decorate$1a([\n RefSelector('markerStrokeSlider')\n ], LegendPanel.prototype, \"markerStrokeSlider\", void 0);\n __decorate$1a([\n RefSelector('markerPaddingSlider')\n ], LegendPanel.prototype, \"markerPaddingSlider\", void 0);\n __decorate$1a([\n RefSelector('itemPaddingXSlider')\n ], LegendPanel.prototype, \"itemPaddingXSlider\", void 0);\n __decorate$1a([\n RefSelector('itemPaddingYSlider')\n ], LegendPanel.prototype, \"itemPaddingYSlider\", void 0);\n __decorate$1a([\n Autowired('chartTranslationService')\n ], LegendPanel.prototype, \"chartTranslationService\", void 0);\n __decorate$1a([\n PostConstruct\n ], LegendPanel.prototype, \"init\", null);\n return LegendPanel;\n}(Component));\n\nvar __extends$1E = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$19 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar AxisTicksPanel = /** @class */ (function (_super) {\n __extends$1E(AxisTicksPanel, _super);\n function AxisTicksPanel(chartOptionsService) {\n var _this = _super.call(this) || this;\n _this.chartOptionsService = chartOptionsService;\n return _this;\n }\n AxisTicksPanel.prototype.init = function () {\n var groupParams = {\n cssIdentifier: 'charts-format-sub-level',\n direction: 'vertical',\n suppressOpenCloseIcons: true\n };\n this.setTemplate(AxisTicksPanel.TEMPLATE, { axisTicksGroup: groupParams });\n this.initAxisTicks();\n };\n AxisTicksPanel.prototype.initAxisTicks = function () {\n var _this = this;\n this.axisTicksGroup\n .setTitle(this.chartTranslationService.translate(\"ticks\"))\n .hideOpenCloseIcons(true)\n .hideEnabledCheckbox(true);\n this.axisTicksColorPicker\n .setLabel(this.chartTranslationService.translate(\"color\"))\n .setLabelWidth(\"flex\")\n .setInputWidth(45)\n .setValue(this.chartOptionsService.getAxisProperty(\"tick.color\"))\n .onValueChange(function (newColor) { return _this.chartOptionsService.setAxisProperty(\"tick.color\", newColor); });\n var initInput = function (expression, input, label, defaultMaxValue) {\n var currentValue = _this.chartOptionsService.getAxisProperty(expression);\n input.setLabel(label)\n .setMaxValue(getMaxValue(currentValue, defaultMaxValue))\n .setValue(\"\" + currentValue)\n .setTextFieldWidth(45)\n .onValueChange(function (newValue) { return _this.chartOptionsService.setAxisProperty(expression, newValue); });\n };\n initInput(\"tick.width\", this.axisTicksWidthSlider, this.chartTranslationService.translate(\"width\"), 10);\n initInput(\"tick.size\", this.axisTicksSizeSlider, this.chartTranslationService.translate(\"length\"), 30);\n };\n AxisTicksPanel.TEMPLATE = \"
\\n \\n \\n \\n \\n \\n
\";\n __decorate$19([\n RefSelector('axisTicksGroup')\n ], AxisTicksPanel.prototype, \"axisTicksGroup\", void 0);\n __decorate$19([\n RefSelector('axisTicksColorPicker')\n ], AxisTicksPanel.prototype, \"axisTicksColorPicker\", void 0);\n __decorate$19([\n RefSelector('axisTicksWidthSlider')\n ], AxisTicksPanel.prototype, \"axisTicksWidthSlider\", void 0);\n __decorate$19([\n RefSelector('axisTicksSizeSlider')\n ], AxisTicksPanel.prototype, \"axisTicksSizeSlider\", void 0);\n __decorate$19([\n Autowired('chartTranslationService')\n ], AxisTicksPanel.prototype, \"chartTranslationService\", void 0);\n __decorate$19([\n PostConstruct\n ], AxisTicksPanel.prototype, \"init\", null);\n return AxisTicksPanel;\n}(Component));\n\nvar __extends$1D = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$18 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar AgAngleSelect = /** @class */ (function (_super) {\n __extends$1D(AgAngleSelect, _super);\n function AgAngleSelect(config) {\n var _this = _super.call(this, config, AgAngleSelect.TEMPLATE) || this;\n _this.radius = 0;\n _this.offsetX = 0;\n _this.offsetY = 0;\n return _this;\n }\n AgAngleSelect.prototype.postConstruct = function () {\n var _this = this;\n _super.prototype.postConstruct.call(this);\n this.dragListener = {\n eElement: this.eParentCircle,\n dragStartPixels: 0,\n onDragStart: function (e) {\n _this.parentCircleRect = _this.eParentCircle.getBoundingClientRect();\n },\n onDragging: function (e) { return _this.calculateAngleDrag(e); },\n onDragStop: function () { }\n };\n this.dragService.addDragSource(this.dragListener);\n this.eAngleValue\n .setLabel('')\n .setLabelWidth(5)\n .setInputWidth(45)\n .setMin(0)\n .setMax(360)\n .setValue(\"\" + this.degrees)\n .onValueChange(function (value) {\n if (value == null || value === '') {\n value = '0';\n }\n value = _this.eAngleValue.normalizeValue(value);\n var floatValue = parseFloat(value);\n if (floatValue > 180) {\n floatValue = floatValue - 360;\n }\n _this.setValue(floatValue);\n });\n this.updateNumberInput();\n if (_.exists(this.getValue())) {\n this.eAngleValue.setValue(this.normalizeNegativeValue(this.getValue()).toString());\n }\n this.addManagedListener(this, AgAbstractField.EVENT_CHANGED, function () {\n var eDocument = _this.gridOptionsService.getDocument();\n if (_this.eAngleValue.getInputElement().contains(eDocument.activeElement)) {\n return;\n }\n _this.updateNumberInput();\n });\n };\n AgAngleSelect.prototype.updateNumberInput = function () {\n var normalizedValue = this.normalizeNegativeValue(this.getValue());\n this.eAngleValue.setValue(normalizedValue.toString());\n };\n AgAngleSelect.prototype.positionChildCircle = function (radians) {\n var rect = this.parentCircleRect || { width: 24, height: 24 };\n var eChildCircle = this.eChildCircle;\n var centerX = rect.width / 2;\n var centerY = rect.height / 2;\n eChildCircle.style.left = centerX + Math.cos(radians) * 8 + \"px\";\n eChildCircle.style.top = centerY + Math.sin(radians) * 8 + \"px\";\n };\n AgAngleSelect.prototype.calculatePolar = function () {\n var x = this.offsetX;\n var y = this.offsetY;\n var radians = Math.atan2(y, x);\n this.degrees = this.toDegrees(radians);\n this.radius = Math.sqrt((x * x) + (y * y));\n this.positionChildCircle(radians);\n };\n AgAngleSelect.prototype.calculateCartesian = function () {\n var radians = this.toRadians(this.getValue());\n var radius = this.getRadius();\n this\n .setOffsetX(Math.cos(radians) * radius)\n .setOffsetY(Math.sin(radians) * radius);\n };\n AgAngleSelect.prototype.setOffsetX = function (offset) {\n if (this.offsetX !== offset) {\n this.offsetX = offset;\n this.calculatePolar();\n }\n return this;\n };\n AgAngleSelect.prototype.setOffsetY = function (offset) {\n if (this.offsetY !== offset) {\n this.offsetY = offset;\n this.calculatePolar();\n }\n return this;\n };\n AgAngleSelect.prototype.calculateAngleDrag = function (e) {\n var rect = this.parentCircleRect;\n var centerX = rect.width / 2;\n var centerY = rect.height / 2;\n var x = e.clientX - rect.left;\n var y = e.clientY - rect.top;\n var dx = x - centerX;\n var dy = y - centerY;\n var radians = Math.atan2(dy, dx);\n this.setValue(radians, true);\n };\n AgAngleSelect.prototype.toDegrees = function (radians) {\n return radians / Math.PI * 180;\n };\n AgAngleSelect.prototype.toRadians = function (degrees) {\n return degrees / 180 * Math.PI;\n };\n AgAngleSelect.prototype.normalizeNegativeValue = function (degrees) {\n return degrees < 0 ? 360 + degrees : degrees;\n };\n AgAngleSelect.prototype.normalizeAngle180 = function (radians) {\n radians %= Math.PI * 2;\n if (radians < -Math.PI) {\n radians += Math.PI * 2;\n }\n else if (radians >= Math.PI) {\n radians -= Math.PI * 2;\n }\n return radians;\n };\n AgAngleSelect.prototype.getRadius = function () {\n return this.radius;\n };\n AgAngleSelect.prototype.setRadius = function (r) {\n if (this.radius === r) {\n return this;\n }\n this.radius = r;\n this.calculateCartesian();\n return this;\n };\n AgAngleSelect.prototype.onValueChange = function (callbackFn) {\n var _this = this;\n this.addManagedListener(this, AgAbstractField.EVENT_CHANGED, function () {\n callbackFn(_this.degrees);\n });\n return this;\n };\n AgAngleSelect.prototype.getValue = function (radians) {\n return radians ? this.toRadians(this.degrees) : this.degrees;\n };\n AgAngleSelect.prototype.setValue = function (degrees, radians) {\n var radiansValue;\n if (!radians) {\n radiansValue = this.normalizeAngle180(this.toRadians(degrees));\n }\n else {\n radiansValue = degrees;\n }\n degrees = this.toDegrees(radiansValue);\n if (this.degrees !== degrees) {\n this.degrees = Math.floor(degrees);\n this.calculateCartesian();\n this.positionChildCircle(radiansValue);\n this.dispatchEvent({ type: AgAbstractField.EVENT_CHANGED });\n }\n return this;\n };\n AgAngleSelect.prototype.setWidth = function (width) {\n _.setFixedWidth(this.getGui(), width);\n return this;\n };\n AgAngleSelect.prototype.setDisabled = function (disabled) {\n _super.prototype.setDisabled.call(this, disabled);\n this.eAngleValue.setDisabled(disabled);\n return this;\n };\n AgAngleSelect.prototype.destroy = function () {\n this.dragService.removeDragSource(this.dragListener);\n _super.prototype.destroy.call(this);\n };\n AgAngleSelect.TEMPLATE = \"
\\n
\\n
\\n
\\n
\\n
\\n
\\n
\\n \\n
\\n
\";\n __decorate$18([\n RefSelector('eLabel')\n ], AgAngleSelect.prototype, \"eLabel\", void 0);\n __decorate$18([\n RefSelector('eParentCircle')\n ], AgAngleSelect.prototype, \"eParentCircle\", void 0);\n __decorate$18([\n RefSelector('eChildCircle')\n ], AgAngleSelect.prototype, \"eChildCircle\", void 0);\n __decorate$18([\n RefSelector('eAngleValue')\n ], AgAngleSelect.prototype, \"eAngleValue\", void 0);\n __decorate$18([\n Autowired('dragService')\n ], AgAngleSelect.prototype, \"dragService\", void 0);\n return AgAngleSelect;\n}(AgAbstractLabel));\n\nvar __extends$1C = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$17 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar AxisPanel = /** @class */ (function (_super) {\n __extends$1C(AxisPanel, _super);\n function AxisPanel(_a) {\n var chartController = _a.chartController, chartOptionsService = _a.chartOptionsService, _b = _a.isExpandedOnInit, isExpandedOnInit = _b === void 0 ? false : _b;\n var _this = _super.call(this) || this;\n _this.activePanels = [];\n _this.axisLabelUpdateFuncs = [];\n _this.prevXRotation = 0;\n _this.prevYRotation = 0;\n _this.chartController = chartController;\n _this.chartOptionsService = chartOptionsService;\n _this.isExpandedOnInit = isExpandedOnInit;\n return _this;\n }\n AxisPanel.prototype.init = function () {\n var _this = this;\n var groupParams = {\n cssIdentifier: 'charts-format-top-level',\n direction: 'vertical'\n };\n this.setTemplate(AxisPanel.TEMPLATE, { axisGroup: groupParams });\n this.initAxis();\n this.initAxisTicks();\n this.initAxisLabels();\n var updateAxisLabelRotations = function () { return _this.axisLabelUpdateFuncs.forEach(function (func) { return func(); }); };\n this.addManagedListener(this.chartController, ChartController.EVENT_CHART_UPDATED, updateAxisLabelRotations);\n };\n AxisPanel.prototype.initAxis = function () {\n var _this = this;\n this.axisGroup\n .setTitle(this.translate(\"axis\"))\n .toggleGroupExpand(this.isExpandedOnInit)\n .hideEnabledCheckbox(true);\n this.axisColorInput\n .setLabel(this.translate(\"color\"))\n .setLabelWidth(\"flex\")\n .setInputWidth(45)\n .setValue(this.chartOptionsService.getAxisProperty(\"line.color\"))\n .onValueChange(function (newColor) { return _this.chartOptionsService.setAxisProperty(\"line.color\", newColor); });\n var currentValue = this.chartOptionsService.getAxisProperty(\"line.width\");\n this.axisLineWidthSlider\n .setMaxValue(getMaxValue(currentValue, 10))\n .setLabel(this.translate(\"thickness\"))\n .setTextFieldWidth(45)\n .setValue(\"\" + currentValue)\n .onValueChange(function (newValue) { return _this.chartOptionsService.setAxisProperty(\"line.width\", newValue); });\n };\n AxisPanel.prototype.initAxisTicks = function () {\n var axisTicksComp = this.createBean(new AxisTicksPanel(this.chartOptionsService));\n this.axisGroup.addItem(axisTicksComp);\n this.activePanels.push(axisTicksComp);\n };\n AxisPanel.prototype.initAxisLabels = function () {\n var _this = this;\n var initialFont = {\n family: this.chartOptionsService.getAxisProperty(\"label.fontFamily\"),\n style: this.chartOptionsService.getAxisProperty(\"label.fontStyle\"),\n weight: this.chartOptionsService.getAxisProperty(\"label.fontWeight\"),\n size: this.chartOptionsService.getAxisProperty(\"label.fontSize\"),\n color: this.chartOptionsService.getAxisProperty(\"label.color\")\n };\n var setFont = function (font) {\n if (font.family) {\n _this.chartOptionsService.setAxisProperty(\"label.fontFamily\", font.family);\n }\n if (font.weight) {\n _this.chartOptionsService.setAxisProperty(\"label.fontWeight\", font.weight);\n }\n if (font.style) {\n _this.chartOptionsService.setAxisProperty(\"label.fontStyle\", font.style);\n }\n if (font.size) {\n _this.chartOptionsService.setAxisProperty(\"label.fontSize\", font.size);\n }\n if (font.color) {\n _this.chartOptionsService.setAxisProperty(\"label.color\", font.color);\n }\n };\n var params = {\n name: this.translate(\"labels\"),\n enabled: true,\n suppressEnabledCheckbox: true,\n initialFont: initialFont,\n setFont: setFont\n };\n var labelPanelComp = this.createBean(new FontPanel(params));\n this.axisGroup.addItem(labelPanelComp);\n this.activePanels.push(labelPanelComp);\n this.addAdditionalLabelComps(labelPanelComp);\n };\n AxisPanel.prototype.addAdditionalLabelComps = function (labelPanelComp) {\n this.addLabelPadding(labelPanelComp);\n var _a = this.createRotationWidgets(), xRotationComp = _a.xRotationComp, yRotationComp = _a.yRotationComp;\n var autoRotateCb = this.initLabelRotations(xRotationComp, yRotationComp);\n labelPanelComp.addCompToPanel(autoRotateCb);\n labelPanelComp.addCompToPanel(xRotationComp);\n labelPanelComp.addCompToPanel(yRotationComp);\n };\n AxisPanel.prototype.initLabelRotations = function (xRotationComp, yRotationComp) {\n var _this = this;\n var getLabelRotation = function (axisType) {\n return _this.chartOptionsService.getLabelRotation(axisType);\n };\n var setLabelRotation = function (axisType, value) {\n _this.chartOptionsService.setLabelRotation(axisType, value);\n };\n var updateAutoRotate = function (autoRotate) {\n _this.chartOptionsService.setAxisProperty(\"label.autoRotate\", autoRotate);\n if (autoRotate) {\n // store prev rotations before we remove them from the options\n _this.prevXRotation = getLabelRotation(\"xAxis\");\n _this.prevYRotation = getLabelRotation(\"yAxis\");\n // `autoRotate` is only\n setLabelRotation(\"xAxis\", undefined);\n setLabelRotation(\"yAxis\", undefined);\n }\n else {\n // reinstate prev rotations\n setLabelRotation(\"xAxis\", _this.prevXRotation);\n setLabelRotation(\"yAxis\", _this.prevYRotation);\n }\n xRotationComp.setDisabled(autoRotate);\n yRotationComp.setDisabled(autoRotate);\n };\n var getAutoRotateValue = function () {\n var xRotation = getLabelRotation(\"xAxis\");\n var yRotation = getLabelRotation(\"yAxis\");\n if (xRotation == undefined && yRotation == undefined) {\n return _this.chartOptionsService.getAxisProperty(\"label.autoRotate\");\n }\n return false;\n };\n var autoRotate = getAutoRotateValue();\n var autoRotateCheckbox = this.createBean(new AgCheckbox())\n .setLabel(this.translate('autoRotate'))\n .setValue(autoRotate)\n .onValueChange(updateAutoRotate);\n // init rotation comp state\n xRotationComp.setDisabled(autoRotate);\n yRotationComp.setDisabled(autoRotate);\n return autoRotateCheckbox;\n };\n AxisPanel.prototype.createRotationWidgets = function () {\n var _this = this;\n var degreesSymbol = String.fromCharCode(176);\n var createRotationComp = function (labelKey, axisType) {\n var label = _this.chartTranslationService.translate(labelKey) + \" \" + degreesSymbol;\n var value = _this.chartOptionsService.getLabelRotation(axisType);\n var angleSelect = new AgAngleSelect()\n .setLabel(label)\n .setLabelWidth(\"flex\")\n .setValue(value || 0)\n .onValueChange(function (newValue) { return _this.chartOptionsService.setLabelRotation(axisType, newValue); });\n // the axis label rotation needs to be updated when the default category changes in the data panel\n _this.axisLabelUpdateFuncs.push(function () {\n var value = _this.chartOptionsService.getLabelRotation(axisType);\n angleSelect.setValue(value || 0);\n });\n return _this.createBean(angleSelect);\n };\n return {\n xRotationComp: createRotationComp(\"xRotation\", \"xAxis\"),\n yRotationComp: createRotationComp(\"yRotation\", \"yAxis\")\n };\n };\n AxisPanel.prototype.addLabelPadding = function (labelPanelComp) {\n var _this = this;\n var labelPaddingSlider = this.createBean(new AgSlider());\n var currentValue = this.chartOptionsService.getAxisProperty(\"label.padding\");\n labelPaddingSlider.setLabel(this.chartTranslationService.translate(\"padding\"))\n .setMaxValue(getMaxValue(currentValue, 30))\n .setValue(\"\" + currentValue)\n .setTextFieldWidth(45)\n .onValueChange(function (newValue) { return _this.chartOptionsService.setAxisProperty(\"label.padding\", newValue); });\n labelPanelComp.addCompToPanel(labelPaddingSlider);\n };\n AxisPanel.prototype.translate = function (key, defaultText) {\n return this.chartTranslationService.translate(key, defaultText);\n };\n AxisPanel.prototype.destroyActivePanels = function () {\n var _this = this;\n this.activePanels.forEach(function (panel) {\n _.removeFromParent(panel.getGui());\n _this.destroyBean(panel);\n });\n };\n AxisPanel.prototype.destroy = function () {\n this.destroyActivePanels();\n _super.prototype.destroy.call(this);\n };\n AxisPanel.TEMPLATE = \"
\\n \\n \\n \\n \\n
\";\n __decorate$17([\n RefSelector('axisGroup')\n ], AxisPanel.prototype, \"axisGroup\", void 0);\n __decorate$17([\n RefSelector('axisColorInput')\n ], AxisPanel.prototype, \"axisColorInput\", void 0);\n __decorate$17([\n RefSelector('axisLineWidthSlider')\n ], AxisPanel.prototype, \"axisLineWidthSlider\", void 0);\n __decorate$17([\n Autowired('chartTranslationService')\n ], AxisPanel.prototype, \"chartTranslationService\", void 0);\n __decorate$17([\n PostConstruct\n ], AxisPanel.prototype, \"init\", null);\n return AxisPanel;\n}(Component));\n\nvar __extends$1B = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$16 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar NavigatorPanel = /** @class */ (function (_super) {\n __extends$1B(NavigatorPanel, _super);\n function NavigatorPanel(_a) {\n var chartOptionsService = _a.chartOptionsService, _b = _a.isExpandedOnInit, isExpandedOnInit = _b === void 0 ? false : _b;\n var _this = _super.call(this) || this;\n _this.chartOptionsService = chartOptionsService;\n _this.isExpandedOnInit = isExpandedOnInit;\n return _this;\n }\n NavigatorPanel.prototype.init = function () {\n var groupParams = {\n cssIdentifier: 'charts-format-top-level',\n direction: 'vertical'\n };\n this.setTemplate(NavigatorPanel.TEMPLATE, { navigatorGroup: groupParams });\n this.initNavigator();\n };\n NavigatorPanel.prototype.initNavigator = function () {\n var _this = this;\n var chartTranslationService = this.chartTranslationService;\n this.navigatorGroup\n .setTitle(chartTranslationService.translate(\"navigator\"))\n .hideEnabledCheckbox(false)\n .setEnabled(this.chartOptionsService.getChartOption(\"navigator.enabled\") || false)\n .onEnableChange(function (enabled) {\n _this.chartOptionsService.setChartOption(\"navigator.enabled\", enabled);\n _this.navigatorGroup.toggleGroupExpand(true);\n })\n .toggleGroupExpand(this.isExpandedOnInit);\n var currentValue = this.chartOptionsService.getChartOption(\"navigator.height\");\n this.navigatorHeightSlider\n .setLabel(chartTranslationService.translate(\"height\"))\n .setMinValue(10)\n .setMaxValue(getMaxValue(currentValue, 60))\n .setTextFieldWidth(45)\n .setValue(\"\" + (currentValue || 30))\n .onValueChange(function (height) { return _this.chartOptionsService.setChartOption(\"navigator.height\", height); });\n };\n NavigatorPanel.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n };\n NavigatorPanel.TEMPLATE = \"
\\n \\n \\n \\n
\";\n __decorate$16([\n RefSelector('navigatorGroup')\n ], NavigatorPanel.prototype, \"navigatorGroup\", void 0);\n __decorate$16([\n RefSelector('navigatorHeightSlider')\n ], NavigatorPanel.prototype, \"navigatorHeightSlider\", void 0);\n __decorate$16([\n Autowired('chartTranslationService')\n ], NavigatorPanel.prototype, \"chartTranslationService\", void 0);\n __decorate$16([\n PostConstruct\n ], NavigatorPanel.prototype, \"init\", null);\n return NavigatorPanel;\n}(Component));\n\nvar __extends$1A = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$15 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar PaddingPanel = /** @class */ (function (_super) {\n __extends$1A(PaddingPanel, _super);\n function PaddingPanel(chartOptionsService, chartController) {\n var _this = _super.call(this) || this;\n _this.chartOptionsService = chartOptionsService;\n _this.chartController = chartController;\n return _this;\n }\n PaddingPanel.prototype.init = function () {\n var _this = this;\n var groupParams = {\n cssIdentifier: 'charts-format-sub-level',\n direction: 'vertical',\n suppressOpenCloseIcons: true\n };\n this.setTemplate(PaddingPanel.TEMPLATE, { chartPaddingGroup: groupParams });\n this.addManagedListener(this.eventService, Events.EVENT_CHART_OPTIONS_CHANGED, function (e) {\n _this.updateTopPadding(e.chartOptions);\n });\n this.initGroup();\n this.initChartPaddingItems();\n };\n PaddingPanel.prototype.initGroup = function () {\n this.chartPaddingGroup\n .setTitle(this.chartTranslationService.translate(\"padding\"))\n .hideOpenCloseIcons(true)\n .hideEnabledCheckbox(true);\n };\n PaddingPanel.prototype.initChartPaddingItems = function () {\n var _this = this;\n var initInput = function (property, input) {\n var currentValue = _this.chartOptionsService.getChartOption('padding.' + property);\n input.setLabel(_this.chartTranslationService.translate(property))\n .setMaxValue(getMaxValue(currentValue, 200))\n .setValue(\"\" + currentValue)\n .setTextFieldWidth(45)\n .onValueChange(function (newValue) { return _this.chartOptionsService.setChartOption('padding.' + property, newValue); });\n };\n initInput('top', this.paddingTopSlider);\n initInput('right', this.paddingRightSlider);\n initInput('bottom', this.paddingBottomSlider);\n initInput('left', this.paddingLeftSlider);\n };\n PaddingPanel.prototype.updateTopPadding = function (chartOptions) {\n var _a, _b;\n // keep 'top' padding in sync with chart as toggling chart title on / off change the 'top' padding\n var seriesType = this.chartController.getChartSeriesTypes()[0];\n var topPadding = (_b = (_a = chartOptions[seriesType]) === null || _a === void 0 ? void 0 : _a.padding) === null || _b === void 0 ? void 0 : _b.top;\n if (topPadding != null) {\n this.paddingTopSlider.setValue(topPadding);\n }\n };\n PaddingPanel.TEMPLATE = \"
\\n \\n \\n \\n \\n \\n \\n
\";\n __decorate$15([\n RefSelector('chartPaddingGroup')\n ], PaddingPanel.prototype, \"chartPaddingGroup\", void 0);\n __decorate$15([\n RefSelector('paddingTopSlider')\n ], PaddingPanel.prototype, \"paddingTopSlider\", void 0);\n __decorate$15([\n RefSelector('paddingRightSlider')\n ], PaddingPanel.prototype, \"paddingRightSlider\", void 0);\n __decorate$15([\n RefSelector('paddingBottomSlider')\n ], PaddingPanel.prototype, \"paddingBottomSlider\", void 0);\n __decorate$15([\n RefSelector('paddingLeftSlider')\n ], PaddingPanel.prototype, \"paddingLeftSlider\", void 0);\n __decorate$15([\n Autowired('chartTranslationService')\n ], PaddingPanel.prototype, \"chartTranslationService\", void 0);\n __decorate$15([\n PostConstruct\n ], PaddingPanel.prototype, \"init\", null);\n return PaddingPanel;\n}(Component));\n\nvar __extends$1z = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$14 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar BackgroundPanel = /** @class */ (function (_super) {\n __extends$1z(BackgroundPanel, _super);\n function BackgroundPanel(chartOptionsService) {\n var _this = _super.call(this) || this;\n _this.chartOptionsService = chartOptionsService;\n return _this;\n }\n BackgroundPanel.prototype.init = function () {\n var groupParams = {\n cssIdentifier: 'charts-format-sub-level',\n direction: 'vertical',\n suppressOpenCloseIcons: true\n };\n this.setTemplate(BackgroundPanel.TEMPLATE, { chartBackgroundGroup: groupParams });\n this.initGroup();\n this.initColorPicker();\n };\n BackgroundPanel.prototype.initGroup = function () {\n var _this = this;\n this.group\n .setTitle(this.chartTranslationService.translate('background'))\n .setEnabled(this.chartOptionsService.getChartOption('background.visible'))\n .hideOpenCloseIcons(true)\n .hideEnabledCheckbox(false)\n .onEnableChange(function (enabled) { return _this.chartOptionsService.setChartOption('background.visible', enabled); });\n };\n BackgroundPanel.prototype.initColorPicker = function () {\n var _this = this;\n this.colorPicker\n .setLabel(this.chartTranslationService.translate('color'))\n .setLabelWidth('flex')\n .setInputWidth(45)\n .setValue(this.chartOptionsService.getChartOption('background.fill'))\n .onValueChange(function (newColor) { return _this.chartOptionsService.setChartOption('background.fill', newColor); });\n };\n BackgroundPanel.TEMPLATE = \"
\\n \\n \\n \\n
\";\n __decorate$14([\n RefSelector('chartBackgroundGroup')\n ], BackgroundPanel.prototype, \"group\", void 0);\n __decorate$14([\n RefSelector('colorPicker')\n ], BackgroundPanel.prototype, \"colorPicker\", void 0);\n __decorate$14([\n Autowired('chartTranslationService')\n ], BackgroundPanel.prototype, \"chartTranslationService\", void 0);\n __decorate$14([\n PostConstruct\n ], BackgroundPanel.prototype, \"init\", null);\n return BackgroundPanel;\n}(Component));\n\nvar __extends$1y = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$13 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar TitlePanel = /** @class */ (function (_super) {\n __extends$1y(TitlePanel, _super);\n function TitlePanel(chartOptionsService) {\n var _this = _super.call(this, TitlePanel.TEMPLATE) || this;\n _this.chartOptionsService = chartOptionsService;\n _this.activePanels = [];\n return _this;\n }\n TitlePanel.prototype.init = function () {\n this.initFontPanel();\n this.titlePlaceholder = this.chartTranslationService.translate('titlePlaceholder');\n };\n TitlePanel.prototype.hasTitle = function () {\n var title = this.getOption('title');\n return title && title.enabled && title.text && title.text.length > 0;\n };\n TitlePanel.prototype.initFontPanel = function () {\n var _this = this;\n var hasTitle = this.hasTitle();\n var setFont = function (font, isSilent) {\n if (font.family) {\n _this.setOption('title.fontFamily', font.family, isSilent);\n }\n if (font.weight) {\n _this.setOption('title.fontWeight', font.weight, isSilent);\n }\n if (font.style) {\n _this.setOption('title.fontStyle', font.style, isSilent);\n }\n if (font.size) {\n _this.setOption('title.fontSize', font.size, isSilent);\n }\n if (font.color) {\n _this.setOption('title.color', font.color, isSilent);\n }\n };\n var initialFont = {\n family: this.getOption('title.fontFamily'),\n style: this.getOption('title.fontStyle'),\n weight: this.getOption('title.fontWeight'),\n size: this.getOption('title.fontSize'),\n color: this.getOption('title.color')\n };\n if (!hasTitle) {\n setFont(initialFont, true);\n }\n var fontPanelParams = {\n name: this.chartTranslationService.translate('title'),\n enabled: hasTitle,\n suppressEnabledCheckbox: false,\n initialFont: initialFont,\n setFont: setFont,\n setEnabled: function (enabled) {\n if (_this.toolbarExists()) {\n // extra padding is only included when the toolbar is present\n var topPadding = _this.getOption('padding.top');\n _this.setOption('padding.top', enabled ? topPadding - 20 : topPadding + 20);\n }\n _this.setOption('title.enabled', enabled);\n var currentTitleText = _this.getOption('title.text');\n var replaceableTitleText = currentTitleText === 'Title' || (currentTitleText === null || currentTitleText === void 0 ? void 0 : currentTitleText.trim().length) === 0;\n if (enabled && replaceableTitleText) {\n _this.setOption('title.text', _this.titlePlaceholder);\n }\n }\n };\n var fontPanelComp = this.createBean(new FontPanel(fontPanelParams));\n // add the title spacing slider to font panel\n fontPanelComp.addItemToPanel(this.createSpacingSlicer());\n this.getGui().appendChild(fontPanelComp.getGui());\n this.activePanels.push(fontPanelComp);\n // edits to the title can disable it, so keep the checkbox in sync:\n this.addManagedListener(this.eventService, 'chartTitleEdit', function () {\n fontPanelComp.setEnabled(_this.hasTitle());\n });\n };\n TitlePanel.prototype.createSpacingSlicer = function () {\n var _this = this;\n var spacingSlider = this.createBean(new AgSlider());\n var currentValue = this.chartOptionsService.getChartOption('title.spacing');\n spacingSlider.setLabel(this.chartTranslationService.translate('spacing'))\n .setMaxValue(Math.max(currentValue, 100))\n .setValue(\"\" + currentValue)\n .setTextFieldWidth(45)\n .onValueChange(function (newValue) { return _this.chartOptionsService.setChartOption('title.spacing', newValue); });\n return spacingSlider;\n };\n TitlePanel.prototype.toolbarExists = function () {\n var toolbarItemsFunc = this.gridOptionsService.getCallback('getChartToolbarItems');\n if (!toolbarItemsFunc) {\n return true;\n }\n var params = {\n defaultItems: ['chartUnlink', 'chartDownload']\n };\n var topItems = ['chartLink', 'chartUnlink', 'chartDownload'];\n return topItems.some(function (v) { var _a; return (_a = (toolbarItemsFunc && toolbarItemsFunc(params))) === null || _a === void 0 ? void 0 : _a.includes(v); });\n };\n TitlePanel.prototype.getOption = function (expression) {\n return this.chartOptionsService.getChartOption(expression);\n };\n TitlePanel.prototype.setOption = function (property, value, isSilent) {\n this.chartOptionsService.setChartOption(property, value, isSilent);\n };\n TitlePanel.prototype.destroyActivePanels = function () {\n var _this = this;\n this.activePanels.forEach(function (panel) {\n _.removeFromParent(panel.getGui());\n _this.destroyBean(panel);\n });\n };\n TitlePanel.prototype.destroy = function () {\n this.destroyActivePanels();\n _super.prototype.destroy.call(this);\n };\n TitlePanel.TEMPLATE = \"
\";\n __decorate$13([\n Autowired('chartTranslationService')\n ], TitlePanel.prototype, \"chartTranslationService\", void 0);\n __decorate$13([\n PostConstruct\n ], TitlePanel.prototype, \"init\", null);\n return TitlePanel;\n}(Component));\n\nvar __extends$1x = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$12 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar ChartPanel = /** @class */ (function (_super) {\n __extends$1x(ChartPanel, _super);\n function ChartPanel(_a) {\n var chartController = _a.chartController, chartOptionsService = _a.chartOptionsService, _b = _a.isExpandedOnInit, isExpandedOnInit = _b === void 0 ? false : _b;\n var _this = _super.call(this) || this;\n _this.activePanels = [];\n _this.chartController = chartController;\n _this.chartOptionsService = chartOptionsService;\n _this.isExpandedOnInit = isExpandedOnInit;\n return _this;\n }\n ChartPanel.prototype.init = function () {\n var groupParams = {\n cssIdentifier: 'charts-format-top-level',\n direction: 'vertical'\n };\n this.setTemplate(ChartPanel.TEMPLATE, { chartGroup: groupParams });\n this.initGroup();\n this.initTitles();\n this.initPaddingPanel();\n this.initBackgroundPanel();\n };\n ChartPanel.prototype.initGroup = function () {\n this.chartGroup\n .setTitle(this.chartTranslationService.translate('chart'))\n .toggleGroupExpand(this.isExpandedOnInit)\n .hideEnabledCheckbox(true);\n };\n ChartPanel.prototype.initTitles = function () {\n var titlePanelComp = this.createBean(new TitlePanel(this.chartOptionsService));\n this.chartGroup.addItem(titlePanelComp);\n this.activePanels.push(titlePanelComp);\n };\n ChartPanel.prototype.initPaddingPanel = function () {\n var paddingPanelComp = this.createBean(new PaddingPanel(this.chartOptionsService, this.chartController));\n this.chartGroup.addItem(paddingPanelComp);\n this.activePanels.push(paddingPanelComp);\n };\n ChartPanel.prototype.initBackgroundPanel = function () {\n var backgroundPanelComp = this.createBean(new BackgroundPanel(this.chartOptionsService));\n this.chartGroup.addItem(backgroundPanelComp);\n this.activePanels.push(backgroundPanelComp);\n };\n ChartPanel.prototype.destroyActivePanels = function () {\n var _this = this;\n this.activePanels.forEach(function (panel) {\n _.removeFromParent(panel.getGui());\n _this.destroyBean(panel);\n });\n };\n ChartPanel.prototype.destroy = function () {\n this.destroyActivePanels();\n _super.prototype.destroy.call(this);\n };\n ChartPanel.TEMPLATE = \"
\\n \\n
\";\n __decorate$12([\n RefSelector('chartGroup')\n ], ChartPanel.prototype, \"chartGroup\", void 0);\n __decorate$12([\n Autowired('chartTranslationService')\n ], ChartPanel.prototype, \"chartTranslationService\", void 0);\n __decorate$12([\n PostConstruct\n ], ChartPanel.prototype, \"init\", null);\n return ChartPanel;\n}(Component));\n\nvar __extends$1w = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$11 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar ShadowPanel = /** @class */ (function (_super) {\n __extends$1w(ShadowPanel, _super);\n function ShadowPanel(chartOptionsService, getSelectedSeries) {\n var _this = _super.call(this) || this;\n _this.chartOptionsService = chartOptionsService;\n _this.getSelectedSeries = getSelectedSeries;\n return _this;\n }\n ShadowPanel.prototype.init = function () {\n var groupParams = {\n cssIdentifier: 'charts-format-sub-level',\n direction: 'vertical',\n suppressOpenCloseIcons: true\n };\n this.setTemplate(ShadowPanel.TEMPLATE, { shadowGroup: groupParams });\n this.shadowBlurSlider.setTextFieldWidth(45);\n this.shadowXOffsetSlider.setTextFieldWidth(45);\n this.shadowYOffsetSlider.setTextFieldWidth(45);\n this.initSeriesShadow();\n };\n ShadowPanel.prototype.initSeriesShadow = function () {\n var _this = this;\n this.shadowGroup\n .setTitle(this.chartTranslationService.translate(\"shadow\"))\n .setEnabled(this.chartOptionsService.getSeriesOption(\"shadow.enabled\", this.getSelectedSeries()))\n .hideOpenCloseIcons(true)\n .hideEnabledCheckbox(false)\n .onEnableChange(function (newValue) { return _this.chartOptionsService.setSeriesOption(\"shadow.enabled\", newValue, _this.getSelectedSeries()); });\n this.shadowColorPicker\n .setLabel(this.chartTranslationService.translate(\"color\"))\n .setLabelWidth(\"flex\")\n .setInputWidth(45)\n .setValue(this.chartOptionsService.getSeriesOption(\"shadow.color\", this.getSelectedSeries()))\n .onValueChange(function (newValue) { return _this.chartOptionsService.setSeriesOption(\"shadow.color\", newValue, _this.getSelectedSeries()); });\n var initInput = function (input, property, minValue, defaultMaxValue) {\n var currentValue = _this.chartOptionsService.getSeriesOption(\"shadow.\" + property, _this.getSelectedSeries());\n input.setLabel(_this.chartTranslationService.translate(property))\n .setMinValue(minValue)\n .setMaxValue(getMaxValue(currentValue, defaultMaxValue))\n .setValue(\"\" + currentValue)\n .onValueChange(function (newValue) { return _this.chartOptionsService.setSeriesOption(\"shadow.\" + property, newValue, _this.getSelectedSeries()); });\n };\n initInput(this.shadowBlurSlider, \"blur\", 0, 20);\n initInput(this.shadowXOffsetSlider, \"xOffset\", -10, 10);\n initInput(this.shadowYOffsetSlider, \"yOffset\", -10, 10);\n };\n ShadowPanel.TEMPLATE = \"
\\n \\n \\n \\n \\n \\n \\n
\";\n __decorate$11([\n RefSelector('shadowGroup')\n ], ShadowPanel.prototype, \"shadowGroup\", void 0);\n __decorate$11([\n RefSelector('shadowColorPicker')\n ], ShadowPanel.prototype, \"shadowColorPicker\", void 0);\n __decorate$11([\n RefSelector('shadowBlurSlider')\n ], ShadowPanel.prototype, \"shadowBlurSlider\", void 0);\n __decorate$11([\n RefSelector('shadowXOffsetSlider')\n ], ShadowPanel.prototype, \"shadowXOffsetSlider\", void 0);\n __decorate$11([\n RefSelector('shadowYOffsetSlider')\n ], ShadowPanel.prototype, \"shadowYOffsetSlider\", void 0);\n __decorate$11([\n Autowired('chartTranslationService')\n ], ShadowPanel.prototype, \"chartTranslationService\", void 0);\n __decorate$11([\n PostConstruct\n ], ShadowPanel.prototype, \"init\", null);\n return ShadowPanel;\n}(Component));\n\nfunction initFontPanelParams(_a) {\n var labelName = _a.labelName, chartOptionsService = _a.chartOptionsService, getSelectedSeries = _a.getSelectedSeries, seriesOptionLabelProperty = _a.seriesOptionLabelProperty;\n var getFontOptionExpression = function (fontOption) {\n return seriesOptionLabelProperty + \".\" + fontOption;\n };\n var getFontOption = function (fontOption) {\n var expression = getFontOptionExpression(fontOption);\n return chartOptionsService.getSeriesOption(expression, getSelectedSeries());\n };\n var setFontOption = function (fontOption, value) {\n var expression = getFontOptionExpression(fontOption);\n chartOptionsService.setSeriesOption(expression, value, getSelectedSeries());\n };\n var initialFont = {\n family: getFontOption('fontFamily'),\n style: getFontOption('fontStyle'),\n weight: getFontOption('fontWeight'),\n size: getFontOption('fontSize'),\n color: getFontOption('color'),\n };\n var setFont = function (font) {\n if (font.family) {\n setFontOption('fontFamily', font.family);\n }\n if (font.weight) {\n setFontOption('fontWeight', font.weight);\n }\n if (font.style) {\n setFontOption('fontStyle', font.style);\n }\n if (font.size) {\n setFontOption('fontSize', font.size);\n }\n if (font.color) {\n setFontOption('color', font.color);\n }\n };\n var params = {\n name: labelName,\n enabled: getFontOption('enabled') || false,\n setEnabled: function (enabled) { return setFontOption('enabled', enabled); },\n suppressEnabledCheckbox: false,\n initialFont: initialFont,\n setFont: setFont\n };\n return params;\n}\n\nvar __extends$1v = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$10 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar MarkersPanel = /** @class */ (function (_super) {\n __extends$1v(MarkersPanel, _super);\n function MarkersPanel(chartOptionsService, getSelectedSeries) {\n var _this = _super.call(this) || this;\n _this.chartOptionsService = chartOptionsService;\n _this.getSelectedSeries = getSelectedSeries;\n return _this;\n }\n MarkersPanel.prototype.init = function () {\n var groupParams = {\n cssIdentifier: 'charts-format-sub-level',\n direction: 'vertical'\n };\n this.setTemplate(MarkersPanel.TEMPLATE, { seriesMarkersGroup: groupParams });\n this.initMarkers();\n };\n MarkersPanel.prototype.initMarkers = function () {\n var _this = this;\n var seriesMarkerShapeOptions = [\n {\n value: 'square',\n text: 'Square'\n },\n {\n value: 'circle',\n text: 'Circle'\n },\n {\n value: 'cross',\n text: 'Cross'\n },\n {\n value: 'diamond',\n text: 'Diamond'\n },\n {\n value: 'plus',\n text: 'Plus'\n },\n {\n value: 'triangle',\n text: 'Triangle'\n },\n {\n value: 'heart',\n text: 'Heart'\n }\n ];\n this.seriesMarkerShapeSelect\n .addOptions(seriesMarkerShapeOptions)\n .setLabel(this.chartTranslationService.translate('shape'))\n .setValue(this.getSeriesOption(\"marker.shape\"))\n .onValueChange(function (value) { return _this.setSeriesOption(\"marker.shape\", value); });\n // scatter charts should always show markers\n var chartType = this.chartOptionsService.getChartType();\n var shouldHideEnabledCheckbox = _.includes(['scatter', 'bubble'], chartType);\n this.seriesMarkersGroup\n .setTitle(this.chartTranslationService.translate(\"markers\"))\n .hideEnabledCheckbox(shouldHideEnabledCheckbox)\n .setEnabled(this.getSeriesOption(\"marker.enabled\") || false)\n .hideOpenCloseIcons(true)\n .onEnableChange(function (newValue) { return _this.setSeriesOption(\"marker.enabled\", newValue); });\n var initInput = function (expression, input, labelKey, defaultMaxValue) {\n var currentValue = _this.getSeriesOption(expression);\n input.setLabel(_this.chartTranslationService.translate(labelKey))\n .setMaxValue(getMaxValue(currentValue, defaultMaxValue))\n .setValue(\"\" + currentValue)\n .setTextFieldWidth(45)\n .onValueChange(function (newValue) { return _this.setSeriesOption(expression, newValue); });\n };\n if (chartType === 'bubble') {\n initInput(\"marker.maxSize\", this.seriesMarkerMinSizeSlider, \"maxSize\", 60);\n initInput(\"marker.size\", this.seriesMarkerSizeSlider, \"minSize\", 60);\n }\n else {\n this.seriesMarkerMinSizeSlider.setDisplayed(false);\n initInput(\"marker.size\", this.seriesMarkerSizeSlider, \"size\", 60);\n }\n initInput(\"marker.strokeWidth\", this.seriesMarkerStrokeWidthSlider, \"strokeWidth\", 10);\n };\n MarkersPanel.prototype.getSeriesOption = function (expression) {\n return this.chartOptionsService.getSeriesOption(expression, this.getSelectedSeries());\n };\n MarkersPanel.prototype.setSeriesOption = function (expression, newValue) {\n this.chartOptionsService.setSeriesOption(expression, newValue, this.getSelectedSeries());\n };\n MarkersPanel.TEMPLATE = \"
\\n \\n \\n \\n \\n \\n \\n
\";\n __decorate$10([\n RefSelector('seriesMarkersGroup')\n ], MarkersPanel.prototype, \"seriesMarkersGroup\", void 0);\n __decorate$10([\n RefSelector('seriesMarkerShapeSelect')\n ], MarkersPanel.prototype, \"seriesMarkerShapeSelect\", void 0);\n __decorate$10([\n RefSelector('seriesMarkerSizeSlider')\n ], MarkersPanel.prototype, \"seriesMarkerSizeSlider\", void 0);\n __decorate$10([\n RefSelector('seriesMarkerMinSizeSlider')\n ], MarkersPanel.prototype, \"seriesMarkerMinSizeSlider\", void 0);\n __decorate$10([\n RefSelector('seriesMarkerStrokeWidthSlider')\n ], MarkersPanel.prototype, \"seriesMarkerStrokeWidthSlider\", void 0);\n __decorate$10([\n Autowired('chartTranslationService')\n ], MarkersPanel.prototype, \"chartTranslationService\", void 0);\n __decorate$10([\n PostConstruct\n ], MarkersPanel.prototype, \"init\", null);\n return MarkersPanel;\n}(Component));\n\nvar __extends$1u = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$$ = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar CalloutPanel = /** @class */ (function (_super) {\n __extends$1u(CalloutPanel, _super);\n function CalloutPanel(chartOptionsService, getSelectedSeries) {\n var _this = _super.call(this) || this;\n _this.chartOptionsService = chartOptionsService;\n _this.getSelectedSeries = getSelectedSeries;\n return _this;\n }\n CalloutPanel.prototype.init = function () {\n var groupParams = {\n cssIdentifier: 'charts-format-sub-level',\n direction: 'vertical'\n };\n this.setTemplate(CalloutPanel.TEMPLATE, { calloutGroup: groupParams });\n this.initCalloutOptions();\n };\n CalloutPanel.prototype.initCalloutOptions = function () {\n var _this = this;\n this.calloutGroup\n .setTitle(this.chartTranslationService.translate(\"callout\"))\n .setEnabled(true)\n .hideOpenCloseIcons(true)\n .hideEnabledCheckbox(true);\n var initInput = function (expression, input, labelKey, defaultMaxValue) {\n var currentValue = _this.chartOptionsService.getSeriesOption(expression, _this.getSelectedSeries());\n input.setLabel(_this.chartTranslationService.translate(labelKey))\n .setMaxValue(getMaxValue(currentValue, defaultMaxValue))\n .setValue(\"\" + currentValue)\n .setTextFieldWidth(45)\n .onValueChange(function (newValue) { return _this.chartOptionsService.setSeriesOption(expression, newValue, _this.getSelectedSeries()); });\n };\n initInput('calloutLine.length', this.calloutLengthSlider, 'length', 40);\n initInput('calloutLine.strokeWidth', this.calloutStrokeWidthSlider, 'strokeWidth', 10);\n initInput('calloutLabel.offset', this.labelOffsetSlider, 'offset', 30);\n };\n CalloutPanel.TEMPLATE = \"
\\n \\n \\n \\n \\n \\n
\";\n __decorate$$([\n RefSelector('calloutGroup')\n ], CalloutPanel.prototype, \"calloutGroup\", void 0);\n __decorate$$([\n RefSelector('calloutLengthSlider')\n ], CalloutPanel.prototype, \"calloutLengthSlider\", void 0);\n __decorate$$([\n RefSelector('calloutStrokeWidthSlider')\n ], CalloutPanel.prototype, \"calloutStrokeWidthSlider\", void 0);\n __decorate$$([\n RefSelector('labelOffsetSlider')\n ], CalloutPanel.prototype, \"labelOffsetSlider\", void 0);\n __decorate$$([\n Autowired('chartTranslationService')\n ], CalloutPanel.prototype, \"chartTranslationService\", void 0);\n __decorate$$([\n PostConstruct\n ], CalloutPanel.prototype, \"init\", null);\n return CalloutPanel;\n}(Component));\n\nvar __extends$1t = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$_ = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar SeriesPanel = /** @class */ (function (_super) {\n __extends$1t(SeriesPanel, _super);\n function SeriesPanel(_a) {\n var chartController = _a.chartController, chartOptionsService = _a.chartOptionsService, seriesType = _a.seriesType, _b = _a.isExpandedOnInit, isExpandedOnInit = _b === void 0 ? false : _b;\n var _this = _super.call(this) || this;\n _this.activePanels = [];\n _this.widgetFuncs = {\n 'lineWidth': function () { return _this.initLineWidth(); },\n 'strokeWidth': function () { return _this.initStrokeWidth(); },\n 'lineDash': function () { return _this.initLineDash(); },\n 'lineOpacity': function () { return _this.initLineOpacity(); },\n 'fillOpacity': function () { return _this.initFillOpacity(); },\n 'markers': function () { return _this.initMarkers(); },\n 'labels': function () { return _this.initLabels(); },\n 'shadow': function () { return _this.initShadow(); },\n 'tooltips': function () { return _this.initTooltips(); },\n 'bins': function () { return _this.initBins(); },\n };\n _this.seriesWidgetMappings = {\n 'area': ['tooltips', 'lineWidth', 'lineDash', 'lineOpacity', 'fillOpacity', 'markers', 'labels', 'shadow'],\n 'bar': ['tooltips', 'strokeWidth', 'lineDash', 'lineOpacity', 'fillOpacity', 'labels', 'shadow'],\n 'column': ['tooltips', 'strokeWidth', 'lineDash', 'lineOpacity', 'fillOpacity', 'labels', 'shadow'],\n 'line': ['tooltips', 'lineWidth', 'lineDash', 'lineOpacity', 'markers', 'labels'],\n 'histogram': ['tooltips', 'bins', 'strokeWidth', 'lineDash', 'lineOpacity', 'fillOpacity', 'labels', 'shadow'],\n 'scatter': ['tooltips', 'markers', 'labels'],\n 'pie': ['tooltips', 'strokeWidth', 'lineOpacity', 'fillOpacity', 'labels', 'shadow'],\n };\n _this.chartController = chartController;\n _this.chartOptionsService = chartOptionsService;\n _this.seriesType = seriesType || _this.getChartSeriesType();\n _this.isExpandedOnInit = isExpandedOnInit;\n return _this;\n }\n SeriesPanel.prototype.init = function () {\n var groupParams = {\n cssIdentifier: 'charts-format-top-level',\n direction: 'vertical'\n };\n this.setTemplate(SeriesPanel.TEMPLATE, { seriesGroup: groupParams });\n this.seriesGroup\n .setTitle(this.translate(\"series\"))\n .toggleGroupExpand(this.isExpandedOnInit)\n .hideEnabledCheckbox(true);\n this.addManagedListener(this.chartController, ChartController.EVENT_CHART_SERIES_CHART_TYPE_CHANGED, this.refreshWidgets.bind(this));\n this.refreshWidgets();\n };\n SeriesPanel.prototype.refreshWidgets = function () {\n var _this = this;\n this.destroyActivePanels();\n var chart = this.chartController.getChartProxy().getChart();\n chart.waitForUpdate().then(function () {\n if (_this.chartController.isComboChart()) {\n _this.updateSeriesType();\n _this.initSeriesSelect();\n }\n _this.seriesWidgetMappings[_this.seriesType].forEach(function (w) { return _this.widgetFuncs[w](); });\n })\n .catch(function (e) { return console.error(\"AG Grid - chart rendering failed\", e); });\n };\n SeriesPanel.prototype.initSeriesSelect = function () {\n var _this = this;\n var seriesSelect = this.seriesGroup.createManagedBean(new AgSelect());\n seriesSelect\n .setLabel(this.translate('seriesType'))\n .setLabelAlignment(\"left\")\n .setLabelWidth('flex')\n .setInputWidth(100)\n .addOptions(this.getSeriesSelectOptions())\n .setValue(\"\" + this.seriesType)\n .onValueChange(function (newValue) {\n _this.seriesType = newValue;\n _this.refreshWidgets();\n });\n this.seriesGroup.addItem(seriesSelect);\n this.activePanels.push(seriesSelect);\n };\n SeriesPanel.prototype.initTooltips = function () {\n var _this = this;\n var seriesTooltipsToggle = this.createBean(new AgToggleButton());\n seriesTooltipsToggle\n .setLabel(this.translate(\"tooltips\"))\n .setLabelAlignment(\"left\")\n .setLabelWidth(\"flex\")\n .setInputWidth(45)\n .setValue(this.getSeriesOption(\"tooltip.enabled\") || false)\n .onValueChange(function (newValue) { return _this.setSeriesOption(\"tooltip.enabled\", newValue); });\n this.addWidget(seriesTooltipsToggle);\n };\n SeriesPanel.prototype.initStrokeWidth = function () {\n var _this = this;\n var currentValue = this.getSeriesOption(\"strokeWidth\");\n var seriesStrokeWidthSlider = this.createBean(new AgSlider());\n seriesStrokeWidthSlider\n .setLabel(this.translate(\"strokeWidth\"))\n .setMaxValue(getMaxValue(currentValue, 10))\n .setTextFieldWidth(45)\n .setValue(\"\" + currentValue)\n .onValueChange(function (newValue) { return _this.setSeriesOption(\"strokeWidth\", newValue); });\n this.addWidget(seriesStrokeWidthSlider);\n };\n SeriesPanel.prototype.initLineWidth = function () {\n var _this = this;\n var currentValue = this.getSeriesOption(\"strokeWidth\");\n var seriesLineWidthSlider = this.createBean(new AgSlider());\n seriesLineWidthSlider\n .setLabel(this.translate('lineWidth'))\n .setMaxValue(getMaxValue(currentValue, 10))\n .setTextFieldWidth(45)\n .setValue(\"\" + currentValue)\n .onValueChange(function (newValue) { return _this.setSeriesOption(\"strokeWidth\", newValue); });\n this.addWidget(seriesLineWidthSlider);\n };\n SeriesPanel.prototype.initLineDash = function () {\n var _this = this;\n var lineDash = this.getSeriesOption(\"lineDash\");\n var currentValue = lineDash ? lineDash[0] : 0;\n var seriesLineDashSlider = this.createBean(new AgSlider());\n seriesLineDashSlider\n .setLabel(this.translate('lineDash'))\n .setMaxValue(getMaxValue(currentValue, 30))\n .setTextFieldWidth(45)\n .setValue(\"\" + currentValue)\n .onValueChange(function (newValue) { return _this.setSeriesOption(\"lineDash\", [newValue]); });\n this.addWidget(seriesLineDashSlider);\n };\n SeriesPanel.prototype.initLineOpacity = function () {\n var _this = this;\n var currentValue = this.getSeriesOption(\"strokeOpacity\");\n var seriesLineOpacitySlider = this.createBean(new AgSlider());\n seriesLineOpacitySlider\n .setLabel(this.translate(\"strokeOpacity\"))\n .setStep(0.05)\n .setMaxValue(getMaxValue(currentValue, 1))\n .setTextFieldWidth(45)\n .setValue(\"\" + currentValue)\n .onValueChange(function (newValue) { return _this.setSeriesOption(\"strokeOpacity\", newValue); });\n this.addWidget(seriesLineOpacitySlider);\n };\n SeriesPanel.prototype.initFillOpacity = function () {\n var _this = this;\n var currentValue = this.getSeriesOption(\"fillOpacity\");\n var seriesFillOpacitySlider = this.createBean(new AgSlider());\n seriesFillOpacitySlider\n .setLabel(this.translate(\"fillOpacity\"))\n .setStep(0.05)\n .setMaxValue(getMaxValue(currentValue, 1))\n .setTextFieldWidth(45)\n .setValue(\"\" + currentValue)\n .onValueChange(function (newValue) { return _this.setSeriesOption(\"fillOpacity\", newValue); });\n this.addWidget(seriesFillOpacitySlider);\n };\n SeriesPanel.prototype.initLabels = function () {\n var _this = this;\n var seriesOptionLabelProperty = this.seriesType === 'pie' ? 'calloutLabel' : 'label';\n var labelName = this.seriesType === 'pie'\n ? this.chartTranslationService.translate('calloutLabels')\n : this.chartTranslationService.translate('labels');\n var labelParams = initFontPanelParams({\n labelName: labelName,\n chartOptionsService: this.chartOptionsService,\n getSelectedSeries: function () { return _this.seriesType; },\n seriesOptionLabelProperty: seriesOptionLabelProperty\n });\n var labelPanelComp = this.createBean(new FontPanel(labelParams));\n if (this.seriesType === 'pie') {\n var calloutPanelComp = this.createBean(new CalloutPanel(this.chartOptionsService, function () { return _this.seriesType; }));\n labelPanelComp.addCompToPanel(calloutPanelComp);\n this.activePanels.push(calloutPanelComp);\n }\n this.addWidget(labelPanelComp);\n if (this.seriesType === 'pie') {\n var sectorParams = initFontPanelParams({\n labelName: this.chartTranslationService.translate('sectorLabels'),\n chartOptionsService: this.chartOptionsService,\n getSelectedSeries: function () { return _this.seriesType; },\n seriesOptionLabelProperty: 'sectorLabel'\n });\n var sectorPanelComp = this.createBean(new FontPanel(sectorParams));\n var positionRatioComp = this.getSectorLabelPositionRatio();\n sectorPanelComp.addCompToPanel(positionRatioComp);\n this.addWidget(sectorPanelComp);\n }\n };\n SeriesPanel.prototype.getSectorLabelPositionRatio = function () {\n var _this = this;\n var expression = 'sectorLabel.positionRatio';\n var currentValue = this.chartOptionsService.getSeriesOption(expression, this.seriesType);\n var sectorLabelPositionRatioSlider = this.createBean(new AgSlider());\n return sectorLabelPositionRatioSlider\n .setLabel(this.translate(\"positionRatio\"))\n .setStep(0.05)\n .setMaxValue(getMaxValue(currentValue, 1))\n .setTextFieldWidth(45)\n .setValue(\"\" + currentValue)\n .onValueChange(function (newValue) { return _this.chartOptionsService.setSeriesOption(expression, newValue, _this.seriesType); });\n };\n SeriesPanel.prototype.initShadow = function () {\n var _this = this;\n var shadowPanelComp = this.createBean(new ShadowPanel(this.chartOptionsService, function () { return _this.seriesType; }));\n this.addWidget(shadowPanelComp);\n };\n SeriesPanel.prototype.initMarkers = function () {\n var _this = this;\n var markersPanelComp = this.createBean(new MarkersPanel(this.chartOptionsService, function () { return _this.seriesType; }));\n this.addWidget(markersPanelComp);\n };\n SeriesPanel.prototype.initBins = function () {\n var _this = this;\n var _a;\n var currentValue = ((_a = this.getSeriesOption(\"bins\")) !== null && _a !== void 0 ? _a : this.getSeriesOption(\"calculatedBins\")).length;\n var seriesBinCountSlider = this.createBean(new AgSlider());\n seriesBinCountSlider\n .setLabel(this.translate(\"histogramBinCount\"))\n .setMinValue(0)\n .setMaxValue(getMaxValue(currentValue, 20))\n .setTextFieldWidth(45)\n .setValue(\"\" + currentValue)\n .onValueChange(function (newValue) { return _this.setSeriesOption(\"binCount\", newValue); });\n this.addWidget(seriesBinCountSlider);\n };\n SeriesPanel.prototype.addWidget = function (widget) {\n this.seriesGroup.addItem(widget);\n this.activePanels.push(widget);\n };\n SeriesPanel.prototype.getSeriesOption = function (expression) {\n return this.chartOptionsService.getSeriesOption(expression, this.seriesType);\n };\n SeriesPanel.prototype.setSeriesOption = function (expression, newValue) {\n this.chartOptionsService.setSeriesOption(expression, newValue, this.seriesType);\n };\n SeriesPanel.prototype.getChartSeriesType = function () {\n if (this.chartController.getSeriesChartTypes().length === 0)\n return 'column';\n var ct = this.chartController.getSeriesChartTypes()[0].chartType;\n if (ct === 'columnLineCombo')\n return 'column';\n if (ct === 'areaColumnCombo')\n return 'area';\n return getSeriesType(ct);\n };\n SeriesPanel.prototype.getSeriesSelectOptions = function () {\n var _this = this;\n if (!this.seriesSelectOptions) {\n // lazy init options as they are only required for combo charts\n this.seriesSelectOptions = new Map([\n ['area', { value: 'area', text: this.translate('area', 'Area') }],\n ['bar', { value: 'bar', text: this.translate('bar', 'Bar') }],\n ['column', { value: 'column', text: this.translate('column', 'Column') }],\n ['line', { value: 'line', text: this.translate('line', 'Line') }],\n ['scatter', { value: 'scatter', text: this.translate('scatter', 'Scatter') }],\n ['histogram', { value: 'histogram', text: this.translate('histogram', 'Histogram') }],\n ['pie', { value: 'pie', text: this.translate('pie', 'Pie') }],\n ]);\n }\n var seriesSelectOptions = new Set();\n this.chartController.getActiveSeriesChartTypes().forEach(function (s) {\n var chartType = getSeriesType(s.chartType);\n seriesSelectOptions.add(_this.seriesSelectOptions.get(chartType));\n });\n return Array.from(seriesSelectOptions);\n };\n SeriesPanel.prototype.updateSeriesType = function () {\n var activeChartTypes = this.chartController.getActiveSeriesChartTypes().map(function (s) { return getSeriesType(s.chartType); });\n var invalidSeriesType = !activeChartTypes.includes(this.seriesType);\n if (invalidSeriesType && activeChartTypes.length > 0) {\n this.seriesType = activeChartTypes[0]; // default to first active series type\n }\n };\n SeriesPanel.prototype.translate = function (key, defaultText) {\n return this.chartTranslationService.translate(key, defaultText);\n };\n SeriesPanel.prototype.destroyActivePanels = function () {\n var _this = this;\n this.activePanels.forEach(function (panel) {\n _.removeFromParent(panel.getGui());\n _this.destroyBean(panel);\n });\n };\n SeriesPanel.prototype.destroy = function () {\n this.destroyActivePanels();\n _super.prototype.destroy.call(this);\n };\n SeriesPanel.TEMPLATE = \"
\\n \\n \\n
\";\n __decorate$_([\n RefSelector('seriesGroup')\n ], SeriesPanel.prototype, \"seriesGroup\", void 0);\n __decorate$_([\n Autowired('chartTranslationService')\n ], SeriesPanel.prototype, \"chartTranslationService\", void 0);\n __decorate$_([\n PostConstruct\n ], SeriesPanel.prototype, \"init\", null);\n return SeriesPanel;\n}(Component));\n\nvar __extends$1s = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$Z = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nfunction getMaxValue(currentValue, defaultMaxValue) {\n return Math.max(currentValue, defaultMaxValue);\n}\nvar DefaultFormatPanelDef = {\n groups: [\n { type: 'chart' },\n { type: 'legend' },\n { type: 'series' },\n { type: 'axis' },\n { type: 'navigator' },\n ]\n};\nvar FormatPanel = /** @class */ (function (_super) {\n __extends$1s(FormatPanel, _super);\n function FormatPanel(chartController, chartOptionsService) {\n var _this = _super.call(this, FormatPanel.TEMPLATE) || this;\n _this.chartController = chartController;\n _this.chartOptionsService = chartOptionsService;\n _this.panels = [];\n _this.isGroupPanelShownInSeries = function (group, seriesType) {\n var commonGroupPanels = ['chart', 'legend', 'series'];\n if (commonGroupPanels.includes(group)) {\n return true;\n }\n var cartesianOnlyGroupPanels = ['axis', 'navigator'];\n var cartesianSeries = ['bar', 'column', 'line', 'area', 'scatter', 'histogram', 'cartesian'];\n return !!(cartesianOnlyGroupPanels.includes(group) && cartesianSeries.includes(seriesType));\n };\n return _this;\n }\n FormatPanel.prototype.init = function () {\n var _this = this;\n this.createPanels();\n this.addManagedListener(this.chartController, ChartController.EVENT_CHART_UPDATED, function () { return _this.createPanels(true); });\n this.addManagedListener(this.chartController, ChartController.EVENT_CHART_API_UPDATE, function () { return _this.createPanels(false); });\n };\n FormatPanel.prototype.createPanels = function (reuse) {\n var _this = this;\n var _a;\n var chartType = this.chartController.getChartType();\n var isGrouping = this.chartController.isGrouping();\n var seriesType = getSeriesType(chartType);\n if (reuse && chartType === this.chartType && isGrouping === this.isGrouping) {\n // existing panels can be re-used\n return;\n }\n this.destroyPanels();\n (_a = this.getFormatPanelDef().groups) === null || _a === void 0 ? void 0 : _a.forEach(function (groupDef) {\n var group = groupDef.type;\n // ensure the group should be displayed for the current series type\n if (!_this.isGroupPanelShownInSeries(group, seriesType)) {\n return;\n }\n var opts = {\n chartController: _this.chartController,\n chartOptionsService: _this.chartOptionsService,\n isExpandedOnInit: groupDef.isOpen,\n seriesType: seriesType\n };\n if (group === 'chart') {\n _this.addComponent(new ChartPanel(opts));\n }\n else if (group === 'legend') {\n _this.addComponent(new LegendPanel(opts));\n }\n else if (group === 'axis') {\n _this.addComponent(new AxisPanel(opts));\n }\n else if (group === 'series') {\n _this.addComponent(new SeriesPanel(opts));\n }\n else if (group === 'navigator') {\n _this.addComponent(new NavigatorPanel(opts));\n }\n else {\n console.warn(\"AG Grid: invalid charts format panel group name supplied: '\" + groupDef.type + \"'\");\n }\n });\n this.chartType = chartType;\n this.isGrouping = isGrouping;\n };\n FormatPanel.prototype.getFormatPanelDef = function () {\n var _a;\n var userProvidedFormatPanelDef = (_a = this.gridOptionsService.get('chartToolPanelsDef')) === null || _a === void 0 ? void 0 : _a.formatPanel;\n return userProvidedFormatPanelDef ? userProvidedFormatPanelDef : DefaultFormatPanelDef;\n };\n FormatPanel.prototype.addComponent = function (component) {\n this.createBean(component);\n this.panels.push(component);\n component.addCssClass('ag-chart-format-section');\n this.getGui().appendChild(component.getGui());\n };\n FormatPanel.prototype.destroyPanels = function () {\n var _this = this;\n this.panels.forEach(function (panel) {\n _.removeFromParent(panel.getGui());\n _this.destroyBean(panel);\n });\n };\n FormatPanel.prototype.destroy = function () {\n this.destroyPanels();\n _super.prototype.destroy.call(this);\n };\n FormatPanel.TEMPLATE = \"
\";\n __decorate$Z([\n PostConstruct\n ], FormatPanel.prototype, \"init\", null);\n return FormatPanel;\n}(Component));\n\nvar __extends$1r = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$Y = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar MiniChart = /** @class */ (function (_super) {\n __extends$1r(MiniChart, _super);\n function MiniChart(container, tooltipName) {\n var _this = _super.call(this) || this;\n _this.size = 58;\n _this.padding = 5;\n _this.root = new Group();\n var scene = new Scene({ document: window.document, width: _this.size, height: _this.size });\n scene.canvas.element.classList.add('ag-chart-mini-thumbnail-canvas');\n scene.root = _this.root;\n scene.container = container;\n _this.scene = scene;\n _this.tooltipName = tooltipName;\n return _this;\n }\n MiniChart.prototype.init = function () {\n this.scene.canvas.element.title = this.chartTranslationService.translate(this.tooltipName);\n // necessary to force scene graph render as we are not using the standalone factory!\n this.scene.render()\n .catch(function (e) { return console.error(\"AG Grid - chart update failed\", e); });\n };\n __decorate$Y([\n Autowired('chartTranslationService')\n ], MiniChart.prototype, \"chartTranslationService\", void 0);\n __decorate$Y([\n PostConstruct\n ], MiniChart.prototype, \"init\", null);\n return MiniChart;\n}(Component));\n\nvar __extends$1q = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$X = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar MiniChartWithAxes = /** @class */ (function (_super) {\n __extends$1q(MiniChartWithAxes, _super);\n function MiniChartWithAxes(container, tooltipName) {\n var _this = _super.call(this, container, tooltipName) || this;\n _this.stroke = 'gray';\n _this.axisOvershoot = 3;\n return _this;\n }\n MiniChartWithAxes.prototype.addAxes = function () {\n var size = this.size;\n var padding = this.padding;\n var leftAxis = new Line();\n leftAxis.x1 = padding;\n leftAxis.y1 = padding;\n leftAxis.x2 = padding;\n leftAxis.y2 = size - padding + this.axisOvershoot;\n leftAxis.stroke = this.stroke;\n var bottomAxis = new Line();\n bottomAxis.x1 = padding - this.axisOvershoot + 1;\n bottomAxis.y1 = size - padding;\n bottomAxis.x2 = size - padding + 1;\n bottomAxis.y2 = size - padding;\n bottomAxis.stroke = this.stroke;\n var root = this.root;\n root.append(leftAxis);\n root.append(bottomAxis);\n };\n __decorate$X([\n PostConstruct\n ], MiniChartWithAxes.prototype, \"addAxes\", null);\n return MiniChartWithAxes;\n}(MiniChart));\n\nfunction createColumnRects(params) {\n var stacked = params.stacked, size = params.size, padding = params.padding, xScalePadding = params.xScalePadding, xScaleDomain = params.xScaleDomain, yScaleDomain = params.yScaleDomain;\n var xScale = new BandScale$5();\n xScale.domain = xScaleDomain;\n xScale.range = [padding, size - padding];\n xScale.paddingInner = xScalePadding;\n xScale.paddingOuter = xScalePadding;\n var yScale = new LinearScale$1();\n yScale.domain = yScaleDomain;\n yScale.range = [size - padding, padding];\n var createBars = function (series, xScale, yScale) {\n return series.map(function (datum, i) {\n var top = yScale.convert(datum);\n var rect = new Rect();\n rect.x = xScale.convert(i);\n rect.y = top;\n rect.width = xScale.bandwidth;\n rect.height = yScale.convert(0) - top;\n rect.strokeWidth = 1;\n rect.crisp = true;\n return rect;\n });\n };\n if (stacked) {\n return params.data.map(function (d) { return createBars(d, xScale, yScale); });\n }\n return createBars(params.data, xScale, yScale);\n}\nfunction createLinePaths(root, data, size, padding) {\n var xScale = new LinearScale$1();\n xScale.domain = [0, 4];\n xScale.range = [padding, size - padding];\n var yScale = new LinearScale$1();\n yScale.domain = [0, 10];\n yScale.range = [size - padding, padding];\n var lines = data.map(function (series) {\n var line = new Path();\n line.strokeWidth = 3;\n line.lineCap = 'round';\n line.fill = undefined;\n series.forEach(function (datum, i) {\n line.path[i > 0 ? 'lineTo' : 'moveTo'](xScale.convert(i), yScale.convert(datum));\n });\n return line;\n });\n var linesGroup = new Group();\n linesGroup.setClipRectInGroupCoordinateSpace(new BBox(padding, padding, size - padding * 2, size - padding * 2));\n linesGroup.append(lines);\n root.append(linesGroup);\n return lines;\n}\n\nvar __extends$1p = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar MiniColumn = /** @class */ (function (_super) {\n __extends$1p(MiniColumn, _super);\n function MiniColumn(container, fills, strokes) {\n var _this = _super.call(this, container, \"groupedColumnTooltip\") || this;\n _this.columnData = [2, 3, 4];\n var _a = _this, root = _a.root, columnData = _a.columnData, size = _a.size, padding = _a.padding;\n _this.columns = createColumnRects({\n stacked: false,\n root: root,\n data: columnData,\n size: size,\n padding: padding,\n xScaleDomain: [0, 1, 2],\n yScaleDomain: [0, 4],\n xScalePadding: 0.3\n });\n root.append(_this.columns);\n _this.updateColors(fills, strokes);\n return _this;\n }\n MiniColumn.prototype.updateColors = function (fills, strokes) {\n this.columns.forEach(function (column, i) {\n column.fill = fills[i];\n column.stroke = strokes[i];\n });\n };\n MiniColumn.chartType = 'groupedColumn';\n return MiniColumn;\n}(MiniChartWithAxes));\n\nvar __extends$1o = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar MiniStackedColumn = /** @class */ (function (_super) {\n __extends$1o(MiniStackedColumn, _super);\n function MiniStackedColumn(container, fills, strokes, data, yScaleDomain, tooltipName) {\n if (data === void 0) { data = MiniStackedColumn.data; }\n if (yScaleDomain === void 0) { yScaleDomain = [0, 16]; }\n if (tooltipName === void 0) { tooltipName = \"stackedColumnTooltip\"; }\n var _this = _super.call(this, container, tooltipName) || this;\n var _a = _this, root = _a.root, size = _a.size, padding = _a.padding;\n _this.stackedColumns = createColumnRects({\n stacked: true,\n root: root,\n data: data,\n size: size,\n padding: padding,\n xScaleDomain: [0, 1, 2],\n yScaleDomain: yScaleDomain,\n xScalePadding: 0.3,\n });\n root.append([].concat.apply([], _this.stackedColumns));\n _this.updateColors(fills, strokes);\n return _this;\n }\n MiniStackedColumn.prototype.updateColors = function (fills, strokes) {\n this.stackedColumns.forEach(function (series, i) {\n return series.forEach(function (column) {\n column.fill = fills[i];\n column.stroke = strokes[i];\n });\n });\n };\n MiniStackedColumn.chartType = 'stackedColumn';\n MiniStackedColumn.data = [\n [8, 12, 16],\n [6, 9, 12],\n [2, 3, 4]\n ];\n return MiniStackedColumn;\n}(MiniChartWithAxes));\n\nvar __extends$1n = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar MiniNormalizedColumn = /** @class */ (function (_super) {\n __extends$1n(MiniNormalizedColumn, _super);\n function MiniNormalizedColumn(container, fills, strokes) {\n return _super.call(this, container, fills, strokes, MiniNormalizedColumn.data, [0, 10], \"normalizedColumnTooltip\") || this;\n }\n MiniNormalizedColumn.chartType = 'normalizedColumn';\n MiniNormalizedColumn.data = [\n [10, 10, 10],\n [6, 7, 8],\n [2, 4, 6]\n ];\n return MiniNormalizedColumn;\n}(MiniStackedColumn));\n\nvar __extends$1m = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar MiniBar = /** @class */ (function (_super) {\n __extends$1m(MiniBar, _super);\n function MiniBar(container, fills, strokes) {\n var _this = _super.call(this, container, \"groupedBarTooltip\") || this;\n var padding = _this.padding;\n var size = _this.size;\n var data = [2, 3, 4];\n var yScale = new BandScale$5();\n yScale.domain = [0, 1, 2];\n yScale.range = [padding, size - padding];\n yScale.paddingInner = 0.3;\n yScale.paddingOuter = 0.3;\n var xScale = new LinearScale$1();\n xScale.domain = [0, 4];\n xScale.range = [size - padding, padding];\n var bottom = xScale.convert(0);\n var height = yScale.bandwidth;\n _this.bars = data.map(function (datum, i) {\n var rect = new Rect();\n rect.x = padding;\n rect.y = yScale.convert(i);\n rect.width = bottom - xScale.convert(datum);\n rect.height = height;\n rect.strokeWidth = 1;\n rect.crisp = true;\n return rect;\n });\n _this.updateColors(fills, strokes);\n _this.root.append(_this.bars);\n return _this;\n }\n MiniBar.prototype.updateColors = function (fills, strokes) {\n this.bars.forEach(function (bar, i) {\n bar.fill = fills[i];\n bar.stroke = strokes[i];\n });\n };\n MiniBar.chartType = 'groupedBar';\n return MiniBar;\n}(MiniChartWithAxes));\n\nvar __extends$1l = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar MiniStackedBar = /** @class */ (function (_super) {\n __extends$1l(MiniStackedBar, _super);\n function MiniStackedBar(container, fills, strokes, data, xScaleDomain, tooltipName) {\n if (data === void 0) { data = MiniStackedBar.data; }\n if (xScaleDomain === void 0) { xScaleDomain = [0, 16]; }\n if (tooltipName === void 0) { tooltipName = \"stackedBarTooltip\"; }\n var _this = _super.call(this, container, tooltipName) || this;\n var size = _this.size;\n var padding = _this.padding;\n var yScale = new BandScale$5();\n yScale.domain = [0, 1, 2];\n yScale.range = [padding, size - padding];\n yScale.paddingInner = 0.3;\n yScale.paddingOuter = 0.3;\n var xScale = new LinearScale$1();\n xScale.domain = xScaleDomain;\n xScale.range = [size - padding, padding];\n var bottom = xScale.convert(0);\n var height = yScale.bandwidth;\n _this.bars = data.map(function (series) {\n return series.map(function (datum, i) {\n var rect = new Rect();\n rect.x = padding;\n rect.y = yScale.convert(i);\n rect.width = bottom - xScale.convert(datum);\n rect.height = height;\n rect.strokeWidth = 1;\n rect.crisp = true;\n return rect;\n });\n });\n _this.updateColors(fills, strokes);\n _this.root.append([].concat.apply([], _this.bars));\n return _this;\n }\n MiniStackedBar.prototype.updateColors = function (fills, strokes) {\n this.bars.forEach(function (series, i) {\n return series.forEach(function (bar) {\n bar.fill = fills[i];\n bar.stroke = strokes[i];\n });\n });\n };\n MiniStackedBar.chartType = 'stackedBar';\n MiniStackedBar.data = [\n [8, 12, 16],\n [6, 9, 12],\n [2, 3, 4]\n ];\n return MiniStackedBar;\n}(MiniChartWithAxes));\n\nvar __extends$1k = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar MiniNormalizedBar = /** @class */ (function (_super) {\n __extends$1k(MiniNormalizedBar, _super);\n function MiniNormalizedBar(container, fills, strokes) {\n return _super.call(this, container, fills, strokes, MiniNormalizedBar.data, [0, 10], \"normalizedBarTooltip\") || this;\n }\n MiniNormalizedBar.chartType = 'normalizedBar';\n MiniNormalizedBar.data = [\n [10, 10, 10],\n [6, 7, 8],\n [2, 4, 6]\n ];\n return MiniNormalizedBar;\n}(MiniStackedBar));\n\nvar __extends$1j = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __read$m = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar toRadians = toRadians$1;\nvar MiniDoughnut = /** @class */ (function (_super) {\n __extends$1j(MiniDoughnut, _super);\n function MiniDoughnut(container, fills, strokes, centerRadiusScaler, tooltipName) {\n if (centerRadiusScaler === void 0) { centerRadiusScaler = 0.6; }\n if (tooltipName === void 0) { tooltipName = \"doughnutTooltip\"; }\n var _this = _super.call(this, container, tooltipName) || this;\n var radius = (_this.size - _this.padding * 2) / 2;\n var center = radius + _this.padding;\n var angles = [\n [toRadians(-90), toRadians(30)],\n [toRadians(30), toRadians(120)],\n [toRadians(120), toRadians(180)],\n [toRadians(180), toRadians(210)],\n [toRadians(210), toRadians(240)],\n [toRadians(240), toRadians(270)]\n ];\n _this.sectors = angles.map(function (_a) {\n var _b = __read$m(_a, 2), startAngle = _b[0], endAngle = _b[1];\n var sector = new Sector();\n sector.centerX = center;\n sector.centerY = center;\n sector.innerRadius = radius * centerRadiusScaler;\n sector.outerRadius = radius;\n sector.startAngle = startAngle;\n sector.endAngle = endAngle;\n sector.stroke = undefined;\n sector.strokeWidth = 1;\n return sector;\n });\n _this.updateColors(fills, strokes);\n _this.root.append(_this.sectors);\n return _this;\n }\n MiniDoughnut.prototype.updateColors = function (fills, strokes) {\n this.sectors.forEach(function (sector, i) {\n sector.fill = fills[i % fills.length];\n sector.stroke = strokes[i % strokes.length];\n });\n };\n MiniDoughnut.chartType = 'doughnut';\n return MiniDoughnut;\n}(MiniChart));\n\nvar __extends$1i = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar MiniPie = /** @class */ (function (_super) {\n __extends$1i(MiniPie, _super);\n function MiniPie(container, fills, strokes) {\n return _super.call(this, container, fills, strokes, 0, \"pieTooltip\") || this;\n }\n MiniPie.chartType = 'pie';\n return MiniPie;\n}(MiniDoughnut));\n\nvar __extends$1h = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar MiniLine = /** @class */ (function (_super) {\n __extends$1h(MiniLine, _super);\n function MiniLine(container, fills, strokes) {\n var _this = _super.call(this, container, \"lineTooltip\") || this;\n _this.data = [\n [9, 7, 8, 5, 6],\n [5, 6, 3, 4, 1],\n [1, 3, 4, 8, 7]\n ];\n _this.lines = createLinePaths(_this.root, _this.data, _this.size, _this.padding);\n _this.updateColors(fills, strokes);\n return _this;\n }\n MiniLine.prototype.updateColors = function (fills, strokes) {\n this.lines.forEach(function (line, i) {\n line.stroke = fills[i];\n });\n };\n MiniLine.chartType = 'line';\n return MiniLine;\n}(MiniChartWithAxes));\n\nvar __extends$1g = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __read$l = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar MiniScatter = /** @class */ (function (_super) {\n __extends$1g(MiniScatter, _super);\n function MiniScatter(container, fills, strokes) {\n var _this = _super.call(this, container, \"scatterTooltip\") || this;\n var size = _this.size;\n var padding = _this.padding;\n // [x, y] pairs\n var data = [\n [[0.3, 3], [1.1, 0.9], [2, 0.4], [3.4, 2.4]],\n [[0, 0.3], [1, 2], [2.4, 1.4], [3, 0]]\n ];\n var xScale = new LinearScale$1();\n xScale.domain = [-0.5, 4];\n xScale.range = [padding * 2, size - padding];\n var yScale = new LinearScale$1();\n yScale.domain = [-0.5, 3.5];\n yScale.range = [size - padding, padding];\n var points = [];\n data.forEach(function (series) {\n series.forEach(function (_a) {\n var _b = __read$l(_a, 2), x = _b[0], y = _b[1];\n var arc = new Arc();\n arc.strokeWidth = 1;\n arc.centerX = xScale.convert(x);\n arc.centerY = yScale.convert(y);\n arc.radius = 2.5;\n points.push(arc);\n });\n });\n _this.points = points;\n _this.updateColors(fills, strokes);\n var pointsGroup = new Group();\n pointsGroup.setClipRectInGroupCoordinateSpace(new BBox(padding, padding, size - padding * 2, size - padding * 2));\n pointsGroup.append(_this.points);\n _this.root.append(pointsGroup);\n return _this;\n }\n MiniScatter.prototype.updateColors = function (fills, strokes) {\n this.points.forEach(function (line, i) {\n line.stroke = strokes[i % strokes.length];\n line.fill = fills[i % fills.length];\n });\n };\n MiniScatter.chartType = 'scatter';\n return MiniScatter;\n}(MiniChartWithAxes));\n\nvar __extends$1f = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __read$k = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar MiniBubble = /** @class */ (function (_super) {\n __extends$1f(MiniBubble, _super);\n function MiniBubble(container, fills, strokes) {\n var _this = _super.call(this, container, \"bubbleTooltip\") || this;\n var size = _this.size;\n var padding = _this.padding;\n // [x, y, radius] triples\n var data = [\n [[0.1, 0.3, 5], [0.5, 0.4, 7], [0.2, 0.8, 7]], [[0.8, 0.7, 5], [0.7, 0.3, 9]]\n ];\n var xScale = new LinearScale$1();\n xScale.domain = [0, 1];\n xScale.range = [padding * 2, size - padding];\n var yScale = new LinearScale$1();\n yScale.domain = [0, 1];\n yScale.range = [size - padding, padding];\n var points = [];\n data.forEach(function (series) {\n series.forEach(function (_a) {\n var _b = __read$k(_a, 3), x = _b[0], y = _b[1], radius = _b[2];\n var arc = new Arc();\n arc.strokeWidth = 1;\n arc.centerX = xScale.convert(x);\n arc.centerY = yScale.convert(y);\n arc.radius = radius;\n arc.fillOpacity = 0.7;\n points.push(arc);\n });\n });\n _this.points = points;\n _this.updateColors(fills, strokes);\n var pointsGroup = new Group();\n pointsGroup.setClipRectInGroupCoordinateSpace(new BBox(padding, padding, size - padding * 2, size - padding * 2));\n pointsGroup.append(_this.points);\n _this.root.append(pointsGroup);\n return _this;\n }\n MiniBubble.prototype.updateColors = function (fills, strokes) {\n this.points.forEach(function (line, i) {\n line.stroke = strokes[i % strokes.length];\n line.fill = fills[i % fills.length];\n });\n };\n MiniBubble.chartType = 'bubble';\n return MiniBubble;\n}(MiniChartWithAxes));\n\nvar __extends$1e = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar MiniArea = /** @class */ (function (_super) {\n __extends$1e(MiniArea, _super);\n function MiniArea(container, fills, strokes, data) {\n if (data === void 0) { data = MiniArea.data; }\n var _this = _super.call(this, container, \"groupedAreaTooltip\") || this;\n var size = _this.size;\n var padding = _this.padding;\n var xScale = new BandScale$5();\n xScale.domain = [0, 1, 2];\n xScale.paddingInner = 1;\n xScale.paddingOuter = 0;\n xScale.range = [padding + 0.5, size - padding - 0.5];\n var yScale = new LinearScale$1();\n yScale.domain = [0, 6];\n yScale.range = [size - padding + 0.5, padding];\n var xCount = data.length;\n var last = xCount * 2 - 1;\n var pathData = [];\n var bottomY = yScale.convert(0);\n data.forEach(function (datum, i) {\n var x = xScale.convert(i);\n datum.forEach(function (yDatum, j) {\n var y = yScale.convert(yDatum);\n var points = pathData[j] || (pathData[j] = []);\n points[i] = {\n x: x,\n y: y\n };\n points[last - i] = {\n x: x,\n y: bottomY\n };\n });\n });\n _this.areas = pathData.reverse().map(function (points) {\n var area = new Path();\n area.strokeWidth = 1;\n area.fillOpacity = 0.7;\n var path = area.path;\n path.clear();\n points.forEach(function (point, i) { return path[i > 0 ? \"lineTo\" : \"moveTo\"](point.x, point.y); });\n path.closePath();\n return area;\n });\n _this.updateColors(fills, strokes);\n _this.root.append(_this.areas);\n return _this;\n }\n MiniArea.prototype.updateColors = function (fills, strokes) {\n this.areas.forEach(function (area, i) {\n area.fill = fills[i];\n area.stroke = strokes[i];\n });\n };\n MiniArea.chartType = 'area';\n MiniArea.data = [\n [1, 3, 5],\n [2, 6, 4],\n [5, 3, 1]\n ];\n return MiniArea;\n}(MiniChartWithAxes));\n\nvar __extends$1d = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar MiniStackedArea = /** @class */ (function (_super) {\n __extends$1d(MiniStackedArea, _super);\n function MiniStackedArea(container, fills, strokes, data, tooltipName) {\n if (data === void 0) { data = MiniStackedArea.data; }\n if (tooltipName === void 0) { tooltipName = \"stackedAreaTooltip\"; }\n var _this = _super.call(this, container, tooltipName) || this;\n var size = _this.size;\n var padding = _this.padding;\n var xScale = new BandScale$5();\n xScale.domain = [0, 1, 2];\n xScale.paddingInner = 1;\n xScale.paddingOuter = 0;\n xScale.range = [padding + 0.5, size - padding - 0.5];\n var yScale = new LinearScale$1();\n yScale.domain = [0, 16];\n yScale.range = [size - padding + 0.5, padding + 0.5];\n var xCount = data.length;\n var last = xCount * 2 - 1;\n var pathData = [];\n data.forEach(function (datum, i) {\n var x = xScale.convert(i);\n var total = 0;\n datum.forEach(function (yDatum, j) {\n var y = yScale.convert(total + yDatum);\n var points = pathData[j] || (pathData[j] = []);\n points[i] = {\n x: x,\n y: y\n };\n points[last - i] = {\n x: x,\n y: yScale.convert(total) // bottom y\n };\n total += yDatum;\n });\n });\n _this.areas = pathData.map(function (points) {\n var area = new Path();\n area.strokeWidth = 1;\n var path = area.path;\n path.clear();\n points.forEach(function (point, i) { return path[i > 0 ? \"lineTo\" : \"moveTo\"](point.x, point.y); });\n path.closePath();\n return area;\n });\n _this.updateColors(fills, strokes);\n _this.root.append(_this.areas);\n return _this;\n }\n MiniStackedArea.prototype.updateColors = function (fills, strokes) {\n this.areas.forEach(function (area, i) {\n area.fill = fills[i];\n area.stroke = strokes[i];\n });\n };\n MiniStackedArea.chartType = 'stackedArea';\n MiniStackedArea.data = [\n [2, 3, 2],\n [3, 6, 5],\n [6, 2, 2]\n ];\n return MiniStackedArea;\n}(MiniChartWithAxes));\n\nvar __extends$1c = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar MiniNormalizedArea = /** @class */ (function (_super) {\n __extends$1c(MiniNormalizedArea, _super);\n function MiniNormalizedArea(container, fills, strokes, data) {\n if (data === void 0) { data = MiniNormalizedArea.data; }\n return _super.call(this, container, fills, strokes, data, \"normalizedAreaTooltip\") || this;\n }\n MiniNormalizedArea.chartType = 'normalizedArea';\n MiniNormalizedArea.data = MiniStackedArea.data.map(function (stack) {\n var sum = stack.reduce(function (p, c) { return p + c; }, 0);\n return stack.map(function (v) { return v / sum * 16; });\n });\n return MiniNormalizedArea;\n}(MiniStackedArea));\n\nvar __extends$1b = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __read$j = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar MiniHistogram = /** @class */ (function (_super) {\n __extends$1b(MiniHistogram, _super);\n function MiniHistogram(container, fills, strokes) {\n var _this = _super.call(this, container, \"histogramTooltip\") || this;\n var padding = _this.padding;\n var size = _this.size;\n // approx normal curve\n var data = [2, 5, 11, 13, 10, 6, 1];\n var xScale = new LinearScale$1();\n xScale.domain = [0, data.length];\n xScale.range = [padding, size - padding];\n var yScale = new LinearScale$1();\n yScale.domain = [0, data.reduce(function (a, b) { return Math.max(a, b); }, 0)];\n yScale.range = [size - padding, padding];\n var bottom = yScale.convert(0);\n _this.bars = data.map(function (datum, i) {\n var top = yScale.convert(datum);\n var left = xScale.convert(i);\n var right = xScale.convert(i + 1);\n var rect = new Rect();\n rect.x = left;\n rect.y = top;\n rect.width = right - left;\n rect.height = bottom - top;\n rect.strokeWidth = 1;\n rect.crisp = true;\n return rect;\n });\n _this.updateColors(fills, strokes);\n _this.root.append(_this.bars);\n return _this;\n }\n MiniHistogram.prototype.updateColors = function (_a, _b) {\n var _c = __read$j(_a, 1), fill = _c[0];\n var _d = __read$j(_b, 1), stroke = _d[0];\n this.bars.forEach(function (bar) {\n bar.fill = fill;\n bar.stroke = stroke;\n });\n };\n MiniHistogram.chartType = 'histogram';\n return MiniHistogram;\n}(MiniChartWithAxes));\n\nvar __extends$1a = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar MiniColumnLineCombo = /** @class */ (function (_super) {\n __extends$1a(MiniColumnLineCombo, _super);\n function MiniColumnLineCombo(container, fills, strokes) {\n var _this = _super.call(this, container, \"columnLineComboTooltip\") || this;\n _this.columnData = [3, 4];\n _this.lineData = [\n [5, 4, 6, 5, 4]\n ];\n var _a = _this, root = _a.root, columnData = _a.columnData, lineData = _a.lineData, size = _a.size, padding = _a.padding;\n _this.columns = createColumnRects({\n stacked: false,\n root: root,\n data: columnData,\n size: size,\n padding: padding,\n xScaleDomain: [0, 1],\n yScaleDomain: [0, 4],\n xScalePadding: 0.5\n });\n root.append(_this.columns);\n _this.lines = createLinePaths(root, lineData, size, padding);\n _this.updateColors(fills, strokes);\n return _this;\n }\n MiniColumnLineCombo.prototype.updateColors = function (fills, strokes) {\n this.columns.forEach(function (bar, i) {\n bar.fill = fills[i];\n bar.stroke = strokes[i];\n });\n this.lines.forEach(function (line, i) {\n line.stroke = fills[i + 2];\n });\n };\n MiniColumnLineCombo.chartType = 'columnLineCombo';\n return MiniColumnLineCombo;\n}(MiniChartWithAxes));\n\nvar __extends$19 = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar MiniAreaColumnCombo = /** @class */ (function (_super) {\n __extends$19(MiniAreaColumnCombo, _super);\n function MiniAreaColumnCombo(container, fills, strokes) {\n var _this = _super.call(this, container, \"areaColumnComboTooltip\") || this;\n _this.columnData = [3, 4.5];\n _this.areaData = [\n [5, 4, 6, 5, 4],\n ];\n var _a = _this, root = _a.root, columnData = _a.columnData, areaData = _a.areaData, size = _a.size, padding = _a.padding;\n _this.columns = createColumnRects({\n stacked: false,\n root: root,\n data: columnData,\n size: size,\n padding: padding,\n xScaleDomain: [0, 1],\n yScaleDomain: [0, 6],\n xScalePadding: 0.5,\n });\n // scale for area series\n var xScale = new BandScale$5();\n xScale.range = [padding, size - padding];\n xScale.domain = [0, 1, 2, 3, 4];\n xScale.paddingInner = 1;\n xScale.paddingOuter = 0;\n var yScale = new LinearScale$1();\n yScale.range = [size - padding, padding];\n yScale.domain = [0, 6];\n var pathData = [];\n var yZero = yScale.convert(0);\n var firstX = xScale.convert(0);\n areaData.forEach(function (series, i) {\n var points = pathData[i] || (pathData[i] = []);\n series.forEach(function (data, j) {\n var yDatum = data;\n var xDatum = j;\n var x = xScale.convert(xDatum);\n var y = yScale.convert(yDatum);\n points[j] = { x: x, y: y };\n });\n var lastX = xScale.convert(series.length - 1);\n pathData[i].push({\n x: lastX,\n y: yZero\n }, {\n x: firstX,\n y: yZero\n });\n });\n _this.areas = pathData.map(function (points) {\n var area = new Path();\n area.strokeWidth = 1;\n area.fillOpacity = 0.8;\n var path = area.path;\n points.forEach(function (point, i) { return path[i > 0 ? 'lineTo' : 'moveTo'](point.x, point.y); });\n return area;\n });\n root.append(_this.areas);\n root.append([].concat.apply([], _this.columns));\n _this.updateColors(fills, strokes);\n return _this;\n }\n MiniAreaColumnCombo.prototype.updateColors = function (fills, strokes) {\n this.areas.forEach(function (area, i) {\n area.fill = fills[i];\n area.stroke = strokes[i];\n });\n this.columns.forEach(function (bar, i) {\n bar.fill = fills[i + 1];\n bar.stroke = strokes[i + 1];\n });\n };\n MiniAreaColumnCombo.chartType = 'areaColumnCombo';\n return MiniAreaColumnCombo;\n}(MiniChartWithAxes));\n\nvar __extends$18 = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar MiniCustomCombo = /** @class */ (function (_super) {\n __extends$18(MiniCustomCombo, _super);\n function MiniCustomCombo(container, fills, strokes) {\n var _this = _super.call(this, container, 'customComboTooltip') || this;\n _this.columnData = [3, 4];\n _this.lineData = [[5, 4, 6, 5, 4]];\n var _a = _this, root = _a.root, columnData = _a.columnData, lineData = _a.lineData, size = _a.size, padding = _a.padding;\n _this.columns = createColumnRects({\n stacked: false,\n root: root,\n data: columnData,\n size: size,\n padding: padding,\n xScaleDomain: [0, 1],\n yScaleDomain: [0, 4],\n xScalePadding: 0.5,\n });\n root.append(_this.columns);\n _this.lines = createLinePaths(root, lineData, size, padding);\n var axisStroke = 'grey';\n var axisOvershoot = 3;\n var leftAxis = new Line();\n leftAxis.x1 = padding;\n leftAxis.y1 = padding;\n leftAxis.x2 = padding;\n leftAxis.y2 = size - padding + axisOvershoot;\n leftAxis.stroke = axisStroke;\n var bottomAxis = new Line();\n bottomAxis.x1 = padding - axisOvershoot + 1;\n bottomAxis.y1 = size - padding;\n bottomAxis.x2 = size - padding + 1;\n bottomAxis.y2 = size - padding;\n bottomAxis.stroke = axisStroke;\n var penIcon = new Path();\n _this.buildPenIconPath(penIcon);\n penIcon.fill = 'whitesmoke';\n penIcon.stroke = 'darkslategrey';\n penIcon.strokeWidth = 1;\n root.append([bottomAxis, leftAxis, penIcon]);\n _this.updateColors(fills, strokes);\n return _this;\n }\n MiniCustomCombo.prototype.updateColors = function (fills, strokes) {\n this.columns.forEach(function (bar, i) {\n bar.fill = fills[i];\n bar.stroke = strokes[i];\n });\n this.lines.forEach(function (line, i) {\n line.stroke = fills[i + 2];\n });\n };\n MiniCustomCombo.prototype.buildPenIconPath = function (penIcon) {\n var path = penIcon.path;\n path.moveTo(25.76, 43.46);\n path.lineTo(31.27, 48.53);\n path.moveTo(49.86, 22);\n path.lineTo(49.86, 22);\n path.cubicCurveTo(49.01994659053345, 21.317514933510974, 47.89593834348529, 21.09645997825817, 46.86, 21.41);\n path.lineTo(46.86, 21.41);\n path.cubicCurveTo(45.55460035985361, 21.77260167850787, 44.38777081121966, 22.517979360321792, 43.51, 23.55);\n path.lineTo(25.51, 43.8);\n path.lineTo(25.43, 43.89);\n path.lineTo(23.01, 51.89);\n path.lineTo(22.83, 52.46);\n path.lineTo(31.02, 48.86);\n path.lineTo(49.02, 28.52);\n path.lineTo(49.02, 28.52);\n path.cubicCurveTo(49.940716461596224, 27.521914221246085, 50.54302631059587, 26.2720342455763, 50.75, 24.93);\n path.lineTo(50.75, 24.93);\n path.cubicCurveTo(50.95363374988308, 23.866379846512814, 50.62080640232334, 22.77066734274871, 49.86, 22.0);\n path.closePath();\n path.moveTo(41.76, 25.5);\n path.lineTo(47.34, 30.5);\n path.moveTo(40.74, 26.65);\n path.lineTo(46.25, 31.71);\n };\n MiniCustomCombo.chartType = 'customCombo';\n return MiniCustomCombo;\n}(MiniChart));\n\nvar __extends$17 = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign$m = (undefined && undefined.__assign) || function () {\n __assign$m = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$m.apply(this, arguments);\n};\nvar __decorate$W = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar miniChartMapping = {\n columnGroup: {\n column: MiniColumn,\n stackedColumn: MiniStackedColumn,\n normalizedColumn: MiniNormalizedColumn\n },\n barGroup: {\n bar: MiniBar,\n stackedBar: MiniStackedBar,\n normalizedBar: MiniNormalizedBar\n },\n pieGroup: {\n pie: MiniPie,\n doughnut: MiniDoughnut\n },\n lineGroup: {\n line: MiniLine\n },\n scatterGroup: {\n scatter: MiniScatter,\n bubble: MiniBubble\n },\n areaGroup: {\n area: MiniArea,\n stackedArea: MiniStackedArea,\n normalizedArea: MiniNormalizedArea\n },\n histogramGroup: {\n histogram: MiniHistogram\n },\n combinationGroup: {\n columnLineCombo: MiniColumnLineCombo,\n areaColumnCombo: MiniAreaColumnCombo,\n customCombo: MiniCustomCombo\n }\n};\nvar MiniChartsContainer = /** @class */ (function (_super) {\n __extends$17(MiniChartsContainer, _super);\n function MiniChartsContainer(chartController, fills, strokes, chartGroups) {\n if (chartGroups === void 0) { chartGroups = DEFAULT_CHART_GROUPS; }\n var _this = _super.call(this, MiniChartsContainer.TEMPLATE) || this;\n _this.wrappers = {};\n _this.chartController = chartController;\n _this.fills = fills;\n _this.strokes = strokes;\n _this.chartGroups = __assign$m({}, chartGroups);\n return _this;\n }\n MiniChartsContainer.prototype.init = function () {\n var _this = this;\n // hide MiniCustomCombo if no custom combo exists\n if (!this.chartController.customComboExists() && this.chartGroups.combinationGroup) {\n this.chartGroups.combinationGroup = this.chartGroups.combinationGroup.filter(function (chartType) { return chartType !== 'customCombo'; });\n }\n var eGui = this.getGui();\n Object.keys(this.chartGroups).forEach(function (group) {\n var chartGroupValues = _this.chartGroups[group];\n var groupComponent = _this.createBean(new AgGroupComponent({\n title: _this.chartTranslationService.translate(group),\n suppressEnabledCheckbox: true,\n enabled: true,\n suppressOpenCloseIcons: true,\n cssIdentifier: 'charts-settings',\n direction: 'horizontal'\n }));\n chartGroupValues.forEach(function (chartType) {\n var _a;\n var MiniClass = (_a = miniChartMapping[group]) === null || _a === void 0 ? void 0 : _a[chartType];\n if (!MiniClass) {\n if (miniChartMapping[group]) {\n _.doOnce(function () { return console.warn(\"AG Grid - invalid chartGroupsDef config '\" + group + \".\" + chartType + \"'\"); }, \"invalid_chartGroupsDef\" + chartType + \"_\" + group);\n }\n else {\n _.doOnce(function () { return console.warn(\"AG Grid - invalid chartGroupsDef config '\" + group + \"'\"); }, \"invalid_chartGroupsDef\" + group);\n }\n return;\n }\n var miniWrapper = document.createElement('div');\n miniWrapper.classList.add('ag-chart-mini-thumbnail');\n var miniClassChartType = MiniClass.chartType;\n _this.addManagedListener(miniWrapper, 'click', function () {\n _this.chartController.setChartType(miniClassChartType);\n _this.updateSelectedMiniChart();\n });\n _this.wrappers[miniClassChartType] = miniWrapper;\n _this.createBean(new MiniClass(miniWrapper, _this.fills, _this.strokes));\n groupComponent.addItem(miniWrapper);\n });\n eGui.appendChild(groupComponent.getGui());\n });\n this.updateSelectedMiniChart();\n };\n MiniChartsContainer.prototype.updateSelectedMiniChart = function () {\n var selectedChartType = this.chartController.getChartType();\n for (var miniChartType in this.wrappers) {\n var miniChart = this.wrappers[miniChartType];\n var selected = miniChartType === selectedChartType;\n miniChart.classList.toggle('ag-selected', selected);\n }\n };\n MiniChartsContainer.TEMPLATE = \"
\";\n __decorate$W([\n Autowired('chartTranslationService')\n ], MiniChartsContainer.prototype, \"chartTranslationService\", void 0);\n __decorate$W([\n PostConstruct\n ], MiniChartsContainer.prototype, \"init\", null);\n return MiniChartsContainer;\n}(Component));\n\nvar __extends$16 = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$V = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar ChartSettingsPanel = /** @class */ (function (_super) {\n __extends$16(ChartSettingsPanel, _super);\n function ChartSettingsPanel(chartController) {\n var _this = _super.call(this, ChartSettingsPanel.TEMPLATE) || this;\n _this.miniChartsContainers = [];\n _this.cardItems = [];\n _this.activePaletteIndex = 0;\n _this.palettes = [];\n _this.themes = [];\n _this.chartController = chartController;\n return _this;\n }\n ChartSettingsPanel.prototype.postConstruct = function () {\n var _this = this;\n this.resetPalettes();\n this.ePrevBtn.insertAdjacentElement('afterbegin', _.createIconNoSpan('previous', this.gridOptionsService));\n this.eNextBtn.insertAdjacentElement('afterbegin', _.createIconNoSpan('next', this.gridOptionsService));\n this.addManagedListener(this.ePrevBtn, 'click', function () { return _this.setActivePalette(_this.getPrev(), 'left'); });\n this.addManagedListener(this.eNextBtn, 'click', function () { return _this.setActivePalette(_this.getNext(), 'right'); });\n // change the selected chart when a combo chart is modified via the data panel, i.e. the custom combo should be selected\n this.addManagedListener(this.chartController, ChartController.EVENT_CHART_TYPE_CHANGED, function () { return _this.resetPalettes(true); });\n this.addManagedListener(this.chartController, ChartController.EVENT_CHART_API_UPDATE, function () { return _this.resetPalettes(true); });\n this.scrollSelectedIntoView();\n };\n ChartSettingsPanel.prototype.scrollSelectedIntoView = function () {\n var _this = this;\n // the panel is not immediately visible due to the slide animation, so we add a\n // setTimeout to wait until the panel animation is over and is able to scroll\n setTimeout(function () {\n var isMiniChartsContainerVisible = function (miniChartsContainers) {\n return !miniChartsContainers.getGui().classList.contains('ag-hidden');\n };\n var currentMiniChartContainer = _this.miniChartsContainers.find(isMiniChartsContainerVisible);\n var currentChart = currentMiniChartContainer.getGui().querySelector('.ag-selected');\n if (currentChart) {\n var parent_1 = currentChart.offsetParent;\n if (parent_1) {\n _this.eMiniChartsContainer.scrollTo(0, parent_1.offsetTop);\n }\n }\n }, 250);\n };\n ChartSettingsPanel.prototype.resetPalettes = function (forceReset) {\n var _this = this;\n var _a, _b;\n var palettes = this.chartController.getPalettes();\n var chartGroups = (_b = (_a = this.gridOptionsService.get('chartToolPanelsDef')) === null || _a === void 0 ? void 0 : _a.settingsPanel) === null || _b === void 0 ? void 0 : _b.chartGroupsDef;\n if ((_.shallowCompare(palettes, this.palettes) && !forceReset) || this.isAnimating) {\n return;\n }\n this.palettes = palettes;\n this.themes = this.chartController.getThemes();\n this.activePaletteIndex = this.themes.findIndex(function (name) { return name === _this.chartController.getChartThemeName(); });\n this.cardItems = [];\n _.clearElement(this.eCardSelector);\n this.destroyMiniCharts();\n this.palettes.forEach(function (palette, index) {\n var isActivePalette = _this.activePaletteIndex === index;\n var fills = palette.fills, strokes = palette.strokes;\n var miniChartsContainer = _this.createBean(new MiniChartsContainer(_this.chartController, fills, strokes, chartGroups));\n _this.miniChartsContainers.push(miniChartsContainer);\n _this.eMiniChartsContainer.appendChild(miniChartsContainer.getGui());\n _this.addCardLink(index);\n if (isActivePalette) {\n miniChartsContainer.updateSelectedMiniChart();\n }\n else {\n miniChartsContainer.setDisplayed(false);\n }\n });\n _.setDisplayed(this.eNavBar, this.palettes.length > 1);\n _.radioCssClass(this.cardItems[this.activePaletteIndex], 'ag-selected', 'ag-not-selected');\n };\n ChartSettingsPanel.prototype.addCardLink = function (index) {\n var _this = this;\n var link = document.createElement('div');\n link.classList.add('ag-chart-settings-card-item');\n this.addManagedListener(link, 'click', function () {\n _this.setActivePalette(index, index < _this.activePaletteIndex ? 'left' : 'right');\n });\n this.eCardSelector.appendChild(link);\n this.cardItems.push(link);\n };\n ChartSettingsPanel.prototype.getPrev = function () {\n var prev = this.activePaletteIndex - 1;\n if (prev < 0) {\n prev = this.palettes.length - 1;\n }\n return prev;\n };\n ChartSettingsPanel.prototype.getNext = function () {\n var next = this.activePaletteIndex + 1;\n if (next >= this.palettes.length) {\n next = 0;\n }\n return next;\n };\n ChartSettingsPanel.prototype.setActivePalette = function (index, animationDirection) {\n var _this = this;\n if (this.isAnimating || this.activePaletteIndex === index) {\n return;\n }\n _.radioCssClass(this.cardItems[index], 'ag-selected', 'ag-not-selected');\n var currentPalette = this.miniChartsContainers[this.activePaletteIndex];\n var currentGui = currentPalette.getGui();\n var futurePalette = this.miniChartsContainers[index];\n var nextGui = futurePalette.getGui();\n currentPalette.updateSelectedMiniChart();\n futurePalette.updateSelectedMiniChart();\n var multiplier = animationDirection === 'left' ? -1 : 1;\n var final = nextGui.style.left = (_.getAbsoluteWidth(this.getGui()) * multiplier) + \"px\";\n this.activePaletteIndex = index;\n this.isAnimating = true;\n var animatingClass = 'ag-animating';\n futurePalette.setDisplayed(true);\n currentPalette.addCssClass(animatingClass);\n futurePalette.addCssClass(animatingClass);\n this.chartController.setChartThemeName(this.themes[index]);\n window.setTimeout(function () {\n currentGui.style.left = -parseFloat(final) + \"px\";\n nextGui.style.left = '0px';\n }, 0);\n window.setTimeout(function () {\n _this.isAnimating = false;\n currentPalette.removeCssClass(animatingClass);\n futurePalette.removeCssClass(animatingClass);\n currentPalette.setDisplayed(false);\n }, 300);\n };\n ChartSettingsPanel.prototype.destroyMiniCharts = function () {\n _.clearElement(this.eMiniChartsContainer);\n this.miniChartsContainers = this.destroyBeans(this.miniChartsContainers);\n };\n ChartSettingsPanel.prototype.destroy = function () {\n this.destroyMiniCharts();\n _super.prototype.destroy.call(this);\n };\n ChartSettingsPanel.TEMPLATE = \"
\\n
\\n
\\n
\\n \\n
\\n
\\n
\\n \\n
\\n
\\n
\";\n __decorate$V([\n Autowired('resizeObserverService')\n ], ChartSettingsPanel.prototype, \"resizeObserverService\", void 0);\n __decorate$V([\n RefSelector('eMiniChartsContainer')\n ], ChartSettingsPanel.prototype, \"eMiniChartsContainer\", void 0);\n __decorate$V([\n RefSelector('eNavBar')\n ], ChartSettingsPanel.prototype, \"eNavBar\", void 0);\n __decorate$V([\n RefSelector('eCardSelector')\n ], ChartSettingsPanel.prototype, \"eCardSelector\", void 0);\n __decorate$V([\n RefSelector('ePrevBtn')\n ], ChartSettingsPanel.prototype, \"ePrevBtn\", void 0);\n __decorate$V([\n RefSelector('eNextBtn')\n ], ChartSettingsPanel.prototype, \"eNextBtn\", void 0);\n __decorate$V([\n PostConstruct\n ], ChartSettingsPanel.prototype, \"postConstruct\", null);\n return ChartSettingsPanel;\n}(Component));\n\nvar __extends$15 = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$U = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar TabbedChartMenu = /** @class */ (function (_super) {\n __extends$15(TabbedChartMenu, _super);\n function TabbedChartMenu(params) {\n var _this = _super.call(this) || this;\n _this.tabs = [];\n var controller = params.controller, panels = params.panels, chartOptionsService = params.chartOptionsService;\n _this.chartController = controller;\n _this.chartOptionsService = chartOptionsService;\n _this.panels = panels;\n return _this;\n }\n TabbedChartMenu.prototype.init = function () {\n var _this = this;\n this.panels.forEach(function (panel) {\n var panelType = panel.replace('chart', '').toLowerCase();\n var _a = _this.createTab(panel, panelType, _this.getPanelClass(panelType)), comp = _a.comp, tab = _a.tab;\n _this.tabs.push(tab);\n _this.addDestroyFunc(function () { return _this.destroyBean(comp); });\n });\n this.tabbedLayout = new TabbedLayout({\n items: this.tabs,\n cssClass: 'ag-chart-tabbed-menu',\n keepScrollPosition: true\n });\n this.getContext().createBean(this.tabbedLayout);\n };\n TabbedChartMenu.prototype.createTab = function (name, title, TabPanelClass) {\n var eWrapperDiv = document.createElement('div');\n eWrapperDiv.classList.add('ag-chart-tab', \"ag-chart-\" + title);\n var comp = new TabPanelClass(this.chartController, this.chartOptionsService);\n this.getContext().createBean(comp);\n eWrapperDiv.appendChild(comp.getGui());\n var titleEl = document.createElement('div');\n var translatedTitle = this.chartTranslationService.translate(title);\n titleEl.innerText = translatedTitle;\n return {\n comp: comp,\n tab: {\n title: titleEl,\n titleLabel: translatedTitle,\n bodyPromise: AgPromise.resolve(eWrapperDiv),\n getScrollableContainer: function () {\n var scrollableContainer = eWrapperDiv.querySelector('.ag-scrollable-container');\n return (scrollableContainer || eWrapperDiv);\n },\n name: name\n }\n };\n };\n TabbedChartMenu.prototype.showTab = function (tab) {\n var tabItem = this.tabs[tab];\n this.tabbedLayout.showItem(tabItem);\n };\n TabbedChartMenu.prototype.getGui = function () {\n return this.tabbedLayout && this.tabbedLayout.getGui();\n };\n TabbedChartMenu.prototype.destroy = function () {\n if (this.parentComponent && this.parentComponent.isAlive()) {\n this.destroyBean(this.parentComponent);\n }\n _super.prototype.destroy.call(this);\n };\n TabbedChartMenu.prototype.getPanelClass = function (panelType) {\n switch (panelType) {\n case TabbedChartMenu.TAB_DATA:\n return ChartDataPanel;\n case TabbedChartMenu.TAB_FORMAT:\n return FormatPanel;\n default:\n return ChartSettingsPanel;\n }\n };\n TabbedChartMenu.TAB_DATA = 'data';\n TabbedChartMenu.TAB_FORMAT = 'format';\n __decorate$U([\n Autowired('chartTranslationService')\n ], TabbedChartMenu.prototype, \"chartTranslationService\", void 0);\n __decorate$U([\n PostConstruct\n ], TabbedChartMenu.prototype, \"init\", null);\n return TabbedChartMenu;\n}(Component));\n\nvar __extends$14 = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$T = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __read$i = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray$a = (undefined && undefined.__spreadArray) || function (to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\n to[j] = from[i];\n return to;\n};\nvar ChartMenu = /** @class */ (function (_super) {\n __extends$14(ChartMenu, _super);\n function ChartMenu(eChartContainer, eMenuPanelContainer, chartController, chartOptionsService) {\n var _this = _super.call(this, ChartMenu.TEMPLATE) || this;\n _this.eChartContainer = eChartContainer;\n _this.eMenuPanelContainer = eMenuPanelContainer;\n _this.chartController = chartController;\n _this.chartOptionsService = chartOptionsService;\n _this.buttons = {\n chartSettings: ['menu', function () { return _this.showMenu(_this.defaultPanel); }],\n chartData: ['menu', function () { return _this.showMenu(\"chartData\"); }],\n chartFormat: ['menu', function () { return _this.showMenu(\"chartFormat\"); }],\n chartLink: ['linked', function (e) { return _this.toggleDetached(e); }],\n chartUnlink: ['unlinked', function (e) { return _this.toggleDetached(e); }],\n chartDownload: ['save', function () { return _this.saveChart(); }]\n };\n _this.panels = [];\n _this.buttonListenersDestroyFuncs = [];\n _this.menuVisible = false;\n return _this;\n }\n ChartMenu.prototype.postConstruct = function () {\n var _this = this;\n this.createButtons();\n this.addManagedListener(this.eventService, Events.EVENT_CHART_CREATED, function (e) {\n var _a;\n if (e.chartId === _this.chartController.getChartId()) {\n var showDefaultToolPanel = Boolean((_a = _this.gridOptionsService.get('chartToolPanelsDef')) === null || _a === void 0 ? void 0 : _a.defaultToolPanel);\n if (showDefaultToolPanel) {\n _this.showMenu(_this.defaultPanel, false);\n }\n }\n });\n this.refreshMenuClasses();\n if (!this.gridOptionsService.is('suppressChartToolPanelsButton') && this.panels.length > 0) {\n this.getGui().classList.add('ag-chart-tool-panel-button-enable');\n this.addManagedListener(this.eHideButton, 'click', this.toggleMenu.bind(this));\n }\n this.addManagedListener(this.chartController, ChartController.EVENT_CHART_API_UPDATE, this.createButtons.bind(this));\n };\n ChartMenu.prototype.isVisible = function () {\n return this.menuVisible;\n };\n ChartMenu.prototype.getExtraPaddingDirections = function () {\n var _this = this;\n var topItems = ['chartLink', 'chartUnlink', 'chartDownload'];\n var rightItems = ['chartSettings', 'chartData', 'chartFormat'];\n var result = [];\n if (topItems.some(function (v) { return _this.chartToolbarOptions.includes(v); })) {\n result.push('top');\n }\n if (rightItems.some(function (v) { return _this.chartToolbarOptions.includes(v); })) {\n result.push(this.gridOptionsService.is('enableRtl') ? 'left' : 'right');\n }\n return result;\n };\n ChartMenu.prototype.getToolbarOptions = function () {\n var _this = this;\n var _a, _b, _c;\n var useChartToolPanelCustomisation = Boolean(this.gridOptionsService.get('chartToolPanelsDef'));\n if (useChartToolPanelCustomisation) {\n var defaultChartToolbarOptions = [\n this.chartController.isChartLinked() ? 'chartLink' : 'chartUnlink',\n 'chartDownload'\n ];\n var toolbarItemsFunc = this.gridOptionsService.getCallback('getChartToolbarItems');\n var params = {\n defaultItems: defaultChartToolbarOptions\n };\n var chartToolbarOptions = toolbarItemsFunc\n ? toolbarItemsFunc(params).filter(function (option) {\n if (!CHART_TOOLBAR_ALLOW_LIST.includes(option)) {\n var msg = CHART_TOOL_PANEL_ALLOW_LIST.includes(option)\n ? \"AG Grid: '\" + option + \"' is a Chart Tool Panel option and will be ignored since 'chartToolPanelsDef' is used. Please use 'chartToolPanelsDef.panels' grid option instead\"\n : \"AG Grid: '\" + option + \"' is not a valid Chart Toolbar Option\";\n console.warn(msg);\n return false;\n }\n return true;\n })\n : defaultChartToolbarOptions;\n var panelsOverride = (_b = (_a = this.gridOptionsService.get('chartToolPanelsDef')) === null || _a === void 0 ? void 0 : _a.panels) === null || _b === void 0 ? void 0 : _b.map(function (panel) {\n var menuOption = CHART_TOOL_PANEL_MENU_OPTIONS[panel];\n if (!menuOption) {\n console.warn(\"AG Grid - invalid panel in chartToolPanelsDef.panels: '\" + panel + \"'\");\n }\n return menuOption;\n }).filter(function (panel) { return Boolean(panel); });\n this.panels = panelsOverride\n ? panelsOverride\n : Object.values(CHART_TOOL_PANEL_MENU_OPTIONS);\n // pivot charts use the column tool panel instead of the data panel\n if (this.chartController.isPivotChart()) {\n this.panels = this.panels.filter(function (panel) { return panel !== 'chartData'; });\n }\n var defaultToolPanel = (_c = this.gridOptionsService.get('chartToolPanelsDef')) === null || _c === void 0 ? void 0 : _c.defaultToolPanel;\n this.defaultPanel = (defaultToolPanel && CHART_TOOL_PANEL_MENU_OPTIONS[defaultToolPanel]) || this.panels[0];\n return this.panels.length > 0\n // Only one panel is required to display menu icon in toolbar\n ? __spreadArray$a([this.panels[0]], __read$i(chartToolbarOptions)) : chartToolbarOptions;\n }\n else { // To be deprecated in future. Toolbar options will be different to chart tool panels.\n var tabOptions = [\n 'chartSettings',\n 'chartData',\n 'chartFormat',\n this.chartController.isChartLinked() ? 'chartLink' : 'chartUnlink',\n 'chartDownload'\n ];\n var toolbarItemsFunc = this.gridOptionsService.getCallback('getChartToolbarItems');\n if (toolbarItemsFunc) {\n var isLegacyToolbar_1 = this.gridOptionsService.is('suppressChartToolPanelsButton');\n var params = {\n defaultItems: isLegacyToolbar_1 ? tabOptions : CHART_TOOLBAR_ALLOW_LIST\n };\n tabOptions = toolbarItemsFunc(params).filter(function (option) {\n if (!_this.buttons[option]) {\n console.warn(\"AG Grid: '\" + option + \"' is not a valid Chart Toolbar Option\");\n return false;\n }\n // If not legacy, remove chart tool panel options here,\n // and add them all in one go below\n else if (!isLegacyToolbar_1 && CHART_TOOL_PANEL_ALLOW_LIST.includes(option)) {\n var msg = \"AG Grid: '\" + option + \"' is a Chart Tool Panel option and will be ignored. Please use 'chartToolPanelsDef.panels' grid option instead\";\n console.warn(msg);\n return false;\n }\n return true;\n });\n if (!isLegacyToolbar_1) {\n // Add all the chart tool panels, as `chartToolPanelsDef.panels`\n // should be used for configuration\n tabOptions = tabOptions.concat(CHART_TOOL_PANEL_ALLOW_LIST);\n }\n }\n // pivot charts use the column tool panel instead of the data panel\n if (this.chartController.isPivotChart()) {\n tabOptions = tabOptions.filter(function (option) { return option !== 'chartData'; });\n }\n var ignoreOptions_1 = ['chartUnlink', 'chartLink', 'chartDownload'];\n this.panels = tabOptions.filter(function (option) { return ignoreOptions_1.indexOf(option) === -1; });\n this.defaultPanel = this.panels[0];\n return tabOptions.filter(function (value) {\n return ignoreOptions_1.indexOf(value) !== -1 ||\n (_this.panels.length && value === _this.panels[0]);\n });\n }\n };\n ChartMenu.prototype.toggleDetached = function (e) {\n var target = e.target;\n var active = target.classList.contains('ag-icon-linked');\n target.classList.toggle('ag-icon-linked', !active);\n target.classList.toggle('ag-icon-unlinked', active);\n var tooltipKey = active ? 'chartUnlinkToolbarTooltip' : 'chartLinkToolbarTooltip';\n var tooltipTitle = this.chartTranslationService.translate(tooltipKey);\n if (tooltipTitle) {\n target.title = tooltipTitle;\n }\n this.chartController.detachChartRange();\n };\n ChartMenu.prototype.createButtons = function () {\n var _this = this;\n this.buttonListenersDestroyFuncs.forEach(function (func) { return func(); });\n this.buttonListenersDestroyFuncs = [];\n this.chartToolbarOptions = this.getToolbarOptions();\n var menuEl = this.eMenu;\n _.clearElement(menuEl);\n this.chartToolbarOptions.forEach(function (button) {\n var buttonConfig = _this.buttons[button];\n var _a = __read$i(buttonConfig, 2), iconName = _a[0], callback = _a[1];\n var buttonEl = _.createIconNoSpan(iconName, _this.gridOptionsService, undefined, true);\n buttonEl.classList.add('ag-chart-menu-icon');\n var tooltipTitle = _this.chartTranslationService.translate(button + 'ToolbarTooltip');\n if (tooltipTitle && buttonEl instanceof HTMLElement) {\n buttonEl.title = tooltipTitle;\n }\n _this.buttonListenersDestroyFuncs.push(_this.addManagedListener(buttonEl, 'click', callback));\n menuEl.appendChild(buttonEl);\n });\n };\n ChartMenu.prototype.saveChart = function () {\n var event = { type: ChartMenu.EVENT_DOWNLOAD_CHART };\n this.dispatchEvent(event);\n };\n ChartMenu.prototype.createMenuPanel = function (defaultTab) {\n var _this = this;\n var width = this.environment.chartMenuPanelWidth();\n var menuPanel = this.menuPanel = this.createBean(new AgPanel({\n minWidth: width,\n width: width,\n height: '100%',\n closable: true,\n hideTitleBar: true,\n cssIdentifier: 'chart-menu'\n }));\n menuPanel.setParentComponent(this);\n this.eMenuPanelContainer.appendChild(menuPanel.getGui());\n this.tabbedMenu = this.createBean(new TabbedChartMenu({\n controller: this.chartController,\n type: this.chartController.getChartType(),\n panels: this.panels,\n chartOptionsService: this.chartOptionsService\n }));\n this.addManagedListener(menuPanel, Component.EVENT_DESTROYED, function () { return _this.destroyBean(_this.tabbedMenu); });\n return new AgPromise(function (res) {\n window.setTimeout(function () {\n menuPanel.setBodyComponent(_this.tabbedMenu);\n _this.tabbedMenu.showTab(defaultTab);\n res(menuPanel);\n _this.addManagedListener(_this.eChartContainer, 'click', function (event) {\n if (_this.getGui().contains(event.target)) {\n return;\n }\n if (_this.menuVisible) {\n _this.hideMenu();\n }\n });\n }, 100);\n });\n };\n ChartMenu.prototype.showContainer = function () {\n if (!this.menuPanel) {\n return;\n }\n this.menuVisible = true;\n this.showParent(this.menuPanel.getWidth());\n this.refreshMenuClasses();\n };\n ChartMenu.prototype.toggleMenu = function () {\n this.menuVisible ? this.hideMenu() : this.showMenu();\n };\n ChartMenu.prototype.showMenu = function (\n /**\n * Menu panel to show. If empty, shows the existing menu, or creates the default menu if menu panel has not been created\n */\n panel, \n /**\n * Whether to animate the menu opening\n */\n animate) {\n var _this = this;\n if (animate === void 0) { animate = true; }\n if (!animate) {\n this.eMenuPanelContainer.classList.add('ag-no-transition');\n }\n if (this.menuPanel && !panel) {\n this.showContainer();\n }\n else {\n var menuPanel = panel || this.defaultPanel;\n var tab = this.panels.indexOf(menuPanel);\n if (tab < 0) {\n console.warn(\"AG Grid: '\" + panel + \"' is not a valid Chart Tool Panel name\");\n tab = this.panels.indexOf(this.defaultPanel);\n }\n if (this.menuPanel) {\n this.tabbedMenu.showTab(tab);\n this.showContainer();\n }\n else {\n this.createMenuPanel(tab).then(this.showContainer.bind(this));\n }\n }\n if (!animate) {\n // Wait for menu to render\n setTimeout(function () {\n if (!_this.isAlive()) {\n return;\n }\n _this.eMenuPanelContainer.classList.remove('ag-no-transition');\n }, 500);\n }\n };\n ChartMenu.prototype.hideMenu = function () {\n var _this = this;\n this.hideParent();\n window.setTimeout(function () {\n _this.menuVisible = false;\n _this.refreshMenuClasses();\n }, 500);\n };\n ChartMenu.prototype.refreshMenuClasses = function () {\n this.eChartContainer.classList.toggle('ag-chart-menu-visible', this.menuVisible);\n this.eChartContainer.classList.toggle('ag-chart-menu-hidden', !this.menuVisible);\n if (!this.gridOptionsService.is('suppressChartToolPanelsButton')) {\n this.eHideButtonIcon.classList.toggle('ag-icon-contracted', this.menuVisible);\n this.eHideButtonIcon.classList.toggle('ag-icon-expanded', !this.menuVisible);\n }\n };\n ChartMenu.prototype.showParent = function (width) {\n this.eMenuPanelContainer.style.minWidth = width + \"px\";\n };\n ChartMenu.prototype.hideParent = function () {\n this.eMenuPanelContainer.style.minWidth = '0';\n };\n ChartMenu.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n if (this.menuPanel && this.menuPanel.isAlive()) {\n this.destroyBean(this.menuPanel);\n }\n if (this.tabbedMenu && this.tabbedMenu.isAlive()) {\n this.destroyBean(this.tabbedMenu);\n }\n };\n ChartMenu.EVENT_DOWNLOAD_CHART = \"downloadChart\";\n ChartMenu.TEMPLATE = \"
\\n
\\n \\n
\";\n __decorate$T([\n Autowired('chartTranslationService')\n ], ChartMenu.prototype, \"chartTranslationService\", void 0);\n __decorate$T([\n RefSelector(\"eMenu\")\n ], ChartMenu.prototype, \"eMenu\", void 0);\n __decorate$T([\n RefSelector(\"eHideButton\")\n ], ChartMenu.prototype, \"eHideButton\", void 0);\n __decorate$T([\n RefSelector(\"eHideButtonIcon\")\n ], ChartMenu.prototype, \"eHideButtonIcon\", void 0);\n __decorate$T([\n PostConstruct\n ], ChartMenu.prototype, \"postConstruct\", null);\n return ChartMenu;\n}(Component));\n\nvar __extends$13 = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign$l = (undefined && undefined.__assign) || function () {\n __assign$l = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$l.apply(this, arguments);\n};\nvar __decorate$S = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __values$6 = (undefined && undefined.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nvar TitleEdit = /** @class */ (function (_super) {\n __extends$13(TitleEdit, _super);\n function TitleEdit(chartMenu) {\n var _this = _super.call(this, TitleEdit.TEMPLATE) || this;\n _this.chartMenu = chartMenu;\n _this.destroyableChartListeners = [];\n _this.editing = false;\n return _this;\n }\n TitleEdit.prototype.init = function () {\n var _this = this;\n this.addManagedListener(this.getGui(), 'keydown', function (e) {\n if (_this.editing && e.key === 'Enter' && !e.shiftKey) {\n _this.handleEndEditing();\n e.preventDefault();\n }\n });\n this.addManagedListener(this.getGui(), 'input', function () {\n if (_this.editing) {\n _this.updateHeight();\n }\n });\n this.addManagedListener(this.getGui(), 'blur', function () { return _this.endEditing(); });\n };\n /* should be called when the containing component changes to a new chart proxy */\n TitleEdit.prototype.refreshTitle = function (chartController, chartOptionsService) {\n var e_1, _a;\n var _this = this;\n this.chartController = chartController;\n this.chartOptionsService = chartOptionsService;\n try {\n for (var _b = __values$6(this.destroyableChartListeners), _c = _b.next(); !_c.done; _c = _b.next()) {\n var destroyFn = _c.value;\n destroyFn();\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_1) throw e_1.error; }\n }\n this.destroyableChartListeners = [];\n var chartProxy = this.chartController.getChartProxy();\n var chart = chartProxy.getChart();\n var canvas = chart.scene.canvas.element;\n var destroyDbleClickListener = this.addManagedListener(canvas, 'dblclick', function (event) {\n var title = chart.title;\n if (title && title.node.containsPoint(event.offsetX, event.offsetY)) {\n var bbox = title.node.computeBBox();\n var xy = title.node.inverseTransformPoint(bbox.x, bbox.y);\n _this.startEditing(__assign$l(__assign$l({}, bbox), xy), canvas.width);\n }\n });\n var wasInTitle = false;\n var destroyMouseMoveListener = this.addManagedListener(canvas, 'mousemove', function (event) {\n var title = chart.title;\n var inTitle = !!(title && title.enabled && title.node.containsPoint(event.offsetX, event.offsetY));\n if (wasInTitle !== inTitle) {\n canvas.style.cursor = inTitle ? 'pointer' : '';\n }\n wasInTitle = inTitle;\n });\n this.destroyableChartListeners = [\n destroyDbleClickListener,\n destroyMouseMoveListener\n ];\n };\n TitleEdit.prototype.startEditing = function (titleBBox, canvasWidth) {\n if (this.chartMenu && this.chartMenu.isVisible()) {\n // currently, we ignore requests to edit the chart title while the chart menu is showing\n // because the click to edit the chart will also close the chart menu, making the position\n // of the title change.\n return;\n }\n if (this.editing) {\n return;\n }\n this.editing = true;\n var minimumTargetInputWidth = 300;\n var inputWidth = Math.max(Math.min(titleBBox.width + 20, canvasWidth), minimumTargetInputWidth);\n var element = this.getGui();\n element.classList.add('currently-editing');\n var inputStyle = element.style;\n // match style of input to title that we're editing\n inputStyle.fontFamily = this.chartOptionsService.getChartOption('title.fontFamily');\n inputStyle.fontWeight = this.chartOptionsService.getChartOption('title.fontWeight');\n inputStyle.fontStyle = this.chartOptionsService.getChartOption('title.fontStyle');\n inputStyle.fontSize = this.chartOptionsService.getChartOption('title.fontSize') + 'px';\n inputStyle.color = this.chartOptionsService.getChartOption('title.color');\n // populate the input with the title, unless the title is the placeholder:\n var oldTitle = this.chartOptionsService.getChartOption('title.text');\n var isTitlePlaceholder = oldTitle === this.chartTranslationService.translate('titlePlaceholder');\n element.value = isTitlePlaceholder ? '' : oldTitle;\n var oldTitleLines = oldTitle.split(/\\r?\\n/g).length;\n inputStyle.left = Math.round(titleBBox.x + titleBBox.width / 2 - inputWidth / 2 - 1) + 'px';\n inputStyle.top = Math.round(titleBBox.y + titleBBox.height / 2 - (oldTitleLines * this.getLineHeight()) / 2 - 2) + 'px';\n inputStyle.width = Math.round(inputWidth) + 'px';\n inputStyle.lineHeight = this.getLineHeight() + 'px';\n this.updateHeight();\n element.focus();\n };\n TitleEdit.prototype.updateHeight = function () {\n var element = this.getGui();\n // The element should cover the title and provide enough space for the new one.\n var oldTitleLines = this.chartOptionsService.getChartOption('title.text').split(/\\r?\\n/g).length;\n var currentTitleLines = element.value.split(/\\r?\\n/g).length;\n element.style.height = (Math.round(Math.max(oldTitleLines, currentTitleLines) * this.getLineHeight()) + 4) + 'px';\n };\n TitleEdit.prototype.getLineHeight = function () {\n var fixedLineHeight = this.chartOptionsService.getChartOption('title.lineHeight');\n if (fixedLineHeight) {\n return parseInt(fixedLineHeight);\n }\n return Math.round(parseInt(this.chartOptionsService.getChartOption('title.fontSize')) * 1.2);\n };\n TitleEdit.prototype.handleEndEditing = function () {\n // special handling to avoid flicker caused by delay when swapping old and new titles\n var _this = this;\n // 1 - store current title color\n var titleColor = this.chartOptionsService.getChartOption('title.color');\n // 2 - hide title by making it transparent\n var transparentColor = 'rgba(0, 0, 0, 0)';\n this.chartOptionsService.setChartOption('title.color', transparentColor);\n // 3 - trigger 'end editing' - this will update the chart with the new title\n this.chartOptionsService.awaitChartOptionUpdate(function () { return _this.endEditing(); });\n // 4 - restore title color to its original value\n this.chartOptionsService.awaitChartOptionUpdate(function () {\n _this.chartOptionsService.setChartOption('title.color', titleColor);\n });\n };\n TitleEdit.prototype.endEditing = function () {\n var _this = this;\n if (!this.editing) {\n return;\n }\n this.editing = false;\n var value = this.getGui().value;\n if (value && value.trim() !== '') {\n this.chartOptionsService.setChartOption('title.text', value);\n this.chartOptionsService.setChartOption('title.enabled', true);\n }\n else {\n this.chartOptionsService.setChartOption('title.text', '');\n this.chartOptionsService.setChartOption('title.enabled', false);\n }\n this.getGui().classList.remove('currently-editing');\n // await chart updates so `chartTitleEdit` event consumers can read the new state correctly\n this.chartOptionsService.awaitChartOptionUpdate(function () {\n _this.eventService.dispatchEvent({ type: 'chartTitleEdit' });\n });\n };\n TitleEdit.TEMPLATE = \"\\n \";\n __decorate$S([\n Autowired('chartTranslationService')\n ], TitleEdit.prototype, \"chartTranslationService\", void 0);\n __decorate$S([\n PostConstruct\n ], TitleEdit.prototype, \"init\", null);\n return TitleEdit;\n}(Component));\n\nvar __extends$12 = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$R = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar ChartDatasource = /** @class */ (function (_super) {\n __extends$12(ChartDatasource, _super);\n function ChartDatasource() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n ChartDatasource.prototype.getData = function (params) {\n if (params.crossFiltering) {\n if (params.grouping) {\n console.warn(\"AG Grid: crossing filtering with row grouping is not supported.\");\n return { chartData: [], columnNames: {} };\n }\n if (!this.gridOptionsService.isRowModelType('clientSide')) {\n console.warn(\"AG Grid: crossing filtering is only supported in the client side row model.\");\n return { chartData: [], columnNames: {} };\n }\n }\n var isServerSide = this.gridOptionsService.isRowModelType('serverSide');\n if (isServerSide && params.pivoting) {\n this.updatePivotKeysForSSRM();\n }\n var result = this.extractRowsFromGridRowModel(params);\n result.chartData = this.aggregateRowsByDimension(params, result.chartData);\n return result;\n };\n ChartDatasource.prototype.extractRowsFromGridRowModel = function (params) {\n var _this = this;\n var extractedRowData = [];\n var columnNames = {};\n // maps used to keep track of expanded groups that need to be removed\n var groupNodeIndexes = {};\n var groupsToRemove = {};\n // only used when cross filtering\n var filteredNodes = {};\n var allRowNodes = [];\n var numRows;\n if (params.crossFiltering) {\n filteredNodes = this.getFilteredRowNodes();\n allRowNodes = this.getAllRowNodes();\n numRows = allRowNodes.length;\n }\n else {\n // make sure enough rows in range to chart. if user filters and less rows, then end row will be\n // the last displayed row, not where the range ends.\n var modelLastRow = this.gridRowModel.getRowCount() - 1;\n var rangeLastRow = params.endRow >= 0 ? Math.min(params.endRow, modelLastRow) : modelLastRow;\n numRows = rangeLastRow - params.startRow + 1;\n }\n var _loop_1 = function (i) {\n var data = {};\n var rowNode = params.crossFiltering ? allRowNodes[i] : this_1.gridRowModel.getRow(i + params.startRow);\n // first get data for dimensions columns\n params.dimensionCols.forEach(function (col) {\n var colId = col.colId;\n var column = _this.columnModel.getGridColumn(colId);\n if (column) {\n var valueObject = _this.valueService.getValue(column, rowNode);\n // when grouping we also need to build up multi category labels for charts\n if (params.grouping) {\n var valueString = valueObject && valueObject.toString ? String(valueObject.toString()) : '';\n // traverse parents to extract group label path\n var labels = ChartDatasource.getGroupLabels(rowNode, valueString);\n data[colId] = {\n labels: labels,\n toString: function () {\n return this.labels.filter(function (l) { return !!l; }).reverse().join(' - ');\n }\n };\n // keep track of group node indexes, so they can be padded when other groups are expanded\n if (rowNode.group) {\n groupNodeIndexes[labels.toString()] = i;\n }\n // if node (group or leaf) has parents then it is expanded and should be removed\n var groupKey = labels.slice(1, labels.length).toString();\n if (groupKey) {\n groupsToRemove[groupKey] = groupNodeIndexes[groupKey];\n }\n }\n else {\n // leaf nodes can be directly added to dimension columns\n data[colId] = valueObject;\n }\n }\n else {\n // introduce a default category when no dimensions exist with a value based off row index (+1)\n data[ChartDataModel.DEFAULT_CATEGORY] = i + 1;\n }\n });\n // then get data for value columns\n params.valueCols.forEach(function (col) {\n var columnNamesArr = [];\n // pivot keys should be added first\n var pivotKeys = col.getColDef().pivotKeys;\n if (pivotKeys) {\n columnNamesArr = pivotKeys.slice();\n }\n // then add column header name to results\n var headerName = col.getColDef().headerName;\n if (headerName) {\n columnNamesArr.push(headerName);\n }\n // add array of column names to results\n if (columnNamesArr.length > 0) {\n columnNames[col.getId()] = columnNamesArr;\n }\n var colId = col.getColId();\n if (params.crossFiltering) {\n var filteredOutColId = colId + '-filtered-out';\n // add data value to value column\n var value = _this.valueService.getValue(col, rowNode);\n var actualValue = value != null && typeof value.toNumber === 'function' ? value.toNumber() : value;\n if (filteredNodes[rowNode.id]) {\n data[colId] = actualValue;\n data[filteredOutColId] = params.aggFunc || params.isScatter ? undefined : 0;\n }\n else {\n data[colId] = params.aggFunc || params.isScatter ? undefined : 0;\n data[filteredOutColId] = actualValue;\n }\n }\n else {\n // add data value to value column\n var value = _this.valueService.getValue(col, rowNode);\n // aggregated value\n if (value && value.hasOwnProperty('toString')) {\n value = parseFloat(value.toString());\n }\n data[colId] = value != null && typeof value.toNumber === 'function' ? value.toNumber() : value;\n }\n });\n // row data from footer nodes should not be included in charts\n if (rowNode.footer) {\n // 'stamping' data as footer to avoid impacting previously calculated `groupIndexesToRemove` and will\n // be removed from the results along with any expanded group nodes\n data.footer = true;\n }\n // add data to results\n extractedRowData.push(data);\n };\n var this_1 = this;\n for (var i = 0; i < numRows; i++) {\n _loop_1(i);\n }\n if (params.grouping) {\n var groupIndexesToRemove_1 = _.values(groupsToRemove);\n var filterFunc = function (data, index) { return !data.footer && !_.includes(groupIndexesToRemove_1, index); };\n extractedRowData = extractedRowData.filter(filterFunc);\n }\n return { chartData: extractedRowData, columnNames: columnNames };\n };\n ChartDatasource.prototype.aggregateRowsByDimension = function (params, dataFromGrid) {\n var _this = this;\n var dimensionCols = params.dimensionCols;\n if (!params.aggFunc || dimensionCols.length === 0) {\n return dataFromGrid;\n }\n var lastCol = _.last(dimensionCols);\n var lastColId = lastCol && lastCol.colId;\n var map = {};\n var dataAggregated = [];\n dataFromGrid.forEach(function (data) {\n var currentMap = map;\n dimensionCols.forEach(function (col) {\n var colId = col.colId;\n var key = data[colId];\n if (colId === lastColId) {\n var groupItem_1 = currentMap[key];\n if (!groupItem_1) {\n groupItem_1 = { __children: [] };\n dimensionCols.forEach(function (dimCol) {\n var dimColId = dimCol.colId;\n groupItem_1[dimColId] = data[dimColId];\n });\n currentMap[key] = groupItem_1;\n dataAggregated.push(groupItem_1);\n }\n groupItem_1.__children.push(data);\n }\n else {\n // map of maps\n if (!currentMap[key]) {\n currentMap[key] = {};\n }\n currentMap = currentMap[key];\n }\n });\n });\n if (ModuleRegistry.__assertRegistered(ModuleNames.RowGroupingModule, 'Charting Aggregation', this.context.getGridId())) {\n dataAggregated.forEach(function (groupItem) { return params.valueCols.forEach(function (col) {\n if (params.crossFiltering) {\n params.valueCols.forEach(function (valueCol) {\n var colId = valueCol.getColId();\n // filtered data\n var dataToAgg = groupItem.__children\n .filter(function (child) { return typeof child[colId] !== 'undefined'; })\n .map(function (child) { return child[colId]; });\n var aggResult = _this.aggregationStage.aggregateValues(dataToAgg, params.aggFunc);\n groupItem[valueCol.getId()] = aggResult && typeof aggResult.value !== 'undefined' ? aggResult.value : aggResult;\n // filtered out data\n var filteredOutColId = colId + \"-filtered-out\";\n var dataToAggFiltered = groupItem.__children\n .filter(function (child) { return typeof child[filteredOutColId] !== 'undefined'; })\n .map(function (child) { return child[filteredOutColId]; });\n var aggResultFiltered = _this.aggregationStage.aggregateValues(dataToAggFiltered, params.aggFunc);\n groupItem[filteredOutColId] = aggResultFiltered && typeof aggResultFiltered.value !== 'undefined' ? aggResultFiltered.value : aggResultFiltered;\n });\n }\n else {\n var dataToAgg = groupItem.__children.map(function (child) { return child[col.getId()]; });\n var aggResult = 0;\n if (ModuleRegistry.__assertRegistered(ModuleNames.RowGroupingModule, 'Charting Aggregation', _this.context.getGridId())) {\n aggResult = _this.aggregationStage.aggregateValues(dataToAgg, params.aggFunc);\n }\n groupItem[col.getId()] = aggResult && typeof aggResult.value !== 'undefined' ? aggResult.value : aggResult;\n }\n }); });\n }\n return dataAggregated;\n };\n ChartDatasource.prototype.updatePivotKeysForSSRM = function () {\n var secondaryColumns = this.columnModel.getSecondaryColumns();\n if (!secondaryColumns) {\n return;\n }\n // we don't know what the application will use for the pivot key separator (i.e. '_' or '|' ) as the\n // secondary columns are provided to grid by the application via columnApi.setSecondaryColumns()\n var pivotKeySeparator = this.extractPivotKeySeparator(secondaryColumns);\n // `pivotKeys` is not used by the SSRM for pivoting, so it is safe to reuse this colDef property. This way\n // the same logic can be used for CSRM and SSRM to extract legend names in extractRowsFromGridRowModel()\n secondaryColumns.forEach(function (col) {\n if (pivotKeySeparator === '') {\n col.getColDef().pivotKeys = [];\n }\n else {\n var keys = col.getColId().split(pivotKeySeparator);\n col.getColDef().pivotKeys = keys.slice(0, keys.length - 1);\n }\n });\n };\n ChartDatasource.prototype.extractPivotKeySeparator = function (secondaryColumns) {\n if (secondaryColumns.length === 0) {\n return '';\n }\n var extractSeparator = function (columnGroup, childId) {\n var groupId = columnGroup.getGroupId();\n if (!columnGroup.getParent()) {\n // removing groupId ('2000') from childId ('2000|Swimming') yields '|Swimming' so first char is separator\n return childId.split(groupId)[1][0];\n }\n return extractSeparator(columnGroup.getParent(), groupId);\n };\n var firstSecondaryCol = secondaryColumns[0];\n if (firstSecondaryCol.getParent() == null) {\n return '';\n }\n return extractSeparator(firstSecondaryCol.getParent(), firstSecondaryCol.getColId());\n };\n ChartDatasource.getGroupLabels = function (rowNode, initialLabel) {\n var labels = [initialLabel];\n while (rowNode && rowNode.level !== 0) {\n rowNode = rowNode.parent;\n if (rowNode) {\n labels.push(rowNode.key);\n }\n }\n return labels;\n };\n ChartDatasource.prototype.getFilteredRowNodes = function () {\n var filteredNodes = {};\n this.gridRowModel.forEachNodeAfterFilterAndSort(function (rowNode) {\n filteredNodes[rowNode.id] = rowNode;\n });\n return filteredNodes;\n };\n ChartDatasource.prototype.getAllRowNodes = function () {\n var allRowNodes = [];\n this.gridRowModel.forEachNode(function (rowNode) {\n allRowNodes.push(rowNode);\n });\n return this.sortRowNodes(allRowNodes);\n };\n ChartDatasource.prototype.sortRowNodes = function (rowNodes) {\n var sortOptions = this.sortController.getSortOptions();\n var noSort = !sortOptions || sortOptions.length == 0;\n if (noSort)\n return rowNodes;\n return this.rowNodeSorter.doFullSort(rowNodes, sortOptions);\n };\n __decorate$R([\n Autowired('rowModel')\n ], ChartDatasource.prototype, \"gridRowModel\", void 0);\n __decorate$R([\n Autowired('valueService')\n ], ChartDatasource.prototype, \"valueService\", void 0);\n __decorate$R([\n Autowired('columnModel')\n ], ChartDatasource.prototype, \"columnModel\", void 0);\n __decorate$R([\n Autowired('rowNodeSorter')\n ], ChartDatasource.prototype, \"rowNodeSorter\", void 0);\n __decorate$R([\n Autowired('sortController')\n ], ChartDatasource.prototype, \"sortController\", void 0);\n __decorate$R([\n Optional('aggregationStage')\n ], ChartDatasource.prototype, \"aggregationStage\", void 0);\n return ChartDatasource;\n}(BeanStub));\n\nvar __extends$11 = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$Q = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar ChartColumnService = /** @class */ (function (_super) {\n __extends$11(ChartColumnService, _super);\n function ChartColumnService() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n ChartColumnService.prototype.getColumn = function (colId) {\n return this.columnModel.getPrimaryColumn(colId);\n };\n ChartColumnService.prototype.getAllDisplayedColumns = function () {\n return this.columnModel.getAllDisplayedColumns();\n };\n ChartColumnService.prototype.getColDisplayName = function (col) {\n return this.columnModel.getDisplayNameForColumn(col, 'chart');\n };\n ChartColumnService.prototype.getRowGroupColumns = function () {\n return this.columnModel.getRowGroupColumns();\n };\n ChartColumnService.prototype.getGroupDisplayColumns = function () {\n return this.columnModel.getGroupDisplayColumns();\n };\n ChartColumnService.prototype.isPivotMode = function () {\n return this.columnModel.isPivotMode();\n };\n ChartColumnService.prototype.isPivotActive = function () {\n return this.columnModel.isPivotActive();\n };\n ChartColumnService.prototype.getChartColumns = function () {\n var _this = this;\n var displayedCols = this.columnModel.getAllDisplayedColumns();\n var dimensionCols = new Set();\n var valueCols = new Set();\n displayedCols.forEach(function (col) {\n var colDef = col.getColDef();\n var chartDataType = colDef.chartDataType;\n if (chartDataType) {\n // chart data type was specified explicitly\n switch (chartDataType) {\n case 'category':\n case 'time':\n dimensionCols.add(col);\n return;\n case 'series':\n valueCols.add(col);\n return;\n case 'excluded':\n return;\n default:\n console.warn(\"AG Grid: unexpected chartDataType value '\" + chartDataType + \"' supplied, instead use 'category', 'series' or 'excluded'\");\n break;\n }\n }\n if (colDef.colId === 'ag-Grid-AutoColumn') {\n dimensionCols.add(col);\n return;\n }\n if (!col.isPrimary()) {\n valueCols.add(col);\n return;\n }\n // if 'chartDataType' is not provided then infer type based data contained in first row\n (_this.isNumberCol(col) ? valueCols : dimensionCols).add(col);\n });\n return { dimensionCols: dimensionCols, valueCols: valueCols };\n };\n ChartColumnService.prototype.isNumberCol = function (col) {\n if (col.getColId() === 'ag-Grid-AutoColumn') {\n return false;\n }\n var row = this.rowRenderer.getRowNode({ rowIndex: 0, rowPinned: null });\n if (!row) {\n return false;\n }\n var cellValue = this.valueService.getValue(col, row);\n if (cellValue == null) {\n cellValue = this.extractLeafData(row, col);\n }\n if (cellValue != null && typeof cellValue.toNumber === 'function') {\n cellValue = cellValue.toNumber();\n }\n return typeof cellValue === 'number';\n };\n ChartColumnService.prototype.extractLeafData = function (row, col) {\n if (!row.allLeafChildren) {\n return null;\n }\n for (var i = 0; i < row.allLeafChildren.length; i++) {\n var childRow = row.allLeafChildren[i];\n var value = this.valueService.getValue(col, childRow);\n if (value != null) {\n return value;\n }\n }\n return null;\n };\n __decorate$Q([\n Autowired('columnModel')\n ], ChartColumnService.prototype, \"columnModel\", void 0);\n __decorate$Q([\n Autowired('valueService')\n ], ChartColumnService.prototype, \"valueService\", void 0);\n __decorate$Q([\n Autowired('rowRenderer')\n ], ChartColumnService.prototype, \"rowRenderer\", void 0);\n ChartColumnService = __decorate$Q([\n Bean(\"chartColumnService\")\n ], ChartColumnService);\n return ChartColumnService;\n}(BeanStub));\n\nvar __extends$10 = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$P = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar ComboChartModel = /** @class */ (function (_super) {\n __extends$10(ComboChartModel, _super);\n function ComboChartModel(chartDataModel) {\n var _a;\n var _this = _super.call(this) || this;\n // this control flag is used to only log warning for the initial user config\n _this.suppressComboChartWarnings = false;\n _this.chartDataModel = chartDataModel;\n _this.seriesChartTypes = (_a = chartDataModel.params.seriesChartTypes) !== null && _a !== void 0 ? _a : [];\n return _this;\n }\n ComboChartModel.prototype.init = function () {\n this.initComboCharts();\n };\n ComboChartModel.prototype.update = function (seriesChartTypes) {\n this.seriesChartTypes = seriesChartTypes !== null && seriesChartTypes !== void 0 ? seriesChartTypes : this.seriesChartTypes;\n this.initComboCharts();\n this.updateSeriesChartTypes();\n };\n ComboChartModel.prototype.initComboCharts = function () {\n var seriesChartTypesExist = this.seriesChartTypes && this.seriesChartTypes.length > 0;\n var customCombo = this.chartDataModel.chartType === 'customCombo' || seriesChartTypesExist;\n if (customCombo) {\n // it is not necessary to supply a chart type for combo charts when `seriesChartTypes` is supplied\n this.chartDataModel.chartType = 'customCombo';\n // cache supplied `seriesChartTypes` to allow switching between different chart types in the settings panel\n this.savedCustomSeriesChartTypes = this.seriesChartTypes || [];\n }\n };\n ComboChartModel.prototype.updateSeriesChartTypes = function () {\n if (!this.chartDataModel.isComboChart()) {\n return;\n }\n // ensure primary only chart types are not placed on secondary axis\n this.seriesChartTypes = this.seriesChartTypes.map(function (seriesChartType) {\n var primaryOnly = ['groupedColumn', 'stackedColumn', 'stackedArea'].includes(seriesChartType.chartType);\n seriesChartType.secondaryAxis = primaryOnly ? false : seriesChartType.secondaryAxis;\n return seriesChartType;\n });\n // note that when seriesChartTypes are supplied the chart type is also changed to 'customCombo'\n if (this.chartDataModel.chartType === 'customCombo') {\n this.updateSeriesChartTypesForCustomCombo();\n return;\n }\n this.updateChartSeriesTypesForBuiltInCombos();\n };\n ComboChartModel.prototype.updateSeriesChartTypesForCustomCombo = function () {\n var _this = this;\n var seriesChartTypesSupplied = this.seriesChartTypes && this.seriesChartTypes.length > 0;\n if (!seriesChartTypesSupplied && !this.suppressComboChartWarnings) {\n console.warn(\"AG Grid: 'seriesChartTypes' are required when the 'customCombo' chart type is specified.\");\n }\n // ensure correct chartTypes are supplied\n this.seriesChartTypes = this.seriesChartTypes.map(function (s) {\n if (!ComboChartModel.SUPPORTED_COMBO_CHART_TYPES.includes(s.chartType)) {\n console.warn(\"AG Grid: invalid chartType '\" + s.chartType + \"' supplied in 'seriesChartTypes', converting to 'line' instead.\");\n s.chartType = 'line';\n }\n return s;\n });\n var getSeriesChartType = function (valueCol) {\n if (!_this.savedCustomSeriesChartTypes || _this.savedCustomSeriesChartTypes.length === 0) {\n _this.savedCustomSeriesChartTypes = _this.seriesChartTypes;\n }\n var providedSeriesChartType = _this.savedCustomSeriesChartTypes.find(function (s) { return s.colId === valueCol.colId; });\n if (!providedSeriesChartType) {\n if (valueCol.selected && !_this.suppressComboChartWarnings) {\n console.warn(\"AG Grid: no 'seriesChartType' found for colId = '\" + valueCol.colId + \"', defaulting to 'line'.\");\n }\n return {\n colId: valueCol.colId,\n chartType: 'line',\n secondaryAxis: false\n };\n }\n return providedSeriesChartType;\n };\n var updatedSeriesChartTypes = this.chartDataModel.valueColState.map(getSeriesChartType);\n this.seriesChartTypes = updatedSeriesChartTypes;\n // also cache custom `seriesChartTypes` to allow for switching between different chart types\n this.savedCustomSeriesChartTypes = updatedSeriesChartTypes;\n // turn off warnings as first combo chart attempt has completed\n this.suppressComboChartWarnings = true;\n };\n ComboChartModel.prototype.updateChartSeriesTypesForBuiltInCombos = function () {\n var _a = this.chartDataModel, chartType = _a.chartType, valueColState = _a.valueColState;\n var primaryChartType = chartType === 'columnLineCombo' ? 'groupedColumn' : 'stackedArea';\n var secondaryChartType = chartType === 'columnLineCombo' ? 'line' : 'groupedColumn';\n var selectedCols = valueColState.filter(function (cs) { return cs.selected; });\n var lineIndex = Math.ceil(selectedCols.length / 2);\n this.seriesChartTypes = selectedCols.map(function (valueCol, i) {\n var seriesType = (i >= lineIndex) ? secondaryChartType : primaryChartType;\n return { colId: valueCol.colId, chartType: seriesType, secondaryAxis: false };\n });\n };\n ComboChartModel.SUPPORTED_COMBO_CHART_TYPES = ['line', 'groupedColumn', 'stackedColumn', 'area', 'stackedArea'];\n __decorate$P([\n PostConstruct\n ], ComboChartModel.prototype, \"init\", null);\n return ComboChartModel;\n}(BeanStub));\n\nvar __extends$$ = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign$k = (undefined && undefined.__assign) || function () {\n __assign$k = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$k.apply(this, arguments);\n};\nvar __decorate$O = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __read$h = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray$9 = (undefined && undefined.__spreadArray) || function (to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\n to[j] = from[i];\n return to;\n};\nvar ChartDataModel = /** @class */ (function (_super) {\n __extends$$(ChartDataModel, _super);\n function ChartDataModel(params) {\n var _this = _super.call(this) || this;\n _this.unlinked = false;\n _this.chartData = [];\n _this.valueColState = [];\n _this.dimensionColState = [];\n _this.columnNames = {};\n _this.crossFiltering = false;\n _this.grouping = false;\n _this.params = params;\n _this.chartId = params.chartId;\n _this.chartType = params.chartType;\n _this.pivotChart = params.pivotChart;\n _this.chartThemeName = params.chartThemeName;\n _this.aggFunc = params.aggFunc;\n _this.referenceCellRange = params.cellRange;\n _this.suppliedCellRange = params.cellRange;\n _this.suppressChartRanges = params.suppressChartRanges;\n _this.unlinked = !!params.unlinkChart;\n _this.crossFiltering = !!params.crossFiltering;\n return _this;\n }\n ChartDataModel.prototype.init = function () {\n this.datasource = this.createManagedBean(new ChartDatasource());\n this.chartColumnService = this.createManagedBean(new ChartColumnService());\n this.comboChartModel = this.createManagedBean(new ComboChartModel(this));\n this.updateCellRanges();\n this.updateData();\n };\n ChartDataModel.prototype.updateModel = function (params) {\n var cellRange = params.cellRange, chartType = params.chartType, pivotChart = params.pivotChart, chartThemeName = params.chartThemeName, aggFunc = params.aggFunc, suppressChartRanges = params.suppressChartRanges, unlinkChart = params.unlinkChart, crossFiltering = params.crossFiltering, seriesChartTypes = params.seriesChartTypes;\n if (cellRange !== this.suppliedCellRange) {\n this.dimensionCellRange = undefined;\n this.valueCellRange = undefined;\n }\n this.chartType = chartType;\n this.pivotChart = pivotChart;\n this.chartThemeName = chartThemeName;\n this.aggFunc = aggFunc;\n this.referenceCellRange = cellRange;\n this.suppliedCellRange = cellRange;\n this.suppressChartRanges = suppressChartRanges;\n this.unlinked = !!unlinkChart;\n this.crossFiltering = !!crossFiltering;\n this.updateSelectedDimension(cellRange === null || cellRange === void 0 ? void 0 : cellRange.columns);\n this.updateCellRanges();\n var shouldUpdateComboModel = this.isComboChart() || seriesChartTypes;\n if (shouldUpdateComboModel) {\n this.comboChartModel.update(seriesChartTypes);\n }\n if (!this.unlinked) {\n this.updateData();\n }\n };\n ChartDataModel.prototype.updateCellRanges = function (updatedColState) {\n if (this.valueCellRange) {\n this.referenceCellRange = this.valueCellRange;\n }\n var _a = this.chartColumnService.getChartColumns(), dimensionCols = _a.dimensionCols, valueCols = _a.valueCols;\n var allColsFromRanges = this.getAllColumnsFromRanges();\n if (updatedColState) {\n this.updateColumnState(updatedColState);\n }\n this.setDimensionCellRange(dimensionCols, allColsFromRanges, updatedColState);\n this.setValueCellRange(valueCols, allColsFromRanges, updatedColState);\n if (!updatedColState) {\n this.resetColumnState();\n // dimension / category cell range could be out of sync after resetting column state when row grouping\n this.syncDimensionCellRange();\n }\n this.comboChartModel.updateSeriesChartTypes();\n };\n ChartDataModel.prototype.updateData = function () {\n var _a = this.getRowIndexes(), startRow = _a.startRow, endRow = _a.endRow;\n if (this.pivotChart) {\n this.resetColumnState();\n }\n this.grouping = this.isGrouping();\n var params = {\n aggFunc: this.aggFunc,\n dimensionCols: [this.getSelectedDimension()],\n grouping: this.grouping,\n pivoting: this.isPivotActive(),\n crossFiltering: this.crossFiltering,\n valueCols: this.getSelectedValueCols(),\n startRow: startRow,\n endRow: endRow,\n isScatter: _.includes(['scatter', 'bubble'], this.chartType)\n };\n var _b = this.datasource.getData(params), chartData = _b.chartData, columnNames = _b.columnNames;\n this.chartData = chartData;\n this.columnNames = columnNames;\n };\n ChartDataModel.prototype.isGrouping = function () {\n var usingTreeData = this.gridOptionsService.isTreeData();\n var groupedCols = usingTreeData ? null : this.chartColumnService.getRowGroupColumns();\n var isGroupActive = usingTreeData || (groupedCols && groupedCols.length > 0);\n // charts only group when the selected category is a group column\n var colId = this.getSelectedDimension().colId;\n var displayedGroupCols = this.chartColumnService.getGroupDisplayColumns();\n var groupDimensionSelected = displayedGroupCols.map(function (col) { return col.getColId(); }).some(function (id) { return id === colId; });\n return !!isGroupActive && groupDimensionSelected;\n };\n ChartDataModel.prototype.getSelectedValueCols = function () {\n return this.valueColState.filter(function (cs) { return cs.selected; }).map(function (cs) { return cs.column; });\n };\n ChartDataModel.prototype.getSelectedDimension = function () {\n return this.dimensionColState.filter(function (cs) { return cs.selected; })[0];\n };\n ChartDataModel.prototype.getColDisplayName = function (col) {\n return this.chartColumnService.getColDisplayName(col);\n };\n ChartDataModel.prototype.isPivotMode = function () {\n return this.chartColumnService.isPivotMode();\n };\n ChartDataModel.prototype.getChartDataType = function (colId) {\n var column = this.chartColumnService.getColumn(colId);\n return column ? column.getColDef().chartDataType : undefined;\n };\n ChartDataModel.prototype.isPivotActive = function () {\n return this.chartColumnService.isPivotActive();\n };\n ChartDataModel.prototype.createCellRange = function (type) {\n var columns = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n columns[_i - 1] = arguments[_i];\n }\n return {\n id: this.chartId,\n startRow: this.referenceCellRange.startRow,\n endRow: this.referenceCellRange.endRow,\n columns: columns,\n startColumn: type === CellRangeType.DIMENSION ? columns[0] : this.referenceCellRange.startColumn,\n type: type\n };\n };\n ChartDataModel.prototype.getAllColumnsFromRanges = function () {\n if (this.pivotChart) {\n return _.convertToSet(this.chartColumnService.getAllDisplayedColumns());\n }\n var columns = this.dimensionCellRange || this.valueCellRange ? [] : this.referenceCellRange.columns;\n if (this.dimensionCellRange) {\n columns.push.apply(columns, __spreadArray$9([], __read$h(this.dimensionCellRange.columns)));\n }\n if (this.valueCellRange) {\n columns.push.apply(columns, __spreadArray$9([], __read$h(this.valueCellRange.columns)));\n }\n return _.convertToSet(columns);\n };\n ChartDataModel.prototype.getRowIndexes = function () {\n var startRow = 0, endRow = 0;\n var _a = this, rangeService = _a.rangeService, valueCellRange = _a.valueCellRange;\n if (rangeService && valueCellRange) {\n startRow = rangeService.getRangeStartRow(valueCellRange).rowIndex;\n // when the last row the cell range is a pinned 'bottom' row, the `endRow` index is set to -1 which results\n // in the ChartDatasource processing all non pinned rows from the `startRow` index.\n var endRowPosition = rangeService.getRangeEndRow(valueCellRange);\n endRow = endRowPosition.rowPinned === 'bottom' ? -1 : endRowPosition.rowIndex;\n }\n return { startRow: startRow, endRow: endRow };\n };\n ChartDataModel.prototype.resetColumnState = function () {\n var _this = this;\n var _a = this.chartColumnService.getChartColumns(), dimensionCols = _a.dimensionCols, valueCols = _a.valueCols;\n var allCols = this.getAllColumnsFromRanges();\n var isInitialising = this.valueColState.length < 1;\n this.dimensionColState = [];\n this.valueColState = [];\n var hasSelectedDimension = false;\n var order = 1;\n var aggFuncDimension = this.suppliedCellRange.columns[0]; //TODO\n dimensionCols.forEach(function (column) {\n var isAutoGroupCol = column.getColId() === 'ag-Grid-AutoColumn';\n var selected = false;\n if (_this.crossFiltering && _this.aggFunc) {\n if (aggFuncDimension.getColId() === column.getColId()) {\n selected = true;\n }\n }\n else {\n selected = isAutoGroupCol ? true : !hasSelectedDimension && allCols.has(column);\n }\n _this.dimensionColState.push({\n column: column,\n colId: column.getColId(),\n displayName: _this.getColDisplayName(column),\n selected: selected,\n order: order++\n });\n if (selected) {\n hasSelectedDimension = true;\n }\n });\n var defaultCategory = {\n colId: ChartDataModel.DEFAULT_CATEGORY,\n displayName: this.chartTranslationService.translate('defaultCategory'),\n selected: !hasSelectedDimension,\n order: 0\n };\n this.dimensionColState.unshift(defaultCategory);\n var valueColumnsFromReferenceRange = this.referenceCellRange.columns.filter(function (c) { return valueCols.has(c); });\n valueCols.forEach(function (column) {\n // first time the value cell range is set, preserve the column order from the supplied range\n if (isInitialising && _.includes(_this.referenceCellRange.columns, column)) {\n column = valueColumnsFromReferenceRange.shift();\n }\n _this.valueColState.push({\n column: column,\n colId: column.getColId(),\n displayName: _this.getColDisplayName(column),\n selected: allCols.has(column),\n order: order++\n });\n });\n };\n ChartDataModel.prototype.updateColumnState = function (updatedCol) {\n var idsMatch = function (cs) { return cs.colId === updatedCol.colId; };\n var _a = this, dimensionColState = _a.dimensionColState, valueColState = _a.valueColState;\n if (dimensionColState.filter(idsMatch).length > 0) {\n // only one dimension should be selected\n dimensionColState.forEach(function (cs) { return cs.selected = idsMatch(cs); });\n }\n else {\n // just update the selected value on the supplied value column\n valueColState.filter(idsMatch).forEach(function (cs) { return cs.selected = updatedCol.selected; });\n }\n var allColumns = __spreadArray$9(__spreadArray$9([], __read$h(dimensionColState)), __read$h(valueColState));\n var orderedColIds = [];\n // calculate new order\n allColumns.forEach(function (col, i) {\n if (i === updatedCol.order) {\n orderedColIds.push(updatedCol.colId);\n }\n if (col.colId !== updatedCol.colId) {\n orderedColIds.push(col.colId);\n }\n });\n // update col state with new order\n allColumns.forEach(function (col) {\n var order = orderedColIds.indexOf(col.colId);\n col.order = order >= 0 ? orderedColIds.indexOf(col.colId) : allColumns.length - 1;\n });\n this.reorderColState();\n };\n ChartDataModel.prototype.reorderColState = function () {\n var ascColStateOrder = function (a, b) { return a.order - b.order; };\n this.dimensionColState.sort(ascColStateOrder);\n this.valueColState.sort(ascColStateOrder);\n };\n ChartDataModel.prototype.setDimensionCellRange = function (dimensionCols, colsInRange, updatedColState) {\n var _this = this;\n this.dimensionCellRange = undefined;\n if (!updatedColState && !this.dimensionColState.length) {\n // use first dimension column in range by default\n dimensionCols.forEach(function (col) {\n if (_this.dimensionCellRange || !colsInRange.has(col)) {\n return;\n }\n _this.dimensionCellRange = _this.createCellRange(CellRangeType.DIMENSION, col);\n });\n return;\n }\n var selectedDimensionColState = updatedColState;\n if (this.crossFiltering && this.aggFunc) {\n var aggFuncDimension_1 = this.suppliedCellRange.columns[0]; //TODO\n selectedDimensionColState = this.dimensionColState.filter(function (cs) { return cs.colId === aggFuncDimension_1.getColId(); })[0];\n }\n else if (!selectedDimensionColState || !dimensionCols.has(selectedDimensionColState.column)) {\n selectedDimensionColState = this.dimensionColState.filter(function (cs) { return cs.selected; })[0];\n }\n if (selectedDimensionColState && selectedDimensionColState.colId !== ChartDataModel.DEFAULT_CATEGORY) {\n this.dimensionCellRange = this.createCellRange(CellRangeType.DIMENSION, selectedDimensionColState.column);\n }\n };\n ChartDataModel.prototype.setValueCellRange = function (valueCols, colsInRange, updatedColState) {\n this.valueCellRange = undefined;\n var selectedValueCols = [];\n valueCols.forEach(function (col) {\n if (updatedColState && updatedColState.colId === col.getColId()) {\n if (updatedColState.selected) {\n selectedValueCols.push(updatedColState.column);\n }\n }\n else if (colsInRange.has(col)) {\n selectedValueCols.push(col);\n }\n });\n if (selectedValueCols.length > 0) {\n var orderedColIds_1 = [];\n if (this.valueColState.length > 0) {\n orderedColIds_1 = this.valueColState.map(function (c) { return c.colId; });\n }\n else {\n colsInRange.forEach(function (c) { return orderedColIds_1.push(c.getColId()); });\n }\n selectedValueCols.sort(function (a, b) { return orderedColIds_1.indexOf(a.getColId()) - orderedColIds_1.indexOf(b.getColId()); });\n this.valueCellRange = this.createCellRange.apply(this, __spreadArray$9([CellRangeType.VALUE], __read$h(selectedValueCols)));\n }\n };\n ChartDataModel.prototype.updateSelectedDimension = function (columns) {\n var colIdSet = new Set(columns.map(function (column) { return column.getColId(); }));\n // if no dimension found in supplied columns use the default category (always index = 0)\n var foundColState = this.dimensionColState.find(function (colState) { return colIdSet.has(colState.colId); }) || this.dimensionColState[0];\n this.dimensionColState = this.dimensionColState.map(function (colState) { return (__assign$k(__assign$k({}, colState), { selected: colState.colId === foundColState.colId })); });\n };\n ChartDataModel.prototype.syncDimensionCellRange = function () {\n var selectedDimension = this.getSelectedDimension();\n if (selectedDimension && selectedDimension.column) {\n this.dimensionCellRange = this.createCellRange(CellRangeType.DIMENSION, selectedDimension.column);\n }\n };\n ChartDataModel.prototype.isComboChart = function () {\n return ['columnLineCombo', 'areaColumnCombo', 'customCombo'].includes(this.chartType);\n };\n ChartDataModel.DEFAULT_CATEGORY = 'AG-GRID-DEFAULT-CATEGORY';\n __decorate$O([\n Autowired('rangeService')\n ], ChartDataModel.prototype, \"rangeService\", void 0);\n __decorate$O([\n Autowired('chartTranslationService')\n ], ChartDataModel.prototype, \"chartTranslationService\", void 0);\n __decorate$O([\n PostConstruct\n ], ChartDataModel.prototype, \"init\", null);\n return ChartDataModel;\n}(BeanStub));\n\nfunction deproxy(chartOrProxy) {\n if (chartOrProxy.chart != null) {\n return chartOrProxy.chart;\n }\n return chartOrProxy;\n}\n\nvar __assign$j = (undefined && undefined.__assign) || function () {\n __assign$j = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$j.apply(this, arguments);\n};\nvar ChartProxy = /** @class */ (function () {\n function ChartProxy(chartProxyParams) {\n this.chartProxyParams = chartProxyParams;\n this.clearThemeOverrides = false;\n this.chart = chartProxyParams.chartInstance;\n this.chartType = chartProxyParams.chartType;\n this.crossFiltering = chartProxyParams.crossFiltering;\n this.crossFilterCallback = chartProxyParams.crossFilterCallback;\n this.standaloneChartType = getSeriesType(this.chartType);\n if (this.chart == null) {\n this.chart = AgChart.create(this.getCommonChartOptions());\n }\n else {\n // On chart change, reset formatting panel changes.\n this.clearThemeOverrides = true;\n }\n }\n ChartProxy.prototype.getChart = function () {\n return deproxy(this.chart);\n };\n ChartProxy.prototype.getChartRef = function () {\n return this.chart;\n };\n ChartProxy.prototype.downloadChart = function (dimensions, fileName, fileFormat) {\n var chart = this.chart;\n var rawChart = deproxy(chart);\n var imageFileName = fileName || (rawChart.title ? rawChart.title.text : 'chart');\n var _a = dimensions || {}, width = _a.width, height = _a.height;\n AgChart.download(chart, { width: width, height: height, fileName: imageFileName, fileFormat: fileFormat });\n };\n ChartProxy.prototype.getChartImageDataURL = function (type) {\n return this.getChart().scene.getDataURL(type);\n };\n ChartProxy.prototype.getChartOptions = function () {\n return this.chart.getOptions();\n };\n ChartProxy.prototype.getChartThemeOverrides = function () {\n var _a;\n var chartOptionsTheme = this.getChartOptions().theme;\n return (_a = chartOptionsTheme.overrides) !== null && _a !== void 0 ? _a : {};\n };\n ChartProxy.prototype.getChartPalette = function () {\n return getChartTheme(this.getChartOptions().theme).palette;\n };\n ChartProxy.prototype.setPaired = function (paired) {\n var _a;\n // Special handling to make scatter charts operate in paired mode by default, where \n // columns alternate between being X and Y (and size for bubble). In standard mode,\n // the first column is used for X and every other column is treated as Y\n // (or alternates between Y and size for bubble)\n var seriesType = getSeriesType(this.chartProxyParams.chartType);\n AgChart.updateDelta(this.chart, { theme: { overrides: (_a = {}, _a[seriesType] = { paired: paired }, _a) } });\n };\n ChartProxy.prototype.isPaired = function () {\n var seriesType = getSeriesType(this.chartProxyParams.chartType);\n return _.get(this.getChartThemeOverrides(), seriesType + \".paired\", true);\n };\n ChartProxy.prototype.lookupCustomChartTheme = function (themeName) {\n return lookupCustomChartTheme(this.chartProxyParams, themeName);\n };\n ChartProxy.prototype.transformData = function (data, categoryKey, categoryAxis) {\n if (categoryAxis) {\n // replace the values for the selected category with a complex object to allow for duplicated categories\n return data.map(function (d, index) {\n var value = d[categoryKey];\n var valueString = value && value.toString ? value.toString() : '';\n var datum = __assign$j({}, d);\n datum[categoryKey] = { id: index, value: value, toString: function () { return valueString; } };\n return datum;\n });\n }\n return data;\n };\n ChartProxy.prototype.getCommonChartOptions = function (updatedOverrides) {\n var _a, _b;\n // Only apply active overrides if chart is initialised.\n var existingOptions = this.clearThemeOverrides ? {} : (_b = (_a = this.chart) === null || _a === void 0 ? void 0 : _a.getOptions()) !== null && _b !== void 0 ? _b : {};\n var formattingPanelOverrides = this.chart != null ?\n { overrides: this.getActiveFormattingPanelOverrides() } : {};\n this.clearThemeOverrides = false;\n return __assign$j(__assign$j({}, existingOptions), { theme: __assign$j(__assign$j({}, createAgChartTheme(this.chartProxyParams, this)), (updatedOverrides ? { overrides: updatedOverrides } : formattingPanelOverrides)), container: this.chartProxyParams.parentElement, mode: 'integrated' });\n };\n ChartProxy.prototype.getActiveFormattingPanelOverrides = function () {\n var _a, _b;\n if (this.clearThemeOverrides) {\n return {};\n }\n var inUseTheme = (_a = this.chart) === null || _a === void 0 ? void 0 : _a.getOptions().theme;\n return (_b = inUseTheme === null || inUseTheme === void 0 ? void 0 : inUseTheme.overrides) !== null && _b !== void 0 ? _b : {};\n };\n ChartProxy.prototype.destroy = function (_a) {\n var _b = _a === void 0 ? {} : _a, _c = _b.keepChartInstance, keepChartInstance = _c === void 0 ? false : _c;\n if (keepChartInstance) {\n return this.chart;\n }\n this.destroyChart();\n };\n ChartProxy.prototype.destroyChart = function () {\n if (this.chart) {\n this.chart.destroy();\n this.chart = undefined;\n }\n };\n return ChartProxy;\n}());\n\nvar __extends$_ = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign$i = (undefined && undefined.__assign) || function () {\n __assign$i = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$i.apply(this, arguments);\n};\nvar CartesianChartProxy = /** @class */ (function (_super) {\n __extends$_(CartesianChartProxy, _super);\n function CartesianChartProxy(params) {\n var _this = _super.call(this, params) || this;\n _this.crossFilteringAllPoints = new Set();\n _this.crossFilteringSelectedPoints = [];\n return _this;\n }\n CartesianChartProxy.prototype.update = function (params) {\n var axes = this.getAxes(params);\n var options = __assign$i(__assign$i({}, this.getCommonChartOptions(params.updatedOverrides)), { data: this.getData(params, axes), axes: axes, series: this.getSeries(params) });\n AgChart.update(this.getChartRef(), options);\n };\n CartesianChartProxy.prototype.getData = function (params, axes) {\n var _a;\n var supportsCrossFiltering = ['area', 'line'].includes(this.standaloneChartType);\n var xPosition = this.standaloneChartType === 'bar' ? 'left' : 'bottom';\n var xAxisIsCategory = ((_a = axes.find(function (o) { return o.position === xPosition; })) === null || _a === void 0 ? void 0 : _a.type) === 'category';\n return this.crossFiltering && supportsCrossFiltering ?\n this.getCrossFilterData(params) :\n this.getDataTransformedData(params, xAxisIsCategory);\n };\n CartesianChartProxy.prototype.getDataTransformedData = function (params, isCategoryAxis) {\n return this.transformData(params.data, params.category.id, isCategoryAxis);\n };\n CartesianChartProxy.prototype.getXAxisType = function (params) {\n if (params.grouping) {\n return 'groupedCategory';\n }\n else if (CartesianChartProxy.isTimeAxis(params)) {\n return 'time';\n }\n return 'category';\n };\n CartesianChartProxy.isTimeAxis = function (params) {\n if (params.category && params.category.chartDataType) {\n return params.category.chartDataType === 'time';\n }\n var testDatum = params.data[0];\n return (testDatum && testDatum[params.category.id]) instanceof Date;\n };\n CartesianChartProxy.prototype.crossFilteringReset = function () {\n this.crossFilteringSelectedPoints = [];\n this.crossFilteringAllPoints.clear();\n };\n CartesianChartProxy.prototype.crossFilteringPointSelected = function (point) {\n return this.crossFilteringSelectedPoints.length == 0 || this.crossFilteringSelectedPoints.includes(point);\n };\n CartesianChartProxy.prototype.crossFilteringDeselectedPoints = function () {\n return this.crossFilteringSelectedPoints.length > 0 &&\n this.crossFilteringAllPoints.size !== this.crossFilteringSelectedPoints.length;\n };\n CartesianChartProxy.prototype.extractLineAreaCrossFilterSeries = function (series, params) {\n var _this = this;\n var getYKey = function (yKey) {\n if (_this.standaloneChartType === 'area') {\n var lastSelectedChartId = params.getCrossFilteringContext().lastSelectedChartId;\n return (lastSelectedChartId === params.chartId) ? yKey + '-total' : yKey;\n }\n return yKey + '-total';\n };\n return series.map(function (s) {\n s.yKey = getYKey(s.yKey);\n s.listeners = {\n nodeClick: function (e) {\n var value = e.datum[s.xKey];\n var multiSelection = e.event.metaKey || e.event.ctrlKey;\n _this.crossFilteringAddSelectedPoint(multiSelection, value);\n _this.crossFilterCallback(e);\n }\n };\n s.marker = {\n formatter: function (p) {\n var category = p.datum[params.category.id];\n return {\n fill: p.highlighted ? 'yellow' : p.fill,\n size: p.highlighted ? 14 : _this.crossFilteringPointSelected(category) ? 8 : 0,\n };\n }\n };\n if (_this.standaloneChartType === 'area') {\n s.fillOpacity = _this.crossFilteringDeselectedPoints() ? 0.3 : 1;\n }\n if (_this.standaloneChartType === 'line') {\n s.strokeOpacity = _this.crossFilteringDeselectedPoints() ? 0.3 : 1;\n }\n return s;\n });\n };\n CartesianChartProxy.prototype.getCrossFilterData = function (params) {\n var _this = this;\n this.crossFilteringAllPoints.clear();\n var colId = params.fields[0].colId;\n var filteredOutColId = colId + \"-filtered-out\";\n var lastSelectedChartId = params.getCrossFilteringContext().lastSelectedChartId;\n return params.data.map(function (d) {\n var category = d[params.category.id];\n _this.crossFilteringAllPoints.add(category);\n var pointSelected = _this.crossFilteringPointSelected(category);\n if (_this.standaloneChartType === 'area' && lastSelectedChartId === params.chartId) {\n d[colId + \"-total\"] = pointSelected ? d[colId] : d[colId] + d[filteredOutColId];\n }\n if (_this.standaloneChartType === 'line') {\n d[colId + \"-total\"] = pointSelected ? d[colId] : d[colId] + d[filteredOutColId];\n }\n return d;\n });\n };\n CartesianChartProxy.prototype.crossFilteringAddSelectedPoint = function (multiSelection, value) {\n multiSelection ? this.crossFilteringSelectedPoints.push(value) : this.crossFilteringSelectedPoints = [value];\n };\n return CartesianChartProxy;\n}(ChartProxy));\n\n// deepMerge\nfunction emptyTarget(value) {\n return Array.isArray(value) ? [] : {};\n}\nfunction cloneUnlessOtherwiseSpecified(value, options) {\n return (options.clone !== false && options.isMergeableObject(value))\n ? deepMerge(emptyTarget(value), value, options)\n : value;\n}\nfunction defaultArrayMerge(target, source, options) {\n return target.concat(source).map(function (element) {\n return cloneUnlessOtherwiseSpecified(element, options);\n });\n}\nfunction getMergeFunction(key, options) {\n if (!options.customMerge) {\n return deepMerge;\n }\n var customMerge = options.customMerge(key);\n return typeof customMerge === 'function' ? customMerge : deepMerge;\n}\nfunction getEnumerableOwnPropertySymbols(target) {\n // @ts-ignore\n return Object.getOwnPropertySymbols\n // @ts-ignore\n ? Object.getOwnPropertySymbols(target).filter(function (symbol) {\n return target.propertyIsEnumerable(symbol);\n })\n : [];\n}\nfunction getKeys(target) {\n return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target));\n}\nfunction propertyIsOnObject(object, property) {\n try {\n return property in object;\n }\n catch (_) {\n return false;\n }\n}\n// Protects from prototype poisoning and unexpected merging up the prototype chain.\nfunction propertyIsUnsafe(target, key) {\n return propertyIsOnObject(target, key) // Properties are safe to merge if they don't exist in the target yet,\n && !(Object.hasOwnProperty.call(target, key) // unsafe if they exist up the prototype chain,\n && Object.propertyIsEnumerable.call(target, key)); // and also unsafe if they're nonenumerable.\n}\nfunction mergeObject(target, source, options) {\n if (target === void 0) { target = {}; }\n if (source === void 0) { source = {}; }\n var destination = {};\n if (options.isMergeableObject(target)) {\n getKeys(target).forEach(function (key) {\n destination[key] = cloneUnlessOtherwiseSpecified(target[key], options);\n });\n }\n getKeys(source).forEach(function (key) {\n if (propertyIsUnsafe(target, key)) {\n return;\n }\n if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {\n destination[key] = getMergeFunction(key, options)(target[key], source[key], options);\n }\n else {\n destination[key] = cloneUnlessOtherwiseSpecified(source[key], options);\n }\n });\n return destination;\n}\nfunction defaultIsMergeableObject(value) {\n return isNonNullObject(value) && !isSpecial(value);\n}\nfunction isNonNullObject(value) {\n return !!value && typeof value === 'object';\n}\nfunction isSpecial(value) {\n var stringValue = Object.prototype.toString.call(value);\n return stringValue === '[object RegExp]' || stringValue === '[object Date]';\n}\nfunction deepMerge(target, source, options) {\n options = options || {};\n options.arrayMerge = options.arrayMerge || defaultArrayMerge;\n options.isMergeableObject = options.isMergeableObject || defaultIsMergeableObject;\n // cloneUnlessOtherwiseSpecified is added to `options` so that custom arrayMerge()\n // implementations can use it. The caller may not replace it.\n options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;\n var sourceIsArray = Array.isArray(source);\n var targetIsArray = Array.isArray(target);\n var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;\n if (!sourceAndTargetTypesMatch) {\n return cloneUnlessOtherwiseSpecified(source, options);\n }\n else if (sourceIsArray) {\n return options.arrayMerge(target, source, options);\n }\n else {\n return mergeObject(target, source, options);\n }\n}\n\nfunction hexToRGBA(hex, alpha) {\n var r = parseInt(hex.slice(1, 3), 16);\n var g = parseInt(hex.slice(3, 5), 16);\n var b = parseInt(hex.slice(5, 7), 16);\n return alpha ? \"rgba(\" + r + \", \" + g + \", \" + b + \", \" + alpha + \")\" : \"rgba(\" + r + \", \" + g + \", \" + b + \")\";\n}\nfunction changeOpacity(fills, alpha) {\n return fills.map(function (fill) {\n var c = Color.fromString(fill);\n return new Color(c.r, c.g, c.b, alpha).toHexString();\n });\n}\n\nvar __extends$Z = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign$h = (undefined && undefined.__assign) || function () {\n __assign$h = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$h.apply(this, arguments);\n};\nvar BarChartProxy = /** @class */ (function (_super) {\n __extends$Z(BarChartProxy, _super);\n function BarChartProxy(params) {\n return _super.call(this, params) || this;\n }\n BarChartProxy.prototype.getAxes = function (params) {\n var isBar = this.standaloneChartType === 'bar';\n var axes = [\n {\n type: this.getXAxisType(params),\n position: isBar ? 'left' : 'bottom',\n },\n {\n type: 'number',\n position: isBar ? 'bottom' : 'left',\n },\n ];\n // Add a default label formatter to show '%' for normalized charts if none is provided\n if (this.isNormalised()) {\n var numberAxis = axes[1];\n numberAxis.label = __assign$h(__assign$h({}, numberAxis.label), { formatter: function (params) { return Math.round(params.value) + '%'; } });\n }\n return axes;\n };\n BarChartProxy.prototype.getSeries = function (params) {\n var _this = this;\n var groupedCharts = ['groupedColumn', 'groupedBar'];\n var isGrouped = !this.crossFiltering && _.includes(groupedCharts, this.chartType);\n var series = params.fields.map(function (f) { return ({\n type: _this.standaloneChartType,\n grouped: isGrouped,\n stacked: ['stackedColumn', 'normalizedColumn', 'stackedBar', 'normalizedBar'].includes(_this.chartType),\n normalizedTo: _this.isNormalised() ? 100 : undefined,\n xKey: params.category.id,\n xName: params.category.name,\n yKey: f.colId,\n yName: f.displayName\n }); });\n return this.crossFiltering ? this.extractCrossFilterSeries(series) : series;\n };\n BarChartProxy.prototype.extractCrossFilterSeries = function (series) {\n var _this = this;\n var palette = this.getChartPalette();\n var updatePrimarySeries = function (seriesOptions, index) {\n return __assign$h(__assign$h({}, seriesOptions), { highlightStyle: { item: { fill: undefined } }, fill: palette === null || palette === void 0 ? void 0 : palette.fills[index], stroke: palette === null || palette === void 0 ? void 0 : palette.strokes[index], listeners: {\n nodeClick: _this.crossFilterCallback\n } });\n };\n var updateFilteredOutSeries = function (seriesOptions) {\n var yKey = seriesOptions.yKey + '-filtered-out';\n return __assign$h(__assign$h({}, deepMerge({}, seriesOptions)), { yKey: yKey, fill: hexToRGBA(seriesOptions.fill, '0.3'), stroke: hexToRGBA(seriesOptions.stroke, '0.3'), showInLegend: false });\n };\n var allSeries = [];\n for (var i = 0; i < series.length; i++) {\n // update primary series\n var primarySeries = updatePrimarySeries(series[i], i);\n allSeries.push(primarySeries);\n // add 'filtered-out' series\n allSeries.push(updateFilteredOutSeries(primarySeries));\n }\n return allSeries;\n };\n BarChartProxy.prototype.isNormalised = function () {\n var normalisedCharts = ['normalizedColumn', 'normalizedBar'];\n return !this.crossFiltering && _.includes(normalisedCharts, this.chartType);\n };\n return BarChartProxy;\n}(CartesianChartProxy));\n\nvar __extends$Y = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign$g = (undefined && undefined.__assign) || function () {\n __assign$g = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$g.apply(this, arguments);\n};\nvar AreaChartProxy = /** @class */ (function (_super) {\n __extends$Y(AreaChartProxy, _super);\n function AreaChartProxy(params) {\n return _super.call(this, params) || this;\n }\n AreaChartProxy.prototype.getAxes = function (params) {\n var axes = [\n {\n type: this.getXAxisType(params),\n position: 'bottom',\n },\n {\n type: 'number',\n position: 'left',\n },\n ];\n // Add a default label formatter to show '%' for normalized charts if none is provided\n if (this.isNormalised()) {\n var numberAxis = axes[1];\n numberAxis.label = __assign$g(__assign$g({}, numberAxis.label), { formatter: function (params) { return Math.round(params.value) + '%'; } });\n }\n return axes;\n };\n AreaChartProxy.prototype.getSeries = function (params) {\n var _this = this;\n var series = params.fields.map(function (f) { return ({\n type: _this.standaloneChartType,\n xKey: params.category.id,\n xName: params.category.name,\n yKey: f.colId,\n yName: f.displayName,\n normalizedTo: _this.chartType === 'normalizedArea' ? 100 : undefined,\n stacked: ['normalizedArea', 'stackedArea'].includes(_this.chartType)\n }); });\n return this.crossFiltering ? this.extractLineAreaCrossFilterSeries(series, params) : series;\n };\n AreaChartProxy.prototype.isNormalised = function () {\n return !this.crossFiltering && this.chartType === 'normalizedArea';\n };\n return AreaChartProxy;\n}(CartesianChartProxy));\n\nvar __extends$X = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar LineChartProxy = /** @class */ (function (_super) {\n __extends$X(LineChartProxy, _super);\n function LineChartProxy(params) {\n return _super.call(this, params) || this;\n }\n LineChartProxy.prototype.getAxes = function (params) {\n return [\n {\n type: this.getXAxisType(params),\n position: 'bottom'\n },\n {\n type: 'number',\n position: 'left'\n },\n ];\n };\n LineChartProxy.prototype.getSeries = function (params) {\n var _this = this;\n var series = params.fields.map(function (f) { return ({\n type: _this.standaloneChartType,\n xKey: params.category.id,\n xName: params.category.name,\n yKey: f.colId,\n yName: f.displayName\n }); });\n return this.crossFiltering ? this.extractLineAreaCrossFilterSeries(series, params) : series;\n };\n return LineChartProxy;\n}(CartesianChartProxy));\n\nvar __extends$W = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign$f = (undefined && undefined.__assign) || function () {\n __assign$f = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$f.apply(this, arguments);\n};\nvar PieChartProxy = /** @class */ (function (_super) {\n __extends$W(PieChartProxy, _super);\n function PieChartProxy(params) {\n return _super.call(this, params) || this;\n }\n PieChartProxy.prototype.update = function (params) {\n var data = params.data, category = params.category;\n var options = __assign$f(__assign$f({}, this.getCommonChartOptions(params.updatedOverrides)), { data: this.crossFiltering ? this.getCrossFilterData(params) : this.transformData(data, category.id), series: this.getSeries(params) });\n AgChart.update(this.getChartRef(), options);\n };\n PieChartProxy.prototype.getSeries = function (params) {\n var _this = this;\n var numFields = params.fields.length;\n var offset = {\n currentOffset: 0,\n offsetAmount: numFields > 1 ? 20 : 40\n };\n var series = this.getFields(params).map(function (f) {\n var _a;\n // options shared by 'pie' and 'doughnut' charts\n var options = {\n type: _this.standaloneChartType,\n angleKey: f.colId,\n angleName: f.displayName,\n sectorLabelKey: f.colId,\n calloutLabelKey: params.category.id,\n calloutLabelName: params.category.name,\n };\n if (_this.chartType === 'doughnut') {\n var _b = PieChartProxy.calculateOffsets(offset), outerRadiusOffset = _b.outerRadiusOffset, innerRadiusOffset = _b.innerRadiusOffset;\n var title = f.displayName ? {\n title: { text: f.displayName, showInLegend: numFields > 1 },\n } : undefined;\n // augment shared options with 'doughnut' specific options\n return __assign$f(__assign$f(__assign$f(__assign$f({}, options), { outerRadiusOffset: outerRadiusOffset, innerRadiusOffset: innerRadiusOffset }), title), { calloutLine: {\n colors: (_a = _this.getChartPalette()) === null || _a === void 0 ? void 0 : _a.strokes,\n } });\n }\n return options;\n });\n return this.crossFiltering ? this.extractCrossFilterSeries(series) : series;\n };\n PieChartProxy.prototype.getCrossFilterData = function (params) {\n var colId = params.fields[0].colId;\n var filteredOutColId = colId + \"-filtered-out\";\n return params.data.map(function (d) {\n var total = d[colId] + d[filteredOutColId];\n d[colId + \"-total\"] = total;\n d[filteredOutColId] = 1; // normalise to 1\n d[colId] = d[colId] / total; // fraction of 1\n return d;\n });\n };\n PieChartProxy.prototype.extractCrossFilterSeries = function (series) {\n var _this = this;\n var palette = this.getChartPalette();\n var primaryOptions = function (seriesOptions) {\n return __assign$f(__assign$f({}, seriesOptions), { calloutLabel: { enabled: false }, highlightStyle: { item: { fill: undefined } }, radiusKey: seriesOptions.angleKey, angleKey: seriesOptions.angleKey + '-total', radiusMin: 0, radiusMax: 1, listeners: {\n nodeClick: _this.crossFilterCallback,\n } });\n };\n var filteredOutOptions = function (seriesOptions, angleKey) {\n var _a, _b;\n return __assign$f(__assign$f({}, deepMerge({}, primaryOpts)), { radiusKey: angleKey + '-filtered-out', fills: changeOpacity((_a = seriesOptions.fills) !== null && _a !== void 0 ? _a : palette.fills, 0.3), strokes: changeOpacity((_b = seriesOptions.strokes) !== null && _b !== void 0 ? _b : palette.strokes, 0.3), showInLegend: false });\n };\n // currently, only single 'doughnut' cross-filter series are supported\n var primarySeries = series[0];\n // update primary series\n var angleKey = primarySeries.angleKey;\n var primaryOpts = primaryOptions(primarySeries);\n return [\n filteredOutOptions(primarySeries, angleKey),\n primaryOpts,\n ];\n };\n PieChartProxy.calculateOffsets = function (offset) {\n var outerRadiusOffset = offset.currentOffset;\n offset.currentOffset -= offset.offsetAmount;\n var innerRadiusOffset = offset.currentOffset;\n offset.currentOffset -= offset.offsetAmount;\n return { outerRadiusOffset: outerRadiusOffset, innerRadiusOffset: innerRadiusOffset };\n };\n PieChartProxy.prototype.getFields = function (params) {\n return this.chartType === 'pie' ? params.fields.slice(0, 1) : params.fields;\n };\n PieChartProxy.prototype.crossFilteringReset = function () {\n // not required in pie charts\n };\n return PieChartProxy;\n}(ChartProxy));\n\nvar __extends$V = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign$e = (undefined && undefined.__assign) || function () {\n __assign$e = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$e.apply(this, arguments);\n};\nvar __values$5 = (undefined && undefined.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nvar __read$g = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray$8 = (undefined && undefined.__spreadArray) || function (to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\n to[j] = from[i];\n return to;\n};\nvar ScatterChartProxy = /** @class */ (function (_super) {\n __extends$V(ScatterChartProxy, _super);\n function ScatterChartProxy(params) {\n return _super.call(this, params) || this;\n }\n ScatterChartProxy.prototype.getAxes = function (_params) {\n return [\n {\n type: 'number',\n position: 'bottom',\n },\n {\n type: 'number',\n position: 'left',\n },\n ];\n };\n ScatterChartProxy.prototype.getSeries = function (params) {\n var _this = this;\n var paired = this.isPaired();\n var seriesDefinitions = this.getSeriesDefinitions(params.fields, paired);\n var labelFieldDefinition = params.category.id === ChartDataModel.DEFAULT_CATEGORY ? undefined : params.category;\n var series = seriesDefinitions.map(function (seriesDefinition) { return ({\n type: _this.standaloneChartType,\n xKey: seriesDefinition.xField.colId,\n xName: seriesDefinition.xField.displayName,\n yKey: seriesDefinition.yField.colId,\n yName: seriesDefinition.yField.displayName,\n title: seriesDefinition.yField.displayName + \" vs \" + seriesDefinition.xField.displayName,\n sizeKey: seriesDefinition.sizeField ? seriesDefinition.sizeField.colId : undefined,\n sizeName: seriesDefinition.sizeField ? seriesDefinition.sizeField.displayName : undefined,\n labelKey: labelFieldDefinition ? labelFieldDefinition.id : seriesDefinition.yField.colId,\n labelName: labelFieldDefinition ? labelFieldDefinition.name : undefined,\n }); });\n return this.crossFiltering ? this.extractCrossFilterSeries(series, params) : series;\n };\n ScatterChartProxy.prototype.extractCrossFilterSeries = function (series, params) {\n var _this = this;\n var data = params.data;\n var palette = this.getChartPalette();\n var filteredOutKey = function (key) { return key + \"-filtered-out\"; };\n var calcMarkerDomain = function (data, sizeKey) {\n var e_1, _a;\n var _b;\n var markerDomain = [Infinity, -Infinity];\n if (sizeKey != null) {\n try {\n for (var data_1 = __values$5(data), data_1_1 = data_1.next(); !data_1_1.done; data_1_1 = data_1.next()) {\n var datum = data_1_1.value;\n var value = (_b = datum[sizeKey]) !== null && _b !== void 0 ? _b : datum[filteredOutKey(sizeKey)];\n if (value < markerDomain[0]) {\n markerDomain[0] = value;\n }\n if (value > markerDomain[1]) {\n markerDomain[1] = value;\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (data_1_1 && !data_1_1.done && (_a = data_1.return)) _a.call(data_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n }\n if (markerDomain[0] <= markerDomain[1]) {\n return markerDomain;\n }\n return undefined;\n };\n var updatePrimarySeries = function (series, idx) {\n var sizeKey = series.sizeKey;\n var fill = palette === null || palette === void 0 ? void 0 : palette.fills[idx];\n var stroke = palette === null || palette === void 0 ? void 0 : palette.strokes[idx];\n var markerDomain = calcMarkerDomain(data, sizeKey);\n var marker = __assign$e(__assign$e({}, series.marker), { fill: fill, stroke: stroke, domain: markerDomain });\n return __assign$e(__assign$e({}, series), { marker: marker, highlightStyle: { item: { fill: 'yellow' } }, listeners: __assign$e(__assign$e({}, series.listeners), { nodeClick: _this.crossFilterCallback }) });\n };\n var updateFilteredOutSeries = function (series) {\n var sizeKey = series.sizeKey, yKey = series.yKey, xKey = series.xKey;\n if (sizeKey != null) {\n sizeKey = filteredOutKey(sizeKey);\n }\n return __assign$e(__assign$e({}, series), { yKey: filteredOutKey(yKey), xKey: filteredOutKey(xKey), marker: __assign$e(__assign$e({}, series.marker), { fillOpacity: 0.3, strokeOpacity: 0.3 }), sizeKey: sizeKey, showInLegend: false, listeners: __assign$e(__assign$e({}, series.listeners), { nodeClick: function (e) {\n var _a;\n var value = e.datum[filteredOutKey(xKey)];\n // Need to remove the `-filtered-out` suffixes from the event so that\n // upstream processing maps the event correctly onto grid column ids.\n var filterableEvent = __assign$e(__assign$e({}, e), { xKey: xKey, datum: __assign$e(__assign$e({}, e.datum), (_a = {}, _a[xKey] = value, _a)) });\n _this.crossFilterCallback(filterableEvent);\n } }) });\n };\n var updatedSeries = series.map(updatePrimarySeries);\n return __spreadArray$8(__spreadArray$8([], __read$g(updatedSeries)), __read$g(updatedSeries.map(updateFilteredOutSeries)));\n };\n ScatterChartProxy.prototype.getSeriesDefinitions = function (fields, paired) {\n if (fields.length < 2) {\n return [];\n }\n var isBubbleChart = this.chartType === 'bubble';\n if (paired) {\n if (isBubbleChart) {\n return fields.map(function (currentXField, i) { return i % 3 === 0 ? ({\n xField: currentXField,\n yField: fields[i + 1],\n sizeField: fields[i + 2],\n }) : null; }).filter(function (x) { return x && x.yField && x.sizeField; });\n }\n return fields.map(function (currentXField, i) { return i % 2 === 0 ? ({\n xField: currentXField,\n yField: fields[i + 1],\n }) : null; }).filter(function (x) { return x && x.yField; });\n }\n var xField = fields[0];\n if (isBubbleChart) {\n return fields\n .map(function (yField, i) { return i % 2 === 1 ? ({\n xField: xField,\n yField: yField,\n sizeField: fields[i + 1],\n }) : null; })\n .filter(function (x) { return x && x.sizeField; });\n }\n return fields.filter(function (value, i) { return i > 0; }).map(function (yField) { return ({ xField: xField, yField: yField }); });\n };\n return ScatterChartProxy;\n}(CartesianChartProxy));\n\nvar __extends$U = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar HistogramChartProxy = /** @class */ (function (_super) {\n __extends$U(HistogramChartProxy, _super);\n function HistogramChartProxy(params) {\n return _super.call(this, params) || this;\n }\n HistogramChartProxy.prototype.getSeries = function (params) {\n var firstField = params.fields[0]; // multiple series are not supported!\n return [\n {\n type: this.standaloneChartType,\n xKey: firstField.colId,\n xName: firstField.displayName,\n yName: this.chartProxyParams.translate(\"histogramFrequency\"),\n areaPlot: false, // only constant width is supported via integrated charts\n }\n ];\n };\n HistogramChartProxy.prototype.getAxes = function (_params) {\n return [\n {\n type: 'number',\n position: 'bottom',\n },\n {\n type: 'number',\n position: 'left',\n },\n ];\n };\n return HistogramChartProxy;\n}(CartesianChartProxy));\n\nvar __extends$T = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar ChartOptionsService = /** @class */ (function (_super) {\n __extends$T(ChartOptionsService, _super);\n function ChartOptionsService(chartController) {\n var _this = _super.call(this) || this;\n _this.chartController = chartController;\n return _this;\n }\n ChartOptionsService.prototype.getChartOption = function (expression) {\n // TODO: We shouldn't be reading the chart implementation directly, but right now\n // it isn't possible to either get option defaults OR retrieve themed options.\n return _.get(this.getChart(), expression, undefined);\n };\n ChartOptionsService.prototype.setChartOption = function (expression, value, isSilent) {\n var _this = this;\n var chartSeriesTypes = this.chartController.getChartSeriesTypes();\n if (this.chartController.isComboChart()) {\n chartSeriesTypes.push('cartesian');\n }\n var chartOptions = {};\n // we need to update chart options on each series type for combo charts\n chartSeriesTypes.forEach(function (seriesType) {\n chartOptions = deepMerge(chartOptions, _this.createChartOptions({\n seriesType: seriesType,\n expression: expression,\n value: value\n }));\n });\n this.updateChart(chartOptions);\n if (!isSilent) {\n this.raiseChartOptionsChangedEvent();\n }\n };\n ChartOptionsService.prototype.awaitChartOptionUpdate = function (func) {\n var chart = this.chartController.getChartProxy().getChart();\n chart.waitForUpdate().then(function () { return func(); })\n .catch(function (e) { return console.error(\"AG Grid - chart update failed\", e); });\n };\n ChartOptionsService.prototype.getAxisProperty = function (expression) {\n var _a;\n return _.get((_a = this.getChart().axes) === null || _a === void 0 ? void 0 : _a[0], expression, undefined);\n };\n ChartOptionsService.prototype.setAxisProperty = function (expression, value) {\n var _this = this;\n var _a;\n // update axis options\n var chart = this.getChart();\n var chartOptions = {};\n (_a = chart.axes) === null || _a === void 0 ? void 0 : _a.forEach(function (axis) {\n chartOptions = deepMerge(chartOptions, _this.getUpdateAxisOptions(axis, expression, value));\n });\n this.updateChart(chartOptions);\n this.raiseChartOptionsChangedEvent();\n };\n ChartOptionsService.prototype.getLabelRotation = function (axisType) {\n var axis = this.getAxis(axisType);\n return _.get(axis, 'label.rotation', undefined);\n };\n ChartOptionsService.prototype.setLabelRotation = function (axisType, value) {\n var chartAxis = this.getAxis(axisType);\n if (chartAxis) {\n var chartOptions = this.getUpdateAxisOptions(chartAxis, 'label.rotation', value);\n this.updateChart(chartOptions);\n this.raiseChartOptionsChangedEvent();\n }\n };\n ChartOptionsService.prototype.getSeriesOption = function (expression, seriesType) {\n var series = this.getChart().series.find(function (s) { return ChartOptionsService.isMatchingSeries(seriesType, s); });\n return _.get(series, expression, undefined);\n };\n ChartOptionsService.prototype.setSeriesOption = function (expression, value, seriesType) {\n var chartOptions = this.createChartOptions({\n seriesType: seriesType,\n expression: \"series.\" + expression,\n value: value\n });\n this.updateChart(chartOptions);\n this.raiseChartOptionsChangedEvent();\n };\n ChartOptionsService.prototype.getPairedMode = function () {\n return this.chartController.getChartProxy().isPaired();\n };\n ChartOptionsService.prototype.setPairedMode = function (paired) {\n this.chartController.getChartProxy().setPaired(paired);\n };\n ChartOptionsService.prototype.getAxis = function (axisType) {\n var chart = this.getChart();\n if (!chart.axes || chart.axes.length < 1) {\n return undefined;\n }\n if (axisType === 'xAxis') {\n return (chart.axes && chart.axes[0].direction === 'x') ? chart.axes[0] : chart.axes[1];\n }\n return (chart.axes && chart.axes[1].direction === 'y') ? chart.axes[1] : chart.axes[0];\n };\n ChartOptionsService.prototype.getUpdateAxisOptions = function (chartAxis, expression, value) {\n var seriesType = getSeriesType(this.getChartType());\n var validAxisTypes = ['number', 'category', 'time', 'groupedCategory'];\n if (!validAxisTypes.includes(chartAxis.type)) {\n return {};\n }\n return this.createChartOptions({\n seriesType: seriesType,\n expression: \"axes.\" + chartAxis.type + \".\" + expression,\n value: value\n });\n };\n ChartOptionsService.prototype.getChartType = function () {\n return this.chartController.getChartType();\n };\n ChartOptionsService.prototype.getChart = function () {\n return this.chartController.getChartProxy().getChart();\n };\n ChartOptionsService.prototype.updateChart = function (chartOptions) {\n var chartRef = this.chartController.getChartProxy().getChartRef();\n AgChart.updateDelta(chartRef, chartOptions);\n };\n ChartOptionsService.prototype.createChartOptions = function (_a) {\n var seriesType = _a.seriesType, expression = _a.expression, value = _a.value;\n var overrides = {};\n var chartOptions = {\n theme: {\n overrides: overrides\n }\n };\n _.set(overrides, seriesType + \".\" + expression, value);\n return chartOptions;\n };\n ChartOptionsService.prototype.raiseChartOptionsChangedEvent = function () {\n var chartModel = this.chartController.getChartModel();\n var event = {\n type: Events.EVENT_CHART_OPTIONS_CHANGED,\n chartId: chartModel.chartId,\n chartType: chartModel.chartType,\n chartThemeName: this.chartController.getChartThemeName(),\n chartOptions: chartModel.chartOptions\n };\n this.eventService.dispatchEvent(event);\n };\n ChartOptionsService.isMatchingSeries = function (seriesType, series) {\n return VALID_SERIES_TYPES.includes(seriesType) && series.type === seriesType;\n };\n ChartOptionsService.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n };\n return ChartOptionsService;\n}(BeanStub));\n\nvar __extends$S = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign$d = (undefined && undefined.__assign) || function () {\n __assign$d = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$d.apply(this, arguments);\n};\nvar ComboChartProxy = /** @class */ (function (_super) {\n __extends$S(ComboChartProxy, _super);\n function ComboChartProxy(params) {\n return _super.call(this, params) || this;\n }\n ComboChartProxy.prototype.getAxes = function (params) {\n var fields = params ? params.fields : [];\n var fieldsMap = new Map(fields.map(function (f) { return [f.colId, f]; }));\n var _a = this.getYKeys(fields, params.seriesChartTypes), primaryYKeys = _a.primaryYKeys, secondaryYKeys = _a.secondaryYKeys;\n var axes = [\n {\n type: this.getXAxisType(params),\n position: 'bottom',\n gridStyle: [{ stroke: undefined }],\n },\n ];\n if (primaryYKeys.length > 0) {\n axes.push({\n type: 'number',\n keys: primaryYKeys,\n position: 'left',\n });\n }\n if (secondaryYKeys.length > 0) {\n secondaryYKeys.forEach(function (secondaryYKey, i) {\n var field = fieldsMap.get(secondaryYKey);\n var secondaryAxisIsVisible = field && field.colId === secondaryYKey;\n if (!secondaryAxisIsVisible) {\n return;\n }\n var secondaryAxisOptions = {\n type: 'number',\n keys: [secondaryYKey],\n position: 'right',\n };\n var primaryYAxis = primaryYKeys.some(function (primaryYKey) { return !!fieldsMap.get(primaryYKey); });\n var lastSecondaryAxis = i === secondaryYKeys.length - 1;\n if (!primaryYAxis && lastSecondaryAxis) ;\n else {\n secondaryAxisOptions.gridStyle = [{ stroke: undefined }];\n }\n axes.push(secondaryAxisOptions);\n });\n }\n return axes;\n };\n ComboChartProxy.prototype.getSeries = function (params) {\n var fields = params.fields, category = params.category, seriesChartTypes = params.seriesChartTypes;\n return fields.map(function (field) {\n var seriesChartType = seriesChartTypes.find(function (s) { return s.colId === field.colId; });\n if (seriesChartType) {\n var chartType = seriesChartType.chartType;\n var grouped = ['groupedColumn', 'groupedBar'].includes(chartType);\n var groupedOpts = grouped ? { grouped: true } : {};\n return __assign$d({ type: getSeriesType(chartType), xKey: category.id, yKey: field.colId, yName: field.displayName, stacked: ['stackedArea', 'stackedColumn'].includes(chartType) }, groupedOpts);\n }\n });\n };\n ComboChartProxy.prototype.getYKeys = function (fields, seriesChartTypes) {\n var primaryYKeys = [];\n var secondaryYKeys = [];\n fields.forEach(function (field) {\n var colId = field.colId;\n var seriesChartType = seriesChartTypes.find(function (s) { return s.colId === colId; });\n if (seriesChartType) {\n seriesChartType.secondaryAxis ? secondaryYKeys.push(colId) : primaryYKeys.push(colId);\n }\n });\n return { primaryYKeys: primaryYKeys, secondaryYKeys: secondaryYKeys };\n };\n return ComboChartProxy;\n}(CartesianChartProxy));\n\nvar __extends$R = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$N = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __read$f = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar GridChartComp = /** @class */ (function (_super) {\n __extends$R(GridChartComp, _super);\n function GridChartComp(params) {\n var _this = _super.call(this, GridChartComp.TEMPLATE) || this;\n _this.params = params;\n return _this;\n }\n GridChartComp.prototype.init = function () {\n var _this = this;\n var availableChartThemes = this.gridOptionsService.get('chartThemes') || DEFAULT_THEMES;\n if (availableChartThemes.length < 1) {\n throw new Error('Cannot create chart: no chart themes are available to be used.');\n }\n var chartThemeName = this.params.chartThemeName;\n if (!_.includes(availableChartThemes, chartThemeName)) {\n chartThemeName = availableChartThemes[0];\n }\n var modelParams = {\n chartId: this.params.chartId,\n pivotChart: this.params.pivotChart,\n chartType: this.params.chartType,\n chartThemeName: chartThemeName,\n aggFunc: this.params.aggFunc,\n cellRange: this.params.cellRange,\n suppressChartRanges: this.params.suppressChartRanges,\n unlinkChart: this.params.unlinkChart,\n crossFiltering: this.params.crossFiltering,\n seriesChartTypes: this.params.seriesChartTypes,\n };\n var isRtl = this.gridOptionsService.is('enableRtl');\n this.addCssClass(isRtl ? 'ag-rtl' : 'ag-ltr');\n // only the chart controller interacts with the chart model\n var model = this.createBean(new ChartDataModel(modelParams));\n this.chartController = this.createManagedBean(new ChartController(model));\n this.validateCustomThemes();\n // create chart before dialog to ensure dialog is correct size\n this.createChart();\n if (this.params.insideDialog) {\n this.addDialog();\n }\n this.addMenu();\n this.addTitleEditComp();\n this.addManagedListener(this.getGui(), 'focusin', this.setActiveChartCellRange.bind(this));\n this.addManagedListener(this.chartController, ChartController.EVENT_CHART_MODEL_UPDATE, this.update.bind(this));\n if (this.chartMenu) {\n // chart menu may not exist, i.e. cross filtering\n this.addManagedListener(this.chartMenu, ChartMenu.EVENT_DOWNLOAD_CHART, function () { return _this.downloadChart(); });\n }\n this.update();\n this.raiseChartCreatedEvent();\n };\n GridChartComp.prototype.validateCustomThemes = function () {\n var suppliedThemes = this.getChartThemes();\n var customChartThemes = this.gridOptionsService.get('customChartThemes');\n if (customChartThemes) {\n _.getAllKeysInObjects([customChartThemes]).forEach(function (customThemeName) {\n if (!_.includes(suppliedThemes, customThemeName)) {\n console.warn(\"AG Grid: a custom chart theme with the name '\" + customThemeName + \"' has been \" +\n \"supplied but not added to the 'chartThemes' list\");\n }\n });\n }\n };\n GridChartComp.prototype.createChart = function () {\n var _this = this;\n // if chart already exists, destroy it and remove it from DOM\n var chartInstance = undefined;\n if (this.chartProxy) {\n chartInstance = this.chartProxy.destroy({ keepChartInstance: true });\n }\n var crossFilterCallback = function (event, reset) {\n var ctx = _this.params.crossFilteringContext;\n ctx.lastSelectedChartId = reset ? '' : _this.chartController.getChartId();\n if (reset) {\n _this.params.crossFilteringResetCallback();\n }\n _this.crossFilterService.filter(event, reset);\n };\n var chartType = this.chartController.getChartType();\n var chartProxyParams = {\n chartType: chartType,\n chartInstance: chartInstance,\n getChartThemeName: this.getChartThemeName.bind(this),\n getChartThemes: this.getChartThemes.bind(this),\n customChartThemes: this.gridOptionsService.get('customChartThemes'),\n getGridOptionsChartThemeOverrides: function () { return _this.getGridOptionsChartThemeOverrides(); },\n getExtraPaddingDirections: function () { var _a, _b; return (_b = (_a = _this.chartMenu) === null || _a === void 0 ? void 0 : _a.getExtraPaddingDirections()) !== null && _b !== void 0 ? _b : []; },\n apiChartThemeOverrides: this.params.chartThemeOverrides,\n crossFiltering: this.params.crossFiltering,\n crossFilterCallback: crossFilterCallback,\n parentElement: this.eChart,\n grouping: this.chartController.isGrouping(),\n chartThemeToRestore: this.params.chartThemeName,\n chartOptionsToRestore: this.params.chartOptionsToRestore,\n chartPaletteToRestore: this.params.chartPaletteToRestore,\n seriesChartTypes: this.chartController.getSeriesChartTypes(),\n translate: function (toTranslate, defaultText) { return _this.chartTranslationService.translate(toTranslate, defaultText); },\n };\n // ensure 'restoring' options are not reused when switching chart types\n this.params.chartOptionsToRestore = undefined;\n // set local state used to detect when chart changes\n this.chartType = chartType;\n this.chartThemeName = this.chartController.getChartThemeName();\n this.chartProxy = GridChartComp.createChartProxy(chartProxyParams);\n if (!this.chartProxy) {\n console.warn('AG Grid: invalid chart type supplied: ', chartProxyParams.chartType);\n return;\n }\n var canvas = this.eChart.querySelector('canvas');\n if (canvas) {\n canvas.classList.add('ag-charts-canvas');\n }\n this.chartController.setChartProxy(this.chartProxy);\n this.chartOptionsService = this.createBean(new ChartOptionsService(this.chartController));\n this.titleEdit && this.titleEdit.refreshTitle(this.chartController, this.chartOptionsService);\n };\n GridChartComp.prototype.getChartThemeName = function () {\n return this.chartController.getChartThemeName();\n };\n GridChartComp.prototype.getChartThemes = function () {\n return this.chartController.getThemes();\n };\n GridChartComp.prototype.getGridOptionsChartThemeOverrides = function () {\n return this.gridOptionsService.get('chartThemeOverrides');\n };\n GridChartComp.createChartProxy = function (chartProxyParams) {\n switch (chartProxyParams.chartType) {\n case 'column':\n case 'bar':\n case 'groupedColumn':\n case 'stackedColumn':\n case 'normalizedColumn':\n case 'groupedBar':\n case 'stackedBar':\n case 'normalizedBar':\n return new BarChartProxy(chartProxyParams);\n case 'pie':\n case 'doughnut':\n return new PieChartProxy(chartProxyParams);\n case 'area':\n case 'stackedArea':\n case 'normalizedArea':\n return new AreaChartProxy(chartProxyParams);\n case 'line':\n return new LineChartProxy(chartProxyParams);\n case 'scatter':\n case 'bubble':\n return new ScatterChartProxy(chartProxyParams);\n case 'histogram':\n return new HistogramChartProxy(chartProxyParams);\n case 'columnLineCombo':\n case 'areaColumnCombo':\n case 'customCombo':\n return new ComboChartProxy(chartProxyParams);\n default:\n throw \"AG Grid: Unable to create chart as an invalid chartType = '\" + chartProxyParams.chartType + \"' was supplied.\";\n }\n };\n GridChartComp.prototype.addDialog = function () {\n var _this = this;\n var title = this.chartTranslationService.translate(this.params.pivotChart ? 'pivotChartTitle' : 'rangeChartTitle');\n var _a = this.getBestDialogSize(), width = _a.width, height = _a.height;\n this.chartDialog = new AgDialog({\n resizable: true,\n movable: true,\n maximizable: true,\n title: title,\n width: width,\n height: height,\n component: this,\n centered: true,\n closable: true\n });\n this.getContext().createBean(this.chartDialog);\n this.chartDialog.addEventListener(AgDialog.EVENT_DESTROYED, function () { return _this.destroy(); });\n };\n GridChartComp.prototype.getBestDialogSize = function () {\n var popupParent = this.popupService.getPopupParent();\n var maxWidth = _.getAbsoluteWidth(popupParent) * 0.75;\n var maxHeight = _.getAbsoluteHeight(popupParent) * 0.75;\n var ratio = 0.553;\n var chart = this.chartProxy.getChart();\n var width = this.params.insideDialog ? 850 : chart.width;\n var height = this.params.insideDialog ? 470 : chart.height;\n if (width > maxWidth || height > maxHeight) {\n width = Math.min(width, maxWidth);\n height = Math.round(width * ratio);\n if (height > maxHeight) {\n height = maxHeight;\n width = Math.min(width, Math.round(height / ratio));\n }\n }\n return { width: width, height: height };\n };\n GridChartComp.prototype.addMenu = function () {\n if (!this.params.crossFiltering) {\n this.chartMenu = this.createBean(new ChartMenu(this.eChartContainer, this.eMenuContainer, this.chartController, this.chartOptionsService));\n this.eChartContainer.appendChild(this.chartMenu.getGui());\n }\n };\n GridChartComp.prototype.addTitleEditComp = function () {\n this.titleEdit = this.createBean(new TitleEdit(this.chartMenu));\n this.eTitleEditContainer.appendChild(this.titleEdit.getGui());\n if (this.chartProxy) {\n this.titleEdit.refreshTitle(this.chartController, this.chartOptionsService);\n }\n };\n GridChartComp.prototype.update = function (params) {\n var _this = this;\n // update chart model for api.updateChart()\n if (params === null || params === void 0 ? void 0 : params.chartId) {\n var validUpdate = this.chartController.update(params);\n if (!validUpdate) {\n return; // warning already logged!\n }\n }\n var chartTypeChanged = this.chartTypeChanged(params);\n // recreate chart if chart type has changed\n if (chartTypeChanged)\n this.createChart();\n // update chart options if chart type hasn't changed or if overrides are supplied\n this.updateChart(params === null || params === void 0 ? void 0 : params.chartThemeOverrides);\n if (params === null || params === void 0 ? void 0 : params.chartId) {\n this.chartProxy.getChart().waitForUpdate().then(function () {\n _this.chartController.raiseChartApiUpdateEvent();\n });\n }\n };\n GridChartComp.prototype.updateChart = function (updatedOverrides) {\n var _this = this;\n var chartProxy = this.chartProxy;\n var selectedCols = this.chartController.getSelectedValueColState();\n var fields = selectedCols.map(function (c) { return ({ colId: c.colId, displayName: c.displayName }); });\n var data = this.chartController.getChartData();\n var chartEmpty = this.handleEmptyChart(data, fields);\n if (chartEmpty) {\n return;\n }\n var chartUpdateParams = this.chartController.getChartUpdateParams(updatedOverrides);\n chartProxy.update(chartUpdateParams);\n this.chartProxy.getChart().waitForUpdate().then(function () {\n _this.chartController.raiseChartUpdatedEvent();\n });\n this.titleEdit.refreshTitle(this.chartController, this.chartOptionsService);\n };\n GridChartComp.prototype.chartTypeChanged = function (updateParams) {\n var _a = __read$f([this.chartController.getChartType(), updateParams === null || updateParams === void 0 ? void 0 : updateParams.chartType], 2), currentType = _a[0], updatedChartType = _a[1];\n return this.chartType !== currentType || (!!updatedChartType && this.chartType !== updatedChartType);\n };\n GridChartComp.prototype.getChartModel = function () {\n return this.chartController.getChartModel();\n };\n GridChartComp.prototype.getChartImageDataURL = function (fileFormat) {\n return this.chartProxy.getChartImageDataURL(fileFormat);\n };\n GridChartComp.prototype.handleEmptyChart = function (data, fields) {\n var pivotModeDisabled = this.chartController.isPivotChart() && !this.chartController.isPivotMode();\n var minFieldsRequired = 1;\n if (this.chartController.isActiveXYChart()) {\n minFieldsRequired = this.chartController.getChartType() === 'bubble' ? 3 : 2;\n }\n var isEmptyChart = fields.length < minFieldsRequired || data.length === 0;\n if (this.eChart) {\n var isEmpty = pivotModeDisabled || isEmptyChart;\n _.setDisplayed(this.eChart, !isEmpty);\n _.setDisplayed(this.eEmpty, isEmpty);\n }\n if (pivotModeDisabled) {\n this.eEmpty.innerText = this.chartTranslationService.translate('pivotChartRequiresPivotMode');\n return true;\n }\n if (isEmptyChart) {\n this.eEmpty.innerText = this.chartTranslationService.translate('noDataToChart');\n return true;\n }\n return false;\n };\n GridChartComp.prototype.downloadChart = function (dimensions, fileName, fileFormat) {\n this.chartProxy.downloadChart(dimensions, fileName, fileFormat);\n };\n GridChartComp.prototype.openChartToolPanel = function (panel) {\n var menuPanel = panel ? CHART_TOOL_PANEL_MENU_OPTIONS[panel] : panel;\n this.chartMenu.showMenu(menuPanel);\n };\n GridChartComp.prototype.closeChartToolPanel = function () {\n this.chartMenu.hideMenu();\n };\n GridChartComp.prototype.getChartId = function () {\n return this.chartController.getChartId();\n };\n GridChartComp.prototype.getUnderlyingChart = function () {\n return this.chartProxy.getChartRef();\n };\n GridChartComp.prototype.crossFilteringReset = function () {\n this.chartProxy.crossFilteringReset();\n };\n GridChartComp.prototype.setActiveChartCellRange = function (focusEvent) {\n if (this.getGui().contains(focusEvent.relatedTarget)) {\n return;\n }\n this.chartController.setChartRange(true);\n this.gridApi.focusService.clearFocusedCell();\n };\n GridChartComp.prototype.raiseChartCreatedEvent = function () {\n var _this = this;\n var event = {\n type: Events.EVENT_CHART_CREATED,\n chartId: this.chartController.getChartId()\n };\n this.chartProxy.getChart().waitForUpdate().then(function () {\n _this.eventService.dispatchEvent(event);\n });\n };\n GridChartComp.prototype.raiseChartDestroyedEvent = function () {\n var event = {\n type: Events.EVENT_CHART_DESTROYED,\n chartId: this.chartController.getChartId(),\n };\n this.eventService.dispatchEvent(event);\n };\n GridChartComp.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n if (this.chartProxy) {\n this.chartProxy.destroy();\n }\n this.destroyBean(this.chartMenu);\n this.destroyBean(this.titleEdit);\n // don't want to invoke destroy() on the Dialog (prevents destroy loop)\n if (this.chartDialog && this.chartDialog.isAlive()) {\n this.destroyBean(this.chartDialog);\n }\n // if the user is providing containers for the charts, we need to clean up, otherwise the old chart\n // data will still be visible although the chart is no longer bound to the grid\n var eGui = this.getGui();\n _.clearElement(eGui);\n // remove from parent, so if user provided container, we detach from the provided dom element\n _.removeFromParent(eGui);\n this.raiseChartDestroyedEvent();\n };\n GridChartComp.TEMPLATE = \"
\\n
\\n
\\n
\\n
\\n
\\n
\\n
\";\n __decorate$N([\n RefSelector('eChart')\n ], GridChartComp.prototype, \"eChart\", void 0);\n __decorate$N([\n RefSelector('eChartContainer')\n ], GridChartComp.prototype, \"eChartContainer\", void 0);\n __decorate$N([\n RefSelector('eMenuContainer')\n ], GridChartComp.prototype, \"eMenuContainer\", void 0);\n __decorate$N([\n RefSelector('eEmpty')\n ], GridChartComp.prototype, \"eEmpty\", void 0);\n __decorate$N([\n RefSelector('eTitleEditContainer')\n ], GridChartComp.prototype, \"eTitleEditContainer\", void 0);\n __decorate$N([\n Autowired('chartCrossFilterService')\n ], GridChartComp.prototype, \"crossFilterService\", void 0);\n __decorate$N([\n Autowired('chartTranslationService')\n ], GridChartComp.prototype, \"chartTranslationService\", void 0);\n __decorate$N([\n Autowired('gridApi')\n ], GridChartComp.prototype, \"gridApi\", void 0);\n __decorate$N([\n Autowired('popupService')\n ], GridChartComp.prototype, \"popupService\", void 0);\n __decorate$N([\n PostConstruct\n ], GridChartComp.prototype, \"init\", null);\n return GridChartComp;\n}(Component));\n\n// DO NOT UPDATE MANUALLY: Generated from script during build time\nvar VERSION$a = '30.0.6';\n\nvar __assign$c = (undefined && undefined.__assign) || function () {\n __assign$c = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$c.apply(this, arguments);\n};\nvar __rest$1 = (undefined && undefined.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nvar __read$e = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __values$4 = (undefined && undefined.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nfunction upgradeChartModel(model) {\n model.version;\n if (model.version == null) {\n // Try to guess the version so we can apply the right subset of migrations.\n model.version = heuristicVersionDetection(model);\n }\n model = migrateIfBefore('23.0.0', model, migrateV23);\n model = migrateIfBefore('24.0.0', model, migrateV24);\n model = migrateIfBefore('25.1.0', model, migrateV25_1);\n model = migrateIfBefore('26.0.0', model, migrateV26);\n model = migrateIfBefore('26.1.0', model, migrateV26_1);\n // Switch from iChartOptions to iAgChartOptions....\n model = migrateIfBefore('26.2.0', model, migrateV26_2);\n model = migrateIfBefore('28.0.0', model, migrateV28);\n model = migrateIfBefore('28.2.0', model, migrateV28_2);\n model = migrateIfBefore('29.0.0', model, migrateV29);\n model = migrateIfBefore('29.1.0', model, migrateV29_1);\n model = migrateIfBefore('29.2.0', model, migrateV29_2);\n model = migrateIfBefore('30.0.0', model, migrateV30);\n model = cleanup(model);\n // Bump version to latest.\n model = migrateIfBefore(VERSION$a, model, function (m) { return m; });\n return model;\n}\nfunction migrateV23(model) {\n // https://github.com/ag-grid/ag-grid/commit/76c6744ff2b732d298d1ade73c122188854b5bac\n model = jsonRename('chartOptions.legend.item.marker.type', 'shape', model);\n model = jsonRename('chartOptions.seriesDefaults.marker.type', 'shape', model);\n // https://github.com/ag-grid/ag-grid/commit/7bdf2cfd666acda758a818733a9f9cb35ac1d7a7\n model = jsonRename('chartOptions.legend.padding', 'spacing', model);\n return model;\n}\nfunction migrateV24(model) {\n var _a;\n // https://github.com/ag-grid/ag-grid/commit/f4e854e3dc459400fa00e6da2873cb8e9cfff6fe#\n model = jsonDelete('chartOptions.seriesDefaults.marker.minSize', model);\n var _b = model, chartType = _b.chartType, chartPalette = _b.chartPalette, // Migrate.\n _c = _b.chartOptions, xAxis = _c.xAxis, yAxis = _c.yAxis, chartOptions = __rest$1(_c, [\"xAxis\", \"yAxis\"]), chartModel = __rest$1(_b, [\"chartType\", \"chartPalette\", \"chartOptions\"]);\n var axesTypes = getLegacyAxisType(chartType);\n var axes = axesTypes === null || axesTypes === void 0 ? void 0 : axesTypes.map(function (type, i) { return (__assign$c({ type: type }, (i === 0 ? xAxis : yAxis))); });\n return __assign$c({ chartType: chartType, chartThemeName: (_a = LEGACY_PALETTES[chartPalette]) !== null && _a !== void 0 ? _a : 'ag-default', chartOptions: __assign$c(__assign$c({}, chartOptions), { axes: axes, xAxis: xAxis, yAxis: yAxis }) }, chartModel);\n}\nfunction migrateV25_1(model) {\n // https://github.com/ag-grid/ag-grid/commit/61943f9fecbfb5ac1b9a1fd93788f9fdd8687181\n model = jsonRename('chartOptions.seriesDefaults.label.minRequiredAngle', 'minAngle', model);\n return model;\n}\nfunction migrateV26(model) {\n // https://github.com/ag-grid/ag-grid/commit/df2445d88e64cb4e831d6163104a0fa60ccde3b5\n var highlightOptUpdate = function (_a) {\n var dimOpacity = _a.dimOpacity, opts = __rest$1(_a, [\"dimOpacity\"]);\n return (__assign$c(__assign$c({}, opts), (dimOpacity != null ? { series: { dimOpacity: dimOpacity } } : {})));\n };\n model = jsonMutate('chartOptions.seriesDefaults.highlightStyle', model, highlightOptUpdate);\n // https://github.com/ag-grid/ag-grid/commit/f4e854e3dc459400fa00e6da2873cb8e9cfff6fe#\n model = jsonDelete('chart', model);\n model = jsonDelete('chartOptions.seriesDefaults.tooltipClass', model);\n model = jsonDelete('chartOptions.seriesDefaults.tooltipTracking', model);\n // Cleanup label.rotation === 0, which was treated as 'use the default' on reload prior to 26.\n model = jsonDeleteDefault('chartOptions.axes[].label.rotation', 0, model);\n model = jsonDeleteDefault('chartOptions.axes[].label.rotation', 335, model);\n return model;\n}\nfunction migrateV26_1(model) {\n // https://github.com/ag-grid/ag-grid/commit/df2445d88e64cb4e831d6163104a0fa60ccde3b5\n var highlightOptUpdate = function (_a) {\n var item = _a.item, series = _a.series, opts = __rest$1(_a, [\"item\", \"series\"]);\n return (__assign$c({ item: __assign$c(__assign$c({}, opts), item) }, (series ? { series: series } : {})));\n };\n model = jsonMutate('chartOptions.seriesDefaults.highlightStyle', model, highlightOptUpdate);\n model = jsonMutate('chartOptions.series[].highlightStyle', model, highlightOptUpdate);\n return model;\n}\nfunction migrateV26_2(model) {\n // https://github.com/ag-grid/ag-grid/commit/8b2e223cb1a687cb6c1d70b9f75f52fa29d00341\n model = jsonMove('chartOptions.seriesDefaults.fill.opacity', 'chartOptions.seriesDefaults.fillOpacity', model);\n model = jsonMove('chartOptions.seriesDefaults.stroke.opacity', 'chartOptions.seriesDefaults.strokeOpacity', model);\n model = jsonMove('chartOptions.seriesDefaults.stroke.width', 'chartOptions.seriesDefaults.strokeWidth', model);\n model = jsonDelete('chartOptions.seriesDefaults.fill', model);\n model = jsonDelete('chartOptions.seriesDefaults.stroke', model);\n model = jsonDelete('chartOptions.seriesDefaults.callout.colors', model);\n model = jsonDelete('chartOptions.xAxis', model);\n model = jsonDelete('chartOptions.yAxis', model);\n var _a = model, chartType = _a.chartType, _b = _a.chartOptions, axes = _b.axes; _b.series; var seriesDefaults = _b.seriesDefaults, otherChartOptions = __rest$1(_b, [\"axes\", \"series\", \"seriesDefaults\"]), otherModelProps = __rest$1(_a, [\"chartType\", \"chartOptions\"]);\n // At 26.2.0 combination charts weren't supported, so we can safely assume a single series type.\n // We can't rely on the `series.type` field as it was incorrect (in v25.0.0 line chart has an\n // `area` series).\n var seriesTypes = [getSeriesType(chartType)];\n var chartTypeMixin = {};\n if (!seriesTypes.includes('pie')) {\n var minimalAxis_1 = { top: {}, bottom: {}, left: {}, right: {} };\n var updatedAxes_1 = axes\n .map(function (_a) {\n var _b;\n var type = _a.type, axisProps = __rest$1(_a, [\"type\"]);\n return (_b = {},\n _b[type] = __assign$c(__assign$c({}, minimalAxis_1), axisProps),\n _b);\n })\n .reduce(merge, {});\n ALL_AXIS_TYPES.filter(function (v) { return updatedAxes_1[v] == null; }).forEach(function (v) {\n updatedAxes_1[v] = __assign$c({}, minimalAxis_1);\n });\n chartTypeMixin.axes = updatedAxes_1;\n }\n var updatedChartOptions = seriesTypes\n .map(function (t) {\n var _a;\n return (_a = {},\n _a[t] = __assign$c(__assign$c(__assign$c({}, chartTypeMixin), { series: seriesDefaults }), otherChartOptions),\n _a);\n })\n .reduce(merge, {});\n model = __assign$c(__assign$c({}, otherModelProps), { chartType: chartType, chartOptions: updatedChartOptions });\n return model;\n}\nfunction migrateV28(model) {\n model = jsonDelete('chartOptions.*.title.padding', model);\n model = jsonDelete('chartOptions.*.subtitle.padding', model);\n model = jsonDelete('chartOptions.*.axes.*.title.padding', model);\n model = jsonBackfill('chartOptions.*.axes.*.title.enabled', false, model);\n return model;\n}\nfunction migrateV28_2(model) {\n model = jsonRename('chartOptions.pie.series.callout', 'calloutLine', model);\n model = jsonRename('chartOptions.pie.series.label', 'calloutLabel', model);\n model = jsonRename('chartOptions.pie.series.labelKey', 'sectorLabelKey', model);\n model = jsonRename('chartOptions.pie.series.labelName', 'sectorLabelName', model);\n // series.yKeys => yKey ?\n // series.yNames => yName ?\n return model;\n}\nfunction migrateV29(model) {\n model = jsonMoveIfMissing('chartOptions.scatter.series.fill', 'chartOptions.scatter.series.marker.fill', model);\n model = jsonMoveIfMissing('chartOptions.scatter.series.fillOpacity', 'chartOptions.scatter.series.marker.fillOpacity', model);\n model = jsonMoveIfMissing('chartOptions.scatter.series.stroke', 'chartOptions.scatter.series.marker.stroke', model);\n model = jsonMoveIfMissing('chartOptions.scatter.series.strokeOpacity', 'chartOptions.scatter.series.marker.strokeOpacity', model);\n model = jsonMoveIfMissing('chartOptions.scatter.series.strokeWidth', 'chartOptions.scatter.series.marker.strokeWidth', model);\n model = jsonMove('chartOptions.scatter.series.paired', 'chartOptions.scatter.paired', model);\n return model;\n}\nfunction migrateV29_1(model) {\n model = jsonDelete('chartOptions.axes[].tick.count', model);\n return model;\n}\nfunction migrateV29_2(model) {\n // https://github.com/ag-grid/ag-grid/commit/ce11956492e42e845932edb4e05d7b0b21db5c61\n var tooltipOptUpdate = function (_a) {\n var _b, _c, _d, _e;\n var tracking = _a.tracking, opts = __rest$1(_a, [\"tracking\"]);\n var output = __assign$c({}, opts);\n if (tracking === false) {\n (_b = output.position) !== null && _b !== void 0 ? _b : (output.position = { type: 'pointer' });\n (_c = output.range) !== null && _c !== void 0 ? _c : (output.range = 'nearest');\n }\n else if (tracking === true) {\n (_d = output.position) !== null && _d !== void 0 ? _d : (output.position = { type: 'node' });\n (_e = output.range) !== null && _e !== void 0 ? _e : (output.range = 'nearest');\n }\n return output;\n };\n model = jsonMutate('chartOptions.*.tooltip', model, tooltipOptUpdate);\n return model;\n}\nfunction migrateV30(model) {\n // Repeated from migrateV28_2() as they were applied retrospectively for the v30 release.\n model = jsonRename('chartOptions.pie.series.labelKey', 'sectorLabelKey', model);\n model = jsonRename('chartOptions.pie.series.labelName', 'sectorLabelName', model);\n // Late-applied migrations for deprecations in the 29.x.y range.\n model = migrateV29_1(model);\n model = migrateV29_2(model);\n // Actual v30 changes.\n model = jsonDelete('chartOptions.*.series.flipXY', model);\n model = jsonAdd('chartOptions.common.legend.enabled', true, model);\n model = jsonBackfill('chartOptions.common.legend.position', 'right', model);\n return model;\n}\nfunction cleanup(model) {\n // Remove fixed width/height - this has never been supported via UI configuration.\n model = jsonDelete('chartOptions.*.width', model);\n model = jsonDelete('chartOptions.*.height', model);\n model = jsonBackfill('chartOptions.*.axes.category.label.autoRotate', true, model);\n return model;\n}\nfunction heuristicVersionDetection(model) {\n var _a, _b;\n var modelAny = model;\n if (model.version != null) {\n return model.version;\n }\n var hasKey = function (obj) {\n var keys = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n keys[_i - 1] = arguments[_i];\n }\n return Object.keys(obj || {}).some(function (k) { return keys.includes(k); });\n };\n var chartOptions = modelAny.chartOptions;\n var seriesOptions = hasKey(chartOptions, 'seriesDefaults')\n ? chartOptions === null || chartOptions === void 0 ? void 0 : chartOptions.seriesDefaults\n : chartOptions === null || chartOptions === void 0 ? void 0 : chartOptions[Object.keys(chartOptions)[0]];\n var hints = {\n '27.0.0': hasKey(modelAny, 'seriesChartTypes'),\n '26.2.0': !hasKey(chartOptions, 'seriesDefaults'),\n '26.1.0': hasKey(seriesOptions === null || seriesOptions === void 0 ? void 0 : seriesOptions.highlightStyle, 'item'),\n '26.0.0': hasKey(seriesOptions === null || seriesOptions === void 0 ? void 0 : seriesOptions.highlightStyle, 'series'),\n // '26.0.0': modelAny.chart === undefined,\n '25.1.0': hasKey(seriesOptions === null || seriesOptions === void 0 ? void 0 : seriesOptions.label, 'minAngle'),\n '25.0.0': hasKey(modelAny, 'modelType', 'aggFunc', 'unlinkChart', 'suppressChartRanges') ||\n hasKey(seriesOptions, 'lineDash', 'lineDashOffset'),\n '24.0.0': hasKey(modelAny, 'chartThemeName', 'chart') || hasKey(chartOptions, 'series'),\n '23.2.0': hasKey(chartOptions, 'navigator'),\n '23.0.0': hasKey((_b = (_a = chartOptions === null || chartOptions === void 0 ? void 0 : chartOptions.legend) === null || _a === void 0 ? void 0 : _a.item) === null || _b === void 0 ? void 0 : _b.marker, 'shape'),\n '22.1.0': hasKey(modelAny, 'chartPalette', 'chartType'),\n };\n // Default to 27.1.0, the last version before we added `version`.\n var defaultVersion = '27.1.0';\n var matchingHints = Object.entries(hints).filter(function (_a) {\n var _b = __read$e(_a, 2); _b[0]; var match = _b[1];\n return match;\n });\n var _c = __read$e(matchingHints[0], 1), _d = _c[0], heuristicVersion = _d === void 0 ? defaultVersion : _d;\n return heuristicVersion;\n}\nfunction migrateIfBefore(maxVersion, model, migration) {\n if (versionNumber(maxVersion) > versionNumber(model.version)) {\n var result = migration(model);\n result.version = maxVersion;\n return result;\n }\n return model;\n}\nfunction versionParts(version) {\n var split = typeof version === 'string' ? version.split('.').map(function (v) { return Number(v); }) : [];\n if (split.length !== 3 || split.some(function (v) { return isNaN(v); })) {\n throw new Error('AG Grid - Illegal version string: ' + version);\n }\n return {\n major: split[0],\n minor: split[1],\n patch: split[2],\n };\n}\nfunction versionNumber(version) {\n var _a = versionParts(version), major = _a.major, minor = _a.minor, patch = _a.patch;\n // Return a number of the form MMmmPP.\n return major * 10000 + minor * 100 + patch;\n}\nfunction jsonDeleteDefault(path, defaultValue, json) {\n return jsonMutateProperty(path, true, json, function (parent, prop) {\n if (parent[prop] === defaultValue) {\n delete parent[prop];\n }\n });\n}\nfunction jsonBackfill(path, defaultValue, json) {\n return jsonMutateProperty(path, false, json, function (parent, prop) {\n if (parent[prop] == null) {\n parent[prop] = defaultValue;\n }\n });\n}\nfunction jsonAdd(path, value, json) {\n var _a;\n if (typeof path === 'string') {\n path = path.split('.');\n }\n var nextPath = path[0];\n if (path.length > 1) {\n json[nextPath] = jsonAdd(path.slice(1), value, (_a = json[nextPath]) !== null && _a !== void 0 ? _a : {});\n }\n var hasProperty = Object.keys(json).includes(nextPath);\n if (!hasProperty) {\n json[nextPath] = value;\n }\n return json;\n}\nfunction jsonMove(from, to, json) {\n var valueToMove = undefined;\n var valueFound = false;\n json = jsonMutateProperty(from, true, json, function (parent, prop) {\n valueFound = true;\n valueToMove = parent[prop];\n delete parent[prop];\n });\n if (!valueFound) {\n return json;\n }\n return jsonMutateProperty(to, false, json, function (parent, prop) {\n parent[prop] = valueToMove;\n });\n}\nfunction jsonMoveIfMissing(from, to, json) {\n var valueToMove = undefined;\n var valueFound = false;\n json = jsonMutateProperty(from, true, json, function (parent, prop) {\n valueFound = true;\n valueToMove = parent[prop];\n delete parent[prop];\n });\n if (!valueFound) {\n return json;\n }\n return jsonMutateProperty(to, false, json, function (parent, prop) {\n if (parent[prop] === undefined) {\n parent[prop] = valueToMove;\n }\n });\n}\nfunction jsonRename(path, renameTo, json) {\n return jsonMutateProperty(path, true, json, function (parent, prop) {\n parent[renameTo] = parent[prop];\n delete parent[prop];\n });\n}\nfunction jsonDelete(path, json) {\n return jsonMutateProperty(path, true, json, function (parent, prop) { return delete parent[prop]; });\n}\nfunction jsonMutateProperty(path, skipMissing, json, mutator) {\n var pathElements = path instanceof Array ? path : path.split('.');\n var parentPathElements = pathElements.slice(0, pathElements.length - 1);\n var targetName = pathElements[pathElements.length - 1];\n return jsonMutate(parentPathElements, json, function (parent) {\n var hasProperty = Object.keys(parent).includes(targetName);\n if (skipMissing && !hasProperty) {\n return parent;\n }\n var result = __assign$c({}, parent);\n mutator(result, targetName);\n return result;\n });\n}\nfunction jsonMutate(path, json, mutator) {\n var e_1, _a;\n var pathElements = path instanceof Array ? path : path.split('.');\n // Clone to avoid mutating original input.\n json = __assign$c({}, json);\n if (pathElements.length === 0) {\n return mutator(json);\n }\n else if (pathElements[0].startsWith('{')) {\n var pathOptions = pathElements[0].substring(1, pathElements[0].lastIndexOf('}')).split(',');\n try {\n for (var pathOptions_1 = __values$4(pathOptions), pathOptions_1_1 = pathOptions_1.next(); !pathOptions_1_1.done; pathOptions_1_1 = pathOptions_1.next()) {\n var pathOption = pathOptions_1_1.value;\n if (json[pathOption] != null) {\n json[pathOption] = jsonMutate(pathElements.slice(1), json[pathOption], mutator);\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (pathOptions_1_1 && !pathOptions_1_1.done && (_a = pathOptions_1.return)) _a.call(pathOptions_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n }\n else if (pathElements[0].endsWith('[]')) {\n var arrayName = pathElements[0].substring(0, path[0].indexOf('['));\n if (json[arrayName] instanceof Array) {\n json[arrayName] = json[arrayName].map(function (v) { return jsonMutate(pathElements.slice(1), v, mutator); });\n }\n }\n else if (pathElements[0] === '*') {\n for (var jsonProp in json) {\n json[jsonProp] = jsonMutate(pathElements.slice(1), json[jsonProp], mutator);\n }\n }\n else if (json[pathElements[0]] != null) {\n json[pathElements[0]] = jsonMutate(pathElements.slice(1), json[pathElements[0]], mutator);\n }\n return json;\n}\nvar merge = function (r, n) { return (__assign$c(__assign$c({}, r), n)); };\n// Precise legacy palette fills/strokes can be found here for future reference:\n// https://github.com/ag-grid/ag-grid/blob/b22.1.0/grid-enterprise-modules/charts/src/charts/chart/palettes.ts\nvar LEGACY_PALETTES = {\n borneo: 'ag-default',\n material: 'ag-material',\n pastel: 'ag-pastel',\n bright: 'ag-vivid',\n flat: 'ag-solar',\n};\n\nvar __extends$Q = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign$b = (undefined && undefined.__assign) || function () {\n __assign$b = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$b.apply(this, arguments);\n};\nvar __decorate$M = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __read$d = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray$7 = (undefined && undefined.__spreadArray) || function (to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\n to[j] = from[i];\n return to;\n};\nvar ChartService = /** @class */ (function (_super) {\n __extends$Q(ChartService, _super);\n function ChartService() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n // we destroy all charts bound to this grid when grid is destroyed. activeCharts contains all charts, including\n // those in developer provided containers.\n _this.activeCharts = new Set();\n _this.activeChartComps = new Set();\n // this shared (singleton) context is used by cross filtering in line and area charts\n _this.crossFilteringContext = {\n lastSelectedChartId: '',\n };\n return _this;\n }\n ChartService.prototype.updateChart = function (params) {\n if (this.activeChartComps.size === 0) {\n console.warn(\"AG Grid - No active charts to update.\");\n return;\n }\n var chartComp = __spreadArray$7([], __read$d(this.activeChartComps)).find(function (chartComp) { return chartComp.getChartId() === params.chartId; });\n if (!chartComp) {\n console.warn(\"AG Grid - Unable to update chart. No active chart found with ID: \" + params.chartId + \".\");\n return;\n }\n chartComp.update(params);\n };\n ChartService.prototype.getChartModels = function () {\n var models = [];\n var versionedModel = function (c) {\n return __assign$b(__assign$b({}, c), { version: VERSION$a });\n };\n this.activeChartComps.forEach(function (c) { return models.push(versionedModel(c.getChartModel())); });\n return models;\n };\n ChartService.prototype.getChartRef = function (chartId) {\n var chartRef;\n this.activeCharts.forEach(function (cr) {\n if (cr.chartId === chartId) {\n chartRef = cr;\n }\n });\n return chartRef;\n };\n ChartService.prototype.getChartComp = function (chartId) {\n var chartComp;\n this.activeChartComps.forEach(function (comp) {\n if (comp.getChartId() === chartId) {\n chartComp = comp;\n }\n });\n return chartComp;\n };\n ChartService.prototype.getChartImageDataURL = function (params) {\n var url;\n this.activeChartComps.forEach(function (c) {\n if (c.getChartId() === params.chartId) {\n url = c.getChartImageDataURL(params.fileFormat);\n }\n });\n return url;\n };\n ChartService.prototype.downloadChart = function (params) {\n var chartComp = Array.from(this.activeChartComps).find(function (c) { return c.getChartId() === params.chartId; });\n chartComp === null || chartComp === void 0 ? void 0 : chartComp.downloadChart(params.dimensions, params.fileName, params.fileFormat);\n };\n ChartService.prototype.openChartToolPanel = function (params) {\n var chartComp = Array.from(this.activeChartComps).find(function (c) { return c.getChartId() === params.chartId; });\n chartComp === null || chartComp === void 0 ? void 0 : chartComp.openChartToolPanel(params.panel);\n };\n ChartService.prototype.closeChartToolPanel = function (chartId) {\n var chartComp = Array.from(this.activeChartComps).find(function (c) { return c.getChartId() === chartId; });\n chartComp === null || chartComp === void 0 ? void 0 : chartComp.closeChartToolPanel();\n };\n ChartService.prototype.createChartFromCurrentRange = function (chartType) {\n if (chartType === void 0) { chartType = 'groupedColumn'; }\n var selectedRange = this.getSelectedRange();\n return this.createChart(selectedRange, chartType);\n };\n ChartService.prototype.restoreChart = function (model, chartContainer) {\n var _this = this;\n if (!model) {\n console.warn(\"AG Grid - unable to restore chart as no chart model is provided\");\n return;\n }\n if (model.version !== VERSION$a) {\n model = upgradeChartModel(model);\n }\n var params = {\n cellRange: model.cellRange,\n chartType: model.chartType,\n chartThemeName: model.chartThemeName,\n chartContainer: chartContainer,\n suppressChartRanges: model.suppressChartRanges,\n aggFunc: model.aggFunc,\n unlinkChart: model.unlinkChart,\n seriesChartTypes: model.seriesChartTypes\n };\n var getCellRange = function (cellRangeParams) {\n return _this.rangeService\n ? _this.rangeService.createCellRangeFromCellRangeParams(cellRangeParams)\n : undefined;\n };\n if (model.modelType === 'pivot') {\n // if required enter pivot mode\n if (!this.columnModel.isPivotMode()) {\n this.columnModel.setPivotMode(true, \"pivotChart\");\n }\n // pivot chart range contains all visible column without a row range to include all rows\n var columns = this.columnModel.getAllDisplayedColumns().map(function (col) { return col.getColId(); });\n var chartAllRangeParams = {\n rowStartIndex: null,\n rowStartPinned: undefined,\n rowEndIndex: null,\n rowEndPinned: undefined,\n columns: columns\n };\n var cellRange_1 = getCellRange(chartAllRangeParams);\n if (!cellRange_1) {\n console.warn(\"AG Grid - unable to create chart as there are no columns in the grid.\");\n return;\n }\n return this.createChart(cellRange_1, params.chartType, params.chartThemeName, true, true, params.chartContainer, undefined, undefined, params.unlinkChart, false, model.chartOptions);\n }\n var cellRange = getCellRange(params.cellRange);\n if (!cellRange) {\n console.warn(\"AG Grid - unable to create chart as no range is selected\");\n return;\n }\n return this.createChart(cellRange, params.chartType, params.chartThemeName, false, params.suppressChartRanges, params.chartContainer, params.aggFunc, undefined, params.unlinkChart, false, model.chartOptions, model.chartPalette, params.seriesChartTypes);\n };\n ChartService.prototype.createRangeChart = function (params) {\n var _a;\n var cellRange = (_a = this.rangeService) === null || _a === void 0 ? void 0 : _a.createCellRangeFromCellRangeParams(params.cellRange);\n if (!cellRange) {\n console.warn(\"AG Grid - unable to create chart as no range is selected\");\n return;\n }\n return this.createChart(cellRange, params.chartType, params.chartThemeName, false, params.suppressChartRanges, params.chartContainer, params.aggFunc, params.chartThemeOverrides, params.unlinkChart, undefined, undefined, undefined, params.seriesChartTypes);\n };\n ChartService.prototype.createPivotChart = function (params) {\n // if required enter pivot mode\n if (!this.columnModel.isPivotMode()) {\n this.columnModel.setPivotMode(true, \"pivotChart\");\n }\n // pivot chart range contains all visible column without a row range to include all rows\n var chartAllRangeParams = {\n rowStartIndex: null,\n rowStartPinned: undefined,\n rowEndIndex: null,\n rowEndPinned: undefined,\n columns: this.columnModel.getAllDisplayedColumns().map(function (col) { return col.getColId(); })\n };\n var cellRange = this.rangeService\n ? this.rangeService.createCellRangeFromCellRangeParams(chartAllRangeParams)\n : undefined;\n if (!cellRange) {\n console.warn(\"AG Grid - unable to create chart as there are no columns in the grid.\");\n return;\n }\n return this.createChart(cellRange, params.chartType, params.chartThemeName, true, true, params.chartContainer, undefined, params.chartThemeOverrides, params.unlinkChart);\n };\n ChartService.prototype.createCrossFilterChart = function (params) {\n var _a;\n var cellRange = (_a = this.rangeService) === null || _a === void 0 ? void 0 : _a.createCellRangeFromCellRangeParams(params.cellRange);\n if (!cellRange) {\n console.warn(\"AG Grid - unable to create chart as no range is selected\");\n return;\n }\n var crossFiltering = true;\n var suppressChartRangesSupplied = typeof params.suppressChartRanges !== 'undefined' && params.suppressChartRanges !== null;\n var suppressChartRanges = suppressChartRangesSupplied ? params.suppressChartRanges : true;\n return this.createChart(cellRange, params.chartType, params.chartThemeName, false, suppressChartRanges, params.chartContainer, params.aggFunc, params.chartThemeOverrides, params.unlinkChart, crossFiltering);\n };\n ChartService.prototype.createChart = function (cellRange, chartType, chartThemeName, pivotChart, suppressChartRanges, container, aggFunc, chartThemeOverrides, unlinkChart, crossFiltering, chartOptionsToRestore, chartPaletteToRestore, seriesChartTypes) {\n var _this = this;\n if (pivotChart === void 0) { pivotChart = false; }\n if (suppressChartRanges === void 0) { suppressChartRanges = false; }\n if (unlinkChart === void 0) { unlinkChart = false; }\n if (crossFiltering === void 0) { crossFiltering = false; }\n var createChartContainerFunc = this.gridOptionsService.getCallback('createChartContainer');\n var params = {\n chartId: this.generateId(),\n pivotChart: pivotChart,\n cellRange: cellRange,\n chartType: chartType,\n chartThemeName: chartThemeName,\n insideDialog: !(container || createChartContainerFunc),\n suppressChartRanges: suppressChartRanges,\n aggFunc: aggFunc,\n chartThemeOverrides: chartThemeOverrides,\n unlinkChart: unlinkChart,\n crossFiltering: crossFiltering,\n crossFilteringContext: this.crossFilteringContext,\n chartOptionsToRestore: chartOptionsToRestore,\n chartPaletteToRestore: chartPaletteToRestore,\n seriesChartTypes: seriesChartTypes,\n crossFilteringResetCallback: function () { return _this.activeChartComps.forEach(function (c) { return c.crossFilteringReset(); }); }\n };\n var chartComp = new GridChartComp(params);\n this.context.createBean(chartComp);\n var chartRef = this.createChartRef(chartComp);\n if (container) {\n // if container exists, means developer initiated chart create via API, so place in provided container\n container.appendChild(chartComp.getGui());\n // if the chart container was placed outside an element that\n // has the grid's theme, we manually add the current theme to\n // make sure all styles for the chartMenu are rendered correctly\n var theme = this.environment.getTheme();\n if (theme.el && !theme.el.contains(container)) {\n container.classList.add(theme.theme);\n }\n }\n else if (createChartContainerFunc) {\n // otherwise, user created chart via grid UI, check if developer provides containers (e.g. if the application\n // is using its own dialogs rather than the grid provided dialogs)\n createChartContainerFunc(chartRef);\n }\n else {\n // add listener to remove from active charts list when charts are destroyed, e.g. closing chart dialog\n chartComp.addEventListener(GridChartComp.EVENT_DESTROYED, function () {\n _this.activeChartComps.delete(chartComp);\n _this.activeCharts.delete(chartRef);\n });\n }\n return chartRef;\n };\n ChartService.prototype.createChartRef = function (chartComp) {\n var _this = this;\n var chartRef = {\n destroyChart: function () {\n if (_this.activeCharts.has(chartRef)) {\n _this.context.destroyBean(chartComp);\n _this.activeChartComps.delete(chartComp);\n _this.activeCharts.delete(chartRef);\n }\n },\n chartElement: chartComp.getGui(),\n chart: chartComp.getUnderlyingChart(),\n chartId: chartComp.getChartModel().chartId\n };\n this.activeCharts.add(chartRef);\n this.activeChartComps.add(chartComp);\n return chartRef;\n };\n ChartService.prototype.getSelectedRange = function () {\n var ranges = this.rangeService.getCellRanges();\n return ranges.length > 0 ? ranges[0] : {};\n };\n ChartService.prototype.generateId = function () {\n return \"id-\" + Math.random().toString(36).substring(2, 18);\n };\n ChartService.prototype.destroyAllActiveCharts = function () {\n this.activeCharts.forEach(function (chart) { return chart.destroyChart(); });\n };\n ChartService.CHARTS_VERSION = VERSION$b;\n __decorate$M([\n Optional('rangeService')\n ], ChartService.prototype, \"rangeService\", void 0);\n __decorate$M([\n Autowired('columnModel')\n ], ChartService.prototype, \"columnModel\", void 0);\n __decorate$M([\n PreDestroy\n ], ChartService.prototype, \"destroyAllActiveCharts\", null);\n ChartService = __decorate$M([\n Bean('chartService')\n ], ChartService);\n return ChartService;\n}(BeanStub));\n\nvar __extends$P = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$L = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar ChartTranslationService = /** @class */ (function (_super) {\n __extends$P(ChartTranslationService, _super);\n function ChartTranslationService() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n ChartTranslationService_1 = ChartTranslationService;\n ChartTranslationService.prototype.translate = function (toTranslate, defaultText) {\n var translate = this.localeService.getLocaleTextFunc();\n var defaultTranslation = ChartTranslationService_1.DEFAULT_TRANSLATIONS[toTranslate] || defaultText;\n return translate(toTranslate, defaultTranslation);\n };\n var ChartTranslationService_1;\n ChartTranslationService.DEFAULT_TRANSLATIONS = {\n pivotChartTitle: 'Pivot Chart',\n rangeChartTitle: 'Range Chart',\n settings: 'Settings',\n data: 'Data',\n format: 'Format',\n categories: 'Categories',\n defaultCategory: '(None)',\n series: 'Series',\n xyValues: 'X Y Values',\n paired: 'Paired Mode',\n axis: 'Axis',\n navigator: 'Navigator',\n color: 'Color',\n thickness: 'Thickness',\n xType: 'X Type',\n automatic: 'Automatic',\n category: 'Category',\n number: 'Number',\n time: 'Time',\n autoRotate: 'Auto Rotate',\n xRotation: 'X Rotation',\n yRotation: 'Y Rotation',\n ticks: 'Ticks',\n width: 'Width',\n height: 'Height',\n length: 'Length',\n padding: 'Padding',\n spacing: 'Spacing',\n chart: 'Chart',\n title: 'Title',\n titlePlaceholder: 'Chart title - double click to edit',\n background: 'Background',\n font: 'Font',\n top: 'Top',\n right: 'Right',\n bottom: 'Bottom',\n left: 'Left',\n labels: 'Labels',\n calloutLabels: 'Callout Labels',\n sectorLabels: 'Sector Labels',\n positionRatio: 'Position Ratio',\n size: 'Size',\n shape: 'Shape',\n minSize: 'Minimum Size',\n maxSize: 'Maximum Size',\n legend: 'Legend',\n position: 'Position',\n markerSize: 'Marker Size',\n markerStroke: 'Marker Stroke',\n markerPadding: 'Marker Padding',\n itemSpacing: 'Item Spacing',\n itemPaddingX: 'Item Padding X',\n itemPaddingY: 'Item Padding Y',\n layoutHorizontalSpacing: 'Horizontal Spacing',\n layoutVerticalSpacing: 'Vertical Spacing',\n strokeWidth: 'Stroke Width',\n offset: 'Offset',\n offsets: 'Offsets',\n tooltips: 'Tooltips',\n callout: 'Callout',\n markers: 'Markers',\n shadow: 'Shadow',\n blur: 'Blur',\n xOffset: 'X Offset',\n yOffset: 'Y Offset',\n lineWidth: 'Line Width',\n lineDash: 'Line Dash',\n normal: 'Normal',\n bold: 'Bold',\n italic: 'Italic',\n boldItalic: 'Bold Italic',\n predefined: 'Predefined',\n fillOpacity: 'Fill Opacity',\n strokeOpacity: 'Line Opacity',\n histogramBinCount: 'Bin count',\n columnGroup: 'Column',\n barGroup: 'Bar',\n pieGroup: 'Pie',\n lineGroup: 'Line',\n scatterGroup: 'X Y (Scatter)',\n areaGroup: 'Area',\n histogramGroup: 'Histogram',\n combinationGroup: 'Combination',\n groupedColumnTooltip: 'Grouped',\n stackedColumnTooltip: 'Stacked',\n normalizedColumnTooltip: '100% Stacked',\n groupedBarTooltip: 'Grouped',\n stackedBarTooltip: 'Stacked',\n normalizedBarTooltip: '100% Stacked',\n pieTooltip: 'Pie',\n doughnutTooltip: 'Doughnut',\n lineTooltip: 'Line',\n groupedAreaTooltip: 'Area',\n stackedAreaTooltip: 'Stacked',\n normalizedAreaTooltip: '100% Stacked',\n scatterTooltip: 'Scatter',\n bubbleTooltip: 'Bubble',\n histogramTooltip: 'Histogram',\n columnLineComboTooltip: 'Column & Line',\n areaColumnComboTooltip: 'Area & Column',\n customComboTooltip: 'Custom Combination',\n noDataToChart: 'No data available to be charted.',\n pivotChartRequiresPivotMode: 'Pivot Chart requires Pivot Mode enabled.',\n chartSettingsToolbarTooltip: 'Menu',\n chartLinkToolbarTooltip: 'Linked to Grid',\n chartUnlinkToolbarTooltip: 'Unlinked from Grid',\n chartDownloadToolbarTooltip: 'Download Chart',\n histogramFrequency: \"Frequency\",\n seriesChartType: 'Series Chart Type',\n seriesType: 'Series Type',\n secondaryAxis: 'Secondary Axis',\n };\n ChartTranslationService = ChartTranslationService_1 = __decorate$L([\n Bean(\"chartTranslationService\")\n ], ChartTranslationService);\n return ChartTranslationService;\n}(BeanStub));\n\nvar __extends$O = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$K = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar ChartCrossFilterService = /** @class */ (function (_super) {\n __extends$O(ChartCrossFilterService, _super);\n function ChartCrossFilterService() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n ChartCrossFilterService_1 = ChartCrossFilterService;\n ChartCrossFilterService.prototype.filter = function (event, reset) {\n if (reset === void 0) { reset = false; }\n var filterModel = this.gridApi.getFilterModel();\n // filters should be reset when user clicks on canvas background\n if (reset) {\n this.resetFilters(filterModel);\n return;\n }\n var colId = ChartCrossFilterService_1.extractFilterColId(event);\n if (this.isValidColumnFilter(colId)) {\n // update filters based on current chart selections\n this.updateFilters(filterModel, event, colId);\n }\n else {\n console.warn(\"AG Grid: cross filtering requires a 'agSetColumnFilter' or 'agMultiColumnFilter' \" +\n \"to be defined on the column with id: '\" + colId + \"'\");\n }\n };\n ChartCrossFilterService.prototype.resetFilters = function (filterModel) {\n var filtersExist = Object.keys(filterModel).length > 0;\n if (filtersExist) {\n // only reset filters / charts when necessary to prevent undesirable flickering effect\n this.gridApi.setFilterModel(null);\n this.gridApi.onFilterChanged();\n }\n };\n ChartCrossFilterService.prototype.updateFilters = function (filterModel, event, colId) {\n var _a;\n var dataKey = ChartCrossFilterService_1.extractFilterColId(event);\n var rawValue = event.datum[dataKey];\n if (rawValue === undefined) {\n return;\n }\n var selectedValue = rawValue.toString();\n if (event.event.metaKey || event.event.ctrlKey) {\n var existingGridValues = this.getCurrentGridValuesForCategory(colId);\n var valueAlreadyExists = _.includes(existingGridValues, selectedValue);\n var updatedValues = void 0;\n if (valueAlreadyExists) {\n updatedValues = existingGridValues.filter(function (v) { return v !== selectedValue; });\n }\n else {\n updatedValues = existingGridValues;\n updatedValues.push(selectedValue);\n }\n filterModel[colId] = this.getUpdatedFilterModel(colId, updatedValues);\n }\n else {\n var updatedValues = [selectedValue];\n filterModel = (_a = {}, _a[colId] = this.getUpdatedFilterModel(colId, updatedValues), _a);\n }\n this.gridApi.setFilterModel(filterModel);\n };\n ChartCrossFilterService.prototype.getUpdatedFilterModel = function (colId, updatedValues) {\n var columnFilterType = this.getColumnFilterType(colId);\n if (columnFilterType === 'agMultiColumnFilter') {\n return { filterType: 'multi', filterModels: [null, { filterType: 'set', values: updatedValues }] };\n }\n return { filterType: 'set', values: updatedValues };\n };\n ChartCrossFilterService.prototype.getCurrentGridValuesForCategory = function (colId) {\n var _this = this;\n var filteredValues = [];\n var column = this.getColumnById(colId);\n this.gridApi.forEachNodeAfterFilter(function (rowNode) {\n if (column && !rowNode.group) {\n var value = _this.valueService.getValue(column, rowNode) + '';\n if (!filteredValues.includes(value)) {\n filteredValues.push(value);\n }\n }\n });\n return filteredValues;\n };\n ChartCrossFilterService.extractFilterColId = function (event) {\n return event.xKey || event.calloutLabelKey;\n };\n ChartCrossFilterService.prototype.isValidColumnFilter = function (colId) {\n if (colId.indexOf('-filtered-out')) {\n colId = colId.replace('-filtered-out', '');\n }\n var filterType = this.getColumnFilterType(colId);\n if (typeof filterType === 'boolean') {\n return filterType;\n }\n return _.includes(['agSetColumnFilter', 'agMultiColumnFilter'], filterType);\n };\n ChartCrossFilterService.prototype.getColumnFilterType = function (colId) {\n var gridColumn = this.getColumnById(colId);\n if (gridColumn) {\n var colDef = gridColumn.getColDef();\n return colDef.filter;\n }\n };\n ChartCrossFilterService.prototype.getColumnById = function (colId) {\n return this.columnModel.getGridColumn(colId);\n };\n var ChartCrossFilterService_1;\n __decorate$K([\n Autowired('gridApi')\n ], ChartCrossFilterService.prototype, \"gridApi\", void 0);\n __decorate$K([\n Autowired('columnModel')\n ], ChartCrossFilterService.prototype, \"columnModel\", void 0);\n __decorate$K([\n Autowired('valueService')\n ], ChartCrossFilterService.prototype, \"valueService\", void 0);\n ChartCrossFilterService = ChartCrossFilterService_1 = __decorate$K([\n Bean(\"chartCrossFilterService\")\n ], ChartCrossFilterService);\n return ChartCrossFilterService;\n}(BeanStub));\n\nvar __extends$N = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign$a = (undefined && undefined.__assign) || function () {\n __assign$a = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$a.apply(this, arguments);\n};\nvar __decorate$J = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __read$c = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray$6 = (undefined && undefined.__spreadArray) || function (to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\n to[j] = from[i];\n return to;\n};\nvar __values$3 = (undefined && undefined.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nvar RangeService = /** @class */ (function (_super) {\n __extends$N(RangeService, _super);\n function RangeService() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.cellRanges = [];\n _this.bodyScrollListener = _this.onBodyScroll.bind(_this);\n _this.dragging = false;\n _this.intersectionRange = false; // When dragging ends, the current range will be used to intersect all other ranges\n return _this;\n }\n RangeService.prototype.init = function () {\n var _this = this;\n this.addManagedListener(this.eventService, Events.EVENT_NEW_COLUMNS_LOADED, function () { return _this.onColumnsChanged(); });\n this.addManagedListener(this.eventService, Events.EVENT_COLUMN_VISIBLE, this.onColumnsChanged.bind(this));\n this.addManagedListener(this.eventService, Events.EVENT_COLUMN_VALUE_CHANGED, this.onColumnsChanged.bind(this));\n this.addManagedListener(this.eventService, Events.EVENT_COLUMN_PIVOT_MODE_CHANGED, function () { return _this.removeAllCellRanges(); });\n this.addManagedListener(this.eventService, Events.EVENT_COLUMN_ROW_GROUP_CHANGED, function () { return _this.removeAllCellRanges(); });\n this.addManagedListener(this.eventService, Events.EVENT_COLUMN_PIVOT_CHANGED, function () { return _this.removeAllCellRanges(); });\n this.addManagedListener(this.eventService, Events.EVENT_COLUMN_GROUP_OPENED, this.refreshLastRangeStart.bind(this));\n this.addManagedListener(this.eventService, Events.EVENT_COLUMN_MOVED, this.refreshLastRangeStart.bind(this));\n this.addManagedListener(this.eventService, Events.EVENT_COLUMN_PINNED, this.refreshLastRangeStart.bind(this));\n this.ctrlsService.whenReady(function () {\n var gridBodyCtrl = _this.ctrlsService.getGridBodyCtrl();\n _this.autoScrollService = new AutoScrollService({\n scrollContainer: gridBodyCtrl.getBodyViewportElement(),\n scrollAxis: 'xy',\n getVerticalPosition: function () { return gridBodyCtrl.getScrollFeature().getVScrollPosition().top; },\n setVerticalPosition: function (position) { return gridBodyCtrl.getScrollFeature().setVerticalScrollPosition(position); },\n getHorizontalPosition: function () { return gridBodyCtrl.getScrollFeature().getHScrollPosition().left; },\n setHorizontalPosition: function (position) { return gridBodyCtrl.getScrollFeature().setHorizontalScrollPosition(position); },\n shouldSkipVerticalScroll: function () { return !_this.gridOptionsService.isDomLayout('normal'); },\n shouldSkipHorizontalScroll: function () { return !gridBodyCtrl.getScrollFeature().isHorizontalScrollShowing(); }\n });\n });\n };\n // Called for both columns loaded & column visibility events\n RangeService.prototype.onColumnsChanged = function () {\n var _this = this;\n // first move start column in last cell range (i.e. series chart range)\n this.refreshLastRangeStart();\n var allColumns = this.columnModel.getAllDisplayedColumns();\n // check that the columns in each range still exist and are visible\n this.cellRanges.forEach(function (cellRange) {\n var beforeCols = cellRange.columns;\n // remove hidden or removed cols from cell range\n cellRange.columns = cellRange.columns.filter(function (col) { return col.isVisible() && allColumns.indexOf(col) !== -1; });\n var colsInRangeChanged = !_.areEqual(beforeCols, cellRange.columns);\n if (colsInRangeChanged) {\n // notify users and other parts of grid (i.e. status panel) that range has changed\n _this.dispatchChangedEvent(false, true, cellRange.id);\n }\n });\n // Remove empty cell ranges\n var countBefore = this.cellRanges.length;\n this.cellRanges = this.cellRanges.filter(function (range) { return range.columns.length > 0; });\n if (countBefore > this.cellRanges.length) {\n this.dispatchChangedEvent(false, true);\n }\n };\n RangeService.prototype.refreshLastRangeStart = function () {\n var lastRange = _.last(this.cellRanges);\n if (!lastRange) {\n return;\n }\n this.refreshRangeStart(lastRange);\n };\n RangeService.prototype.isContiguousRange = function (cellRange) {\n var rangeColumns = cellRange.columns;\n if (!rangeColumns.length) {\n return false;\n }\n var allColumns = this.columnModel.getAllDisplayedColumns();\n var allPositions = rangeColumns.map(function (c) { return allColumns.indexOf(c); }).sort(function (a, b) { return a - b; });\n return _.last(allPositions) - allPositions[0] + 1 === rangeColumns.length;\n };\n RangeService.prototype.getRangeStartRow = function (cellRange) {\n if (cellRange.startRow && cellRange.endRow) {\n return this.rowPositionUtils.before(cellRange.startRow, cellRange.endRow) ?\n cellRange.startRow : cellRange.endRow;\n }\n var rowPinned = this.pinnedRowModel.getPinnedTopRowCount() > 0 ? 'top' : null;\n return { rowIndex: 0, rowPinned: rowPinned };\n };\n RangeService.prototype.getRangeEndRow = function (cellRange) {\n if (cellRange.startRow && cellRange.endRow) {\n return this.rowPositionUtils.before(cellRange.startRow, cellRange.endRow) ?\n cellRange.endRow : cellRange.startRow;\n }\n var pinnedBottomRowCount = this.pinnedRowModel.getPinnedBottomRowCount();\n var pinnedBottom = pinnedBottomRowCount > 0;\n if (pinnedBottom) {\n return {\n rowIndex: pinnedBottomRowCount - 1,\n rowPinned: 'bottom'\n };\n }\n return {\n rowIndex: this.rowModel.getRowCount() - 1,\n rowPinned: null\n };\n };\n RangeService.prototype.setRangeToCell = function (cell, appendRange) {\n if (appendRange === void 0) { appendRange = false; }\n if (!this.gridOptionsService.isEnableRangeSelection()) {\n return;\n }\n var columns = this.calculateColumnsBetween(cell.column, cell.column);\n if (!columns) {\n return;\n }\n var suppressMultiRangeSelections = this.gridOptionsService.is('suppressMultiRangeSelection');\n // if not appending, then clear previous range selections\n if (suppressMultiRangeSelections || !appendRange || _.missing(this.cellRanges)) {\n this.removeAllCellRanges(true);\n }\n var rowForCell = {\n rowIndex: cell.rowIndex,\n rowPinned: cell.rowPinned\n };\n var cellRange = {\n startRow: rowForCell,\n endRow: rowForCell,\n columns: columns,\n startColumn: cell.column\n };\n this.cellRanges.push(cellRange);\n this.setNewestRangeStartCell(cell);\n this.onDragStop();\n this.dispatchChangedEvent(true, true);\n };\n RangeService.prototype.extendLatestRangeToCell = function (cellPosition) {\n if (this.isEmpty() || !this.newestRangeStartCell) {\n return;\n }\n var cellRange = _.last(this.cellRanges);\n this.updateRangeEnd(cellRange, cellPosition);\n };\n RangeService.prototype.updateRangeEnd = function (cellRange, cellPosition, silent) {\n if (silent === void 0) { silent = false; }\n var endColumn = cellPosition.column;\n var colsToAdd = this.calculateColumnsBetween(cellRange.startColumn, endColumn);\n if (!colsToAdd || this.isLastCellOfRange(cellRange, cellPosition)) {\n return;\n }\n cellRange.columns = colsToAdd;\n cellRange.endRow = { rowIndex: cellPosition.rowIndex, rowPinned: cellPosition.rowPinned };\n if (!silent) {\n this.dispatchChangedEvent(true, true, cellRange.id);\n }\n };\n RangeService.prototype.refreshRangeStart = function (cellRange) {\n var startColumn = cellRange.startColumn, columns = cellRange.columns;\n var moveColInCellRange = function (colToMove, moveToFront) {\n var otherCols = cellRange.columns.filter(function (col) { return col !== colToMove; });\n if (colToMove) {\n cellRange.startColumn = colToMove;\n cellRange.columns = moveToFront ? __spreadArray$6([colToMove], __read$c(otherCols)) : __spreadArray$6(__spreadArray$6([], __read$c(otherCols)), [colToMove]);\n }\n else {\n cellRange.columns = otherCols;\n }\n };\n var _a = this.getRangeEdgeColumns(cellRange), left = _a.left, right = _a.right;\n var shouldMoveLeftCol = startColumn === columns[0] && startColumn !== left;\n if (shouldMoveLeftCol) {\n moveColInCellRange(left, true);\n return;\n }\n var shouldMoveRightCol = startColumn === _.last(columns) && startColumn === right;\n if (shouldMoveRightCol) {\n moveColInCellRange(right, false);\n return;\n }\n };\n RangeService.prototype.getRangeEdgeColumns = function (cellRange) {\n var allColumns = this.columnModel.getAllDisplayedColumns();\n var allIndices = cellRange.columns\n .map(function (c) { return allColumns.indexOf(c); })\n .filter(function (i) { return i > -1; })\n .sort(function (a, b) { return a - b; });\n return {\n left: allColumns[allIndices[0]],\n right: allColumns[_.last(allIndices)]\n };\n };\n // returns true if successful, false if not successful\n RangeService.prototype.extendLatestRangeInDirection = function (event) {\n if (this.isEmpty() || !this.newestRangeStartCell) {\n return;\n }\n var key = event.key;\n var ctrlKey = event.ctrlKey || event.metaKey;\n var lastRange = _.last(this.cellRanges);\n var startCell = this.newestRangeStartCell;\n var firstCol = lastRange.columns[0];\n var lastCol = _.last(lastRange.columns);\n // find the cell that is at the furthest away corner from the starting cell\n var endCellIndex = lastRange.endRow.rowIndex;\n var endCellFloating = lastRange.endRow.rowPinned;\n var endCellColumn = startCell.column === firstCol ? lastCol : firstCol;\n var endCell = { column: endCellColumn, rowIndex: endCellIndex, rowPinned: endCellFloating };\n var newEndCell = this.cellNavigationService.getNextCellToFocus(key, endCell, ctrlKey);\n // if user is at end of grid, so no cell to extend to, we return false\n if (!newEndCell) {\n return;\n }\n this.setCellRange({\n rowStartIndex: startCell.rowIndex,\n rowStartPinned: startCell.rowPinned,\n rowEndIndex: newEndCell.rowIndex,\n rowEndPinned: newEndCell.rowPinned,\n columnStart: startCell.column,\n columnEnd: newEndCell.column\n });\n return newEndCell;\n };\n RangeService.prototype.setCellRange = function (params) {\n if (!this.gridOptionsService.isEnableRangeSelection()) {\n return;\n }\n this.removeAllCellRanges(true);\n this.addCellRange(params);\n };\n RangeService.prototype.setCellRanges = function (cellRanges) {\n var _this = this;\n if (_.shallowCompare(this.cellRanges, cellRanges)) {\n return;\n }\n this.removeAllCellRanges(true);\n cellRanges.forEach(function (newRange) {\n if (newRange.columns && newRange.startRow) {\n _this.setNewestRangeStartCell({\n rowIndex: newRange.startRow.rowIndex,\n rowPinned: newRange.startRow.rowPinned,\n column: newRange.columns[0]\n });\n }\n _this.cellRanges.push(newRange);\n });\n this.dispatchChangedEvent(false, true);\n };\n RangeService.prototype.setNewestRangeStartCell = function (position) {\n this.newestRangeStartCell = position;\n };\n RangeService.prototype.clearCellRangeCellValues = function (params) {\n var _this = this;\n var cellRanges = params.cellRanges;\n var _a = params.cellEventSource, cellEventSource = _a === void 0 ? 'rangeService' : _a, dispatchWrapperEvents = params.dispatchWrapperEvents, _b = params.wrapperEventSource, wrapperEventSource = _b === void 0 ? 'deleteKey' : _b;\n if (dispatchWrapperEvents) {\n var startEvent = {\n type: Events.EVENT_RANGE_DELETE_START,\n source: wrapperEventSource\n };\n this.eventService.dispatchEvent(startEvent);\n }\n if (!cellRanges) {\n cellRanges = this.cellRanges;\n }\n cellRanges.forEach(function (cellRange) {\n _this.forEachRowInRange(cellRange, function (rowPosition) {\n var rowNode = _this.rowPositionUtils.getRowNode(rowPosition);\n if (!rowNode) {\n return;\n }\n for (var i = 0; i < cellRange.columns.length; i++) {\n var column = _this.columnModel.getGridColumn(cellRange.columns[i]);\n if (!column || !column.isCellEditable(rowNode)) {\n return;\n }\n rowNode.setDataValue(column, null, cellEventSource);\n }\n });\n });\n if (dispatchWrapperEvents) {\n var endEvent = {\n type: Events.EVENT_RANGE_DELETE_END,\n source: wrapperEventSource\n };\n this.eventService.dispatchEvent(endEvent);\n }\n };\n RangeService.prototype.createCellRangeFromCellRangeParams = function (params) {\n var _this = this;\n var columns;\n var startsOnTheRight = false;\n if (params.columns) {\n columns = params.columns.map(function (c) { return _this.columnModel.getColumnWithValidation(c); }).filter(function (c) { return c; });\n }\n else {\n var columnStart = this.columnModel.getColumnWithValidation(params.columnStart);\n var columnEnd = this.columnModel.getColumnWithValidation(params.columnEnd);\n if (!columnStart || !columnEnd) {\n return;\n }\n columns = this.calculateColumnsBetween(columnStart, columnEnd);\n if (columns && columns.length) {\n startsOnTheRight = columns[0] !== columnStart;\n }\n }\n if (!columns) {\n return;\n }\n var startRow = params.rowStartIndex != null ? {\n rowIndex: params.rowStartIndex,\n rowPinned: params.rowStartPinned || null\n } : undefined;\n var endRow = params.rowEndIndex != null ? {\n rowIndex: params.rowEndIndex,\n rowPinned: params.rowEndPinned || null\n } : undefined;\n return {\n startRow: startRow,\n endRow: endRow,\n columns: columns,\n startColumn: startsOnTheRight ? _.last(columns) : columns[0]\n };\n };\n RangeService.prototype.addCellRange = function (params) {\n if (!this.gridOptionsService.isEnableRangeSelection()) {\n return;\n }\n var newRange = this.createCellRangeFromCellRangeParams(params);\n if (newRange) {\n if (newRange.startRow) {\n this.setNewestRangeStartCell({\n rowIndex: newRange.startRow.rowIndex,\n rowPinned: newRange.startRow.rowPinned,\n column: newRange.startColumn\n });\n }\n this.cellRanges.push(newRange);\n this.dispatchChangedEvent(false, true, newRange.id);\n }\n };\n RangeService.prototype.getCellRanges = function () {\n return this.cellRanges;\n };\n RangeService.prototype.isEmpty = function () {\n return this.cellRanges.length === 0;\n };\n RangeService.prototype.isMoreThanOneCell = function () {\n var len = this.cellRanges.length;\n if (len === 0) {\n return false;\n }\n if (len > 1) {\n return true; // Assumes a cell range must contain at least one cell\n }\n // only one range, return true if range has more than one\n var range = this.cellRanges[0];\n var startRow = this.getRangeStartRow(range);\n var endRow = this.getRangeEndRow(range);\n return startRow.rowPinned !== endRow.rowPinned ||\n startRow.rowIndex !== endRow.rowIndex ||\n range.columns.length !== 1;\n };\n RangeService.prototype.areAllRangesAbleToMerge = function () {\n var e_1, _a;\n var _this = this;\n var rowToColumnMap = new Map();\n var len = this.cellRanges.length;\n if (len <= 1)\n return true;\n this.cellRanges.forEach(function (range) {\n _this.forEachRowInRange(range, function (row) {\n var rowName = (row.rowPinned || 'normal') + \"_\" + row.rowIndex;\n var columns = rowToColumnMap.get(rowName);\n var currentRangeColIds = range.columns.map(function (col) { return col.getId(); });\n if (columns) {\n var filteredColumns = currentRangeColIds.filter(function (col) { return columns.indexOf(col) === -1; });\n columns.push.apply(columns, __spreadArray$6([], __read$c(filteredColumns)));\n }\n else {\n rowToColumnMap.set(rowName, currentRangeColIds);\n }\n });\n });\n var columnsString;\n try {\n for (var _b = __values$3(rowToColumnMap.values()), _c = _b.next(); !_c.done; _c = _b.next()) {\n var val = _c.value;\n var currentValString = val.sort().join();\n if (columnsString === undefined) {\n columnsString = currentValString;\n continue;\n }\n if (columnsString !== currentValString) {\n return false;\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_1) throw e_1.error; }\n }\n return true;\n };\n RangeService.prototype.forEachRowInRange = function (cellRange, callback) {\n var topRow = this.getRangeStartRow(cellRange);\n var bottomRow = this.getRangeEndRow(cellRange);\n var currentRow = topRow;\n while (currentRow) {\n callback(currentRow);\n if (this.rowPositionUtils.sameRow(currentRow, bottomRow)) {\n break;\n }\n currentRow = this.cellNavigationService.getRowBelow(currentRow);\n }\n };\n RangeService.prototype.removeAllCellRanges = function (silent) {\n if (this.isEmpty()) {\n return;\n }\n this.onDragStop();\n this.cellRanges.length = 0;\n if (!silent) {\n this.dispatchChangedEvent(false, true);\n }\n };\n // as the user is dragging outside of the panel, the div starts to scroll, which in turn\n // means we are selection more (or less) cells, but the mouse isn't moving, so we recalculate\n // the selection my mimicking a new mouse event\n RangeService.prototype.onBodyScroll = function () {\n if (this.dragging && this.lastMouseEvent) {\n this.onDragging(this.lastMouseEvent);\n }\n };\n RangeService.prototype.isCellInAnyRange = function (cell) {\n return this.getCellRangeCount(cell) > 0;\n };\n RangeService.prototype.isCellInSpecificRange = function (cell, range) {\n var columnInRange = range.columns !== null && _.includes(range.columns, cell.column);\n var rowInRange = this.isRowInRange(cell.rowIndex, cell.rowPinned, range);\n return columnInRange && rowInRange;\n };\n RangeService.prototype.isLastCellOfRange = function (cellRange, cell) {\n var startRow = cellRange.startRow, endRow = cellRange.endRow;\n var lastRow = this.rowPositionUtils.before(startRow, endRow) ? endRow : startRow;\n var isLastRow = cell.rowIndex === lastRow.rowIndex && cell.rowPinned === lastRow.rowPinned;\n var rangeFirstIndexColumn = cellRange.columns[0];\n var rangeLastIndexColumn = _.last(cellRange.columns);\n var lastRangeColumn = cellRange.startColumn === rangeFirstIndexColumn ? rangeLastIndexColumn : rangeFirstIndexColumn;\n var isLastColumn = cell.column === lastRangeColumn;\n return isLastColumn && isLastRow;\n };\n RangeService.prototype.isBottomRightCell = function (cellRange, cell) {\n var allColumns = this.columnModel.getAllDisplayedColumns();\n var allPositions = cellRange.columns.map(function (c) { return allColumns.indexOf(c); }).sort(function (a, b) { return a - b; });\n var startRow = cellRange.startRow, endRow = cellRange.endRow;\n var lastRow = this.rowPositionUtils.before(startRow, endRow) ? endRow : startRow;\n var isRightColumn = allColumns.indexOf(cell.column) === _.last(allPositions);\n var isLastRow = cell.rowIndex === lastRow.rowIndex && _.makeNull(cell.rowPinned) === _.makeNull(lastRow.rowPinned);\n return isRightColumn && isLastRow;\n };\n // returns the number of ranges this cell is in\n RangeService.prototype.getCellRangeCount = function (cell) {\n var _this = this;\n if (this.isEmpty()) {\n return 0;\n }\n return this.cellRanges.filter(function (cellRange) { return _this.isCellInSpecificRange(cell, cellRange); }).length;\n };\n RangeService.prototype.isRowInRange = function (rowIndex, floating, cellRange) {\n var firstRow = this.getRangeStartRow(cellRange);\n var lastRow = this.getRangeEndRow(cellRange);\n var thisRow = { rowIndex: rowIndex, rowPinned: floating || null };\n // compare rowPinned with == instead of === because it can be `null` or `undefined`\n var equalsFirstRow = thisRow.rowIndex === firstRow.rowIndex && thisRow.rowPinned == firstRow.rowPinned;\n var equalsLastRow = thisRow.rowIndex === lastRow.rowIndex && thisRow.rowPinned == lastRow.rowPinned;\n if (equalsFirstRow || equalsLastRow) {\n return true;\n }\n var afterFirstRow = !this.rowPositionUtils.before(thisRow, firstRow);\n var beforeLastRow = this.rowPositionUtils.before(thisRow, lastRow);\n return afterFirstRow && beforeLastRow;\n };\n RangeService.prototype.getDraggingRange = function () {\n return this.draggingRange;\n };\n RangeService.prototype.onDragStart = function (mouseEvent) {\n if (!this.gridOptionsService.isEnableRangeSelection()) {\n return;\n }\n var ctrlKey = mouseEvent.ctrlKey, metaKey = mouseEvent.metaKey, shiftKey = mouseEvent.shiftKey;\n // ctrlKey for windows, metaKey for Apple\n var isMultiKey = ctrlKey || metaKey;\n var allowMulti = !this.gridOptionsService.is('suppressMultiRangeSelection');\n var isMultiSelect = allowMulti ? isMultiKey : false;\n var extendRange = shiftKey && _.existsAndNotEmpty(this.cellRanges);\n if (!isMultiSelect && (!extendRange || _.exists(_.last(this.cellRanges).type))) {\n this.removeAllCellRanges(true);\n }\n // The browser changes the Event target of cached events when working with the ShadowDOM\n // so we need to retrieve the initial DragStartTarget.\n var startTarget = this.dragService.getStartTarget();\n if (startTarget) {\n this.updateValuesOnMove(startTarget);\n }\n if (!this.lastCellHovered) {\n return;\n }\n this.dragging = true;\n this.lastMouseEvent = mouseEvent;\n this.intersectionRange = isMultiSelect && this.getCellRangeCount(this.lastCellHovered) > 1;\n if (!extendRange) {\n this.setNewestRangeStartCell(this.lastCellHovered);\n }\n // if we didn't clear the ranges, then dragging means the user clicked, and when the\n // user clicks it means a range of one cell was created. we need to extend this range\n // rather than creating another range. otherwise we end up with two distinct ranges\n // from a drag operation (one from click, and one from drag).\n if (this.cellRanges.length > 0) {\n this.draggingRange = _.last(this.cellRanges);\n }\n else {\n var mouseRowPosition = {\n rowIndex: this.lastCellHovered.rowIndex,\n rowPinned: this.lastCellHovered.rowPinned\n };\n this.draggingRange = {\n startRow: mouseRowPosition,\n endRow: mouseRowPosition,\n columns: [this.lastCellHovered.column],\n startColumn: this.newestRangeStartCell.column\n };\n this.cellRanges.push(this.draggingRange);\n }\n this.ctrlsService.getGridBodyCtrl().addScrollEventListener(this.bodyScrollListener);\n this.dispatchChangedEvent(true, false, this.draggingRange.id);\n };\n RangeService.prototype.intersectLastRange = function (fromMouseClick) {\n var _this = this;\n // when ranges are created due to a mouse click without drag (happens in cellMouseListener)\n // this method will be called with `fromMouseClick=true`.\n if (fromMouseClick && this.dragging) {\n return;\n }\n if (this.gridOptionsService.is('suppressMultiRangeSelection')) {\n return;\n }\n if (this.isEmpty()) {\n return;\n }\n var lastRange = _.last(this.cellRanges);\n var intersectionStartRow = this.getRangeStartRow(lastRange);\n var intersectionEndRow = this.getRangeEndRow(lastRange);\n var newRanges = [];\n this.cellRanges.slice(0, -1).forEach(function (range) {\n var startRow = _this.getRangeStartRow(range);\n var endRow = _this.getRangeEndRow(range);\n var cols = range.columns;\n var intersectCols = cols.filter(function (col) { return lastRange.columns.indexOf(col) === -1; });\n if (intersectCols.length === cols.length) {\n // No overlapping columns, retain previous range\n newRanges.push(range);\n return;\n }\n if (_this.rowPositionUtils.before(intersectionEndRow, startRow) || _this.rowPositionUtils.before(endRow, intersectionStartRow)) {\n // No overlapping rows, retain previous range\n newRanges.push(range);\n return;\n }\n var rangeCountBefore = newRanges.length;\n // Top\n if (_this.rowPositionUtils.before(startRow, intersectionStartRow)) {\n var top_1 = {\n columns: __spreadArray$6([], __read$c(cols)),\n startColumn: lastRange.startColumn,\n startRow: __assign$a({}, startRow),\n endRow: _this.cellNavigationService.getRowAbove(intersectionStartRow),\n };\n newRanges.push(top_1);\n }\n // Left & Right (not contiguous with columns)\n if (intersectCols.length > 0) {\n var middle = {\n columns: intersectCols,\n startColumn: _.includes(intersectCols, lastRange.startColumn) ? lastRange.startColumn : intersectCols[0],\n startRow: _this.rowPositionUtils.rowMax([__assign$a({}, intersectionStartRow), __assign$a({}, startRow)]),\n endRow: _this.rowPositionUtils.rowMin([__assign$a({}, intersectionEndRow), __assign$a({}, endRow)]),\n };\n newRanges.push(middle);\n }\n // Bottom\n if (_this.rowPositionUtils.before(intersectionEndRow, endRow)) {\n newRanges.push({\n columns: __spreadArray$6([], __read$c(cols)),\n startColumn: lastRange.startColumn,\n startRow: _this.cellNavigationService.getRowBelow(intersectionEndRow),\n endRow: __assign$a({}, endRow),\n });\n }\n if ((newRanges.length - rangeCountBefore) === 1) {\n // Only one range result from the intersection.\n // Copy the source range's id, since essentially we just reduced it's size\n newRanges[newRanges.length - 1].id = range.id;\n }\n });\n this.cellRanges = newRanges;\n // when this is called because of a clickEvent and the ranges were changed\n // we need to force a dragEnd event to update the UI.\n if (fromMouseClick) {\n this.dispatchChangedEvent(false, true);\n }\n };\n RangeService.prototype.updateValuesOnMove = function (eventTarget) {\n var cellCtrl = _.getCtrlForEventTarget(this.gridOptionsService, eventTarget, CellCtrl.DOM_DATA_KEY_CELL_CTRL);\n var cell = cellCtrl === null || cellCtrl === void 0 ? void 0 : cellCtrl.getCellPosition();\n this.cellHasChanged = false;\n if (!cell || (this.lastCellHovered && this.cellPositionUtils.equals(cell, this.lastCellHovered))) {\n return;\n }\n if (this.lastCellHovered) {\n this.cellHasChanged = true;\n }\n this.lastCellHovered = cell;\n };\n RangeService.prototype.onDragging = function (mouseEvent) {\n var _this = this;\n if (!this.dragging || !mouseEvent) {\n return;\n }\n this.updateValuesOnMove(mouseEvent.target);\n this.lastMouseEvent = mouseEvent;\n var cellPosition = this.lastCellHovered;\n var isMouseAndStartInPinned = function (position) {\n return cellPosition && cellPosition.rowPinned === position && _this.newestRangeStartCell.rowPinned === position;\n };\n var skipVerticalScroll = isMouseAndStartInPinned('top') || isMouseAndStartInPinned('bottom');\n this.autoScrollService.check(mouseEvent, skipVerticalScroll);\n if (!this.cellHasChanged) {\n return;\n }\n var columns = this.calculateColumnsBetween(this.newestRangeStartCell.column, cellPosition.column);\n if (!columns) {\n return;\n }\n this.draggingRange.endRow = {\n rowIndex: cellPosition.rowIndex,\n rowPinned: cellPosition.rowPinned\n };\n this.draggingRange.columns = columns;\n this.dispatchChangedEvent(false, false, this.draggingRange.id);\n };\n RangeService.prototype.onDragStop = function () {\n if (!this.dragging) {\n return;\n }\n var id = this.draggingRange.id;\n this.autoScrollService.ensureCleared();\n this.ctrlsService.getGridBodyCtrl().removeScrollEventListener(this.bodyScrollListener);\n this.lastMouseEvent = null;\n this.dragging = false;\n this.draggingRange = undefined;\n this.lastCellHovered = undefined;\n if (this.intersectionRange) {\n this.intersectionRange = false;\n this.intersectLastRange();\n }\n this.dispatchChangedEvent(false, true, id);\n };\n RangeService.prototype.dispatchChangedEvent = function (started, finished, id) {\n var event = {\n type: Events.EVENT_RANGE_SELECTION_CHANGED,\n started: started,\n finished: finished,\n id: id,\n };\n this.eventService.dispatchEvent(event);\n };\n RangeService.prototype.calculateColumnsBetween = function (columnFrom, columnTo) {\n var allColumns = this.columnModel.getAllDisplayedColumns();\n var isSameColumn = columnFrom === columnTo;\n var fromIndex = allColumns.indexOf(columnFrom);\n if (fromIndex < 0) {\n console.warn(\"AG Grid: column \" + columnFrom.getId() + \" is not visible\");\n return;\n }\n var toIndex = isSameColumn ? fromIndex : allColumns.indexOf(columnTo);\n if (toIndex < 0) {\n console.warn(\"AG Grid: column \" + columnTo.getId() + \" is not visible\");\n return;\n }\n if (isSameColumn) {\n return [columnFrom];\n }\n var firstIndex = Math.min(fromIndex, toIndex);\n var lastIndex = firstIndex === fromIndex ? toIndex : fromIndex;\n var columns = [];\n for (var i = firstIndex; i <= lastIndex; i++) {\n columns.push(allColumns[i]);\n }\n return columns;\n };\n __decorate$J([\n Autowired('rowModel')\n ], RangeService.prototype, \"rowModel\", void 0);\n __decorate$J([\n Autowired('dragService')\n ], RangeService.prototype, \"dragService\", void 0);\n __decorate$J([\n Autowired('columnModel')\n ], RangeService.prototype, \"columnModel\", void 0);\n __decorate$J([\n Autowired('cellNavigationService')\n ], RangeService.prototype, \"cellNavigationService\", void 0);\n __decorate$J([\n Autowired(\"pinnedRowModel\")\n ], RangeService.prototype, \"pinnedRowModel\", void 0);\n __decorate$J([\n Autowired('rowPositionUtils')\n ], RangeService.prototype, \"rowPositionUtils\", void 0);\n __decorate$J([\n Autowired('cellPositionUtils')\n ], RangeService.prototype, \"cellPositionUtils\", void 0);\n __decorate$J([\n Autowired('ctrlsService')\n ], RangeService.prototype, \"ctrlsService\", void 0);\n __decorate$J([\n PostConstruct\n ], RangeService.prototype, \"init\", null);\n RangeService = __decorate$J([\n Bean('rangeService')\n ], RangeService);\n return RangeService;\n}(BeanStub));\n\nvar __extends$M = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$I = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar AbstractSelectionHandle = /** @class */ (function (_super) {\n __extends$M(AbstractSelectionHandle, _super);\n function AbstractSelectionHandle() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.changedCalculatedValues = false;\n _this.dragging = false;\n _this.shouldDestroyOnEndDragging = false;\n return _this;\n }\n AbstractSelectionHandle.prototype.init = function () {\n var _this = this;\n this.dragService.addDragSource({\n dragStartPixels: 0,\n eElement: this.getGui(),\n onDragStart: this.onDragStart.bind(this),\n onDragging: function (e) {\n _this.dragging = true;\n _this.rangeService.autoScrollService.check(e);\n if (_this.changedCalculatedValues) {\n _this.onDrag(e);\n _this.changedCalculatedValues = false;\n }\n },\n onDragStop: function (e) {\n _this.dragging = false;\n _this.onDragEnd(e);\n _this.clearValues();\n _this.rangeService.autoScrollService.ensureCleared();\n // TODO: this causes a bug where if there are multiple grids in the same page, all of them will\n // be affected by a drag on any. Move it to the root element.\n document.body.classList.remove(_this.getDraggingCssClass());\n if (_this.shouldDestroyOnEndDragging) {\n _this.destroy();\n }\n }\n });\n this.addManagedListener(this.getGui(), 'mousedown', this.preventRangeExtension.bind(this));\n };\n AbstractSelectionHandle.prototype.isDragging = function () {\n return this.dragging;\n };\n AbstractSelectionHandle.prototype.getCellCtrl = function () {\n return this.cellCtrl;\n };\n AbstractSelectionHandle.prototype.setCellCtrl = function (cellComp) {\n this.cellCtrl = cellComp;\n };\n AbstractSelectionHandle.prototype.getCellRange = function () {\n return this.cellRange;\n };\n AbstractSelectionHandle.prototype.setCellRange = function (range) {\n this.cellRange = range;\n };\n AbstractSelectionHandle.prototype.getRangeStartRow = function () {\n return this.rangeStartRow;\n };\n AbstractSelectionHandle.prototype.setRangeStartRow = function (row) {\n this.rangeStartRow = row;\n };\n AbstractSelectionHandle.prototype.getRangeEndRow = function () {\n return this.rangeEndRow;\n };\n AbstractSelectionHandle.prototype.setRangeEndRow = function (row) {\n this.rangeEndRow = row;\n };\n AbstractSelectionHandle.prototype.getLastCellHovered = function () {\n return this.lastCellHovered;\n };\n AbstractSelectionHandle.prototype.preventRangeExtension = function (e) {\n e.stopPropagation();\n };\n AbstractSelectionHandle.prototype.onDragStart = function (e) {\n this.cellHoverListener = this.addManagedListener(this.ctrlsService.getGridCtrl().getGui(), 'mousemove', this.updateValuesOnMove.bind(this));\n document.body.classList.add(this.getDraggingCssClass());\n };\n AbstractSelectionHandle.prototype.getDraggingCssClass = function () {\n return \"ag-dragging-\" + (this.type === SelectionHandleType.FILL ? 'fill' : 'range') + \"-handle\";\n };\n AbstractSelectionHandle.prototype.updateValuesOnMove = function (e) {\n var cell = this.mouseEventService.getCellPositionForEvent(e);\n if (!cell || (this.lastCellHovered && this.cellPositionUtils.equals(cell, this.lastCellHovered))) {\n return;\n }\n this.lastCellHovered = cell;\n this.changedCalculatedValues = true;\n };\n AbstractSelectionHandle.prototype.getType = function () {\n return this.type;\n };\n AbstractSelectionHandle.prototype.refresh = function (cellCtrl) {\n var oldCellComp = this.getCellCtrl();\n var eGui = this.getGui();\n var cellRange = _.last(this.rangeService.getCellRanges());\n var start = cellRange.startRow;\n var end = cellRange.endRow;\n if (start && end) {\n var isBefore = this.rowPositionUtils.before(end, start);\n if (isBefore) {\n this.setRangeStartRow(end);\n this.setRangeEndRow(start);\n }\n else {\n this.setRangeStartRow(start);\n this.setRangeEndRow(end);\n }\n }\n if (oldCellComp !== cellCtrl || !_.isVisible(eGui)) {\n this.setCellCtrl(cellCtrl);\n var eParentOfValue = cellCtrl.getComp().getParentOfValue();\n if (eParentOfValue) {\n eParentOfValue.appendChild(eGui);\n }\n }\n this.setCellRange(cellRange);\n };\n AbstractSelectionHandle.prototype.clearValues = function () {\n this.lastCellHovered = undefined;\n this.removeListeners();\n };\n AbstractSelectionHandle.prototype.removeListeners = function () {\n if (this.cellHoverListener) {\n this.cellHoverListener();\n this.cellHoverListener = undefined;\n }\n };\n AbstractSelectionHandle.prototype.destroy = function () {\n if (!this.shouldDestroyOnEndDragging && this.isDragging()) {\n _.setDisplayed(this.getGui(), false);\n this.shouldDestroyOnEndDragging = true;\n return;\n }\n this.shouldDestroyOnEndDragging = false;\n _super.prototype.destroy.call(this);\n this.removeListeners();\n var eGui = this.getGui();\n if (eGui.parentElement) {\n eGui.parentElement.removeChild(eGui);\n }\n };\n __decorate$I([\n Autowired(\"rowRenderer\")\n ], AbstractSelectionHandle.prototype, \"rowRenderer\", void 0);\n __decorate$I([\n Autowired(\"dragService\")\n ], AbstractSelectionHandle.prototype, \"dragService\", void 0);\n __decorate$I([\n Autowired(\"rangeService\")\n ], AbstractSelectionHandle.prototype, \"rangeService\", void 0);\n __decorate$I([\n Autowired(\"mouseEventService\")\n ], AbstractSelectionHandle.prototype, \"mouseEventService\", void 0);\n __decorate$I([\n Autowired(\"columnModel\")\n ], AbstractSelectionHandle.prototype, \"columnModel\", void 0);\n __decorate$I([\n Autowired(\"cellNavigationService\")\n ], AbstractSelectionHandle.prototype, \"cellNavigationService\", void 0);\n __decorate$I([\n Autowired(\"navigationService\")\n ], AbstractSelectionHandle.prototype, \"navigationService\", void 0);\n __decorate$I([\n Autowired('rowPositionUtils')\n ], AbstractSelectionHandle.prototype, \"rowPositionUtils\", void 0);\n __decorate$I([\n Autowired('cellPositionUtils')\n ], AbstractSelectionHandle.prototype, \"cellPositionUtils\", void 0);\n __decorate$I([\n Autowired('ctrlsService')\n ], AbstractSelectionHandle.prototype, \"ctrlsService\", void 0);\n __decorate$I([\n PostConstruct\n ], AbstractSelectionHandle.prototype, \"init\", null);\n return AbstractSelectionHandle;\n}(Component));\n\nfunction findLineByLeastSquares(values) {\n var len = values.length;\n var maxDecimals = 0;\n if (len <= 1) {\n return values;\n }\n for (var i = 0; i < values.length; i++) {\n var value = values[i];\n var splitExponent = value.toString().split('e-');\n if (splitExponent.length > 1) {\n maxDecimals = Math.max(maxDecimals, parseInt(splitExponent[1], 10));\n continue;\n }\n if (Math.floor(value) === value) {\n continue;\n }\n maxDecimals = Math.max(maxDecimals, value.toString().split('.')[1].length);\n }\n var sum_x = 0;\n var sum_y = 0;\n var sum_xy = 0;\n var sum_xx = 0;\n var y = 0;\n for (var x = 0; x < len; x++) {\n y = values[x];\n sum_x += x;\n sum_y += y;\n sum_xx += x * x;\n sum_xy += x * y;\n }\n var m = (len * sum_xy - sum_x * sum_y) / (len * sum_xx - sum_x * sum_x);\n var b = (sum_y / len) - (m * sum_x) / len;\n var result = [];\n for (var x = 0; x <= len; x++) {\n result.push(parseFloat((x * m + b).toFixed(maxDecimals)));\n }\n return result;\n}\n\nvar __extends$L = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign$9 = (undefined && undefined.__assign) || function () {\n __assign$9 = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$9.apply(this, arguments);\n};\nvar __decorate$H = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __read$b = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray$5 = (undefined && undefined.__spreadArray) || function (to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\n to[j] = from[i];\n return to;\n};\nvar FillHandle = /** @class */ (function (_super) {\n __extends$L(FillHandle, _super);\n function FillHandle() {\n var _this = _super.call(this, FillHandle.TEMPLATE) || this;\n _this.markedCells = [];\n _this.cellValues = [];\n _this.isUp = false;\n _this.isLeft = false;\n _this.isReduce = false;\n _this.type = SelectionHandleType.FILL;\n return _this;\n }\n FillHandle.prototype.updateValuesOnMove = function (e) {\n _super.prototype.updateValuesOnMove.call(this, e);\n if (!this.initialXY) {\n this.initialXY = this.mouseEventService.getNormalisedPosition(e);\n }\n var _a = this.initialXY, x = _a.x, y = _a.y;\n var _b = this.mouseEventService.getNormalisedPosition(e), newX = _b.x, newY = _b.y;\n var diffX = Math.abs(x - newX);\n var diffY = Math.abs(y - newY);\n var allowedDirection = this.getFillHandleDirection();\n var direction;\n if (allowedDirection === 'xy') {\n direction = diffX > diffY ? 'x' : 'y';\n }\n else {\n direction = allowedDirection;\n }\n if (direction !== this.dragAxis) {\n this.dragAxis = direction;\n this.changedCalculatedValues = true;\n }\n };\n FillHandle.prototype.onDrag = function (e) {\n if (!this.initialPosition) {\n var cellCtrl = this.getCellCtrl();\n if (!cellCtrl) {\n return;\n }\n this.initialPosition = cellCtrl.getCellPosition();\n }\n var lastCellHovered = this.getLastCellHovered();\n if (lastCellHovered) {\n this.markPathFrom(this.initialPosition, lastCellHovered);\n }\n };\n FillHandle.prototype.onDragEnd = function (e) {\n this.initialXY = null;\n if (!this.markedCells.length) {\n return;\n }\n var isX = this.dragAxis === 'x';\n var initialRange = this.getCellRange();\n var colLen = initialRange.columns.length;\n var rangeStartRow = this.getRangeStartRow();\n var rangeEndRow = this.getRangeEndRow();\n var finalRange;\n if (!this.isUp && !this.isLeft) {\n finalRange = this.rangeService.createCellRangeFromCellRangeParams({\n rowStartIndex: rangeStartRow.rowIndex,\n rowStartPinned: rangeStartRow.rowPinned,\n columnStart: initialRange.columns[0],\n rowEndIndex: isX ? rangeEndRow.rowIndex : this.lastCellMarked.rowIndex,\n rowEndPinned: isX ? rangeEndRow.rowPinned : this.lastCellMarked.rowPinned,\n columnEnd: isX ? this.lastCellMarked.column : initialRange.columns[colLen - 1]\n });\n }\n else {\n var startRow = isX ? rangeStartRow : this.lastCellMarked;\n finalRange = this.rangeService.createCellRangeFromCellRangeParams({\n rowStartIndex: startRow.rowIndex,\n rowStartPinned: startRow.rowPinned,\n columnStart: isX ? this.lastCellMarked.column : initialRange.columns[0],\n rowEndIndex: rangeEndRow.rowIndex,\n rowEndPinned: rangeEndRow.rowPinned,\n columnEnd: initialRange.columns[colLen - 1]\n });\n }\n if (finalRange) {\n // raising fill events for undo / redo\n this.raiseFillStartEvent();\n this.handleValueChanged(initialRange, finalRange, e);\n this.rangeService.setCellRanges([finalRange]);\n this.raiseFillEndEvent(initialRange, finalRange);\n }\n };\n FillHandle.prototype.getFillHandleDirection = function () {\n var direction = this.gridOptionsService.get('fillHandleDirection');\n if (!direction) {\n return 'xy';\n }\n if (direction !== 'x' && direction !== 'y' && direction !== 'xy') {\n _.doOnce(function () { return console.warn(\"AG Grid: valid values for fillHandleDirection are 'x', 'y' and 'xy'. Default to 'xy'.\"); }, 'warn invalid fill direction');\n return 'xy';\n }\n return direction;\n };\n FillHandle.prototype.raiseFillStartEvent = function () {\n var fillStartEvent = {\n type: Events.EVENT_FILL_START\n };\n this.eventService.dispatchEvent(fillStartEvent);\n };\n FillHandle.prototype.raiseFillEndEvent = function (initialRange, finalRange) {\n var fillEndEvent = {\n type: Events.EVENT_FILL_END,\n initialRange: initialRange,\n finalRange: finalRange\n };\n this.eventService.dispatchEvent(fillEndEvent);\n };\n FillHandle.prototype.handleValueChanged = function (initialRange, finalRange, e) {\n var _this = this;\n var initialRangeEndRow = this.rangeService.getRangeEndRow(initialRange);\n var initialRangeStartRow = this.rangeService.getRangeStartRow(initialRange);\n var finalRangeEndRow = this.rangeService.getRangeEndRow(finalRange);\n var finalRangeStartRow = this.rangeService.getRangeStartRow(finalRange);\n var isVertical = this.dragAxis === 'y';\n // if the range is being reduced in size, all we need to do is\n // clear the cells that are no longer part of the range\n if (this.isReduce && !this.gridOptionsService.is('suppressClearOnFillReduction')) {\n var columns = isVertical\n ? initialRange.columns\n : initialRange.columns.filter(function (col) { return finalRange.columns.indexOf(col) < 0; });\n var startRow = isVertical ? this.cellNavigationService.getRowBelow(finalRangeEndRow) : finalRangeStartRow;\n if (startRow) {\n this.clearCellsInRange(startRow, initialRangeEndRow, columns);\n }\n return;\n }\n var withinInitialRange = true;\n var values = [];\n var initialValues = [];\n var idx = 0;\n var resetValues = function () {\n values.length = 0;\n initialValues.length = 0;\n idx = 0;\n };\n var iterateAcrossCells = function (column, columns) {\n var currentRow = _this.isUp ? initialRangeEndRow : initialRangeStartRow;\n var finished = false;\n if (isVertical) {\n withinInitialRange = true;\n resetValues();\n }\n var _loop_1 = function () {\n var rowNode = _this.rowPositionUtils.getRowNode(currentRow);\n if (!rowNode) {\n return \"break\";\n }\n if (isVertical && column) {\n fillValues(values, column, rowNode, function () {\n return !_this.rowPositionUtils.sameRow(currentRow, _this.isUp ? initialRangeStartRow : initialRangeEndRow);\n });\n }\n else if (columns) {\n withinInitialRange = true;\n resetValues();\n columns.forEach(function (col) { return fillValues(values, col, rowNode, function () { return col !== (_this.isLeft ? initialRange.columns[0] : _.last(initialRange.columns)); }); });\n }\n finished = _this.rowPositionUtils.sameRow(currentRow, _this.isUp ? finalRangeStartRow : finalRangeEndRow);\n currentRow = _this.isUp\n ? _this.cellNavigationService.getRowAbove(currentRow)\n : _this.cellNavigationService.getRowBelow(currentRow);\n };\n while (!finished && currentRow) {\n var state_1 = _loop_1();\n if (state_1 === \"break\")\n break;\n }\n };\n var fillValues = function (currentValues, col, rowNode, updateInitialSet) {\n var _a, _b;\n var currentValue;\n var skipValue = false;\n if (withinInitialRange) {\n currentValue = _this.valueService.getValue(col, rowNode);\n initialValues.push(currentValue);\n withinInitialRange = updateInitialSet();\n }\n else {\n var _c = _this.processValues(e, currentValues, initialValues, col, rowNode, idx++), value = _c.value, fromUserFunction = _c.fromUserFunction, sourceCol = _c.sourceCol, sourceRowNode = _c.sourceRowNode;\n currentValue = value;\n if (col.isCellEditable(rowNode)) {\n var cellValue = _this.valueService.getValue(col, rowNode);\n if (!fromUserFunction) {\n if ((_a = sourceCol === null || sourceCol === void 0 ? void 0 : sourceCol.getColDef()) === null || _a === void 0 ? void 0 : _a.useValueFormatterForExport) {\n currentValue = (_b = _this.valueFormatterService.formatValue(sourceCol, sourceRowNode, currentValue)) !== null && _b !== void 0 ? _b : currentValue;\n }\n if (col.getColDef().useValueParserForImport) {\n currentValue = _this.valueParserService.parseValue(col, rowNode, \n // if no sourceCol, then currentValue is a number\n sourceCol ? currentValue : _.toStringOrNull(currentValue), cellValue);\n }\n }\n if (!fromUserFunction || cellValue !== currentValue) {\n rowNode.setDataValue(col, currentValue, 'rangeService');\n }\n else {\n skipValue = true;\n }\n }\n }\n if (!skipValue) {\n currentValues.push({\n value: currentValue,\n column: col,\n rowNode: rowNode\n });\n }\n };\n if (isVertical) {\n initialRange.columns.forEach(function (col) {\n iterateAcrossCells(col);\n });\n }\n else {\n var columns = this.isLeft ? __spreadArray$5([], __read$b(finalRange.columns)).reverse() : finalRange.columns;\n iterateAcrossCells(undefined, columns);\n }\n };\n FillHandle.prototype.clearCellsInRange = function (startRow, endRow, columns) {\n var cellRange = {\n startRow: startRow,\n endRow: endRow,\n columns: columns,\n startColumn: columns[0]\n };\n this.rangeService.clearCellRangeCellValues({ cellRanges: [cellRange] });\n };\n FillHandle.prototype.processValues = function (event, values, initialValues, col, rowNode, idx) {\n var userFillOperation = this.gridOptionsService.getCallback('fillOperation');\n var isVertical = this.dragAxis === 'y';\n var direction;\n if (isVertical) {\n direction = this.isUp ? 'up' : 'down';\n }\n else {\n direction = this.isLeft ? 'left' : 'right';\n }\n if (userFillOperation) {\n var params = {\n event: event,\n values: values.map(function (_a) {\n var value = _a.value;\n return value;\n }),\n initialValues: initialValues,\n currentIndex: idx,\n currentCellValue: this.valueService.getValue(col, rowNode),\n direction: direction,\n column: col,\n rowNode: rowNode\n };\n var userResult = userFillOperation(params);\n if (userResult !== false) {\n return { value: userResult, fromUserFunction: true };\n }\n }\n var allNumbers = !values.some(function (_a) {\n var value = _a.value;\n var asFloat = parseFloat(value);\n return isNaN(asFloat) || asFloat.toString() !== value.toString();\n });\n // values should be copied in order if the alt key is pressed\n // or if the values contain strings and numbers\n // However, if we only have one initial value selected, and that\n // value is a number and we are also pressing alt, then we should\n // increment or decrement the value by 1 based on direction.\n if (event.altKey || !allNumbers) {\n if (allNumbers && initialValues.length === 1) {\n var multiplier = (this.isUp || this.isLeft) ? -1 : 1;\n return { value: parseFloat(_.last(values).value) + 1 * multiplier, fromUserFunction: false };\n }\n var _a = values[idx % values.length], value = _a.value, sourceCol = _a.column, sourceRowNode = _a.rowNode;\n return { value: value, fromUserFunction: false, sourceCol: sourceCol, sourceRowNode: sourceRowNode };\n }\n return { value: _.last(findLineByLeastSquares(values.map(function (_a) {\n var value = _a.value;\n return Number(value);\n }))), fromUserFunction: false };\n };\n FillHandle.prototype.clearValues = function () {\n this.clearMarkedPath();\n this.clearCellValues();\n this.lastCellMarked = undefined;\n _super.prototype.clearValues.call(this);\n };\n FillHandle.prototype.clearMarkedPath = function () {\n this.markedCells.forEach(function (cell) {\n if (!cell.isAlive()) {\n return;\n }\n var comp = cell.getComp();\n comp.addOrRemoveCssClass('ag-selection-fill-top', false);\n comp.addOrRemoveCssClass('ag-selection-fill-right', false);\n comp.addOrRemoveCssClass('ag-selection-fill-bottom', false);\n comp.addOrRemoveCssClass('ag-selection-fill-left', false);\n });\n this.markedCells.length = 0;\n this.isUp = false;\n this.isLeft = false;\n this.isReduce = false;\n };\n FillHandle.prototype.clearCellValues = function () {\n this.cellValues.length = 0;\n };\n FillHandle.prototype.markPathFrom = function (initialPosition, currentPosition) {\n this.clearMarkedPath();\n this.clearCellValues();\n if (this.dragAxis === 'y') {\n if (this.rowPositionUtils.sameRow(currentPosition, initialPosition)) {\n return;\n }\n var isBefore = this.rowPositionUtils.before(currentPosition, initialPosition);\n var rangeStartRow = this.getRangeStartRow();\n var rangeEndRow = this.getRangeEndRow();\n if (isBefore && ((currentPosition.rowPinned == rangeStartRow.rowPinned &&\n currentPosition.rowIndex >= rangeStartRow.rowIndex) ||\n (rangeStartRow.rowPinned != rangeEndRow.rowPinned &&\n currentPosition.rowPinned == rangeEndRow.rowPinned &&\n currentPosition.rowIndex <= rangeEndRow.rowIndex))) {\n this.reduceVertical(initialPosition, currentPosition);\n this.isReduce = true;\n }\n else {\n this.extendVertical(initialPosition, currentPosition, isBefore);\n this.isReduce = false;\n }\n }\n else {\n var initialColumn = initialPosition.column;\n var currentColumn = currentPosition.column;\n if (initialColumn === currentColumn) {\n return;\n }\n var displayedColumns = this.columnModel.getAllDisplayedColumns();\n var initialIndex = displayedColumns.indexOf(initialColumn);\n var currentIndex = displayedColumns.indexOf(currentColumn);\n if (currentIndex <= initialIndex && currentIndex >= displayedColumns.indexOf(this.getCellRange().columns[0])) {\n this.reduceHorizontal(initialPosition, currentPosition);\n this.isReduce = true;\n }\n else {\n this.extendHorizontal(initialPosition, currentPosition, currentIndex < initialIndex);\n this.isReduce = false;\n }\n }\n this.lastCellMarked = currentPosition;\n };\n FillHandle.prototype.extendVertical = function (initialPosition, endPosition, isMovingUp) {\n var _a = this, navigationService = _a.navigationService, rangeService = _a.rangeService;\n var row = initialPosition;\n do {\n var cellRange = this.getCellRange();\n var colLen = cellRange.columns.length;\n for (var i = 0; i < colLen; i++) {\n var column = cellRange.columns[i];\n var rowPos = { rowIndex: row.rowIndex, rowPinned: row.rowPinned };\n var cellPos = __assign$9(__assign$9({}, rowPos), { column: column });\n var cellInRange = rangeService.isCellInSpecificRange(cellPos, cellRange);\n var isInitialRow = this.rowPositionUtils.sameRow(row, initialPosition);\n if (isMovingUp) {\n this.isUp = true;\n }\n if (!isInitialRow) {\n var cell = navigationService.getCellByPosition(cellPos);\n if (cell) {\n this.markedCells.push(cell);\n var cellCtrl = cell.getComp();\n if (!cellInRange) {\n cellCtrl.addOrRemoveCssClass('ag-selection-fill-left', i === 0);\n cellCtrl.addOrRemoveCssClass('ag-selection-fill-right', i === colLen - 1);\n }\n cellCtrl.addOrRemoveCssClass(isMovingUp ? 'ag-selection-fill-top' : 'ag-selection-fill-bottom', this.rowPositionUtils.sameRow(row, endPosition));\n }\n }\n }\n if (this.rowPositionUtils.sameRow(row, endPosition)) {\n break;\n }\n } while (\n // tslint:disable-next-line\n row = isMovingUp\n ? this.cellNavigationService.getRowAbove(row)\n : this.cellNavigationService.getRowBelow(row));\n };\n FillHandle.prototype.reduceVertical = function (initialPosition, endPosition) {\n var row = initialPosition;\n do {\n var cellRange = this.getCellRange();\n var colLen = cellRange.columns.length;\n var isLastRow = this.rowPositionUtils.sameRow(row, endPosition);\n for (var i = 0; i < colLen; i++) {\n var rowPos = { rowIndex: row.rowIndex, rowPinned: row.rowPinned };\n var celPos = __assign$9(__assign$9({}, rowPos), { column: cellRange.columns[i] });\n var cell = this.navigationService.getCellByPosition(celPos);\n if (cell) {\n this.markedCells.push(cell);\n var cellComp = cell.getComp();\n cellComp.addOrRemoveCssClass('ag-selection-fill-bottom', this.rowPositionUtils.sameRow(row, endPosition));\n }\n }\n if (isLastRow) {\n break;\n }\n // tslint:disable-next-line\n } while (row = this.cellNavigationService.getRowAbove(row));\n };\n FillHandle.prototype.extendHorizontal = function (initialPosition, endPosition, isMovingLeft) {\n var _this = this;\n var allCols = this.columnModel.getAllDisplayedColumns();\n var startCol = allCols.indexOf(isMovingLeft ? endPosition.column : initialPosition.column);\n var endCol = allCols.indexOf(isMovingLeft ? this.getCellRange().columns[0] : endPosition.column);\n var offset = isMovingLeft ? 0 : 1;\n var colsToMark = allCols.slice(startCol + offset, endCol + offset);\n var rangeStartRow = this.getRangeStartRow();\n var rangeEndRow = this.getRangeEndRow();\n colsToMark.forEach(function (column) {\n var row = rangeStartRow;\n var isLastRow = false;\n do {\n isLastRow = _this.rowPositionUtils.sameRow(row, rangeEndRow);\n var cell = _this.navigationService.getCellByPosition({\n rowIndex: row.rowIndex,\n rowPinned: row.rowPinned,\n column: column\n });\n if (cell) {\n _this.markedCells.push(cell);\n var cellComp = cell.getComp();\n cellComp.addOrRemoveCssClass('ag-selection-fill-top', _this.rowPositionUtils.sameRow(row, rangeStartRow));\n cellComp.addOrRemoveCssClass('ag-selection-fill-bottom', _this.rowPositionUtils.sameRow(row, rangeEndRow));\n if (isMovingLeft) {\n _this.isLeft = true;\n cellComp.addOrRemoveCssClass('ag-selection-fill-left', column === colsToMark[0]);\n }\n else {\n cellComp.addOrRemoveCssClass('ag-selection-fill-right', column === _.last(colsToMark));\n }\n }\n row = _this.cellNavigationService.getRowBelow(row);\n } while (!isLastRow);\n });\n };\n FillHandle.prototype.reduceHorizontal = function (initialPosition, endPosition) {\n var _this = this;\n var allCols = this.columnModel.getAllDisplayedColumns();\n var startCol = allCols.indexOf(endPosition.column);\n var endCol = allCols.indexOf(initialPosition.column);\n var colsToMark = allCols.slice(startCol, endCol);\n var rangeStartRow = this.getRangeStartRow();\n var rangeEndRow = this.getRangeEndRow();\n colsToMark.forEach(function (column) {\n var row = rangeStartRow;\n var isLastRow = false;\n do {\n isLastRow = _this.rowPositionUtils.sameRow(row, rangeEndRow);\n var cell = _this.navigationService.getCellByPosition({\n rowIndex: row.rowIndex,\n rowPinned: row.rowPinned,\n column: column\n });\n if (cell) {\n _this.markedCells.push(cell);\n var cellComp = cell.getComp();\n cellComp.addOrRemoveCssClass('ag-selection-fill-right', column === colsToMark[0]);\n }\n row = _this.cellNavigationService.getRowBelow(row);\n } while (!isLastRow);\n });\n };\n FillHandle.prototype.refresh = function (cellCtrl) {\n var cellRange = this.rangeService.getCellRanges()[0];\n var isColumnRange = !cellRange.startRow || !cellRange.endRow;\n if (isColumnRange) {\n this.destroy();\n return;\n }\n _super.prototype.refresh.call(this, cellCtrl);\n };\n FillHandle.TEMPLATE = \"
\";\n __decorate$H([\n Autowired('valueService')\n ], FillHandle.prototype, \"valueService\", void 0);\n __decorate$H([\n Autowired('valueParserService')\n ], FillHandle.prototype, \"valueParserService\", void 0);\n __decorate$H([\n Autowired('valueFormatterService')\n ], FillHandle.prototype, \"valueFormatterService\", void 0);\n return FillHandle;\n}(AbstractSelectionHandle));\n\nvar __extends$K = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign$8 = (undefined && undefined.__assign) || function () {\n __assign$8 = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$8.apply(this, arguments);\n};\nvar RangeHandle = /** @class */ (function (_super) {\n __extends$K(RangeHandle, _super);\n function RangeHandle() {\n var _this = _super.call(this, RangeHandle.TEMPLATE) || this;\n _this.type = SelectionHandleType.RANGE;\n _this.rangeFixed = false;\n return _this;\n }\n RangeHandle.prototype.onDrag = function (e) {\n var lastCellHovered = this.getLastCellHovered();\n if (!lastCellHovered) {\n return;\n }\n var cellRanges = this.rangeService.getCellRanges();\n var lastRange = _.last(cellRanges);\n if (!this.rangeFixed) {\n this.fixRangeStartEnd(lastRange);\n this.rangeFixed = true;\n }\n this.endPosition = {\n rowIndex: lastCellHovered.rowIndex,\n rowPinned: lastCellHovered.rowPinned,\n column: lastCellHovered.column\n };\n // check if the cell ranges are for a chart\n if (cellRanges.length === 2 && cellRanges[0].type === CellRangeType.DIMENSION && lastRange.type === CellRangeType.VALUE) {\n var rowChanged = !this.rowPositionUtils.sameRow(this.endPosition, this.rangeService.getRangeEndRow(lastRange));\n if (rowChanged) {\n // ensure the dimension range is kept in sync with the value range (which has the handle)\n this.rangeService.updateRangeEnd(cellRanges[0], __assign$8(__assign$8({}, this.endPosition), { column: cellRanges[0].columns[0] }), true);\n }\n }\n this.rangeService.extendLatestRangeToCell(this.endPosition);\n };\n RangeHandle.prototype.onDragEnd = function (e) {\n var cellRange = _.last(this.rangeService.getCellRanges());\n this.fixRangeStartEnd(cellRange);\n this.rangeFixed = false;\n };\n RangeHandle.prototype.fixRangeStartEnd = function (cellRange) {\n var startRow = this.rangeService.getRangeStartRow(cellRange);\n var endRow = this.rangeService.getRangeEndRow(cellRange);\n var column = cellRange.columns[0];\n cellRange.startRow = startRow;\n cellRange.endRow = endRow;\n cellRange.startColumn = column;\n };\n RangeHandle.TEMPLATE = \"
\";\n return RangeHandle;\n}(AbstractSelectionHandle));\n\nvar __extends$J = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$G = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar SelectionHandleFactory = /** @class */ (function (_super) {\n __extends$J(SelectionHandleFactory, _super);\n function SelectionHandleFactory() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n SelectionHandleFactory.prototype.createSelectionHandle = function (type) {\n return this.createBean(type === SelectionHandleType.RANGE ? new RangeHandle() : new FillHandle());\n };\n SelectionHandleFactory = __decorate$G([\n Bean('selectionHandleFactory')\n ], SelectionHandleFactory);\n return SelectionHandleFactory;\n}(BeanStub));\n\n// DO NOT UPDATE MANUALLY: Generated from script during build time\nvar VERSION$9 = '30.0.6';\n\nvar RangeSelectionModule = {\n version: VERSION$9,\n moduleName: ModuleNames.RangeSelectionModule,\n beans: [RangeService, SelectionHandleFactory],\n agStackComponents: [\n { componentName: 'AgFillHandle', componentClass: FillHandle },\n { componentName: 'AgRangeHandle', componentClass: RangeHandle }\n ],\n dependantModules: [\n EnterpriseCoreModule\n ]\n};\n\nvar __extends$I = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$F = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __read$a = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar AgColorPanel = /** @class */ (function (_super) {\n __extends$I(AgColorPanel, _super);\n function AgColorPanel(config) {\n var _this = _super.call(this, AgColorPanel.TEMPLATE) || this;\n _this.H = 1; // in the [0, 1] range\n _this.S = 1; // in the [0, 1] range\n _this.B = 1; // in the [0, 1] range\n _this.A = 1; // in the [0, 1] range\n _this.isSpectrumDragging = false;\n _this.isSpectrumHueDragging = false;\n _this.isSpectrumAlphaDragging = false;\n _this.colorChanged = false;\n _this.picker = config.picker;\n return _this;\n }\n AgColorPanel.prototype.postConstruct = function () {\n var eGui = this.getGui();\n this.initRecentColors();\n this.addManagedListener(this.spectrumVal, 'mousedown', this.onSpectrumDraggerDown.bind(this));\n this.addManagedListener(eGui, 'mousemove', this.onSpectrumDraggerMove.bind(this));\n this.addManagedListener(this.spectrumHue, 'mousedown', this.onSpectrumHueDown.bind(this));\n this.addManagedListener(eGui, 'mousemove', this.onSpectrumHueMove.bind(this));\n this.addManagedListener(this.spectrumAlpha, 'mousedown', this.onSpectrumAlphaDown.bind(this));\n this.addManagedListener(eGui, 'mousemove', this.onSpectrumAlphaMove.bind(this));\n // Listening to `mouseup` on the document on purpose. The user might release the mouse button\n // outside the UI control. When the mouse returns back to the control's area, the dragging\n // of the thumb is not expected and seen as a bug.\n this.addManagedListener(document, 'mouseup', this.onMouseUp.bind(this));\n this.addManagedListener(this.recentColors, 'click', this.onRecentColorClick.bind(this));\n };\n AgColorPanel.prototype.refreshSpectrumRect = function () {\n return this.spectrumValRect = this.spectrumVal.getBoundingClientRect();\n };\n AgColorPanel.prototype.refreshHueRect = function () {\n return this.spectrumHueRect = this.spectrumHue.getBoundingClientRect();\n };\n AgColorPanel.prototype.refreshAlphaRect = function () {\n return this.spectrumAlphaRect = this.spectrumAlpha.getBoundingClientRect();\n };\n AgColorPanel.prototype.onSpectrumDraggerDown = function (e) {\n this.refreshSpectrumRect();\n this.isSpectrumDragging = true;\n this.moveDragger(e);\n };\n AgColorPanel.prototype.onSpectrumDraggerMove = function (e) {\n if (this.isSpectrumDragging) {\n this.moveDragger(e);\n }\n };\n AgColorPanel.prototype.onSpectrumHueDown = function (e) {\n this.refreshHueRect();\n this.isSpectrumHueDragging = true;\n this.moveHueSlider(e);\n };\n AgColorPanel.prototype.onSpectrumHueMove = function (e) {\n if (this.isSpectrumHueDragging) {\n this.moveHueSlider(e);\n }\n };\n AgColorPanel.prototype.onSpectrumAlphaDown = function (e) {\n this.refreshAlphaRect();\n this.isSpectrumAlphaDragging = true;\n this.moveAlphaSlider(e);\n };\n AgColorPanel.prototype.onSpectrumAlphaMove = function (e) {\n if (this.isSpectrumAlphaDragging) {\n this.moveAlphaSlider(e);\n }\n };\n AgColorPanel.prototype.onMouseUp = function () {\n this.isSpectrumDragging = false;\n this.isSpectrumHueDragging = false;\n this.isSpectrumAlphaDragging = false;\n };\n AgColorPanel.prototype.moveDragger = function (e) {\n var valRect = this.spectrumValRect;\n if (valRect) {\n var x = e.clientX - valRect.left;\n var y = e.clientY - valRect.top;\n x = Math.max(x, 0);\n x = Math.min(x, valRect.width);\n y = Math.max(y, 0);\n y = Math.min(y, valRect.height);\n this.setSpectrumValue(x / valRect.width, 1 - y / valRect.height);\n }\n };\n AgColorPanel.prototype.moveHueSlider = function (e) {\n var hueRect = this.spectrumHueRect;\n if (hueRect) {\n var slider = this.spectrumHueSlider;\n var sliderRect = slider.getBoundingClientRect();\n var x = e.clientX - hueRect.left;\n x = Math.max(x, 0);\n x = Math.min(x, hueRect.width);\n this.H = 1 - x / hueRect.width;\n slider.style.left = (x + sliderRect.width / 2) + 'px';\n this.update();\n }\n };\n AgColorPanel.prototype.moveAlphaSlider = function (e) {\n var alphaRect = this.spectrumAlphaRect;\n if (alphaRect) {\n var slider = this.spectrumAlphaSlider;\n var sliderRect = slider.getBoundingClientRect();\n var x = e.clientX - alphaRect.left;\n x = Math.max(x, 0);\n x = Math.min(x, alphaRect.width);\n this.A = x / alphaRect.width;\n slider.style.left = (x + sliderRect.width / 2) + 'px';\n this.update();\n }\n };\n AgColorPanel.prototype.update = function () {\n var color = Color.fromHSB(this.H * 360, this.S, this.B, this.A);\n var spectrumColor = Color.fromHSB(this.H * 360, 1, 1);\n var rgbaColor = color.toRgbaString();\n // the recent color list needs to know color has actually changed\n var colorPicker = this.picker;\n var existingColor = Color.fromString(colorPicker.getValue());\n if (existingColor.toRgbaString() !== rgbaColor) {\n this.colorChanged = true;\n }\n colorPicker.setValue(rgbaColor);\n this.spectrumColor.style.backgroundColor = spectrumColor.toRgbaString();\n this.spectrumDragger.style.backgroundColor = rgbaColor;\n };\n /**\n * @param saturation In the [0, 1] interval.\n * @param brightness In the [0, 1] interval.\n */\n AgColorPanel.prototype.setSpectrumValue = function (saturation, brightness) {\n var valRect = this.spectrumValRect || this.refreshSpectrumRect();\n if (valRect) {\n var dragger = this.spectrumDragger;\n var draggerRect = dragger.getBoundingClientRect();\n saturation = Math.max(0, saturation);\n saturation = Math.min(1, saturation);\n brightness = Math.max(0, brightness);\n brightness = Math.min(1, brightness);\n this.S = saturation;\n this.B = brightness;\n dragger.style.left = (saturation * valRect.width - draggerRect.width / 2) + 'px';\n dragger.style.top = ((1 - brightness) * valRect.height - draggerRect.height / 2) + 'px';\n this.update();\n }\n };\n AgColorPanel.prototype.initRecentColors = function () {\n var recentColors = AgColorPanel.recentColors;\n var innerHtml = recentColors.map(function (color, index) {\n return \"
\";\n });\n this.recentColors.innerHTML = innerHtml.join('');\n };\n AgColorPanel.prototype.setValue = function (val) {\n var color = Color.fromString(val);\n var _a = __read$a(color.toHSB(), 3), h = _a[0], s = _a[1], b = _a[2];\n this.H = (isNaN(h) ? 0 : h) / 360;\n this.A = color.a;\n var spectrumHueRect = this.spectrumHueRect || this.refreshHueRect();\n var spectrumAlphaRect = this.spectrumAlphaRect || this.refreshAlphaRect();\n this.spectrumHueSlider.style.left = ((this.H - 1) * -spectrumHueRect.width) + \"px\";\n this.spectrumAlphaSlider.style.left = (this.A * spectrumAlphaRect.width) + \"px\";\n this.setSpectrumValue(s, b);\n };\n AgColorPanel.prototype.onRecentColorClick = function (e) {\n var target = e.target;\n if (!_.exists(target.id)) {\n return;\n }\n var id = parseInt(target.id, 10);\n this.setValue(AgColorPanel.recentColors[id]);\n this.destroy();\n };\n AgColorPanel.prototype.addRecentColor = function () {\n var color = Color.fromHSB(this.H * 360, this.S, this.B, this.A);\n var rgbaColor = color.toRgbaString();\n var recentColors = AgColorPanel.recentColors;\n if (!this.colorChanged || recentColors[0] === rgbaColor) {\n return;\n }\n // remove duplicate color\n recentColors = recentColors.filter(function (currentColor) { return currentColor != rgbaColor; });\n // add color to head\n recentColors = [rgbaColor].concat(recentColors);\n // ensure we don't exceed max number of recent colors\n if (recentColors.length > AgColorPanel.maxRecentColors) {\n recentColors = recentColors.slice(0, AgColorPanel.maxRecentColors);\n }\n AgColorPanel.recentColors = recentColors;\n };\n AgColorPanel.prototype.destroy = function () {\n this.addRecentColor();\n _super.prototype.destroy.call(this);\n };\n AgColorPanel.maxRecentColors = 8;\n AgColorPanel.recentColors = [];\n AgColorPanel.TEMPLATE = \"
\\n
\\n
\\n
\\n
\\n
\\n
\\n
\\n
\\n
\\n
\\n
\\n
\\n
\\n
\\n
\\n
\\n
\\n
\\n
\";\n __decorate$F([\n RefSelector('spectrumColor')\n ], AgColorPanel.prototype, \"spectrumColor\", void 0);\n __decorate$F([\n RefSelector('spectrumVal')\n ], AgColorPanel.prototype, \"spectrumVal\", void 0);\n __decorate$F([\n RefSelector('spectrumDragger')\n ], AgColorPanel.prototype, \"spectrumDragger\", void 0);\n __decorate$F([\n RefSelector('spectrumHue')\n ], AgColorPanel.prototype, \"spectrumHue\", void 0);\n __decorate$F([\n RefSelector('spectrumHueSlider')\n ], AgColorPanel.prototype, \"spectrumHueSlider\", void 0);\n __decorate$F([\n RefSelector('spectrumAlpha')\n ], AgColorPanel.prototype, \"spectrumAlpha\", void 0);\n __decorate$F([\n RefSelector('spectrumAlphaSlider')\n ], AgColorPanel.prototype, \"spectrumAlphaSlider\", void 0);\n __decorate$F([\n RefSelector('recentColors')\n ], AgColorPanel.prototype, \"recentColors\", void 0);\n __decorate$F([\n PostConstruct\n ], AgColorPanel.prototype, \"postConstruct\", null);\n return AgColorPanel;\n}(Component));\n\nvar __extends$H = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar AgColorPicker = /** @class */ (function (_super) {\n __extends$H(AgColorPicker, _super);\n function AgColorPicker(config) {\n var _this = _super.call(this, config, 'ag-color-picker', 'colorPicker') || this;\n if (config && config.color) {\n _this.value = config.color;\n }\n return _this;\n }\n AgColorPicker.prototype.postConstruct = function () {\n _super.prototype.postConstruct.call(this);\n if (this.value) {\n this.setValue(this.value);\n }\n };\n AgColorPicker.prototype.showPicker = function () {\n var _this = this;\n var eGuiRect = this.getGui().getBoundingClientRect();\n var colorDialog = this.createBean(new AgDialog({\n closable: false,\n modal: true,\n hideTitleBar: true,\n minWidth: 190,\n width: 190,\n height: 250,\n x: eGuiRect.right - 190,\n y: eGuiRect.top - 250\n }));\n this.isPickerDisplayed = true;\n colorDialog.addCssClass('ag-color-dialog');\n _.setAriaExpanded(this.eWrapper, true);\n var colorPanel = this.createBean(new AgColorPanel({ picker: this }));\n colorPanel.addDestroyFunc(function () {\n if (colorDialog.isAlive()) {\n _this.destroyBean(colorDialog);\n }\n });\n colorDialog.setParentComponent(this);\n colorDialog.setBodyComponent(colorPanel);\n colorPanel.setValue(this.getValue());\n colorDialog.addDestroyFunc(function () {\n // here we check if the picker was already being\n // destroyed to avoid a stack overflow\n if (!_this.isDestroyingPicker) {\n _this.isDestroyingPicker = true;\n if (colorPanel.isAlive()) {\n _this.destroyBean(colorPanel);\n }\n }\n else {\n _this.isDestroyingPicker = false;\n }\n if (_this.isAlive()) {\n _.setAriaExpanded(_this.eWrapper, false);\n _this.getFocusableElement().focus();\n }\n _this.isPickerDisplayed = false;\n });\n return colorDialog;\n };\n AgColorPicker.prototype.setValue = function (color) {\n if (this.value === color) {\n return this;\n }\n this.eDisplayField.style.backgroundColor = color;\n return _super.prototype.setValue.call(this, color);\n };\n AgColorPicker.prototype.getValue = function () {\n return this.value;\n };\n return AgColorPicker;\n}(AgPickerField));\n\nvar __read$9 = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar VERSION_CHECKING_FIRST_GRID_MAJOR_VERSION = 28;\nvar VERSION_CHECKING_FIRST_CHARTS_MAJOR_VERSION = 6;\nfunction isValidVersion(version) {\n return version && version.match(/\\d+\\.\\d+\\.\\d+/);\n}\nfunction isValidMajorVersion(_a) {\n var gridMajorVersion = _a.gridMajorVersion, chartsMajorVersion = _a.chartsMajorVersion;\n var gridMajor = parseInt(gridMajorVersion, 10);\n var chartsMajor = parseInt(chartsMajorVersion, 10);\n var gridMajorDifference = gridMajor - VERSION_CHECKING_FIRST_GRID_MAJOR_VERSION;\n var chartsMajorDifference = chartsMajor - VERSION_CHECKING_FIRST_CHARTS_MAJOR_VERSION;\n var isFirstOrAfterVersion = gridMajorDifference >= 0;\n return gridMajorDifference === chartsMajorDifference && isFirstOrAfterVersion;\n}\nfunction gridChartVersion(gridVersion) {\n if (!gridVersion || !isValidVersion(gridVersion)) {\n return undefined;\n }\n var _a = __read$9(gridVersion.split('.') || [], 2), gridMajor = _a[0], gridMinor = _a[1];\n var gridMajorMinor = gridMajor + \".\" + gridMinor + \".x\";\n var gridMajorNumber = parseInt(gridMajor, 10);\n var chartsMajor = (gridMajorNumber - VERSION_CHECKING_FIRST_GRID_MAJOR_VERSION) + VERSION_CHECKING_FIRST_CHARTS_MAJOR_VERSION;\n if (chartsMajor < 0) {\n return undefined;\n }\n var chartsMinor = gridMinor;\n var chartsMajorMinor = chartsMajor + \".\" + chartsMinor + \".x\";\n return {\n gridMajorMinor: gridMajorMinor,\n chartsMajorMinor: chartsMajorMinor\n };\n}\nfunction validGridChartsVersionErrorMessage(_a) {\n var type = _a.type, gridVersion = _a.gridVersion, chartsVersion = _a.chartsVersion;\n var invalidMessage = 'AG Grid: AG Grid version is incompatible. Please see https://www.ag-grid.com/javascript-data-grid/modules/ for more information.';\n if (!gridVersion) {\n return invalidMessage;\n }\n var version = gridChartVersion(gridVersion);\n if (!version) {\n return invalidMessage;\n }\n var gridMajorMinor = version.gridMajorMinor, chartsMajorMinor = version.chartsMajorMinor;\n if (type === 'incompatible') {\n return \"AG Grid version \" + gridVersion + \" and AG Charts version \" + chartsVersion + \" is not supported. AG Grid version \" + gridMajorMinor + \" should be used with AG Chart \" + chartsMajorMinor + \". Please see https://www.ag-grid.com/javascript-data-grid/modules/ for more information.\";\n }\n else if (type === 'invalidCharts') {\n return \"AG Grid version \" + gridMajorMinor + \" should be used with AG Chart \" + chartsMajorMinor + \". Please see https://www.ag-grid.com/javascript-data-grid/modules/ for more information.\";\n }\n return invalidMessage;\n}\nfunction validGridChartsVersion(_a) {\n var gridVersion = _a.gridVersion, chartsVersion = _a.chartsVersion;\n if (!isValidVersion(chartsVersion)) {\n return {\n isValid: false,\n message: validGridChartsVersionErrorMessage({ type: 'invalidCharts', gridVersion: gridVersion, chartsVersion: chartsVersion })\n };\n }\n if (!isValidVersion(gridVersion)) {\n return {\n isValid: false,\n message: validGridChartsVersionErrorMessage({ type: 'invalidGrid', gridVersion: gridVersion, chartsVersion: chartsVersion })\n };\n }\n var _b = __read$9(gridVersion.split('.') || [], 2), gridMajor = _b[0], gridMinor = _b[1];\n var _c = __read$9(chartsVersion.split('.') || [], 2), chartsMajor = _c[0], chartsMinor = _c[1];\n var isValidMajor = isValidMajorVersion({\n gridMajorVersion: gridMajor,\n chartsMajorVersion: chartsMajor\n });\n if (isValidMajor && gridMinor === chartsMinor) {\n return {\n isValid: true\n };\n }\n else if (!isValidMajor || gridMinor !== chartsMinor) {\n return {\n isValid: false,\n message: validGridChartsVersionErrorMessage({ type: 'incompatible', gridVersion: gridVersion, chartsVersion: chartsVersion })\n };\n }\n return {\n isValid: false,\n message: validGridChartsVersionErrorMessage({ type: 'invalid', gridVersion: gridVersion, chartsVersion: chartsVersion })\n };\n}\n\nvar GridChartsModule = {\n version: VERSION$a,\n validate: function () {\n return validGridChartsVersion({\n gridVersion: VERSION$a,\n chartsVersion: ChartService.CHARTS_VERSION\n });\n },\n moduleName: ModuleNames.GridChartsModule,\n beans: [\n ChartService, ChartTranslationService, ChartCrossFilterService\n ],\n agStackComponents: [\n { componentName: 'AgColorPicker', componentClass: AgColorPicker },\n { componentName: 'AgAngleSelect', componentClass: AgAngleSelect },\n ],\n dependantModules: [\n RangeSelectionModule,\n EnterpriseCoreModule\n ]\n};\n\n/**\n * Internal Use Only: Used to ensure this file is treated as a module until we can use moduleDetection flag in Ts v4.7\n */\nvar __FORCE_MODULE_DETECTION_AG_GRID_CORE_EXT = 0;\n\nvar agCharts = {\n time: time,\n AgChart: AgChart\n};\n\nvar __extends$G = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign$7 = (undefined && undefined.__assign) || function () {\n __assign$7 = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$7.apply(this, arguments);\n};\nvar __decorate$E = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar DetailCellRendererCtrl = /** @class */ (function (_super) {\n __extends$G(DetailCellRendererCtrl, _super);\n function DetailCellRendererCtrl() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.loadRowDataVersion = 0;\n return _this;\n }\n DetailCellRendererCtrl.prototype.init = function (comp, params) {\n this.params = params;\n this.comp = comp;\n var doNothingBecauseInsidePinnedSection = params.pinned != null;\n if (doNothingBecauseInsidePinnedSection) {\n return;\n }\n this.setAutoHeightClasses();\n this.setupRefreshStrategy();\n this.addThemeToDetailGrid();\n this.createDetailGrid();\n this.loadRowData();\n this.addManagedListener(this.eventService, Events.EVENT_FULL_WIDTH_ROW_FOCUSED, this.onFullWidthRowFocused.bind(this));\n };\n DetailCellRendererCtrl.prototype.onFullWidthRowFocused = function (e) {\n var params = this.params;\n var row = { rowIndex: params.node.rowIndex, rowPinned: params.node.rowPinned };\n var eventRow = { rowIndex: e.rowIndex, rowPinned: e.rowPinned };\n var isSameRow = this.rowPositionUtils.sameRow(row, eventRow);\n if (!isSameRow) {\n return;\n }\n this.focusService.focusInto(this.comp.getGui(), e.fromBelow);\n };\n DetailCellRendererCtrl.prototype.setAutoHeightClasses = function () {\n var autoHeight = this.gridOptionsService.is('detailRowAutoHeight');\n var parentClass = autoHeight ? 'ag-details-row-auto-height' : 'ag-details-row-fixed-height';\n var detailClass = autoHeight ? 'ag-details-grid-auto-height' : 'ag-details-grid-fixed-height';\n this.comp.addOrRemoveCssClass(parentClass, true);\n this.comp.addOrRemoveDetailGridCssClass(detailClass, true);\n };\n DetailCellRendererCtrl.prototype.setupRefreshStrategy = function () {\n var providedStrategy = this.params.refreshStrategy;\n var validSelection = providedStrategy == 'everything' || providedStrategy == 'nothing' || providedStrategy == 'rows';\n if (validSelection) {\n this.refreshStrategy = providedStrategy;\n return;\n }\n if (providedStrategy != null) {\n console.warn(\"AG Grid: invalid cellRendererParams.refreshStrategy = '\" + providedStrategy +\n \"' supplied, defaulting to refreshStrategy = 'rows'.\");\n }\n this.refreshStrategy = 'rows';\n };\n DetailCellRendererCtrl.prototype.addThemeToDetailGrid = function () {\n // this is needed by environment service of the child grid, the class needs to be on\n // the grid div itself - the browser's CSS on the other hand just inherits from the parent grid theme.\n var theme = this.environment.getTheme().theme;\n if (theme) {\n this.comp.addOrRemoveDetailGridCssClass(theme, true);\n }\n };\n DetailCellRendererCtrl.prototype.createDetailGrid = function () {\n if (_.missing(this.params.detailGridOptions)) {\n console.warn('AG Grid: could not find detail grid options for master detail, ' +\n 'please set gridOptions.detailCellRendererParams.detailGridOptions');\n return;\n }\n var autoHeight = this.gridOptionsService.is('detailRowAutoHeight');\n // we clone the detail grid options, as otherwise it would be shared\n // across many instances, and that would be a problem because we set\n // api and columnApi into gridOptions\n var gridOptions = __assign$7({}, this.params.detailGridOptions);\n if (autoHeight) {\n gridOptions.domLayout = 'autoHeight';\n }\n this.comp.setDetailGrid(gridOptions);\n };\n DetailCellRendererCtrl.prototype.registerDetailWithMaster = function (api, columnApi) {\n var rowId = this.params.node.id;\n var masterGridApi = this.params.api;\n var gridInfo = {\n id: rowId,\n api: api,\n columnApi: columnApi\n };\n var rowNode = this.params.node;\n // register with api\n masterGridApi.addDetailGridInfo(rowId, gridInfo);\n // register with node\n rowNode.detailGridInfo = gridInfo;\n this.addDestroyFunc(function () {\n // the gridInfo can be stale if a refresh happens and\n // a new row is created before the old one is destroyed.\n if (rowNode.detailGridInfo !== gridInfo) {\n return;\n }\n masterGridApi.removeDetailGridInfo(rowId); // unregister from api\n rowNode.detailGridInfo = null; // unregister from node\n });\n };\n DetailCellRendererCtrl.prototype.loadRowData = function () {\n var _this = this;\n // in case a refresh happens before the last refresh completes (as we depend on async\n // application logic) we keep track on what the latest call was.\n this.loadRowDataVersion++;\n var versionThisCall = this.loadRowDataVersion;\n var userFunc = this.params.getDetailRowData;\n if (!userFunc) {\n console.warn('AG Grid: could not find getDetailRowData for master / detail, ' +\n 'please set gridOptions.detailCellRendererParams.getDetailRowData');\n return;\n }\n var successCallback = function (rowData) {\n var mostRecentCall = _this.loadRowDataVersion === versionThisCall;\n if (mostRecentCall) {\n _this.comp.setRowData(rowData);\n }\n };\n var funcParams = {\n node: this.params.node,\n // we take data from node, rather than params.data\n // as the data could have been updated with new instance\n data: this.params.node.data,\n successCallback: successCallback,\n context: this.gridOptionsService.context\n };\n userFunc(funcParams);\n };\n DetailCellRendererCtrl.prototype.refresh = function () {\n var GET_GRID_TO_REFRESH = false;\n var GET_GRID_TO_DO_NOTHING = true;\n switch (this.refreshStrategy) {\n // ignore this refresh, make grid think we've refreshed but do nothing\n case 'nothing': return GET_GRID_TO_DO_NOTHING;\n // grid will destroy and recreate the cell\n case 'everything': return GET_GRID_TO_REFRESH;\n }\n // do the refresh here, and tell the grid to do nothing\n this.loadRowData();\n return GET_GRID_TO_DO_NOTHING;\n };\n __decorate$E([\n Autowired('rowPositionUtils')\n ], DetailCellRendererCtrl.prototype, \"rowPositionUtils\", void 0);\n __decorate$E([\n Autowired('focusService')\n ], DetailCellRendererCtrl.prototype, \"focusService\", void 0);\n return DetailCellRendererCtrl;\n}(BeanStub));\n\nvar __extends$F = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$D = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar DetailCellRenderer = /** @class */ (function (_super) {\n __extends$F(DetailCellRenderer, _super);\n function DetailCellRenderer() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n DetailCellRenderer.prototype.init = function (params) {\n var _this = this;\n this.params = params;\n this.selectAndSetTemplate();\n var compProxy = {\n addOrRemoveCssClass: function (cssClassName, on) { return _this.addOrRemoveCssClass(cssClassName, on); },\n addOrRemoveDetailGridCssClass: function (cssClassName, on) { return _this.eDetailGrid.classList.toggle(cssClassName, on); },\n setDetailGrid: function (gridOptions) { return _this.setDetailGrid(gridOptions); },\n setRowData: function (rowData) { return _this.setRowData(rowData); },\n getGui: function () { return _this.eDetailGrid; }\n };\n this.ctrl = this.createManagedBean(new DetailCellRendererCtrl());\n this.ctrl.init(compProxy, params);\n };\n DetailCellRenderer.prototype.refresh = function () {\n return this.ctrl && this.ctrl.refresh();\n };\n // this is a user component, and IComponent has \"public destroy()\" as part of the interface.\n // so we need to override destroy() just to make the method public.\n DetailCellRenderer.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n };\n DetailCellRenderer.prototype.selectAndSetTemplate = function () {\n var _this = this;\n if (this.params.pinned) {\n this.setTemplate('
');\n return;\n }\n var setDefaultTemplate = function () {\n _this.setTemplate(DetailCellRenderer.TEMPLATE);\n };\n if (_.missing(this.params.template)) {\n // use default template\n setDefaultTemplate();\n }\n else {\n // use user provided template\n if (typeof this.params.template === 'string') {\n this.setTemplate(this.params.template);\n }\n else if (typeof this.params.template === 'function') {\n var templateFunc = this.params.template;\n var template = templateFunc(this.params);\n this.setTemplate(template);\n }\n else {\n console.warn('AG Grid: detailCellRendererParams.template should be function or string');\n setDefaultTemplate();\n }\n }\n if (this.eDetailGrid == null) {\n console.warn('AG Grid: reference to eDetailGrid was missing from the details template. ' +\n 'Please add ref=\"eDetailGrid\" to the template.');\n }\n };\n DetailCellRenderer.prototype.setDetailGrid = function (gridOptions) {\n if (!this.eDetailGrid) {\n return;\n }\n // AG-1715\n // this is only needed when suppressReactUi=true, once we remove the old way\n // of doing react, and Master / Details is all native React, then we\n // can remove this code.\n var agGridReact = this.context.getBean('agGridReact');\n var agGridReactCloned = agGridReact ? _.cloneObject(agGridReact) : undefined;\n // when we create detail grid, the detail grid needs frameworkComponentWrapper so that\n // it created child components correctly, ie Angular detail grid can have Angular cell renderer.\n // this is only used by Angular and Vue, as React uses native React AG Grid detail grids\n var frameworkComponentWrapper = this.context.getBean('frameworkComponentWrapper');\n var frameworkOverrides = this.getFrameworkOverrides();\n // tslint:disable-next-line\n new Grid(this.eDetailGrid, gridOptions, {\n frameworkOverrides: frameworkOverrides,\n providedBeanInstances: {\n agGridReact: agGridReactCloned,\n frameworkComponentWrapper: frameworkComponentWrapper\n },\n modules: ModuleRegistry.__getGridRegisteredModules(this.params.api.getGridId())\n });\n this.detailApi = gridOptions.api;\n this.ctrl.registerDetailWithMaster(gridOptions.api, gridOptions.columnApi);\n this.addDestroyFunc(function () {\n if (gridOptions.api) {\n gridOptions.api.destroy();\n }\n });\n };\n DetailCellRenderer.prototype.setRowData = function (rowData) {\n // ensure detail grid api still exists (grid may be destroyed when async call tries to set data)\n this.detailApi && this.detailApi.setRowData(rowData);\n };\n DetailCellRenderer.TEMPLATE = \"
\\n
\\n
\";\n __decorate$D([\n RefSelector('eDetailGrid')\n ], DetailCellRenderer.prototype, \"eDetailGrid\", void 0);\n return DetailCellRenderer;\n}(Component));\n\n// DO NOT UPDATE MANUALLY: Generated from script during build time\nvar VERSION$8 = '30.0.6';\n\nvar MasterDetailModule = {\n version: VERSION$8,\n moduleName: ModuleNames.MasterDetailModule,\n beans: [],\n userComponents: [\n { componentName: 'agDetailCellRenderer', componentClass: DetailCellRenderer }\n ],\n controllers: [\n { controllerName: 'detailCellRenderer', controllerClass: DetailCellRendererCtrl }\n ],\n dependantModules: [\n EnterpriseCoreModule\n ]\n};\n\nvar __extends$E = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$C = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar EnterpriseMenuFactory = /** @class */ (function (_super) {\n __extends$E(EnterpriseMenuFactory, _super);\n function EnterpriseMenuFactory() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n EnterpriseMenuFactory.prototype.hideActiveMenu = function () {\n this.destroyBean(this.activeMenu);\n };\n EnterpriseMenuFactory.prototype.showMenuAfterMouseEvent = function (column, mouseEvent, defaultTab) {\n var _this = this;\n this.showMenu(column, function (menu) {\n var ePopup = menu.getGui();\n _this.popupService.positionPopupUnderMouseEvent({\n type: 'columnMenu',\n column: column,\n mouseEvent: mouseEvent,\n ePopup: ePopup\n });\n if (defaultTab) {\n menu.showTab(defaultTab);\n }\n }, 'columnMenu', defaultTab, undefined, mouseEvent.target);\n };\n EnterpriseMenuFactory.prototype.showMenuAfterButtonClick = function (column, eventSource, containerType, defaultTab, restrictToTabs) {\n var _this = this;\n var multiplier = -1;\n var alignSide = 'left';\n if (this.gridOptionsService.is('enableRtl')) {\n multiplier = 1;\n alignSide = 'right';\n }\n this.showMenu(column, function (menu) {\n var ePopup = menu.getGui();\n _this.popupService.positionPopupByComponent({\n type: containerType,\n column: column,\n eventSource: eventSource,\n ePopup: ePopup,\n alignSide: alignSide,\n nudgeX: 9 * multiplier,\n nudgeY: -23,\n position: 'under',\n keepWithinBounds: true,\n });\n if (defaultTab) {\n menu.showTab(defaultTab);\n }\n }, containerType, defaultTab, restrictToTabs, eventSource);\n };\n EnterpriseMenuFactory.prototype.showMenu = function (column, positionCallback, containerType, defaultTab, restrictToTabs, eventSource) {\n var _this = this;\n var _a = this.getMenuParams(column, restrictToTabs, eventSource), menu = _a.menu, eMenuGui = _a.eMenuGui, currentHeaderPosition = _a.currentHeaderPosition, currentColumnIndex = _a.currentColumnIndex, anchorToElement = _a.anchorToElement;\n var closedFuncs = [];\n closedFuncs.push(this.getClosedCallback(column, menu, currentHeaderPosition, currentColumnIndex, eventSource));\n var translate = this.localeService.getLocaleTextFunc();\n // need to show filter before positioning, as only after filter\n // is visible can we find out what the width of it is\n this.popupService.addPopup({\n modal: true,\n eChild: eMenuGui,\n closeOnEsc: true,\n closedCallback: function (e) {\n closedFuncs.forEach(function (f) { return f(e); });\n },\n afterGuiAttached: function (params) { return menu.afterGuiAttached(Object.assign({}, { container: containerType }, params)); },\n // if defaultTab is not present, positionCallback will be called\n // after `showTabBasedOnPreviousSelection` is called.\n positionCallback: !!defaultTab ? function () { return positionCallback(menu); } : undefined,\n ariaLabel: translate('ariaLabelColumnMenu', 'Column Menu')\n });\n if (!defaultTab) {\n menu.showTabBasedOnPreviousSelection();\n // reposition the menu because the method above could load\n // an element that is bigger than enterpriseMenu header.\n positionCallback(menu);\n }\n // if user starts showing / hiding columns, or otherwise move the underlying column\n // for this menu, we want to stop tracking the menu with the column position. otherwise\n // the menu would move as the user is using the columns tab inside the menu.\n var stopAnchoringPromise = this.popupService.setPopupPositionRelatedToElement(eMenuGui, anchorToElement);\n if (stopAnchoringPromise) {\n this.addStopAnchoring(stopAnchoringPromise, column, closedFuncs);\n }\n menu.addEventListener(EnterpriseMenu.EVENT_TAB_SELECTED, function (event) {\n _this.lastSelectedTab = event.key;\n });\n column.setMenuVisible(true, 'contextMenu');\n this.activeMenu = menu;\n menu.addEventListener(BeanStub.EVENT_DESTROYED, function () {\n if (_this.activeMenu === menu) {\n _this.activeMenu = null;\n }\n });\n };\n EnterpriseMenuFactory.prototype.addStopAnchoring = function (stopAnchoringPromise, column, closedFuncsArr) {\n stopAnchoringPromise.then(function (stopAnchoringFunc) {\n column.addEventListener('leftChanged', stopAnchoringFunc);\n column.addEventListener('visibleChanged', stopAnchoringFunc);\n closedFuncsArr.push(function () {\n column.removeEventListener('leftChanged', stopAnchoringFunc);\n column.removeEventListener('visibleChanged', stopAnchoringFunc);\n });\n });\n };\n EnterpriseMenuFactory.prototype.getClosedCallback = function (column, menu, headerPosition, columnIndex, eventSource) {\n var _this = this;\n return function (e) {\n _this.destroyBean(menu);\n column.setMenuVisible(false, 'contextMenu');\n var isKeyboardEvent = e instanceof KeyboardEvent;\n if (!isKeyboardEvent || !eventSource) {\n return;\n }\n if (_.isVisible(eventSource)) {\n var focusableEl = _this.focusService.findTabbableParent(eventSource);\n if (focusableEl) {\n if (column) {\n _this.headerNavigationService.scrollToColumn(column);\n }\n focusableEl.focus();\n }\n }\n // if the focusEl is no longer in the DOM, we try to focus\n // the header that is closest to the previous header position\n else if (headerPosition && columnIndex !== -1) {\n var allColumns = _this.columnModel.getAllDisplayedColumns();\n var columnToFocus = allColumns[columnIndex] || _.last(allColumns);\n if (columnToFocus) {\n _this.focusService.focusHeaderPosition({\n headerPosition: {\n headerRowIndex: headerPosition.headerRowIndex,\n column: columnToFocus\n }\n });\n }\n }\n };\n };\n EnterpriseMenuFactory.prototype.getMenuParams = function (column, restrictToTabs, eventSource) {\n var menu = this.createBean(new EnterpriseMenu(column, this.lastSelectedTab, restrictToTabs));\n return {\n menu: menu,\n eMenuGui: menu.getGui(),\n currentHeaderPosition: this.focusService.getFocusedHeader(),\n currentColumnIndex: this.columnModel.getAllDisplayedColumns().indexOf(column),\n anchorToElement: eventSource || this.ctrlsService.getGridBodyCtrl().getGui()\n };\n };\n EnterpriseMenuFactory.prototype.isMenuEnabled = function (column) {\n return column.getMenuTabs(EnterpriseMenu.TABS_DEFAULT).length > 0;\n };\n __decorate$C([\n Autowired('popupService')\n ], EnterpriseMenuFactory.prototype, \"popupService\", void 0);\n __decorate$C([\n Autowired('focusService')\n ], EnterpriseMenuFactory.prototype, \"focusService\", void 0);\n __decorate$C([\n Autowired('headerNavigationService')\n ], EnterpriseMenuFactory.prototype, \"headerNavigationService\", void 0);\n __decorate$C([\n Autowired('ctrlsService')\n ], EnterpriseMenuFactory.prototype, \"ctrlsService\", void 0);\n __decorate$C([\n Autowired('columnModel')\n ], EnterpriseMenuFactory.prototype, \"columnModel\", void 0);\n EnterpriseMenuFactory = __decorate$C([\n Bean('menuFactory')\n ], EnterpriseMenuFactory);\n return EnterpriseMenuFactory;\n}(BeanStub));\nvar EnterpriseMenu = /** @class */ (function (_super) {\n __extends$E(EnterpriseMenu, _super);\n function EnterpriseMenu(column, initialSelection, restrictTo) {\n var _this = _super.call(this) || this;\n _this.tabFactories = {};\n _this.includeChecks = {};\n _this.column = column;\n _this.initialSelection = initialSelection;\n _this.tabFactories[EnterpriseMenu.TAB_GENERAL] = _this.createMainPanel.bind(_this);\n _this.tabFactories[EnterpriseMenu.TAB_FILTER] = _this.createFilterPanel.bind(_this);\n _this.tabFactories[EnterpriseMenu.TAB_COLUMNS] = _this.createColumnsPanel.bind(_this);\n _this.includeChecks[EnterpriseMenu.TAB_GENERAL] = function () { return true; };\n _this.includeChecks[EnterpriseMenu.TAB_FILTER] = function () { return _this.filterManager.isFilterAllowed(column); };\n _this.includeChecks[EnterpriseMenu.TAB_COLUMNS] = function () { return true; };\n _this.restrictTo = restrictTo;\n return _this;\n }\n EnterpriseMenu.prototype.init = function () {\n var _this = this;\n var tabs = this.getTabsToCreate().map(function (name) { return _this.createTab(name); });\n this.tabbedLayout = new TabbedLayout({\n items: tabs,\n cssClass: 'ag-menu',\n onActiveItemClicked: this.onHidePopup.bind(this),\n onItemClicked: this.onTabItemClicked.bind(this)\n });\n this.createBean(this.tabbedLayout);\n if (this.mainMenuList) {\n this.mainMenuList.setParentComponent(this.tabbedLayout);\n }\n this.addDestroyFunc(function () { return _this.destroyBean(_this.tabbedLayout); });\n };\n EnterpriseMenu.prototype.getTabsToCreate = function () {\n var _this = this;\n if (this.restrictTo) {\n return this.restrictTo;\n }\n return this.column.getMenuTabs(EnterpriseMenu.TABS_DEFAULT)\n .filter(function (tabName) { return _this.isValidMenuTabItem(tabName); })\n .filter(function (tabName) { return _this.isNotSuppressed(tabName); })\n .filter(function (tabName) { return _this.isModuleLoaded(tabName); });\n };\n EnterpriseMenu.prototype.isModuleLoaded = function (menuTabName) {\n if (menuTabName === EnterpriseMenu.TAB_COLUMNS) {\n return ModuleRegistry.__isRegistered(ModuleNames.ColumnsToolPanelModule, this.context.getGridId());\n }\n return true;\n };\n EnterpriseMenu.prototype.isValidMenuTabItem = function (menuTabName) {\n var isValid = true;\n var itemsToConsider = EnterpriseMenu.TABS_DEFAULT;\n if (this.restrictTo != null) {\n isValid = this.restrictTo.indexOf(menuTabName) > -1;\n itemsToConsider = this.restrictTo;\n }\n isValid = isValid && EnterpriseMenu.TABS_DEFAULT.indexOf(menuTabName) > -1;\n if (!isValid) {\n console.warn(\"AG Grid: Trying to render an invalid menu item '\" + menuTabName + \"'. Check that your 'menuTabs' contains one of [\" + itemsToConsider + \"]\");\n }\n return isValid;\n };\n EnterpriseMenu.prototype.isNotSuppressed = function (menuTabName) {\n return this.includeChecks[menuTabName]();\n };\n EnterpriseMenu.prototype.createTab = function (name) {\n return this.tabFactories[name]();\n };\n EnterpriseMenu.prototype.showTabBasedOnPreviousSelection = function () {\n // show the tab the user was on last time they had a menu open\n this.showTab(this.initialSelection);\n };\n EnterpriseMenu.prototype.showTab = function (toShow) {\n if (this.tabItemColumns && toShow === EnterpriseMenu.TAB_COLUMNS) {\n this.tabbedLayout.showItem(this.tabItemColumns);\n }\n else if (this.tabItemFilter && toShow === EnterpriseMenu.TAB_FILTER) {\n this.tabbedLayout.showItem(this.tabItemFilter);\n }\n else if (this.tabItemGeneral && toShow === EnterpriseMenu.TAB_GENERAL) {\n this.tabbedLayout.showItem(this.tabItemGeneral);\n }\n else {\n this.tabbedLayout.showFirstItem();\n }\n };\n EnterpriseMenu.prototype.onTabItemClicked = function (event) {\n var key = null;\n switch (event.item) {\n case this.tabItemColumns:\n key = EnterpriseMenu.TAB_COLUMNS;\n break;\n case this.tabItemFilter:\n key = EnterpriseMenu.TAB_FILTER;\n break;\n case this.tabItemGeneral:\n key = EnterpriseMenu.TAB_GENERAL;\n break;\n }\n if (key) {\n this.activateTab(key);\n }\n };\n EnterpriseMenu.prototype.activateTab = function (tab) {\n var ev = {\n type: EnterpriseMenu.EVENT_TAB_SELECTED,\n key: tab\n };\n this.dispatchEvent(ev);\n };\n EnterpriseMenu.prototype.getMenuItems = function () {\n var defaultMenuOptions = this.getDefaultMenuOptions();\n var result;\n var userFunc = this.gridOptionsService.getCallback('getMainMenuItems');\n if (userFunc) {\n result = userFunc({\n column: this.column,\n defaultItems: defaultMenuOptions\n });\n }\n else {\n result = defaultMenuOptions;\n }\n // GUI looks weird when two separators are side by side. this can happen accidentally\n // if we remove items from the menu then two separators can edit up adjacent.\n _.removeRepeatsFromArray(result, EnterpriseMenu.MENU_ITEM_SEPARATOR);\n return result;\n };\n EnterpriseMenu.prototype.getDefaultMenuOptions = function () {\n var result = [];\n var allowPinning = !this.column.getColDef().lockPinned;\n var rowGroupCount = this.columnModel.getRowGroupColumns().length;\n var doingGrouping = rowGroupCount > 0;\n var groupedByThisColumn = this.columnModel.getRowGroupColumns().indexOf(this.column) >= 0;\n var allowValue = this.column.isAllowValue();\n var allowRowGroup = this.column.isAllowRowGroup();\n var isPrimary = this.column.isPrimary();\n var pivotModeOn = this.columnModel.isPivotMode();\n var isInMemoryRowModel = this.rowModel.getType() === 'clientSide';\n var usingTreeData = this.gridOptionsService.isTreeData();\n var allowValueAgg = \n // if primary, then only allow aggValue if grouping and it's a value columns\n (isPrimary && doingGrouping && allowValue)\n // secondary columns can always have aggValue, as it means it's a pivot value column\n || !isPrimary;\n if (allowPinning) {\n result.push('pinSubMenu');\n }\n if (allowValueAgg) {\n result.push('valueAggSubMenu');\n }\n if (allowPinning || allowValueAgg) {\n result.push(EnterpriseMenu.MENU_ITEM_SEPARATOR);\n }\n result.push('autoSizeThis');\n result.push('autoSizeAll');\n result.push(EnterpriseMenu.MENU_ITEM_SEPARATOR);\n if (allowRowGroup && this.column.isPrimary()) {\n if (groupedByThisColumn) {\n result.push('rowUnGroup');\n }\n else {\n result.push('rowGroup');\n }\n }\n result.push(EnterpriseMenu.MENU_ITEM_SEPARATOR);\n result.push('resetColumns');\n // only add grouping expand/collapse if grouping in the InMemoryRowModel\n // if pivoting, we only have expandable groups if grouping by 2 or more columns\n // as the lowest level group is not expandable while pivoting.\n // if not pivoting, then any active row group can be expanded.\n var allowExpandAndContract = isInMemoryRowModel && (usingTreeData || rowGroupCount > (pivotModeOn ? 1 : 0));\n if (allowExpandAndContract) {\n result.push('expandAll');\n result.push('contractAll');\n }\n return result;\n };\n EnterpriseMenu.prototype.createMainPanel = function () {\n this.mainMenuList = this.createManagedBean(new AgMenuList());\n var menuItems = this.getMenuItems();\n var menuItemsMapped = this.menuItemMapper.mapWithStockItems(menuItems, this.column);\n this.mainMenuList.addMenuItems(menuItemsMapped);\n this.mainMenuList.addEventListener(AgMenuItemComponent.EVENT_MENU_ITEM_SELECTED, this.onHidePopup.bind(this));\n this.tabItemGeneral = {\n title: _.createIconNoSpan('menu', this.gridOptionsService, this.column),\n titleLabel: EnterpriseMenu.TAB_GENERAL.replace('MenuTab', ''),\n bodyPromise: AgPromise.resolve(this.mainMenuList.getGui()),\n name: EnterpriseMenu.TAB_GENERAL\n };\n return this.tabItemGeneral;\n };\n EnterpriseMenu.prototype.onHidePopup = function (event) {\n var keyboardEvent;\n if (event && event.event && event.event instanceof KeyboardEvent) {\n keyboardEvent = event.event;\n }\n this.hidePopupFunc(keyboardEvent && { keyboardEvent: keyboardEvent });\n // this method only gets called when the menu was closed by selection an option\n // in this case we highlight the cell that was previously highlighted\n var focusedCell = this.focusService.getFocusedCell();\n var eDocument = this.gridOptionsService.getDocument();\n if (eDocument.activeElement === eDocument.body && focusedCell) {\n var rowIndex = focusedCell.rowIndex, rowPinned = focusedCell.rowPinned, column = focusedCell.column;\n this.focusService.setFocusedCell({ rowIndex: rowIndex, column: column, rowPinned: rowPinned, forceBrowserFocus: true, preventScrollOnBrowserFocus: true });\n }\n };\n EnterpriseMenu.prototype.createFilterPanel = function () {\n var filterWrapper = this.filterManager.getOrCreateFilterWrapper(this.column, 'COLUMN_MENU');\n if (!filterWrapper) {\n throw new Error('AG Grid - Unable to instantiate filter');\n }\n var afterFilterAttachedCallback = function (params) {\n if (!(filterWrapper === null || filterWrapper === void 0 ? void 0 : filterWrapper.filterPromise)) {\n return;\n }\n // slightly odd block this - this promise will always have been resolved by the time it gets here, so won't be\n // async (_unless_ in react or similar, but if so why not encountered before now?).\n // I'd suggest a future improvement would be to remove/replace this promise as this block just wont work if it is\n // async and is confusing if you don't have this context\n filterWrapper.filterPromise.then(function (filter) {\n if (filter && filter.afterGuiAttached) {\n filter.afterGuiAttached(params);\n }\n });\n };\n // see comment above\n var afterDetachedCallback = function () { var _a; return (_a = filterWrapper === null || filterWrapper === void 0 ? void 0 : filterWrapper.filterPromise) === null || _a === void 0 ? void 0 : _a.then(function (filter) { var _a; return (_a = filter === null || filter === void 0 ? void 0 : filter.afterGuiDetached) === null || _a === void 0 ? void 0 : _a.call(filter); }); };\n this.tabItemFilter = {\n title: _.createIconNoSpan('filter', this.gridOptionsService, this.column),\n titleLabel: EnterpriseMenu.TAB_FILTER.replace('MenuTab', ''),\n bodyPromise: filterWrapper === null || filterWrapper === void 0 ? void 0 : filterWrapper.guiPromise,\n afterAttachedCallback: afterFilterAttachedCallback,\n afterDetachedCallback: afterDetachedCallback,\n name: EnterpriseMenu.TAB_FILTER\n };\n return this.tabItemFilter;\n };\n EnterpriseMenu.prototype.createColumnsPanel = function () {\n var eWrapperDiv = document.createElement('div');\n eWrapperDiv.classList.add('ag-menu-column-select-wrapper');\n var columnSelectPanel = this.createManagedBean(new PrimaryColsPanel());\n var columnsMenuParams = this.column.getColDef().columnsMenuParams;\n if (!columnsMenuParams) {\n columnsMenuParams = {};\n }\n var contractColumnSelection = columnsMenuParams.contractColumnSelection, suppressColumnExpandAll = columnsMenuParams.suppressColumnExpandAll, suppressColumnFilter = columnsMenuParams.suppressColumnFilter, suppressColumnSelectAll = columnsMenuParams.suppressColumnSelectAll, suppressSyncLayoutWithGrid = columnsMenuParams.suppressSyncLayoutWithGrid, columnLayout = columnsMenuParams.columnLayout;\n columnSelectPanel.init(false, {\n suppressColumnMove: false,\n suppressValues: false,\n suppressPivots: false,\n suppressRowGroups: false,\n suppressPivotMode: false,\n contractColumnSelection: !!contractColumnSelection,\n suppressColumnExpandAll: !!suppressColumnExpandAll,\n suppressColumnFilter: !!suppressColumnFilter,\n suppressColumnSelectAll: !!suppressColumnSelectAll,\n suppressSyncLayoutWithGrid: !!columnLayout || !!suppressSyncLayoutWithGrid,\n api: this.gridApi,\n columnApi: this.columnApi,\n context: this.gridOptionsService.context\n }, 'columnMenu');\n if (columnLayout) {\n columnSelectPanel.setColumnLayout(columnLayout);\n }\n var columnSelectPanelGui = columnSelectPanel.getGui();\n columnSelectPanelGui.classList.add('ag-menu-column-select');\n eWrapperDiv.appendChild(columnSelectPanelGui);\n this.tabItemColumns = {\n title: _.createIconNoSpan('columns', this.gridOptionsService, this.column),\n titleLabel: EnterpriseMenu.TAB_COLUMNS.replace('MenuTab', ''),\n bodyPromise: AgPromise.resolve(eWrapperDiv),\n name: EnterpriseMenu.TAB_COLUMNS\n };\n return this.tabItemColumns;\n };\n EnterpriseMenu.prototype.afterGuiAttached = function (params) {\n var container = params.container, hidePopup = params.hidePopup;\n this.tabbedLayout.setAfterAttachedParams({ container: container, hidePopup: hidePopup });\n if (hidePopup) {\n this.hidePopupFunc = hidePopup;\n this.addDestroyFunc(hidePopup);\n }\n };\n EnterpriseMenu.prototype.getGui = function () {\n return this.tabbedLayout.getGui();\n };\n EnterpriseMenu.EVENT_TAB_SELECTED = 'tabSelected';\n EnterpriseMenu.TAB_FILTER = 'filterMenuTab';\n EnterpriseMenu.TAB_GENERAL = 'generalMenuTab';\n EnterpriseMenu.TAB_COLUMNS = 'columnsMenuTab';\n EnterpriseMenu.TABS_DEFAULT = [EnterpriseMenu.TAB_GENERAL, EnterpriseMenu.TAB_FILTER, EnterpriseMenu.TAB_COLUMNS];\n EnterpriseMenu.MENU_ITEM_SEPARATOR = 'separator';\n __decorate$C([\n Autowired('columnModel')\n ], EnterpriseMenu.prototype, \"columnModel\", void 0);\n __decorate$C([\n Autowired('filterManager')\n ], EnterpriseMenu.prototype, \"filterManager\", void 0);\n __decorate$C([\n Autowired('gridApi')\n ], EnterpriseMenu.prototype, \"gridApi\", void 0);\n __decorate$C([\n Autowired('columnApi')\n ], EnterpriseMenu.prototype, \"columnApi\", void 0);\n __decorate$C([\n Autowired('menuItemMapper')\n ], EnterpriseMenu.prototype, \"menuItemMapper\", void 0);\n __decorate$C([\n Autowired('rowModel')\n ], EnterpriseMenu.prototype, \"rowModel\", void 0);\n __decorate$C([\n Autowired('focusService')\n ], EnterpriseMenu.prototype, \"focusService\", void 0);\n __decorate$C([\n PostConstruct\n ], EnterpriseMenu.prototype, \"init\", null);\n return EnterpriseMenu;\n}(BeanStub));\n\nvar __extends$D = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign$6 = (undefined && undefined.__assign) || function () {\n __assign$6 = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$6.apply(this, arguments);\n};\nvar __decorate$B = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar CSS_MENU = 'ag-menu';\nvar CSS_CONTEXT_MENU_OPEN = 'ag-context-menu-open';\nvar ContextMenuFactory = /** @class */ (function (_super) {\n __extends$D(ContextMenuFactory, _super);\n function ContextMenuFactory() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n ContextMenuFactory.prototype.hideActiveMenu = function () {\n this.destroyBean(this.activeMenu);\n };\n ContextMenuFactory.prototype.getMenuItems = function (node, column, value) {\n var defaultMenuOptions = [];\n if (_.exists(node) && ModuleRegistry.__isRegistered(ModuleNames.ClipboardModule, this.context.getGridId())) {\n if (column) {\n // only makes sense if column exists, could have originated from a row\n if (!this.gridOptionsService.is('suppressCutToClipboard')) {\n defaultMenuOptions.push('cut');\n }\n defaultMenuOptions.push('copy', 'copyWithHeaders', 'copyWithGroupHeaders', 'paste', 'separator');\n }\n }\n if (this.gridOptionsService.is('enableCharts') && ModuleRegistry.__isRegistered(ModuleNames.GridChartsModule, this.context.getGridId())) {\n if (this.columnModel.isPivotMode()) {\n defaultMenuOptions.push('pivotChart');\n }\n if (this.rangeService && !this.rangeService.isEmpty()) {\n defaultMenuOptions.push('chartRange');\n }\n }\n if (_.exists(node)) {\n // if user clicks a cell\n var csvModuleMissing = !ModuleRegistry.__isRegistered(ModuleNames.CsvExportModule, this.context.getGridId());\n var excelModuleMissing = !ModuleRegistry.__isRegistered(ModuleNames.ExcelExportModule, this.context.getGridId());\n var suppressExcel = this.gridOptionsService.is('suppressExcelExport') || excelModuleMissing;\n var suppressCsv = this.gridOptionsService.is('suppressCsvExport') || csvModuleMissing;\n var onIPad = _.isIOSUserAgent();\n var anyExport = !onIPad && (!suppressExcel || !suppressCsv);\n if (anyExport) {\n defaultMenuOptions.push('export');\n }\n }\n var userFunc = this.gridOptionsService.getCallback('getContextMenuItems');\n if (userFunc) {\n var params = {\n node: node,\n column: column,\n value: value,\n defaultItems: defaultMenuOptions.length ? defaultMenuOptions : undefined,\n };\n return userFunc(params);\n }\n return defaultMenuOptions;\n };\n ContextMenuFactory.prototype.onContextMenu = function (mouseEvent, touchEvent, rowNode, column, value, anchorToElement) {\n // to allow us to debug in chrome, we ignore the event if ctrl is pressed.\n // not everyone wants this, so first 'if' below allows to turn this hack off.\n if (!this.gridOptionsService.is('allowContextMenuWithControlKey')) {\n // then do the check\n if (mouseEvent && (mouseEvent.ctrlKey || mouseEvent.metaKey)) {\n return;\n }\n }\n // need to do this regardless of context menu showing or not, so doing\n // before the isSuppressContextMenu() check\n if (mouseEvent) {\n this.blockMiddleClickScrollsIfNeeded(mouseEvent);\n }\n if (this.gridOptionsService.is('suppressContextMenu')) {\n return;\n }\n var eventOrTouch = mouseEvent ? mouseEvent : touchEvent.touches[0];\n if (this.showMenu(rowNode, column, value, eventOrTouch, anchorToElement)) {\n var event_1 = mouseEvent ? mouseEvent : touchEvent;\n event_1.preventDefault();\n }\n };\n ContextMenuFactory.prototype.blockMiddleClickScrollsIfNeeded = function (mouseEvent) {\n // if we don't do this, then middle click will never result in a 'click' event, as 'mousedown'\n // will be consumed by the browser to mean 'scroll' (as you can scroll with the middle mouse\n // button in the browser). so this property allows the user to receive middle button clicks if\n // they want.\n var gridOptionsService = this.gridOptionsService;\n var which = mouseEvent.which;\n if (gridOptionsService.is('suppressMiddleClickScrolls') && which === 2) {\n mouseEvent.preventDefault();\n }\n };\n ContextMenuFactory.prototype.showMenu = function (node, column, value, mouseEvent, anchorToElement) {\n var _this = this;\n var menuItems = this.getMenuItems(node, column, value);\n var eGridBodyGui = this.ctrlsService.getGridBodyCtrl().getGui();\n if (menuItems === undefined || _.missingOrEmpty(menuItems)) {\n return false;\n }\n var menu = new ContextMenu(menuItems);\n this.createBean(menu);\n var eMenuGui = menu.getGui();\n var positionParams = {\n column: column,\n rowNode: node,\n type: 'contextMenu',\n mouseEvent: mouseEvent,\n ePopup: eMenuGui,\n // move one pixel away so that accidentally double clicking\n // won't show the browser's contextmenu\n nudgeY: 1\n };\n var translate = this.localeService.getLocaleTextFunc();\n var addPopupRes = this.popupService.addPopup({\n modal: true,\n eChild: eMenuGui,\n closeOnEsc: true,\n closedCallback: function () {\n eGridBodyGui.classList.remove(CSS_CONTEXT_MENU_OPEN);\n _this.destroyBean(menu);\n },\n click: mouseEvent,\n positionCallback: function () {\n var isRtl = _this.gridOptionsService.is('enableRtl');\n _this.popupService.positionPopupUnderMouseEvent(__assign$6(__assign$6({}, positionParams), { nudgeX: isRtl ? (eMenuGui.offsetWidth + 1) * -1 : 1 }));\n },\n // so when browser is scrolled down, or grid is scrolled, context menu stays with cell\n anchorToElement: anchorToElement,\n ariaLabel: translate('ariaLabelContextMenu', 'Context Menu')\n });\n if (addPopupRes) {\n eGridBodyGui.classList.add(CSS_CONTEXT_MENU_OPEN);\n menu.afterGuiAttached({ container: 'contextMenu', hidePopup: addPopupRes.hideFunc });\n }\n // there should never be an active menu at this point, however it was found\n // that you could right click a second time just 1 or 2 pixels from the first\n // click, and another menu would pop up. so somehow the logic for closing the\n // first menu (clicking outside should close it) was glitchy somehow. an easy\n // way to avoid this is just remove the old context menu here if it exists.\n if (this.activeMenu) {\n this.hideActiveMenu();\n }\n this.activeMenu = menu;\n menu.addEventListener(BeanStub.EVENT_DESTROYED, function () {\n if (_this.activeMenu === menu) {\n _this.activeMenu = null;\n }\n });\n // hide the popup if something gets selected\n if (addPopupRes) {\n menu.addEventListener(AgMenuItemComponent.EVENT_MENU_ITEM_SELECTED, addPopupRes.hideFunc);\n }\n return true;\n };\n __decorate$B([\n Autowired('popupService')\n ], ContextMenuFactory.prototype, \"popupService\", void 0);\n __decorate$B([\n Optional('rangeService')\n ], ContextMenuFactory.prototype, \"rangeService\", void 0);\n __decorate$B([\n Autowired('ctrlsService')\n ], ContextMenuFactory.prototype, \"ctrlsService\", void 0);\n __decorate$B([\n Autowired('columnModel')\n ], ContextMenuFactory.prototype, \"columnModel\", void 0);\n ContextMenuFactory = __decorate$B([\n Bean('contextMenuFactory')\n ], ContextMenuFactory);\n return ContextMenuFactory;\n}(BeanStub));\nvar ContextMenu = /** @class */ (function (_super) {\n __extends$D(ContextMenu, _super);\n function ContextMenu(menuItems) {\n var _this = _super.call(this, /* html */ \"
\") || this;\n _this.menuList = null;\n _this.focusedCell = null;\n _this.menuItems = menuItems;\n return _this;\n }\n ContextMenu.prototype.addMenuItems = function () {\n var _this = this;\n var menuList = this.createManagedBean(new AgMenuList());\n var menuItemsMapped = this.menuItemMapper.mapWithStockItems(this.menuItems, null);\n menuList.addMenuItems(menuItemsMapped);\n this.appendChild(menuList);\n this.menuList = menuList;\n menuList.addEventListener(AgMenuItemComponent.EVENT_MENU_ITEM_SELECTED, function (e) { return _this.dispatchEvent(e); });\n };\n ContextMenu.prototype.afterGuiAttached = function (params) {\n if (params.hidePopup) {\n this.addDestroyFunc(params.hidePopup);\n }\n this.focusedCell = this.focusService.getFocusedCell();\n if (this.menuList) {\n this.focusService.focusInto(this.menuList.getGui());\n }\n };\n ContextMenu.prototype.restoreFocusedCell = function () {\n var currentFocusedCell = this.focusService.getFocusedCell();\n if (currentFocusedCell && this.focusedCell && this.cellPositionUtils.equals(currentFocusedCell, this.focusedCell)) {\n var _a = this.focusedCell, rowIndex = _a.rowIndex, rowPinned = _a.rowPinned, column = _a.column;\n var doc = this.gridOptionsService.getDocument();\n if (doc.activeElement === doc.body) {\n this.focusService.setFocusedCell({ rowIndex: rowIndex, column: column, rowPinned: rowPinned, forceBrowserFocus: true });\n }\n }\n };\n ContextMenu.prototype.destroy = function () {\n this.restoreFocusedCell();\n _super.prototype.destroy.call(this);\n };\n __decorate$B([\n Autowired('menuItemMapper')\n ], ContextMenu.prototype, \"menuItemMapper\", void 0);\n __decorate$B([\n Autowired('focusService')\n ], ContextMenu.prototype, \"focusService\", void 0);\n __decorate$B([\n Autowired('cellPositionUtils')\n ], ContextMenu.prototype, \"cellPositionUtils\", void 0);\n __decorate$B([\n PostConstruct\n ], ContextMenu.prototype, \"addMenuItems\", null);\n return ContextMenu;\n}(Component));\n\nvar __extends$C = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign$5 = (undefined && undefined.__assign) || function () {\n __assign$5 = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$5.apply(this, arguments);\n};\nvar __decorate$A = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar MenuItemMapper = /** @class */ (function (_super) {\n __extends$C(MenuItemMapper, _super);\n function MenuItemMapper() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n MenuItemMapper.prototype.mapWithStockItems = function (originalList, column) {\n var _this = this;\n if (!originalList) {\n return [];\n }\n var resultList = [];\n originalList.forEach(function (menuItemOrString) {\n var result;\n if (typeof menuItemOrString === 'string') {\n result = _this.getStockMenuItem(menuItemOrString, column);\n }\n else {\n // Spread to prevent leaking mapped subMenus back into the original menuItem\n result = __assign$5({}, menuItemOrString);\n }\n // if no mapping, can happen when module is not loaded but user tries to use module anyway\n if (!result) {\n return;\n }\n var resultDef = result;\n var subMenu = resultDef.subMenu;\n if (subMenu && subMenu instanceof Array) {\n resultDef.subMenu = _this.mapWithStockItems(subMenu, column);\n }\n if (result != null) {\n resultList.push(result);\n }\n });\n return resultList;\n };\n MenuItemMapper.prototype.getStockMenuItem = function (key, column) {\n var _this = this;\n var _a;\n var localeTextFunc = this.localeService.getLocaleTextFunc();\n var skipHeaderOnAutoSize = this.gridOptionsService.is('skipHeaderOnAutoSize');\n switch (key) {\n case 'pinSubMenu':\n return {\n name: localeTextFunc('pinColumn', 'Pin Column'),\n icon: _.createIconNoSpan('menuPin', this.gridOptionsService, null),\n subMenu: ['clearPinned', 'pinLeft', 'pinRight']\n };\n case 'pinLeft':\n return {\n name: localeTextFunc('pinLeft', 'Pin Left'),\n action: function () { return _this.columnModel.setColumnPinned(column, 'left', \"contextMenu\"); },\n checked: !!column && column.isPinnedLeft()\n };\n case 'pinRight':\n return {\n name: localeTextFunc('pinRight', 'Pin Right'),\n action: function () { return _this.columnModel.setColumnPinned(column, 'right', \"contextMenu\"); },\n checked: !!column && column.isPinnedRight()\n };\n case 'clearPinned':\n return {\n name: localeTextFunc('noPin', 'No Pin'),\n action: function () { return _this.columnModel.setColumnPinned(column, null, \"contextMenu\"); },\n checked: !!column && !column.isPinned()\n };\n case 'valueAggSubMenu':\n if (ModuleRegistry.__assertRegistered(ModuleNames.RowGroupingModule, 'Aggregation from Menu', this.context.getGridId())) {\n if (!(column === null || column === void 0 ? void 0 : column.isPrimary()) && !(column === null || column === void 0 ? void 0 : column.getColDef().pivotValueColumn)) {\n return null;\n }\n return {\n name: localeTextFunc('valueAggregation', 'Value Aggregation'),\n icon: _.createIconNoSpan('menuValue', this.gridOptionsService, null),\n subMenu: this.createAggregationSubMenu(column)\n };\n }\n else {\n return null;\n }\n case 'autoSizeThis':\n return {\n name: localeTextFunc('autosizeThiscolumn', 'Autosize This Column'),\n action: function () { return _this.columnModel.autoSizeColumn(column, skipHeaderOnAutoSize, \"contextMenu\"); }\n };\n case 'autoSizeAll':\n return {\n name: localeTextFunc('autosizeAllColumns', 'Autosize All Columns'),\n action: function () { return _this.columnModel.autoSizeAllColumns(skipHeaderOnAutoSize, \"contextMenu\"); }\n };\n case 'rowGroup':\n return {\n name: localeTextFunc('groupBy', 'Group by') + ' ' + _.escapeString(this.columnModel.getDisplayNameForColumn(column, 'header')),\n disabled: (column === null || column === void 0 ? void 0 : column.isRowGroupActive()) || !(column === null || column === void 0 ? void 0 : column.getColDef().enableRowGroup),\n action: function () { return _this.columnModel.addRowGroupColumn(column, \"contextMenu\"); },\n icon: _.createIconNoSpan('menuAddRowGroup', this.gridOptionsService, null)\n };\n case 'rowUnGroup':\n return {\n name: localeTextFunc('ungroupBy', 'Un-Group by') + ' ' + _.escapeString(this.columnModel.getDisplayNameForColumn(column, 'header')),\n disabled: !(column === null || column === void 0 ? void 0 : column.isRowGroupActive()) || !(column === null || column === void 0 ? void 0 : column.getColDef().enableRowGroup),\n action: function () { return _this.columnModel.removeRowGroupColumn(column, \"contextMenu\"); },\n icon: _.createIconNoSpan('menuRemoveRowGroup', this.gridOptionsService, null)\n };\n case 'resetColumns':\n return {\n name: localeTextFunc('resetColumns', 'Reset Columns'),\n action: function () { return _this.columnModel.resetColumnState(\"contextMenu\"); }\n };\n case 'expandAll':\n return {\n name: localeTextFunc('expandAll', 'Expand All Row Groups'),\n action: function () { return _this.gridApi.expandAll(); }\n };\n case 'contractAll':\n return {\n name: localeTextFunc('collapseAll', 'Collapse All Row Groups'),\n action: function () { return _this.gridApi.collapseAll(); }\n };\n case 'copy':\n if (ModuleRegistry.__assertRegistered(ModuleNames.ClipboardModule, 'Copy from Menu', this.context.getGridId())) {\n return {\n name: localeTextFunc('copy', 'Copy'),\n shortcut: localeTextFunc('ctrlC', 'Ctrl+C'),\n icon: _.createIconNoSpan('clipboardCopy', this.gridOptionsService, null),\n action: function () { return _this.clipboardService.copyToClipboard(); }\n };\n }\n else {\n return null;\n }\n case 'copyWithHeaders':\n if (ModuleRegistry.__assertRegistered(ModuleNames.ClipboardModule, 'Copy with Headers from Menu', this.context.getGridId())) {\n return {\n name: localeTextFunc('copyWithHeaders', 'Copy with Headers'),\n // shortcut: localeTextFunc('ctrlC','Ctrl+C'),\n icon: _.createIconNoSpan('clipboardCopy', this.gridOptionsService, null),\n action: function () { return _this.clipboardService.copyToClipboard({ includeHeaders: true }); }\n };\n }\n else {\n return null;\n }\n case 'copyWithGroupHeaders':\n if (ModuleRegistry.__assertRegistered(ModuleNames.ClipboardModule, 'Copy with Group Headers from Menu', this.context.getGridId())) {\n return {\n name: localeTextFunc('copyWithGroupHeaders', 'Copy with Group Headers'),\n // shortcut: localeTextFunc('ctrlC','Ctrl+C'),\n icon: _.createIconNoSpan('clipboardCopy', this.gridOptionsService, null),\n action: function () { return _this.clipboardService.copyToClipboard({ includeHeaders: true, includeGroupHeaders: true }); }\n };\n }\n else {\n return null;\n }\n case 'cut':\n if (ModuleRegistry.__assertRegistered(ModuleNames.ClipboardModule, 'Cut from Menu', this.context.getGridId())) {\n var focusedCell = this.focusService.getFocusedCell();\n var rowNode = focusedCell ? this.rowPositionUtils.getRowNode(focusedCell) : null;\n var isEditable = rowNode ? focusedCell === null || focusedCell === void 0 ? void 0 : focusedCell.column.isCellEditable(rowNode) : false;\n return {\n name: localeTextFunc('cut', 'Cut'),\n shortcut: localeTextFunc('ctrlX', 'Ctrl+X'),\n icon: _.createIconNoSpan('clipboardCut', this.gridOptionsService, null),\n disabled: !isEditable || this.gridOptionsService.is('suppressCutToClipboard'),\n action: function () { return _this.clipboardService.cutToClipboard(undefined, 'contextMenu'); }\n };\n }\n else {\n return null;\n }\n case 'paste':\n if (ModuleRegistry.__assertRegistered(ModuleNames.ClipboardModule, 'Paste from Clipboard', this.context.getGridId())) {\n return {\n name: localeTextFunc('paste', 'Paste'),\n shortcut: localeTextFunc('ctrlV', 'Ctrl+V'),\n disabled: true,\n icon: _.createIconNoSpan('clipboardPaste', this.gridOptionsService, null),\n action: function () { return _this.clipboardService.pasteFromClipboard(); }\n };\n }\n else {\n return null;\n }\n case 'export':\n var exportSubMenuItems = [];\n var csvModuleLoaded = ModuleRegistry.__isRegistered(ModuleNames.CsvExportModule, this.context.getGridId());\n var excelModuleLoaded = ModuleRegistry.__isRegistered(ModuleNames.ExcelExportModule, this.context.getGridId());\n if (!this.gridOptionsService.is('suppressCsvExport') && csvModuleLoaded) {\n exportSubMenuItems.push('csvExport');\n }\n if (!this.gridOptionsService.is('suppressExcelExport') && excelModuleLoaded) {\n exportSubMenuItems.push('excelExport');\n }\n return {\n name: localeTextFunc('export', 'Export'),\n subMenu: exportSubMenuItems,\n icon: _.createIconNoSpan('save', this.gridOptionsService, null),\n };\n case 'csvExport':\n return {\n name: localeTextFunc('csvExport', 'CSV Export'),\n icon: _.createIconNoSpan('csvExport', this.gridOptionsService, null),\n action: function () { return _this.gridApi.exportDataAsCsv({}); }\n };\n case 'excelExport':\n return {\n name: localeTextFunc('excelExport', 'Excel Export'),\n icon: _.createIconNoSpan('excelExport', this.gridOptionsService, null),\n action: function () { return _this.gridApi.exportDataAsExcel(); }\n };\n case 'separator':\n return 'separator';\n case 'pivotChart':\n case 'chartRange':\n return (_a = this.chartMenuItemMapper.getChartItems(key)) !== null && _a !== void 0 ? _a : null;\n default: {\n console.warn(\"AG Grid: unknown menu item type \" + key);\n return null;\n }\n }\n };\n MenuItemMapper.prototype.createAggregationSubMenu = function (column) {\n var _this = this;\n var localeTextFunc = this.localeService.getLocaleTextFunc();\n var columnToUse;\n if (column.isPrimary()) {\n columnToUse = column;\n }\n else {\n var pivotValueColumn = column.getColDef().pivotValueColumn;\n columnToUse = _.exists(pivotValueColumn) ? pivotValueColumn : undefined;\n }\n var result = [];\n if (columnToUse) {\n var columnIsAlreadyAggValue_1 = columnToUse.isValueActive();\n var funcNames = this.aggFuncService.getFuncNames(columnToUse);\n result.push({\n name: localeTextFunc('noAggregation', 'None'),\n action: function () {\n _this.columnModel.removeValueColumn(columnToUse, \"contextMenu\");\n _this.columnModel.setColumnAggFunc(columnToUse, undefined, \"contextMenu\");\n },\n checked: !columnIsAlreadyAggValue_1\n });\n funcNames.forEach(function (funcName) {\n result.push({\n name: localeTextFunc(funcName, _.capitalise(funcName)),\n action: function () {\n _this.columnModel.setColumnAggFunc(columnToUse, funcName, \"contextMenu\");\n _this.columnModel.addValueColumn(columnToUse, \"contextMenu\");\n },\n checked: columnIsAlreadyAggValue_1 && columnToUse.getAggFunc() === funcName\n });\n });\n }\n return result;\n };\n __decorate$A([\n Autowired('columnModel')\n ], MenuItemMapper.prototype, \"columnModel\", void 0);\n __decorate$A([\n Autowired('gridApi')\n ], MenuItemMapper.prototype, \"gridApi\", void 0);\n __decorate$A([\n Optional('clipboardService')\n ], MenuItemMapper.prototype, \"clipboardService\", void 0);\n __decorate$A([\n Optional('aggFuncService')\n ], MenuItemMapper.prototype, \"aggFuncService\", void 0);\n __decorate$A([\n Autowired('focusService')\n ], MenuItemMapper.prototype, \"focusService\", void 0);\n __decorate$A([\n Autowired('rowPositionUtils')\n ], MenuItemMapper.prototype, \"rowPositionUtils\", void 0);\n __decorate$A([\n Autowired('chartMenuItemMapper')\n ], MenuItemMapper.prototype, \"chartMenuItemMapper\", void 0);\n MenuItemMapper = __decorate$A([\n Bean('menuItemMapper')\n ], MenuItemMapper);\n return MenuItemMapper;\n}(BeanStub));\n\n// DO NOT UPDATE MANUALLY: Generated from script during build time\nvar VERSION$7 = '30.0.6';\n\nvar __extends$B = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign$4 = (undefined && undefined.__assign) || function () {\n __assign$4 = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$4.apply(this, arguments);\n};\nvar __decorate$z = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __read$8 = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar ChartMenuItemMapper = /** @class */ (function (_super) {\n __extends$B(ChartMenuItemMapper, _super);\n function ChartMenuItemMapper() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n ChartMenuItemMapper_1 = ChartMenuItemMapper;\n ChartMenuItemMapper.prototype.getChartItems = function (key) {\n var _a, _b;\n if (!this.chartService) {\n ModuleRegistry.__assertRegistered(ModuleNames.GridChartsModule, \"the Context Menu key \\\"\" + key + \"\\\"\", this.context.getGridId());\n return undefined;\n }\n var builder = key === 'pivotChart'\n ? new PivotMenuItemMapper(this.gridOptionsService, this.chartService, this.localeService)\n : new RangeMenuItemMapper(this.gridOptionsService, this.chartService, this.localeService);\n var topLevelMenuItem = builder.getMenuItem();\n var chartGroupsDef = (_b = (_a = this.gridOptionsService.get('chartToolPanelsDef')) === null || _a === void 0 ? void 0 : _a.settingsPanel) === null || _b === void 0 ? void 0 : _b.chartGroupsDef;\n if (chartGroupsDef) {\n // Apply filtering and ordering if chartGroupsDef provided\n topLevelMenuItem = ChartMenuItemMapper_1.filterAndOrderChartMenu(topLevelMenuItem, chartGroupsDef, builder.getConfigLookup());\n }\n return this.cleanInternals(topLevelMenuItem);\n };\n // Remove our internal _key properties so this does not leak out of the class on the menu items.\n ChartMenuItemMapper.prototype.cleanInternals = function (menuItem) {\n if (!menuItem) {\n return menuItem;\n }\n var removeKey = function (m) {\n var _a;\n m === null || m === void 0 ? true : delete m._key;\n (_a = m === null || m === void 0 ? void 0 : m.subMenu) === null || _a === void 0 ? void 0 : _a.forEach(function (s) { return removeKey(s); });\n return m;\n };\n return removeKey(menuItem);\n };\n ChartMenuItemMapper.buildLookup = function (menuItem) {\n var itemLookup = {};\n var addItem = function (item) {\n itemLookup[item._key] = item;\n if (item.subMenu) {\n item.subMenu.forEach(function (s) { return addItem(s); });\n }\n };\n addItem(menuItem);\n return itemLookup;\n };\n /**\n * Make the MenuItem match the charts provided and their ordering on the ChartGroupsDef config object as provided by the user.\n */\n ChartMenuItemMapper.filterAndOrderChartMenu = function (topLevelMenuItem, chartGroupsDef, configLookup) {\n var _a;\n var menuItemLookup = this.buildLookup(topLevelMenuItem);\n var orderedAndFiltered = __assign$4(__assign$4({}, topLevelMenuItem), { subMenu: [] });\n Object.entries(chartGroupsDef).forEach(function (_a) {\n var _b, _c;\n var _d = __read$8(_a, 2), group = _d[0], chartTypes = _d[1];\n var chartConfigGroup = configLookup[group];\n if (chartConfigGroup == undefined) {\n _.doOnce(function () { return console.warn(\"AG Grid - invalid chartGroupsDef config '\" + group + \"'\"); }, \"invalid_chartGroupsDef\" + group);\n return undefined;\n }\n var menuItem = menuItemLookup[chartConfigGroup._key];\n if (menuItem) {\n if (menuItem.subMenu) {\n var subMenus = chartTypes.map(function (chartType) {\n var itemKey = chartConfigGroup[chartType];\n if (itemKey == undefined) {\n _.doOnce(function () { return console.warn(\"AG Grid - invalid chartGroupsDef config '\" + group + \".\" + chartType + \"'\"); }, \"invalid_chartGroupsDef\" + chartType + \"_\" + group);\n return undefined;\n }\n return menuItemLookup[itemKey];\n }).filter(function (s) { return s !== undefined; });\n if (subMenus.length > 0) {\n menuItem.subMenu = subMenus;\n (_b = orderedAndFiltered.subMenu) === null || _b === void 0 ? void 0 : _b.push(menuItem);\n }\n }\n else {\n // Handles line case which is not actually a sub subMenu\n (_c = orderedAndFiltered.subMenu) === null || _c === void 0 ? void 0 : _c.push(menuItem);\n }\n }\n });\n if (((_a = orderedAndFiltered.subMenu) === null || _a === void 0 ? void 0 : _a.length) == 0) {\n return undefined;\n }\n return orderedAndFiltered;\n };\n var ChartMenuItemMapper_1;\n __decorate$z([\n Optional('chartService')\n ], ChartMenuItemMapper.prototype, \"chartService\", void 0);\n ChartMenuItemMapper = ChartMenuItemMapper_1 = __decorate$z([\n Bean('chartMenuItemMapper')\n ], ChartMenuItemMapper);\n return ChartMenuItemMapper;\n}(BeanStub));\nvar PivotMenuItemMapper = /** @class */ (function () {\n function PivotMenuItemMapper(gridOptionsService, chartService, localeService) {\n this.gridOptionsService = gridOptionsService;\n this.chartService = chartService;\n this.localeService = localeService;\n }\n PivotMenuItemMapper.prototype.getMenuItem = function () {\n var _this = this;\n var localeTextFunc = this.localeService.getLocaleTextFunc();\n var getMenuItem = function (localeKey, defaultText, chartType, key) {\n return {\n name: localeTextFunc(localeKey, defaultText),\n action: function () { return _this.chartService.createPivotChart({ chartType: chartType }); },\n _key: key\n };\n };\n return {\n name: localeTextFunc('pivotChart', 'Pivot Chart'),\n _key: 'pivotChart',\n subMenu: [\n {\n _key: 'pivotColumnChart',\n name: localeTextFunc('columnChart', 'Column'),\n subMenu: [\n getMenuItem('groupedColumn', 'Grouped‎', 'groupedColumn', 'pivotGroupedColumn'),\n getMenuItem('stackedColumn', 'Stacked‎', 'stackedColumn', 'pivotStackedColumn'),\n getMenuItem('normalizedColumn', '100% Stacked‎', 'normalizedColumn', 'pivotNormalizedColumn')\n ]\n },\n {\n _key: 'pivotBarChart',\n name: localeTextFunc('barChart', 'Bar'),\n subMenu: [\n getMenuItem('groupedBar', 'Grouped‎', 'groupedBar', 'pivotGroupedBar'),\n getMenuItem('stackedBar', 'Stacked‎', 'stackedBar', 'pivotStackedBar'),\n getMenuItem('normalizedBar', '100% Stacked‎', 'normalizedBar', 'pivotNormalizedBar')\n ]\n },\n {\n _key: 'pivotPieChart',\n name: localeTextFunc('pieChart', 'Pie'),\n subMenu: [\n getMenuItem('pie', 'Pie‎', 'pie', 'pivotPie'),\n getMenuItem('doughnut', 'Doughnut‎', 'doughnut', 'pivotDoughnut')\n ]\n },\n getMenuItem('line', 'Line‎', 'line', 'pivotLineChart'),\n {\n _key: 'pivotXYChart',\n name: localeTextFunc('xyChart', 'X Y (Scatter)'),\n subMenu: [\n getMenuItem('scatter', 'Scatter‎', 'scatter', 'pivotScatter'),\n getMenuItem('bubble', 'Bubble‎', 'bubble', 'pivotBubble')\n ]\n },\n {\n _key: 'pivotAreaChart',\n name: localeTextFunc('areaChart', 'Area'),\n subMenu: [\n getMenuItem('area', 'Area‎', 'area', 'pivotArea'),\n getMenuItem('stackedArea', 'Stacked‎', 'stackedArea', 'pivotStackedArea'),\n getMenuItem('normalizedArea', '100% Stacked‎', 'normalizedArea', 'pivotNormalizedArea')\n ]\n },\n getMenuItem('histogramChart', 'Histogram‎', 'histogram', 'pivotHistogramChart'),\n {\n _key: 'pivotCombinationChart',\n name: localeTextFunc('combinationChart', 'Combination'),\n subMenu: [\n getMenuItem('columnLineCombo', 'Column & Line‎', 'columnLineCombo', 'pivotColumnLineCombo'),\n getMenuItem('AreaColumnCombo', 'Area & Column‎', 'areaColumnCombo', 'pivotAreaColumnCombo')\n ]\n }\n ],\n icon: _.createIconNoSpan('chart', this.gridOptionsService, undefined),\n };\n };\n PivotMenuItemMapper.prototype.getConfigLookup = function () {\n return {\n columnGroup: {\n _key: 'pivotColumnChart',\n column: 'pivotGroupedColumn',\n stackedColumn: 'pivotStackedColumn',\n normalizedColumn: 'pivotNormalizedColumn',\n },\n barGroup: {\n _key: 'pivotBarChart',\n bar: 'pivotGroupedBar',\n stackedBar: 'pivotStackedBar',\n normalizedBar: 'pivotNormalizedBar',\n },\n pieGroup: {\n _key: 'pivotPieChart',\n pie: 'pivotPie',\n doughnut: 'pivotDoughnut',\n },\n lineGroup: {\n _key: 'pivotLineChart',\n line: 'pivotLineChart',\n },\n scatterGroup: {\n _key: 'pivotXYChart',\n bubble: 'pivotBubble',\n scatter: 'pivotScatter',\n },\n areaGroup: {\n _key: 'pivotAreaChart',\n area: 'pivotArea',\n stackedArea: 'pivotStackedArea',\n normalizedArea: 'pivotNormalizedArea',\n },\n histogramGroup: {\n _key: 'pivotHistogramChart',\n histogram: 'pivotHistogramChart',\n },\n combinationGroup: {\n _key: 'pivotCombinationChart',\n columnLineCombo: 'pivotColumnLineCombo',\n areaColumnCombo: 'pivotAreaColumnCombo',\n customCombo: '' // Not currently supported but needs a value to separate from a missing value\n }\n };\n };\n return PivotMenuItemMapper;\n}());\nvar RangeMenuItemMapper = /** @class */ (function () {\n function RangeMenuItemMapper(gridOptionsService, chartService, localeService) {\n this.gridOptionsService = gridOptionsService;\n this.chartService = chartService;\n this.localeService = localeService;\n }\n RangeMenuItemMapper.prototype.getMenuItem = function () {\n var _this = this;\n var localeTextFunc = this.localeService.getLocaleTextFunc();\n var getMenuItem = function (localeKey, defaultText, chartType, key) {\n return {\n name: localeTextFunc(localeKey, defaultText),\n action: function () { return _this.chartService.createChartFromCurrentRange(chartType); },\n _key: key\n };\n };\n return {\n name: localeTextFunc('chartRange', 'Chart Range'),\n _key: 'chartRange',\n subMenu: [\n {\n name: localeTextFunc('columnChart', 'Column'),\n subMenu: [\n getMenuItem('groupedColumn', 'Grouped‎', 'groupedColumn', 'rangeGroupedColumn'),\n getMenuItem('stackedColumn', 'Stacked‎', 'stackedColumn', 'rangeStackedColumn'),\n getMenuItem('normalizedColumn', '100% Stacked‎', 'normalizedColumn', 'rangeNormalizedColumn')\n ],\n _key: 'rangeColumnChart'\n },\n {\n name: localeTextFunc('barChart', 'Bar'),\n subMenu: [\n getMenuItem('groupedBar', 'Grouped‎', 'groupedBar', 'rangeGroupedBar'),\n getMenuItem('stackedBar', 'Stacked‎', 'stackedBar', 'rangeStackedBar'),\n getMenuItem('normalizedBar', '100% Stacked‎', 'normalizedBar', 'rangeNormalizedBar')\n ],\n _key: 'rangeBarChart'\n },\n {\n name: localeTextFunc('pieChart', 'Pie'),\n subMenu: [\n getMenuItem('pie', 'Pie‎', 'pie', 'rangePie'),\n getMenuItem('doughnut', 'Doughnut‎', 'doughnut', 'rangeDoughnut')\n ],\n _key: 'rangePieChart'\n },\n getMenuItem('line', 'Line‎', 'line', 'rangeLineChart'),\n {\n name: localeTextFunc('xyChart', 'X Y (Scatter)'),\n subMenu: [\n getMenuItem('scatter', 'Scatter‎', 'scatter', 'rangeScatter'),\n getMenuItem('bubble', 'Bubble‎', 'bubble', 'rangeBubble')\n ],\n _key: 'rangeXYChart'\n },\n {\n name: localeTextFunc('areaChart', 'Area'),\n subMenu: [\n getMenuItem('area', 'Area‎', 'area', 'rangeArea'),\n getMenuItem('stackedArea', 'Stacked‎', 'stackedArea', 'rangeStackedArea'),\n getMenuItem('normalizedArea', '100% Stacked‎', 'normalizedArea', 'rangeNormalizedArea')\n ],\n _key: 'rangeAreaChart'\n },\n getMenuItem('histogramChart', 'Histogram‎', 'histogram', 'rangeHistogramChart'),\n {\n name: localeTextFunc('combinationChart', 'Combination'),\n subMenu: [\n getMenuItem('columnLineCombo', 'Column & Line‎', 'columnLineCombo', 'rangeColumnLineCombo'),\n getMenuItem('AreaColumnCombo', 'Area & Column‎', 'areaColumnCombo', 'rangeAreaColumnCombo')\n ],\n _key: 'rangeCombinationChart'\n }\n ],\n icon: _.createIconNoSpan('chart', this.gridOptionsService, undefined),\n };\n };\n RangeMenuItemMapper.prototype.getConfigLookup = function () {\n return {\n columnGroup: {\n _key: 'rangeColumnChart',\n column: 'rangeGroupedColumn',\n stackedColumn: 'rangeStackedColumn',\n normalizedColumn: 'rangeNormalizedColumn',\n },\n barGroup: {\n _key: 'rangeBarChart',\n bar: 'rangeGroupedBar',\n stackedBar: 'rangeStackedBar',\n normalizedBar: 'rangeNormalizedBar',\n },\n pieGroup: {\n _key: 'rangePieChart',\n pie: 'rangePie',\n doughnut: 'rangeDoughnut',\n },\n lineGroup: {\n _key: 'rangeLineChart',\n line: 'rangeLineChart',\n },\n scatterGroup: {\n _key: 'rangeXYChart',\n bubble: 'rangeBubble',\n scatter: 'rangeScatter',\n },\n areaGroup: {\n _key: 'rangeAreaChart',\n area: 'rangeArea',\n stackedArea: 'rangeStackedArea',\n normalizedArea: 'rangeNormalizedArea',\n },\n histogramGroup: {\n _key: 'rangeHistogramChart',\n histogram: 'rangeHistogramChart',\n },\n combinationGroup: {\n _key: 'rangeCombinationChart',\n columnLineCombo: 'rangeColumnLineCombo',\n areaColumnCombo: 'rangeAreaColumnCombo',\n customCombo: '' // Not currently supported but needs a value to separate from a missing value\n }\n };\n };\n return RangeMenuItemMapper;\n}());\n\nvar MenuModule = {\n version: VERSION$7,\n moduleName: ModuleNames.MenuModule,\n beans: [EnterpriseMenuFactory, ContextMenuFactory, MenuItemMapper, ChartMenuItemMapper],\n dependantModules: [\n EnterpriseCoreModule\n ]\n};\n\nvar __extends$A = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign$3 = (undefined && undefined.__assign) || function () {\n __assign$3 = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$3.apply(this, arguments);\n};\nvar __decorate$y = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar MultiFilter = /** @class */ (function (_super) {\n __extends$A(MultiFilter, _super);\n function MultiFilter() {\n var _this = _super.call(this, /* html */ \"
\") || this;\n _this.filterDefs = [];\n _this.filters = [];\n _this.guiDestroyFuncs = [];\n _this.activeFilterIndices = [];\n _this.lastActivatedMenuItem = null;\n _this.afterFiltersReadyFuncs = [];\n return _this;\n }\n MultiFilter.prototype.postConstruct = function () {\n var _this = this;\n this.initialiseTabGuard({\n onFocusIn: function (e) { return _this.onFocusIn(e); }\n });\n };\n MultiFilter.getFilterDefs = function (params) {\n var filters = params.filters;\n return filters && filters.length > 0 ?\n filters :\n [{ filter: 'agTextColumnFilter' }, { filter: 'agSetColumnFilter' }];\n };\n MultiFilter.prototype.init = function (params) {\n var _this = this;\n this.params = params;\n this.filterDefs = MultiFilter.getFilterDefs(params);\n var column = params.column, filterChangedCallback = params.filterChangedCallback;\n this.column = column;\n this.filterChangedCallback = filterChangedCallback;\n var filterPromises = [];\n this.filterDefs.forEach(function (filterDef, index) {\n var filterPromise = _this.createFilter(filterDef, index);\n if (filterPromise != null) {\n filterPromises.push(filterPromise);\n }\n });\n // we have to refresh the GUI here to ensure that Angular components are not rendered in odd places\n return AgPromise\n .all(filterPromises)\n .then(function (filters) {\n _this.filters = filters;\n _this.refreshGui('columnMenu');\n _this.afterFiltersReadyFuncs.forEach(function (f) { return f(); });\n _this.afterFiltersReadyFuncs.length = 0;\n });\n };\n MultiFilter.prototype.refreshGui = function (container) {\n var _this = this;\n if (container === this.lastOpenedInContainer) {\n return;\n }\n this.removeAllChildrenExceptTabGuards();\n this.destroyChildren();\n this.filters.forEach(function (filter, index) {\n if (index > 0) {\n _this.appendChild(_.loadTemplate(/* html */ \"
\"));\n }\n var filterDef = _this.filterDefs[index];\n var filterTitle = _this.getFilterTitle(filter, filterDef);\n var filterGui;\n if (filterDef.display === 'subMenu' && container !== 'toolPanel') {\n // prevent sub-menu being used in tool panel\n var menuItem = _this.insertFilterMenu(filter, filterTitle);\n filterGui = menuItem.getGui();\n }\n else if (filterDef.display === 'subMenu' || filterDef.display === 'accordion') {\n // sub-menus should appear as groups in the tool panel\n var group = _this.insertFilterGroup(filter, filterTitle);\n filterGui = group.getGui();\n }\n else {\n // display inline\n filterGui = filter.getGui();\n }\n _this.appendChild(filterGui);\n });\n this.lastOpenedInContainer = container;\n };\n MultiFilter.prototype.getFilterTitle = function (filter, filterDef) {\n if (filterDef.title != null) {\n return filterDef.title;\n }\n var filterWithoutType = filter;\n return typeof filterWithoutType.getFilterTitle === 'function' ? filterWithoutType.getFilterTitle() : 'Filter';\n };\n MultiFilter.prototype.destroyChildren = function () {\n this.guiDestroyFuncs.forEach(function (func) { return func(); });\n this.guiDestroyFuncs.length = 0;\n };\n MultiFilter.prototype.insertFilterMenu = function (filter, name) {\n var _this = this;\n var menuItem = this.createBean(new AgMenuItemComponent({\n name: name,\n subMenu: filter,\n cssClasses: ['ag-multi-filter-menu-item'],\n isCompact: true,\n isAnotherSubMenuOpen: function () { return false; },\n }));\n menuItem.setParentComponent(this);\n this.guiDestroyFuncs.push(function () { return _this.destroyBean(menuItem); });\n this.addManagedListener(menuItem, AgMenuItemComponent.EVENT_MENU_ITEM_ACTIVATED, function (event) {\n if (_this.lastActivatedMenuItem && _this.lastActivatedMenuItem !== event.menuItem) {\n _this.lastActivatedMenuItem.deactivate();\n }\n _this.lastActivatedMenuItem = event.menuItem;\n });\n menuItem.addGuiEventListener('focusin', function () { return menuItem.activate(); });\n menuItem.addGuiEventListener('focusout', function () {\n if (!menuItem.isSubMenuOpen()) {\n menuItem.deactivate();\n }\n });\n return menuItem;\n };\n MultiFilter.prototype.insertFilterGroup = function (filter, title) {\n var _this = this;\n var group = this.createBean(new AgGroupComponent({\n title: title,\n cssIdentifier: 'multi-filter',\n }));\n this.guiDestroyFuncs.push(function () { return _this.destroyBean(group); });\n group.addItem(filter.getGui());\n group.toggleGroupExpand(false);\n if (filter.afterGuiAttached) {\n group.addManagedListener(group, AgGroupComponent.EVENT_EXPANDED, function () { return filter.afterGuiAttached({\n container: _this.lastOpenedInContainer,\n suppressFocus: true,\n hidePopup: _this.hidePopup\n }); });\n }\n return group;\n };\n MultiFilter.prototype.isFilterActive = function () {\n return this.filters.some(function (filter) { return filter.isFilterActive(); });\n };\n MultiFilter.prototype.getLastActiveFilterIndex = function () {\n return this.activeFilterIndices.length > 0 ? this.activeFilterIndices[this.activeFilterIndices.length - 1] : null;\n };\n MultiFilter.prototype.doesFilterPass = function (params, filterToSkip) {\n var rowPasses = true;\n this.filters.forEach(function (filter) {\n if (!rowPasses || filter === filterToSkip || !filter.isFilterActive()) {\n return;\n }\n rowPasses = filter.doesFilterPass(params);\n });\n return rowPasses;\n };\n MultiFilter.prototype.getFilterType = function () {\n return 'multi';\n };\n MultiFilter.prototype.getModelFromUi = function () {\n var model = {\n filterType: this.getFilterType(),\n filterModels: this.filters.map(function (filter) {\n var providedFilter = filter;\n if (typeof providedFilter.getModelFromUi === 'function') {\n return providedFilter.getModelFromUi();\n }\n return null;\n })\n };\n return model;\n };\n MultiFilter.prototype.getModel = function () {\n if (!this.isFilterActive()) {\n return null;\n }\n var model = {\n filterType: this.getFilterType(),\n filterModels: this.filters.map(function (filter) {\n if (filter.isFilterActive()) {\n return filter.getModel();\n }\n return null;\n })\n };\n return model;\n };\n MultiFilter.prototype.setModel = function (model) {\n var _this = this;\n var setFilterModel = function (filter, filterModel) {\n return new AgPromise(function (resolve) {\n var promise = filter.setModel(filterModel);\n promise ? promise.then(function () { return resolve(); }) : resolve();\n });\n };\n var promises = [];\n if (model == null) {\n promises = this.filters.map(function (filter, index) {\n var res = setFilterModel(filter, null).then(function () {\n _this.updateActiveList(index);\n });\n return res;\n });\n }\n else {\n this.filters.forEach(function (filter, index) {\n var filterModel = model.filterModels.length > index ? model.filterModels[index] : null;\n var res = setFilterModel(filter, filterModel).then(function () {\n _this.updateActiveList(index);\n });\n promises.push(res);\n });\n }\n return AgPromise.all(promises).then(function () { });\n };\n MultiFilter.prototype.applyModel = function (source) {\n if (source === void 0) { source = 'api'; }\n var result = false;\n this.filters.forEach(function (filter) {\n if (filter instanceof ProvidedFilter) {\n result = filter.applyModel(source) || result;\n }\n });\n return result;\n };\n MultiFilter.prototype.getChildFilterInstance = function (index) {\n return this.filters[index];\n };\n MultiFilter.prototype.afterGuiAttached = function (params) {\n if (params) {\n this.hidePopup = params.hidePopup;\n this.refreshGui(params.container);\n }\n else {\n this.hidePopup = undefined;\n }\n var filters = this.params.filters;\n var suppressFocus = filters && filters.some(function (filter) { return filter.display && filter.display !== 'inline'; });\n this.executeFunctionIfExists('afterGuiAttached', __assign$3(__assign$3({}, params || {}), { suppressFocus: suppressFocus }));\n var eDocument = this.gridOptionsService.getDocument();\n var activeEl = eDocument.activeElement;\n // if suppress focus is true, we might run into two scenarios:\n // 1 - we are loading the filter for the first time and the component isn't ready,\n // which means the document will have focus.\n // 2 - The focus will be somewhere inside the component due to auto focus\n // In both cases we need to force the focus somewhere valid but outside the filter.\n if (suppressFocus && (activeEl === eDocument.body || this.getGui().contains(activeEl))) {\n // reset focus to the top of the container, and blur\n this.forceFocusOutOfContainer(true);\n }\n };\n MultiFilter.prototype.afterGuiDetached = function () {\n this.executeFunctionIfExists('afterGuiDetached');\n };\n MultiFilter.prototype.onAnyFilterChanged = function () {\n this.executeFunctionIfExists('onAnyFilterChanged');\n };\n MultiFilter.prototype.onNewRowsLoaded = function () {\n this.executeFunctionIfExists('onNewRowsLoaded');\n };\n MultiFilter.prototype.destroy = function () {\n var _this = this;\n this.filters.forEach(function (filter) {\n filter.setModel(null);\n _this.destroyBean(filter);\n });\n this.filters.length = 0;\n this.destroyChildren();\n this.hidePopup = undefined;\n _super.prototype.destroy.call(this);\n };\n MultiFilter.prototype.executeFunctionIfExists = function (name) {\n var params = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n params[_i - 1] = arguments[_i];\n }\n // The first filter is always the \"dominant\" one. By iterating in reverse order we ensure the first filter\n // always gets the last say\n _.forEachReverse(this.filters, function (filter) {\n var func = filter[name];\n if (typeof func === 'function') {\n func.apply(filter, params);\n }\n });\n };\n MultiFilter.prototype.createFilter = function (filterDef, index) {\n var _this = this;\n var _a = this.params, filterModifiedCallback = _a.filterModifiedCallback, doesRowPassOtherFilter = _a.doesRowPassOtherFilter;\n var filterInstance;\n var filterParams = __assign$3(__assign$3({}, this.filterManager.createFilterParams(this.column, this.column.getColDef())), { filterModifiedCallback: filterModifiedCallback, filterChangedCallback: function (additionalEventAttributes) {\n _this.executeWhenAllFiltersReady(function () { return _this.filterChanged(index, additionalEventAttributes); });\n }, doesRowPassOtherFilter: function (node) {\n return doesRowPassOtherFilter(node) && _this.doesFilterPass({ node: node, data: node.data }, filterInstance);\n } });\n var compDetails = this.userComponentFactory.getFilterDetails(filterDef, filterParams, 'agTextColumnFilter');\n if (!compDetails) {\n return null;\n }\n var filterPromise = compDetails.newAgStackInstance();\n if (filterPromise) {\n filterPromise.then(function (filter) { return filterInstance = filter; });\n }\n return filterPromise;\n };\n MultiFilter.prototype.executeWhenAllFiltersReady = function (action) {\n if (this.filters && this.filters.length > 0) {\n action();\n }\n else {\n this.afterFiltersReadyFuncs.push(action);\n }\n };\n MultiFilter.prototype.updateActiveList = function (index) {\n var changedFilter = this.filters[index];\n _.removeFromArray(this.activeFilterIndices, index);\n if (changedFilter.isFilterActive()) {\n this.activeFilterIndices.push(index);\n }\n };\n MultiFilter.prototype.filterChanged = function (index, additionalEventAttributes) {\n this.updateActiveList(index);\n this.filterChangedCallback(additionalEventAttributes);\n var changedFilter = this.filters[index];\n this.filters.forEach(function (filter) {\n if (filter === changedFilter) {\n return;\n }\n if (typeof filter.onAnyFilterChanged === 'function') {\n filter.onAnyFilterChanged();\n }\n });\n };\n MultiFilter.prototype.onFocusIn = function (e) {\n if (this.lastActivatedMenuItem != null && !this.lastActivatedMenuItem.getGui().contains(e.target)) {\n this.lastActivatedMenuItem.deactivate();\n this.lastActivatedMenuItem = null;\n }\n return true;\n };\n MultiFilter.prototype.getModelAsString = function (model) {\n var _a, _b, _c, _d;\n if (!this.filters || !((_a = model === null || model === void 0 ? void 0 : model.filterModels) === null || _a === void 0 ? void 0 : _a.length)) {\n return '';\n }\n var lastActiveIndex = (_b = this.getLastActiveFilterIndex()) !== null && _b !== void 0 ? _b : 0;\n var activeFilter = this.filters[lastActiveIndex];\n return (_d = (_c = activeFilter.getModelAsString) === null || _c === void 0 ? void 0 : _c.call(activeFilter, model.filterModels[lastActiveIndex])) !== null && _d !== void 0 ? _d : '';\n };\n __decorate$y([\n Autowired('filterManager')\n ], MultiFilter.prototype, \"filterManager\", void 0);\n __decorate$y([\n Autowired('userComponentFactory')\n ], MultiFilter.prototype, \"userComponentFactory\", void 0);\n __decorate$y([\n PostConstruct\n ], MultiFilter.prototype, \"postConstruct\", null);\n return MultiFilter;\n}(TabGuardComp));\n\nvar __extends$z = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign$2 = (undefined && undefined.__assign) || function () {\n __assign$2 = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$2.apply(this, arguments);\n};\nvar __decorate$x = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar MultiFloatingFilterComp = /** @class */ (function (_super) {\n __extends$z(MultiFloatingFilterComp, _super);\n function MultiFloatingFilterComp() {\n var _this = _super.call(this, /* html */ \"
\") || this;\n _this.floatingFilters = [];\n return _this;\n }\n MultiFloatingFilterComp.prototype.init = function (params) {\n var _this = this;\n this.params = params;\n var filterParams = params.filterParams;\n var floatingFilterPromises = [];\n MultiFilter.getFilterDefs(filterParams).forEach(function (filterDef, index) {\n var floatingFilterParams = __assign$2(__assign$2({}, params), { \n // set the parent filter instance for each floating filter to the relevant child filter instance\n parentFilterInstance: function (callback) {\n _this.parentMultiFilterInstance(function (parent) {\n var child = parent.getChildFilterInstance(index);\n if (child == null) {\n return;\n }\n callback(child);\n });\n } });\n _.mergeDeep(floatingFilterParams.filterParams, filterDef.filterParams);\n var floatingFilterPromise = _this.createFloatingFilter(filterDef, floatingFilterParams);\n if (floatingFilterPromise != null) {\n floatingFilterPromises.push(floatingFilterPromise);\n }\n });\n return AgPromise.all(floatingFilterPromises).then(function (floatingFilters) {\n floatingFilters.forEach(function (floatingFilter, index) {\n _this.floatingFilters.push(floatingFilter);\n var gui = floatingFilter.getGui();\n _this.appendChild(gui);\n if (index > 0) {\n _.setDisplayed(gui, false);\n }\n });\n });\n };\n MultiFloatingFilterComp.prototype.onParentModelChanged = function (model, event) {\n var _this = this;\n // We don't want to update the floating filter if the floating filter caused the change,\n // because the UI is already in sync. if we didn't do this, the UI would behave strangely\n // as it would be updating as the user is typing\n if (event && event.afterFloatingFilter) {\n return;\n }\n this.parentMultiFilterInstance(function (parent) {\n if (model == null) {\n _this.floatingFilters.forEach(function (filter, i) {\n filter.onParentModelChanged(null, event);\n _.setDisplayed(filter.getGui(), i === 0);\n });\n }\n else {\n var lastActiveFloatingFilterIndex_1 = parent.getLastActiveFilterIndex();\n _this.floatingFilters.forEach(function (filter, i) {\n var filterModel = model.filterModels.length > i ? model.filterModels[i] : null;\n filter.onParentModelChanged(filterModel, event);\n var shouldShow = lastActiveFloatingFilterIndex_1 == null ? i === 0 : i === lastActiveFloatingFilterIndex_1;\n _.setDisplayed(filter.getGui(), shouldShow);\n });\n }\n });\n };\n MultiFloatingFilterComp.prototype.destroy = function () {\n this.destroyBeans(this.floatingFilters);\n this.floatingFilters.length = 0;\n _super.prototype.destroy.call(this);\n };\n MultiFloatingFilterComp.prototype.createFloatingFilter = function (filterDef, params) {\n var _this = this;\n var _a;\n var defaultComponentName = (_a = this.userComponentFactory.getDefaultFloatingFilterType(filterDef, function () { return _this.filterManager.getDefaultFloatingFilter(_this.params.column); })) !== null && _a !== void 0 ? _a : 'agReadOnlyFloatingFilter';\n var compDetails = this.userComponentFactory.getFloatingFilterCompDetails(filterDef, params, defaultComponentName);\n return compDetails ? compDetails.newAgStackInstance() : null;\n };\n MultiFloatingFilterComp.prototype.parentMultiFilterInstance = function (cb) {\n this.params.parentFilterInstance(function (parent) {\n if (!(parent instanceof MultiFilter)) {\n throw new Error('AG Grid - MultiFloatingFilterComp expects MultiFilter as its parent');\n }\n cb(parent);\n });\n };\n __decorate$x([\n Autowired('userComponentFactory')\n ], MultiFloatingFilterComp.prototype, \"userComponentFactory\", void 0);\n __decorate$x([\n Autowired('filterManager')\n ], MultiFloatingFilterComp.prototype, \"filterManager\", void 0);\n return MultiFloatingFilterComp;\n}(Component));\n\n// DO NOT UPDATE MANUALLY: Generated from script during build time\nvar VERSION$6 = '30.0.6';\n\nvar MultiFilterModule = {\n version: VERSION$6,\n moduleName: ModuleNames.MultiFilterModule,\n beans: [],\n userComponents: [\n { componentName: 'agMultiColumnFilter', componentClass: MultiFilter },\n { componentName: 'agMultiColumnFloatingFilter', componentClass: MultiFloatingFilterComp },\n ],\n dependantModules: [\n EnterpriseCoreModule\n ]\n};\n\n/**\n * cell renderers are used in a few places. they bind to dom slightly differently to other cell renderes as they\n * can return back strings (instead of html elemnt) in the getGui() method. common code placed here to handle that.\n * @param {AgPromise} cellRendererPromise\n * @param {HTMLElement} eTarget\n */\nfunction bindCellRendererToHtmlElement(cellRendererPromise, eTarget) {\n cellRendererPromise.then(function (cellRenderer) {\n var gui = cellRenderer.getGui();\n if (gui != null) {\n if (typeof gui === 'object') {\n eTarget.appendChild(gui);\n }\n else {\n eTarget.innerHTML = gui;\n }\n }\n });\n}\n\nvar __extends$y = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$w = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar RichSelectRow = /** @class */ (function (_super) {\n __extends$y(RichSelectRow, _super);\n function RichSelectRow(params) {\n var _this = _super.call(this, /* html */ \"
\") || this;\n _this.params = params;\n return _this;\n }\n RichSelectRow.prototype.setState = function (value, valueFormatted, selected) {\n var rendererSuccessful = this.populateWithRenderer(value, valueFormatted);\n if (!rendererSuccessful) {\n this.populateWithoutRenderer(value, valueFormatted);\n }\n this.updateSelected(selected);\n };\n RichSelectRow.prototype.updateSelected = function (selected) {\n this.addOrRemoveCssClass('ag-rich-select-row-selected', selected);\n };\n RichSelectRow.prototype.populateWithoutRenderer = function (value, valueFormatted) {\n var valueFormattedExits = valueFormatted !== null && valueFormatted !== undefined;\n var valueToRender = valueFormattedExits ? valueFormatted : value;\n if (_.exists(valueToRender) && valueToRender !== '') {\n // not using innerHTML to prevent injection of HTML\n // https://developer.mozilla.org/en-US/docs/Web/API/Element/innerHTML#Security_considerations\n this.getGui().textContent = valueToRender.toString();\n }\n else {\n // putting in blank, so if missing, at least the user can click on it\n this.getGui().innerHTML = ' ';\n }\n };\n RichSelectRow.prototype.populateWithRenderer = function (value, valueFormatted) {\n var _this = this;\n // bad coder here - we are not populating all values of the cellRendererParams\n var params = {\n value: value,\n valueFormatted: valueFormatted,\n api: this.gridOptionsService.api\n };\n var compDetails = this.userComponentFactory.getCellRendererDetails(this.params, params);\n var cellRendererPromise = compDetails ? compDetails.newAgStackInstance() : undefined;\n if (cellRendererPromise != null) {\n bindCellRendererToHtmlElement(cellRendererPromise, this.getGui());\n }\n else {\n this.getGui().innerText = params.valueFormatted != null ? params.valueFormatted : params.value;\n }\n if (cellRendererPromise) {\n cellRendererPromise.then(function (childComponent) {\n _this.addDestroyFunc(function () {\n _this.getContext().destroyBean(childComponent);\n });\n });\n return true;\n }\n return false;\n };\n __decorate$w([\n Autowired('userComponentFactory')\n ], RichSelectRow.prototype, \"userComponentFactory\", void 0);\n return RichSelectRow;\n}(Component));\n\nvar __extends$x = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$v = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar RichSelectCellEditor = /** @class */ (function (_super) {\n __extends$x(RichSelectCellEditor, _super);\n function RichSelectCellEditor() {\n var _this = _super.call(this, RichSelectCellEditor.TEMPLATE) || this;\n _this.selectionConfirmed = false;\n _this.searchString = '';\n return _this;\n }\n RichSelectCellEditor.prototype.init = function (params) {\n var _a;\n this.params = params;\n this.selectedValue = params.value;\n this.originalSelectedValue = params.value;\n this.focusAfterAttached = params.cellStartedEdit;\n var icon = _.createIconNoSpan('smallDown', this.gridOptionsService);\n icon.classList.add('ag-rich-select-value-icon');\n this.eValue.appendChild(icon);\n this.virtualList = this.createManagedBean(new VirtualList('rich-select'));\n this.virtualList.setComponentCreator(this.createRowComponent.bind(this));\n this.eList.appendChild(this.virtualList.getGui());\n if (_.exists(this.params.cellHeight)) {\n this.virtualList.setRowHeight(this.params.cellHeight);\n }\n this.renderSelectedValue();\n if (_.missing(params.values)) {\n console.warn('AG Grid: richSelectCellEditor requires values for it to work');\n return;\n }\n var values = params.values;\n this.virtualList.setModel({\n getRowCount: function () { return values.length; },\n getRow: function (index) { return values[index]; }\n });\n this.addGuiEventListener('keydown', this.onKeyDown.bind(this));\n var virtualListGui = this.virtualList.getGui();\n this.addManagedListener(virtualListGui, 'click', this.onClick.bind(this));\n this.addManagedListener(virtualListGui, 'mousemove', this.onMouseMove.bind(this));\n var debounceDelay = _.exists(params.searchDebounceDelay) ? params.searchDebounceDelay : 300;\n this.clearSearchString = _.debounce(this.clearSearchString, debounceDelay);\n if (((_a = params.eventKey) === null || _a === void 0 ? void 0 : _a.length) === 1) {\n this.searchText(params.eventKey);\n }\n };\n RichSelectCellEditor.prototype.onKeyDown = function (event) {\n var key = event.key;\n event.preventDefault();\n switch (key) {\n case KeyCode.ENTER:\n this.onEnterKeyDown();\n break;\n case KeyCode.TAB:\n this.confirmSelection();\n break;\n case KeyCode.DOWN:\n case KeyCode.UP:\n this.onNavigationKeyDown(event, key);\n break;\n default:\n this.searchText(event);\n }\n };\n RichSelectCellEditor.prototype.confirmSelection = function () {\n this.selectionConfirmed = true;\n };\n RichSelectCellEditor.prototype.onEnterKeyDown = function () {\n this.confirmSelection();\n this.params.stopEditing();\n };\n RichSelectCellEditor.prototype.onNavigationKeyDown = function (event, key) {\n // if we don't preventDefault the page body and/or grid scroll will move.\n event.preventDefault();\n var oldIndex = this.params.values.indexOf(this.selectedValue);\n var newIndex = key === KeyCode.UP ? oldIndex - 1 : oldIndex + 1;\n if (newIndex >= 0 && newIndex < this.params.values.length) {\n var valueToSelect = this.params.values[newIndex];\n this.setSelectedValue(valueToSelect);\n }\n };\n RichSelectCellEditor.prototype.searchText = function (key) {\n if (typeof key !== 'string') {\n var keyString = key.key;\n if (keyString === KeyCode.BACKSPACE) {\n this.searchString = this.searchString.slice(0, -1);\n keyString = '';\n }\n else if (!_.isEventFromPrintableCharacter(key)) {\n return;\n }\n this.searchText(keyString);\n return;\n }\n this.searchString += key;\n this.runSearch();\n this.clearSearchString();\n };\n RichSelectCellEditor.prototype.runSearch = function () {\n var _this = this;\n var values = this.params.values;\n var searchStrings;\n if (typeof values[0] === 'number' || typeof values[0] === 'string') {\n searchStrings = values.map(function (v) { return _this.params.formatValue(v); });\n }\n if (typeof values[0] === 'object' && this.params.colDef.keyCreator) {\n searchStrings = values.map(function (value) {\n var keyParams = {\n value: value,\n colDef: _this.params.colDef,\n column: _this.params.column,\n node: _this.params.node,\n data: _this.params.data,\n api: _this.gridOptionsService.api,\n columnApi: _this.gridOptionsService.columnApi,\n context: _this.gridOptionsService.context\n };\n return _this.params.colDef.keyCreator(keyParams);\n });\n }\n if (!searchStrings) {\n return;\n }\n var topSuggestion = _.fuzzySuggestions(this.searchString, searchStrings, true)[0];\n if (!topSuggestion) {\n return;\n }\n var topSuggestionIndex = searchStrings.indexOf(topSuggestion);\n var topValue = values[topSuggestionIndex];\n this.setSelectedValue(topValue);\n };\n RichSelectCellEditor.prototype.clearSearchString = function () {\n this.searchString = '';\n };\n RichSelectCellEditor.prototype.renderSelectedValue = function () {\n var _this = this;\n var valueFormatted = this.params.formatValue(this.selectedValue);\n var eValue = this.eValue;\n var params = {\n value: this.selectedValue,\n valueFormatted: valueFormatted,\n api: this.gridOptionsService.api,\n };\n var compDetails = this.userComponentFactory.getCellRendererDetails(this.params, params);\n var promise = compDetails ? compDetails.newAgStackInstance() : undefined;\n if (promise) {\n bindCellRendererToHtmlElement(promise, eValue);\n promise.then(function (renderer) {\n _this.addDestroyFunc(function () { return _this.getContext().destroyBean(renderer); });\n });\n }\n else {\n if (_.exists(this.selectedValue)) {\n eValue.innerText = valueFormatted;\n }\n else {\n _.clearElement(eValue);\n }\n }\n };\n RichSelectCellEditor.prototype.setSelectedValue = function (value) {\n if (this.selectedValue === value) {\n return;\n }\n var index = this.params.values.indexOf(value);\n if (index === -1) {\n return;\n }\n this.selectedValue = value;\n this.virtualList.ensureIndexVisible(index);\n this.virtualList.forEachRenderedRow(function (cmp, idx) {\n cmp.updateSelected(index === idx);\n });\n this.virtualList.focusRow(index);\n };\n RichSelectCellEditor.prototype.createRowComponent = function (value) {\n var valueFormatted = this.params.formatValue(value);\n var row = new RichSelectRow(this.params);\n this.getContext().createBean(row);\n row.setState(value, valueFormatted, value === this.selectedValue);\n return row;\n };\n RichSelectCellEditor.prototype.onMouseMove = function (mouseEvent) {\n var rect = this.virtualList.getGui().getBoundingClientRect();\n var scrollTop = this.virtualList.getScrollTop();\n var mouseY = mouseEvent.clientY - rect.top + scrollTop;\n var row = Math.floor(mouseY / this.virtualList.getRowHeight());\n var value = this.params.values[row];\n // not using utils.exist() as want empty string test to pass\n if (value !== undefined) {\n this.setSelectedValue(value);\n }\n };\n RichSelectCellEditor.prototype.onClick = function () {\n this.confirmSelection();\n this.params.stopEditing();\n };\n // we need to have the gui attached before we can draw the virtual rows, as the\n // virtual row logic needs info about the gui state\n RichSelectCellEditor.prototype.afterGuiAttached = function () {\n var selectedIndex = this.params.values.indexOf(this.selectedValue);\n // we have to call this here to get the list to have the right height, ie\n // otherwise it would not have scrolls yet and ensureIndexVisible would do nothing\n this.virtualList.refresh();\n if (selectedIndex >= 0) {\n this.virtualList.ensureIndexVisible(selectedIndex);\n }\n // we call refresh again, as the list could of moved, and we need to render the new rows\n this.virtualList.refresh();\n if (this.focusAfterAttached) {\n var indexToSelect = selectedIndex !== -1 ? selectedIndex : 0;\n if (this.params.values.length) {\n this.virtualList.focusRow(indexToSelect);\n }\n else {\n this.getGui().focus();\n }\n }\n };\n RichSelectCellEditor.prototype.getValue = function () {\n // NOTE: we don't use valueParser for Set Filter. The user should provide values that are to be\n // set into the data. valueParser only really makese sense when the user is typing in text (not picking\n // form a set).\n return this.selectionConfirmed ? this.selectedValue : this.originalSelectedValue;\n };\n // tab index is needed so we can focus, which is needed for keyboard events\n RichSelectCellEditor.TEMPLATE = \"
\\n
\\n
\\n
\";\n __decorate$v([\n Autowired('userComponentFactory')\n ], RichSelectCellEditor.prototype, \"userComponentFactory\", void 0);\n __decorate$v([\n RefSelector('eValue')\n ], RichSelectCellEditor.prototype, \"eValue\", void 0);\n __decorate$v([\n RefSelector('eList')\n ], RichSelectCellEditor.prototype, \"eList\", void 0);\n return RichSelectCellEditor;\n}(PopupComponent));\n\n// DO NOT UPDATE MANUALLY: Generated from script during build time\nvar VERSION$5 = '30.0.6';\n\nvar RichSelectModule = {\n version: VERSION$5,\n moduleName: ModuleNames.RichSelectModule,\n beans: [],\n userComponents: [\n { componentName: 'agRichSelect', componentClass: RichSelectCellEditor },\n { componentName: 'agRichSelectCellEditor', componentClass: RichSelectCellEditor }\n ],\n dependantModules: [\n EnterpriseCoreModule\n ]\n};\n\nvar __extends$w = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$u = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar FullStore = /** @class */ (function (_super) {\n __extends$w(FullStore, _super);\n function FullStore(ssrmParams, storeParams, parentRowNode) {\n var _this = \n // finite block represents a cache with just one block, thus 0 is the id, it's the first block\n _super.call(this, 0) || this;\n _this.nodeIdSequence = new NumberSequence();\n _this.info = {};\n _this.ssrmParams = ssrmParams;\n _this.parentRowNode = parentRowNode;\n _this.level = parentRowNode.level + 1;\n _this.groupLevel = ssrmParams.rowGroupCols ? _this.level < ssrmParams.rowGroupCols.length : undefined;\n _this.leafGroup = ssrmParams.rowGroupCols ? _this.level === ssrmParams.rowGroupCols.length - 1 : false;\n return _this;\n }\n FullStore.prototype.postConstruct = function () {\n var _this = this;\n this.usingTreeData = this.gridOptionsService.isTreeData();\n this.nodeIdPrefix = this.blockUtils.createNodeIdPrefix(this.parentRowNode);\n if (!this.usingTreeData && this.groupLevel) {\n var groupColVo = this.ssrmParams.rowGroupCols[this.level];\n this.groupField = groupColVo.field;\n this.rowGroupColumn = this.columnModel.getRowGroupColumns()[this.level];\n }\n var initialRowCount = 1;\n var isRootStore = this.parentRowNode.level === -1;\n var userInitialRowCount = this.storeUtils.getServerSideInitialRowCount();\n if (isRootStore && userInitialRowCount !== undefined) {\n initialRowCount = userInitialRowCount;\n }\n this.initialiseRowNodes(initialRowCount);\n this.rowNodeBlockLoader.addBlock(this);\n this.addDestroyFunc(function () { return _this.rowNodeBlockLoader.removeBlock(_this); });\n };\n FullStore.prototype.destroyRowNodes = function () {\n this.blockUtils.destroyRowNodes(this.allRowNodes);\n this.allRowNodes = [];\n this.nodesAfterSort = [];\n this.nodesAfterFilter = [];\n this.allNodesMap = {};\n };\n FullStore.prototype.initialiseRowNodes = function (loadingRowsCount, failedLoad) {\n if (failedLoad === void 0) { failedLoad = false; }\n this.destroyRowNodes();\n for (var i = 0; i < loadingRowsCount; i++) {\n var loadingRowNode = this.blockUtils.createRowNode({\n field: this.groupField, group: this.groupLevel, leafGroup: this.leafGroup,\n level: this.level, parent: this.parentRowNode, rowGroupColumn: this.rowGroupColumn\n });\n if (failedLoad) {\n loadingRowNode.failedLoad = true;\n }\n this.allRowNodes.push(loadingRowNode);\n this.nodesAfterFilter.push(loadingRowNode);\n this.nodesAfterSort.push(loadingRowNode);\n }\n };\n FullStore.prototype.getBlockStateJson = function () {\n return {\n id: this.nodeIdPrefix ? this.nodeIdPrefix : '',\n state: this.getState()\n };\n };\n FullStore.prototype.loadFromDatasource = function () {\n this.storeUtils.loadFromDatasource({\n startRow: undefined,\n endRow: undefined,\n parentBlock: this,\n parentNode: this.parentRowNode,\n storeParams: this.ssrmParams,\n successCallback: this.pageLoaded.bind(this, this.getVersion()),\n success: this.success.bind(this, this.getVersion()),\n failCallback: this.pageLoadFailed.bind(this, this.getVersion()),\n fail: this.pageLoadFailed.bind(this, this.getVersion())\n });\n };\n FullStore.prototype.getStartRow = function () {\n return 0; // always zero as not in a cache\n };\n FullStore.prototype.getEndRow = function () {\n return this.nodesAfterSort.length;\n };\n FullStore.prototype.createDataNode = function (data, index) {\n var rowNode = this.blockUtils.createRowNode({\n field: this.groupField, group: this.groupLevel, leafGroup: this.leafGroup,\n level: this.level, parent: this.parentRowNode, rowGroupColumn: this.rowGroupColumn\n });\n if (index != null) {\n _.insertIntoArray(this.allRowNodes, rowNode, index);\n }\n else {\n this.allRowNodes.push(rowNode);\n }\n var defaultId = this.prefixId(this.nodeIdSequence.next());\n this.blockUtils.setDataIntoRowNode(rowNode, data, defaultId, undefined);\n this.nodeManager.addRowNode(rowNode);\n this.blockUtils.checkOpenByDefault(rowNode);\n this.allNodesMap[rowNode.id] = rowNode;\n return rowNode;\n };\n FullStore.prototype.prefixId = function (id) {\n if (this.nodeIdPrefix) {\n return this.nodeIdPrefix + '-' + id;\n }\n else {\n return id.toString();\n }\n };\n FullStore.prototype.processServerFail = function () {\n this.initialiseRowNodes(1, true);\n this.fireStoreUpdatedEvent();\n this.flushAsyncTransactions();\n };\n FullStore.prototype.processServerResult = function (params) {\n if (!this.isAlive()) {\n return;\n }\n var info = params.storeInfo || params.groupLevelInfo;\n if (info) {\n Object.assign(this.info, info);\n }\n var nodesToRecycle = this.allRowNodes.length > 0 ? this.allNodesMap : undefined;\n this.allRowNodes = [];\n this.nodesAfterSort = [];\n this.nodesAfterFilter = [];\n this.allNodesMap = {};\n if (!params.rowData) {\n var message_1 = 'AG Grid: \"params.data\" is missing from Server-Side Row Model success() callback. Please use the \"data\" attribute. If no data is returned, set an empty list.';\n _.doOnce(function () { return console.warn(message_1, params); }, 'FullStore.noData');\n }\n this.createOrRecycleNodes(nodesToRecycle, params.rowData);\n if (nodesToRecycle) {\n this.blockUtils.destroyRowNodes(_.getAllValuesInObject(nodesToRecycle));\n }\n this.filterAndSortNodes();\n this.fireStoreUpdatedEvent();\n this.flushAsyncTransactions();\n };\n FullStore.prototype.createOrRecycleNodes = function (nodesToRecycle, rowData) {\n var _this = this;\n if (!rowData) {\n return;\n }\n var lookupNodeToRecycle = function (data) {\n if (!nodesToRecycle) {\n return undefined;\n }\n var getRowIdFunc = _this.gridOptionsService.getCallback('getRowId');\n if (!getRowIdFunc) {\n return undefined;\n }\n var parentKeys = _this.parentRowNode.getGroupKeys();\n var level = _this.level;\n var id = getRowIdFunc({\n data: data,\n parentKeys: parentKeys.length > 0 ? parentKeys : undefined,\n level: level,\n });\n var foundNode = nodesToRecycle[id];\n if (!foundNode) {\n return undefined;\n }\n delete nodesToRecycle[id];\n return foundNode;\n };\n var recycleNode = function (rowNode, dataItem) {\n _this.allNodesMap[rowNode.id] = rowNode;\n _this.blockUtils.updateDataIntoRowNode(rowNode, dataItem);\n _this.allRowNodes.push(rowNode);\n };\n rowData.forEach(function (dataItem) {\n var nodeToRecycle = lookupNodeToRecycle(dataItem);\n if (nodeToRecycle) {\n recycleNode(nodeToRecycle, dataItem);\n }\n else {\n _this.createDataNode(dataItem);\n }\n });\n };\n FullStore.prototype.flushAsyncTransactions = function () {\n var _this = this;\n // we want to update the store with any outstanding transactions straight away,\n // as otherwise if waitTimeMillis is large (eg 5s), then the user could be looking\n // at old data for a few seconds before the transactions is applied, which isn't what\n // you would expect when we advertise 'transaction is applied when data is loaded'.\n // we do this in a timeout as flushAsyncTransactions expects the grid to be in a settled\n // state, not in the middle of loading rows! keeps the VM Turns more simple and deterministic.\n window.setTimeout(function () { return _this.transactionManager.flushAsyncTransactions(); }, 0);\n };\n FullStore.prototype.filterAndSortNodes = function () {\n this.filterRowNodes();\n this.sortRowNodes();\n };\n FullStore.prototype.sortRowNodes = function () {\n var serverIsSorting = this.storeUtils.isServerSideSortAllLevels() || this.storeUtils.isServerSideSortOnServer();\n var sortOptions = this.sortController.getSortOptions();\n var noSortApplied = !sortOptions || sortOptions.length == 0;\n if (serverIsSorting || noSortApplied) {\n this.nodesAfterSort = this.nodesAfterFilter;\n return;\n }\n this.nodesAfterSort = this.rowNodeSorter.doFullSort(this.nodesAfterFilter, sortOptions);\n };\n FullStore.prototype.filterRowNodes = function () {\n var _this = this;\n var serverIsFiltering = !this.storeUtils.isServerSideOnlyRefreshFilteredGroups() || this.storeUtils.isServerSideFilterOnServer();\n // filtering for InFullStore only works at lowest level details.\n // reason is the logic for group filtering was to difficult to work out how it should work at time of writing.\n var groupLevel = this.groupLevel;\n if (serverIsFiltering || groupLevel) {\n this.nodesAfterFilter = this.allRowNodes;\n return;\n }\n this.nodesAfterFilter = this.allRowNodes.filter(function (rowNode) { return _this.filterManager.doesRowPassFilter({ rowNode: rowNode }); });\n };\n FullStore.prototype.clearDisplayIndexes = function () {\n var _this = this;\n this.displayIndexStart = undefined;\n this.displayIndexEnd = undefined;\n this.allRowNodes.forEach(function (rowNode) { return _this.blockUtils.clearDisplayIndex(rowNode); });\n };\n FullStore.prototype.getDisplayIndexEnd = function () {\n return this.displayIndexEnd;\n };\n FullStore.prototype.isDisplayIndexInStore = function (displayIndex) {\n if (this.getRowCount() === 0) {\n return false;\n }\n return displayIndex >= this.displayIndexStart && displayIndex < this.displayIndexEnd;\n };\n FullStore.prototype.setDisplayIndexes = function (displayIndexSeq, nextRowTop) {\n var _this = this;\n this.displayIndexStart = displayIndexSeq.peek();\n this.topPx = nextRowTop.value;\n var visibleNodeIds = {};\n // set on all visible nodes\n this.nodesAfterSort.forEach(function (rowNode) {\n _this.blockUtils.setDisplayIndex(rowNode, displayIndexSeq, nextRowTop);\n visibleNodeIds[rowNode.id] = true;\n });\n // and clear on all non-visible nodes\n this.allRowNodes.forEach(function (rowNode) {\n if (!visibleNodeIds[rowNode.id]) {\n _this.blockUtils.clearDisplayIndex(rowNode);\n }\n });\n this.displayIndexEnd = displayIndexSeq.peek();\n this.heightPx = nextRowTop.value - this.topPx;\n };\n FullStore.prototype.forEachStoreDeep = function (callback, sequence) {\n if (sequence === void 0) { sequence = new NumberSequence(); }\n callback(this, sequence.next());\n this.allRowNodes.forEach(function (rowNode) {\n var childCache = rowNode.childStore;\n if (childCache) {\n childCache.forEachStoreDeep(callback, sequence);\n }\n });\n };\n FullStore.prototype.forEachNodeDeep = function (callback, sequence) {\n if (sequence === void 0) { sequence = new NumberSequence(); }\n this.allRowNodes.forEach(function (rowNode) {\n callback(rowNode, sequence.next());\n var childCache = rowNode.childStore;\n if (childCache) {\n childCache.forEachNodeDeep(callback, sequence);\n }\n });\n };\n FullStore.prototype.forEachNodeDeepAfterFilterAndSort = function (callback, sequence) {\n if (sequence === void 0) { sequence = new NumberSequence(); }\n this.nodesAfterSort.forEach(function (rowNode) {\n callback(rowNode, sequence.next());\n var childCache = rowNode.childStore;\n if (childCache) {\n childCache.forEachNodeDeepAfterFilterAndSort(callback, sequence);\n }\n });\n };\n FullStore.prototype.getRowUsingDisplayIndex = function (displayRowIndex) {\n // this can happen if asking for a row that doesn't exist in the model,\n // eg if a cell range is selected, and the user filters so rows no longer exists\n if (!this.isDisplayIndexInStore(displayRowIndex)) {\n return undefined;\n }\n var res = this.blockUtils.binarySearchForDisplayIndex(displayRowIndex, this.nodesAfterSort);\n return res;\n };\n FullStore.prototype.getRowBounds = function (index) {\n for (var i = 0; i < this.nodesAfterSort.length; i++) {\n var rowNode = this.nodesAfterSort[i];\n var res = this.blockUtils.extractRowBounds(rowNode, index);\n if (res) {\n return res;\n }\n }\n return null;\n };\n FullStore.prototype.isPixelInRange = function (pixel) {\n return pixel >= this.topPx && pixel < (this.topPx + this.heightPx);\n };\n FullStore.prototype.getRowIndexAtPixel = function (pixel) {\n var _this = this;\n // if pixel before block, return first row\n var pixelBeforeThisStore = pixel <= this.topPx;\n if (pixelBeforeThisStore) {\n var firstNode = this.nodesAfterSort[0];\n return firstNode.rowIndex;\n }\n // if pixel after store, return last row, however the last\n // row could be a child store\n var pixelAfterThisStore = pixel >= (this.topPx + this.heightPx);\n if (pixelAfterThisStore) {\n var lastRowNode = this.nodesAfterSort[this.nodesAfterSort.length - 1];\n var lastRowNodeBottomPx = lastRowNode.rowTop + lastRowNode.rowHeight;\n if (pixel >= lastRowNodeBottomPx && lastRowNode.expanded) {\n if (lastRowNode.childStore && lastRowNode.childStore.getRowCount() > 0) {\n return lastRowNode.childStore.getRowIndexAtPixel(pixel);\n }\n if (lastRowNode.detailNode) {\n return lastRowNode.detailNode.rowIndex;\n }\n }\n return lastRowNode.rowIndex;\n }\n var res = null;\n this.nodesAfterSort.forEach(function (rowNode) {\n var res2 = _this.blockUtils.getIndexAtPixel(rowNode, pixel);\n if (res2 != null) {\n res = res2;\n }\n });\n var pixelIsPastLastRow = res == null;\n if (pixelIsPastLastRow) {\n return this.displayIndexEnd - 1;\n }\n return res;\n };\n FullStore.prototype.getChildStore = function (keys) {\n var _this = this;\n return this.storeUtils.getChildStore(keys, this, function (key) {\n var rowNode = _this.allRowNodes.find(function (currentRowNode) {\n return currentRowNode.key == key;\n });\n return rowNode;\n });\n };\n FullStore.prototype.forEachChildStoreShallow = function (callback) {\n this.allRowNodes.forEach(function (rowNode) {\n var childStore = rowNode.childStore;\n if (childStore) {\n callback(childStore);\n }\n });\n };\n FullStore.prototype.refreshAfterFilter = function (params) {\n var serverIsFiltering = this.storeUtils.isServerSideFilterOnServer();\n var storeIsImpacted = this.storeUtils.isServerRefreshNeeded(this.parentRowNode, this.ssrmParams.rowGroupCols, params);\n var serverIsFilteringAllLevels = !this.storeUtils.isServerSideOnlyRefreshFilteredGroups();\n if (serverIsFilteringAllLevels || (serverIsFiltering && storeIsImpacted)) {\n this.refreshStore(true);\n this.sortRowNodes();\n return;\n }\n this.filterRowNodes();\n this.sortRowNodes();\n this.forEachChildStoreShallow(function (store) { return store.refreshAfterFilter(params); });\n };\n FullStore.prototype.refreshAfterSort = function (params) {\n var serverIsSorting = this.storeUtils.isServerSideSortOnServer();\n var storeIsImpacted = this.storeUtils.isServerRefreshNeeded(this.parentRowNode, this.ssrmParams.rowGroupCols, params);\n var serverIsSortingAllLevels = this.storeUtils.isServerSideSortAllLevels();\n if (serverIsSortingAllLevels || (serverIsSorting && storeIsImpacted)) {\n this.refreshStore(true);\n this.filterRowNodes();\n return;\n }\n this.filterRowNodes();\n this.sortRowNodes();\n this.forEachChildStoreShallow(function (store) { return store.refreshAfterSort(params); });\n };\n FullStore.prototype.applyTransaction = function (transaction) {\n // we only apply transactions to loaded state\n switch (this.getState()) {\n case RowNodeBlock.STATE_FAILED:\n return { status: ServerSideTransactionResultStatus.StoreLoadingFailed };\n case RowNodeBlock.STATE_LOADING:\n return { status: ServerSideTransactionResultStatus.StoreLoading };\n case RowNodeBlock.STATE_WAITING_TO_LOAD:\n return { status: ServerSideTransactionResultStatus.StoreWaitingToLoad };\n }\n var applyCallback = this.gridOptionsService.getCallback('isApplyServerSideTransaction');\n if (applyCallback) {\n var params = {\n transaction: transaction,\n parentNode: this.parentRowNode,\n storeInfo: this.info,\n groupLevelInfo: this.info\n };\n var apply = applyCallback(params);\n if (!apply) {\n return { status: ServerSideTransactionResultStatus.Cancelled };\n }\n }\n var res = {\n status: ServerSideTransactionResultStatus.Applied,\n remove: [],\n update: [],\n add: []\n };\n var nodesToUnselect = [];\n this.executeAdd(transaction, res);\n this.executeRemove(transaction, res, nodesToUnselect);\n this.executeUpdate(transaction, res, nodesToUnselect);\n this.filterAndSortNodes();\n this.updateSelection(nodesToUnselect);\n return res;\n };\n FullStore.prototype.updateSelection = function (nodesToUnselect) {\n var selectionChanged = nodesToUnselect.length > 0;\n if (selectionChanged) {\n this.selectionService.setNodesSelected({\n newValue: false,\n nodes: nodesToUnselect,\n suppressFinishActions: true,\n clearSelection: false,\n source: 'rowDataChanged',\n });\n var event_1 = {\n type: Events.EVENT_SELECTION_CHANGED,\n source: 'rowDataChanged'\n };\n this.eventService.dispatchEvent(event_1);\n }\n };\n FullStore.prototype.executeAdd = function (rowDataTran, rowNodeTransaction) {\n var _this = this;\n var add = rowDataTran.add, addIndex = rowDataTran.addIndex;\n if (_.missingOrEmpty(add)) {\n return;\n }\n var useIndex = typeof addIndex === 'number' && addIndex >= 0;\n if (useIndex) {\n // items get inserted in reverse order for index insertion\n add.reverse().forEach(function (item) {\n var newRowNode = _this.createDataNode(item, addIndex);\n rowNodeTransaction.add.push(newRowNode);\n });\n }\n else {\n add.forEach(function (item) {\n var newRowNode = _this.createDataNode(item);\n rowNodeTransaction.add.push(newRowNode);\n });\n }\n };\n FullStore.prototype.executeRemove = function (rowDataTran, rowNodeTransaction, nodesToUnselect) {\n var _this = this;\n var remove = rowDataTran.remove;\n if (remove == null) {\n return;\n }\n var rowIdsRemoved = {};\n remove.forEach(function (item) {\n var rowNode = _this.lookupRowNode(item);\n if (!rowNode) {\n return;\n }\n // do delete - setting 'suppressFinishActions = true' to ensure EVENT_SELECTION_CHANGED is not raised for\n // each row node updated, instead it is raised once by the calling code if any selected nodes exist.\n if (rowNode.isSelected()) {\n nodesToUnselect.push(rowNode);\n }\n // so row renderer knows to fade row out (and not reposition it)\n rowNode.clearRowTopAndRowIndex();\n // NOTE: were we could remove from allLeaveChildren, however _.removeFromArray() is expensive, especially\n // if called multiple times (eg deleting lots of rows) and if allLeafChildren is a large list\n rowIdsRemoved[rowNode.id] = true;\n // _.removeFromArray(this.rootNode.allLeafChildren, rowNode);\n delete _this.allNodesMap[rowNode.id];\n rowNodeTransaction.remove.push(rowNode);\n _this.nodeManager.removeNode(rowNode);\n });\n this.allRowNodes = this.allRowNodes.filter(function (rowNode) { return !rowIdsRemoved[rowNode.id]; });\n };\n FullStore.prototype.executeUpdate = function (rowDataTran, rowNodeTransaction, nodesToUnselect) {\n var _this = this;\n var update = rowDataTran.update;\n if (update == null) {\n return;\n }\n update.forEach(function (item) {\n var rowNode = _this.lookupRowNode(item);\n if (!rowNode) {\n return;\n }\n _this.blockUtils.updateDataIntoRowNode(rowNode, item);\n if (!rowNode.selectable && rowNode.isSelected()) {\n nodesToUnselect.push(rowNode);\n }\n rowNodeTransaction.update.push(rowNode);\n });\n };\n FullStore.prototype.lookupRowNode = function (data) {\n var getRowIdFunc = this.gridOptionsService.getCallback('getRowId');\n var rowNode;\n if (getRowIdFunc != null) {\n // find rowNode using id\n var level = this.level;\n var parentKeys = this.parentRowNode.getGroupKeys();\n var id = getRowIdFunc({\n data: data,\n parentKeys: parentKeys.length > 0 ? parentKeys : undefined,\n level: level,\n });\n rowNode = this.allNodesMap[id];\n if (!rowNode) {\n console.error(\"AG Grid: could not find row id=\" + id + \", data item was not found for this id\");\n return null;\n }\n }\n else {\n // find rowNode using object references\n rowNode = this.allRowNodes.find(function (currentRowNode) { return currentRowNode.data === data; });\n if (!rowNode) {\n console.error(\"AG Grid: could not find data item as object was not found\", data);\n return null;\n }\n }\n return rowNode;\n };\n FullStore.prototype.addStoreStates = function (result) {\n result.push({\n suppressInfiniteScroll: true,\n route: this.parentRowNode.getGroupKeys(),\n rowCount: this.allRowNodes.length,\n info: this.info\n });\n this.forEachChildStoreShallow(function (childStore) { return childStore.addStoreStates(result); });\n };\n FullStore.prototype.refreshStore = function (purge) {\n if (purge) {\n var loadingRowsToShow = this.nodesAfterSort ? this.nodesAfterSort.length : 1;\n this.initialiseRowNodes(loadingRowsToShow);\n }\n this.scheduleLoad();\n this.fireStoreUpdatedEvent();\n };\n FullStore.prototype.retryLoads = function () {\n if (this.getState() === RowNodeBlock.STATE_FAILED) {\n this.initialiseRowNodes(1);\n this.scheduleLoad();\n }\n this.forEachChildStoreShallow(function (store) { return store.retryLoads(); });\n };\n FullStore.prototype.scheduleLoad = function () {\n this.setStateWaitingToLoad();\n this.rowNodeBlockLoader.checkBlockToLoad();\n };\n // gets called 1) row count changed 2) cache purged 3) items inserted\n FullStore.prototype.fireStoreUpdatedEvent = function () {\n // this results in row model firing ModelUpdated.\n // server side row model also updates the row indexes first\n var event = {\n type: Events.EVENT_STORE_UPDATED\n };\n this.eventService.dispatchEvent(event);\n };\n FullStore.prototype.getRowCount = function () {\n return this.nodesAfterSort.length;\n };\n FullStore.prototype.getTopLevelRowDisplayedIndex = function (topLevelIndex) {\n var rowNode = this.nodesAfterSort[topLevelIndex];\n return rowNode.rowIndex;\n };\n FullStore.prototype.isLastRowIndexKnown = function () {\n return this.getState() == RowNodeBlock.STATE_LOADED;\n };\n FullStore.prototype.getRowNodesInRange = function (firstInRange, lastInRange) {\n var result = [];\n var inActiveRange = false;\n // if only one node passed, we start the selection at the top\n if (_.missing(firstInRange)) {\n inActiveRange = true;\n }\n this.nodesAfterSort.forEach(function (rowNode) {\n var hitFirstOrLast = rowNode === firstInRange || rowNode === lastInRange;\n if (inActiveRange || hitFirstOrLast) {\n result.push(rowNode);\n }\n if (hitFirstOrLast) {\n inActiveRange = !inActiveRange;\n }\n });\n // inActiveRange will be still true if we never hit the second rowNode\n var invalidRange = inActiveRange;\n return invalidRange ? [] : result;\n };\n FullStore.prototype.getStoreBounds = function () {\n return {\n topPx: this.topPx,\n heightPx: this.heightPx,\n };\n };\n __decorate$u([\n Autowired('ssrmStoreUtils')\n ], FullStore.prototype, \"storeUtils\", void 0);\n __decorate$u([\n Autowired('ssrmBlockUtils')\n ], FullStore.prototype, \"blockUtils\", void 0);\n __decorate$u([\n Autowired('columnModel')\n ], FullStore.prototype, \"columnModel\", void 0);\n __decorate$u([\n Autowired('rowNodeBlockLoader')\n ], FullStore.prototype, \"rowNodeBlockLoader\", void 0);\n __decorate$u([\n Autowired('rowNodeSorter')\n ], FullStore.prototype, \"rowNodeSorter\", void 0);\n __decorate$u([\n Autowired('sortController')\n ], FullStore.prototype, \"sortController\", void 0);\n __decorate$u([\n Autowired('selectionService')\n ], FullStore.prototype, \"selectionService\", void 0);\n __decorate$u([\n Autowired('ssrmNodeManager')\n ], FullStore.prototype, \"nodeManager\", void 0);\n __decorate$u([\n Autowired('filterManager')\n ], FullStore.prototype, \"filterManager\", void 0);\n __decorate$u([\n Autowired('ssrmTransactionManager')\n ], FullStore.prototype, \"transactionManager\", void 0);\n __decorate$u([\n PostConstruct\n ], FullStore.prototype, \"postConstruct\", null);\n __decorate$u([\n PreDestroy\n ], FullStore.prototype, \"destroyRowNodes\", null);\n return FullStore;\n}(RowNodeBlock));\n\nvar __extends$v = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$t = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __read$7 = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar LazyBlockLoader = /** @class */ (function (_super) {\n __extends$v(LazyBlockLoader, _super);\n function LazyBlockLoader(cache, parentNode, storeParams) {\n var _this = _super.call(this) || this;\n _this.loadingNodes = new Set();\n _this.checkForLoadQueued = false;\n _this.loaderTimeout = undefined;\n _this.nextBlockToLoad = undefined;\n _this.parentNode = parentNode;\n _this.cache = cache;\n _this.storeParams = storeParams;\n return _this;\n }\n LazyBlockLoader.prototype.init = function () {\n var _this = this;\n this.addManagedListener(this.rowNodeBlockLoader, RowNodeBlockLoader.BLOCK_LOADED_EVENT, function () { return _this.queueLoadAction(); });\n };\n LazyBlockLoader.prototype.isRowLoading = function (index) {\n return this.loadingNodes.has(index);\n };\n LazyBlockLoader.prototype.getBlockToLoad = function () {\n var _a;\n var firstRowInViewport = this.api.getFirstDisplayedRow();\n var lastRowInViewport = this.api.getLastDisplayedRow();\n // quick look-up for priority rows needing loading in viewport.\n for (var i = firstRowInViewport; i <= lastRowInViewport; i++) {\n var node = this.cache.getNodeCachedByDisplayIndex(i);\n if (!node) {\n // if no row details, ignore, as row hasn't been created\n // and it's too expensive to work out its location here\n continue;\n }\n var lazyNode = this.cache.getNodes().getBy('node', node);\n if (!lazyNode) {\n continue;\n }\n if (this.isRowLoading(lazyNode.index)) {\n continue;\n }\n if (node.__needsRefreshWhenVisible || (node.stub && !node.failedLoad)) {\n return this.getBlockStartIndexForIndex(lazyNode.index);\n }\n }\n var nodesToRefresh = this.cache.getNodesToRefresh();\n var nodeToRefresh = null;\n var nodeToRefreshDist = Number.MAX_SAFE_INTEGER;\n nodesToRefresh.forEach(function (node) {\n if (node.rowIndex == null) {\n nodeToRefresh = node;\n return;\n }\n var distToViewportTop = Math.abs(firstRowInViewport - node.rowIndex);\n var distToViewportBottom = Math.abs(node.rowIndex - lastRowInViewport);\n if (distToViewportTop < nodeToRefreshDist) {\n nodeToRefresh = node;\n nodeToRefreshDist = distToViewportTop;\n }\n if (distToViewportBottom < nodeToRefreshDist) {\n nodeToRefresh = node;\n nodeToRefreshDist = distToViewportBottom;\n }\n });\n var lazyIndex = (_a = this.cache.getNodes().getBy('node', nodeToRefresh)) === null || _a === void 0 ? void 0 : _a.index;\n return lazyIndex == null ? undefined : this.getBlockStartIndexForIndex(lazyIndex);\n };\n LazyBlockLoader.prototype.reset = function () {\n this.loadingNodes.clear();\n clearTimeout(this.loaderTimeout);\n this.loaderTimeout = undefined;\n };\n LazyBlockLoader.prototype.executeLoad = function (startRow, endRow) {\n var _this = this;\n var _a;\n var ssrmParams = this.cache.getSsrmParams();\n var request = {\n startRow: startRow,\n endRow: endRow,\n rowGroupCols: ssrmParams.rowGroupCols,\n valueCols: ssrmParams.valueCols,\n pivotCols: ssrmParams.pivotCols,\n pivotMode: ssrmParams.pivotMode,\n groupKeys: this.parentNode.getGroupKeys(),\n filterModel: ssrmParams.filterModel,\n sortModel: ssrmParams.sortModel,\n };\n var removeNodesFromLoadingMap = function () {\n for (var i = 0; i < endRow - startRow; i++) {\n _this.loadingNodes.delete(startRow + i);\n }\n };\n var addNodesToLoadingMap = function () {\n for (var i = 0; i < endRow - startRow; i++) {\n _this.loadingNodes.add(startRow + i);\n }\n };\n var success = function (params) {\n _this.rowNodeBlockLoader.loadComplete();\n _this.cache.onLoadSuccess(startRow, endRow - startRow, params);\n removeNodesFromLoadingMap();\n _this.queueLoadAction();\n };\n var fail = function () {\n _this.rowNodeBlockLoader.loadComplete();\n _this.cache.onLoadFailed(startRow, endRow - startRow);\n removeNodesFromLoadingMap();\n _this.queueLoadAction();\n };\n var params = {\n request: request,\n successCallback: function (rowData, rowCount) { return success({ rowData: rowData, rowCount: rowCount }); },\n success: success,\n failCallback: fail,\n fail: fail,\n parentNode: this.parentNode,\n api: this.api,\n columnApi: this.columnApi,\n context: this.gridOptionsService.context\n };\n addNodesToLoadingMap();\n (_a = this.cache.getSsrmParams().datasource) === null || _a === void 0 ? void 0 : _a.getRows(params);\n };\n LazyBlockLoader.prototype.getNextBlockToLoad = function () {\n var result = this.getBlockToLoad();\n if (result != null && result < 0) {\n this.getBlockToLoad();\n }\n if (result != null) {\n return [String(result), result + this.getBlockSize()];\n }\n return null;\n };\n LazyBlockLoader.prototype.queueLoadCheck = function () {\n var _this = this;\n // already going to check next cycle, ignore.\n if (this.checkForLoadQueued) {\n return;\n }\n this.checkForLoadQueued = true;\n window.queueMicrotask(function () {\n _this.checkForLoadQueued = false;\n _this.queueLoadAction();\n });\n };\n LazyBlockLoader.prototype.queueLoadAction = function () {\n var _this = this;\n var _a;\n var nextBlockToLoad = this.getNextBlockToLoad();\n if (!nextBlockToLoad) {\n // there's no block we should be loading right now, clear the timeouts\n window.clearTimeout(this.loaderTimeout);\n this.loaderTimeout = undefined;\n this.nextBlockToLoad = undefined;\n return;\n }\n // if the next required block has changed, reset the loading timeout\n if (!this.nextBlockToLoad || (this.nextBlockToLoad[0] !== nextBlockToLoad[0] && this.nextBlockToLoad[1] !== nextBlockToLoad[1])) {\n this.nextBlockToLoad = nextBlockToLoad;\n window.clearTimeout(this.loaderTimeout);\n var _b = __read$7(this.nextBlockToLoad, 2), startRowString = _b[0], endRow_1 = _b[1];\n var startRow_1 = Number(startRowString);\n this.loaderTimeout = window.setTimeout(function () {\n if (!_this.cache.isAlive()) {\n return;\n }\n _this.loaderTimeout = undefined;\n _this.attemptLoad(startRow_1, endRow_1);\n _this.nextBlockToLoad = undefined;\n }, (_a = this.gridOptionsService.getNum('blockLoadDebounceMillis')) !== null && _a !== void 0 ? _a : 0);\n }\n };\n LazyBlockLoader.prototype.attemptLoad = function (start, end) {\n var availableLoadingCount = this.rowNodeBlockLoader.getAvailableLoadingCount();\n // too many loads already, ignore the request as a successful request will requeue itself anyway\n if (availableLoadingCount != null && availableLoadingCount === 0) {\n return;\n }\n this.rowNodeBlockLoader.registerLoads(1);\n this.executeLoad(start, end);\n this.queueLoadAction();\n };\n LazyBlockLoader.prototype.getBlockSize = function () {\n return this.storeParams.cacheBlockSize || LazyBlockLoader.DEFAULT_BLOCK_SIZE;\n };\n LazyBlockLoader.prototype.getBlockStartIndexForIndex = function (storeIndex) {\n var blockSize = this.getBlockSize();\n return storeIndex - (storeIndex % blockSize);\n };\n LazyBlockLoader.prototype.getBlockBoundsForIndex = function (storeIndex) {\n var startOfBlock = this.getBlockStartIndexForIndex(storeIndex);\n var blockSize = this.getBlockSize();\n return [startOfBlock, startOfBlock + blockSize];\n };\n LazyBlockLoader.DEFAULT_BLOCK_SIZE = 100;\n __decorate$t([\n Autowired('gridApi')\n ], LazyBlockLoader.prototype, \"api\", void 0);\n __decorate$t([\n Autowired('columnApi')\n ], LazyBlockLoader.prototype, \"columnApi\", void 0);\n __decorate$t([\n Autowired('rowNodeBlockLoader')\n ], LazyBlockLoader.prototype, \"rowNodeBlockLoader\", void 0);\n __decorate$t([\n PostConstruct\n ], LazyBlockLoader.prototype, \"init\", null);\n return LazyBlockLoader;\n}(BeanStub));\n\nvar MultiIndexMap = /** @class */ (function () {\n function MultiIndexMap() {\n var indexes = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n indexes[_i] = arguments[_i];\n }\n if (indexes.length < 1) {\n throw new Error('AG Grid: At least one index must be provided.');\n }\n this.indexes = indexes;\n this.maps = new Map(this.indexes.map(function (index) { return [index, new Map()]; }));\n }\n MultiIndexMap.prototype.getBy = function (index, key) {\n var map = this.maps.get(index);\n if (!map) {\n throw new Error(\"AG Grid: \" + String(index) + \" not found\");\n }\n return map.get(key);\n };\n MultiIndexMap.prototype.set = function (item) {\n var _this = this;\n this.indexes.forEach(function (index) {\n var map = _this.maps.get(index);\n if (!map) {\n throw new Error(\"AG Grid: \" + String(index) + \" not found\");\n }\n map.set(item[index], item);\n });\n };\n MultiIndexMap.prototype.delete = function (item) {\n var _this = this;\n this.indexes.forEach(function (index) {\n var map = _this.maps.get(index);\n if (!map) {\n throw new Error(\"AG Grid: \" + String(index) + \" not found\");\n }\n map.delete(item[index]);\n });\n };\n MultiIndexMap.prototype.clear = function () {\n this.maps.forEach(function (map) { return map.clear(); });\n };\n MultiIndexMap.prototype.getIterator = function (index) {\n var map = this.maps.get(index);\n if (!map) {\n throw new Error(\"AG Grid: \" + String(index) + \" not found\");\n }\n return map.values();\n };\n MultiIndexMap.prototype.forEach = function (callback) {\n var iterator = this.getIterator(this.indexes[0]);\n var pointer;\n while (pointer = iterator.next()) {\n if (pointer.done)\n break;\n callback(pointer.value);\n }\n };\n MultiIndexMap.prototype.find = function (callback) {\n var iterator = this.getIterator(this.indexes[0]);\n var pointer;\n while (pointer = iterator.next()) {\n if (pointer.done)\n break;\n if (callback(pointer.value)) {\n return pointer.value;\n }\n }\n };\n MultiIndexMap.prototype.filter = function (predicate) {\n var iterator = this.getIterator(this.indexes[0]);\n var pointer;\n var result = [];\n while (pointer = iterator.next()) {\n if (pointer.done)\n break;\n if (predicate(pointer.value)) {\n result.push(pointer.value);\n }\n }\n return result;\n };\n return MultiIndexMap;\n}());\n\nvar __extends$u = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$s = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __read$6 = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray$4 = (undefined && undefined.__spreadArray) || function (to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\n to[j] = from[i];\n return to;\n};\nvar LazyCache = /** @class */ (function (_super) {\n __extends$u(LazyCache, _super);\n function LazyCache(store, numberOfRows, storeParams) {\n var _this = _super.call(this) || this;\n /**\n * Indicates whether this is still the live dataset for this store (used for ignoring old requests after purge)\n */\n _this.live = true;\n /**\n * A cache of removed group nodes, this is retained for preserving group\n * state when the node moves in and out of the cache. Generally caused by\n * rows moving blocks.\n */\n _this.removedNodeCache = new Map();\n _this.store = store;\n _this.numberOfRows = numberOfRows;\n _this.isLastRowKnown = false;\n _this.storeParams = storeParams;\n return _this;\n }\n LazyCache.prototype.init = function () {\n // initiate the node map to be indexed at 'index', 'id' and 'node' for quick look-up.\n // it's important id isn't first, as stub nodes overwrite each-other, and the first index is\n // used for iteration.\n this.nodeMap = new MultiIndexMap('index', 'id', 'node');\n this.nodeDisplayIndexMap = new Map();\n this.nodesToRefresh = new Set();\n this.defaultNodeIdPrefix = this.blockUtils.createNodeIdPrefix(this.store.getParentNode());\n this.rowLoader = this.createManagedBean(new LazyBlockLoader(this, this.store.getParentNode(), this.storeParams));\n this.getRowIdFunc = this.gridOptionsService.getCallback('getRowId');\n this.isMasterDetail = this.gridOptionsService.isMasterDetail();\n };\n LazyCache.prototype.destroyRowNodes = function () {\n var _this = this;\n this.numberOfRows = 0;\n this.nodeMap.forEach(function (node) { return _this.blockUtils.destroyRowNode(node.node); });\n this.nodeMap.clear();\n this.nodeDisplayIndexMap.clear();\n this.nodesToRefresh.clear();\n this.live = false;\n };\n /**\n * Get the row node for a specific display index from this store\n * @param displayIndex the display index of the node to find\n * @returns undefined if the node is not in the store bounds, otherwise will always return a node\n */\n LazyCache.prototype.getRowByDisplayIndex = function (displayIndex) {\n var _a, _b, _c, _d;\n // if index isn't in store, nothing to return\n if (!this.store.isDisplayIndexInStore(displayIndex)) {\n return undefined;\n }\n // first try to directly look this node up in the display index map\n var node = this.nodeDisplayIndexMap.get(displayIndex);\n if (node) {\n // if we have the node, check if it needs refreshed when rendered\n if (node.stub || node.__needsRefreshWhenVisible) {\n this.rowLoader.queueLoadCheck();\n }\n return node;\n }\n // next check if this is the first row, if so return a stub node\n // this is a performance optimisation, as it is the most common scenario\n // and enables the node - 1 check to kick in more often.\n if (displayIndex === this.store.getDisplayIndexStart()) {\n return this.createStubNode(0, displayIndex);\n }\n // check if the row immediately prior is available in the store\n var contiguouslyPreviousNode = this.nodeDisplayIndexMap.get(displayIndex - 1);\n if (contiguouslyPreviousNode) {\n // if previous row is master detail, and expanded, this node must be detail\n if (this.isMasterDetail && contiguouslyPreviousNode.master && contiguouslyPreviousNode.expanded) {\n return contiguouslyPreviousNode.detailNode;\n }\n // if previous row is expanded group, this node will belong to that group.\n if (contiguouslyPreviousNode.expanded && ((_a = contiguouslyPreviousNode.childStore) === null || _a === void 0 ? void 0 : _a.isDisplayIndexInStore(displayIndex))) {\n return (_b = contiguouslyPreviousNode.childStore) === null || _b === void 0 ? void 0 : _b.getRowUsingDisplayIndex(displayIndex);\n }\n // otherwise, row must be a stub node\n var lazyCacheNode = this.nodeMap.getBy('node', contiguouslyPreviousNode);\n return this.createStubNode(lazyCacheNode.index + 1, displayIndex);\n }\n var adjacentNodes = this.getSurroundingNodesByDisplayIndex(displayIndex);\n // if no bounds skipped includes this, calculate from end index\n if (adjacentNodes == null) {\n var storeIndexFromEndIndex_1 = this.store.getRowCount() - (this.store.getDisplayIndexEnd() - displayIndex);\n return this.createStubNode(storeIndexFromEndIndex_1, displayIndex);\n }\n var previousNode = adjacentNodes.previousNode, nextNode = adjacentNodes.nextNode;\n // if the node before this node is expanded, this node might be a child of that node\n if (previousNode && previousNode.node.expanded && ((_c = previousNode.node.childStore) === null || _c === void 0 ? void 0 : _c.isDisplayIndexInStore(displayIndex))) {\n return (_d = previousNode.node.childStore) === null || _d === void 0 ? void 0 : _d.getRowUsingDisplayIndex(displayIndex);\n }\n // if we have the node after this node, we can calculate the store index of this node by the difference\n // in display indexes between the two nodes.\n if (nextNode) {\n var displayIndexDiff = nextNode.node.rowIndex - displayIndex;\n var newStoreIndex = nextNode.index - displayIndexDiff;\n return this.createStubNode(newStoreIndex, displayIndex);\n }\n // if no next node, calculate from end index of this store\n var storeIndexFromEndIndex = this.store.getRowCount() - (this.store.getDisplayIndexEnd() - displayIndex);\n return this.createStubNode(storeIndexFromEndIndex, displayIndex);\n };\n /**\n * Used for creating and positioning a stub node without firing a store updated event\n */\n LazyCache.prototype.createStubNode = function (storeIndex, displayIndex) {\n var _this = this;\n // bounds are acquired before creating the node, as otherwise it'll use it's own empty self to calculate\n var rowBounds = this.store.getRowBounds(displayIndex);\n var newNode = this.createRowAtIndex(storeIndex, null, function (node) {\n node.setRowIndex(displayIndex);\n node.setRowTop(rowBounds.rowTop);\n _this.nodeDisplayIndexMap.set(displayIndex, node);\n });\n this.rowLoader.queueLoadCheck();\n return newNode;\n };\n /**\n * @param index The row index relative to this store\n * @returns A rowNode at the given store index\n */\n LazyCache.prototype.getRowByStoreIndex = function (index) {\n var _a;\n return (_a = this.nodeMap.getBy('index', index)) === null || _a === void 0 ? void 0 : _a.node;\n };\n /**\n * Given a number of rows, skips through the given sequence & row top reference (using default row height)\n * @param numberOfRowsToSkip number of rows to skip over in the given sequence\n * @param displayIndexSeq the sequence in which to skip\n * @param nextRowTop the row top reference in which to skip\n */\n LazyCache.prototype.skipDisplayIndexes = function (numberOfRowsToSkip, displayIndexSeq, nextRowTop) {\n if (numberOfRowsToSkip === 0) {\n return;\n }\n var defaultRowHeight = this.gridOptionsService.getRowHeightAsNumber();\n displayIndexSeq.skip(numberOfRowsToSkip);\n nextRowTop.value += numberOfRowsToSkip * defaultRowHeight;\n };\n /**\n * @param displayIndexSeq the number sequence for generating the display index of each row\n * @param nextRowTop an object containing the next row top value intended to be modified by ref per row\n */\n LazyCache.prototype.setDisplayIndexes = function (displayIndexSeq, nextRowTop) {\n // Create a map of display index nodes for access speed\n this.nodeDisplayIndexMap.clear();\n // create an object indexed by store index, as this will sort all of the nodes when we iterate\n // the object\n var orderedMap = {};\n this.nodeMap.forEach(function (lazyNode) {\n orderedMap[lazyNode.index] = lazyNode.node;\n });\n var lastIndex = -1;\n // iterate over the nodes in order, setting the display index on each node.\n for (var stringIndex in orderedMap) {\n var node = orderedMap[stringIndex];\n var numericIndex = Number(stringIndex);\n // if any nodes aren't currently in the store, skip the display indexes too\n var numberOfRowsToSkip_1 = (numericIndex - 1) - lastIndex;\n this.skipDisplayIndexes(numberOfRowsToSkip_1, displayIndexSeq, nextRowTop);\n // set this nodes index and row top\n this.blockUtils.setDisplayIndex(node, displayIndexSeq, nextRowTop);\n this.nodeDisplayIndexMap.set(node.rowIndex, node);\n // store this index for skipping after this\n lastIndex = numericIndex;\n }\n // need to skip rows until the end of this store\n var numberOfRowsToSkip = (this.numberOfRows - 1) - lastIndex;\n this.skipDisplayIndexes(numberOfRowsToSkip, displayIndexSeq, nextRowTop);\n // this is not terribly efficient, and could probs be improved\n this.purgeExcessRows();\n };\n LazyCache.prototype.getRowCount = function () {\n return this.numberOfRows;\n };\n LazyCache.prototype.setRowCount = function (rowCount, isLastRowIndexKnown) {\n if (rowCount < 0) {\n throw new Error('AG Grid: setRowCount can only accept a positive row count.');\n }\n this.numberOfRows = rowCount;\n if (isLastRowIndexKnown != null) {\n this.isLastRowKnown = isLastRowIndexKnown;\n if (isLastRowIndexKnown === false) {\n this.numberOfRows += 1;\n }\n }\n this.fireStoreUpdatedEvent();\n };\n LazyCache.prototype.getNodes = function () {\n return this.nodeMap;\n };\n LazyCache.prototype.getNodeCachedByDisplayIndex = function (displayIndex) {\n var _a;\n return (_a = this.nodeDisplayIndexMap.get(displayIndex)) !== null && _a !== void 0 ? _a : null;\n };\n LazyCache.prototype.getNodesToRefresh = function () {\n return this.nodesToRefresh;\n };\n /**\n * @returns the previous and next loaded row nodes surrounding the given display index\n */\n LazyCache.prototype.getSurroundingNodesByDisplayIndex = function (displayIndex) {\n var nextNode;\n var previousNode;\n this.nodeMap.forEach(function (lazyNode) {\n // previous node\n if (displayIndex > lazyNode.node.rowIndex) {\n // get the largest previous node\n if (previousNode == null || previousNode.node.rowIndex < lazyNode.node.rowIndex) {\n previousNode = lazyNode;\n }\n return;\n }\n // next node\n // get the smallest next node\n if (nextNode == null || nextNode.node.rowIndex > lazyNode.node.rowIndex) {\n nextNode = lazyNode;\n return;\n }\n });\n if (!previousNode && !nextNode)\n return null;\n return { previousNode: previousNode, nextNode: nextNode };\n };\n /**\n * Get or calculate the display index for a given store index\n * @param storeIndex the rows index within this store\n * @returns the rows visible display index relative to the grid\n */\n LazyCache.prototype.getDisplayIndexFromStoreIndex = function (storeIndex) {\n var _a, _b;\n var nodeAtIndex = this.nodeMap.getBy('index', storeIndex);\n if (nodeAtIndex) {\n return nodeAtIndex.node.rowIndex;\n }\n var nextNode;\n var previousNode;\n this.nodeMap.forEach(function (lazyNode) {\n // previous node\n if (storeIndex > lazyNode.index) {\n // get the largest previous node\n if (previousNode == null || previousNode.index < lazyNode.index) {\n previousNode = lazyNode;\n }\n return;\n }\n // next node\n // get the smallest next node\n if (nextNode == null || nextNode.index > lazyNode.index) {\n nextNode = lazyNode;\n return;\n }\n });\n if (!nextNode) {\n return this.store.getDisplayIndexEnd() - (this.numberOfRows - storeIndex);\n }\n if (!previousNode) {\n return this.store.getDisplayIndexStart() + storeIndex;\n }\n var storeIndexDiff = storeIndex - previousNode.index;\n var previousDisplayIndex = ((_b = (_a = previousNode.node.childStore) === null || _a === void 0 ? void 0 : _a.getDisplayIndexEnd()) !== null && _b !== void 0 ? _b : previousNode.node.rowIndex);\n return previousDisplayIndex + storeIndexDiff;\n };\n /**\n * Creates a new row and inserts it at the given index\n * @param atStoreIndex the node index relative to this store\n * @param data the data object to populate the node with\n * @returns the new row node\n */\n LazyCache.prototype.createRowAtIndex = function (atStoreIndex, data, createNodeCallback) {\n var _a, _b;\n // make sure an existing node isn't being overwritten\n var lazyNode = this.nodeMap.getBy('index', atStoreIndex);\n // if node already exists, update it or destroy it\n if (lazyNode) {\n var node = lazyNode.node;\n this.nodesToRefresh.delete(node);\n node.__needsRefreshWhenVisible = false;\n // if the node is the same, just update the content\n if (this.doesNodeMatch(data, node)) {\n this.blockUtils.updateDataIntoRowNode(node, data);\n return node;\n }\n // if there's no id and this is an open group, protect this node from changes\n if (this.getRowIdFunc == null && node.group && node.expanded) {\n return node;\n }\n // destroy the old node, might be worth caching state here\n this.destroyRowAtIndex(atStoreIndex);\n }\n // if the node already exists elsewhere, update it and move it to the new location\n if (data && this.getRowIdFunc != null) {\n var id = this.getRowId(data);\n // the node was deleted at some point, but as we're refreshing\n // it's been cached and we can retrieve it for reuse.\n var deletedNode = id && ((_a = this.removedNodeCache) === null || _a === void 0 ? void 0 : _a.get(id));\n if (deletedNode) {\n (_b = this.removedNodeCache) === null || _b === void 0 ? void 0 : _b.delete(id);\n this.blockUtils.updateDataIntoRowNode(deletedNode, data);\n this.nodeMap.set({\n id: deletedNode.id,\n node: deletedNode,\n index: atStoreIndex\n });\n return deletedNode;\n }\n var lazyNode_1 = this.nodeMap.getBy('id', id);\n if (lazyNode_1) {\n // delete old lazy node so we can insert it at different location\n this.nodeMap.delete(lazyNode_1);\n var node = lazyNode_1.node, index = lazyNode_1.index;\n this.blockUtils.updateDataIntoRowNode(node, data);\n this.nodeMap.set({\n id: node.id,\n node: node,\n index: atStoreIndex\n });\n this.nodesToRefresh.delete(node);\n if (this.rowLoader.getBlockStartIndexForIndex(index) === this.rowLoader.getBlockStartIndexForIndex(atStoreIndex)) {\n // if the block hasn't changed and we have a nodes map, we don't need to refresh the original block, as this block\n // has just been refreshed.\n return node;\n }\n // mark all of the old block as needsVerify to trigger it for a refresh, as nodes\n // should not be out of place\n this.markBlockForVerify(index);\n return node;\n }\n }\n // node doesn't exist, create a new one\n var newNode = this.blockUtils.createRowNode(this.store.getRowDetails());\n if (data != null) {\n var defaultId = this.getPrefixedId(this.store.getIdSequence().next());\n this.blockUtils.setDataIntoRowNode(newNode, data, defaultId, undefined);\n this.blockUtils.checkOpenByDefault(newNode);\n this.nodeManager.addRowNode(newNode);\n }\n // add the new node to the store, has to be done after the display index is calculated so it doesn't take itself into account\n this.nodeMap.set({\n id: newNode.id,\n node: newNode,\n index: atStoreIndex,\n });\n if (createNodeCallback) {\n createNodeCallback(newNode);\n }\n return newNode;\n };\n LazyCache.prototype.getBlockStates = function () {\n var _this = this;\n var blockCounts = {};\n var blockStates = {};\n this.nodeMap.forEach(function (_a) {\n var _b;\n var node = _a.node, index = _a.index;\n var blockStart = _this.rowLoader.getBlockStartIndexForIndex(index);\n if (!node.stub && !node.failedLoad) {\n blockCounts[blockStart] = ((_b = blockCounts[blockStart]) !== null && _b !== void 0 ? _b : 0) + 1;\n }\n var rowState = 'loaded';\n if (node.failedLoad) {\n rowState = 'failed';\n }\n else if (_this.rowLoader.isRowLoading(blockStart)) {\n rowState = 'loading';\n }\n else if (_this.nodesToRefresh.has(node) || node.stub) {\n rowState = 'needsLoading';\n }\n if (!blockStates[blockStart]) {\n blockStates[blockStart] = new Set();\n }\n blockStates[blockStart].add(rowState);\n });\n var statePriorityMap = {\n loading: 4,\n failed: 3,\n needsLoading: 2,\n loaded: 1,\n };\n var blockPrefix = this.blockUtils.createNodeIdPrefix(this.store.getParentNode());\n var results = {};\n Object.entries(blockStates).forEach(function (_a) {\n var _b;\n var _c = __read$6(_a, 2), blockStart = _c[0], uniqueStates = _c[1];\n var sortedStates = __spreadArray$4([], __read$6(uniqueStates)).sort(function (a, b) { var _a, _b; return ((_a = statePriorityMap[a]) !== null && _a !== void 0 ? _a : 0) - ((_b = statePriorityMap[b]) !== null && _b !== void 0 ? _b : 0); });\n var priorityState = sortedStates[0];\n var blockNumber = Number(blockStart) / _this.rowLoader.getBlockSize();\n var blockId = blockPrefix ? blockPrefix + \"-\" + blockNumber : String(blockNumber);\n results[blockId] = {\n blockNumber: blockNumber,\n startRow: Number(blockStart),\n endRow: Number(blockStart) + _this.rowLoader.getBlockSize(),\n pageStatus: priorityState,\n loadedRowCount: (_b = blockCounts[blockStart]) !== null && _b !== void 0 ? _b : 0,\n };\n });\n return results;\n };\n LazyCache.prototype.destroyRowAtIndex = function (atStoreIndex) {\n var lazyNode = this.nodeMap.getBy('index', atStoreIndex);\n if (!lazyNode) {\n return;\n }\n this.nodeMap.delete(lazyNode);\n this.nodeDisplayIndexMap.delete(lazyNode.node.rowIndex);\n this.nodesToRefresh.delete(lazyNode.node);\n if (lazyNode.node.group && this.nodesToRefresh.size > 0) {\n // while refreshing, we retain the group nodes so they can be moved\n // without losing state\n this.removedNodeCache.set(lazyNode.node.id, lazyNode.node);\n }\n else {\n this.blockUtils.destroyRowNode(lazyNode.node);\n }\n };\n LazyCache.prototype.getSsrmParams = function () {\n return this.store.getSsrmParams();\n };\n /**\n * @param id the base id to be prefixed\n * @returns a node id with prefix if required\n */\n LazyCache.prototype.getPrefixedId = function (id) {\n if (this.defaultNodeIdPrefix) {\n return this.defaultNodeIdPrefix + '-' + id;\n }\n else {\n return id.toString();\n }\n };\n LazyCache.prototype.markBlockForVerify = function (rowIndex) {\n var _a = __read$6(this.rowLoader.getBlockBoundsForIndex(rowIndex), 2), start = _a[0], end = _a[1];\n var lazyNodesInRange = this.nodeMap.filter(function (lazyNode) { return lazyNode.index >= start && lazyNode.index < end; });\n lazyNodesInRange.forEach(function (_a) {\n var node = _a.node;\n node.__needsRefreshWhenVisible = true;\n });\n };\n LazyCache.prototype.doesNodeMatch = function (data, node) {\n if (node.stub) {\n return false;\n }\n if (this.getRowIdFunc != null) {\n var id = this.getRowId(data);\n return node.id === id;\n }\n return node.data === data;\n };\n /**\n * Deletes any stub nodes not within the given range\n */\n LazyCache.prototype.purgeStubsOutsideOfViewport = function () {\n var _this = this;\n var firstRow = this.api.getFirstDisplayedRow();\n var lastRow = this.api.getLastDisplayedRow();\n var firstRowBlockStart = this.rowLoader.getBlockStartIndexForIndex(firstRow);\n var _a = __read$6(this.rowLoader.getBlockBoundsForIndex(lastRow), 2); _a[0]; var lastRowBlockEnd = _a[1];\n this.nodeMap.forEach(function (lazyNode) {\n // failed loads are still useful, so we don't purge them\n if (_this.rowLoader.isRowLoading(lazyNode.index) || lazyNode.node.failedLoad) {\n return;\n }\n if (lazyNode.node.stub && (lazyNode.index < firstRowBlockStart || lazyNode.index > lastRowBlockEnd)) {\n _this.destroyRowAtIndex(lazyNode.index);\n }\n });\n };\n LazyCache.prototype.getBlocksDistanceFromRow = function (nodes, otherDisplayIndex) {\n var _this = this;\n var blockDistanceToMiddle = {};\n nodes.forEach(function (_a) {\n var node = _a.node, index = _a.index;\n var _b = __read$6(_this.rowLoader.getBlockBoundsForIndex(index), 2), blockStart = _b[0], blockEnd = _b[1];\n if (blockStart in blockDistanceToMiddle) {\n return;\n }\n var distStart = Math.abs(node.rowIndex - otherDisplayIndex);\n var distEnd;\n // may not have an end node if the block came back small \n var lastLazyNode = _this.nodeMap.getBy('index', [blockEnd - 1]);\n if (lastLazyNode)\n distEnd = Math.abs(lastLazyNode.node.rowIndex - otherDisplayIndex);\n var farthest = distEnd == null || distStart < distEnd ? distStart : distEnd;\n blockDistanceToMiddle[blockStart] = farthest;\n });\n return Object.entries(blockDistanceToMiddle);\n };\n LazyCache.prototype.purgeExcessRows = function () {\n var _this = this;\n var _a;\n // Delete all stub nodes which aren't in the viewport or already loading\n this.purgeStubsOutsideOfViewport();\n if (this.store.getDisplayIndexEnd() == null || this.storeParams.maxBlocksInCache == null) {\n // if group is collapsed, or max blocks missing, ignore the event\n return;\n }\n var firstRowInViewport = this.api.getFirstDisplayedRow();\n var lastRowInViewport = this.api.getLastDisplayedRow();\n // the start storeIndex of every block in this store\n var allLoadedBlocks = new Set();\n // the start storeIndex of every displayed block in this store\n var blocksInViewport = new Set();\n this.nodeMap.forEach(function (_a) {\n var index = _a.index, node = _a.node;\n var blockStart = _this.rowLoader.getBlockStartIndexForIndex(index);\n allLoadedBlocks.add(blockStart);\n var isInViewport = node.rowIndex >= firstRowInViewport && node.rowIndex <= lastRowInViewport;\n if (isInViewport) {\n blocksInViewport.add(blockStart);\n }\n });\n // if the viewport is larger than the max blocks, then the viewport size is minimum cache size\n var numberOfBlocksToRetain = Math.max(blocksInViewport.size, (_a = this.storeParams.maxBlocksInCache) !== null && _a !== void 0 ? _a : 0);\n // ensure there is blocks that can be removed\n var loadedBlockCount = allLoadedBlocks.size;\n var blocksToRemove = loadedBlockCount - numberOfBlocksToRetain;\n if (blocksToRemove <= 0) {\n return;\n }\n // the first and last block in the viewport\n var firstRowBlockStart = Number.MAX_SAFE_INTEGER;\n var lastRowBlockStart = Number.MIN_SAFE_INTEGER;\n blocksInViewport.forEach(function (blockStart) {\n if (firstRowBlockStart > blockStart) {\n firstRowBlockStart = blockStart;\n }\n if (lastRowBlockStart < blockStart) {\n lastRowBlockStart = blockStart;\n }\n });\n // all nodes which aren't cached or in the viewport, and so can be removed\n var disposableNodes = this.nodeMap.filter(function (_a) {\n var node = _a.node, index = _a.index;\n var rowBlockStart = _this.rowLoader.getBlockStartIndexForIndex(index);\n var rowBlockInViewport = rowBlockStart >= firstRowBlockStart && rowBlockStart <= lastRowBlockStart;\n return !rowBlockInViewport && !_this.isNodeCached(node);\n });\n if (disposableNodes.length === 0) {\n return;\n }\n var midViewportRow = firstRowInViewport + ((lastRowInViewport - firstRowInViewport) / 2);\n var blockDistanceArray = this.getBlocksDistanceFromRow(disposableNodes, midViewportRow);\n var blockSize = this.rowLoader.getBlockSize();\n // sort the blocks by distance from middle of viewport\n blockDistanceArray.sort(function (a, b) { return Math.sign(b[1] - a[1]); });\n // remove excess blocks, starting from furthest from viewport\n for (var i = 0; i < Math.min(blocksToRemove, blockDistanceArray.length); i++) {\n var blockStart = Number(blockDistanceArray[i][0]);\n for (var x = blockStart; x < blockStart + blockSize; x++) {\n var lazyNode = this.nodeMap.getBy('index', x);\n if (!lazyNode || this.isNodeCached(lazyNode.node)) {\n continue;\n }\n this.destroyRowAtIndex(x);\n }\n }\n };\n LazyCache.prototype.isNodeFocused = function (node) {\n var focusedCell = this.focusService.getFocusCellToUseAfterRefresh();\n if (!focusedCell) {\n return false;\n }\n if (focusedCell.rowPinned != null) {\n return false;\n }\n var hasFocus = focusedCell.rowIndex === node.rowIndex;\n return hasFocus;\n };\n LazyCache.prototype.isNodeCached = function (node) {\n return (node.isExpandable() && node.expanded) || this.isNodeFocused(node);\n };\n LazyCache.prototype.extractDuplicateIds = function (rows) {\n var _this = this;\n if (!this.getRowIdFunc == null) {\n return [];\n }\n var newIds = new Set();\n var duplicates = new Set();\n rows.forEach(function (data) {\n var id = _this.getRowId(data);\n if (newIds.has(id)) {\n duplicates.add(id);\n return;\n }\n newIds.add(id);\n });\n return __spreadArray$4([], __read$6(duplicates));\n };\n LazyCache.prototype.onLoadSuccess = function (firstRowIndex, numberOfRowsExpected, response) {\n var _this = this;\n var _a;\n if (!this.live)\n return;\n var info = (_a = response.groupLevelInfo) !== null && _a !== void 0 ? _a : response.storeInfo;\n this.store.setStoreInfo(info);\n if (this.getRowIdFunc != null) {\n var duplicates = this.extractDuplicateIds(response.rowData);\n if (duplicates.length > 0) {\n var duplicateIdText = duplicates.join(', ');\n console.warn(\"AG Grid: Unable to display rows as duplicate row ids (\" + duplicateIdText + \") were returned by the getRowId callback. Please modify the getRowId callback to provide unique ids.\");\n this.onLoadFailed(firstRowIndex, numberOfRowsExpected);\n return;\n }\n }\n var wasRefreshing = this.nodesToRefresh.size > 0;\n response.rowData.forEach(function (data, responseRowIndex) {\n var _a;\n var rowIndex = firstRowIndex + responseRowIndex;\n var nodeFromCache = _this.nodeMap.getBy('index', rowIndex);\n // if stub, overwrite\n if ((_a = nodeFromCache === null || nodeFromCache === void 0 ? void 0 : nodeFromCache.node) === null || _a === void 0 ? void 0 : _a.stub) {\n _this.createRowAtIndex(rowIndex, data);\n return;\n }\n // node already exists, and same as node at designated position, update data\n if (nodeFromCache && _this.doesNodeMatch(data, nodeFromCache.node)) {\n _this.blockUtils.updateDataIntoRowNode(nodeFromCache.node, data);\n _this.nodesToRefresh.delete(nodeFromCache.node);\n nodeFromCache.node.__needsRefreshWhenVisible = false;\n return;\n }\n // create row will handle deleting the overwritten row\n _this.createRowAtIndex(rowIndex, data);\n });\n var finishedRefreshing = this.nodesToRefresh.size === 0;\n if (wasRefreshing && finishedRefreshing) {\n this.fireRefreshFinishedEvent();\n }\n if (response.rowCount != undefined && response.rowCount !== -1) {\n // if the rowCount has been provided, set the row count\n this.numberOfRows = response.rowCount;\n this.isLastRowKnown = true;\n }\n else if (numberOfRowsExpected > response.rowData.length) {\n // infer the last row as the response came back short\n this.numberOfRows = firstRowIndex + response.rowData.length;\n this.isLastRowKnown = true;\n }\n else if (!this.isLastRowKnown) {\n // add 1 for loading row, as we don't know the last row\n var lastInferredRow = firstRowIndex + response.rowData.length + 1;\n if (lastInferredRow > this.numberOfRows) {\n this.numberOfRows = lastInferredRow;\n }\n }\n if (this.isLastRowKnown) {\n // delete any rows after the last index\n var lazyNodesAfterStoreEnd = this.nodeMap.filter(function (lazyNode) { return lazyNode.index >= _this.numberOfRows; });\n lazyNodesAfterStoreEnd.forEach(function (lazyNode) { return _this.destroyRowAtIndex(lazyNode.index); });\n }\n this.fireStoreUpdatedEvent();\n };\n LazyCache.prototype.fireRefreshFinishedEvent = function () {\n var _this = this;\n var finishedRefreshing = this.nodesToRefresh.size === 0;\n // if anything refreshing currently, skip.\n if (!finishedRefreshing) {\n return;\n }\n // any nodes left in the map need to be cleaned up, this prevents us preserving nodes\n // indefinitely\n this.removedNodeCache.forEach(function (node) {\n _this.blockUtils.destroyRowNode(node);\n });\n this.removedNodeCache = new Map();\n this.store.fireRefreshFinishedEvent();\n };\n LazyCache.prototype.isLastRowIndexKnown = function () {\n return this.isLastRowKnown;\n };\n LazyCache.prototype.onLoadFailed = function (firstRowIndex, numberOfRowsExpected) {\n var _a;\n if (!this.live)\n return;\n var wasRefreshing = this.nodesToRefresh.size > 0;\n for (var i = firstRowIndex; i < firstRowIndex + numberOfRowsExpected && i < this.getRowCount(); i++) {\n var node = ((_a = this.nodeMap.getBy('index', i)) !== null && _a !== void 0 ? _a : {}).node;\n if (node) {\n this.nodesToRefresh.delete(node);\n }\n if (!node || !node.stub) {\n if (node && !node.stub) {\n // if node is not a stub, we destroy it and recreate as nodes can't go from data to stub\n this.destroyRowAtIndex(i);\n }\n node = this.createRowAtIndex(i);\n }\n // this node has been refreshed, even if it wasn't successful\n node.__needsRefreshWhenVisible = false;\n node.failedLoad = true;\n }\n var finishedRefreshing = this.nodesToRefresh.size === 0;\n if (wasRefreshing && finishedRefreshing) {\n this.fireRefreshFinishedEvent();\n }\n this.fireStoreUpdatedEvent();\n };\n LazyCache.prototype.markNodesForRefresh = function () {\n var _this = this;\n this.nodeMap.forEach(function (lazyNode) {\n if (lazyNode.node.stub && !lazyNode.node.failedLoad) {\n return;\n }\n _this.nodesToRefresh.add(lazyNode.node);\n });\n this.rowLoader.queueLoadCheck();\n if (this.isLastRowKnown && this.numberOfRows === 0) {\n this.numberOfRows = 1;\n this.isLastRowKnown = false;\n this.fireStoreUpdatedEvent();\n }\n };\n LazyCache.prototype.isNodeInCache = function (id) {\n return !!this.nodeMap.getBy('id', id);\n };\n // gets called 1) row count changed 2) cache purged 3) items inserted\n LazyCache.prototype.fireStoreUpdatedEvent = function () {\n if (!this.live) {\n return;\n }\n this.store.fireStoreUpdatedEvent();\n };\n LazyCache.prototype.getRowId = function (data) {\n if (this.getRowIdFunc == null) {\n return null;\n }\n // find rowNode using id\n var level = this.store.getRowDetails().level;\n var parentKeys = this.store.getParentNode().getGroupKeys();\n var id = this.getRowIdFunc({\n data: data,\n parentKeys: parentKeys.length > 0 ? parentKeys : undefined,\n level: level,\n });\n return String(id);\n };\n LazyCache.prototype.updateRowNodes = function (updates) {\n var _this = this;\n if (this.getRowIdFunc == null) {\n // throw error, as this is type checked in the store. User likely abusing internal apis if here.\n throw new Error('AG Grid: Insert transactions can only be applied when row ids are supplied.');\n }\n var updatedNodes = [];\n updates.forEach(function (data) {\n var id = _this.getRowId(data);\n var lazyNode = _this.nodeMap.getBy('id', id);\n if (lazyNode) {\n _this.blockUtils.updateDataIntoRowNode(lazyNode.node, data);\n updatedNodes.push(lazyNode.node);\n }\n });\n return updatedNodes;\n };\n LazyCache.prototype.insertRowNodes = function (inserts, indexToAdd) {\n var _this = this;\n // if missing and we know the last row, we're inserting at the end\n var addIndex = indexToAdd == null && this.isLastRowKnown ? this.store.getRowCount() : indexToAdd;\n // can't insert nodes past the end of the store\n if (addIndex == null || this.store.getRowCount() < addIndex) {\n return [];\n }\n if (this.getRowIdFunc == null) {\n // throw error, as this is type checked in the store. User likely abusing internal apis if here.\n throw new Error('AG Grid: Insert transactions can only be applied when row ids are supplied.');\n }\n var uniqueInsertsMap = {};\n inserts.forEach(function (data) {\n var dataId = _this.getRowId(data);\n if (dataId && _this.isNodeInCache(dataId)) {\n return;\n }\n uniqueInsertsMap[dataId] = data;\n });\n var uniqueInserts = Object.values(uniqueInsertsMap);\n var numberOfInserts = uniqueInserts.length;\n if (numberOfInserts === 0) {\n return [];\n }\n var nodesToMove = this.nodeMap.filter(function (node) { return node.index >= addIndex; });\n // delete all nodes which need moved first, so they don't get overwritten\n nodesToMove.forEach(function (lazyNode) { return _this.nodeMap.delete(lazyNode); });\n // then move the nodes to their new locations\n nodesToMove.forEach(function (lazyNode) {\n _this.nodeMap.set({\n node: lazyNode.node,\n index: lazyNode.index + numberOfInserts,\n id: lazyNode.id,\n });\n });\n // increase the store size to accommodate\n this.numberOfRows += numberOfInserts;\n // finally insert the new rows\n return uniqueInserts.map(function (data, uniqueInsertOffset) { return _this.createRowAtIndex(addIndex + uniqueInsertOffset, data); });\n };\n LazyCache.prototype.getOrderedNodeMap = function () {\n var obj = {};\n this.nodeMap.forEach(function (node) { return obj[node.index] = node; });\n return obj;\n };\n LazyCache.prototype.clearDisplayIndexes = function () {\n this.nodeDisplayIndexMap.clear();\n };\n LazyCache.prototype.removeRowNodes = function (idsToRemove) {\n if (this.getRowIdFunc == null) {\n // throw error, as this is type checked in the store. User likely abusing internal apis if here.\n throw new Error('AG Grid: Insert transactions can only be applied when row ids are supplied.');\n }\n var removedNodes = [];\n var nodesToVerify = [];\n // track how many nodes have been deleted, as when we pass other nodes we need to shift them up\n var deletedNodeCount = 0;\n var remainingIdsToRemove = __spreadArray$4([], __read$6(idsToRemove));\n var allNodes = this.getOrderedNodeMap();\n var contiguousIndex = -1;\n var _loop_1 = function (stringIndex) {\n contiguousIndex += 1;\n var node = allNodes[stringIndex];\n // finding the index allows the use of splice which should be slightly faster than both a check and filter\n var matchIndex = remainingIdsToRemove.findIndex(function (idToRemove) { return idToRemove === node.id; });\n if (matchIndex !== -1) {\n // found node, remove it from nodes to remove\n remainingIdsToRemove.splice(matchIndex, 1);\n this_1.destroyRowAtIndex(Number(stringIndex));\n removedNodes.push(node.node);\n deletedNodeCount += 1;\n return \"continue\";\n }\n // no nodes removed and this node doesn't match, so no need to shift\n if (deletedNodeCount === 0) {\n return \"continue\";\n }\n var numericStoreIndex = Number(stringIndex);\n if (contiguousIndex !== numericStoreIndex) {\n nodesToVerify.push(node.node);\n }\n // shift normal node up by number of deleted prior to this point\n this_1.nodeMap.delete(allNodes[stringIndex]);\n this_1.nodeMap.set({\n id: node.id,\n node: node.node,\n index: numericStoreIndex - deletedNodeCount,\n });\n };\n var this_1 = this;\n for (var stringIndex in allNodes) {\n _loop_1(stringIndex);\n }\n this.numberOfRows -= this.isLastRowIndexKnown() ? idsToRemove.length : deletedNodeCount;\n if (remainingIdsToRemove.length > 0 && nodesToVerify.length > 0) {\n nodesToVerify.forEach(function (node) { return node.__needsRefreshWhenVisible = true; });\n this.rowLoader.queueLoadCheck();\n }\n return removedNodes;\n };\n __decorate$s([\n Autowired('gridApi')\n ], LazyCache.prototype, \"api\", void 0);\n __decorate$s([\n Autowired('ssrmBlockUtils')\n ], LazyCache.prototype, \"blockUtils\", void 0);\n __decorate$s([\n Autowired('focusService')\n ], LazyCache.prototype, \"focusService\", void 0);\n __decorate$s([\n Autowired('ssrmNodeManager')\n ], LazyCache.prototype, \"nodeManager\", void 0);\n __decorate$s([\n PostConstruct\n ], LazyCache.prototype, \"init\", null);\n __decorate$s([\n PreDestroy\n ], LazyCache.prototype, \"destroyRowNodes\", null);\n return LazyCache;\n}(BeanStub));\n\nvar __extends$t = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$r = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __read$5 = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray$3 = (undefined && undefined.__spreadArray) || function (to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\n to[j] = from[i];\n return to;\n};\nvar LazyStore = /** @class */ (function (_super) {\n __extends$t(LazyStore, _super);\n function LazyStore(ssrmParams, storeParams, parentRowNode) {\n var _this = _super.call(this) || this;\n _this.idSequence = new NumberSequence();\n _this.ssrmParams = ssrmParams;\n _this.parentRowNode = parentRowNode;\n _this.storeParams = storeParams;\n _this.level = parentRowNode.level + 1;\n _this.group = ssrmParams.rowGroupCols ? _this.level < ssrmParams.rowGroupCols.length : false;\n _this.leafGroup = ssrmParams.rowGroupCols ? _this.level === ssrmParams.rowGroupCols.length - 1 : false;\n _this.info = {};\n return _this;\n }\n LazyStore.prototype.init = function () {\n var numberOfRows = 1;\n if (this.level === 0) {\n numberOfRows = this.storeUtils.getServerSideInitialRowCount();\n }\n this.cache = this.createManagedBean(new LazyCache(this, numberOfRows, this.storeParams));\n var usingTreeData = this.gridOptionsService.isTreeData();\n if (!usingTreeData && this.group) {\n var groupColVo = this.ssrmParams.rowGroupCols[this.level];\n this.groupField = groupColVo.field;\n this.rowGroupColumn = this.columnModel.getRowGroupColumns()[this.level];\n }\n };\n LazyStore.prototype.destroyRowNodes = function () {\n this.displayIndexStart = undefined;\n this.displayIndexEnd = undefined;\n this.destroyBean(this.cache);\n };\n /**\n * Applies a given transaction to the data set within this store\n *\n * @param transaction an object containing delta instructions determining the changes to apply to this store\n * @returns an object determining the status of this transaction and effected nodes\n */\n LazyStore.prototype.applyTransaction = function (transaction) {\n var _this = this;\n var _a, _b, _c;\n var idFunc = this.gridOptionsService.getCallback('getRowId');\n if (!idFunc) {\n console.warn('AG Grid: getRowId callback must be implemented for transactions to work. Transaction was ignored.');\n return {\n status: ServerSideTransactionResultStatus.Cancelled,\n };\n }\n var applyCallback = this.gridOptionsService.getCallback('isApplyServerSideTransaction');\n if (applyCallback) {\n var params = {\n transaction: transaction,\n parentNode: this.parentRowNode,\n storeInfo: this.info,\n groupLevelInfo: this.info\n };\n var apply = applyCallback(params);\n if (!apply) {\n return { status: ServerSideTransactionResultStatus.Cancelled };\n }\n }\n var updatedNodes = undefined;\n if ((_a = transaction.update) === null || _a === void 0 ? void 0 : _a.length) {\n updatedNodes = this.cache.updateRowNodes(transaction.update);\n }\n var insertedNodes = undefined;\n if ((_b = transaction.add) === null || _b === void 0 ? void 0 : _b.length) {\n var addIndex = transaction.addIndex;\n if (addIndex != null && addIndex < 0) {\n addIndex = undefined;\n }\n insertedNodes = this.cache.insertRowNodes(transaction.add, addIndex);\n }\n var removedNodes = undefined;\n if ((_c = transaction.remove) === null || _c === void 0 ? void 0 : _c.length) {\n var allIdsToRemove = transaction.remove.map(function (data) { return (idFunc({ level: _this.level, parentKeys: _this.parentRowNode.getGroupKeys(), data: data })); });\n var allUniqueIdsToRemove = __spreadArray$3([], __read$5(new Set(allIdsToRemove)));\n removedNodes = this.cache.removeRowNodes(allUniqueIdsToRemove);\n }\n this.updateSelectionAfterTransaction(updatedNodes, removedNodes);\n return {\n status: ServerSideTransactionResultStatus.Applied,\n update: updatedNodes,\n add: insertedNodes,\n remove: removedNodes,\n };\n };\n LazyStore.prototype.updateSelectionAfterTransaction = function (updatedNodes, removedNodes) {\n var nodesToDeselect = [];\n updatedNodes === null || updatedNodes === void 0 ? void 0 : updatedNodes.forEach(function (node) {\n if (node.isSelected() && !node.selectable) {\n nodesToDeselect.push(node);\n }\n });\n removedNodes === null || removedNodes === void 0 ? void 0 : removedNodes.forEach(function (node) {\n if (node.isSelected()) {\n nodesToDeselect.push(node);\n }\n });\n if (nodesToDeselect.length) {\n this.selectionService.setNodesSelected({\n newValue: false,\n clearSelection: false,\n nodes: nodesToDeselect,\n source: 'rowDataChanged',\n });\n }\n };\n /**\n * Clear the display indexes, used for fading rows out when stores are not being destroyed\n */\n LazyStore.prototype.clearDisplayIndexes = function () {\n var _this = this;\n this.displayIndexStart = undefined;\n this.displayIndexEnd = undefined;\n this.cache.getNodes().forEach(function (lazyNode) { return _this.blockUtils.clearDisplayIndex(lazyNode.node); });\n if (this.parentRowNode.sibling) {\n this.blockUtils.clearDisplayIndex(this.parentRowNode.sibling);\n }\n this.cache.clearDisplayIndexes();\n };\n /**\n * @returns an index representing the last sequentially displayed row in the grid for this store\n */\n LazyStore.prototype.getDisplayIndexStart = function () {\n return this.displayIndexStart;\n };\n /**\n * @returns the index representing one after the last sequentially displayed row in the grid for this store\n */\n LazyStore.prototype.getDisplayIndexEnd = function () {\n return this.displayIndexEnd;\n };\n /**\n * @returns the virtual size of this store\n */\n LazyStore.prototype.getRowCount = function () {\n if (this.parentRowNode.sibling) {\n return this.cache.getRowCount() + 1;\n }\n return this.cache.getRowCount();\n };\n /**\n * Sets the current row count of the store, and whether the last row index is known\n */\n LazyStore.prototype.setRowCount = function (rowCount, isLastRowIndexKnown) {\n this.cache.setRowCount(rowCount, isLastRowIndexKnown);\n };\n /**\n * Given a display index, returns whether that row is within this store or a child store of this store\n *\n * @param displayIndex the visible index of a row\n * @returns whether or not the row exists within this store\n */\n LazyStore.prototype.isDisplayIndexInStore = function (displayIndex) {\n if (this.cache.getRowCount() === 0)\n return false;\n return this.displayIndexStart <= displayIndex && displayIndex < this.getDisplayIndexEnd();\n };\n /**\n * Recursively sets up the display indexes and top position of every node belonging to this store.\n *\n * Called after a row height changes, or a store updated event.\n *\n * @param displayIndexSeq the number sequence for generating the display index of each row\n * @param nextRowTop an object containing the next row top value intended to be modified by ref per row\n */\n LazyStore.prototype.setDisplayIndexes = function (displayIndexSeq, nextRowTop) {\n this.displayIndexStart = displayIndexSeq.peek();\n this.topPx = nextRowTop.value;\n // delegate to the store to set the row display indexes\n this.cache.setDisplayIndexes(displayIndexSeq, nextRowTop);\n if (this.parentRowNode.sibling) {\n this.blockUtils.setDisplayIndex(this.parentRowNode.sibling, displayIndexSeq, nextRowTop);\n }\n this.displayIndexEnd = displayIndexSeq.peek();\n this.heightPx = nextRowTop.value - this.topPx;\n };\n /**\n * Recursively applies a provided function to every node\n *\n * For the purpose of exclusively server side filtered stores, this is the same as getNodes().forEachDeepAfterFilterAndSort\n */\n LazyStore.prototype.forEachStoreDeep = function (callback, sequence) {\n if (sequence === void 0) { sequence = new NumberSequence(); }\n callback(this, sequence.next());\n this.cache.getNodes().forEach(function (lazyNode) {\n var childCache = lazyNode.node.childStore;\n if (childCache) {\n childCache.forEachStoreDeep(callback, sequence);\n }\n });\n };\n /**\n * Recursively applies a provided function to every node\n *\n * For the purpose of exclusively server side filtered stores, this is the same as getNodes().forEachDeepAfterFilterAndSort\n */\n LazyStore.prototype.forEachNodeDeep = function (callback, sequence) {\n if (sequence === void 0) { sequence = new NumberSequence(); }\n this.cache.getNodes().forEach(function (lazyNode) {\n callback(lazyNode.node, sequence.next());\n var childCache = lazyNode.node.childStore;\n if (childCache) {\n childCache.forEachNodeDeep(callback, sequence);\n }\n });\n };\n /**\n * Recursively applies a provided function to every node\n *\n * For the purpose of exclusively server side filtered stores, this is the same as getNodes().forEachDeep\n */\n LazyStore.prototype.forEachNodeDeepAfterFilterAndSort = function (callback, sequence) {\n if (sequence === void 0) { sequence = new NumberSequence(); }\n var orderedNodes = this.cache.getOrderedNodeMap();\n for (var key in orderedNodes) {\n var lazyNode = orderedNodes[key];\n callback(lazyNode.node, sequence.next());\n var childCache = lazyNode.node.childStore;\n if (childCache) {\n childCache.forEachNodeDeepAfterFilterAndSort(callback, sequence);\n }\n }\n };\n /**\n * Removes the failed status from all nodes, and marks them as stub to encourage reloading\n */\n LazyStore.prototype.retryLoads = function () {\n this.cache.getNodes().forEach(function (_a) {\n var node = _a.node;\n if (node.failedLoad) {\n node.failedLoad = false;\n node.__needsRefreshWhenVisible = true;\n node.stub = true;\n }\n });\n this.forEachChildStoreShallow(function (store) { return store.retryLoads(); });\n this.fireStoreUpdatedEvent();\n };\n /**\n * Given a display index, returns the row at that location.\n *\n * @param displayRowIndex the displayed index within the grid to search for\n * @returns the row node if the display index falls within the store, if it didn't exist this will create a new stub to return\n */\n LazyStore.prototype.getRowUsingDisplayIndex = function (displayRowIndex) {\n if (this.parentRowNode.sibling && displayRowIndex === this.parentRowNode.sibling.rowIndex) {\n return this.parentRowNode.sibling;\n }\n return this.cache.getRowByDisplayIndex(displayRowIndex);\n };\n /**\n * Given a display index, returns the row top and height for the row at that index.\n *\n * @param displayIndex the display index of the node\n * @returns an object containing the rowTop and rowHeight of the node at the given displayIndex\n */\n LazyStore.prototype.getRowBounds = function (displayIndex) {\n var _a;\n if (!this.isDisplayIndexInStore(displayIndex)) {\n return null;\n }\n var thisNode = this.cache.getNodeCachedByDisplayIndex(displayIndex);\n if (thisNode) {\n var boundsFromRow = this.blockUtils.extractRowBounds(thisNode, displayIndex);\n if (boundsFromRow) {\n return boundsFromRow;\n }\n }\n var _b = (_a = this.cache.getSurroundingNodesByDisplayIndex(displayIndex)) !== null && _a !== void 0 ? _a : {}, previousNode = _b.previousNode, nextNode = _b.nextNode;\n // previous node may equal, or catch via detail node or child of group\n if (previousNode) {\n var boundsFromRow = this.blockUtils.extractRowBounds(previousNode.node, displayIndex);\n if (boundsFromRow != null) {\n return boundsFromRow;\n }\n }\n var defaultRowHeight = this.gridOptionsService.getRowHeightAsNumber();\n // if node after this, can calculate backwards (and ignore detail/grouping)\n if (nextNode) {\n var numberOfRowDiff_1 = (nextNode.node.rowIndex - displayIndex) * defaultRowHeight;\n return {\n rowTop: nextNode.node.rowTop - numberOfRowDiff_1,\n rowHeight: defaultRowHeight,\n };\n }\n // otherwise calculate from end of store\n var lastTop = this.topPx + this.heightPx;\n var numberOfRowDiff = (this.getDisplayIndexEnd() - displayIndex) * defaultRowHeight;\n return {\n rowTop: lastTop - numberOfRowDiff,\n rowHeight: defaultRowHeight,\n };\n };\n /**\n * Given a vertical pixel, determines whether this store contains a row at that pixel\n *\n * @param pixel a vertical pixel position from the grid\n * @returns whether that pixel points to a virtual space belonging to this store\n */\n LazyStore.prototype.isPixelInRange = function (pixel) {\n return pixel >= this.topPx && pixel < (this.topPx + this.heightPx);\n };\n /**\n * Given a vertical pixel, returns the row existing at that pixel location\n *\n * @param pixel a vertical pixel position from the grid\n * @returns the display index at the given pixel location\n */\n LazyStore.prototype.getRowIndexAtPixel = function (pixel) {\n if (pixel < this.topPx) {\n return this.getDisplayIndexStart();\n }\n if (pixel >= this.topPx + this.heightPx) {\n return this.getDisplayIndexEnd() - 1;\n }\n var distToPreviousNodeTop = Number.MAX_SAFE_INTEGER;\n var previousNode = null;\n var distToNextNodeTop = Number.MAX_SAFE_INTEGER;\n var nextNode = null;\n this.cache.getNodes().forEach(function (_a) {\n var node = _a.node;\n var distBetween = Math.abs(pixel - node.rowTop);\n // previous node\n if (node.rowTop < pixel) {\n if (distBetween < distToPreviousNodeTop) {\n distToPreviousNodeTop = distBetween;\n previousNode = node;\n }\n return;\n }\n // next node\n if (distBetween < distToNextNodeTop) {\n distToNextNodeTop = distBetween;\n nextNode = node;\n }\n });\n // cast these back as typescript doesn't understand the forEach above\n previousNode = previousNode;\n nextNode = nextNode;\n // previous node may equal, or catch via detail node or child of group\n if (previousNode) {\n var indexOfRow = this.blockUtils.getIndexAtPixel(previousNode, pixel);\n if (indexOfRow != null) {\n return indexOfRow;\n }\n }\n var defaultRowHeight = this.gridOptionsService.getRowHeightAsNumber();\n // if node after this, can calculate backwards (and ignore detail/grouping)\n if (nextNode) {\n var nextTop_1 = nextNode.rowTop;\n var numberOfRowDiff_2 = Math.ceil((nextTop_1 - pixel) / defaultRowHeight);\n return nextNode.rowIndex - numberOfRowDiff_2;\n }\n // otherwise calculate from end of store\n var nextTop = this.topPx + this.heightPx;\n var numberOfRowDiff = Math.floor((nextTop - pixel) / defaultRowHeight);\n return this.getDisplayIndexEnd() - numberOfRowDiff;\n };\n /**\n * Given a path of group keys, returns the child store for that group.\n *\n * @param keys the grouping path to the desired store\n * @returns the child store for the given keys, or null if not found\n */\n LazyStore.prototype.getChildStore = function (keys) {\n var _this = this;\n return this.storeUtils.getChildStore(keys, this, function (key) {\n var lazyNode = _this.cache.getNodes().find(function (lazyNode) { return lazyNode.node.key == key; });\n if (!lazyNode) {\n return null;\n }\n return lazyNode.node;\n });\n };\n /**\n * Executes a provided callback on each child store belonging to this store\n *\n * @param cb the callback to execute\n */\n LazyStore.prototype.forEachChildStoreShallow = function (cb) {\n this.cache.getNodes().forEach(function (_a) {\n var node = _a.node;\n if (node.childStore) {\n cb(node.childStore);\n }\n });\n };\n /**\n * Executes after a change to sorting, determines recursively whether this store or a child requires refreshed.\n *\n * If a purge refresh occurs, the row count is preserved.\n *\n * @param params a set of properties pertaining to the sort changes\n */\n LazyStore.prototype.refreshAfterSort = function (params) {\n var serverSortsAllLevels = this.storeUtils.isServerSideSortAllLevels();\n if (serverSortsAllLevels || this.storeUtils.isServerRefreshNeeded(this.parentRowNode, this.ssrmParams.rowGroupCols, params)) {\n var oldCount = this.cache.getRowCount();\n this.destroyBean(this.cache);\n this.cache = this.createManagedBean(new LazyCache(this, oldCount, this.storeParams));\n this.fireStoreUpdatedEvent();\n return;\n }\n // call refreshAfterSort on children, as we did not purge.\n // if we did purge, no need to do this as all children were destroyed\n this.forEachChildStoreShallow(function (store) { return store.refreshAfterSort(params); });\n };\n /**\n * Executes after a change to filtering, determines recursively whether this store or a child requires refreshed.\n *\n * If a refresh occurs, the row count is reset.\n *\n * @param params a set of properties pertaining to the filter changes\n */\n LazyStore.prototype.refreshAfterFilter = function (params) {\n var serverFiltersAllLevels = !this.storeUtils.isServerSideOnlyRefreshFilteredGroups();\n if (serverFiltersAllLevels || this.storeUtils.isServerRefreshNeeded(this.parentRowNode, this.ssrmParams.rowGroupCols, params)) {\n this.refreshStore(true);\n return;\n }\n // call refreshAfterSort on children, as we did not purge.\n // if we did purge, no need to do this as all children were destroyed\n this.forEachChildStoreShallow(function (store) { return store.refreshAfterFilter(params); });\n };\n /**\n * Marks all existing nodes as requiring reloaded, and triggers a load check\n *\n * @param purge whether to remove all nodes and data in favour of stub nodes\n */\n LazyStore.prototype.refreshStore = function (purge) {\n if (purge) {\n this.destroyBean(this.cache);\n this.cache = this.createManagedBean(new LazyCache(this, 1, this.storeParams));\n this.fireStoreUpdatedEvent();\n return;\n }\n this.cache.markNodesForRefresh();\n };\n /**\n * Used for pagination, given a local/store index, returns the display index of that row\n *\n * @param topLevelIndex the store index of a row\n * @returns the display index for the given store index\n */\n LazyStore.prototype.getTopLevelRowDisplayedIndex = function (topLevelIndex) {\n var displayIndex = this.cache.getDisplayIndexFromStoreIndex(topLevelIndex);\n return displayIndex !== null && displayIndex !== void 0 ? displayIndex : topLevelIndex;\n };\n /**\n * Used for pagination to determine if the last page is known, and for aria to determine if the last grid row is known\n *\n * @returns whether the last index of this store is known, or if lazy loading still required\n */\n LazyStore.prototype.isLastRowIndexKnown = function () {\n return this.cache.isLastRowIndexKnown();\n };\n /**\n * Used by the selection service to select a range of nodes\n *\n * @param firstInRange the first node in the range to find\n * @param lastInRange the last node in the range to find\n * @returns a range of nodes between firstInRange and lastInRange inclusive\n */\n LazyStore.prototype.getRowNodesInRange = function (firstInRange, lastInRange) {\n // if only one node passed, we start the selection at the top\n if (_.missing(firstInRange)) ;\n return this.cache.getNodes().filter(function (_a) {\n var node = _a.node;\n return node.rowIndex >= firstInRange.rowIndex && node.rowIndex <= lastInRange.rowIndex;\n }).map(function (_a) {\n var node = _a.node;\n return node;\n });\n };\n /**\n * Mutates a given array to add this stores state, and recursively add all the children store states.\n *\n * @param result a mutable results array\n */\n LazyStore.prototype.addStoreStates = function (result) {\n result.push({\n suppressInfiniteScroll: false,\n route: this.parentRowNode.getGroupKeys(),\n rowCount: this.getRowCount(),\n lastRowIndexKnown: this.isLastRowIndexKnown(),\n info: this.info,\n maxBlocksInCache: this.storeParams.maxBlocksInCache,\n cacheBlockSize: this.storeParams.cacheBlockSize,\n });\n this.forEachChildStoreShallow(function (childStore) { return childStore.addStoreStates(result); });\n };\n LazyStore.prototype.getIdSequence = function () {\n return this.idSequence;\n };\n LazyStore.prototype.getParentNode = function () {\n return this.parentRowNode;\n };\n LazyStore.prototype.getRowDetails = function () {\n return {\n field: this.groupField,\n group: this.group,\n leafGroup: this.leafGroup,\n level: this.level,\n parent: this.parentRowNode,\n rowGroupColumn: this.rowGroupColumn,\n };\n };\n LazyStore.prototype.getSsrmParams = function () {\n return this.ssrmParams;\n };\n LazyStore.prototype.setStoreInfo = function (info) {\n if (info) {\n Object.assign(this.info, info);\n }\n };\n // gets called 1) row count changed 2) cache purged\n LazyStore.prototype.fireStoreUpdatedEvent = function () {\n // this results in row model firing ModelUpdated.\n // server side row model also updates the row indexes first\n var event = {\n type: Events.EVENT_STORE_UPDATED\n };\n this.eventService.dispatchEvent(event);\n };\n // gets called when row data updated, and no more refreshing needed\n LazyStore.prototype.fireRefreshFinishedEvent = function () {\n var event = {\n type: Events.EVENT_STORE_REFRESHED,\n route: this.parentRowNode.getRoute(),\n };\n this.eventService.dispatchEvent(event);\n };\n LazyStore.prototype.getBlockStates = function () {\n return this.cache.getBlockStates();\n };\n LazyStore.prototype.getStoreBounds = function () {\n return {\n topPx: this.topPx,\n heightPx: this.heightPx,\n };\n };\n __decorate$r([\n Autowired('ssrmBlockUtils')\n ], LazyStore.prototype, \"blockUtils\", void 0);\n __decorate$r([\n Autowired('ssrmStoreUtils')\n ], LazyStore.prototype, \"storeUtils\", void 0);\n __decorate$r([\n Autowired('columnModel')\n ], LazyStore.prototype, \"columnModel\", void 0);\n __decorate$r([\n Autowired('selectionService')\n ], LazyStore.prototype, \"selectionService\", void 0);\n __decorate$r([\n PostConstruct\n ], LazyStore.prototype, \"init\", null);\n __decorate$r([\n PreDestroy\n ], LazyStore.prototype, \"destroyRowNodes\", null);\n return LazyStore;\n}(BeanStub));\n\nvar __extends$s = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$q = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __read$4 = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar ServerSideRowModel = /** @class */ (function (_super) {\n __extends$s(ServerSideRowModel, _super);\n function ServerSideRowModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.onRowHeightChanged_debounced = _.debounce(_this.onRowHeightChanged.bind(_this), 100);\n _this.pauseStoreUpdateListening = false;\n _this.started = false;\n return _this;\n }\n // we don't implement as lazy row heights is not supported in this row model\n ServerSideRowModel.prototype.ensureRowHeightsValid = function () { return false; };\n ServerSideRowModel.prototype.start = function () {\n this.started = true;\n var datasource = this.gridOptionsService.get('serverSideDatasource');\n if (datasource) {\n this.setDatasource(datasource);\n }\n };\n ServerSideRowModel.prototype.destroyDatasource = function () {\n if (!this.datasource) {\n return;\n }\n if (this.datasource.destroy) {\n this.datasource.destroy();\n }\n this.rowRenderer.datasourceChanged();\n this.datasource = undefined;\n };\n ServerSideRowModel.prototype.addEventListeners = function () {\n this.addManagedListener(this.eventService, Events.EVENT_NEW_COLUMNS_LOADED, this.onColumnEverything.bind(this));\n this.addManagedListener(this.eventService, Events.EVENT_STORE_UPDATED, this.onStoreUpdated.bind(this));\n var resetListener = this.resetRootStore.bind(this);\n this.addManagedListener(this.eventService, Events.EVENT_COLUMN_VALUE_CHANGED, resetListener);\n this.addManagedListener(this.eventService, Events.EVENT_COLUMN_PIVOT_CHANGED, resetListener);\n this.addManagedListener(this.eventService, Events.EVENT_COLUMN_ROW_GROUP_CHANGED, resetListener);\n this.addManagedListener(this.eventService, Events.EVENT_COLUMN_PIVOT_MODE_CHANGED, resetListener);\n this.verifyProps();\n };\n ServerSideRowModel.prototype.verifyProps = function () {\n if (this.gridOptionsService.exists('initialGroupOrderComparator')) {\n var message_1 = \"AG Grid: initialGroupOrderComparator cannot be used with Server Side Row Model. If using Full Store, then provide the rows to the grid in the desired sort order. If using Infinite Scroll, then sorting is done on the server side, nothing to do with the client.\";\n _.doOnce(function () { return console.warn(message_1); }, 'SSRM.InitialGroupOrderComparator');\n }\n if (this.gridOptionsService.isRowSelection() && !this.gridOptionsService.exists('getRowId')) {\n var message_2 = \"AG Grid: getRowId callback must be provided for Server Side Row Model selection to work correctly.\";\n _.doOnce(function () { return console.warn(message_2); }, 'SSRM.SelectionNeedsRowNodeIdFunc');\n }\n };\n ServerSideRowModel.prototype.setDatasource = function (datasource) {\n // sometimes React, due to async, can call gridApi.setDatasource() before we have started.\n // this happens when React app does this:\n // useEffect(() => setDatasource(ds), []);\n // thus if we set the datasource before the grid UI has finished initialising, we do not set it,\n // and the ssrm.start() method will set the datasoure when the grid is ready.\n if (!this.started) {\n return;\n }\n this.destroyDatasource();\n this.datasource = datasource;\n this.resetRootStore();\n };\n ServerSideRowModel.prototype.isLastRowIndexKnown = function () {\n var cache = this.getRootStore();\n if (!cache) {\n return false;\n }\n return cache.isLastRowIndexKnown();\n };\n ServerSideRowModel.prototype.onColumnEverything = function () {\n // if first time, always reset\n if (!this.storeParams) {\n this.resetRootStore();\n return;\n }\n // check if anything pertaining to fetching data has changed, and if it has, reset, but if\n // it has not, don't reset\n var rowGroupColumnVos = this.columnsToValueObjects(this.columnModel.getRowGroupColumns());\n var valueColumnVos = this.columnsToValueObjects(this.columnModel.getValueColumns());\n var pivotColumnVos = this.columnsToValueObjects(this.columnModel.getPivotColumns());\n // compares two sets of columns, ensuring no columns have been added or removed (unless specified via allowRemovedColumns)\n // if the columns are found, also ensures the field and aggFunc properties have not been changed.\n var areColsSame = function (params) {\n var oldColsMap = {};\n params.oldCols.forEach(function (col) { return oldColsMap[col.id] = col; });\n var allColsUnchanged = params.newCols.every(function (col) {\n var equivalentCol = oldColsMap[col.id];\n if (equivalentCol) {\n delete oldColsMap[col.id];\n }\n return equivalentCol && equivalentCol.field === col.field && equivalentCol.aggFunc === col.aggFunc;\n });\n var missingCols = !params.allowRemovedColumns && !!Object.values(oldColsMap).length;\n return allColsUnchanged && !missingCols;\n };\n var sortModelDifferent = !_.jsonEquals(this.storeParams.sortModel, this.sortListener.extractSortModel());\n var rowGroupDifferent = !areColsSame({\n oldCols: this.storeParams.rowGroupCols,\n newCols: rowGroupColumnVos,\n });\n var pivotDifferent = !areColsSame({\n oldCols: this.storeParams.pivotCols,\n newCols: pivotColumnVos,\n });\n var valuesDifferent = !!(rowGroupColumnVos === null || rowGroupColumnVos === void 0 ? void 0 : rowGroupColumnVos.length) && !areColsSame({\n oldCols: this.storeParams.valueCols,\n newCols: valueColumnVos,\n allowRemovedColumns: true,\n });\n var resetRequired = sortModelDifferent || rowGroupDifferent || pivotDifferent || valuesDifferent;\n if (resetRequired) {\n this.resetRootStore();\n }\n else {\n // cols may have changed even if we didn't do a reset. storeParams ref will be provided when getRows\n // is called, so it's important to keep it up to date.\n var newParams = this.createStoreParams();\n this.storeParams.rowGroupCols = newParams.rowGroupCols;\n this.storeParams.pivotCols = newParams.pivotCols;\n this.storeParams.valueCols = newParams.valueCols;\n }\n };\n ServerSideRowModel.prototype.destroyRootStore = function () {\n if (!this.rootNode || !this.rootNode.childStore) {\n return;\n }\n this.rootNode.childStore = this.destroyBean(this.rootNode.childStore);\n this.nodeManager.clear();\n };\n ServerSideRowModel.prototype.refreshAfterSort = function (newSortModel, params) {\n if (this.storeParams) {\n this.storeParams.sortModel = newSortModel;\n }\n var rootStore = this.getRootStore();\n if (!rootStore) {\n return;\n }\n rootStore.refreshAfterSort(params);\n this.onStoreUpdated();\n };\n ServerSideRowModel.prototype.resetRootStore = function () {\n this.destroyRootStore();\n this.rootNode = new RowNode(this.beans);\n this.rootNode.group = true;\n this.rootNode.level = -1;\n if (this.datasource) {\n this.storeParams = this.createStoreParams();\n this.rootNode.childStore = this.createBean(this.storeFactory.createStore(this.storeParams, this.rootNode));\n this.updateRowIndexesAndBounds();\n }\n // this event shows/hides 'no rows' overlay\n var rowDataChangedEvent = {\n type: Events.EVENT_ROW_DATA_UPDATED\n };\n this.eventService.dispatchEvent(rowDataChangedEvent);\n // this gets the row to render rows (or remove the previously rendered rows, as it's blank to start).\n // important to NOT pass in an event with keepRenderedRows or animate, as we want the renderer\n // to treat the rows as new rows, as it's all new data\n this.dispatchModelUpdated(true);\n };\n ServerSideRowModel.prototype.columnsToValueObjects = function (columns) {\n var _this = this;\n return columns.map(function (col) { return ({\n id: col.getId(),\n aggFunc: col.getAggFunc(),\n displayName: _this.columnModel.getDisplayNameForColumn(col, 'model'),\n field: col.getColDef().field\n }); });\n };\n ServerSideRowModel.prototype.createStoreParams = function () {\n var rowGroupColumnVos = this.columnsToValueObjects(this.columnModel.getRowGroupColumns());\n var valueColumnVos = this.columnsToValueObjects(this.columnModel.getValueColumns());\n var pivotColumnVos = this.columnsToValueObjects(this.columnModel.getPivotColumns());\n var dynamicRowHeight = this.gridOptionsService.isGetRowHeightFunction();\n var params = {\n // the columns the user has grouped and aggregated by\n valueCols: valueColumnVos,\n rowGroupCols: rowGroupColumnVos,\n pivotCols: pivotColumnVos,\n pivotMode: this.columnModel.isPivotMode(),\n // sort and filter model\n filterModel: this.filterManager.getFilterModel(),\n sortModel: this.sortListener.extractSortModel(),\n datasource: this.datasource,\n lastAccessedSequence: new NumberSequence(),\n // blockSize: blockSize == null ? 100 : blockSize,\n dynamicRowHeight: dynamicRowHeight\n };\n return params;\n };\n ServerSideRowModel.prototype.getParams = function () {\n return this.storeParams;\n };\n ServerSideRowModel.prototype.dispatchModelUpdated = function (reset) {\n if (reset === void 0) { reset = false; }\n var modelUpdatedEvent = {\n type: Events.EVENT_MODEL_UPDATED,\n animate: !reset,\n keepRenderedRows: !reset,\n newPage: false,\n newData: false\n };\n this.eventService.dispatchEvent(modelUpdatedEvent);\n };\n ServerSideRowModel.prototype.onStoreUpdated = function () {\n // sometimes if doing a batch update, we do the batch first,\n // then call onStoreUpdated manually. eg expandAll() method.\n if (this.pauseStoreUpdateListening) {\n return;\n }\n this.updateRowIndexesAndBounds();\n this.dispatchModelUpdated();\n };\n /** This method is debounced. It is used for row auto-height. If we don't debounce,\n * then the Row Models will end up recalculating each row position\n * for each row height change and result in the Row Renderer laying out rows.\n * This is particularly bad if using print layout, and showing eg 1,000 rows,\n * each row will change it's height, causing Row Model to update 1,000 times.\n */\n ServerSideRowModel.prototype.onRowHeightChangedDebounced = function () {\n this.onRowHeightChanged_debounced();\n };\n ServerSideRowModel.prototype.onRowHeightChanged = function () {\n this.updateRowIndexesAndBounds();\n this.dispatchModelUpdated();\n };\n ServerSideRowModel.prototype.updateRowIndexesAndBounds = function () {\n var rootStore = this.getRootStore();\n if (!rootStore) {\n return;\n }\n rootStore.setDisplayIndexes(new NumberSequence(), { value: 0 });\n };\n ServerSideRowModel.prototype.retryLoads = function () {\n var rootStore = this.getRootStore();\n if (!rootStore) {\n return;\n }\n rootStore.retryLoads();\n this.onStoreUpdated();\n };\n ServerSideRowModel.prototype.getRow = function (index) {\n var rootStore = this.getRootStore();\n if (!rootStore) {\n return undefined;\n }\n return rootStore.getRowUsingDisplayIndex(index);\n };\n ServerSideRowModel.prototype.expandAll = function (value) {\n // if we don't pause store updating, we are needlessly\n // recalculating row-indexes etc, and also getting rendering\n // engine to re-render (listens on ModelUpdated event)\n this.pauseStoreUpdateListening = true;\n this.forEachNode(function (node) {\n if (node.stub) {\n return;\n }\n if (node.hasChildren()) {\n node.setExpanded(value);\n }\n });\n this.pauseStoreUpdateListening = false;\n this.onStoreUpdated();\n };\n ServerSideRowModel.prototype.refreshAfterFilter = function (newFilterModel, params) {\n if (this.storeParams) {\n this.storeParams.filterModel = newFilterModel;\n }\n var rootStore = this.getRootStore();\n if (!rootStore) {\n return;\n }\n rootStore.refreshAfterFilter(params);\n this.onStoreUpdated();\n };\n ServerSideRowModel.prototype.getRootStore = function () {\n if (this.rootNode && this.rootNode.childStore) {\n return this.rootNode.childStore;\n }\n };\n ServerSideRowModel.prototype.getRowCount = function () {\n var rootStore = this.getRootStore();\n if (!rootStore) {\n return 0;\n }\n return rootStore.getDisplayIndexEnd();\n };\n ServerSideRowModel.prototype.getTopLevelRowCount = function () {\n var rootStore = this.getRootStore();\n if (!rootStore) {\n return 1;\n }\n return rootStore.getRowCount();\n };\n ServerSideRowModel.prototype.getTopLevelRowDisplayedIndex = function (topLevelIndex) {\n var rootStore = this.getRootStore();\n if (!rootStore) {\n return topLevelIndex;\n }\n return rootStore.getTopLevelRowDisplayedIndex(topLevelIndex);\n };\n ServerSideRowModel.prototype.getRowBounds = function (index) {\n var rootStore = this.getRootStore();\n if (!rootStore) {\n var rowHeight = this.gridOptionsService.getRowHeightAsNumber();\n return {\n rowTop: 0,\n rowHeight: rowHeight\n };\n }\n return rootStore.getRowBounds(index);\n };\n ServerSideRowModel.prototype.getBlockStates = function () {\n var root = this.getRootStore();\n if (!root) {\n return undefined;\n }\n var states = {};\n root.forEachStoreDeep(function (store) {\n if (store instanceof FullStore) {\n var _a = store.getBlockStateJson(), id = _a.id, state = _a.state;\n states[id] = state;\n }\n else if (store instanceof LazyStore) {\n Object.entries(store.getBlockStates()).forEach(function (_a) {\n var _b = __read$4(_a, 2), block = _b[0], state = _b[1];\n states[block] = state;\n });\n }\n else {\n throw new Error('AG Grid: Unsupported store type');\n }\n });\n return states;\n };\n ServerSideRowModel.prototype.getRowIndexAtPixel = function (pixel) {\n var rootStore = this.getRootStore();\n if (pixel <= 0 || !rootStore) {\n return 0;\n }\n return rootStore.getRowIndexAtPixel(pixel);\n };\n ServerSideRowModel.prototype.isEmpty = function () {\n return false;\n };\n ServerSideRowModel.prototype.isRowsToRender = function () {\n return this.getRootStore() != null && this.getRowCount() > 0;\n };\n ServerSideRowModel.prototype.getType = function () {\n return 'serverSide';\n };\n ServerSideRowModel.prototype.forEachNode = function (callback) {\n var rootStore = this.getRootStore();\n if (!rootStore) {\n return;\n }\n rootStore.forEachNodeDeep(callback);\n };\n ServerSideRowModel.prototype.forEachNodeAfterFilterAndSort = function (callback) {\n var rootStore = this.getRootStore();\n if (!rootStore) {\n return;\n }\n rootStore.forEachNodeDeepAfterFilterAndSort(callback);\n };\n ServerSideRowModel.prototype.executeOnStore = function (route, callback) {\n var rootStore = this.getRootStore();\n if (!rootStore) {\n return;\n }\n var storeToExecuteOn = rootStore.getChildStore(route);\n if (storeToExecuteOn) {\n callback(storeToExecuteOn);\n }\n };\n ServerSideRowModel.prototype.refreshStore = function (params) {\n if (params === void 0) { params = {}; }\n var route = params.route ? params.route : [];\n this.executeOnStore(route, function (store) { return store.refreshStore(params.purge == true); });\n };\n ServerSideRowModel.prototype.getStoreState = function () {\n var res = [];\n var rootStore = this.getRootStore();\n if (rootStore) {\n rootStore.addStoreStates(res);\n }\n return res;\n };\n ServerSideRowModel.prototype.getNodesInRangeForSelection = function (firstInRange, lastInRange) {\n if (!_.exists(firstInRange)) {\n return [];\n }\n if (!lastInRange) {\n return [firstInRange];\n }\n var startIndex = firstInRange.rowIndex;\n var endIndex = lastInRange.rowIndex;\n if (startIndex === null || endIndex === null) {\n return [firstInRange];\n }\n var nodeRange = [];\n var _a = __read$4([startIndex, endIndex].sort(function (a, b) { return a - b; }), 2), firstIndex = _a[0], lastIndex = _a[1];\n this.forEachNode(function (node) {\n var thisRowIndex = node.rowIndex;\n if (thisRowIndex == null || node.stub) {\n return;\n }\n if (thisRowIndex >= firstIndex && thisRowIndex <= lastIndex) {\n nodeRange.push(node);\n }\n });\n // don't allow range selection if we don't have the full range of rows\n if (nodeRange.length !== (lastIndex - firstIndex + 1)) {\n return [firstInRange];\n }\n return nodeRange;\n };\n ServerSideRowModel.prototype.getRowNode = function (id) {\n var result;\n this.forEachNode(function (rowNode) {\n if (rowNode.id === id) {\n result = rowNode;\n }\n if (rowNode.detailNode && rowNode.detailNode.id === id) {\n result = rowNode.detailNode;\n }\n });\n return result;\n };\n ServerSideRowModel.prototype.isRowPresent = function (rowNode) {\n var foundRowNode = this.getRowNode(rowNode.id);\n return !!foundRowNode;\n };\n ServerSideRowModel.prototype.setRowCount = function (rowCount, lastRowIndexKnown) {\n var rootStore = this.getRootStore();\n if (rootStore) {\n if (rootStore instanceof LazyStore) {\n rootStore.setRowCount(rowCount, lastRowIndexKnown);\n return;\n }\n console.error('AG Grid: Infinite scrolling must be enabled in order to set the row count.');\n }\n };\n __decorate$q([\n Autowired('columnModel')\n ], ServerSideRowModel.prototype, \"columnModel\", void 0);\n __decorate$q([\n Autowired('filterManager')\n ], ServerSideRowModel.prototype, \"filterManager\", void 0);\n __decorate$q([\n Autowired('rowRenderer')\n ], ServerSideRowModel.prototype, \"rowRenderer\", void 0);\n __decorate$q([\n Autowired('ssrmSortService')\n ], ServerSideRowModel.prototype, \"sortListener\", void 0);\n __decorate$q([\n Autowired('ssrmNodeManager')\n ], ServerSideRowModel.prototype, \"nodeManager\", void 0);\n __decorate$q([\n Autowired('ssrmStoreFactory')\n ], ServerSideRowModel.prototype, \"storeFactory\", void 0);\n __decorate$q([\n Autowired('beans')\n ], ServerSideRowModel.prototype, \"beans\", void 0);\n __decorate$q([\n PreDestroy\n ], ServerSideRowModel.prototype, \"destroyDatasource\", null);\n __decorate$q([\n PostConstruct\n ], ServerSideRowModel.prototype, \"addEventListeners\", null);\n __decorate$q([\n PreDestroy\n ], ServerSideRowModel.prototype, \"destroyRootStore\", null);\n ServerSideRowModel = __decorate$q([\n Bean('rowModel')\n ], ServerSideRowModel);\n return ServerSideRowModel;\n}(BeanStub));\n\nvar __extends$r = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$p = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar StoreUtils = /** @class */ (function (_super) {\n __extends$r(StoreUtils, _super);\n function StoreUtils() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n StoreUtils.prototype.loadFromDatasource = function (p) {\n var storeParams = p.storeParams, parentBlock = p.parentBlock, parentNode = p.parentNode;\n var groupKeys = parentNode.getGroupKeys();\n if (!storeParams.datasource) {\n return;\n }\n var request = {\n startRow: p.startRow,\n endRow: p.endRow,\n rowGroupCols: storeParams.rowGroupCols,\n valueCols: storeParams.valueCols,\n pivotCols: storeParams.pivotCols,\n pivotMode: storeParams.pivotMode,\n groupKeys: groupKeys,\n filterModel: storeParams.filterModel,\n sortModel: storeParams.sortModel\n };\n var getRowsParams = {\n successCallback: p.successCallback,\n success: p.success,\n failCallback: p.failCallback,\n fail: p.fail,\n request: request,\n parentNode: p.parentNode,\n api: this.gridApi,\n columnApi: this.columnApi,\n context: this.gridOptionsService.context\n };\n window.setTimeout(function () {\n if (!storeParams.datasource || !parentBlock.isAlive()) {\n // failCallback() is important, to reduce the 'RowNodeBlockLoader.activeBlockLoadsCount' count\n p.failCallback();\n return;\n }\n storeParams.datasource.getRows(getRowsParams);\n }, 0);\n };\n StoreUtils.prototype.getChildStore = function (keys, currentCache, findNodeFunc) {\n if (_.missingOrEmpty(keys)) {\n return currentCache;\n }\n var nextKey = keys[0];\n var nextNode = findNodeFunc(nextKey);\n if (nextNode) {\n var keyListForNextLevel = keys.slice(1, keys.length);\n var nextStore = nextNode.childStore;\n return nextStore ? nextStore.getChildStore(keyListForNextLevel) : null;\n }\n return null;\n };\n StoreUtils.prototype.isServerRefreshNeeded = function (parentRowNode, rowGroupCols, params) {\n if (params.valueColChanged || params.secondaryColChanged) {\n return true;\n }\n var level = parentRowNode.level + 1;\n var grouping = level < rowGroupCols.length;\n var leafNodes = !grouping;\n if (leafNodes) {\n return true;\n }\n var colIdThisGroup = rowGroupCols[level].id;\n var actionOnThisGroup = params.changedColumns.indexOf(colIdThisGroup) > -1;\n if (actionOnThisGroup) {\n return true;\n }\n var allCols = this.columnModel.getAllGridColumns();\n var affectedGroupCols = allCols\n // find all impacted cols which also a group display column\n .filter(function (col) { return col.getColDef().showRowGroup && params.changedColumns.includes(col.getId()); })\n .map(function (col) { return col.getColDef().showRowGroup; })\n // if displaying all groups, or displaying the effected col for this group, refresh\n .some(function (group) { return group === true || group === colIdThisGroup; });\n return affectedGroupCols;\n };\n StoreUtils.prototype.getServerSideInitialRowCount = function () {\n var rowCount = this.gridOptionsService.getNum('serverSideInitialRowCount');\n if (typeof rowCount === 'number' && rowCount > 0) {\n return rowCount;\n }\n return 1;\n };\n StoreUtils.prototype.assertRowModelIsServerSide = function (key) {\n if (!this.gridOptionsService.isRowModelType('serverSide')) {\n _.doOnce(function () { return console.warn(\"AG Grid: The '\" + key + \"' property can only be used with the Server Side Row Model.\"); }, key);\n return false;\n }\n return true;\n };\n StoreUtils.prototype.assertNotTreeData = function (key) {\n if (this.gridOptionsService.is('treeData')) {\n _.doOnce(function () { return console.warn(\"AG Grid: The '\" + key + \"' property cannot be used while using tree data.\"); }, key + '_TreeData');\n return false;\n }\n return true;\n };\n StoreUtils.prototype.isServerSideSortAllLevels = function () {\n return this.gridOptionsService.is('serverSideSortAllLevels') && this.assertRowModelIsServerSide('serverSideSortAllLevels');\n };\n StoreUtils.prototype.isServerSideOnlyRefreshFilteredGroups = function () {\n return this.gridOptionsService.is('serverSideOnlyRefreshFilteredGroups') && this.assertRowModelIsServerSide('serverSideOnlyRefreshFilteredGroups');\n };\n StoreUtils.prototype.isServerSideSortOnServer = function () {\n return this.gridOptionsService.is('serverSideSortOnServer') && this.assertRowModelIsServerSide('serverSideSortOnServer') && this.assertNotTreeData('serverSideSortOnServer');\n };\n StoreUtils.prototype.isServerSideFilterOnServer = function () {\n return this.gridOptionsService.is('serverSideFilterOnServer') && this.assertRowModelIsServerSide('serverSideFilterOnServer') && this.assertNotTreeData('serverSideFilterOnServer');\n };\n __decorate$p([\n Autowired('columnApi')\n ], StoreUtils.prototype, \"columnApi\", void 0);\n __decorate$p([\n Autowired('columnModel')\n ], StoreUtils.prototype, \"columnModel\", void 0);\n __decorate$p([\n Autowired('gridApi')\n ], StoreUtils.prototype, \"gridApi\", void 0);\n StoreUtils = __decorate$p([\n Bean('ssrmStoreUtils')\n ], StoreUtils);\n return StoreUtils;\n}(BeanStub));\n\nvar __extends$q = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$o = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar GROUP_MISSING_KEY_ID = 'ag-Grid-MissingKey';\nvar BlockUtils = /** @class */ (function (_super) {\n __extends$q(BlockUtils, _super);\n function BlockUtils() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n BlockUtils.prototype.postConstruct = function () {\n this.rowHeight = this.gridOptionsService.getRowHeightAsNumber();\n this.usingTreeData = this.gridOptionsService.isTreeData();\n this.usingMasterDetail = this.gridOptionsService.isMasterDetail();\n };\n BlockUtils.prototype.createRowNode = function (params) {\n var rowNode = new RowNode(this.beans);\n var rowHeight = params.rowHeight != null ? params.rowHeight : this.rowHeight;\n rowNode.setRowHeight(rowHeight);\n rowNode.group = params.group;\n rowNode.leafGroup = params.leafGroup;\n rowNode.level = params.level;\n rowNode.uiLevel = params.level;\n rowNode.parent = params.parent;\n // stub gets set to true here, and then false when this rowNode gets it's data\n rowNode.stub = true;\n rowNode.__needsRefreshWhenVisible = false;\n if (rowNode.group) {\n rowNode.expanded = false;\n rowNode.field = params.field;\n rowNode.rowGroupColumn = params.rowGroupColumn;\n }\n return rowNode;\n };\n BlockUtils.prototype.destroyRowNodes = function (rowNodes) {\n var _this = this;\n if (rowNodes) {\n rowNodes.forEach(function (row) { return _this.destroyRowNode(row); });\n }\n };\n BlockUtils.prototype.destroyRowNode = function (rowNode, preserveStore) {\n if (preserveStore === void 0) { preserveStore = false; }\n if (rowNode.childStore && !preserveStore) {\n this.destroyBean(rowNode.childStore);\n rowNode.childStore = null;\n }\n if (rowNode.sibling) {\n this.destroyRowNode(rowNode.sibling, false);\n }\n // this is needed, so row render knows to fade out the row, otherwise it\n // sees row top is present, and thinks the row should be shown. maybe\n // rowNode should have a flag on whether it is visible???\n rowNode.clearRowTopAndRowIndex();\n if (rowNode.id != null) {\n this.nodeManager.removeNode(rowNode);\n }\n };\n BlockUtils.prototype.setTreeGroupInfo = function (rowNode) {\n rowNode.updateHasChildren();\n var getKeyFunc = this.gridOptionsService.get('getServerSideGroupKey');\n if (rowNode.hasChildren() && getKeyFunc != null) {\n rowNode.key = getKeyFunc(rowNode.data);\n }\n if (!rowNode.hasChildren() && rowNode.childStore != null) {\n this.destroyBean(rowNode.childStore);\n rowNode.childStore = null;\n rowNode.expanded = false;\n }\n };\n BlockUtils.prototype.setRowGroupInfo = function (rowNode) {\n rowNode.key = this.valueService.getValue(rowNode.rowGroupColumn, rowNode);\n if (rowNode.key === null || rowNode.key === undefined) {\n _.doOnce(function () {\n console.warn(\"AG Grid: null and undefined values are not allowed for server side row model keys\");\n if (rowNode.rowGroupColumn) {\n console.warn(\"column = \" + rowNode.rowGroupColumn.getId());\n }\n console.warn(\"data is \", rowNode.data);\n }, 'ServerSideBlock-CannotHaveNullOrUndefinedForKey');\n }\n if (this.beans.gridOptionsService.is('groupIncludeFooter')) {\n rowNode.createFooter();\n if (rowNode.sibling) {\n rowNode.sibling.uiLevel = rowNode.uiLevel + 1;\n }\n }\n };\n BlockUtils.prototype.setMasterDetailInfo = function (rowNode) {\n var isMasterFunc = this.gridOptionsService.get('isRowMaster');\n if (isMasterFunc != null) {\n rowNode.master = isMasterFunc(rowNode.data);\n }\n else {\n rowNode.master = true;\n }\n };\n BlockUtils.prototype.updateDataIntoRowNode = function (rowNode, data) {\n rowNode.updateData(data);\n if (this.usingTreeData) {\n this.setTreeGroupInfo(rowNode);\n this.setChildCountIntoRowNode(rowNode);\n }\n else if (rowNode.group) {\n this.setChildCountIntoRowNode(rowNode);\n // it's not possible for a node to change whether it's a group or not\n // when doing row grouping (as only rows at certain levels are groups),\n // so nothing to do here\n }\n else if (this.usingMasterDetail) ;\n };\n BlockUtils.prototype.setDataIntoRowNode = function (rowNode, data, defaultId, cachedRowHeight) {\n var _a;\n rowNode.stub = false;\n if (_.exists(data)) {\n rowNode.setDataAndId(data, defaultId);\n if (this.usingTreeData) {\n this.setTreeGroupInfo(rowNode);\n }\n else if (rowNode.group) {\n this.setRowGroupInfo(rowNode);\n }\n else if (this.usingMasterDetail) {\n this.setMasterDetailInfo(rowNode);\n }\n }\n else {\n rowNode.setDataAndId(undefined, undefined);\n rowNode.key = null;\n }\n if (this.usingTreeData || rowNode.group) {\n this.setGroupDataIntoRowNode(rowNode);\n this.setChildCountIntoRowNode(rowNode);\n }\n // this needs to be done AFTER setGroupDataIntoRowNode(), as the height can depend on the group data\n // getting set, if it's a group node and colDef.autoHeight=true\n if (_.exists(data)) {\n rowNode.setRowHeight(this.gridOptionsService.getRowHeightForNode(rowNode, false, cachedRowHeight).height);\n (_a = rowNode.sibling) === null || _a === void 0 ? void 0 : _a.setRowHeight(this.gridOptionsService.getRowHeightForNode(rowNode.sibling, false, cachedRowHeight).height);\n }\n };\n BlockUtils.prototype.setChildCountIntoRowNode = function (rowNode) {\n var getChildCount = this.gridOptionsService.get('getChildCount');\n if (getChildCount) {\n rowNode.setAllChildrenCount(getChildCount(rowNode.data));\n }\n };\n BlockUtils.prototype.setGroupDataIntoRowNode = function (rowNode) {\n var _this = this;\n var groupDisplayCols = this.columnModel.getGroupDisplayColumns();\n var usingTreeData = this.gridOptionsService.isTreeData();\n groupDisplayCols.forEach(function (col) {\n if (rowNode.groupData == null) {\n rowNode.groupData = {};\n }\n if (usingTreeData) {\n rowNode.groupData[col.getColId()] = rowNode.key;\n }\n else if (col.isRowGroupDisplayed(rowNode.rowGroupColumn.getId())) {\n var groupValue = _this.valueService.getValue(rowNode.rowGroupColumn, rowNode);\n rowNode.groupData[col.getColId()] = groupValue;\n }\n });\n };\n BlockUtils.prototype.clearDisplayIndex = function (rowNode) {\n rowNode.clearRowTopAndRowIndex();\n var hasChildStore = rowNode.hasChildren() && _.exists(rowNode.childStore);\n if (hasChildStore) {\n var childStore = rowNode.childStore;\n childStore.clearDisplayIndexes();\n }\n var hasDetailNode = rowNode.master && rowNode.detailNode;\n if (hasDetailNode) {\n rowNode.detailNode.clearRowTopAndRowIndex();\n }\n };\n BlockUtils.prototype.setDisplayIndex = function (rowNode, displayIndexSeq, nextRowTop) {\n // set this row\n rowNode.setRowIndex(displayIndexSeq.next());\n rowNode.setRowTop(nextRowTop.value);\n nextRowTop.value += rowNode.rowHeight;\n // set child for master / detail\n var hasDetailRow = rowNode.master;\n if (hasDetailRow) {\n if (rowNode.expanded && rowNode.detailNode) {\n rowNode.detailNode.setRowIndex(displayIndexSeq.next());\n rowNode.detailNode.setRowTop(nextRowTop.value);\n nextRowTop.value += rowNode.detailNode.rowHeight;\n }\n else if (rowNode.detailNode) {\n rowNode.detailNode.clearRowTopAndRowIndex();\n }\n }\n // set children for SSRM child rows\n var hasChildStore = rowNode.hasChildren() && _.exists(rowNode.childStore);\n if (hasChildStore) {\n var childStore = rowNode.childStore;\n if (rowNode.expanded) {\n childStore.setDisplayIndexes(displayIndexSeq, nextRowTop);\n }\n else {\n // we need to clear the row tops, as the row renderer depends on\n // this to know if the row should be faded out\n childStore.clearDisplayIndexes();\n }\n }\n };\n BlockUtils.prototype.binarySearchForDisplayIndex = function (displayRowIndex, rowNodes) {\n var bottomPointer = 0;\n var topPointer = rowNodes.length - 1;\n if (_.missing(topPointer) || _.missing(bottomPointer)) {\n console.warn(\"AG Grid: error: topPointer = \" + topPointer + \", bottomPointer = \" + bottomPointer);\n return undefined;\n }\n while (true) {\n var midPointer = Math.floor((bottomPointer + topPointer) / 2);\n var currentRowNode = rowNodes[midPointer];\n // first check current row for index\n if (currentRowNode.rowIndex === displayRowIndex) {\n return currentRowNode;\n }\n // then check if current row contains a detail row with the index\n var expandedMasterRow = currentRowNode.master && currentRowNode.expanded;\n var detailNode = currentRowNode.detailNode;\n if (expandedMasterRow && detailNode && detailNode.rowIndex === displayRowIndex) {\n return currentRowNode.detailNode;\n }\n // then check if child cache contains index\n var childStore = currentRowNode.childStore;\n if (currentRowNode.expanded && childStore && childStore.isDisplayIndexInStore(displayRowIndex)) {\n return childStore.getRowUsingDisplayIndex(displayRowIndex);\n }\n // otherwise adjust pointers to continue searching for index\n if (currentRowNode.rowIndex < displayRowIndex) {\n bottomPointer = midPointer + 1;\n }\n else if (currentRowNode.rowIndex > displayRowIndex) {\n topPointer = midPointer - 1;\n }\n else {\n console.warn(\"AG Grid: error: unable to locate rowIndex = \" + displayRowIndex + \" in cache\");\n return undefined;\n }\n }\n };\n BlockUtils.prototype.extractRowBounds = function (rowNode, index) {\n var extractRowBounds = function (currentRowNode) { return ({\n rowHeight: currentRowNode.rowHeight,\n rowTop: currentRowNode.rowTop\n }); };\n if (rowNode.rowIndex === index) {\n return extractRowBounds(rowNode);\n }\n if (rowNode.hasChildren() && rowNode.expanded && _.exists(rowNode.childStore)) {\n var childStore = rowNode.childStore;\n if (childStore.isDisplayIndexInStore(index)) {\n return childStore.getRowBounds(index);\n }\n }\n else if (rowNode.master && rowNode.expanded && _.exists(rowNode.detailNode)) {\n if (rowNode.detailNode.rowIndex === index) {\n return extractRowBounds(rowNode.detailNode);\n }\n }\n };\n BlockUtils.prototype.getIndexAtPixel = function (rowNode, pixel) {\n // first check if pixel is in range of current row\n if (rowNode.isPixelInRange(pixel)) {\n return rowNode.rowIndex;\n }\n // then check if current row contains a detail row with pixel in range\n var expandedMasterRow = rowNode.master && rowNode.expanded;\n var detailNode = rowNode.detailNode;\n if (expandedMasterRow && detailNode && detailNode.isPixelInRange(pixel)) {\n return rowNode.detailNode.rowIndex;\n }\n // then check if it's a group row with a child cache with pixel in range\n if (rowNode.hasChildren() && rowNode.expanded && _.exists(rowNode.childStore)) {\n var childStore = rowNode.childStore;\n if (childStore.isPixelInRange(pixel)) {\n return childStore.getRowIndexAtPixel(pixel);\n }\n }\n return null;\n // pixel is not within this row node or it's children / detail, so return undefined\n };\n BlockUtils.prototype.createNodeIdPrefix = function (parentRowNode) {\n var parts = [];\n var rowNode = parentRowNode;\n // pull keys from all parent nodes, but do not include the root node\n while (rowNode && rowNode.level >= 0) {\n if (rowNode.key === '') {\n parts.push(GROUP_MISSING_KEY_ID);\n }\n else {\n parts.push(rowNode.key);\n }\n rowNode = rowNode.parent;\n }\n if (parts.length > 0) {\n return parts.reverse().join('-');\n }\n // no prefix, so node id's are left as they are\n return undefined;\n };\n BlockUtils.prototype.checkOpenByDefault = function (rowNode) {\n if (!rowNode.isExpandable()) {\n return;\n }\n var userFunc = this.gridOptionsService.getCallback('isServerSideGroupOpenByDefault');\n if (!userFunc) {\n return;\n }\n var params = {\n data: rowNode.data,\n rowNode: rowNode\n };\n var userFuncRes = userFunc(params);\n if (userFuncRes) {\n // we do this in a timeout, so that we don't expand a row node while in the middle\n // of setting up rows, setting up rows is complex enough without another chunk of work\n // getting added to the call stack. this is also helpful as openByDefault may or may\n // not happen (so makes setting up rows more deterministic by expands never happening)\n // and also checkOpenByDefault is shard with both store types, so easier control how it\n // impacts things by keeping it in new VM turn.\n window.setTimeout(function () { return rowNode.setExpanded(true); }, 0);\n }\n };\n __decorate$o([\n Autowired('valueService')\n ], BlockUtils.prototype, \"valueService\", void 0);\n __decorate$o([\n Autowired('columnModel')\n ], BlockUtils.prototype, \"columnModel\", void 0);\n __decorate$o([\n Autowired('ssrmNodeManager')\n ], BlockUtils.prototype, \"nodeManager\", void 0);\n __decorate$o([\n Autowired('beans')\n ], BlockUtils.prototype, \"beans\", void 0);\n __decorate$o([\n PostConstruct\n ], BlockUtils.prototype, \"postConstruct\", null);\n BlockUtils = __decorate$o([\n Bean('ssrmBlockUtils')\n ], BlockUtils);\n return BlockUtils;\n}(BeanStub));\n\nvar __decorate$n = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar NodeManager = /** @class */ (function () {\n function NodeManager() {\n this.rowNodes = {};\n }\n NodeManager.prototype.addRowNode = function (rowNode) {\n var id = rowNode.id;\n if (this.rowNodes[id]) {\n console.warn(\"AG Grid: Duplicate node id \" + rowNode.id + \". Row ID's are provided via the getRowId() callback. Please modify the getRowId() callback code to provide unique row id values.\");\n console.warn('first instance', this.rowNodes[id].data);\n console.warn('second instance', rowNode.data);\n }\n this.rowNodes[id] = rowNode;\n };\n NodeManager.prototype.removeNode = function (rowNode) {\n var id = rowNode.id;\n if (this.rowNodes[id]) {\n this.rowNodes[id] = undefined;\n }\n };\n NodeManager.prototype.clear = function () {\n this.rowNodes = {};\n };\n __decorate$n([\n PreDestroy\n ], NodeManager.prototype, \"clear\", null);\n NodeManager = __decorate$n([\n Bean('ssrmNodeManager')\n ], NodeManager);\n return NodeManager;\n}());\n\nvar __extends$p = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$m = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar TransactionManager = /** @class */ (function (_super) {\n __extends$p(TransactionManager, _super);\n function TransactionManager() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.asyncTransactions = [];\n return _this;\n }\n TransactionManager.prototype.postConstruct = function () {\n // only want to be active if SSRM active, otherwise would be interfering with other row models\n if (!this.gridOptionsService.isRowModelType('serverSide')) {\n return;\n }\n };\n TransactionManager.prototype.applyTransactionAsync = function (transaction, callback) {\n if (this.asyncTransactionsTimeout == null) {\n this.scheduleExecuteAsync();\n }\n this.asyncTransactions.push({ transaction: transaction, callback: callback });\n };\n TransactionManager.prototype.scheduleExecuteAsync = function () {\n var _this = this;\n var waitMillis = this.gridOptionsService.getAsyncTransactionWaitMillis();\n this.asyncTransactionsTimeout = window.setTimeout(function () {\n _this.executeAsyncTransactions();\n }, waitMillis);\n };\n TransactionManager.prototype.executeAsyncTransactions = function () {\n var _this = this;\n if (!this.asyncTransactions) {\n return;\n }\n var resultFuncs = [];\n var resultsForEvent = [];\n var transactionsToRetry = [];\n var atLeastOneTransactionApplied = false;\n this.asyncTransactions.forEach(function (txWrapper) {\n var result;\n _this.serverSideRowModel.executeOnStore(txWrapper.transaction.route, function (cache) {\n result = cache.applyTransaction(txWrapper.transaction);\n });\n if (result == undefined) {\n result = { status: ServerSideTransactionResultStatus.StoreNotFound };\n }\n resultsForEvent.push(result);\n var retryTransaction = result.status == ServerSideTransactionResultStatus.StoreLoading;\n if (retryTransaction) {\n transactionsToRetry.push(txWrapper);\n return;\n }\n if (txWrapper.callback) {\n resultFuncs.push(function () { return txWrapper.callback(result); });\n }\n if (result.status === ServerSideTransactionResultStatus.Applied) {\n atLeastOneTransactionApplied = true;\n }\n });\n // do callbacks in next VM turn so it's async\n if (resultFuncs.length > 0) {\n window.setTimeout(function () {\n resultFuncs.forEach(function (func) { return func(); });\n }, 0);\n }\n this.asyncTransactionsTimeout = undefined;\n // this will be empty list if nothing to retry\n this.asyncTransactions = transactionsToRetry;\n if (atLeastOneTransactionApplied) {\n this.valueCache.onDataChanged();\n this.eventService.dispatchEvent({ type: Events.EVENT_STORE_UPDATED });\n }\n if (resultsForEvent.length > 0) {\n var event_1 = {\n type: Events.EVENT_ASYNC_TRANSACTIONS_FLUSHED,\n results: resultsForEvent\n };\n this.eventService.dispatchEvent(event_1);\n }\n };\n TransactionManager.prototype.flushAsyncTransactions = function () {\n // the timeout could be missing, if we are flushing due to row data loaded\n if (this.asyncTransactionsTimeout != null) {\n clearTimeout(this.asyncTransactionsTimeout);\n }\n this.executeAsyncTransactions();\n };\n TransactionManager.prototype.applyTransaction = function (transaction) {\n var res;\n this.serverSideRowModel.executeOnStore(transaction.route, function (store) {\n res = store.applyTransaction(transaction);\n });\n if (res) {\n this.valueCache.onDataChanged();\n if (res.remove) {\n var removedRowIds = res.remove.map(function (row) { return row.id; });\n this.selectionService.deleteSelectionStateFromParent(transaction.route || [], removedRowIds);\n }\n this.eventService.dispatchEvent({ type: Events.EVENT_STORE_UPDATED });\n return res;\n }\n else {\n return { status: ServerSideTransactionResultStatus.StoreNotFound };\n }\n };\n __decorate$m([\n Autowired('rowNodeBlockLoader')\n ], TransactionManager.prototype, \"rowNodeBlockLoader\", void 0);\n __decorate$m([\n Autowired('valueCache')\n ], TransactionManager.prototype, \"valueCache\", void 0);\n __decorate$m([\n Autowired('rowModel')\n ], TransactionManager.prototype, \"serverSideRowModel\", void 0);\n __decorate$m([\n Autowired('rowRenderer')\n ], TransactionManager.prototype, \"rowRenderer\", void 0);\n __decorate$m([\n Autowired('selectionService')\n ], TransactionManager.prototype, \"selectionService\", void 0);\n __decorate$m([\n PostConstruct\n ], TransactionManager.prototype, \"postConstruct\", null);\n TransactionManager = __decorate$m([\n Bean('ssrmTransactionManager')\n ], TransactionManager);\n return TransactionManager;\n}(BeanStub));\n\nvar __extends$o = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$l = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar ExpandListener = /** @class */ (function (_super) {\n __extends$o(ExpandListener, _super);\n function ExpandListener() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n ExpandListener.prototype.postConstruct = function () {\n // only want to be active if SSRM active, otherwise would be interfering with other row models\n if (!this.gridOptionsService.isRowModelType('serverSide')) {\n return;\n }\n this.addManagedListener(this.eventService, Events.EVENT_ROW_GROUP_OPENED, this.onRowGroupOpened.bind(this));\n };\n ExpandListener.prototype.onRowGroupOpened = function (event) {\n var rowNode = event.node;\n if (rowNode.expanded) {\n if (rowNode.master) {\n this.createDetailNode(rowNode);\n }\n else if (_.missing(rowNode.childStore)) {\n var storeParams = this.serverSideRowModel.getParams();\n rowNode.childStore = this.createBean(this.storeFactory.createStore(storeParams, rowNode));\n }\n }\n else if (this.gridOptionsService.is('purgeClosedRowNodes') && _.exists(rowNode.childStore)) {\n rowNode.childStore = this.destroyBean(rowNode.childStore);\n }\n var storeUpdatedEvent = { type: Events.EVENT_STORE_UPDATED };\n this.eventService.dispatchEvent(storeUpdatedEvent);\n };\n ExpandListener.prototype.createDetailNode = function (masterNode) {\n if (_.exists(masterNode.detailNode)) {\n return masterNode.detailNode;\n }\n var detailNode = new RowNode(this.beans);\n detailNode.detail = true;\n detailNode.selectable = false;\n detailNode.parent = masterNode;\n if (_.exists(masterNode.id)) {\n detailNode.id = 'detail_' + masterNode.id;\n }\n detailNode.data = masterNode.data;\n detailNode.level = masterNode.level + 1;\n var defaultDetailRowHeight = 200;\n var rowHeight = this.gridOptionsService.getRowHeightForNode(detailNode).height;\n detailNode.rowHeight = rowHeight ? rowHeight : defaultDetailRowHeight;\n masterNode.detailNode = detailNode;\n return detailNode;\n };\n __decorate$l([\n Autowired('rowModel')\n ], ExpandListener.prototype, \"serverSideRowModel\", void 0);\n __decorate$l([\n Autowired('ssrmStoreFactory')\n ], ExpandListener.prototype, \"storeFactory\", void 0);\n __decorate$l([\n Autowired('beans')\n ], ExpandListener.prototype, \"beans\", void 0);\n __decorate$l([\n PostConstruct\n ], ExpandListener.prototype, \"postConstruct\", null);\n ExpandListener = __decorate$l([\n Bean('ssrmExpandListener')\n ], ExpandListener);\n return ExpandListener;\n}(BeanStub));\n\nvar __extends$n = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$k = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar SortListener = /** @class */ (function (_super) {\n __extends$n(SortListener, _super);\n function SortListener() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n SortListener.prototype.postConstruct = function () {\n // only want to be active if SSRM active, otherwise would be interfering with other row models\n if (!this.gridOptionsService.isRowModelType('serverSide')) {\n return;\n }\n this.addManagedListener(this.eventService, Events.EVENT_SORT_CHANGED, this.onSortChanged.bind(this));\n };\n SortListener.prototype.extractSortModel = function () {\n var sortModel = this.sortController.getSortModel();\n // when using tree data we just return the sort model with the 'ag-Grid-AutoColumn' as is, i.e not broken out\n // into it's constitute group columns as they are not defined up front and can vary per node.\n if (this.gridOptionsService.isTreeData()) {\n return sortModel;\n }\n // it autoCol is active, we don't want to send this to the server. instead we want to\n // send the\n this.replaceAutoGroupColumnWithActualRowGroupColumns(sortModel);\n this.removeMultiColumnPrefixOnColumnIds(sortModel);\n return sortModel;\n };\n SortListener.prototype.removeMultiColumnPrefixOnColumnIds = function (sortModel) {\n if (this.gridOptionsService.isGroupMultiAutoColumn()) {\n var multiColumnPrefix = GROUP_AUTO_COLUMN_ID + \"-\";\n for (var i = 0; i < sortModel.length; ++i) {\n if (sortModel[i].colId.indexOf(multiColumnPrefix) > -1) {\n sortModel[i].colId = sortModel[i].colId.substr(multiColumnPrefix.length);\n }\n }\n }\n };\n SortListener.prototype.replaceAutoGroupColumnWithActualRowGroupColumns = function (sortModel) {\n // find index of auto group column in sort model\n var autoGroupSortModel = sortModel.find(function (sm) { return sm.colId == GROUP_AUTO_COLUMN_ID; });\n // replace auto column with individual group columns\n if (autoGroupSortModel) {\n // remove auto group column\n var autoGroupIndex = sortModel.indexOf(autoGroupSortModel);\n _.removeFromArray(sortModel, autoGroupSortModel);\n var isNotInSortModel = function (col) { return sortModel.filter(function (sm) { return sm.colId === col.getColId(); }).length == 0; };\n var mapColumnToSortModel = function (col) { return ({ colId: col.getId(), sort: autoGroupSortModel.sort }); };\n var newModels = this.columnModel.getRowGroupColumns()\n .filter(isNotInSortModel)\n .map(mapColumnToSortModel);\n _.insertArrayIntoArray(sortModel, newModels, autoGroupIndex);\n }\n };\n SortListener.prototype.onSortChanged = function () {\n var storeParams = this.serverSideRowModel.getParams();\n if (!storeParams) {\n return;\n } // params is undefined if no datasource set\n var newSortModel = this.extractSortModel();\n var oldSortModel = storeParams.sortModel;\n var changedColumns = this.findChangedColumnsInSort(newSortModel, oldSortModel);\n var valueColChanged = this.listenerUtils.isSortingWithValueColumn(changedColumns);\n var secondaryColChanged = this.listenerUtils.isSortingWithSecondaryColumn(changedColumns);\n var params = {\n valueColChanged: valueColChanged,\n secondaryColChanged: secondaryColChanged,\n changedColumns: changedColumns\n };\n this.serverSideRowModel.refreshAfterSort(newSortModel, params);\n };\n // returns back all the cols that were effected by the sorting. eg if we were sorting by col A,\n // and now we are sorting by col B, the list of impacted cols should be A and B. so if a cache\n // is impacted by sorting on A or B then it needs to be refreshed. this includes where the cache\n // was previously sorted by A and then the A sort now needs to be cleared.\n SortListener.prototype.findChangedColumnsInSort = function (newSortModel, oldSortModel) {\n var allColsInBothSorts = [];\n [newSortModel, oldSortModel].forEach(function (sortModel) {\n if (sortModel) {\n var ids = sortModel.map(function (sm) { return sm.colId; });\n allColsInBothSorts = allColsInBothSorts.concat(ids);\n }\n });\n var differentSorts = function (oldSortItem, newSortItem) {\n var oldSort = oldSortItem ? oldSortItem.sort : null;\n var newSort = newSortItem ? newSortItem.sort : null;\n return oldSort !== newSort;\n };\n var differentIndexes = function (oldSortItem, newSortItem) {\n var oldIndex = oldSortItem ? oldSortModel.indexOf(oldSortItem) : -1;\n var newIndex = newSortItem ? newSortModel.indexOf(newSortItem) : -1;\n return oldIndex !== newIndex;\n };\n return allColsInBothSorts.filter(function (colId) {\n var oldSortItem = oldSortModel.find(function (sm) { return sm.colId === colId; });\n var newSortItem = newSortModel.find(function (sm) { return sm.colId === colId; });\n return differentSorts(oldSortItem, newSortItem) || differentIndexes(oldSortItem, newSortItem);\n });\n };\n __decorate$k([\n Autowired('sortController')\n ], SortListener.prototype, \"sortController\", void 0);\n __decorate$k([\n Autowired('columnModel')\n ], SortListener.prototype, \"columnModel\", void 0);\n __decorate$k([\n Autowired('rowModel')\n ], SortListener.prototype, \"serverSideRowModel\", void 0);\n __decorate$k([\n Autowired('ssrmListenerUtils')\n ], SortListener.prototype, \"listenerUtils\", void 0);\n __decorate$k([\n PostConstruct\n ], SortListener.prototype, \"postConstruct\", null);\n SortListener = __decorate$k([\n Bean('ssrmSortService')\n ], SortListener);\n return SortListener;\n}(BeanStub));\n\nvar __extends$m = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$j = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar FilterListener = /** @class */ (function (_super) {\n __extends$m(FilterListener, _super);\n function FilterListener() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n FilterListener.prototype.postConstruct = function () {\n // only want to be active if SSRM active, otherwise would be interfering with other row models\n if (!this.gridOptionsService.isRowModelType('serverSide')) {\n return;\n }\n this.addManagedListener(this.eventService, Events.EVENT_FILTER_CHANGED, this.onFilterChanged.bind(this));\n };\n FilterListener.prototype.onFilterChanged = function () {\n var storeParams = this.serverSideRowModel.getParams();\n if (!storeParams) {\n return;\n } // params is undefined if no datasource set\n var newModel = this.filterManager.getFilterModel();\n var oldModel = storeParams ? storeParams.filterModel : {};\n var changedColumns = this.findChangedColumns(newModel, oldModel);\n var valueColChanged = this.listenerUtils.isSortingWithValueColumn(changedColumns);\n var secondaryColChanged = this.listenerUtils.isSortingWithSecondaryColumn(changedColumns);\n var params = {\n valueColChanged: valueColChanged,\n secondaryColChanged: secondaryColChanged,\n changedColumns: changedColumns\n };\n this.serverSideRowModel.refreshAfterFilter(newModel, params);\n };\n FilterListener.prototype.findChangedColumns = function (oldModel, newModel) {\n var allColKeysMap = {};\n Object.keys(oldModel).forEach(function (key) { return allColKeysMap[key] = true; });\n Object.keys(newModel).forEach(function (key) { return allColKeysMap[key] = true; });\n var res = [];\n Object.keys(allColKeysMap).forEach(function (key) {\n var oldJson = JSON.stringify(oldModel[key]);\n var newJson = JSON.stringify(newModel[key]);\n var filterChanged = oldJson != newJson;\n if (filterChanged) {\n res.push(key);\n }\n });\n return res;\n };\n __decorate$j([\n Autowired('rowModel')\n ], FilterListener.prototype, \"serverSideRowModel\", void 0);\n __decorate$j([\n Autowired('filterManager')\n ], FilterListener.prototype, \"filterManager\", void 0);\n __decorate$j([\n Autowired('ssrmListenerUtils')\n ], FilterListener.prototype, \"listenerUtils\", void 0);\n __decorate$j([\n PostConstruct\n ], FilterListener.prototype, \"postConstruct\", null);\n FilterListener = __decorate$j([\n Bean('ssrmFilterListener')\n ], FilterListener);\n return FilterListener;\n}(BeanStub));\n\nvar __decorate$i = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar StoreFactory = /** @class */ (function () {\n function StoreFactory() {\n }\n StoreFactory.prototype.createStore = function (ssrmParams, parentNode) {\n var storeParams = this.getStoreParams(ssrmParams, parentNode);\n var CacheClass = storeParams.suppressInfiniteScroll ? FullStore : LazyStore;\n return new CacheClass(ssrmParams, storeParams, parentNode);\n };\n StoreFactory.prototype.getStoreParams = function (ssrmParams, parentNode) {\n var userStoreParams = this.getLevelSpecificParams(parentNode);\n // if user provided overrideParams, we take infiniteScroll from there if it exists\n var infiniteScroll = this.isInfiniteScroll(userStoreParams);\n var cacheBlockSize = this.getBlockSize(infiniteScroll, userStoreParams);\n var maxBlocksInCache = this.getMaxBlocksInCache(infiniteScroll, ssrmParams, userStoreParams);\n var storeParams = {\n suppressInfiniteScroll: !infiniteScroll,\n cacheBlockSize: cacheBlockSize,\n maxBlocksInCache: maxBlocksInCache\n };\n return storeParams;\n };\n StoreFactory.prototype.getMaxBlocksInCache = function (infiniteScroll, ssrmParams, userStoreParams) {\n if (!infiniteScroll) {\n return undefined;\n }\n var maxBlocksInCache = (userStoreParams && userStoreParams.maxBlocksInCache != null)\n ? userStoreParams.maxBlocksInCache\n : this.gridOptionsService.getNum('maxBlocksInCache');\n var maxBlocksActive = maxBlocksInCache != null && maxBlocksInCache >= 0;\n if (!maxBlocksActive) {\n return undefined;\n }\n if (ssrmParams.dynamicRowHeight) {\n var message_1 = 'AG Grid: Server Side Row Model does not support Dynamic Row Height and Cache Purging. ' +\n 'Either a) remove getRowHeight() callback or b) remove maxBlocksInCache property. Purging has been disabled.';\n _.doOnce(function () { return console.warn(message_1); }, 'storeFactory.maxBlocksInCache.dynamicRowHeight');\n return undefined;\n }\n if (this.columnModel.isAutoRowHeightActive()) {\n var message_2 = 'AG Grid: Server Side Row Model does not support Auto Row Height and Cache Purging. ' +\n 'Either a) remove colDef.autoHeight or b) remove maxBlocksInCache property. Purging has been disabled.';\n _.doOnce(function () { return console.warn(message_2); }, 'storeFactory.maxBlocksInCache.autoRowHeightActive');\n return undefined;\n }\n return maxBlocksInCache;\n };\n StoreFactory.prototype.getBlockSize = function (infiniteScroll, userStoreParams) {\n if (!infiniteScroll) {\n return undefined;\n }\n var blockSize = (userStoreParams && userStoreParams.cacheBlockSize != null)\n ? userStoreParams.cacheBlockSize\n : this.gridOptionsService.getNum('cacheBlockSize');\n if (blockSize != null && blockSize > 0) {\n return blockSize;\n }\n else {\n return 100;\n }\n };\n StoreFactory.prototype.getLevelSpecificParams = function (parentNode) {\n var callback = this.gridOptionsService.getCallback('getServerSideGroupLevelParams');\n if (!callback) {\n return undefined;\n }\n var params = {\n level: parentNode.level + 1,\n parentRowNode: parentNode.level >= 0 ? parentNode : undefined,\n rowGroupColumns: this.columnModel.getRowGroupColumns(),\n pivotColumns: this.columnModel.getPivotColumns(),\n pivotMode: this.columnModel.isPivotMode()\n };\n var res = callback(params);\n if (res.storeType != null) {\n res.suppressInfiniteScroll = res.storeType !== \"partial\";\n }\n return res;\n };\n StoreFactory.prototype.isInfiniteScroll = function (storeParams) {\n var res = (storeParams && storeParams.suppressInfiniteScroll != null)\n ? storeParams.suppressInfiniteScroll\n : this.isSuppressServerSideInfiniteScroll();\n return !res;\n };\n StoreFactory.prototype.isSuppressServerSideInfiniteScroll = function () {\n return this.gridOptionsService.is('suppressServerSideInfiniteScroll');\n };\n __decorate$i([\n Autowired('gridOptionsService')\n ], StoreFactory.prototype, \"gridOptionsService\", void 0);\n __decorate$i([\n Autowired('columnModel')\n ], StoreFactory.prototype, \"columnModel\", void 0);\n StoreFactory = __decorate$i([\n Bean('ssrmStoreFactory')\n ], StoreFactory);\n return StoreFactory;\n}());\n\nvar __decorate$h = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar ListenerUtils = /** @class */ (function () {\n function ListenerUtils() {\n }\n ListenerUtils.prototype.isSortingWithValueColumn = function (changedColumnsInSort) {\n var valueColIds = this.columnModel.getValueColumns().map(function (col) { return col.getColId(); });\n for (var i = 0; i < changedColumnsInSort.length; i++) {\n if (valueColIds.indexOf(changedColumnsInSort[i]) > -1) {\n return true;\n }\n }\n return false;\n };\n ListenerUtils.prototype.isSortingWithSecondaryColumn = function (changedColumnsInSort) {\n if (!this.columnModel.getSecondaryColumns()) {\n return false;\n }\n var secondaryColIds = this.columnModel.getSecondaryColumns().map(function (col) { return col.getColId(); });\n for (var i = 0; i < changedColumnsInSort.length; i++) {\n if (secondaryColIds.indexOf(changedColumnsInSort[i]) > -1) {\n return true;\n }\n }\n return false;\n };\n __decorate$h([\n Autowired('columnModel')\n ], ListenerUtils.prototype, \"columnModel\", void 0);\n ListenerUtils = __decorate$h([\n Bean('ssrmListenerUtils')\n ], ListenerUtils);\n return ListenerUtils;\n}());\n\nvar __extends$l = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$g = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __read$3 = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray$2 = (undefined && undefined.__spreadArray) || function (to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\n to[j] = from[i];\n return to;\n};\nvar DefaultStrategy = /** @class */ (function (_super) {\n __extends$l(DefaultStrategy, _super);\n function DefaultStrategy() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.selectedState = { selectAll: false, toggledNodes: new Set() };\n _this.lastSelected = null;\n _this.selectAllUsed = false;\n // this is to prevent regressions, default selectionService retains reference of clicked nodes.\n _this.selectedNodes = {};\n return _this;\n }\n DefaultStrategy.prototype.init = function () {\n var _this = this;\n this.rowSelection = this.gridOptionsService.get('rowSelection');\n this.addManagedPropertyListener('rowSelection', function (propChange) {\n _this.rowSelection = propChange.currentValue;\n });\n };\n DefaultStrategy.prototype.getSelectedState = function () {\n return {\n selectAll: this.selectedState.selectAll,\n toggledNodes: __spreadArray$2([], __read$3(this.selectedState.toggledNodes)),\n };\n };\n DefaultStrategy.prototype.setSelectedState = function (state) {\n // fire selection changed event\n var newState = {\n selectAll: false,\n toggledNodes: new Set(),\n };\n if (typeof state !== 'object') {\n console.error('AG Grid: The provided selection state should be an object.');\n return;\n }\n if ('selectAll' in state && typeof state.selectAll === 'boolean') {\n newState.selectAll = state.selectAll;\n }\n else {\n console.error('AG Grid: Select all status should be of boolean type.');\n return;\n }\n if ('toggledNodes' in state && Array.isArray(state.toggledNodes)) {\n state.toggledNodes.forEach(function (key) {\n if (typeof key === 'string') {\n newState.toggledNodes.add(key);\n }\n else {\n console.warn(\"AG Grid: Provided ids must be of string type. Invalid id provided: \" + key);\n }\n });\n }\n else {\n console.error('AG Grid: `toggledNodes` must be an array of string ids.');\n return;\n }\n this.selectedState = newState;\n };\n DefaultStrategy.prototype.deleteSelectionStateFromParent = function (parentPath, removedNodeIds) {\n var _this = this;\n if (this.selectedState.toggledNodes.size === 0) {\n return false;\n }\n var anyNodesToggled = false;\n removedNodeIds.forEach(function (id) {\n if (_this.selectedState.toggledNodes.delete(id)) {\n anyNodesToggled = true;\n }\n });\n return anyNodesToggled;\n };\n DefaultStrategy.prototype.setNodesSelected = function (params) {\n var _a;\n var _this = this;\n if (params.nodes.length === 0)\n return 0;\n var onlyThisNode = params.clearSelection && params.newValue && !params.rangeSelect;\n if (this.rowSelection !== 'multiple' || onlyThisNode) {\n if (params.nodes.length > 1) {\n throw new Error('AG Grid: cannot select multiple rows when rowSelection is set to \\'single\\'');\n }\n var node = params.nodes[0];\n if (params.newValue) {\n this.selectedNodes = (_a = {}, _a[node.id] = node, _a);\n this.selectedState = {\n selectAll: false,\n toggledNodes: new Set([node.id]),\n };\n }\n else {\n this.selectedNodes = {};\n this.selectedState = {\n selectAll: false,\n toggledNodes: new Set(),\n };\n }\n this.lastSelected = node.id;\n return 1;\n }\n var updateNodeState = function (node) {\n if (params.newValue) {\n _this.selectedNodes[node.id] = node;\n }\n else {\n delete _this.selectedNodes[node.id];\n }\n var doesNodeConform = params.newValue === _this.selectedState.selectAll;\n if (doesNodeConform) {\n _this.selectedState.toggledNodes.delete(node.id);\n return;\n }\n _this.selectedState.toggledNodes.add(node.id);\n };\n if (params.rangeSelect && this.lastSelected) {\n if (params.nodes.length > 1) {\n throw new Error('AG Grid: cannot select multiple rows when using rangeSelect');\n }\n var node = params.nodes[0];\n var lastSelectedNode = this.rowModel.getRowNode(this.lastSelected);\n this.rowModel.getNodesInRangeForSelection(node, lastSelectedNode !== null && lastSelectedNode !== void 0 ? lastSelectedNode : null).forEach(updateNodeState);\n this.lastSelected = node.id;\n return 1;\n }\n params.nodes.forEach(updateNodeState);\n this.lastSelected = params.nodes[params.nodes.length - 1].id;\n return 1;\n };\n DefaultStrategy.prototype.processNewRow = function (node) {\n if (this.selectedNodes[node.id]) {\n this.selectedNodes[node.id] = node;\n }\n };\n DefaultStrategy.prototype.isNodeSelected = function (node) {\n var isToggled = this.selectedState.toggledNodes.has(node.id);\n return this.selectedState.selectAll ? !isToggled : isToggled;\n };\n DefaultStrategy.prototype.getSelectedNodes = function () {\n if (this.selectAllUsed) {\n console.warn(\"AG Grid: getSelectedNodes and getSelectedRows functions cannot be used with select all functionality with the server-side row model.\\n Use `api.getServerSideSelectionState()` instead.\");\n }\n return Object.values(this.selectedNodes);\n };\n DefaultStrategy.prototype.getSelectedRows = function () {\n return this.getSelectedNodes().map(function (node) { return node.data; });\n };\n DefaultStrategy.prototype.getSelectionCount = function () {\n if (this.selectedState.selectAll) {\n return -1;\n }\n return this.selectedState.toggledNodes.size;\n };\n DefaultStrategy.prototype.clearOtherNodes = function (rowNodeToKeepSelected, source) {\n var clearedRows = this.selectedState.selectAll ? 1 : this.selectedState.toggledNodes.size - 1;\n this.selectedState = {\n selectAll: false,\n toggledNodes: new Set([rowNodeToKeepSelected.id]),\n };\n this.rowModel.forEachNode(function (node) {\n if (node !== rowNodeToKeepSelected) {\n node.selectThisNode(false, undefined, source);\n }\n });\n var event = {\n type: Events.EVENT_SELECTION_CHANGED,\n source: source,\n };\n this.eventService.dispatchEvent(event);\n return clearedRows;\n };\n DefaultStrategy.prototype.isEmpty = function () {\n var _a;\n return !this.selectedState.selectAll && !((_a = this.selectedState.toggledNodes) === null || _a === void 0 ? void 0 : _a.size);\n };\n DefaultStrategy.prototype.selectAllRowNodes = function (params) {\n this.selectedState = { selectAll: true, toggledNodes: new Set() };\n this.selectedNodes = {};\n this.selectAllUsed = true;\n };\n DefaultStrategy.prototype.deselectAllRowNodes = function (params) {\n this.selectedState = { selectAll: false, toggledNodes: new Set() };\n this.selectedNodes = {};\n };\n DefaultStrategy.prototype.getSelectAllState = function (justFiltered, justCurrentPage) {\n if (this.selectedState.selectAll) {\n if (this.selectedState.toggledNodes.size > 0) {\n return null;\n }\n return true;\n }\n if (this.selectedState.toggledNodes.size > 0) {\n return null;\n }\n return false;\n };\n __decorate$g([\n Autowired('rowModel')\n ], DefaultStrategy.prototype, \"rowModel\", void 0);\n __decorate$g([\n PostConstruct\n ], DefaultStrategy.prototype, \"init\", null);\n return DefaultStrategy;\n}(BeanStub));\n\nvar __extends$k = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign$1 = (undefined && undefined.__assign) || function () {\n __assign$1 = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign$1.apply(this, arguments);\n};\nvar __decorate$f = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __rest = (undefined && undefined.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nvar __read$2 = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray$1 = (undefined && undefined.__spreadArray) || function (to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\n to[j] = from[i];\n return to;\n};\nvar GroupSelectsChildrenStrategy = /** @class */ (function (_super) {\n __extends$k(GroupSelectsChildrenStrategy, _super);\n function GroupSelectsChildrenStrategy() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.selectedState = { selectAllChildren: false, toggledNodes: new Map() };\n _this.lastSelected = null;\n return _this;\n }\n GroupSelectsChildrenStrategy.prototype.init = function () {\n var _this = this;\n // if model has updated, a store may now be fully loaded to clean up indeterminate states\n this.addManagedListener(this.eventService, Events.EVENT_MODEL_UPDATED, function () { return _this.removeRedundantState(); });\n // when the grouping changes, the state no longer makes sense, so reset the state.\n this.addManagedListener(this.eventService, Events.EVENT_COLUMN_ROW_GROUP_CHANGED, function () { return _this.selectionService.reset(); });\n };\n GroupSelectsChildrenStrategy.prototype.getSelectedState = function () {\n var _this = this;\n var recursivelySerializeState = function (state, level, nodeId) {\n var normalisedState = {\n nodeId: nodeId,\n };\n if (level <= _this.columnModel.getRowGroupColumns().length) {\n normalisedState.selectAllChildren = state.selectAllChildren;\n }\n // omit toggledNodes if empty\n if (state.toggledNodes.size) {\n var toggledNodes_1 = [];\n state.toggledNodes.forEach(function (value, key) {\n var newState = recursivelySerializeState(value, level + 1, key);\n toggledNodes_1.push(newState);\n });\n normalisedState.toggledNodes = toggledNodes_1;\n }\n return normalisedState;\n };\n return recursivelySerializeState(this.selectedState, 0);\n };\n GroupSelectsChildrenStrategy.prototype.setSelectedState = function (state) {\n var recursivelyDeserializeState = function (normalisedState, parentSelected) {\n var _a, _b;\n if (typeof normalisedState !== 'object') {\n throw new Error('AG Grid: Each provided state object must be an object.');\n }\n if ('selectAllChildren' in normalisedState && typeof normalisedState.selectAllChildren !== 'boolean') {\n throw new Error('AG Grid: `selectAllChildren` must be a boolean value or undefined.');\n }\n if ('toggledNodes' in normalisedState) {\n if (!Array.isArray(normalisedState.toggledNodes)) {\n throw new Error('AG Grid: `toggledNodes` must be an array.');\n }\n var allHaveIds = normalisedState.toggledNodes.every(function (innerState) { return (typeof innerState === 'object' && 'nodeId' in innerState && typeof innerState.nodeId === 'string'); });\n if (!allHaveIds) {\n throw new Error('AG Grid: Every `toggledNode` requires an associated string id.');\n }\n }\n var isThisNodeSelected = (_a = normalisedState.selectAllChildren) !== null && _a !== void 0 ? _a : !parentSelected;\n var convertedChildren = (_b = normalisedState.toggledNodes) === null || _b === void 0 ? void 0 : _b.map(function (innerState) { return ([innerState.nodeId, recursivelyDeserializeState(innerState, isThisNodeSelected)]); });\n var doesRedundantStateExist = convertedChildren === null || convertedChildren === void 0 ? void 0 : convertedChildren.some(function (_a) {\n var _b = __read$2(_a, 2); _b[0]; var innerState = _b[1];\n return isThisNodeSelected === innerState.selectAllChildren && innerState.toggledNodes.size === 0;\n });\n if (doesRedundantStateExist) {\n throw new Error(\"\\n AG Grid: AG Grid: Row selection state could not be parsed due to invalid data. Ensure all child state has toggledNodes or does not conform with the parent rule.\\n Please rebuild the selection state and reapply it.\\n \");\n }\n return {\n selectAllChildren: isThisNodeSelected,\n toggledNodes: new Map(convertedChildren),\n };\n };\n try {\n this.selectedState = recursivelyDeserializeState(state, !!state.selectAllChildren);\n }\n catch (e) {\n console.error(e.message);\n }\n };\n GroupSelectsChildrenStrategy.prototype.deleteSelectionStateFromParent = function (parentRoute, removedNodeIds) {\n var parentState = this.selectedState;\n var remainingRoute = __spreadArray$1([], __read$2(parentRoute));\n while (parentState && remainingRoute.length) {\n parentState = parentState.toggledNodes.get(remainingRoute.pop());\n }\n // parent has no explicit state, nothing to remove\n if (!parentState) {\n return false;\n }\n var anyStateChanged = false;\n removedNodeIds.forEach(function (id) {\n if (parentState === null || parentState === void 0 ? void 0 : parentState.toggledNodes.delete(id)) {\n anyStateChanged = true;\n }\n });\n if (anyStateChanged) {\n this.removeRedundantState();\n }\n return anyStateChanged;\n };\n GroupSelectsChildrenStrategy.prototype.setNodesSelected = function (params) {\n var _this = this;\n var nodes = params.nodes, other = __rest(params, [\"nodes\"]);\n if (nodes.length === 0)\n return 0;\n if (params.rangeSelect) {\n if (nodes.length > 1) {\n throw new Error('AG Grid: cannot select multiple rows when using rangeSelect');\n }\n var node_1 = nodes[0];\n var rangeOfNodes = this.rowModel.getNodesInRangeForSelection(node_1, this.lastSelected);\n // sort the routes by route length, high to low, this means we can do the lowest level children first\n var routes = rangeOfNodes.map(this.getRouteToNode).sort(function (a, b) { return b.length - a.length; });\n // skip routes if we've already done a descendent\n var completedRoutes_1 = new Set();\n routes.forEach(function (route) {\n // skip routes if we've already selected a descendent\n if (completedRoutes_1.has(route[route.length - 1])) {\n return;\n }\n route.forEach(function (part) { return completedRoutes_1.add(part); });\n _this.recursivelySelectNode(route, _this.selectedState, __assign$1({ node: node_1 }, other));\n });\n this.removeRedundantState();\n this.lastSelected = node_1;\n return 1;\n }\n params.nodes.forEach(function (node) {\n var idPathToNode = _this.getRouteToNode(node);\n _this.recursivelySelectNode(idPathToNode, _this.selectedState, __assign$1(__assign$1({}, other), { node: node }));\n });\n this.removeRedundantState();\n this.lastSelected = params.nodes[params.nodes.length - 1];\n return 1;\n };\n GroupSelectsChildrenStrategy.prototype.isNodeSelected = function (node) {\n var path = this.getRouteToNode(node);\n return this.isNodePathSelected(path, this.selectedState);\n };\n GroupSelectsChildrenStrategy.prototype.isNodePathSelected = function (_a, state) {\n var _b = __read$2(_a), nextNode = _b[0], nodes = _b.slice(1);\n if (nodes.length === 0) {\n var isToggled = state.toggledNodes.has(nextNode.id);\n if (nextNode.hasChildren()) {\n var groupState = state.toggledNodes.get(nextNode.id);\n if (groupState && groupState.toggledNodes.size) {\n return undefined;\n }\n }\n return state.selectAllChildren ? !isToggled : isToggled;\n }\n // if there's a deeper level, check recursively\n if (state.toggledNodes.has(nextNode.id)) {\n var nextState = state.toggledNodes.get(nextNode.id);\n if (nextState) {\n return this.isNodePathSelected(nodes, nextState);\n }\n }\n // no deeper custom state, respect the closest default\n return !!state.selectAllChildren;\n };\n GroupSelectsChildrenStrategy.prototype.getRouteToNode = function (node) {\n var pathToNode = [];\n var tempNode = node;\n while (tempNode.parent) {\n pathToNode.push(tempNode);\n tempNode = tempNode.parent;\n }\n return pathToNode.reverse();\n };\n GroupSelectsChildrenStrategy.prototype.removeRedundantState = function () {\n var _this = this;\n if (this.filterManager.isAnyFilterPresent()) {\n return;\n }\n var recursivelyRemoveState = function (selectedState, store, node) {\n if (selectedState === void 0) { selectedState = _this.selectedState; }\n if (store === void 0) { store = _this.serverSideRowModel.getRootStore(); }\n var allChildNodesFound = true;\n var noIndeterminateChildren = true;\n selectedState.toggledNodes.forEach(function (state, id) {\n var parentNode = _this.rowModel.getRowNode(id);\n if (!parentNode) {\n allChildNodesFound = false;\n }\n var nextStore = parentNode === null || parentNode === void 0 ? void 0 : parentNode.childStore;\n if (!nextStore) {\n if (state.toggledNodes.size > 0) {\n noIndeterminateChildren = false;\n }\n return;\n }\n // if child was cleared, check if this state is still relevant\n if (recursivelyRemoveState(state, nextStore, parentNode)) {\n // cleans out groups which have no toggled nodes and an equivalent default to its parent\n if (selectedState.selectAllChildren === state.selectAllChildren) {\n selectedState.toggledNodes.delete(id);\n }\n }\n if (state.toggledNodes.size > 0) {\n noIndeterminateChildren = false;\n }\n });\n if (!store || !store.isLastRowIndexKnown() || store.getRowCount() !== selectedState.toggledNodes.size) {\n // if row count unknown, or doesn't match the size of toggledNodes, ignore.\n return false;\n }\n if (noIndeterminateChildren && allChildNodesFound) {\n selectedState.toggledNodes.clear();\n selectedState.selectAllChildren = !selectedState.selectAllChildren;\n // if node was indeterminate, it's not any more.\n if (node && (node === null || node === void 0 ? void 0 : node.isSelected()) !== selectedState.selectAllChildren) {\n node.selectThisNode(selectedState.selectAllChildren, undefined, 'api');\n }\n return true;\n }\n return false;\n };\n recursivelyRemoveState();\n };\n GroupSelectsChildrenStrategy.prototype.recursivelySelectNode = function (_a, selectedState, params) {\n var _b = __read$2(_a), nextNode = _b[0], nodes = _b.slice(1);\n if (!nextNode) {\n return;\n }\n // if this is the last node, hard add/remove based on its selectAllChildren state\n var isLastNode = !nodes.length;\n if (isLastNode) {\n var needsDeleted = selectedState.selectAllChildren === params.newValue;\n if (needsDeleted) {\n selectedState.toggledNodes.delete(nextNode.id);\n return;\n }\n var newState = {\n selectAllChildren: params.newValue,\n toggledNodes: new Map(),\n };\n selectedState.toggledNodes.set(nextNode.id, newState);\n return;\n }\n var doesStateAlreadyExist = selectedState.toggledNodes.has(nextNode.id);\n var childState = doesStateAlreadyExist ? (selectedState.toggledNodes.get(nextNode.id)) : {\n selectAllChildren: selectedState.selectAllChildren,\n toggledNodes: new Map(),\n };\n if (!doesStateAlreadyExist) {\n selectedState.toggledNodes.set(nextNode.id, childState);\n }\n this.recursivelySelectNode(nodes, childState, params);\n // cleans out groups which have no toggled nodes and an equivalent default to its parent\n if (selectedState.selectAllChildren === childState.selectAllChildren && childState.toggledNodes.size === 0) {\n selectedState.toggledNodes.delete(nextNode.id);\n }\n };\n GroupSelectsChildrenStrategy.prototype.getSelectedNodes = function () {\n console.warn(\"AG Grid: `getSelectedNodes` and `getSelectedRows` functions cannot be used with `groupSelectsChildren` and the server-side row model.\\n Use `api.getServerSideSelectionState()` instead.\");\n var selectedNodes = [];\n this.rowModel.forEachNode(function (node) {\n if (node.isSelected()) {\n selectedNodes.push(node);\n }\n });\n return selectedNodes;\n };\n GroupSelectsChildrenStrategy.prototype.processNewRow = function (node) {\n // This is used for updating outdated node refs, as this model entirely uses ids it's irrelevant\n };\n GroupSelectsChildrenStrategy.prototype.getSelectedRows = function () {\n return this.getSelectedNodes().map(function (node) { return node.data; });\n };\n GroupSelectsChildrenStrategy.prototype.getSelectionCount = function () {\n return -1;\n };\n GroupSelectsChildrenStrategy.prototype.isEmpty = function () {\n var _a;\n return !this.selectedState.selectAllChildren && !((_a = this.selectedState.toggledNodes) === null || _a === void 0 ? void 0 : _a.size);\n };\n GroupSelectsChildrenStrategy.prototype.selectAllRowNodes = function (params) {\n this.selectedState = { selectAllChildren: true, toggledNodes: new Map() };\n };\n GroupSelectsChildrenStrategy.prototype.deselectAllRowNodes = function (params) {\n this.selectedState = { selectAllChildren: false, toggledNodes: new Map() };\n };\n GroupSelectsChildrenStrategy.prototype.getSelectAllState = function (justFiltered, justCurrentPage) {\n if (this.selectedState.selectAllChildren) {\n if (this.selectedState.toggledNodes.size > 0) {\n return null;\n }\n return true;\n }\n if (this.selectedState.toggledNodes.size > 0) {\n return null;\n }\n return false;\n };\n __decorate$f([\n Autowired('rowModel')\n ], GroupSelectsChildrenStrategy.prototype, \"rowModel\", void 0);\n __decorate$f([\n Autowired('columnModel')\n ], GroupSelectsChildrenStrategy.prototype, \"columnModel\", void 0);\n __decorate$f([\n Autowired('filterManager')\n ], GroupSelectsChildrenStrategy.prototype, \"filterManager\", void 0);\n __decorate$f([\n Autowired('rowModel')\n ], GroupSelectsChildrenStrategy.prototype, \"serverSideRowModel\", void 0);\n __decorate$f([\n Autowired('selectionService')\n ], GroupSelectsChildrenStrategy.prototype, \"selectionService\", void 0);\n __decorate$f([\n PostConstruct\n ], GroupSelectsChildrenStrategy.prototype, \"init\", null);\n return GroupSelectsChildrenStrategy;\n}(BeanStub));\n\nvar __extends$j = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$e = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar ServerSideSelectionService = /** @class */ (function (_super) {\n __extends$j(ServerSideSelectionService, _super);\n function ServerSideSelectionService() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n ServerSideSelectionService.prototype.init = function () {\n var _this = this;\n var groupSelectsChildren = this.gridOptionsService.is('groupSelectsChildren');\n this.addManagedPropertyListener('groupSelectsChildren', function (propChange) {\n _this.destroyBean(_this.selectionStrategy);\n var StrategyClazz = !propChange.currentValue ? DefaultStrategy : GroupSelectsChildrenStrategy;\n _this.selectionStrategy = _this.createManagedBean(new StrategyClazz());\n _this.shotgunResetNodeSelectionState();\n var event = {\n type: Events.EVENT_SELECTION_CHANGED,\n source: 'api',\n };\n _this.eventService.dispatchEvent(event);\n });\n this.rowSelection = this.gridOptionsService.get('rowSelection');\n this.addManagedPropertyListener('rowSelection', function (propChange) { return _this.rowSelection = propChange.currentValue; });\n var StrategyClazz = !groupSelectsChildren ? DefaultStrategy : GroupSelectsChildrenStrategy;\n this.selectionStrategy = this.createManagedBean(new StrategyClazz());\n };\n ServerSideSelectionService.prototype.getServerSideSelectionState = function () {\n return this.selectionStrategy.getSelectedState();\n };\n ServerSideSelectionService.prototype.setServerSideSelectionState = function (state) {\n this.selectionStrategy.setSelectedState(state);\n this.shotgunResetNodeSelectionState();\n var event = {\n type: Events.EVENT_SELECTION_CHANGED,\n source: 'api',\n };\n this.eventService.dispatchEvent(event);\n };\n ServerSideSelectionService.prototype.setNodesSelected = function (params) {\n if (params.nodes.length > 1 && this.rowSelection !== 'multiple') {\n console.warn(\"AG Grid: cannot multi select while rowSelection='single'\");\n return 0;\n }\n if (params.nodes.length > 1 && params.rangeSelect) {\n console.warn(\"AG Grid: cannot use range selection when multi selecting rows\");\n return 0;\n }\n var changedNodes = this.selectionStrategy.setNodesSelected(params);\n this.shotgunResetNodeSelectionState(params.source);\n var event = {\n type: Events.EVENT_SELECTION_CHANGED,\n source: params.source,\n };\n this.eventService.dispatchEvent(event);\n return changedNodes;\n };\n /**\n * Deletes the selection state for a set of nodes, for use after deleting nodes via\n * transaction. As this is designed for transactions, all nodes should belong to the same group.\n */\n ServerSideSelectionService.prototype.deleteSelectionStateFromParent = function (storeRoute, removedNodeIds) {\n var stateChanged = this.selectionStrategy.deleteSelectionStateFromParent(storeRoute, removedNodeIds);\n if (!stateChanged) {\n return;\n }\n this.shotgunResetNodeSelectionState();\n var event = {\n type: Events.EVENT_SELECTION_CHANGED,\n source: 'api',\n };\n this.eventService.dispatchEvent(event);\n };\n ServerSideSelectionService.prototype.shotgunResetNodeSelectionState = function (source) {\n var _this = this;\n this.rowModel.forEachNode(function (node) {\n if (node.stub) {\n return;\n }\n var isNodeSelected = _this.selectionStrategy.isNodeSelected(node);\n if (isNodeSelected !== node.isSelected()) {\n node.selectThisNode(isNodeSelected, undefined, source);\n }\n });\n };\n ServerSideSelectionService.prototype.getSelectedNodes = function () {\n return this.selectionStrategy.getSelectedNodes();\n };\n ServerSideSelectionService.prototype.getSelectedRows = function () {\n return this.selectionStrategy.getSelectedRows();\n };\n ServerSideSelectionService.prototype.getSelectionCount = function () {\n return this.selectionStrategy.getSelectionCount();\n };\n ServerSideSelectionService.prototype.syncInRowNode = function (rowNode, oldNode) {\n // update any refs being held in the strategies\n this.selectionStrategy.processNewRow(rowNode);\n var isNodeSelected = this.selectionStrategy.isNodeSelected(rowNode);\n rowNode.setSelectedInitialValue(isNodeSelected);\n };\n ServerSideSelectionService.prototype.reset = function () {\n this.selectionStrategy.deselectAllRowNodes({ source: 'api' });\n };\n ServerSideSelectionService.prototype.isEmpty = function () {\n return this.selectionStrategy.isEmpty();\n };\n ServerSideSelectionService.prototype.selectAllRowNodes = function (params) {\n if (params.justCurrentPage || params.justFiltered) {\n console.warn(\"AG Grid: selecting just filtered only works when gridOptions.rowModelType='clientSide'\");\n }\n this.selectionStrategy.selectAllRowNodes(params);\n this.rowModel.forEachNode(function (node) {\n if (node.stub) {\n return;\n }\n node.selectThisNode(true, undefined, params.source);\n });\n var event = {\n type: Events.EVENT_SELECTION_CHANGED,\n source: params.source,\n };\n this.eventService.dispatchEvent(event);\n };\n ServerSideSelectionService.prototype.deselectAllRowNodes = function (params) {\n if (params.justCurrentPage || params.justFiltered) {\n console.warn(\"AG Grid: selecting just filtered only works when gridOptions.rowModelType='clientSide'\");\n }\n this.selectionStrategy.deselectAllRowNodes(params);\n this.rowModel.forEachNode(function (node) {\n if (node.stub) {\n return;\n }\n node.selectThisNode(false, undefined, params.source);\n });\n var event = {\n type: Events.EVENT_SELECTION_CHANGED,\n source: params.source,\n };\n this.eventService.dispatchEvent(event);\n };\n ServerSideSelectionService.prototype.getSelectAllState = function (justFiltered, justCurrentPage) {\n return this.selectionStrategy.getSelectAllState(justFiltered, justCurrentPage);\n };\n // used by CSRM\n ServerSideSelectionService.prototype.updateGroupsFromChildrenSelections = function (source, changedPath) {\n return false;\n };\n // used by CSRM\n ServerSideSelectionService.prototype.getBestCostNodeSelection = function () {\n console.warn('AG Grid: calling gridApi.getBestCostNodeSelection() is only possible when using rowModelType=`clientSide`.');\n return undefined;\n };\n // used by CSRM\n ServerSideSelectionService.prototype.filterFromSelection = function () {\n return;\n };\n __decorate$e([\n Autowired('rowModel')\n ], ServerSideSelectionService.prototype, \"rowModel\", void 0);\n __decorate$e([\n PostConstruct\n ], ServerSideSelectionService.prototype, \"init\", null);\n ServerSideSelectionService = __decorate$e([\n Bean('selectionService')\n ], ServerSideSelectionService);\n return ServerSideSelectionService;\n}(BeanStub));\n\n// DO NOT UPDATE MANUALLY: Generated from script during build time\nvar VERSION$4 = '30.0.6';\n\nvar ServerSideRowModelModule = {\n version: VERSION$4,\n moduleName: ModuleNames.ServerSideRowModelModule,\n rowModel: 'serverSide',\n beans: [ServerSideRowModel, ExpandListener, SortListener, StoreUtils, BlockUtils, NodeManager, TransactionManager,\n FilterListener, StoreFactory, ListenerUtils, ServerSideSelectionService],\n dependantModules: [\n EnterpriseCoreModule\n ]\n};\n\n/** @param V type of value in the Set Filter */\nvar ClientSideValuesExtractor = /** @class */ (function () {\n function ClientSideValuesExtractor(rowModel, filterParams, createKey, caseFormat, columnModel, valueService, treeDataOrGrouping, treeData, getDataPath) {\n this.rowModel = rowModel;\n this.filterParams = filterParams;\n this.createKey = createKey;\n this.caseFormat = caseFormat;\n this.columnModel = columnModel;\n this.valueService = valueService;\n this.treeDataOrGrouping = treeDataOrGrouping;\n this.treeData = treeData;\n this.getDataPath = getDataPath;\n }\n ClientSideValuesExtractor.prototype.extractUniqueValues = function (predicate, existingValues) {\n var _this = this;\n var values = new Map();\n var existingFormattedKeys = this.extractExistingFormattedKeys(existingValues);\n var formattedKeys = new Set();\n var treeData = this.treeData && !!this.getDataPath;\n var groupedCols = this.columnModel.getRowGroupColumns();\n var addValue = function (unformattedKey, value) {\n var formattedKey = _this.caseFormat(unformattedKey);\n if (!formattedKeys.has(formattedKey)) {\n formattedKeys.add(formattedKey);\n var keyToAdd = unformattedKey;\n var valueToAdd = _.makeNull(value);\n // when case insensitive, we pick the first value to use. if this is later filtered out,\n // we still want to use the original value and not one with a different case\n var existingUnformattedKey = existingFormattedKeys === null || existingFormattedKeys === void 0 ? void 0 : existingFormattedKeys.get(formattedKey);\n if (existingUnformattedKey != null) {\n keyToAdd = existingUnformattedKey;\n valueToAdd = existingValues.get(existingUnformattedKey);\n }\n values.set(keyToAdd, valueToAdd);\n }\n };\n this.rowModel.forEachLeafNode(function (node) {\n // only pull values from rows that have data. this means we skip filler group nodes.\n if (!node.data || !predicate(node)) {\n return;\n }\n if (_this.treeDataOrGrouping) {\n _this.addValueForTreeDataOrGrouping(node, treeData, groupedCols, addValue);\n return;\n }\n var value = _this.getValue(node);\n if (_this.filterParams.convertValuesToStrings) {\n // for backwards compatibility - keeping separate as it will eventually be removed\n _this.addValueForConvertValuesToString(node, value, addValue);\n return;\n }\n if (value != null && Array.isArray(value)) {\n value.forEach(function (x) {\n addValue(_this.createKey(x, node), x);\n });\n if (value.length === 0) {\n addValue(null, null);\n }\n }\n else {\n addValue(_this.createKey(value, node), value);\n }\n });\n return values;\n };\n ClientSideValuesExtractor.prototype.addValueForConvertValuesToString = function (node, value, addValue) {\n var key = this.createKey(value, node);\n if (key != null && Array.isArray(key)) {\n key.forEach(function (part) {\n var processedPart = _.toStringOrNull(_.makeNull(part));\n addValue(processedPart, processedPart);\n });\n if (key.length === 0) {\n addValue(null, null);\n }\n }\n else {\n addValue(key, key);\n }\n };\n ClientSideValuesExtractor.prototype.addValueForTreeDataOrGrouping = function (node, treeData, groupedCols, addValue) {\n var _this = this;\n var _a;\n var dataPath;\n if (treeData) {\n if ((_a = node.childrenAfterGroup) === null || _a === void 0 ? void 0 : _a.length) {\n return;\n }\n dataPath = this.getDataPath(node.data);\n }\n else {\n dataPath = groupedCols.map(function (groupCol) { return _this.valueService.getKeyForNode(groupCol, node); });\n dataPath.push(this.getValue(node));\n }\n if (dataPath) {\n dataPath = dataPath.map(function (treeKey) { return _.toStringOrNull(_.makeNull(treeKey)); });\n }\n if (dataPath === null || dataPath === void 0 ? void 0 : dataPath.some(function (treeKey) { return treeKey == null; })) {\n dataPath = null;\n }\n addValue(this.createKey(dataPath), dataPath);\n };\n ClientSideValuesExtractor.prototype.getValue = function (node) {\n var _a = this.filterParams, api = _a.api, colDef = _a.colDef, column = _a.column, columnApi = _a.columnApi, context = _a.context;\n return this.filterParams.valueGetter({\n api: api,\n colDef: colDef,\n column: column,\n columnApi: columnApi,\n context: context,\n data: node.data,\n getValue: function (field) { return node.data[field]; },\n node: node,\n });\n };\n ClientSideValuesExtractor.prototype.extractExistingFormattedKeys = function (existingValues) {\n var _this = this;\n if (!existingValues) {\n return null;\n }\n var existingFormattedKeys = new Map();\n existingValues.forEach(function (_value, key) {\n existingFormattedKeys.set(_this.caseFormat(key), key);\n });\n return existingFormattedKeys;\n };\n return ClientSideValuesExtractor;\n}());\n\nvar SetFilterDisplayValue = /** @class */ (function () {\n function SetFilterDisplayValue() {\n }\n SetFilterDisplayValue.SELECT_ALL = '__AG_SELECT_ALL__';\n return SetFilterDisplayValue;\n}());\n\nvar __values$2 = (undefined && undefined.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nvar FlatSetDisplayValueModel = /** @class */ (function () {\n function FlatSetDisplayValueModel(valueFormatterService, valueFormatter, formatter, column) {\n this.valueFormatterService = valueFormatterService;\n this.valueFormatter = valueFormatter;\n this.formatter = formatter;\n this.column = column;\n /** All keys that are currently displayed, after the mini-filter has been applied. */\n this.displayedKeys = [];\n }\n FlatSetDisplayValueModel.prototype.updateDisplayedValuesToAllAvailable = function (_getValue, _allKeys, availableKeys) {\n this.displayedKeys = Array.from(availableKeys);\n };\n FlatSetDisplayValueModel.prototype.updateDisplayedValuesToMatchMiniFilter = function (getValue, _allKeys, availableKeys, matchesFilter, nullMatchesFilter) {\n var e_1, _a;\n this.displayedKeys = [];\n try {\n for (var availableKeys_1 = __values$2(availableKeys), availableKeys_1_1 = availableKeys_1.next(); !availableKeys_1_1.done; availableKeys_1_1 = availableKeys_1.next()) {\n var key = availableKeys_1_1.value;\n if (key == null) {\n if (nullMatchesFilter) {\n this.displayedKeys.push(key);\n }\n }\n else {\n var value = getValue(key);\n var valueFormatterValue = this.valueFormatterService.formatValue(this.column, null, value, this.valueFormatter, false);\n var textFormatterValue = this.formatter(valueFormatterValue);\n if (matchesFilter(textFormatterValue)) {\n this.displayedKeys.push(key);\n }\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (availableKeys_1_1 && !availableKeys_1_1.done && (_a = availableKeys_1.return)) _a.call(availableKeys_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n };\n FlatSetDisplayValueModel.prototype.getDisplayedValueCount = function () {\n return this.displayedKeys.length;\n };\n FlatSetDisplayValueModel.prototype.getDisplayedItem = function (index) {\n return this.displayedKeys[index];\n };\n FlatSetDisplayValueModel.prototype.getSelectAllItem = function () {\n return SetFilterDisplayValue.SELECT_ALL;\n };\n FlatSetDisplayValueModel.prototype.getDisplayedKeys = function () {\n return this.displayedKeys;\n };\n FlatSetDisplayValueModel.prototype.forEachDisplayedKey = function (func) {\n this.displayedKeys.forEach(func);\n };\n FlatSetDisplayValueModel.prototype.someDisplayedKey = function (func) {\n return this.displayedKeys.some(func);\n };\n FlatSetDisplayValueModel.prototype.hasGroups = function () {\n return false;\n };\n FlatSetDisplayValueModel.prototype.refresh = function () {\n // not used\n };\n return FlatSetDisplayValueModel;\n}());\n\nvar __read$1 = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray = (undefined && undefined.__spreadArray) || function (to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\n to[j] = from[i];\n return to;\n};\nvar __values$1 = (undefined && undefined.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nvar TreeSetDisplayValueModel = /** @class */ (function () {\n function TreeSetDisplayValueModel(formatter, treeListPathGetter, treeListFormatter, treeDataOrGrouping) {\n this.formatter = formatter;\n this.treeListPathGetter = treeListPathGetter;\n this.treeListFormatter = treeListFormatter;\n this.treeDataOrGrouping = treeDataOrGrouping;\n /** all displayed items in a tree structure */\n this.allDisplayedItemsTree = [];\n /** all displayed items flattened and filtered */\n this.activeDisplayedItemsFlat = [];\n this.selectAllItem = {\n depth: 0,\n filterPasses: true,\n available: true,\n treeKey: SetFilterDisplayValue.SELECT_ALL,\n children: this.allDisplayedItemsTree,\n expanded: true,\n key: SetFilterDisplayValue.SELECT_ALL,\n parentTreeKeys: []\n };\n }\n TreeSetDisplayValueModel.prototype.updateDisplayedValuesToAllAvailable = function (getValue, allKeys, availableKeys, source) {\n if (source === 'reload') {\n this.generateItemTree(getValue, allKeys, availableKeys);\n }\n else if (source === 'otherFilter') {\n this.updateAvailable(availableKeys);\n this.updateExpandAll();\n }\n else if (source === 'miniFilter') {\n this.resetFilter();\n this.updateExpandAll();\n }\n this.flattenItems();\n };\n TreeSetDisplayValueModel.prototype.updateDisplayedValuesToMatchMiniFilter = function (getValue, allKeys, availableKeys, matchesFilter, nullMatchesFilter, source) {\n if (source === 'reload') {\n this.generateItemTree(getValue, allKeys, availableKeys);\n }\n else if (source === 'otherFilter') {\n this.updateAvailable(availableKeys);\n }\n this.updateFilter(matchesFilter, nullMatchesFilter);\n this.updateExpandAll();\n this.flattenItems();\n };\n TreeSetDisplayValueModel.prototype.generateItemTree = function (getValue, allKeys, availableKeys) {\n var e_1, _a;\n var _b;\n this.allDisplayedItemsTree = [];\n this.groupsExist = false;\n var treeListPathGetter = this.getTreeListPathGetter(getValue, availableKeys);\n var _loop_1 = function (key) {\n var value = getValue(key);\n var dataPath = (_b = treeListPathGetter(value)) !== null && _b !== void 0 ? _b : [null];\n if (dataPath.length > 1) {\n this_1.groupsExist = true;\n }\n var available = availableKeys.has(key);\n var children = this_1.allDisplayedItemsTree;\n var item;\n var parentTreeKeys = [];\n dataPath.forEach(function (treeKey, depth) {\n if (!children) {\n children = [];\n item.children = children;\n }\n item = children.find(function (child) { var _a; return ((_a = child.treeKey) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === (treeKey === null || treeKey === void 0 ? void 0 : treeKey.toUpperCase()); });\n if (!item) {\n item = { treeKey: treeKey, depth: depth, filterPasses: true, expanded: false, available: available, parentTreeKeys: parentTreeKeys };\n if (depth === dataPath.length - 1) {\n item.key = key;\n }\n children.push(item);\n }\n children = item.children;\n parentTreeKeys = __spreadArray(__spreadArray([], __read$1(parentTreeKeys)), [treeKey]);\n });\n };\n var this_1 = this;\n try {\n for (var allKeys_1 = __values$1(allKeys), allKeys_1_1 = allKeys_1.next(); !allKeys_1_1.done; allKeys_1_1 = allKeys_1.next()) {\n var key = allKeys_1_1.value;\n _loop_1(key);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (allKeys_1_1 && !allKeys_1_1.done && (_a = allKeys_1.return)) _a.call(allKeys_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n // update the parent availability based on the children\n this.updateAvailable(availableKeys);\n this.selectAllItem.children = this.allDisplayedItemsTree;\n this.selectAllItem.expanded = false;\n };\n TreeSetDisplayValueModel.prototype.getTreeListPathGetter = function (getValue, availableKeys) {\n var e_2, _a;\n if (this.treeListPathGetter) {\n return this.treeListPathGetter;\n }\n if (this.treeDataOrGrouping) {\n return function (value) { return value; };\n }\n // infer from data\n var isDate = false;\n try {\n for (var availableKeys_1 = __values$1(availableKeys), availableKeys_1_1 = availableKeys_1.next(); !availableKeys_1_1.done; availableKeys_1_1 = availableKeys_1.next()) {\n var availableKey = availableKeys_1_1.value;\n // find the first non-null value\n var value = getValue(availableKey);\n if (value instanceof Date) {\n isDate = true;\n break;\n }\n else if (value != null) {\n break;\n }\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (availableKeys_1_1 && !availableKeys_1_1.done && (_a = availableKeys_1.return)) _a.call(availableKeys_1);\n }\n finally { if (e_2) throw e_2.error; }\n }\n if (isDate) {\n return TreeSetDisplayValueModel.DATE_TREE_LIST_PATH_GETTER;\n }\n _.doOnce(function () { return console.warn('AG Grid: property treeList=true for Set Filter params, but you did not provide a treeListPathGetter or values of type Date.'); }, 'getTreeListPathGetter');\n return function (value) { return [String(value)]; };\n };\n TreeSetDisplayValueModel.prototype.flattenItems = function () {\n var _this = this;\n this.activeDisplayedItemsFlat = [];\n var recursivelyFlattenDisplayedItems = function (items) {\n items.forEach(function (item) {\n if (!item.filterPasses || !item.available) {\n return;\n }\n _this.activeDisplayedItemsFlat.push(item);\n if (item.children && item.expanded) {\n recursivelyFlattenDisplayedItems(item.children);\n }\n });\n };\n recursivelyFlattenDisplayedItems(this.allDisplayedItemsTree);\n };\n TreeSetDisplayValueModel.prototype.resetFilter = function () {\n var recursiveFilterReset = function (item) {\n if (item.children) {\n item.children.forEach(function (child) {\n recursiveFilterReset(child);\n });\n }\n item.filterPasses = true;\n };\n this.allDisplayedItemsTree.forEach(function (item) { return recursiveFilterReset(item); });\n };\n TreeSetDisplayValueModel.prototype.updateFilter = function (matchesFilter, nullMatchesFilter) {\n var _this = this;\n var passesFilter = function (item) {\n if (!item.available) {\n return false;\n }\n if (item.treeKey == null) {\n return nullMatchesFilter;\n }\n return matchesFilter(_this.formatter(_this.treeListFormatter ? _this.treeListFormatter(item.treeKey, item.depth, item.parentTreeKeys) : item.treeKey));\n };\n this.allDisplayedItemsTree.forEach(function (item) { return _this.recursiveItemCheck(item, false, passesFilter, 'filterPasses'); });\n };\n TreeSetDisplayValueModel.prototype.getDisplayedValueCount = function () {\n return this.activeDisplayedItemsFlat.length;\n };\n TreeSetDisplayValueModel.prototype.getDisplayedItem = function (index) {\n return this.activeDisplayedItemsFlat[index];\n };\n TreeSetDisplayValueModel.prototype.getSelectAllItem = function () {\n return this.selectAllItem;\n };\n TreeSetDisplayValueModel.prototype.getDisplayedKeys = function () {\n var displayedKeys = [];\n this.forEachDisplayedKey(function (key) { return displayedKeys.push(key); });\n return displayedKeys;\n };\n TreeSetDisplayValueModel.prototype.forEachDisplayedKey = function (func) {\n var recursiveForEachItem = function (item, topParentExpanded) {\n if (item.children) {\n if (!item.expanded || !topParentExpanded) {\n // if the parent is not expanded, we need to iterate the entire tree\n item.children.forEach(function (child) {\n if (child.filterPasses) {\n recursiveForEachItem(child, false);\n }\n });\n }\n }\n else {\n func(item.key);\n }\n };\n this.activeDisplayedItemsFlat.forEach(function (item) { return recursiveForEachItem(item, true); });\n };\n TreeSetDisplayValueModel.prototype.someDisplayedKey = function (func) {\n var recursiveSomeItem = function (item, topParentExpanded) {\n if (item.children) {\n if (!item.expanded || !topParentExpanded) {\n // if the parent is not expanded, we need to iterate the entire tree\n return item.children.some(function (child) {\n if (child.filterPasses) {\n return recursiveSomeItem(child, false);\n }\n return false;\n });\n }\n }\n else {\n return func(item.key);\n }\n return false;\n };\n return this.activeDisplayedItemsFlat.some(function (item) { return recursiveSomeItem(item, true); });\n };\n TreeSetDisplayValueModel.prototype.hasGroups = function () {\n return this.groupsExist;\n };\n TreeSetDisplayValueModel.prototype.refresh = function () {\n this.updateExpandAll();\n this.flattenItems();\n };\n TreeSetDisplayValueModel.prototype.updateExpandAll = function () {\n var recursiveExpansionCheck = function (items, someTrue, someFalse) {\n var e_3, _a;\n try {\n for (var items_1 = __values$1(items), items_1_1 = items_1.next(); !items_1_1.done; items_1_1 = items_1.next()) {\n var item_1 = items_1_1.value;\n if (!item_1.filterPasses || !item_1.available || !item_1.children) {\n continue;\n }\n // indeterminate state only exists for expand all, so don't need to check for the current item\n someTrue = someTrue || !!item_1.expanded;\n someFalse = someFalse || !item_1.expanded;\n if (someTrue && someFalse) {\n // already indeterminate. No need to check the children\n return undefined;\n }\n var childExpanded = recursiveExpansionCheck(item_1.children, someTrue, someFalse);\n if (childExpanded === undefined) {\n return undefined;\n }\n else if (childExpanded) {\n someTrue = true;\n }\n else {\n someFalse = true;\n }\n }\n }\n catch (e_3_1) { e_3 = { error: e_3_1 }; }\n finally {\n try {\n if (items_1_1 && !items_1_1.done && (_a = items_1.return)) _a.call(items_1);\n }\n finally { if (e_3) throw e_3.error; }\n }\n return someTrue && someFalse ? undefined : someTrue;\n };\n var item = this.getSelectAllItem();\n item.expanded = recursiveExpansionCheck(item.children, false, false);\n };\n TreeSetDisplayValueModel.prototype.recursiveItemCheck = function (item, parentPasses, checkFunction, itemProp) {\n var _this = this;\n var atLeastOneChildPassed = false;\n if (item.children) {\n item.children.forEach(function (child) {\n var childPasses = _this.recursiveItemCheck(child, parentPasses || checkFunction(item), checkFunction, itemProp);\n atLeastOneChildPassed = atLeastOneChildPassed || childPasses;\n });\n }\n var itemPasses = parentPasses || atLeastOneChildPassed || checkFunction(item);\n item[itemProp] = itemPasses;\n return itemPasses;\n };\n TreeSetDisplayValueModel.prototype.updateAvailable = function (availableKeys) {\n var _this = this;\n var isAvailable = function (item) { return availableKeys.has(item.key); };\n this.allDisplayedItemsTree.forEach(function (item) { return _this.recursiveItemCheck(item, false, isAvailable, 'available'); });\n };\n TreeSetDisplayValueModel.DATE_TREE_LIST_PATH_GETTER = function (date) { return date ? [String(date.getFullYear()), String(date.getMonth() + 1), String(date.getDate())] : null; };\n return TreeSetDisplayValueModel;\n}());\n\nvar __read = (undefined && undefined.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar SetFilterModelValuesType;\n(function (SetFilterModelValuesType) {\n SetFilterModelValuesType[SetFilterModelValuesType[\"PROVIDED_LIST\"] = 0] = \"PROVIDED_LIST\";\n SetFilterModelValuesType[SetFilterModelValuesType[\"PROVIDED_CALLBACK\"] = 1] = \"PROVIDED_CALLBACK\";\n SetFilterModelValuesType[SetFilterModelValuesType[\"TAKEN_FROM_GRID_VALUES\"] = 2] = \"TAKEN_FROM_GRID_VALUES\";\n})(SetFilterModelValuesType || (SetFilterModelValuesType = {}));\n/** @param V type of value in the Set Filter */\nvar SetValueModel = /** @class */ (function () {\n function SetValueModel(params) {\n var _this = this;\n var _a;\n this.localEventService = new EventService();\n this.miniFilterText = null;\n /** Values provided to the filter for use. */\n this.providedValues = null;\n /** All possible values for the filter, sorted if required. */\n this.allValues = new Map();\n /** Remaining keys when filters from other columns have been applied. */\n this.availableKeys = new Set();\n /** Keys that have been selected for this filter. */\n this.selectedKeys = new Set();\n this.initialised = false;\n var usingComplexObjects = params.usingComplexObjects, columnModel = params.columnModel, valueService = params.valueService, treeDataTreeList = params.treeDataTreeList, groupingTreeList = params.groupingTreeList, filterParams = params.filterParams, gridOptionsService = params.gridOptionsService, valueFormatterService = params.valueFormatterService, valueFormatter = params.valueFormatter;\n var column = filterParams.column, colDef = filterParams.colDef, textFormatter = filterParams.textFormatter, doesRowPassOtherFilter = filterParams.doesRowPassOtherFilter, suppressSorting = filterParams.suppressSorting, comparator = filterParams.comparator, rowModel = filterParams.rowModel, values = filterParams.values, caseSensitive = filterParams.caseSensitive, convertValuesToStrings = filterParams.convertValuesToStrings, treeList = filterParams.treeList, treeListPathGetter = filterParams.treeListPathGetter, treeListFormatter = filterParams.treeListFormatter;\n this.filterParams = filterParams;\n this.setIsLoading = params.setIsLoading;\n this.translate = params.translate;\n this.caseFormat = params.caseFormat;\n this.createKey = params.createKey;\n this.usingComplexObjects = !!params.usingComplexObjects;\n this.formatter = textFormatter || TextFilter.DEFAULT_FORMATTER;\n this.doesRowPassOtherFilters = doesRowPassOtherFilter;\n this.suppressSorting = suppressSorting || false;\n this.convertValuesToStrings = !!convertValuesToStrings;\n var keyComparator = comparator !== null && comparator !== void 0 ? comparator : colDef.comparator;\n var treeDataOrGrouping = !!treeDataTreeList || !!groupingTreeList;\n // If using complex objects and a comparator is provided, sort by values, otherwise need to sort by the string keys.\n // Also if tree data, grouping, or date with tree list, then need to do value sort\n this.compareByValue = !!((usingComplexObjects && keyComparator) || treeDataOrGrouping || (treeList && !treeListPathGetter));\n if (treeDataOrGrouping && !keyComparator) {\n this.entryComparator = this.createTreeDataOrGroupingComparator();\n }\n else if (treeList && !treeListPathGetter && !keyComparator) {\n this.entryComparator = function (_a, _b) {\n var _c = __read(_a, 2); _c[0]; var aValue = _c[1];\n var _d = __read(_b, 2); _d[0]; var bValue = _d[1];\n return _.defaultComparator(aValue, bValue);\n };\n }\n else {\n this.entryComparator = function (_a, _b) {\n var _c = __read(_a, 2); _c[0]; var aValue = _c[1];\n var _d = __read(_b, 2); _d[0]; var bValue = _d[1];\n return keyComparator(aValue, bValue);\n };\n }\n this.keyComparator = (_a = keyComparator) !== null && _a !== void 0 ? _a : _.defaultComparator;\n this.caseSensitive = !!caseSensitive;\n var getDataPath = gridOptionsService.get('getDataPath');\n if (rowModel.getType() === 'clientSide') {\n this.clientSideValuesExtractor = new ClientSideValuesExtractor(rowModel, this.filterParams, this.createKey, this.caseFormat, columnModel, valueService, treeDataOrGrouping, !!treeDataTreeList, getDataPath);\n }\n if (values == null) {\n this.valuesType = SetFilterModelValuesType.TAKEN_FROM_GRID_VALUES;\n }\n else {\n this.valuesType = Array.isArray(values) ?\n SetFilterModelValuesType.PROVIDED_LIST :\n SetFilterModelValuesType.PROVIDED_CALLBACK;\n this.providedValues = values;\n }\n this.displayValueModel = treeList ? new TreeSetDisplayValueModel(this.formatter, treeListPathGetter, treeListFormatter, treeDataTreeList || groupingTreeList) : new FlatSetDisplayValueModel(valueFormatterService, valueFormatter, this.formatter, column);\n this.updateAllValues().then(function (updatedKeys) { return _this.resetSelectionState(updatedKeys || []); });\n }\n SetValueModel.prototype.addEventListener = function (eventType, listener, async) {\n this.localEventService.addEventListener(eventType, listener, async);\n };\n SetValueModel.prototype.removeEventListener = function (eventType, listener, async) {\n this.localEventService.removeEventListener(eventType, listener, async);\n };\n /**\n * Re-fetches the values used in the filter from the value source.\n * If keepSelection is false, the filter selection will be reset to everything selected,\n * otherwise the current selection will be preserved.\n */\n SetValueModel.prototype.refreshValues = function () {\n var currentModel = this.getModel();\n this.updateAllValues();\n // ensure model is updated for new values\n return this.setModel(currentModel);\n };\n /**\n * Overrides the current values being used for the set filter.\n * If keepSelection is false, the filter selection will be reset to everything selected,\n * otherwise the current selection will be preserved.\n */\n SetValueModel.prototype.overrideValues = function (valuesToUse) {\n var _this = this;\n return new AgPromise(function (resolve) {\n // wait for any existing values to be populated before overriding\n _this.allValuesPromise.then(function () {\n _this.valuesType = SetFilterModelValuesType.PROVIDED_LIST;\n _this.providedValues = valuesToUse;\n _this.refreshValues().then(function () { return resolve(); });\n });\n });\n };\n /** @return has anything been updated */\n SetValueModel.prototype.refreshAfterAnyFilterChanged = function () {\n var _this = this;\n if (this.showAvailableOnly()) {\n return this.allValuesPromise.then(function (keys) {\n _this.updateAvailableKeys(keys !== null && keys !== void 0 ? keys : [], 'otherFilter');\n return true;\n });\n }\n return AgPromise.resolve(false);\n };\n SetValueModel.prototype.isInitialised = function () {\n return this.initialised;\n };\n SetValueModel.prototype.updateAllValues = function () {\n var _this = this;\n this.allValuesPromise = new AgPromise(function (resolve) {\n switch (_this.valuesType) {\n case SetFilterModelValuesType.TAKEN_FROM_GRID_VALUES:\n case SetFilterModelValuesType.PROVIDED_LIST: {\n resolve(_this.processAllKeys(_this.valuesType === SetFilterModelValuesType.TAKEN_FROM_GRID_VALUES, _this.providedValues));\n break;\n }\n case SetFilterModelValuesType.PROVIDED_CALLBACK: {\n _this.setIsLoading(true);\n var callback_1 = _this.providedValues;\n var _a = _this.filterParams, columnApi = _a.columnApi, api = _a.api, context = _a.context, column = _a.column, colDef = _a.colDef;\n var params_1 = {\n success: function (values) {\n _this.setIsLoading(false);\n resolve(_this.processAllKeys(false, values));\n },\n colDef: colDef,\n column: column,\n columnApi: columnApi,\n api: api,\n context: context,\n };\n window.setTimeout(function () { return callback_1(params_1); }, 0);\n break;\n }\n default:\n throw new Error('Unrecognised valuesType');\n }\n });\n this.allValuesPromise.then(function (values) { return _this.updateAvailableKeys(values || [], 'reload'); }).then(function () { return _this.initialised = true; });\n return this.allValuesPromise;\n };\n SetValueModel.prototype.processAllKeys = function (getFromRows, providedValues) {\n var values = getFromRows ? this.getValuesFromRows(false) : this.uniqueValues(this.validateProvidedValues(providedValues));\n var sortedKeys = this.sortKeys(values);\n this.allValues = values !== null && values !== void 0 ? values : new Map();\n return sortedKeys;\n };\n SetValueModel.prototype.validateProvidedValues = function (values) {\n if (this.usingComplexObjects && (values === null || values === void 0 ? void 0 : values.length)) {\n var firstValue = values[0];\n if (firstValue && typeof firstValue !== 'object' && typeof firstValue !== 'function') {\n var firstKey = this.createKey(firstValue);\n if (firstKey == null) {\n _.doOnce(function () { return console.warn('Set Filter Key Creator is returning null for provided values and provided values are primitives. Please provide complex objects or set convertValuesToStrings=true in the filterParams. See https://www.ag-grid.com/javascript-data-grid/filter-set-filter-list/#filter-value-types'); }, 'setFilterComplexObjectsProvidedNull');\n }\n else {\n _.doOnce(function () { return console.warn('AG Grid: Set Filter has a Key Creator, but provided values are primitives. Did you mean to provide complex objects or enable convertValuesToStrings?'); }, 'setFilterComplexObjectsProvidedPrimitive');\n }\n }\n }\n return values;\n };\n SetValueModel.prototype.setValuesType = function (value) {\n this.valuesType = value;\n };\n SetValueModel.prototype.getValuesType = function () {\n return this.valuesType;\n };\n SetValueModel.prototype.isKeyAvailable = function (key) {\n return this.availableKeys.has(key);\n };\n SetValueModel.prototype.showAvailableOnly = function () {\n return this.valuesType === SetFilterModelValuesType.TAKEN_FROM_GRID_VALUES;\n };\n SetValueModel.prototype.updateAvailableKeys = function (allKeys, source) {\n var availableKeys = this.showAvailableOnly() ? this.sortKeys(this.getValuesFromRows(true)) : allKeys;\n this.availableKeys = new Set(availableKeys);\n this.localEventService.dispatchEvent({ type: SetValueModel.EVENT_AVAILABLE_VALUES_CHANGED });\n this.updateDisplayedValues(source, allKeys);\n };\n SetValueModel.prototype.sortKeys = function (nullableValues) {\n var values = nullableValues !== null && nullableValues !== void 0 ? nullableValues : new Map();\n if (this.suppressSorting) {\n return Array.from(values.keys());\n }\n var sortedKeys;\n if (this.compareByValue) {\n sortedKeys = Array.from(values.entries()).sort(this.entryComparator).map(function (_a) {\n var _b = __read(_a, 1), key = _b[0];\n return key;\n });\n }\n else {\n sortedKeys = Array.from(values.keys()).sort(this.keyComparator);\n }\n if (this.filterParams.excelMode && values.has(null)) {\n // ensure the blank value always appears last\n sortedKeys = sortedKeys.filter(function (v) { return v != null; });\n sortedKeys.push(null);\n }\n return sortedKeys;\n };\n SetValueModel.prototype.getValuesFromRows = function (removeUnavailableValues) {\n var _this = this;\n if (removeUnavailableValues === void 0) { removeUnavailableValues = false; }\n if (!this.clientSideValuesExtractor) {\n console.error('AG Grid: Set Filter cannot initialise because you are using a row model that does not contain all rows in the browser. Either use a different filter type, or configure Set Filter such that you provide it with values');\n return null;\n }\n var predicate = function (node) { return (!removeUnavailableValues || _this.doesRowPassOtherFilters(node)); };\n return this.clientSideValuesExtractor.extractUniqueValues(predicate, removeUnavailableValues && !this.caseSensitive ? this.allValues : undefined);\n };\n /** Sets mini filter value. Returns true if it changed from last value, otherwise false. */\n SetValueModel.prototype.setMiniFilter = function (value) {\n value = _.makeNull(value);\n if (this.miniFilterText === value) {\n //do nothing if filter has not changed\n return false;\n }\n this.miniFilterText = value;\n this.updateDisplayedValues('miniFilter');\n return true;\n };\n SetValueModel.prototype.getMiniFilter = function () {\n return this.miniFilterText;\n };\n SetValueModel.prototype.updateDisplayedValues = function (source, allKeys) {\n var _this = this;\n if (source === 'expansion') {\n this.displayValueModel.refresh();\n return;\n }\n // if no filter, just display all available values\n if (this.miniFilterText == null) {\n this.displayValueModel.updateDisplayedValuesToAllAvailable(function (key) { return _this.getValue(key); }, allKeys, this.availableKeys, source);\n return;\n }\n // if filter present, we filter down the list\n // to allow for case insensitive searches, upper-case both filter text and value\n var formattedFilterText = this.caseFormat(this.formatter(this.miniFilterText) || '');\n var matchesFilter = function (valueToCheck) {\n return valueToCheck != null && _this.caseFormat(valueToCheck).indexOf(formattedFilterText) >= 0;\n };\n var nullMatchesFilter = !!this.filterParams.excelMode && matchesFilter(this.translate('blanks'));\n this.displayValueModel.updateDisplayedValuesToMatchMiniFilter(function (key) { return _this.getValue(key); }, allKeys, this.availableKeys, matchesFilter, nullMatchesFilter, source);\n };\n SetValueModel.prototype.getDisplayedValueCount = function () {\n return this.displayValueModel.getDisplayedValueCount();\n };\n SetValueModel.prototype.getDisplayedItem = function (index) {\n return this.displayValueModel.getDisplayedItem(index);\n };\n SetValueModel.prototype.getSelectAllItem = function () {\n return this.displayValueModel.getSelectAllItem();\n };\n SetValueModel.prototype.hasSelections = function () {\n return this.filterParams.defaultToNothingSelected ?\n this.selectedKeys.size > 0 :\n this.allValues.size !== this.selectedKeys.size;\n };\n SetValueModel.prototype.getKeys = function () {\n return Array.from(this.allValues.keys());\n };\n SetValueModel.prototype.getValues = function () {\n return Array.from(this.allValues.values());\n };\n SetValueModel.prototype.getValue = function (key) {\n return this.allValues.get(key);\n };\n SetValueModel.prototype.selectAllMatchingMiniFilter = function (clearExistingSelection) {\n var _this = this;\n if (clearExistingSelection === void 0) { clearExistingSelection = false; }\n if (this.miniFilterText == null) {\n // ensure everything is selected\n this.selectedKeys = new Set(this.allValues.keys());\n }\n else {\n // ensure everything that matches the mini filter is selected\n if (clearExistingSelection) {\n this.selectedKeys.clear();\n }\n this.displayValueModel.forEachDisplayedKey(function (key) { return _this.selectedKeys.add(key); });\n }\n };\n SetValueModel.prototype.deselectAllMatchingMiniFilter = function () {\n var _this = this;\n if (this.miniFilterText == null) {\n // ensure everything is deselected\n this.selectedKeys.clear();\n }\n else {\n // ensure everything that matches the mini filter is deselected\n this.displayValueModel.forEachDisplayedKey(function (key) { return _this.selectedKeys.delete(key); });\n }\n };\n SetValueModel.prototype.selectKey = function (key) {\n this.selectedKeys.add(key);\n };\n SetValueModel.prototype.deselectKey = function (key) {\n if (this.filterParams.excelMode && this.isEverythingVisibleSelected()) {\n // ensure we're starting from the correct \"everything selected\" state\n this.resetSelectionState(this.displayValueModel.getDisplayedKeys());\n }\n this.selectedKeys.delete(key);\n };\n SetValueModel.prototype.isKeySelected = function (key) {\n return this.selectedKeys.has(key);\n };\n SetValueModel.prototype.isEverythingVisibleSelected = function () {\n var _this = this;\n return !this.displayValueModel.someDisplayedKey(function (it) { return !_this.isKeySelected(it); });\n };\n SetValueModel.prototype.isNothingVisibleSelected = function () {\n var _this = this;\n return !this.displayValueModel.someDisplayedKey(function (it) { return _this.isKeySelected(it); });\n };\n SetValueModel.prototype.getModel = function () {\n return this.hasSelections() ? Array.from(this.selectedKeys) : null;\n };\n SetValueModel.prototype.setModel = function (model) {\n var _this = this;\n return this.allValuesPromise.then(function (keys) {\n if (model == null) {\n _this.resetSelectionState(keys !== null && keys !== void 0 ? keys : []);\n }\n else {\n // select all values from the model that exist in the filter\n _this.selectedKeys.clear();\n var existingFormattedKeys_1 = new Map();\n _this.allValues.forEach(function (_value, key) {\n existingFormattedKeys_1.set(_this.caseFormat(key), key);\n });\n model.forEach(function (unformattedKey) {\n var formattedKey = _this.caseFormat(unformattedKey);\n var existingUnformattedKey = existingFormattedKeys_1.get(formattedKey);\n if (existingUnformattedKey !== undefined) {\n _this.selectKey(existingUnformattedKey);\n }\n });\n }\n });\n };\n SetValueModel.prototype.uniqueValues = function (values) {\n var _this = this;\n var uniqueValues = new Map();\n var formattedKeys = new Set();\n (values !== null && values !== void 0 ? values : []).forEach(function (value) {\n var valueToUse = _.makeNull(value);\n var unformattedKey = _this.convertAndGetKey(valueToUse);\n var formattedKey = _this.caseFormat(unformattedKey);\n if (!formattedKeys.has(formattedKey)) {\n formattedKeys.add(formattedKey);\n uniqueValues.set(unformattedKey, valueToUse);\n }\n });\n return uniqueValues;\n };\n SetValueModel.prototype.convertAndGetKey = function (value) {\n return this.convertValuesToStrings ? value : this.createKey(value);\n };\n SetValueModel.prototype.resetSelectionState = function (keys) {\n if (this.filterParams.defaultToNothingSelected) {\n this.selectedKeys.clear();\n }\n else {\n this.selectedKeys = new Set(keys);\n }\n };\n SetValueModel.prototype.hasGroups = function () {\n return this.displayValueModel.hasGroups();\n };\n SetValueModel.prototype.createTreeDataOrGroupingComparator = function () {\n return function (_a, _b) {\n var _c = __read(_a, 2); _c[0]; var aValue = _c[1];\n var _d = __read(_b, 2); _d[0]; var bValue = _d[1];\n if (aValue == null) {\n return bValue == null ? 0 : -1;\n }\n else if (bValue == null) {\n return 1;\n }\n for (var i = 0; i < aValue.length; i++) {\n if (i >= bValue.length) {\n return 1;\n }\n var diff = _.defaultComparator(aValue[i], bValue[i]);\n if (diff !== 0) {\n return diff;\n }\n }\n return 0;\n };\n };\n SetValueModel.EVENT_AVAILABLE_VALUES_CHANGED = 'availableValuesChanged';\n return SetValueModel;\n}());\n\nvar __extends$i = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$d = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\n/** @param V type of value in the Set Filter */\nvar SetFilterListItem = /** @class */ (function (_super) {\n __extends$i(SetFilterListItem, _super);\n function SetFilterListItem(params) {\n var _a;\n var _this = _super.call(this, params.isGroup ? SetFilterListItem.GROUP_TEMPLATE : SetFilterListItem.TEMPLATE) || this;\n _this.focusWrapper = params.focusWrapper;\n _this.value = params.value;\n _this.params = params.params;\n _this.translate = params.translate;\n _this.valueFormatter = params.valueFormatter;\n _this.item = params.item;\n _this.isSelected = params.isSelected;\n _this.isTree = params.isTree;\n _this.depth = (_a = params.depth) !== null && _a !== void 0 ? _a : 0;\n _this.isGroup = params.isGroup;\n _this.groupsExist = params.groupsExist;\n _this.isExpanded = params.isExpanded;\n _this.hasIndeterminateExpandState = params.hasIndeterminateExpandState;\n return _this;\n }\n SetFilterListItem.prototype.init = function () {\n var _this = this;\n this.addDestroyFunc(function () { var _a; return (_a = _this.destroyCellRendererComponent) === null || _a === void 0 ? void 0 : _a.call(_this); });\n this.render();\n this.eCheckbox.setLabelEllipsis(true);\n this.eCheckbox.setValue(this.isSelected, true);\n this.eCheckbox.setDisabled(!!this.params.readOnly);\n this.eCheckbox.getInputElement().setAttribute('tabindex', '-1');\n this.refreshVariableAriaLabels();\n if (this.isTree) {\n if (this.depth > 0) {\n this.addCssClass('ag-set-filter-indent-' + this.depth);\n }\n if (this.isGroup) {\n this.setupExpansion();\n }\n else {\n if (this.groupsExist) {\n this.addCssClass('ag-set-filter-add-group-indent');\n }\n }\n _.setAriaLevel(this.focusWrapper, this.depth + 1);\n }\n if (!!this.params.readOnly) {\n // Don't add event listeners if we're read-only.\n return;\n }\n this.eCheckbox.onValueChange(function (value) { return _this.onCheckboxChanged(!!value); });\n };\n SetFilterListItem.prototype.setupExpansion = function () {\n this.eGroupClosedIcon.appendChild(_.createIcon('setFilterGroupClosed', this.gridOptionsService, null));\n this.eGroupOpenedIcon.appendChild(_.createIcon('setFilterGroupOpen', this.gridOptionsService, null));\n this.addManagedListener(this.eGroupClosedIcon, 'click', this.onExpandOrContractClicked.bind(this));\n this.addManagedListener(this.eGroupOpenedIcon, 'click', this.onExpandOrContractClicked.bind(this));\n if (this.hasIndeterminateExpandState) {\n this.eGroupIndeterminateIcon.appendChild(_.createIcon('setFilterGroupIndeterminate', this.gridOptionsService, null));\n this.addManagedListener(this.eGroupIndeterminateIcon, 'click', this.onExpandOrContractClicked.bind(this));\n }\n this.setExpandedIcons();\n this.refreshAriaExpanded();\n };\n SetFilterListItem.prototype.onExpandOrContractClicked = function () {\n this.setExpanded(!this.isExpanded);\n };\n SetFilterListItem.prototype.setExpanded = function (isExpanded, silent) {\n if (this.isGroup && isExpanded !== this.isExpanded) {\n this.isExpanded = isExpanded;\n var event_1 = {\n type: SetFilterListItem.EVENT_EXPANDED_CHANGED,\n isExpanded: !!isExpanded,\n item: this.item\n };\n if (!silent) {\n this.dispatchEvent(event_1);\n }\n this.setExpandedIcons();\n this.refreshAriaExpanded();\n }\n };\n SetFilterListItem.prototype.refreshAriaExpanded = function () {\n _.setAriaExpanded(this.focusWrapper, !!this.isExpanded);\n };\n SetFilterListItem.prototype.setExpandedIcons = function () {\n _.setDisplayed(this.eGroupClosedIcon, this.hasIndeterminateExpandState ? this.isExpanded === false : !this.isExpanded);\n _.setDisplayed(this.eGroupOpenedIcon, this.isExpanded === true);\n if (this.hasIndeterminateExpandState) {\n _.setDisplayed(this.eGroupIndeterminateIcon, this.isExpanded === undefined);\n }\n };\n SetFilterListItem.prototype.onCheckboxChanged = function (isSelected) {\n this.isSelected = isSelected;\n var event = {\n type: SetFilterListItem.EVENT_SELECTION_CHANGED,\n isSelected: isSelected,\n item: this.item\n };\n this.dispatchEvent(event);\n this.refreshVariableAriaLabels();\n };\n SetFilterListItem.prototype.toggleSelected = function () {\n if (!!this.params.readOnly) {\n return;\n }\n this.setSelected(!this.isSelected);\n };\n SetFilterListItem.prototype.setSelected = function (isSelected, silent) {\n this.isSelected = isSelected;\n this.eCheckbox.setValue(this.isSelected, silent);\n };\n SetFilterListItem.prototype.refreshVariableAriaLabels = function () {\n if (!this.isTree) {\n return;\n }\n var translate = this.localeService.getLocaleTextFunc();\n var checkboxValue = this.eCheckbox.getValue();\n var state = checkboxValue === undefined ?\n translate('ariaIndeterminate', 'indeterminate') :\n (checkboxValue ? translate('ariaVisible', 'visible') : translate('ariaHidden', 'hidden'));\n var visibilityLabel = translate('ariaToggleVisibility', 'Press SPACE to toggle visibility');\n _.setAriaLabelledBy(this.eCheckbox.getInputElement(), undefined);\n this.eCheckbox.setInputAriaLabel(visibilityLabel + \" (\" + state + \")\");\n };\n SetFilterListItem.prototype.setupFixedAriaLabels = function (value) {\n if (!this.isTree) {\n return;\n }\n var translate = this.localeService.getLocaleTextFunc();\n var itemLabel = translate('ariaFilterValue', 'Filter Value');\n _.setAriaLabel(this.focusWrapper, value + \" \" + itemLabel);\n _.setAriaDescribedBy(this.focusWrapper, this.eCheckbox.getInputElement().id);\n };\n SetFilterListItem.prototype.refresh = function (item, isSelected, isExpanded) {\n var _a, _b;\n this.item = item;\n // setExpanded checks if value has changed, setSelected does not\n if (isSelected !== this.isSelected) {\n this.setSelected(isSelected, true);\n }\n this.setExpanded(isExpanded, true);\n if (this.valueFunction) {\n // underlying value might have changed, so call again and re-render\n var value = this.valueFunction();\n this.setTooltipAndCellRendererParams(value, value);\n if (!this.cellRendererComponent) {\n this.renderCellWithoutCellRenderer();\n }\n }\n if (this.cellRendererComponent) {\n var success = (_b = (_a = this.cellRendererComponent).refresh) === null || _b === void 0 ? void 0 : _b.call(_a, this.cellRendererParams);\n if (!success) {\n var oldComponent = this.cellRendererComponent;\n this.renderCell();\n this.destroyBean(oldComponent);\n }\n }\n };\n SetFilterListItem.prototype.render = function () {\n var column = this.params.column;\n var value = this.value;\n var formattedValue = null;\n if (typeof value === 'function') {\n this.valueFunction = value;\n formattedValue = this.valueFunction();\n // backwards compatibility for select all in value\n value = formattedValue;\n }\n else if (this.isTree) {\n // tree values are already formatted via treeListFormatter\n formattedValue = _.toStringOrNull(value);\n }\n else {\n formattedValue = this.getFormattedValue(column, value);\n }\n this.setTooltipAndCellRendererParams(value, formattedValue);\n this.renderCell();\n };\n SetFilterListItem.prototype.setTooltipAndCellRendererParams = function (value, formattedValue) {\n if (this.params.showTooltips) {\n var tooltipValue = formattedValue != null ? formattedValue : _.toStringOrNull(value);\n this.setTooltip(tooltipValue);\n }\n this.cellRendererParams = {\n value: value,\n valueFormatted: formattedValue,\n api: this.gridOptionsService.api,\n columnApi: this.gridOptionsService.columnApi,\n context: this.gridOptionsService.context,\n colDef: this.params.colDef,\n column: this.params.column,\n };\n };\n SetFilterListItem.prototype.getTooltipParams = function () {\n var res = _super.prototype.getTooltipParams.call(this);\n res.location = 'setFilterValue';\n res.colDef = this.getComponentHolder();\n if (this.isTree) {\n res.level = this.depth;\n }\n return res;\n };\n SetFilterListItem.prototype.getFormattedValue = function (column, value) {\n return this.valueFormatterService.formatValue(column, null, value, this.valueFormatter, false);\n };\n SetFilterListItem.prototype.renderCell = function () {\n var _this = this;\n var compDetails = this.userComponentFactory.getSetFilterCellRendererDetails(this.params, this.cellRendererParams);\n var cellRendererPromise = compDetails ? compDetails.newAgStackInstance() : undefined;\n if (cellRendererPromise == null) {\n this.renderCellWithoutCellRenderer();\n return;\n }\n cellRendererPromise.then(function (component) {\n if (component) {\n _this.cellRendererComponent = component;\n _this.eCheckbox.setLabel(component.getGui());\n _this.destroyCellRendererComponent = function () { return _this.destroyBean(component); };\n }\n });\n };\n SetFilterListItem.prototype.renderCellWithoutCellRenderer = function () {\n var _a;\n var valueToRender = (_a = (this.cellRendererParams.valueFormatted == null ? this.cellRendererParams.value : this.cellRendererParams.valueFormatted)) !== null && _a !== void 0 ? _a : this.translate('blanks');\n if (typeof valueToRender !== 'string') {\n _.doOnce(function () { return console.warn('AG Grid: Set Filter Value Formatter must return string values. Please ensure the Set Filter Value Formatter returns string values for complex objects, or set convertValuesToStrings=true in the filterParams. See https://www.ag-grid.com/javascript-data-grid/filter-set-filter-list/#filter-value-types'); }, 'setFilterComplexObjectsValueFormatter');\n valueToRender = '';\n }\n this.eCheckbox.setLabel(valueToRender);\n this.setupFixedAriaLabels(valueToRender);\n };\n SetFilterListItem.prototype.getComponentHolder = function () {\n return this.params.column.getColDef();\n };\n SetFilterListItem.EVENT_SELECTION_CHANGED = 'selectionChanged';\n SetFilterListItem.EVENT_EXPANDED_CHANGED = 'expandedChanged';\n SetFilterListItem.GROUP_TEMPLATE = \"\\n
\\n \\n \\n \\n \\n \\n \\n
\";\n SetFilterListItem.TEMPLATE = \"\\n
\\n \\n
\";\n __decorate$d([\n Autowired('valueFormatterService')\n ], SetFilterListItem.prototype, \"valueFormatterService\", void 0);\n __decorate$d([\n Autowired('userComponentFactory')\n ], SetFilterListItem.prototype, \"userComponentFactory\", void 0);\n __decorate$d([\n RefSelector('eCheckbox')\n ], SetFilterListItem.prototype, \"eCheckbox\", void 0);\n __decorate$d([\n RefSelector('eGroupOpenedIcon')\n ], SetFilterListItem.prototype, \"eGroupOpenedIcon\", void 0);\n __decorate$d([\n RefSelector('eGroupClosedIcon')\n ], SetFilterListItem.prototype, \"eGroupClosedIcon\", void 0);\n __decorate$d([\n RefSelector('eGroupIndeterminateIcon')\n ], SetFilterListItem.prototype, \"eGroupIndeterminateIcon\", void 0);\n __decorate$d([\n PostConstruct\n ], SetFilterListItem.prototype, \"init\", null);\n return SetFilterListItem;\n}(Component));\n\nvar DEFAULT_LOCALE_TEXT = {\n loadingOoo: 'Loading...',\n blanks: '(Blanks)',\n searchOoo: 'Search...',\n selectAll: '(Select All)',\n selectAllSearchResults: '(Select All Search Results)',\n noMatches: 'No matches.'\n};\n\nvar SetFilterModelFormatter = /** @class */ (function () {\n function SetFilterModelFormatter() {\n }\n SetFilterModelFormatter.prototype.getModelAsString = function (model, setFilter) {\n var values = (model || setFilter.getModel() || {}).values;\n var valueModel = setFilter.getValueModel();\n if (values == null || valueModel == null) {\n return '';\n }\n var availableKeys = values.filter(function (v) { return valueModel.isKeyAvailable(v); });\n var numValues = availableKeys.length;\n var formattedValues = availableKeys.slice(0, 10).map(function (key) { return setFilter.getFormattedValue(key); });\n return \"(\" + numValues + \") \" + formattedValues.join(',') + (numValues > 10 ? ',...' : '');\n };\n return SetFilterModelFormatter;\n}());\n\nvar __extends$h = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$c = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\n/** @param V type of value in the Set Filter */\nvar SetFilter = /** @class */ (function (_super) {\n __extends$h(SetFilter, _super);\n function SetFilter() {\n var _this = _super.call(this, 'setFilter') || this;\n _this.valueModel = null;\n _this.setFilterParams = null;\n _this.virtualList = null;\n _this.caseSensitive = false;\n _this.convertValuesToStrings = false;\n _this.treeDataTreeList = false;\n _this.groupingTreeList = false;\n _this.hardRefreshVirtualList = false;\n _this.noValueFormatterSupplied = false;\n // To make the filtering super fast, we store the keys in an Set rather than using the default array\n _this.appliedModelKeys = null;\n _this.noAppliedModelKeys = false;\n _this.filterModelFormatter = new SetFilterModelFormatter();\n return _this;\n }\n SetFilter.prototype.postConstruct = function () {\n _super.prototype.postConstruct.call(this);\n };\n // unlike the simple filters, nothing in the set filter UI shows/hides.\n // maybe this method belongs in abstractSimpleFilter???\n SetFilter.prototype.updateUiVisibility = function () { };\n SetFilter.prototype.createBodyTemplate = function () {\n return /* html */ \"\\n
\\n
\" + this.translateForSetFilter('loadingOoo') + \"
\\n \\n
\" + this.translateForSetFilter('noMatches') + \"
\\n
\\n
\";\n };\n SetFilter.prototype.handleKeyDown = function (e) {\n _super.prototype.handleKeyDown.call(this, e);\n if (e.defaultPrevented) {\n return;\n }\n switch (e.key) {\n case KeyCode.SPACE:\n this.handleKeySpace(e);\n break;\n case KeyCode.ENTER:\n this.handleKeyEnter(e);\n break;\n case KeyCode.LEFT:\n this.handleKeyLeft(e);\n break;\n case KeyCode.RIGHT:\n this.handleKeyRight(e);\n break;\n }\n };\n SetFilter.prototype.handleKeySpace = function (e) {\n var _a;\n (_a = this.getComponentForKeyEvent(e)) === null || _a === void 0 ? void 0 : _a.toggleSelected();\n };\n SetFilter.prototype.handleKeyEnter = function (e) {\n if (!this.setFilterParams) {\n return;\n }\n var _a = this.setFilterParams || {}, excelMode = _a.excelMode, readOnly = _a.readOnly;\n if (!excelMode || !!readOnly) {\n return;\n }\n e.preventDefault();\n // in Excel Mode, hitting Enter is the same as pressing the Apply button\n this.onBtApply(false, false, e);\n if (this.setFilterParams.excelMode === 'mac') {\n // in Mac version, select all the input text\n this.eMiniFilter.getInputElement().select();\n }\n };\n SetFilter.prototype.handleKeyLeft = function (e) {\n var _a;\n (_a = this.getComponentForKeyEvent(e)) === null || _a === void 0 ? void 0 : _a.setExpanded(false);\n };\n SetFilter.prototype.handleKeyRight = function (e) {\n var _a;\n (_a = this.getComponentForKeyEvent(e)) === null || _a === void 0 ? void 0 : _a.setExpanded(true);\n };\n SetFilter.prototype.getComponentForKeyEvent = function (e) {\n var _a;\n var eDocument = this.gridOptionsService.getDocument();\n if (!this.eSetFilterList.contains(eDocument.activeElement) || !this.virtualList) {\n return;\n }\n var currentItem = this.virtualList.getLastFocusedRow();\n if (currentItem == null) {\n return;\n }\n var component = this.virtualList.getComponentAt(currentItem);\n if (component == null) {\n return;\n }\n e.preventDefault();\n var readOnly = ((_a = this.setFilterParams) !== null && _a !== void 0 ? _a : {}).readOnly;\n if (!!readOnly) {\n return;\n }\n return component;\n };\n SetFilter.prototype.getCssIdentifier = function () {\n return 'set-filter';\n };\n SetFilter.prototype.setModel = function (model) {\n var _a;\n if (model == null && ((_a = this.valueModel) === null || _a === void 0 ? void 0 : _a.getModel()) == null) {\n // refreshing is expensive. if new and old model are both null (e.g. nothing set), skip.\n // mini filter isn't contained within the model, so always reset\n this.setMiniFilter(null);\n return AgPromise.resolve();\n }\n return _super.prototype.setModel.call(this, model);\n };\n SetFilter.prototype.setModelAndRefresh = function (values) {\n var _this = this;\n return this.valueModel ? this.valueModel.setModel(values).then(function () { return _this.refresh(); }) : AgPromise.resolve();\n };\n SetFilter.prototype.resetUiToDefaults = function () {\n this.setMiniFilter(null);\n return this.setModelAndRefresh(null);\n };\n SetFilter.prototype.setModelIntoUi = function (model) {\n this.setMiniFilter(null);\n var values = model == null ? null : model.values;\n return this.setModelAndRefresh(values);\n };\n SetFilter.prototype.getModelFromUi = function () {\n if (!this.valueModel) {\n throw new Error('Value model has not been created.');\n }\n var values = this.valueModel.getModel();\n if (!values) {\n return null;\n }\n return { values: values, filterType: this.getFilterType() };\n };\n SetFilter.prototype.getFilterType = function () {\n return 'set';\n };\n SetFilter.prototype.getValueModel = function () {\n return this.valueModel;\n };\n SetFilter.prototype.areModelsEqual = function (a, b) {\n // both are missing\n if (a == null && b == null) {\n return true;\n }\n return a != null && b != null && _.areEqual(a.values, b.values);\n };\n SetFilter.prototype.setParams = function (params) {\n var _this = this;\n var _a;\n this.applyExcelModeOptions(params);\n _super.prototype.setParams.call(this, params);\n this.setFilterParams = params;\n this.convertValuesToStrings = !!params.convertValuesToStrings;\n this.caseSensitive = !!params.caseSensitive;\n var keyCreator = (_a = params.keyCreator) !== null && _a !== void 0 ? _a : params.colDef.keyCreator;\n this.setValueFormatter(params.valueFormatter, keyCreator, this.convertValuesToStrings, !!params.treeList, !!params.colDef.refData);\n var isGroupCol = params.column.getId().startsWith(GROUP_AUTO_COLUMN_ID);\n this.treeDataTreeList = this.gridOptionsService.is('treeData') && !!params.treeList && isGroupCol;\n this.getDataPath = this.gridOptionsService.get('getDataPath');\n this.groupingTreeList = !!this.columnModel.getRowGroupColumns().length && !!params.treeList && isGroupCol;\n this.createKey = this.generateCreateKey(keyCreator, this.convertValuesToStrings, this.treeDataTreeList || this.groupingTreeList);\n this.valueModel = new SetValueModel({\n filterParams: params,\n setIsLoading: function (loading) { return _this.setIsLoading(loading); },\n valueFormatterService: this.valueFormatterService,\n translate: function (key) { return _this.translateForSetFilter(key); },\n caseFormat: function (v) { return _this.caseFormat(v); },\n createKey: this.createKey,\n valueFormatter: this.valueFormatter,\n usingComplexObjects: !!keyCreator,\n gridOptionsService: this.gridOptionsService,\n columnModel: this.columnModel,\n valueService: this.valueService,\n treeDataTreeList: this.treeDataTreeList,\n groupingTreeList: this.groupingTreeList\n });\n this.initialiseFilterBodyUi();\n this.addEventListenersForDataChanges();\n };\n SetFilter.prototype.setValueFormatter = function (providedValueFormatter, keyCreator, convertValuesToStrings, treeList, isRefData) {\n var valueFormatter = providedValueFormatter;\n if (!valueFormatter) {\n if (keyCreator && !convertValuesToStrings && !treeList) {\n throw new Error('AG Grid: Must supply a Value Formatter in Set Filter params when using a Key Creator unless convertValuesToStrings is enabled');\n }\n this.noValueFormatterSupplied = true;\n // ref data is handled by ValueFormatterService\n if (!isRefData) {\n valueFormatter = function (params) { return _.toStringOrNull(params.value); };\n }\n }\n this.valueFormatter = valueFormatter;\n };\n SetFilter.prototype.generateCreateKey = function (keyCreator, convertValuesToStrings, treeDataOrGrouping) {\n var _this = this;\n if (treeDataOrGrouping && !keyCreator) {\n throw new Error('AG Grid: Must supply a Key Creator in Set Filter params when `treeList = true` on a group column, and Tree Data or Row Grouping is enabled.');\n }\n if (keyCreator) {\n return function (value, node) {\n if (node === void 0) { node = null; }\n var params = _this.getKeyCreatorParams(value, node);\n return _.makeNull(keyCreator(params));\n };\n }\n if (convertValuesToStrings) {\n // for backwards compatibility - keeping separate as it will eventually be removed\n return function (value) { return Array.isArray(value) ? value : _.makeNull(_.toStringOrNull(value)); };\n }\n else {\n return function (value) { return _.makeNull(_.toStringOrNull(value)); };\n }\n };\n SetFilter.prototype.getFormattedValue = function (key) {\n var _a;\n var value = this.valueModel.getValue(key);\n if (this.noValueFormatterSupplied && (this.treeDataTreeList || this.groupingTreeList) && Array.isArray(value)) {\n // essentially get back the cell value\n value = _.last(value);\n }\n var formattedValue = this.valueFormatterService.formatValue(this.setFilterParams.column, null, value, this.valueFormatter, false);\n return (_a = (formattedValue == null ? _.toStringOrNull(value) : formattedValue)) !== null && _a !== void 0 ? _a : this.translateForSetFilter('blanks');\n };\n SetFilter.prototype.applyExcelModeOptions = function (params) {\n // apply default options to match Excel behaviour, unless they have already been specified\n if (params.excelMode === 'windows') {\n if (!params.buttons) {\n params.buttons = ['apply', 'cancel'];\n }\n if (params.closeOnApply == null) {\n params.closeOnApply = true;\n }\n }\n else if (params.excelMode === 'mac') {\n if (!params.buttons) {\n params.buttons = ['reset'];\n }\n if (params.applyMiniFilterWhileTyping == null) {\n params.applyMiniFilterWhileTyping = true;\n }\n if (params.debounceMs == null) {\n params.debounceMs = 500;\n }\n }\n if (params.excelMode && params.defaultToNothingSelected) {\n params.defaultToNothingSelected = false;\n _.doOnce(function () { return console.warn('AG Grid: The Set Filter Parameter \"defaultToNothingSelected\" value was ignored because it does not work when \"excelMode\" is used.'); }, 'setFilterExcelModeDefaultToNothingSelect');\n }\n };\n SetFilter.prototype.addEventListenersForDataChanges = function () {\n var _this = this;\n if (!this.isValuesTakenFromGrid()) {\n return;\n }\n this.addManagedListener(this.eventService, Events.EVENT_CELL_VALUE_CHANGED, function (event) {\n // only interested in changes to do with this column\n if (_this.setFilterParams && event.column === _this.setFilterParams.column) {\n _this.syncAfterDataChange();\n }\n });\n };\n SetFilter.prototype.syncAfterDataChange = function () {\n var _this = this;\n if (!this.valueModel) {\n throw new Error('Value model has not been created.');\n }\n var promise = this.valueModel.refreshValues();\n return promise.then(function () {\n _this.refresh();\n _this.onBtApply(false, true);\n });\n };\n SetFilter.prototype.setIsLoading = function (isLoading) {\n _.setDisplayed(this.eFilterLoading, isLoading);\n if (!isLoading) {\n // hard refresh when async data received\n this.hardRefreshVirtualList = true;\n }\n };\n SetFilter.prototype.initialiseFilterBodyUi = function () {\n this.initVirtualList();\n this.initMiniFilter();\n };\n SetFilter.prototype.initVirtualList = function () {\n var _this = this;\n if (!this.setFilterParams) {\n throw new Error('Set filter params have not been provided.');\n }\n if (!this.valueModel) {\n throw new Error('Value model has not been created.');\n }\n var translate = this.localeService.getLocaleTextFunc();\n var filterListName = translate('ariaFilterList', 'Filter List');\n var isTree = !!this.setFilterParams.treeList;\n var virtualList = this.virtualList = this.createBean(new VirtualList('filter', isTree ? 'tree' : 'listbox', filterListName));\n var eSetFilterList = this.getRefElement('eSetFilterList');\n if (isTree) {\n eSetFilterList.classList.add('ag-set-filter-tree-list');\n }\n if (eSetFilterList) {\n eSetFilterList.appendChild(virtualList.getGui());\n }\n var cellHeight = this.setFilterParams.cellHeight;\n if (cellHeight != null) {\n virtualList.setRowHeight(cellHeight);\n }\n var componentCreator = function (item, listItemElement) { return _this.createSetListItem(item, isTree, listItemElement); };\n virtualList.setComponentCreator(componentCreator);\n var componentUpdater = function (item, component) { return _this.updateSetListItem(item, component); };\n virtualList.setComponentUpdater(componentUpdater);\n var model;\n if (this.setFilterParams.suppressSelectAll) {\n model = new ModelWrapper(this.valueModel);\n }\n else {\n model = new ModelWrapperWithSelectAll(this.valueModel, function () { return _this.isSelectAllSelected(); });\n }\n if (isTree) {\n model = new TreeModelWrapper(model);\n }\n virtualList.setModel(model);\n };\n SetFilter.prototype.getSelectAllLabel = function () {\n if (!this.setFilterParams) {\n throw new Error('Set filter params have not been provided.');\n }\n if (!this.valueModel) {\n throw new Error('Value model has not been created.');\n }\n var key = this.valueModel.getMiniFilter() == null || !this.setFilterParams.excelMode ?\n 'selectAll' : 'selectAllSearchResults';\n return this.translateForSetFilter(key);\n };\n SetFilter.prototype.createSetListItem = function (item, isTree, focusWrapper) {\n var _this = this;\n var _a, _b, _c, _d, _e, _f;\n if (!this.setFilterParams) {\n throw new Error('Set filter params have not been provided.');\n }\n if (!this.valueModel) {\n throw new Error('Value model has not been created.');\n }\n var groupsExist = this.valueModel.hasGroups();\n var value;\n var depth;\n var isGroup;\n var hasIndeterminateExpandState;\n var selectedListener;\n var expandedListener;\n if (this.isSetFilterModelTreeItem(item)) {\n depth = item.depth;\n if (item.key === SetFilterDisplayValue.SELECT_ALL) {\n // select all\n value = function () { return _this.getSelectAllLabel(); };\n isGroup = groupsExist;\n hasIndeterminateExpandState = true;\n selectedListener = function (e) { return _this.onSelectAll(e.isSelected); };\n expandedListener = function (e) { return _this.onExpandAll(e.item, e.isExpanded); };\n }\n else if (item.children) {\n // group\n value = (_c = (_b = (_a = this.setFilterParams).treeListFormatter) === null || _b === void 0 ? void 0 : _b.call(_a, item.treeKey, item.depth, item.parentTreeKeys)) !== null && _c !== void 0 ? _c : item.treeKey;\n isGroup = true;\n selectedListener = function (e) { return _this.onGroupItemSelected(e.item, e.isSelected); };\n expandedListener = function (e) { return _this.onExpandedChanged(e.item, e.isExpanded); };\n }\n else {\n // leaf\n value = (_f = (_e = (_d = this.setFilterParams).treeListFormatter) === null || _e === void 0 ? void 0 : _e.call(_d, item.treeKey, item.depth, item.parentTreeKeys)) !== null && _f !== void 0 ? _f : item.treeKey;\n selectedListener = function (e) { return _this.onItemSelected(e.item.key, e.isSelected); };\n }\n }\n else {\n if (item === SetFilterDisplayValue.SELECT_ALL) {\n value = function () { return _this.getSelectAllLabel(); };\n selectedListener = function (e) { return _this.onSelectAll(e.isSelected); };\n }\n else {\n value = this.valueModel.getValue(item);\n selectedListener = function (e) { return _this.onItemSelected(e.item, e.isSelected); };\n }\n }\n var _g = this.isSelectedExpanded(item), isSelected = _g.isSelected, isExpanded = _g.isExpanded;\n var itemParams = {\n focusWrapper: focusWrapper,\n value: value,\n params: this.setFilterParams,\n translate: function (translateKey) { return _this.translateForSetFilter(translateKey); },\n valueFormatter: this.valueFormatter,\n item: item,\n isSelected: isSelected,\n isTree: isTree,\n depth: depth,\n groupsExist: groupsExist,\n isGroup: isGroup,\n isExpanded: isExpanded,\n hasIndeterminateExpandState: hasIndeterminateExpandState,\n };\n var listItem = this.createBean(new SetFilterListItem(itemParams));\n listItem.addEventListener(SetFilterListItem.EVENT_SELECTION_CHANGED, selectedListener);\n if (expandedListener) {\n listItem.addEventListener(SetFilterListItem.EVENT_EXPANDED_CHANGED, expandedListener);\n }\n return listItem;\n };\n SetFilter.prototype.updateSetListItem = function (item, component) {\n var _a = this.isSelectedExpanded(item), isSelected = _a.isSelected, isExpanded = _a.isExpanded;\n component.refresh(item, isSelected, isExpanded);\n };\n SetFilter.prototype.isSelectedExpanded = function (item) {\n var isSelected;\n var isExpanded;\n if (this.isSetFilterModelTreeItem(item)) {\n isExpanded = item.expanded;\n if (item.key === SetFilterDisplayValue.SELECT_ALL) {\n isSelected = this.isSelectAllSelected();\n }\n else if (item.children) {\n isSelected = this.areAllChildrenSelected(item);\n }\n else {\n isSelected = this.valueModel.isKeySelected(item.key);\n }\n }\n else {\n if (item === SetFilterDisplayValue.SELECT_ALL) {\n isSelected = this.isSelectAllSelected();\n }\n else {\n isSelected = this.valueModel.isKeySelected(item);\n }\n }\n return { isSelected: isSelected, isExpanded: isExpanded };\n };\n SetFilter.prototype.isSetFilterModelTreeItem = function (item) {\n return (item === null || item === void 0 ? void 0 : item.treeKey) !== undefined;\n };\n SetFilter.prototype.initMiniFilter = function () {\n var _this = this;\n if (!this.setFilterParams) {\n throw new Error('Set filter params have not been provided.');\n }\n if (!this.valueModel) {\n throw new Error('Value model has not been created.');\n }\n var _a = this, eMiniFilter = _a.eMiniFilter, localeService = _a.localeService;\n var translate = localeService.getLocaleTextFunc();\n eMiniFilter.setDisplayed(!this.setFilterParams.suppressMiniFilter);\n eMiniFilter.setValue(this.valueModel.getMiniFilter());\n eMiniFilter.onValueChange(function () { return _this.onMiniFilterInput(); });\n eMiniFilter.setInputAriaLabel(translate('ariaSearchFilterValues', 'Search filter values'));\n this.addManagedListener(eMiniFilter.getInputElement(), 'keydown', function (e) { return _this.onMiniFilterKeyDown(e); });\n };\n // we need to have the GUI attached before we can draw the virtual rows, as the\n // virtual row logic needs info about the GUI state\n SetFilter.prototype.afterGuiAttached = function (params) {\n if (!this.setFilterParams) {\n throw new Error('Set filter params have not been provided.');\n }\n _super.prototype.afterGuiAttached.call(this, params);\n // collapse all tree list items (if tree list)\n this.resetExpansion();\n this.refreshVirtualList();\n var eMiniFilter = this.eMiniFilter;\n eMiniFilter.setInputPlaceholder(this.translateForSetFilter('searchOoo'));\n if (!params || !params.suppressFocus) {\n eMiniFilter.getFocusableElement().focus();\n }\n };\n SetFilter.prototype.afterGuiDetached = function () {\n var _a, _b;\n _super.prototype.afterGuiDetached.call(this);\n // discard any unapplied UI state (reset to model)\n if ((_a = this.setFilterParams) === null || _a === void 0 ? void 0 : _a.excelMode) {\n this.resetMiniFilter();\n }\n var appliedModel = this.getModel();\n if (((_b = this.setFilterParams) === null || _b === void 0 ? void 0 : _b.excelMode) || !this.areModelsEqual(appliedModel, this.getModelFromUi())) {\n this.resetUiToActiveModel(appliedModel);\n this.showOrHideResults();\n }\n };\n SetFilter.prototype.applyModel = function (source) {\n var _this = this;\n if (source === void 0) { source = 'api'; }\n if (!this.setFilterParams) {\n throw new Error('Set filter params have not been provided.');\n }\n if (!this.valueModel) {\n throw new Error('Value model has not been created.');\n }\n if (this.setFilterParams.excelMode && source !== 'rowDataUpdated' && this.valueModel.isEverythingVisibleSelected()) {\n // In Excel, if the filter is applied with all visible values selected, then any active filter on the\n // column is removed. This ensures the filter is removed in this situation.\n this.valueModel.selectAllMatchingMiniFilter();\n }\n var result = _super.prototype.applyModel.call(this, source);\n // keep appliedModelKeys in sync with the applied model\n var appliedModel = this.getModel();\n if (appliedModel) {\n this.appliedModelKeys = new Set();\n appliedModel.values.forEach(function (key) {\n _this.appliedModelKeys.add(_this.caseFormat(key));\n });\n }\n else {\n this.appliedModelKeys = null;\n }\n this.noAppliedModelKeys = (appliedModel === null || appliedModel === void 0 ? void 0 : appliedModel.values.length) === 0;\n return result;\n };\n SetFilter.prototype.isModelValid = function (model) {\n return this.setFilterParams && this.setFilterParams.excelMode ? model == null || model.values.length > 0 : true;\n };\n SetFilter.prototype.doesFilterPass = function (params) {\n var _this = this;\n if (!this.setFilterParams || !this.valueModel || !this.appliedModelKeys) {\n return true;\n }\n // if nothing selected, don't need to check value\n if (this.noAppliedModelKeys) {\n return false;\n }\n var node = params.node, data = params.data;\n if (this.treeDataTreeList) {\n return this.doesFilterPassForTreeData(node, data);\n }\n if (this.groupingTreeList) {\n return this.doesFilterPassForGrouping(node, data);\n }\n var value = this.getValueFromNode(node, data);\n if (this.convertValuesToStrings) {\n // for backwards compatibility - keeping separate as it will eventually be removed\n return this.doesFilterPassForConvertValuesToString(node, value);\n }\n if (value != null && Array.isArray(value)) {\n if (value.length === 0) {\n return this.appliedModelKeys.has(null);\n }\n return value.some(function (v) { return _this.isInAppliedModel(_this.createKey(v, node)); });\n }\n return this.isInAppliedModel(this.createKey(value, node));\n };\n SetFilter.prototype.doesFilterPassForConvertValuesToString = function (node, value) {\n var _this = this;\n var key = this.createKey(value, node);\n if (key != null && Array.isArray(key)) {\n if (key.length === 0) {\n return this.appliedModelKeys.has(null);\n }\n return key.some(function (v) { return _this.isInAppliedModel(v); });\n }\n return this.isInAppliedModel(key);\n };\n SetFilter.prototype.doesFilterPassForTreeData = function (node, data) {\n var _a;\n if ((_a = node.childrenAfterGroup) === null || _a === void 0 ? void 0 : _a.length) {\n // only perform checking on leaves. The core filtering logic for tree data won't work properly otherwise\n return false;\n }\n return this.isInAppliedModel(this.createKey(this.checkMakeNullDataPath(this.getDataPath(data))));\n };\n SetFilter.prototype.doesFilterPassForGrouping = function (node, data) {\n var _this = this;\n var dataPath = this.columnModel.getRowGroupColumns().map(function (groupCol) { return _this.valueService.getKeyForNode(groupCol, node); });\n dataPath.push(this.getValueFromNode(node, data));\n return this.isInAppliedModel(this.createKey(this.checkMakeNullDataPath(dataPath)));\n };\n SetFilter.prototype.checkMakeNullDataPath = function (dataPath) {\n if (dataPath) {\n dataPath = dataPath.map(function (treeKey) { return _.toStringOrNull(_.makeNull(treeKey)); });\n }\n if (dataPath === null || dataPath === void 0 ? void 0 : dataPath.some(function (treeKey) { return treeKey == null; })) {\n return null;\n }\n return dataPath;\n };\n SetFilter.prototype.isInAppliedModel = function (key) {\n return this.appliedModelKeys.has(this.caseFormat(key));\n };\n SetFilter.prototype.getValueFromNode = function (node, data) {\n var _a = this.setFilterParams, valueGetter = _a.valueGetter, api = _a.api, colDef = _a.colDef, column = _a.column, columnApi = _a.columnApi, context = _a.context;\n return valueGetter({\n api: api,\n colDef: colDef,\n column: column,\n columnApi: columnApi,\n context: context,\n data: data,\n getValue: function (field) { return data[field]; },\n node: node,\n });\n };\n SetFilter.prototype.getKeyCreatorParams = function (value, node) {\n if (node === void 0) { node = null; }\n return {\n value: value,\n colDef: this.setFilterParams.colDef,\n column: this.setFilterParams.column,\n node: node,\n data: node === null || node === void 0 ? void 0 : node.data,\n api: this.setFilterParams.api,\n columnApi: this.setFilterParams.columnApi,\n context: this.setFilterParams.context\n };\n };\n SetFilter.prototype.onNewRowsLoaded = function () {\n if (!this.isValuesTakenFromGrid()) {\n return;\n }\n this.syncAfterDataChange();\n };\n SetFilter.prototype.isValuesTakenFromGrid = function () {\n if (!this.valueModel) {\n return false;\n }\n var valuesType = this.valueModel.getValuesType();\n return valuesType === SetFilterModelValuesType.TAKEN_FROM_GRID_VALUES;\n };\n //noinspection JSUnusedGlobalSymbols\n /**\n * Public method provided so the user can change the value of the filter once\n * the filter has been already started\n * @param values The values to use.\n */\n SetFilter.prototype.setFilterValues = function (values) {\n var _this = this;\n if (!this.valueModel) {\n throw new Error('Value model has not been created.');\n }\n this.valueModel.overrideValues(values).then(function () {\n _this.refresh();\n _this.onUiChanged();\n });\n };\n //noinspection JSUnusedGlobalSymbols\n /**\n * Public method provided so the user can reset the values of the filter once that it has started.\n */\n SetFilter.prototype.resetFilterValues = function () {\n if (!this.valueModel) {\n throw new Error('Value model has not been created.');\n }\n this.valueModel.setValuesType(SetFilterModelValuesType.TAKEN_FROM_GRID_VALUES);\n this.syncAfterDataChange();\n };\n SetFilter.prototype.refreshFilterValues = function () {\n var _this = this;\n if (!this.valueModel) {\n throw new Error('Value model has not been created.');\n }\n // the model is still being initialised\n if (!this.valueModel.isInitialised()) {\n return;\n }\n this.valueModel.refreshValues().then(function () {\n _this.refresh();\n _this.onUiChanged();\n });\n };\n SetFilter.prototype.onAnyFilterChanged = function () {\n var _this = this;\n // don't block the current action when updating the values for this filter\n setTimeout(function () {\n if (!_this.isAlive()) {\n return;\n }\n if (!_this.valueModel) {\n throw new Error('Value model has not been created.');\n }\n _this.valueModel.refreshAfterAnyFilterChanged().then(function (refresh) {\n if (refresh) {\n _this.refresh();\n _this.showOrHideResults();\n }\n });\n }, 0);\n };\n SetFilter.prototype.onMiniFilterInput = function () {\n if (!this.setFilterParams) {\n throw new Error('Set filter params have not been provided.');\n }\n if (!this.valueModel) {\n throw new Error('Value model has not been created.');\n }\n if (!this.valueModel.setMiniFilter(this.eMiniFilter.getValue())) {\n return;\n }\n var _a = this.setFilterParams || {}, applyMiniFilterWhileTyping = _a.applyMiniFilterWhileTyping, readOnly = _a.readOnly;\n if (!readOnly && applyMiniFilterWhileTyping) {\n this.filterOnAllVisibleValues(false);\n }\n else {\n this.updateUiAfterMiniFilterChange();\n }\n };\n SetFilter.prototype.updateUiAfterMiniFilterChange = function () {\n if (!this.setFilterParams) {\n throw new Error('Set filter params have not been provided.');\n }\n if (!this.valueModel) {\n throw new Error('Value model has not been created.');\n }\n var _a = this.setFilterParams || {}, excelMode = _a.excelMode, readOnly = _a.readOnly;\n if (excelMode == null || !!readOnly) {\n this.refresh();\n }\n else if (this.valueModel.getMiniFilter() == null) {\n this.resetUiToActiveModel(this.getModel());\n }\n else {\n this.valueModel.selectAllMatchingMiniFilter(true);\n this.refresh();\n this.onUiChanged();\n }\n this.showOrHideResults();\n };\n SetFilter.prototype.showOrHideResults = function () {\n if (!this.valueModel) {\n throw new Error('Value model has not been created.');\n }\n var hideResults = this.valueModel.getMiniFilter() != null && this.valueModel.getDisplayedValueCount() < 1;\n _.setDisplayed(this.eNoMatches, hideResults);\n _.setDisplayed(this.eSetFilterList, !hideResults);\n };\n SetFilter.prototype.resetMiniFilter = function () {\n var _a;\n this.eMiniFilter.setValue(null, true);\n (_a = this.valueModel) === null || _a === void 0 ? void 0 : _a.setMiniFilter(null);\n };\n SetFilter.prototype.resetUiToActiveModel = function (currentModel, afterUiUpdatedFunc) {\n var _this = this;\n // override the default behaviour as we don't always want to clear the mini filter\n this.setModelAndRefresh(currentModel == null ? null : currentModel.values).then(function () {\n _this.onUiChanged(false, 'prevent');\n afterUiUpdatedFunc === null || afterUiUpdatedFunc === void 0 ? void 0 : afterUiUpdatedFunc();\n });\n };\n SetFilter.prototype.handleCancelEnd = function (e) {\n this.setMiniFilter(null);\n _super.prototype.handleCancelEnd.call(this, e);\n };\n SetFilter.prototype.onMiniFilterKeyDown = function (e) {\n var _a = this.setFilterParams || {}, excelMode = _a.excelMode, readOnly = _a.readOnly;\n if (e.key === KeyCode.ENTER && !excelMode && !readOnly) {\n this.filterOnAllVisibleValues();\n }\n };\n SetFilter.prototype.filterOnAllVisibleValues = function (applyImmediately) {\n if (applyImmediately === void 0) { applyImmediately = true; }\n var readOnly = (this.setFilterParams || {}).readOnly;\n if (!this.valueModel) {\n throw new Error('Value model has not been created.');\n }\n if (!!readOnly) {\n throw new Error('Unable to filter in readOnly mode.');\n }\n this.valueModel.selectAllMatchingMiniFilter(true);\n this.refresh();\n this.onUiChanged(false, applyImmediately ? 'immediately' : 'debounce');\n this.showOrHideResults();\n };\n SetFilter.prototype.focusRowIfAlive = function (rowIndex) {\n var _this = this;\n if (rowIndex == null) {\n return;\n }\n window.setTimeout(function () {\n if (!_this.virtualList) {\n throw new Error('Virtual list has not been created.');\n }\n if (_this.isAlive()) {\n _this.virtualList.focusRow(rowIndex);\n }\n }, 0);\n };\n SetFilter.prototype.onSelectAll = function (isSelected) {\n if (!this.valueModel) {\n throw new Error('Value model has not been created.');\n }\n if (!this.virtualList) {\n throw new Error('Virtual list has not been created.');\n }\n if (isSelected) {\n this.valueModel.selectAllMatchingMiniFilter();\n }\n else {\n this.valueModel.deselectAllMatchingMiniFilter();\n }\n this.refreshAfterSelection();\n };\n SetFilter.prototype.onGroupItemSelected = function (item, isSelected) {\n var _this = this;\n var recursiveGroupSelection = function (i) {\n if (i.children) {\n i.children.forEach(function (childItem) { return recursiveGroupSelection(childItem); });\n }\n else {\n _this.selectItem(i.key, isSelected);\n }\n };\n recursiveGroupSelection(item);\n this.refreshAfterSelection();\n };\n SetFilter.prototype.onItemSelected = function (key, isSelected) {\n if (!this.valueModel) {\n throw new Error('Value model has not been created.');\n }\n if (!this.virtualList) {\n throw new Error('Virtual list has not been created.');\n }\n this.selectItem(key, isSelected);\n this.refreshAfterSelection();\n };\n SetFilter.prototype.selectItem = function (key, isSelected) {\n if (isSelected) {\n this.valueModel.selectKey(key);\n }\n else {\n this.valueModel.deselectKey(key);\n }\n };\n SetFilter.prototype.onExpandAll = function (item, isExpanded) {\n var recursiveExpansion = function (i) {\n if (i.filterPasses && i.available && i.children) {\n i.children.forEach(function (childItem) { return recursiveExpansion(childItem); });\n i.expanded = isExpanded;\n }\n };\n recursiveExpansion(item);\n this.refreshAfterExpansion();\n };\n SetFilter.prototype.onExpandedChanged = function (item, isExpanded) {\n item.expanded = isExpanded;\n this.refreshAfterExpansion();\n };\n SetFilter.prototype.refreshAfterExpansion = function () {\n var focusedRow = this.virtualList.getLastFocusedRow();\n this.valueModel.updateDisplayedValues('expansion');\n this.refresh();\n this.focusRowIfAlive(focusedRow);\n };\n SetFilter.prototype.refreshAfterSelection = function () {\n var focusedRow = this.virtualList.getLastFocusedRow();\n this.refresh();\n this.onUiChanged();\n this.focusRowIfAlive(focusedRow);\n };\n SetFilter.prototype.setMiniFilter = function (newMiniFilter) {\n this.eMiniFilter.setValue(newMiniFilter);\n this.onMiniFilterInput();\n };\n SetFilter.prototype.getMiniFilter = function () {\n return this.valueModel ? this.valueModel.getMiniFilter() : null;\n };\n SetFilter.prototype.refresh = function () {\n if (!this.virtualList) {\n throw new Error('Virtual list has not been created.');\n }\n this.virtualList.refresh(!this.hardRefreshVirtualList);\n if (this.hardRefreshVirtualList) {\n this.hardRefreshVirtualList = false;\n }\n };\n SetFilter.prototype.getFilterKeys = function () {\n return this.valueModel ? this.valueModel.getKeys() : [];\n };\n SetFilter.prototype.getFilterValues = function () {\n return this.valueModel ? this.valueModel.getValues() : [];\n };\n SetFilter.prototype.getValues = function () {\n return this.getFilterKeys();\n };\n SetFilter.prototype.refreshVirtualList = function () {\n if (this.setFilterParams && this.setFilterParams.refreshValuesOnOpen) {\n this.refreshFilterValues();\n }\n else {\n this.refresh();\n }\n };\n SetFilter.prototype.translateForSetFilter = function (key) {\n var translate = this.localeService.getLocaleTextFunc();\n return translate(key, DEFAULT_LOCALE_TEXT[key]);\n };\n SetFilter.prototype.isSelectAllSelected = function () {\n if (!this.setFilterParams || !this.valueModel) {\n return false;\n }\n if (!this.setFilterParams.defaultToNothingSelected) {\n // everything selected by default\n if (this.valueModel.hasSelections() && this.valueModel.isNothingVisibleSelected()) {\n return false;\n }\n if (this.valueModel.isEverythingVisibleSelected()) {\n return true;\n }\n }\n else {\n // nothing selected by default\n if (this.valueModel.hasSelections() && this.valueModel.isEverythingVisibleSelected()) {\n return true;\n }\n if (this.valueModel.isNothingVisibleSelected()) {\n return false;\n }\n }\n // returning `undefined` means the checkbox status is indeterminate.\n return undefined;\n };\n SetFilter.prototype.areAllChildrenSelected = function (item) {\n var _this = this;\n var recursiveChildSelectionCheck = function (i) {\n if (i.children) {\n var someTrue_1 = false;\n var someFalse_1 = false;\n var mixed = i.children.some(function (child) {\n if (!child.filterPasses || !child.available) {\n return false;\n }\n var childSelected = recursiveChildSelectionCheck(child);\n if (childSelected === undefined) {\n return true;\n }\n if (childSelected) {\n someTrue_1 = true;\n }\n else {\n someFalse_1 = true;\n }\n return someTrue_1 && someFalse_1;\n });\n // returning `undefined` means the checkbox status is indeterminate.\n // if not mixed and some true, all must be true\n return mixed ? undefined : someTrue_1;\n }\n else {\n return _this.valueModel.isKeySelected(i.key);\n }\n };\n if (!this.setFilterParams.defaultToNothingSelected) {\n // everything selected by default\n return recursiveChildSelectionCheck(item);\n }\n else {\n // nothing selected by default\n return this.valueModel.hasSelections() && recursiveChildSelectionCheck(item);\n }\n };\n SetFilter.prototype.destroy = function () {\n if (this.virtualList != null) {\n this.virtualList.destroy();\n this.virtualList = null;\n }\n _super.prototype.destroy.call(this);\n };\n SetFilter.prototype.caseFormat = function (valueToFormat) {\n if (valueToFormat == null || typeof valueToFormat !== 'string') {\n return valueToFormat;\n }\n return this.caseSensitive ? valueToFormat : valueToFormat.toUpperCase();\n };\n SetFilter.prototype.resetExpansion = function () {\n var _a, _b;\n if (!((_a = this.setFilterParams) === null || _a === void 0 ? void 0 : _a.treeList)) {\n return;\n }\n var selectAllItem = (_b = this.valueModel) === null || _b === void 0 ? void 0 : _b.getSelectAllItem();\n if (this.isSetFilterModelTreeItem(selectAllItem)) {\n var recursiveCollapse_1 = function (i) {\n if (i.children) {\n i.children.forEach(function (childItem) { return recursiveCollapse_1(childItem); });\n i.expanded = false;\n }\n };\n recursiveCollapse_1(selectAllItem);\n this.valueModel.updateDisplayedValues('expansion');\n }\n };\n SetFilter.prototype.getModelAsString = function (model) {\n return this.filterModelFormatter.getModelAsString(model, this);\n };\n SetFilter.prototype.getPositionableElement = function () {\n return this.eSetFilterList;\n };\n __decorate$c([\n RefSelector('eMiniFilter')\n ], SetFilter.prototype, \"eMiniFilter\", void 0);\n __decorate$c([\n RefSelector('eFilterLoading')\n ], SetFilter.prototype, \"eFilterLoading\", void 0);\n __decorate$c([\n RefSelector('eSetFilterList')\n ], SetFilter.prototype, \"eSetFilterList\", void 0);\n __decorate$c([\n RefSelector('eFilterNoMatches')\n ], SetFilter.prototype, \"eNoMatches\", void 0);\n __decorate$c([\n Autowired('valueFormatterService')\n ], SetFilter.prototype, \"valueFormatterService\", void 0);\n __decorate$c([\n Autowired('columnModel')\n ], SetFilter.prototype, \"columnModel\", void 0);\n __decorate$c([\n Autowired('valueService')\n ], SetFilter.prototype, \"valueService\", void 0);\n return SetFilter;\n}(ProvidedFilter));\nvar ModelWrapper = /** @class */ (function () {\n function ModelWrapper(model) {\n this.model = model;\n }\n ModelWrapper.prototype.getRowCount = function () {\n return this.model.getDisplayedValueCount();\n };\n ModelWrapper.prototype.getRow = function (index) {\n return this.model.getDisplayedItem(index);\n };\n ModelWrapper.prototype.isRowSelected = function (index) {\n return this.model.isKeySelected(this.getRow(index));\n };\n ModelWrapper.prototype.areRowsEqual = function (oldRow, newRow) {\n return oldRow === newRow;\n };\n return ModelWrapper;\n}());\nvar ModelWrapperWithSelectAll = /** @class */ (function () {\n function ModelWrapperWithSelectAll(model, isSelectAllSelected) {\n this.model = model;\n this.isSelectAllSelected = isSelectAllSelected;\n }\n ModelWrapperWithSelectAll.prototype.getRowCount = function () {\n return this.model.getDisplayedValueCount() + 1;\n };\n ModelWrapperWithSelectAll.prototype.getRow = function (index) {\n return index === 0 ? this.model.getSelectAllItem() : this.model.getDisplayedItem(index - 1);\n };\n ModelWrapperWithSelectAll.prototype.isRowSelected = function (index) {\n return index === 0 ? this.isSelectAllSelected() : this.model.isKeySelected(this.getRow(index));\n };\n ModelWrapperWithSelectAll.prototype.areRowsEqual = function (oldRow, newRow) {\n return oldRow === newRow;\n };\n return ModelWrapperWithSelectAll;\n}());\n// isRowSelected is used by VirtualList to add aria tags for flat lists. We want to suppress this when using trees\nvar TreeModelWrapper = /** @class */ (function () {\n function TreeModelWrapper(model) {\n this.model = model;\n }\n TreeModelWrapper.prototype.getRowCount = function () {\n return this.model.getRowCount();\n };\n TreeModelWrapper.prototype.getRow = function (index) {\n return this.model.getRow(index);\n };\n TreeModelWrapper.prototype.areRowsEqual = function (oldRow, newRow) {\n if (oldRow == null && newRow == null) {\n return true;\n }\n return oldRow != null && newRow != null && oldRow.treeKey === newRow.treeKey && oldRow.depth === newRow.depth;\n };\n return TreeModelWrapper;\n}());\n\nvar __extends$g = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$b = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar SetFloatingFilterComp = /** @class */ (function (_super) {\n __extends$g(SetFloatingFilterComp, _super);\n function SetFloatingFilterComp() {\n var _this = _super.call(this, /* html */ \"\\n
\\n \\n
\") || this;\n _this.availableValuesListenerAdded = false;\n _this.filterModelFormatter = new SetFilterModelFormatter();\n return _this;\n }\n // this is a user component, and IComponent has \"public destroy()\" as part of the interface.\n // so we need to override destroy() just to make the method public.\n SetFloatingFilterComp.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n };\n SetFloatingFilterComp.prototype.init = function (params) {\n var displayName = this.columnModel.getDisplayNameForColumn(params.column, 'header', true);\n var translate = this.localeService.getLocaleTextFunc();\n this.eFloatingFilterText\n .setDisabled(true)\n .setInputAriaLabel(displayName + \" \" + translate('ariaFilterInput', 'Filter Input'))\n .addGuiEventListener('click', function () { return params.showParentFilter(); });\n this.params = params;\n };\n SetFloatingFilterComp.prototype.onParentModelChanged = function (parentModel) {\n this.updateFloatingFilterText(parentModel);\n };\n SetFloatingFilterComp.prototype.parentSetFilterInstance = function (cb) {\n this.params.parentFilterInstance(function (filter) {\n if (!(filter instanceof SetFilter)) {\n throw new Error('AG Grid - SetFloatingFilter expects SetFilter as its parent');\n }\n cb(filter);\n });\n };\n SetFloatingFilterComp.prototype.addAvailableValuesListener = function () {\n var _this = this;\n this.parentSetFilterInstance(function (setFilter) {\n var setValueModel = setFilter.getValueModel();\n if (!setValueModel) {\n return;\n }\n // unlike other filters, what we show in the floating filter can be different, even\n // if another filter changes. this is due to how set filter restricts its values based\n // on selections in other filters, e.g. if you filter Language to English, then the set filter\n // on Country will only show English speaking countries. Thus the list of items to show\n // in the floating filter can change.\n _this.addManagedListener(setValueModel, SetValueModel.EVENT_AVAILABLE_VALUES_CHANGED, function () { return _this.updateFloatingFilterText(); });\n });\n this.availableValuesListenerAdded = true;\n };\n SetFloatingFilterComp.prototype.updateFloatingFilterText = function (parentModel) {\n var _this = this;\n if (!this.availableValuesListenerAdded) {\n this.addAvailableValuesListener();\n }\n this.parentSetFilterInstance(function (setFilter) {\n _this.eFloatingFilterText.setValue(_this.filterModelFormatter.getModelAsString(parentModel, setFilter));\n });\n };\n __decorate$b([\n RefSelector('eFloatingFilterText')\n ], SetFloatingFilterComp.prototype, \"eFloatingFilterText\", void 0);\n __decorate$b([\n Autowired('columnModel')\n ], SetFloatingFilterComp.prototype, \"columnModel\", void 0);\n return SetFloatingFilterComp;\n}(Component));\n\n// DO NOT UPDATE MANUALLY: Generated from script during build time\nvar VERSION$3 = '30.0.6';\n\nvar SetFilterModule = {\n version: VERSION$3,\n moduleName: ModuleNames.SetFilterModule,\n beans: [],\n userComponents: [\n { componentName: 'agSetColumnFilter', componentClass: SetFilter },\n { componentName: 'agSetColumnFloatingFilter', componentClass: SetFloatingFilterComp },\n ],\n dependantModules: [\n EnterpriseCoreModule\n ]\n};\n\nvar __extends$f = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$a = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar StatusBarService = /** @class */ (function (_super) {\n __extends$f(StatusBarService, _super);\n // tslint:disable-next-line\n function StatusBarService() {\n var _this = _super.call(this) || this;\n _this.allComponents = {};\n return _this;\n }\n StatusBarService.prototype.registerStatusPanel = function (key, component) {\n this.allComponents[key] = component;\n };\n StatusBarService.prototype.getStatusPanel = function (key) {\n return this.allComponents[key];\n };\n StatusBarService = __decorate$a([\n Bean('statusBarService')\n ], StatusBarService);\n return StatusBarService;\n}(BeanStub));\n\nvar __extends$e = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$9 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar StatusBar = /** @class */ (function (_super) {\n __extends$e(StatusBar, _super);\n function StatusBar() {\n return _super.call(this, StatusBar.TEMPLATE) || this;\n }\n StatusBar.prototype.postConstruct = function () {\n var _a;\n var statusPanels = (_a = this.gridOptionsService.get('statusBar')) === null || _a === void 0 ? void 0 : _a.statusPanels;\n if (statusPanels) {\n var leftStatusPanelComponents = statusPanels\n .filter(function (componentConfig) { return componentConfig.align === 'left'; });\n this.createAndRenderComponents(leftStatusPanelComponents, this.eStatusBarLeft);\n var centerStatusPanelComponents = statusPanels\n .filter(function (componentConfig) { return componentConfig.align === 'center'; });\n this.createAndRenderComponents(centerStatusPanelComponents, this.eStatusBarCenter);\n var rightStatusPanelComponents = statusPanels\n .filter(function (componentConfig) { return (!componentConfig.align || componentConfig.align === 'right'); });\n this.createAndRenderComponents(rightStatusPanelComponents, this.eStatusBarRight);\n }\n else {\n this.setDisplayed(false);\n }\n };\n StatusBar.prototype.createAndRenderComponents = function (statusBarComponents, ePanelComponent) {\n var _this = this;\n var componentDetails = [];\n statusBarComponents.forEach(function (componentConfig) {\n var params = {};\n var compDetails = _this.userComponentFactory.getStatusPanelCompDetails(componentConfig, params);\n var promise = compDetails.newAgStackInstance();\n if (!promise) {\n return;\n }\n componentDetails.push({\n // default to the component name if no key supplied\n key: componentConfig.key || componentConfig.statusPanel,\n promise: promise\n });\n });\n AgPromise.all(componentDetails.map(function (details) { return details.promise; }))\n .then(function () {\n componentDetails.forEach(function (componentDetail) {\n componentDetail.promise.then(function (component) {\n var destroyFunc = function () {\n _this.getContext().destroyBean(component);\n };\n if (_this.isAlive()) {\n _this.statusBarService.registerStatusPanel(componentDetail.key, component);\n ePanelComponent.appendChild(component.getGui());\n _this.addDestroyFunc(destroyFunc);\n }\n else {\n destroyFunc();\n }\n });\n });\n });\n };\n StatusBar.TEMPLATE = \"
\\n
\\n
\\n
\\n
\";\n __decorate$9([\n Autowired('userComponentFactory')\n ], StatusBar.prototype, \"userComponentFactory\", void 0);\n __decorate$9([\n Autowired('statusBarService')\n ], StatusBar.prototype, \"statusBarService\", void 0);\n __decorate$9([\n RefSelector('eStatusBarLeft')\n ], StatusBar.prototype, \"eStatusBarLeft\", void 0);\n __decorate$9([\n RefSelector('eStatusBarCenter')\n ], StatusBar.prototype, \"eStatusBarCenter\", void 0);\n __decorate$9([\n RefSelector('eStatusBarRight')\n ], StatusBar.prototype, \"eStatusBarRight\", void 0);\n __decorate$9([\n PostConstruct\n ], StatusBar.prototype, \"postConstruct\", null);\n return StatusBar;\n}(Component));\n\nvar __extends$d = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$8 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar NameValueComp = /** @class */ (function (_super) {\n __extends$d(NameValueComp, _super);\n function NameValueComp() {\n return _super.call(this, NameValueComp.TEMPLATE) || this;\n }\n NameValueComp.prototype.setLabel = function (key, defaultValue) {\n // we want to hide until the first value comes in\n this.setDisplayed(false);\n var localeTextFunc = this.localeService.getLocaleTextFunc();\n this.eLabel.innerHTML = localeTextFunc(key, defaultValue);\n };\n NameValueComp.prototype.setValue = function (value) {\n this.eValue.innerHTML = value;\n };\n NameValueComp.TEMPLATE = \"
\\n : \\n \\n
\";\n __decorate$8([\n RefSelector('eLabel')\n ], NameValueComp.prototype, \"eLabel\", void 0);\n __decorate$8([\n RefSelector('eValue')\n ], NameValueComp.prototype, \"eValue\", void 0);\n return NameValueComp;\n}(Component));\n\nvar __extends$c = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$7 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar TotalAndFilteredRowsComp = /** @class */ (function (_super) {\n __extends$c(TotalAndFilteredRowsComp, _super);\n function TotalAndFilteredRowsComp() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n TotalAndFilteredRowsComp.prototype.postConstruct = function () {\n // this component is only really useful with client side row model\n if (this.gridApi.getModel().getType() !== 'clientSide') {\n console.warn(\"AG Grid: agTotalAndFilteredRowCountComponent should only be used with the client side row model.\");\n return;\n }\n this.setLabel('totalAndFilteredRows', 'Rows');\n this.addCssClass('ag-status-panel');\n this.addCssClass('ag-status-panel-total-and-filtered-row-count');\n this.setDisplayed(true);\n this.addManagedListener(this.eventService, Events.EVENT_MODEL_UPDATED, this.onDataChanged.bind(this));\n this.onDataChanged();\n };\n TotalAndFilteredRowsComp.prototype.onDataChanged = function () {\n var localeTextFunc = this.localeService.getLocaleTextFunc();\n var thousandSeparator = localeTextFunc('thousandSeparator', ',');\n var decimalSeparator = localeTextFunc('decimalSeparator', '.');\n var rowCount = _.formatNumberCommas(this.getFilteredRowCountValue(), thousandSeparator, decimalSeparator);\n var totalRowCount = _.formatNumberCommas(this.getTotalRowCount(), thousandSeparator, decimalSeparator);\n if (rowCount === totalRowCount) {\n this.setValue(rowCount);\n }\n else {\n var localeTextFunc_1 = this.localeService.getLocaleTextFunc();\n this.setValue(rowCount + \" \" + localeTextFunc_1('of', 'of') + \" \" + totalRowCount);\n }\n };\n TotalAndFilteredRowsComp.prototype.getFilteredRowCountValue = function () {\n var filteredRowCount = 0;\n this.gridApi.forEachNodeAfterFilter(function (node) {\n if (!node.group) {\n filteredRowCount++;\n }\n });\n return filteredRowCount;\n };\n TotalAndFilteredRowsComp.prototype.getTotalRowCount = function () {\n var totalRowCount = 0;\n this.gridApi.forEachNode(function (node) {\n if (!node.group) {\n totalRowCount++;\n }\n });\n return totalRowCount;\n };\n TotalAndFilteredRowsComp.prototype.init = function () { };\n // this is a user component, and IComponent has \"public destroy()\" as part of the interface.\n // so we need to override destroy() just to make the method public.\n TotalAndFilteredRowsComp.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n };\n __decorate$7([\n Autowired('gridApi')\n ], TotalAndFilteredRowsComp.prototype, \"gridApi\", void 0);\n __decorate$7([\n PostConstruct\n ], TotalAndFilteredRowsComp.prototype, \"postConstruct\", null);\n return TotalAndFilteredRowsComp;\n}(NameValueComp));\n\nvar __extends$b = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$6 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar FilteredRowsComp = /** @class */ (function (_super) {\n __extends$b(FilteredRowsComp, _super);\n function FilteredRowsComp() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n FilteredRowsComp.prototype.postConstruct = function () {\n this.setLabel('filteredRows', 'Filtered');\n // this component is only really useful with client side row model\n if (this.gridApi.getModel().getType() !== 'clientSide') {\n console.warn(\"AG Grid: agFilteredRowCountComponent should only be used with the client side row model.\");\n return;\n }\n this.addCssClass('ag-status-panel');\n this.addCssClass('ag-status-panel-filtered-row-count');\n this.setDisplayed(true);\n var listener = this.onDataChanged.bind(this);\n this.addManagedListener(this.eventService, Events.EVENT_MODEL_UPDATED, listener);\n listener();\n };\n FilteredRowsComp.prototype.onDataChanged = function () {\n var totalRowCountValue = this.getTotalRowCountValue();\n var filteredRowCountValue = this.getFilteredRowCountValue();\n var localeTextFunc = this.localeService.getLocaleTextFunc();\n var thousandSeparator = localeTextFunc('thousandSeparator', ',');\n var decimalSeparator = localeTextFunc('decimalSeparator', '.');\n this.setValue(_.formatNumberCommas(filteredRowCountValue, thousandSeparator, decimalSeparator));\n this.setDisplayed(totalRowCountValue !== filteredRowCountValue);\n };\n FilteredRowsComp.prototype.getTotalRowCountValue = function () {\n var totalRowCount = 0;\n this.gridApi.forEachNode(function (node) { return totalRowCount += 1; });\n return totalRowCount;\n };\n FilteredRowsComp.prototype.getFilteredRowCountValue = function () {\n var filteredRowCount = 0;\n this.gridApi.forEachNodeAfterFilter(function (node) {\n if (!node.group) {\n filteredRowCount += 1;\n }\n });\n return filteredRowCount;\n };\n FilteredRowsComp.prototype.init = function () { };\n // this is a user component, and IComponent has \"public destroy()\" as part of the interface.\n // so we need to override destroy() just to make the method public.\n FilteredRowsComp.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n };\n __decorate$6([\n Autowired('gridApi')\n ], FilteredRowsComp.prototype, \"gridApi\", void 0);\n __decorate$6([\n PostConstruct\n ], FilteredRowsComp.prototype, \"postConstruct\", null);\n return FilteredRowsComp;\n}(NameValueComp));\n\nvar __extends$a = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$5 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar TotalRowsComp = /** @class */ (function (_super) {\n __extends$a(TotalRowsComp, _super);\n function TotalRowsComp() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n TotalRowsComp.prototype.postConstruct = function () {\n this.setLabel('totalRows', 'Total Rows');\n // this component is only really useful with client side row model\n if (this.gridApi.getModel().getType() !== 'clientSide') {\n console.warn(\"AG Grid: agTotalRowCountComponent should only be used with the client side row model.\");\n return;\n }\n this.addCssClass('ag-status-panel');\n this.addCssClass('ag-status-panel-total-row-count');\n this.setDisplayed(true);\n this.addManagedListener(this.eventService, Events.EVENT_MODEL_UPDATED, this.onDataChanged.bind(this));\n this.onDataChanged();\n };\n TotalRowsComp.prototype.onDataChanged = function () {\n var localeTextFunc = this.localeService.getLocaleTextFunc();\n var thousandSeparator = localeTextFunc('thousandSeparator', ',');\n var decimalSeparator = localeTextFunc('decimalSeparator', '.');\n this.setValue(_.formatNumberCommas(this.getRowCountValue(), thousandSeparator, decimalSeparator));\n };\n TotalRowsComp.prototype.getRowCountValue = function () {\n var totalRowCount = 0;\n this.gridApi.forEachLeafNode(function (node) { return totalRowCount += 1; });\n return totalRowCount;\n };\n TotalRowsComp.prototype.init = function () {\n };\n // this is a user component, and IComponent has \"public destroy()\" as part of the interface.\n // so we need to override destroy() just to make the method public.\n TotalRowsComp.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n };\n __decorate$5([\n Autowired('gridApi')\n ], TotalRowsComp.prototype, \"gridApi\", void 0);\n __decorate$5([\n PostConstruct\n ], TotalRowsComp.prototype, \"postConstruct\", null);\n return TotalRowsComp;\n}(NameValueComp));\n\nvar __extends$9 = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$4 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar SelectedRowsComp = /** @class */ (function (_super) {\n __extends$9(SelectedRowsComp, _super);\n function SelectedRowsComp() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n SelectedRowsComp.prototype.postConstruct = function () {\n if (!this.isValidRowModel()) {\n console.warn(\"AG Grid: agSelectedRowCountComponent should only be used with the client and server side row model.\");\n return;\n }\n this.setLabel('selectedRows', 'Selected');\n this.addCssClass('ag-status-panel');\n this.addCssClass('ag-status-panel-selected-row-count');\n this.onRowSelectionChanged();\n var eventListener = this.onRowSelectionChanged.bind(this);\n this.addManagedListener(this.eventService, Events.EVENT_MODEL_UPDATED, eventListener);\n this.addManagedListener(this.eventService, Events.EVENT_SELECTION_CHANGED, eventListener);\n };\n SelectedRowsComp.prototype.isValidRowModel = function () {\n // this component is only really useful with client or server side rowmodels\n var rowModelType = this.gridApi.getModel().getType();\n return rowModelType === 'clientSide' || rowModelType === 'serverSide';\n };\n SelectedRowsComp.prototype.onRowSelectionChanged = function () {\n var selectedRowCount = this.selectionService.getSelectionCount();\n if (selectedRowCount < 0) {\n this.setValue('?');\n this.setDisplayed(true);\n return;\n }\n var localeTextFunc = this.localeService.getLocaleTextFunc();\n var thousandSeparator = localeTextFunc('thousandSeparator', ',');\n var decimalSeparator = localeTextFunc('decimalSeparator', '.');\n this.setValue(_.formatNumberCommas(selectedRowCount, thousandSeparator, decimalSeparator));\n this.setDisplayed(selectedRowCount > 0);\n };\n SelectedRowsComp.prototype.init = function () {\n };\n // this is a user component, and IComponent has \"public destroy()\" as part of the interface.\n // so we need to override destroy() just to make the method public.\n SelectedRowsComp.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n };\n __decorate$4([\n Autowired('gridApi')\n ], SelectedRowsComp.prototype, \"gridApi\", void 0);\n __decorate$4([\n Autowired('selectionService')\n ], SelectedRowsComp.prototype, \"selectionService\", void 0);\n __decorate$4([\n PostConstruct\n ], SelectedRowsComp.prototype, \"postConstruct\", null);\n return SelectedRowsComp;\n}(NameValueComp));\n\nvar __extends$8 = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$3 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar AggregationComp = /** @class */ (function (_super) {\n __extends$8(AggregationComp, _super);\n function AggregationComp() {\n return _super.call(this, AggregationComp.TEMPLATE) || this;\n }\n // this is a user component, and IComponent has \"public destroy()\" as part of the interface.\n // so we need to override destroy() just to make the method public.\n AggregationComp.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n };\n AggregationComp.prototype.postConstruct = function () {\n if (!this.isValidRowModel()) {\n console.warn(\"AG Grid: agAggregationComponent should only be used with the client and server side row model.\");\n return;\n }\n this.avgAggregationComp.setLabel('avg', 'Average');\n this.countAggregationComp.setLabel('count', 'Count');\n this.minAggregationComp.setLabel('min', 'Min');\n this.maxAggregationComp.setLabel('max', 'Max');\n this.sumAggregationComp.setLabel('sum', 'Sum');\n this.addManagedListener(this.eventService, Events.EVENT_RANGE_SELECTION_CHANGED, this.onRangeSelectionChanged.bind(this));\n this.addManagedListener(this.eventService, Events.EVENT_MODEL_UPDATED, this.onRangeSelectionChanged.bind(this));\n };\n AggregationComp.prototype.isValidRowModel = function () {\n // this component is only really useful with client or server side rowmodels\n var rowModelType = this.gridApi.getModel().getType();\n return rowModelType === 'clientSide' || rowModelType === 'serverSide';\n };\n AggregationComp.prototype.init = function () {\n };\n AggregationComp.prototype.setAggregationComponentValue = function (aggFuncName, value, visible) {\n var statusBarValueComponent = this.getAggregationValueComponent(aggFuncName);\n if (_.exists(statusBarValueComponent) && statusBarValueComponent) {\n var localeTextFunc = this.localeService.getLocaleTextFunc();\n var thousandSeparator = localeTextFunc('thousandSeparator', ',');\n var decimalSeparator = localeTextFunc('decimalSeparator', '.');\n statusBarValueComponent.setValue(_.formatNumberTwoDecimalPlacesAndCommas(value, thousandSeparator, decimalSeparator));\n statusBarValueComponent.setDisplayed(visible);\n }\n };\n AggregationComp.prototype.getAggregationValueComponent = function (aggFuncName) {\n // converts user supplied agg name to our reference - eg: sum => sumAggregationComp\n var refComponentName = aggFuncName + \"AggregationComp\";\n // if the user has specified the agAggregationPanelComp but no aggFuncs we show the all\n // if the user has specified the agAggregationPanelComp and aggFuncs, then we only show the aggFuncs listed\n var statusBarValueComponent = null;\n var statusBar = this.gridOptionsService.get('statusBar');\n var aggregationPanelConfig = _.exists(statusBar) && statusBar ? statusBar.statusPanels.find(function (panel) { return panel.statusPanel === 'agAggregationComponent'; }) : null;\n if (_.exists(aggregationPanelConfig) && aggregationPanelConfig) {\n // a little defensive here - if no statusPanelParams show it, if componentParams we also expect aggFuncs\n if (!_.exists(aggregationPanelConfig.statusPanelParams) ||\n (_.exists(aggregationPanelConfig.statusPanelParams) &&\n _.exists(aggregationPanelConfig.statusPanelParams.aggFuncs) &&\n _.exists(aggregationPanelConfig.statusPanelParams.aggFuncs.find(function (func) { return func === aggFuncName; })))) {\n statusBarValueComponent = this[refComponentName];\n }\n }\n else {\n // components not specified - assume we can show this component\n statusBarValueComponent = this[refComponentName];\n }\n // either we can't find it (which would indicate a typo or similar user side), or the user has deliberately\n // not listed the component in aggFuncs\n return statusBarValueComponent;\n };\n AggregationComp.prototype.onRangeSelectionChanged = function () {\n var _this = this;\n var cellRanges = this.rangeService ? this.rangeService.getCellRanges() : undefined;\n var sum = 0;\n var count = 0;\n var numberCount = 0;\n var min = null;\n var max = null;\n var cellsSoFar = {};\n if (cellRanges && !_.missingOrEmpty(cellRanges)) {\n cellRanges.forEach(function (cellRange) {\n var currentRow = _this.rangeService.getRangeStartRow(cellRange);\n var lastRow = _this.rangeService.getRangeEndRow(cellRange);\n while (true) {\n var finishedAllRows = _.missing(currentRow) || !currentRow || _this.rowPositionUtils.before(lastRow, currentRow);\n if (finishedAllRows || !currentRow || !cellRange.columns) {\n break;\n }\n cellRange.columns.forEach(function (col) {\n if (currentRow === null) {\n return;\n }\n // we only want to include each cell once, in case a cell is in multiple ranges\n var cellId = _this.cellPositionUtils.createId({\n rowPinned: currentRow.rowPinned,\n column: col,\n rowIndex: currentRow.rowIndex\n });\n if (cellsSoFar[cellId]) {\n return;\n }\n cellsSoFar[cellId] = true;\n var rowNode = _this.rowRenderer.getRowNode(currentRow);\n if (_.missing(rowNode)) {\n return;\n }\n var value = _this.valueService.getValue(col, rowNode);\n // if empty cell, skip it, doesn't impact count or anything\n if (_.missing(value) || value === '') {\n return;\n }\n count++;\n // see if value is wrapped, can happen when doing count() or avg() functions\n if (typeof value === 'object' && 'value' in value) {\n value = value.value;\n // ensure that the new value wouldn't have been skipped by the previous check\n if (value === '') {\n return;\n }\n }\n if (typeof value === 'string') {\n value = Number(value);\n }\n if (typeof value === 'number' && !isNaN(value)) {\n sum += value;\n if (max === null || value > max) {\n max = value;\n }\n if (min === null || value < min) {\n min = value;\n }\n numberCount++;\n }\n });\n currentRow = _this.cellNavigationService.getRowBelow(currentRow);\n }\n });\n }\n var gotResult = count > 1;\n var gotNumberResult = numberCount > 1;\n // we show count even if no numbers\n this.setAggregationComponentValue('count', count, gotResult);\n // show if numbers found\n this.setAggregationComponentValue('sum', sum, gotNumberResult);\n this.setAggregationComponentValue('min', min, gotNumberResult);\n this.setAggregationComponentValue('max', max, gotNumberResult);\n this.setAggregationComponentValue('avg', (sum / numberCount), gotNumberResult);\n };\n AggregationComp.TEMPLATE = \"
\\n \\n \\n \\n \\n \\n
\";\n __decorate$3([\n Optional('rangeService')\n ], AggregationComp.prototype, \"rangeService\", void 0);\n __decorate$3([\n Autowired('valueService')\n ], AggregationComp.prototype, \"valueService\", void 0);\n __decorate$3([\n Autowired('cellNavigationService')\n ], AggregationComp.prototype, \"cellNavigationService\", void 0);\n __decorate$3([\n Autowired('rowRenderer')\n ], AggregationComp.prototype, \"rowRenderer\", void 0);\n __decorate$3([\n Autowired('gridApi')\n ], AggregationComp.prototype, \"gridApi\", void 0);\n __decorate$3([\n Autowired('cellPositionUtils')\n ], AggregationComp.prototype, \"cellPositionUtils\", void 0);\n __decorate$3([\n Autowired('rowPositionUtils')\n ], AggregationComp.prototype, \"rowPositionUtils\", void 0);\n __decorate$3([\n RefSelector('sumAggregationComp')\n ], AggregationComp.prototype, \"sumAggregationComp\", void 0);\n __decorate$3([\n RefSelector('countAggregationComp')\n ], AggregationComp.prototype, \"countAggregationComp\", void 0);\n __decorate$3([\n RefSelector('minAggregationComp')\n ], AggregationComp.prototype, \"minAggregationComp\", void 0);\n __decorate$3([\n RefSelector('maxAggregationComp')\n ], AggregationComp.prototype, \"maxAggregationComp\", void 0);\n __decorate$3([\n RefSelector('avgAggregationComp')\n ], AggregationComp.prototype, \"avgAggregationComp\", void 0);\n __decorate$3([\n PostConstruct\n ], AggregationComp.prototype, \"postConstruct\", null);\n return AggregationComp;\n}(Component));\n\n// DO NOT UPDATE MANUALLY: Generated from script during build time\nvar VERSION$2 = '30.0.6';\n\nvar StatusBarModule = {\n version: VERSION$2,\n moduleName: ModuleNames.StatusBarModule,\n beans: [StatusBarService],\n agStackComponents: [\n { componentName: 'AgStatusBar', componentClass: StatusBar },\n { componentName: 'AgNameValue', componentClass: NameValueComp },\n ],\n userComponents: [\n { componentName: 'agAggregationComponent', componentClass: AggregationComp },\n { componentName: 'agSelectedRowCountComponent', componentClass: SelectedRowsComp },\n { componentName: 'agTotalRowCountComponent', componentClass: TotalRowsComp },\n { componentName: 'agFilteredRowCountComponent', componentClass: FilteredRowsComp },\n { componentName: 'agTotalAndFilteredRowCountComponent', componentClass: TotalAndFilteredRowsComp }\n ],\n dependantModules: [\n EnterpriseCoreModule\n ]\n};\n\n// DO NOT UPDATE MANUALLY: Generated from script during build time\nvar VERSION$1 = '30.0.6';\n\nvar __extends$7 = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate$2 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar DEFAULT_VIEWPORT_ROW_MODEL_PAGE_SIZE = 5;\nvar DEFAULT_VIEWPORT_ROW_MODEL_BUFFER_SIZE = 5;\nvar ViewportRowModel = /** @class */ (function (_super) {\n __extends$7(ViewportRowModel, _super);\n function ViewportRowModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n // rowRenderer tells us these\n _this.firstRow = -1;\n _this.lastRow = -1;\n // datasource tells us this\n _this.rowCount = -1;\n _this.rowNodesByIndex = {};\n return _this;\n }\n // we don't implement as lazy row heights is not supported in this row model\n ViewportRowModel.prototype.ensureRowHeightsValid = function (startPixel, endPixel, startLimitIndex, endLimitIndex) { return false; };\n ViewportRowModel.prototype.init = function () {\n this.rowHeight = this.gridOptionsService.getRowHeightAsNumber();\n this.addManagedListener(this.eventService, Events.EVENT_VIEWPORT_CHANGED, this.onViewportChanged.bind(this));\n };\n ViewportRowModel.prototype.start = function () {\n if (this.gridOptionsService.get('viewportDatasource')) {\n this.setViewportDatasource(this.gridOptionsService.get('viewportDatasource'));\n }\n };\n ViewportRowModel.prototype.isLastRowIndexKnown = function () {\n return true;\n };\n ViewportRowModel.prototype.destroyDatasource = function () {\n if (!this.viewportDatasource) {\n return;\n }\n if (this.viewportDatasource.destroy) {\n this.viewportDatasource.destroy();\n }\n this.rowRenderer.datasourceChanged();\n this.firstRow = -1;\n this.lastRow = -1;\n };\n ViewportRowModel.prototype.getViewportRowModelPageSize = function () {\n return _.oneOrGreater(this.gridOptionsService.getNum('viewportRowModelPageSize'), DEFAULT_VIEWPORT_ROW_MODEL_PAGE_SIZE);\n };\n ViewportRowModel.prototype.getViewportRowModelBufferSize = function () {\n return _.zeroOrGreater(this.gridOptionsService.getNum('viewportRowModelBufferSize'), DEFAULT_VIEWPORT_ROW_MODEL_BUFFER_SIZE);\n };\n ViewportRowModel.prototype.calculateFirstRow = function (firstRenderedRow) {\n var bufferSize = this.getViewportRowModelBufferSize();\n var pageSize = this.getViewportRowModelPageSize();\n var afterBuffer = firstRenderedRow - bufferSize;\n if (afterBuffer < 0) {\n return 0;\n }\n return Math.floor(afterBuffer / pageSize) * pageSize;\n };\n ViewportRowModel.prototype.calculateLastRow = function (lastRenderedRow) {\n if (lastRenderedRow === -1) {\n return lastRenderedRow;\n }\n var bufferSize = this.getViewportRowModelBufferSize();\n var pageSize = this.getViewportRowModelPageSize();\n var afterBuffer = lastRenderedRow + bufferSize;\n var result = Math.ceil(afterBuffer / pageSize) * pageSize;\n var lastRowIndex = this.rowCount - 1;\n return Math.min(result, lastRowIndex);\n };\n ViewportRowModel.prototype.onViewportChanged = function (event) {\n var newFirst = this.calculateFirstRow(event.firstRow);\n var newLast = this.calculateLastRow(event.lastRow);\n if (this.firstRow !== newFirst || this.lastRow !== newLast) {\n this.firstRow = newFirst;\n this.lastRow = newLast;\n this.purgeRowsNotInViewport();\n if (this.viewportDatasource) {\n this.viewportDatasource.setViewportRange(this.firstRow, this.lastRow);\n }\n }\n };\n ViewportRowModel.prototype.purgeRowsNotInViewport = function () {\n var _this = this;\n Object.keys(this.rowNodesByIndex).forEach(function (indexStr) {\n var index = parseInt(indexStr, 10);\n if (index < _this.firstRow || index > _this.lastRow) {\n if (_this.isRowFocused(index)) {\n return;\n }\n delete _this.rowNodesByIndex[index];\n }\n });\n };\n ViewportRowModel.prototype.isRowFocused = function (rowIndex) {\n var focusedCell = this.focusService.getFocusCellToUseAfterRefresh();\n if (!focusedCell) {\n return false;\n }\n if (focusedCell.rowPinned != null) {\n return false;\n }\n var hasFocus = focusedCell.rowIndex === rowIndex;\n return hasFocus;\n };\n ViewportRowModel.prototype.setViewportDatasource = function (viewportDatasource) {\n this.destroyDatasource();\n this.viewportDatasource = viewportDatasource;\n this.rowCount = -1;\n if (!viewportDatasource.init) {\n console.warn('AG Grid: viewport is missing init method.');\n }\n else {\n viewportDatasource.init({\n setRowCount: this.setRowCount.bind(this),\n setRowData: this.setRowData.bind(this),\n getRow: this.getRow.bind(this)\n });\n }\n };\n ViewportRowModel.prototype.getType = function () {\n return 'viewport';\n };\n ViewportRowModel.prototype.getRow = function (rowIndex) {\n if (!this.rowNodesByIndex[rowIndex]) {\n this.rowNodesByIndex[rowIndex] = this.createBlankRowNode(rowIndex);\n }\n return this.rowNodesByIndex[rowIndex];\n };\n ViewportRowModel.prototype.getRowNode = function (id) {\n var result;\n this.forEachNode(function (rowNode) {\n if (rowNode.id === id) {\n result = rowNode;\n }\n });\n return result;\n };\n ViewportRowModel.prototype.getRowCount = function () {\n return this.rowCount === -1 ? 0 : this.rowCount;\n };\n ViewportRowModel.prototype.getRowIndexAtPixel = function (pixel) {\n if (this.rowHeight !== 0) { // avoid divide by zero error\n return Math.floor(pixel / this.rowHeight);\n }\n return 0;\n };\n ViewportRowModel.prototype.getRowBounds = function (index) {\n return {\n rowHeight: this.rowHeight,\n rowTop: this.rowHeight * index\n };\n };\n ViewportRowModel.prototype.getTopLevelRowCount = function () {\n return this.getRowCount();\n };\n ViewportRowModel.prototype.getTopLevelRowDisplayedIndex = function (topLevelIndex) {\n return topLevelIndex;\n };\n ViewportRowModel.prototype.isEmpty = function () {\n return this.rowCount > 0;\n };\n ViewportRowModel.prototype.isRowsToRender = function () {\n return this.rowCount > 0;\n };\n ViewportRowModel.prototype.getNodesInRangeForSelection = function (firstInRange, lastInRange) {\n var firstIndex = _.missing(firstInRange) ? 0 : firstInRange.rowIndex;\n var lastIndex = lastInRange.rowIndex;\n var firstNodeOutOfRange = firstIndex < this.firstRow || firstIndex > this.lastRow;\n var lastNodeOutOfRange = lastIndex < this.firstRow || lastIndex > this.lastRow;\n if (firstNodeOutOfRange || lastNodeOutOfRange) {\n return [];\n }\n var result = [];\n var startIndex = firstIndex <= lastIndex ? firstIndex : lastIndex;\n var endIndex = firstIndex <= lastIndex ? lastIndex : firstIndex;\n for (var i = startIndex; i <= endIndex; i++) {\n result.push(this.rowNodesByIndex[i]);\n }\n return result;\n };\n ViewportRowModel.prototype.forEachNode = function (callback) {\n var _this = this;\n var callbackCount = 0;\n Object.keys(this.rowNodesByIndex).forEach(function (indexStr) {\n var index = parseInt(indexStr, 10);\n var rowNode = _this.rowNodesByIndex[index];\n callback(rowNode, callbackCount);\n callbackCount++;\n });\n };\n ViewportRowModel.prototype.setRowData = function (rowData) {\n var _this = this;\n _.iterateObject(rowData, function (indexStr, dataItem) {\n var index = parseInt(indexStr, 10);\n // we should never keep rows that we didn't specifically ask for, this\n // guarantees the contract we have with the server.\n if (index >= _this.firstRow && index <= _this.lastRow) {\n var rowNode = _this.rowNodesByIndex[index];\n // the abnormal case is we requested a row even though the grid didn't need it\n // as a result of the paging and buffer (ie the row is off screen), in which\n // case we need to create a new node now\n if (_.missing(rowNode)) {\n rowNode = _this.createBlankRowNode(index);\n _this.rowNodesByIndex[index] = rowNode;\n }\n // now we deffo have a row node, so set in the details\n // if the grid already asked for this row (the normal case), then we would\n // of put a placeholder node in place.\n rowNode.setDataAndId(dataItem, index.toString());\n }\n });\n };\n ViewportRowModel.prototype.createBlankRowNode = function (rowIndex) {\n var rowNode = new RowNode(this.beans);\n rowNode.setRowHeight(this.rowHeight);\n rowNode.setRowTop(this.rowHeight * rowIndex);\n rowNode.setRowIndex(rowIndex);\n return rowNode;\n };\n ViewportRowModel.prototype.setRowCount = function (rowCount, keepRenderedRows) {\n if (keepRenderedRows === void 0) { keepRenderedRows = false; }\n if (rowCount === this.rowCount) {\n return;\n }\n this.rowCount = rowCount;\n var event = {\n type: Events.EVENT_MODEL_UPDATED,\n newData: false,\n newPage: false,\n keepRenderedRows: keepRenderedRows,\n animate: false\n };\n this.eventService.dispatchEvent(event);\n };\n ViewportRowModel.prototype.isRowPresent = function (rowNode) {\n var foundRowNode = this.getRowNode(rowNode.id);\n return !!foundRowNode;\n };\n __decorate$2([\n Autowired('rowRenderer')\n ], ViewportRowModel.prototype, \"rowRenderer\", void 0);\n __decorate$2([\n Autowired('focusService')\n ], ViewportRowModel.prototype, \"focusService\", void 0);\n __decorate$2([\n Autowired('beans')\n ], ViewportRowModel.prototype, \"beans\", void 0);\n __decorate$2([\n PostConstruct\n ], ViewportRowModel.prototype, \"init\", null);\n __decorate$2([\n PreDestroy\n ], ViewportRowModel.prototype, \"destroyDatasource\", null);\n ViewportRowModel = __decorate$2([\n Bean('rowModel')\n ], ViewportRowModel);\n return ViewportRowModel;\n}(BeanStub));\n\nvar ViewportRowModelModule = {\n version: VERSION$1,\n moduleName: ModuleNames.ViewportRowModelModule,\n rowModel: 'viewport',\n beans: [ViewportRowModel],\n dependantModules: [\n EnterpriseCoreModule\n ]\n};\n\nvar defaultTooltipCss = \"\\n.ag-sparkline-tooltip-wrapper {\\n position: absolute;\\n user-select: none;\\n pointer-events: none;\\n}\\n\\n.ag-sparkline-tooltip {\\n position: relative;\\n font: 12px arial,sans-serif;\\n border-radius: 2px;\\n box-shadow: 0 1px 3px rgb(0 0 0 / 20%), 0 1px 1px rgb(0 0 0 / 14%);\\n line-height: 1.7em;\\n overflow: hidden;\\n white-space: nowrap;\\n z-index: 99999;\\n background-color: rgb(255, 255, 255);\\n color: rgba(0,0,0, 0.67);\\n}\\n\\n.ag-sparkline-tooltip-content {\\n padding: 0 7px;\\n opacity: 1;\\n}\\n\\n.ag-sparkline-tooltip-title {\\n padding-left: 7px;\\n opacity: 1;\\n}\\n\\n.ag-sparkline-tooltip-wrapper-hidden {\\n top: -10000px !important;\\n}\\n\\n.ag-sparkline-wrapper {\\n box-sizing: border-box;\\n overflow: hidden;\\n}\\n\";\n\nvar __values = (undefined && undefined.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nvar extent$3 = extent$4, isNumber$3 = isNumber$4, isString = isString$2, isStringObject = isStringObject$1, isDate = isDate$1, createId = createId$1, Padding = Padding$1;\nvar LinearScale = LinearScale$1, BandScale$4 = BandScale$5, TimeScale = TimeScale$1;\n/**\n * Constants to declare the expected nominal zIndex for nodes in a sparkline rendering.\n */\nvar ZINDICIES;\n(function (ZINDICIES) {\n ZINDICIES[ZINDICIES[\"SERIES_FILL_ZINDEX\"] = 50] = \"SERIES_FILL_ZINDEX\";\n ZINDICIES[ZINDICIES[\"AXIS_LINE_ZINDEX\"] = 500] = \"AXIS_LINE_ZINDEX\";\n ZINDICIES[ZINDICIES[\"SERIES_STROKE_ZINDEX\"] = 1000] = \"SERIES_STROKE_ZINDEX\";\n ZINDICIES[ZINDICIES[\"SERIES_LABEL_ZINDEX\"] = 1500] = \"SERIES_LABEL_ZINDEX\";\n ZINDICIES[ZINDICIES[\"CROSSHAIR_ZINDEX\"] = 2000] = \"CROSSHAIR_ZINDEX\";\n ZINDICIES[ZINDICIES[\"SERIES_MARKERS_ZINDEX\"] = 2500] = \"SERIES_MARKERS_ZINDEX\";\n})(ZINDICIES || (ZINDICIES = {}));\nvar SparklineAxis = /** @class */ (function () {\n function SparklineAxis() {\n this.type = 'category';\n this.stroke = 'rgb(204, 214, 235)';\n this.strokeWidth = 1;\n }\n return SparklineAxis;\n}());\nvar Sparkline = /** @class */ (function () {\n function Sparkline() {\n this.id = createId(this);\n this.seriesRect = {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n };\n this._context = undefined;\n this._container = undefined;\n this._data = undefined;\n this.padding = new Padding(3);\n this.xKey = 'x';\n this.yKey = 'y';\n this.dataType = undefined;\n this.xData = [];\n this.yData = [];\n // Minimum y value in provided data.\n this.min = undefined;\n // Maximum y value in provided data.\n this.max = undefined;\n this.yScale = new LinearScale();\n this.axis = new SparklineAxis();\n this.highlightStyle = {\n size: 6,\n fill: 'yellow',\n stroke: 'silver',\n strokeWidth: 1,\n };\n this._width = 100;\n this._height = 100;\n this.smallestInterval = undefined;\n this.layoutId = 0;\n this.defaultDateFormatter = new Intl.DateTimeFormat('en-US', {\n year: 'numeric',\n month: '2-digit',\n day: '2-digit',\n hour: '2-digit',\n minute: '2-digit',\n second: '2-digit',\n hour12: false,\n });\n this._onMouseMove = this.onMouseMove.bind(this);\n this._onMouseOut = this.onMouseOut.bind(this);\n var root = new Group();\n this.rootGroup = root;\n var element = document.createElement('div');\n element.setAttribute('class', 'ag-sparkline-wrapper');\n var scene = new Scene({ document: document });\n this.scene = scene;\n this.canvasElement = scene.canvas.element;\n scene.root = root;\n scene.container = element;\n scene.resize(this.width, this.height);\n this.seriesRect.width = this.width;\n this.seriesRect.height = this.height;\n // one style element for tooltip styles per document\n if (Sparkline.tooltipDocuments.indexOf(document) === -1) {\n var styleElement = document.createElement('style');\n styleElement.innerHTML = defaultTooltipCss;\n document.head.insertBefore(styleElement, document.head.querySelector('style'));\n Sparkline.tooltipDocuments.push(document);\n }\n this.setupDomEventListeners(this.scene.canvas.element);\n }\n Object.defineProperty(Sparkline.prototype, \"context\", {\n get: function () {\n return this._context;\n },\n set: function (value) {\n if (this._context !== value) {\n this._context = value;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Sparkline.prototype, \"container\", {\n get: function () {\n return this._container;\n },\n set: function (value) {\n if (this._container !== value) {\n var parentNode = this.canvasElement.parentNode;\n if (parentNode != null) {\n parentNode.removeChild(this.canvasElement);\n }\n if (value) {\n value.appendChild(this.canvasElement);\n }\n this._container = value;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Sparkline.prototype, \"data\", {\n get: function () {\n return this._data;\n },\n set: function (value) {\n if (this._data !== value) {\n this._data = value;\n this.processData();\n if (this.mouseMoveEvent && this.highlightedDatum) {\n this.updateHitPoint(this.mouseMoveEvent);\n }\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Sparkline.prototype, \"width\", {\n get: function () {\n return this._width;\n },\n set: function (value) {\n if (this._width !== value) {\n this._width = value;\n this.scene.resize(value, this.height);\n this.scheduleLayout();\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Sparkline.prototype, \"height\", {\n get: function () {\n return this._height;\n },\n set: function (value) {\n if (this._height !== value) {\n this._height = value;\n this.scene.resize(this.width, value);\n this.scheduleLayout();\n }\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Generate node data from processed data.\n * Produce data joins.\n * Update selection's nodes using node data.\n */\n Sparkline.prototype.update = function () { };\n // Update y scale based on processed data.\n Sparkline.prototype.updateYScale = function () {\n this.updateYScaleRange();\n this.updateYScaleDomain();\n };\n // Update y scale domain based on processed data.\n Sparkline.prototype.updateYScaleDomain = function () { };\n // Update y scale range based on height and padding (seriesRect).\n Sparkline.prototype.updateYScaleRange = function () {\n var _a = this, yScale = _a.yScale, seriesRect = _a.seriesRect;\n yScale.range = [seriesRect.height, 0];\n };\n // Update x scale based on processed data.\n Sparkline.prototype.updateXScale = function () {\n var type = this.axis.type;\n this.xScale = this.getXScale(type);\n this.updateXScaleRange();\n this.updateXScaleDomain();\n };\n // Update x scale range based on width and padding (seriesRect).\n Sparkline.prototype.updateXScaleRange = function () {\n this.xScale.range = [0, this.seriesRect.width];\n };\n // Update x scale domain based on processed data and type of scale.\n Sparkline.prototype.updateXScaleDomain = function () {\n var _a = this, xData = _a.xData, xScale = _a.xScale;\n var xMinMax;\n if (xScale instanceof LinearScale || xScale instanceof TimeScale) {\n xMinMax = extent$3(xData);\n }\n this.xScale.domain = xMinMax ? xMinMax.slice() : xData;\n };\n /**\n * Return xScale instance based on the provided type or return a `BandScale` by default.\n * The default type is `category`.\n * @param type\n */\n Sparkline.prototype.getXScale = function (type) {\n if (type === void 0) { type = 'category'; }\n switch (type) {\n case 'number':\n return new LinearScale();\n case 'time':\n return new TimeScale();\n case 'category':\n default:\n return new BandScale$4();\n }\n };\n // Update axis line.\n Sparkline.prototype.updateAxisLine = function () { };\n // Update X and Y scales and the axis line.\n Sparkline.prototype.updateAxes = function () {\n this.updateYScale();\n this.updateXScale();\n this.updateAxisLine();\n };\n // Update horizontal and vertical crosshair lines.\n Sparkline.prototype.updateCrosshairs = function () {\n this.updateXCrosshairLine();\n this.updateYCrosshairLine();\n };\n // Using processed data, generate data that backs visible nodes.\n Sparkline.prototype.generateNodeData = function () {\n return [];\n };\n // Returns persisted node data associated with the sparkline's data.\n Sparkline.prototype.getNodeData = function () {\n return [];\n };\n // Update the selection's nodes.\n Sparkline.prototype.updateNodes = function () { };\n // Update the vertical crosshair line.\n Sparkline.prototype.updateXCrosshairLine = function () { };\n // Update the horizontal crosshair line.\n Sparkline.prototype.updateYCrosshairLine = function () { };\n Sparkline.prototype.highlightDatum = function (closestDatum) {\n this.updateNodes();\n };\n Sparkline.prototype.dehighlightDatum = function () {\n this.highlightedDatum = undefined;\n this.updateNodes();\n this.updateCrosshairs();\n };\n /**\n * Highlight closest datum and display tooltip if enabled.\n * Only update if necessary, i.e. only update if the highlighted datum is different from previously highlighted datum,\n * or if there is no previously highlighted datum.\n * @param event\n */\n Sparkline.prototype.onMouseMove = function (event) {\n this.mouseMoveEvent = event;\n this.updateHitPoint(event);\n };\n Sparkline.prototype.updateHitPoint = function (event) {\n var _a, _b, _c;\n var closestDatum = this.pickClosestSeriesNodeDatum(event.offsetX, event.offsetY);\n if (!closestDatum) {\n return;\n }\n var oldHighlightedDatum = this.highlightedDatum;\n this.highlightedDatum = closestDatum;\n if ((this.highlightedDatum && !oldHighlightedDatum) ||\n (this.highlightedDatum && oldHighlightedDatum && this.highlightedDatum !== oldHighlightedDatum)) {\n this.highlightDatum(closestDatum);\n this.updateCrosshairs();\n this.scene.render().catch(function (e) { return console.error(\"AG Grid - chart rendering failed\", e); });\n }\n var tooltipEnabled = (_c = (_b = (_a = this.processedOptions) === null || _a === void 0 ? void 0 : _a.tooltip) === null || _b === void 0 ? void 0 : _b.enabled) !== null && _c !== void 0 ? _c : true;\n if (tooltipEnabled) {\n this.handleTooltip(event, closestDatum);\n }\n };\n /**\n * Dehighlight all nodes and remove tooltip.\n * @param event\n */\n Sparkline.prototype.onMouseOut = function (event) {\n this.dehighlightDatum();\n this.tooltip.toggle(false);\n this.scene.render().catch(function (e) { return console.error(\"AG Grid - chart rendering failed\", e); });\n };\n // Fetch required values from the data object and process them.\n Sparkline.prototype.processData = function () {\n var _this = this;\n var _a = this, data = _a.data, yData = _a.yData, xData = _a.xData;\n if (!data || this.invalidData(this.data)) {\n return;\n }\n yData.length = 0;\n xData.length = 0;\n var n = data.length;\n var dataType = this.getDataType(data);\n this.dataType = dataType;\n var xValueType = this.axis.type;\n var xType = xValueType !== 'number' && xValueType !== 'time' ? 'category' : xValueType;\n var isContinuousX = xType === 'number' || xType === 'time';\n var setSmallestXInterval = function (curr, prev) {\n if (_this.smallestInterval == undefined) {\n _this.smallestInterval = { x: Infinity, y: Infinity };\n }\n var x = _this.smallestInterval.x;\n var interval = Math.abs(curr - prev);\n if (interval > 0 && interval < x) {\n _this.smallestInterval.x = interval;\n }\n };\n var prevX;\n if (dataType === 'number') {\n for (var i = 0; i < n; i++) {\n var xDatum = i;\n var yDatum = data[i];\n var x = this.getDatum(xDatum, xType);\n var y = this.getDatum(yDatum, 'number');\n if (isContinuousX) {\n setSmallestXInterval(x, prevX);\n }\n xData.push(x);\n yData.push(y);\n prevX = x;\n }\n }\n else if (dataType === 'array') {\n for (var i = 0; i < n; i++) {\n var datum = data[i];\n if (Array.isArray(datum)) {\n var xDatum = datum[0];\n var yDatum = datum[1];\n var x = this.getDatum(xDatum, xType);\n var y = this.getDatum(yDatum, 'number');\n if (x == undefined) {\n continue;\n }\n if (isContinuousX) {\n setSmallestXInterval(x, prevX);\n }\n xData.push(x);\n yData.push(y);\n prevX = x;\n }\n }\n }\n else if (dataType === 'object') {\n var _b = this, yKey = _b.yKey, xKey = _b.xKey;\n for (var i = 0; i < n; i++) {\n var datum = data[i];\n if (typeof datum === 'object' && !Array.isArray(datum)) {\n var xDatum = datum[xKey];\n var yDatum = datum[yKey];\n var x = this.getDatum(xDatum, xType);\n var y = this.getDatum(yDatum, 'number');\n if (x == undefined) {\n continue;\n }\n if (isContinuousX) {\n setSmallestXInterval(x, prevX);\n }\n xData.push(x);\n yData.push(y);\n prevX = x;\n }\n }\n }\n this.updateAxes();\n this.immediateLayout();\n };\n /**\n * Return the type of data provided to the sparkline based on the first truthy value in the data array.\n * If the value is not a number, array or object, return `undefined`.\n * @param data\n */\n Sparkline.prototype.getDataType = function (data) {\n var e_1, _a;\n try {\n for (var data_1 = __values(data), data_1_1 = data_1.next(); !data_1_1.done; data_1_1 = data_1.next()) {\n var datum = data_1_1.value;\n if (datum != undefined) {\n if (isNumber$3(datum)) {\n return 'number';\n }\n else if (Array.isArray(datum)) {\n return 'array';\n }\n else if (typeof datum === 'object') {\n return 'object';\n }\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (data_1_1 && !data_1_1.done && (_a = data_1.return)) _a.call(data_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n };\n /**\n * Return the given value depending on the type of axis.\n * Return `undefined` if the value is invalid for the given axis type.\n * @param value\n */\n Sparkline.prototype.getDatum = function (value, type) {\n if ((type === 'number' && isNumber$3(value)) || (type === 'time' && (isNumber$3(value) || isDate(value)))) {\n return value;\n }\n else if (type === 'category') {\n if (isString(value) || isDate(value) || isNumber$3(value)) {\n return { toString: function () { return String(value); } };\n }\n else if (isStringObject(value)) {\n return value;\n }\n }\n };\n Object.defineProperty(Sparkline.prototype, \"layoutScheduled\", {\n /**\n * Only `true` while we are waiting for the layout to start.\n * This will be `false` if the layout has already started and is ongoing.\n */\n get: function () {\n return !!this.layoutId;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Execute update method on the next available screen repaint to make changes to the canvas.\n * If we are waiting for a layout to start and a new layout is requested,\n * cancel the previous layout using the non 0 integer (this.layoutId) returned from requestAnimationFrame.\n */\n Sparkline.prototype.scheduleLayout = function () {\n var _this = this;\n if (this.layoutId) {\n cancelAnimationFrame(this.layoutId);\n }\n this.layoutId = requestAnimationFrame(function () {\n _this.immediateLayout();\n _this.layoutId = 0;\n });\n };\n Sparkline.prototype.immediateLayout = function () {\n this.setSparklineDimensions();\n if (this.invalidData(this.data)) {\n return;\n }\n // update axes ranges\n this.updateXScaleRange();\n this.updateYScaleRange();\n // update axis line\n this.updateAxisLine();\n // produce data joins and update selection's nodes\n this.update();\n this.scene.render().catch(function (e) { return console.error(\"AG Grid - chart rendering failed\", e); });\n };\n Sparkline.prototype.setSparklineDimensions = function () {\n var _a = this, width = _a.width, height = _a.height, padding = _a.padding, seriesRect = _a.seriesRect, rootGroup = _a.rootGroup;\n var shrunkWidth = width - padding.left - padding.right;\n var shrunkHeight = height - padding.top - padding.bottom;\n seriesRect.width = shrunkWidth;\n seriesRect.height = shrunkHeight;\n seriesRect.x = padding.left;\n seriesRect.y = padding.top;\n rootGroup.translationX = seriesRect.x;\n rootGroup.translationY = seriesRect.y;\n };\n /**\n * Return the closest data point to x/y canvas coordinates.\n * @param x\n * @param y\n */\n Sparkline.prototype.pickClosestSeriesNodeDatum = function (x, y) {\n var minDistance = Infinity;\n var closestDatum;\n var hitPoint = this.rootGroup.transformPoint(x, y);\n var nodeData = this.getNodeData();\n for (var i = 0; i < nodeData.length; i++) {\n var datum = nodeData[i];\n if (!datum.point) {\n return;\n }\n var distance = this.getDistance(hitPoint, datum.point);\n if (distance <= minDistance) {\n minDistance = distance;\n closestDatum = datum;\n }\n }\n return closestDatum;\n };\n /**\n * Return the relevant distance between two points.\n * The distance will be calculated based on the x value of the points for all sparklines except bar sparkline, where the distance is based on the y values.\n * @param x\n * @param y\n */\n Sparkline.prototype.getDistance = function (p1, p2) {\n return Math.abs(p1.x - p2.x);\n };\n /**\n * calculate x/y coordinates for tooltip based on coordinates of highlighted datum, position of canvas and page offset.\n * @param datum\n */\n Sparkline.prototype.handleTooltip = function (event, datum) {\n var _a, _b;\n var seriesDatum = datum.seriesDatum;\n var canvasElement = this.canvasElement;\n var clientX = event.clientX, clientY = event.clientY;\n var tooltipOptions = (_a = this.processedOptions) === null || _a === void 0 ? void 0 : _a.tooltip;\n var meta = {\n pageX: clientX,\n pageY: clientY,\n position: {\n xOffset: tooltipOptions === null || tooltipOptions === void 0 ? void 0 : tooltipOptions.xOffset,\n yOffset: tooltipOptions === null || tooltipOptions === void 0 ? void 0 : tooltipOptions.yOffset,\n },\n container: tooltipOptions === null || tooltipOptions === void 0 ? void 0 : tooltipOptions.container,\n };\n // confine tooltip to sparkline width if tooltip container not provided.\n if (meta.container == undefined) {\n meta.container = canvasElement;\n }\n var yValue = seriesDatum.y;\n var xValue = seriesDatum.x;\n // check if tooltip is enabled for this specific data point\n var enabled = (_b = tooltipOptions === null || tooltipOptions === void 0 ? void 0 : tooltipOptions.enabled) !== null && _b !== void 0 ? _b : true;\n var tooltipRenderer = tooltipOptions === null || tooltipOptions === void 0 ? void 0 : tooltipOptions.renderer;\n if (tooltipRenderer) {\n var tooltipRendererResult = tooltipRenderer({\n context: this.context,\n datum: seriesDatum,\n yValue: yValue,\n xValue: xValue,\n });\n enabled =\n typeof tooltipRendererResult !== 'string' && tooltipRendererResult.enabled !== undefined\n ? tooltipRendererResult.enabled\n : enabled;\n }\n var html = enabled && seriesDatum.y !== undefined && this.getTooltipHtml(datum);\n if (html) {\n this.tooltip.show(meta, html);\n }\n };\n Sparkline.prototype.formatNumericDatum = function (datum) {\n return String(Math.round(datum * 10) / 10);\n };\n // locale.format('%m/%d/%y, %H:%M:%S');\n Sparkline.prototype.formatDatum = function (datum) {\n var type = this.axis.type || 'category';\n if (type === 'number' && typeof datum === 'number') {\n return this.formatNumericDatum(datum);\n }\n else if (type === 'time' && (datum instanceof Date || isNumber$3(datum))) {\n return this.defaultDateFormatter.format(datum);\n }\n else {\n return String(datum);\n }\n };\n Sparkline.prototype.setupDomEventListeners = function (chartElement) {\n chartElement.addEventListener('mousemove', this._onMouseMove);\n chartElement.addEventListener('mouseout', this._onMouseOut);\n };\n Sparkline.prototype.cleanupDomEventListeners = function (chartElement) {\n chartElement.removeEventListener('mousemove', this._onMouseMove);\n chartElement.removeEventListener('mouseout', this._onMouseOut);\n };\n Sparkline.prototype.invalidData = function (data) {\n return !data || !Array.isArray(data) || data.length === 0;\n };\n /**\n * Cleanup and remove canvas element from the DOM.\n */\n Sparkline.prototype.destroy = function () {\n this.scene.container = undefined;\n // remove canvas element from the DOM\n this.container = undefined;\n this.cleanupDomEventListeners(this.scene.canvas.element);\n };\n Sparkline.tooltipDocuments = [];\n return Sparkline;\n}());\n\nfunction toTooltipHtml(input, defaults) {\n var _a, _b, _c;\n if (typeof input === 'string') {\n return input;\n }\n defaults = defaults !== null && defaults !== void 0 ? defaults : {};\n var _d = input.content, content = _d === void 0 ? (_a = defaults.content) !== null && _a !== void 0 ? _a : '' : _d, _e = input.title, title = _e === void 0 ? (_b = defaults.title) !== null && _b !== void 0 ? _b : undefined : _e, _f = input.color, color = _f === void 0 ? defaults.color : _f, _g = input.backgroundColor, backgroundColor = _g === void 0 ? defaults.backgroundColor : _g, _h = input.opacity, opacity = _h === void 0 ? (_c = defaults.opacity) !== null && _c !== void 0 ? _c : 1 : _h;\n var titleHtml;\n var contentHtml;\n if (color) {\n titleHtml = title\n ? \"\" + title + \"\"\n : '';\n contentHtml = \"\" + content + \"\";\n }\n else {\n titleHtml = title ? \"\" + title + \"\" : '';\n contentHtml = \"\" + content + \"\";\n }\n var style = \"opacity: \" + opacity;\n if (backgroundColor) {\n style += \"; background-color: \" + backgroundColor.toLowerCase();\n }\n return \"
\\n \" + titleHtml + \"\\n \" + contentHtml + \"\\n
\";\n}\nvar SparklineTooltip = /** @class */ (function () {\n function SparklineTooltip() {\n this.element = document.createElement('div');\n var tooltipRoot = document.body;\n tooltipRoot.appendChild(this.element);\n }\n SparklineTooltip.prototype.isVisible = function () {\n var element = this.element;\n if (element.classList) {\n return !element.classList.contains(SparklineTooltip.class + \"-wrapper-hidden\");\n }\n // IE11\n var classes = element.getAttribute('class');\n if (classes) {\n return classes.split(' ').indexOf(SparklineTooltip.class + \"-wrapper-hidden\") < 0;\n }\n return false;\n };\n SparklineTooltip.prototype.updateClass = function (visible) {\n var classList = [SparklineTooltip.class + \"-wrapper\"];\n if (visible !== true) {\n classList.push(SparklineTooltip.class + \"-wrapper-hidden\");\n }\n this.element.setAttribute('class', classList.join(' '));\n };\n SparklineTooltip.prototype.show = function (meta, html) {\n var _a, _b, _c, _d;\n this.toggle(false);\n var element = this.element;\n if (html !== undefined) {\n element.innerHTML = html;\n }\n else if (!element.innerHTML) {\n return;\n }\n var xOffset = (_b = (_a = meta.position) === null || _a === void 0 ? void 0 : _a.xOffset) !== null && _b !== void 0 ? _b : 10;\n var yOffset = (_d = (_c = meta.position) === null || _c === void 0 ? void 0 : _c.yOffset) !== null && _d !== void 0 ? _d : 0;\n var left = meta.pageX + xOffset;\n var top = meta.pageY + yOffset;\n var tooltipRect = element.getBoundingClientRect();\n var maxLeft = window.innerWidth - tooltipRect.width;\n if (meta.container) {\n var containerRect = meta.container.getBoundingClientRect();\n maxLeft = containerRect.left + (containerRect.width - tooltipRect.width);\n }\n if (left > maxLeft) {\n left = meta.pageX - element.clientWidth - xOffset;\n }\n if (typeof scrollX !== 'undefined') {\n left += scrollX;\n }\n if (typeof scrollY !== 'undefined') {\n top += scrollY;\n }\n element.style.left = Math.round(left) + \"px\";\n element.style.top = Math.round(top) + \"px\";\n this.toggle(true);\n };\n SparklineTooltip.prototype.toggle = function (visible) {\n this.updateClass(visible);\n };\n SparklineTooltip.prototype.destroy = function () {\n var parentNode = this.element.parentNode;\n if (parentNode) {\n parentNode.removeChild(this.element);\n }\n };\n SparklineTooltip.class = 'ag-sparkline-tooltip';\n return SparklineTooltip;\n}());\n\nfunction getMarker(shape) {\n switch (shape) {\n case 'circle':\n return Circle;\n case 'square':\n return Square;\n case 'diamond':\n return Diamond;\n default:\n return Circle;\n }\n}\n\nfunction getLineDash(lineCap, lineDash) {\n if (lineDash === void 0) { lineDash = 'solid'; }\n var buttOrNull = {\n solid: [],\n dash: [4, 3],\n dot: [1, 3],\n dashDot: [4, 3, 1, 3],\n dashDotDot: [4, 3, 1, 3, 1, 3],\n shortDot: [1, 1],\n shortDash: [3, 1],\n shortDashDot: [3, 1, 1, 1],\n shortDashDotDot: [3, 1, 1, 1, 1, 1],\n longDash: [8, 3],\n longDashDot: [8, 3, 1, 3],\n longDashDotDot: [8, 3, 1, 3, 1, 3]\n };\n var roundOrSquare = {\n solid: [],\n dash: [3, 3],\n dot: [0, 3],\n dashDot: [3, 3, 0, 3],\n dashDotDot: [3, 3, 0, 3, 0, 3],\n shortDot: [0, 2],\n shortDash: [2, 2],\n shortDashDot: [2, 2, 0, 2],\n shortDashDotDot: [2, 2, 0, 2, 0, 2],\n longDash: [7, 3],\n longDashDot: [7, 3, 0, 3],\n longDashDotDot: [7, 3, 0, 3, 0, 3]\n };\n if (lineCap === 'round' || lineCap === 'square') {\n if (roundOrSquare[lineDash] == undefined) {\n console.warn(\"'\" + lineDash + \"' is not a valid 'lineDash' option.\");\n return roundOrSquare.solid;\n }\n return roundOrSquare[lineDash];\n }\n if (buttOrNull[lineDash] == undefined) {\n console.warn(\"'\" + lineDash + \"' is not a valid 'lineDash' option.\");\n return buttOrNull.solid;\n }\n return buttOrNull[lineDash];\n}\n\nvar __extends$6 = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar extent$2 = extent$4;\nvar BandScale$3 = BandScale$5;\nvar SparklineMarker$1 = /** @class */ (function () {\n function SparklineMarker() {\n this.enabled = true;\n this.shape = 'circle';\n this.size = 0;\n this.fill = 'rgb(124, 181, 236)';\n this.stroke = 'rgb(124, 181, 236)';\n this.strokeWidth = 1;\n this.formatter = undefined;\n }\n return SparklineMarker;\n}());\nvar SparklineLine$1 = /** @class */ (function () {\n function SparklineLine() {\n this.stroke = 'rgb(124, 181, 236)';\n this.strokeWidth = 1;\n }\n return SparklineLine;\n}());\nvar SparklineCrosshairs$1 = /** @class */ (function () {\n function SparklineCrosshairs() {\n this.xLine = {\n enabled: true,\n stroke: 'rgba(0,0,0, 0.54)',\n strokeWidth: 1,\n lineDash: 'solid',\n lineCap: undefined,\n };\n this.yLine = {\n enabled: false,\n stroke: 'rgba(0,0,0, 0.54)',\n strokeWidth: 1,\n lineDash: 'solid',\n lineCap: undefined,\n };\n }\n return SparklineCrosshairs;\n}());\nvar AreaSparkline = /** @class */ (function (_super) {\n __extends$6(AreaSparkline, _super);\n function AreaSparkline() {\n var _this = _super.call(this) || this;\n _this.fill = 'rgba(124, 181, 236, 0.25)';\n _this.strokePath = new Path();\n _this.fillPath = new Path();\n _this.xCrosshairLine = new Line();\n _this.yCrosshairLine = new Line();\n _this.areaSparklineGroup = new Group();\n _this.xAxisLine = new Line();\n _this.markers = new Group();\n _this.markerSelection = Selection.select(_this.markers, function () { return _this.markerFactory(); });\n _this.markerSelectionData = [];\n _this.marker = new SparklineMarker$1();\n _this.line = new SparklineLine$1();\n _this.crosshairs = new SparklineCrosshairs$1();\n _this.rootGroup.append(_this.areaSparklineGroup);\n _this.xAxisLine.zIndex = ZINDICIES.AXIS_LINE_ZINDEX;\n _this.fillPath.zIndex = ZINDICIES.SERIES_FILL_ZINDEX;\n _this.strokePath.zIndex = ZINDICIES.SERIES_STROKE_ZINDEX;\n _this.xCrosshairLine.zIndex = ZINDICIES.CROSSHAIR_ZINDEX;\n _this.yCrosshairLine.zIndex = ZINDICIES.CROSSHAIR_ZINDEX;\n _this.markers.zIndex = ZINDICIES.SERIES_MARKERS_ZINDEX;\n _this.areaSparklineGroup.append([\n _this.fillPath,\n _this.xAxisLine,\n _this.strokePath,\n _this.xCrosshairLine,\n _this.yCrosshairLine,\n _this.markers,\n ]);\n return _this;\n }\n AreaSparkline.prototype.markerFactory = function () {\n var shape = this.marker.shape;\n var MarkerShape = getMarker(shape);\n return new MarkerShape();\n };\n AreaSparkline.prototype.getNodeData = function () {\n return this.markerSelectionData;\n };\n AreaSparkline.prototype.update = function () {\n var data = this.generateNodeData();\n if (!data) {\n return;\n }\n var nodeData = data.nodeData, fillData = data.fillData, strokeData = data.strokeData;\n this.markerSelectionData = nodeData;\n this.updateSelection(nodeData);\n this.updateNodes();\n this.updateStroke(strokeData);\n this.updateFill(fillData);\n };\n AreaSparkline.prototype.updateYScaleDomain = function () {\n var _a = this, yData = _a.yData, yScale = _a.yScale;\n var yMinMax = extent$2(yData);\n var yMin = 0;\n var yMax = 1;\n if (yMinMax !== undefined) {\n yMin = this.min = yMinMax[0];\n yMax = this.max = yMinMax[1];\n }\n // if yMin is positive, set yMin to 0\n yMin = yMin < 0 ? yMin : 0;\n // if yMax is negative, set yMax to 0\n yMax = yMax < 0 ? 0 : yMax;\n yScale.domain = [yMin, yMax];\n };\n AreaSparkline.prototype.generateNodeData = function () {\n var _a = this, data = _a.data, yData = _a.yData, xData = _a.xData, xScale = _a.xScale, yScale = _a.yScale;\n if (!data) {\n return;\n }\n var continuous = !(xScale instanceof BandScale$3);\n var offsetX = !continuous ? xScale.bandwidth / 2 : 0;\n var n = yData.length;\n var nodeData = [];\n var fillData = [];\n var strokeData = [];\n var firstValidX;\n var lastValidX;\n var previousX;\n var nextX;\n var yZero = yScale.convert(0);\n for (var i = 0; i < n; i++) {\n var yDatum = yData[i];\n var xDatum = xData[i];\n var x = xScale.convert(continuous ? xScale.toDomain(xDatum) : xDatum) + offsetX;\n var y = yDatum === undefined ? NaN : yScale.convert(yDatum);\n // if this iteration is not the last, set nextX using the next value in the data array\n if (i + 1 < n) {\n nextX = xScale.convert(continuous ? xScale.toDomain(xData[i + 1]) : xData[i + 1]) + offsetX;\n }\n // set stroke data regardless of missing/ undefined values. Undefined values will be handled in the updateStroke() method\n strokeData.push({\n seriesDatum: { x: xDatum, y: yDatum },\n point: { x: x, y: y },\n });\n if (yDatum === undefined && previousX !== undefined) {\n // if yDatum is undefined and there is a valid previous data point, add a phantom point at yZero\n // if a next data point exists, add a phantom point at yZero at the next X\n fillData.push({ seriesDatum: undefined, point: { x: previousX, y: yZero } });\n if (nextX !== undefined) {\n fillData.push({ seriesDatum: undefined, point: { x: nextX, y: yZero } });\n }\n }\n else if (yDatum !== undefined) {\n fillData.push({\n seriesDatum: { x: xDatum, y: yDatum },\n point: { x: x, y: y },\n });\n // set node data only if yDatum is not undefined. These values are used in the updateSelection() method to update markers\n nodeData.push({\n seriesDatum: { x: xDatum, y: yDatum },\n point: { x: x, y: y },\n });\n firstValidX = firstValidX !== undefined ? firstValidX : x;\n lastValidX = x;\n }\n previousX = x;\n }\n // phantom points for creating closed area\n fillData.push({ seriesDatum: undefined, point: { x: lastValidX, y: yZero } }, { seriesDatum: undefined, point: { x: firstValidX, y: yZero } });\n return { nodeData: nodeData, fillData: fillData, strokeData: strokeData };\n };\n AreaSparkline.prototype.updateAxisLine = function () {\n var _a = this, xScale = _a.xScale, yScale = _a.yScale, axis = _a.axis, xAxisLine = _a.xAxisLine;\n xAxisLine.x1 = xScale.range[0];\n xAxisLine.x2 = xScale.range[1];\n xAxisLine.y1 = xAxisLine.y2 = 0;\n xAxisLine.stroke = axis.stroke;\n xAxisLine.strokeWidth = axis.strokeWidth;\n var yZero = yScale.convert(0);\n xAxisLine.translationY = yZero;\n };\n AreaSparkline.prototype.updateSelection = function (selectionData) {\n this.markerSelection.update(selectionData);\n };\n AreaSparkline.prototype.updateNodes = function () {\n var _this = this;\n var _a = this, highlightedDatum = _a.highlightedDatum, highlightStyle = _a.highlightStyle, marker = _a.marker;\n var highlightSize = highlightStyle.size, highlightFill = highlightStyle.fill, highlightStroke = highlightStyle.stroke, highlightStrokeWidth = highlightStyle.strokeWidth;\n var markerFormatter = marker.formatter;\n this.markerSelection.each(function (node, datum, index) {\n var point = datum.point, seriesDatum = datum.seriesDatum;\n if (!point) {\n return;\n }\n var highlighted = datum === highlightedDatum;\n var markerFill = highlighted && highlightFill !== undefined ? highlightFill : marker.fill;\n var markerStroke = highlighted && highlightStroke !== undefined ? highlightStroke : marker.stroke;\n var markerStrokeWidth = highlighted && highlightStrokeWidth !== undefined ? highlightStrokeWidth : marker.strokeWidth;\n var markerSize = highlighted && highlightSize !== undefined ? highlightSize : marker.size;\n var markerFormat;\n if (markerFormatter) {\n var first = index === 0;\n var last = index === _this.markerSelectionData.length - 1;\n var min = seriesDatum.y === _this.min;\n var max = seriesDatum.y === _this.max;\n markerFormat = markerFormatter({\n datum: datum,\n xValue: seriesDatum.x,\n yValue: seriesDatum.y,\n min: min,\n max: max,\n first: first,\n last: last,\n fill: markerFill,\n stroke: markerStroke,\n strokeWidth: markerStrokeWidth,\n size: markerSize,\n highlighted: highlighted,\n });\n }\n node.size = markerFormat && markerFormat.size != undefined ? markerFormat.size : markerSize;\n node.fill = markerFormat && markerFormat.fill != undefined ? markerFormat.fill : markerFill;\n node.stroke = markerFormat && markerFormat.stroke != undefined ? markerFormat.stroke : markerStroke;\n node.strokeWidth =\n markerFormat && markerFormat.strokeWidth != undefined ? markerFormat.strokeWidth : markerStrokeWidth;\n node.translationX = point.x;\n node.translationY = point.y;\n node.visible =\n markerFormat && markerFormat.enabled != undefined\n ? markerFormat.enabled\n : marker.enabled && node.size > 0;\n });\n };\n AreaSparkline.prototype.updateStroke = function (strokeData) {\n var _a = this, strokePath = _a.strokePath, yData = _a.yData, line = _a.line;\n if (yData.length < 2) {\n return;\n }\n var path = strokePath.path;\n var n = strokeData.length;\n var moveTo = true;\n path.clear();\n for (var i = 0; i < n; i++) {\n var _b = strokeData[i], point = _b.point, seriesDatum = _b.seriesDatum;\n var x = point.x;\n var y = point.y;\n if (seriesDatum.y == undefined) {\n moveTo = true;\n }\n else {\n if (moveTo) {\n path.moveTo(x, y);\n moveTo = false;\n }\n else {\n path.lineTo(x, y);\n }\n }\n }\n strokePath.lineJoin = strokePath.lineCap = 'round';\n strokePath.fill = undefined;\n strokePath.stroke = line.stroke;\n strokePath.strokeWidth = line.strokeWidth;\n };\n AreaSparkline.prototype.updateFill = function (areaData) {\n var _a = this, fillPath = _a.fillPath, yData = _a.yData, fill = _a.fill;\n var path = fillPath.path;\n var n = areaData.length;\n path.clear();\n if (yData.length < 2) {\n return;\n }\n for (var i = 0; i < n; i++) {\n var point = areaData[i].point;\n var x = point.x;\n var y = point.y;\n if (i > 0) {\n path.lineTo(x, y);\n }\n else {\n path.moveTo(x, y);\n }\n }\n path.closePath();\n fillPath.lineJoin = 'round';\n fillPath.stroke = undefined;\n fillPath.fill = fill;\n };\n AreaSparkline.prototype.updateXCrosshairLine = function () {\n var _a;\n var _b = this, yScale = _b.yScale, xCrosshairLine = _b.xCrosshairLine, highlightedDatum = _b.highlightedDatum, xLine = _b.crosshairs.xLine;\n if (!xLine.enabled || highlightedDatum == undefined) {\n xCrosshairLine.strokeWidth = 0;\n return;\n }\n xCrosshairLine.y1 = yScale.range[0];\n xCrosshairLine.y2 = yScale.range[1];\n xCrosshairLine.x1 = xCrosshairLine.x2 = 0;\n xCrosshairLine.stroke = xLine.stroke;\n xCrosshairLine.strokeWidth = (_a = xLine.strokeWidth) !== null && _a !== void 0 ? _a : 1;\n xCrosshairLine.lineCap = xLine.lineCap === 'round' || xLine.lineCap === 'square' ? xLine.lineCap : undefined;\n var lineDash = xLine.lineDash;\n xCrosshairLine.lineDash = Array.isArray(lineDash)\n ? lineDash\n : getLineDash(xCrosshairLine.lineCap, xLine.lineDash);\n xCrosshairLine.translationX = highlightedDatum.point.x;\n };\n AreaSparkline.prototype.updateYCrosshairLine = function () {\n var _a;\n var _b = this, xScale = _b.xScale, yCrosshairLine = _b.yCrosshairLine, highlightedDatum = _b.highlightedDatum, yLine = _b.crosshairs.yLine;\n if (!yLine.enabled || highlightedDatum == undefined) {\n yCrosshairLine.strokeWidth = 0;\n return;\n }\n yCrosshairLine.x1 = xScale.range[0];\n yCrosshairLine.x2 = xScale.range[1];\n yCrosshairLine.y1 = yCrosshairLine.y2 = 0;\n yCrosshairLine.stroke = yLine.stroke;\n yCrosshairLine.strokeWidth = (_a = yLine.strokeWidth) !== null && _a !== void 0 ? _a : 1;\n yCrosshairLine.lineCap = yLine.lineCap === 'round' || yLine.lineCap === 'square' ? yLine.lineCap : undefined;\n var lineDash = yLine.lineDash;\n yCrosshairLine.lineDash = Array.isArray(lineDash)\n ? lineDash\n : getLineDash(yCrosshairLine.lineCap, yLine.lineDash);\n yCrosshairLine.translationY = highlightedDatum.point.y;\n };\n AreaSparkline.prototype.getTooltipHtml = function (datum) {\n var _a, _b;\n var dataType = this.dataType;\n var seriesDatum = datum.seriesDatum;\n var yValue = seriesDatum.y;\n var xValue = seriesDatum.x;\n var content = this.formatNumericDatum(yValue);\n var title = dataType === 'array' || dataType === 'object' ? this.formatDatum(xValue) : undefined;\n var defaults = {\n content: content,\n title: title,\n };\n var tooltipRenderer = (_b = (_a = this.processedOptions) === null || _a === void 0 ? void 0 : _a.tooltip) === null || _b === void 0 ? void 0 : _b.renderer;\n if (tooltipRenderer) {\n return toTooltipHtml(tooltipRenderer({\n context: this.context,\n datum: seriesDatum,\n yValue: yValue,\n xValue: xValue,\n }), defaults);\n }\n return toTooltipHtml(defaults);\n };\n AreaSparkline.className = 'AreaSparkline';\n return AreaSparkline;\n}(Sparkline));\n\nvar __extends$5 = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar extent$1 = extent$4;\nvar BandScale$2 = BandScale$5;\nvar SparklineMarker = /** @class */ (function () {\n function SparklineMarker() {\n this.enabled = true;\n this.shape = 'circle';\n this.size = 0;\n this.fill = 'rgb(124, 181, 236)';\n this.stroke = 'rgb(124, 181, 236)';\n this.strokeWidth = 1;\n this.formatter = undefined;\n }\n return SparklineMarker;\n}());\nvar SparklineLine = /** @class */ (function () {\n function SparklineLine() {\n this.stroke = 'rgb(124, 181, 236)';\n this.strokeWidth = 1;\n }\n return SparklineLine;\n}());\nvar SparklineCrosshairs = /** @class */ (function () {\n function SparklineCrosshairs() {\n this.xLine = {\n enabled: true,\n stroke: 'rgba(0,0,0, 0.54)',\n strokeWidth: 1,\n lineDash: 'solid',\n lineCap: undefined,\n };\n this.yLine = {\n enabled: false,\n stroke: 'rgba(0,0,0, 0.54)',\n strokeWidth: 1,\n lineDash: 'solid',\n lineCap: undefined,\n };\n }\n return SparklineCrosshairs;\n}());\nvar LineSparkline = /** @class */ (function (_super) {\n __extends$5(LineSparkline, _super);\n function LineSparkline() {\n var _this = _super.call(this) || this;\n _this.linePath = new Path();\n _this.xCrosshairLine = new Line();\n _this.yCrosshairLine = new Line();\n _this.lineSparklineGroup = new Group();\n _this.markers = new Group();\n _this.markerSelection = Selection.select(_this.markers, function () { return _this.markerFactory(); });\n _this.markerSelectionData = [];\n _this.marker = new SparklineMarker();\n _this.line = new SparklineLine();\n _this.crosshairs = new SparklineCrosshairs();\n _this.rootGroup.append(_this.lineSparklineGroup);\n _this.linePath.zIndex = ZINDICIES.SERIES_STROKE_ZINDEX;\n _this.xCrosshairLine.zIndex = ZINDICIES.CROSSHAIR_ZINDEX;\n _this.yCrosshairLine.zIndex = ZINDICIES.CROSSHAIR_ZINDEX;\n _this.markers.zIndex = ZINDICIES.SERIES_MARKERS_ZINDEX;\n _this.lineSparklineGroup.append([_this.linePath, _this.xCrosshairLine, _this.yCrosshairLine, _this.markers]);\n return _this;\n }\n LineSparkline.prototype.getNodeData = function () {\n return this.markerSelectionData;\n };\n LineSparkline.prototype.markerFactory = function () {\n var shape = this.marker.shape;\n var MarkerShape = getMarker(shape);\n return new MarkerShape();\n };\n /**\n * If marker shape is changed, this method should be called to remove the previous marker nodes selection.\n */\n LineSparkline.prototype.onMarkerShapeChange = function () {\n this.markerSelection = this.markerSelection.clear();\n this.scheduleLayout();\n };\n LineSparkline.prototype.update = function () {\n var nodeData = this.generateNodeData();\n if (!nodeData) {\n return;\n }\n this.markerSelectionData = nodeData;\n this.updateSelection(nodeData);\n this.updateNodes();\n this.updateLine();\n };\n LineSparkline.prototype.updateYScaleDomain = function () {\n var _a = this, yData = _a.yData, yScale = _a.yScale;\n var yMinMax = extent$1(yData);\n var yMin = 0;\n var yMax = 1;\n if (yMinMax !== undefined) {\n yMin = this.min = yMinMax[0];\n yMax = this.max = yMinMax[1];\n }\n if (yMin === yMax) {\n // if all values in the data are the same, yMin and yMax will be equal, need to adjust the domain with some padding\n var padding = Math.abs(yMin * 0.01);\n yMin -= padding;\n yMax += padding;\n }\n yScale.domain = [yMin, yMax];\n };\n LineSparkline.prototype.generateNodeData = function () {\n var _a = this, data = _a.data, yData = _a.yData, xData = _a.xData, xScale = _a.xScale, yScale = _a.yScale;\n if (!data) {\n return;\n }\n var continuous = !(xScale instanceof BandScale$2);\n var offsetX = !continuous ? xScale.bandwidth / 2 : 0;\n var nodeData = [];\n for (var i = 0; i < yData.length; i++) {\n var yDatum = yData[i];\n var xDatum = xData[i];\n if (yDatum == undefined) {\n continue;\n }\n var x = xScale.convert(continuous ? xScale.toDomain(xDatum) : xDatum) + offsetX;\n var y = yDatum === undefined ? NaN : yScale.convert(yDatum);\n nodeData.push({\n seriesDatum: { x: xDatum, y: yDatum },\n point: { x: x, y: y },\n });\n }\n return nodeData;\n };\n LineSparkline.prototype.updateSelection = function (selectionData) {\n this.markerSelection.update(selectionData);\n };\n LineSparkline.prototype.updateNodes = function () {\n var _this = this;\n var _a = this, highlightedDatum = _a.highlightedDatum, highlightStyle = _a.highlightStyle, marker = _a.marker;\n var highlightSize = highlightStyle.size, highlightFill = highlightStyle.fill, highlightStroke = highlightStyle.stroke, highlightStrokeWidth = highlightStyle.strokeWidth;\n var markerFormatter = marker.formatter;\n this.markerSelection.each(function (node, datum, index) {\n var highlighted = datum === highlightedDatum;\n var markerFill = highlighted && highlightFill !== undefined ? highlightFill : marker.fill;\n var markerStroke = highlighted && highlightStroke !== undefined ? highlightStroke : marker.stroke;\n var markerStrokeWidth = highlighted && highlightStrokeWidth !== undefined ? highlightStrokeWidth : marker.strokeWidth;\n var markerSize = highlighted && highlightSize !== undefined ? highlightSize : marker.size;\n var markerFormat;\n var seriesDatum = datum.seriesDatum, point = datum.point;\n if (markerFormatter) {\n var first = index === 0;\n var last = index === _this.markerSelectionData.length - 1;\n var min = seriesDatum.y === _this.min;\n var max = seriesDatum.y === _this.max;\n markerFormat = markerFormatter({\n datum: datum,\n xValue: seriesDatum.x,\n yValue: seriesDatum.y,\n min: min,\n max: max,\n first: first,\n last: last,\n fill: markerFill,\n stroke: markerStroke,\n strokeWidth: markerStrokeWidth,\n size: markerSize,\n highlighted: highlighted,\n });\n }\n node.size = markerFormat && markerFormat.size != undefined ? markerFormat.size : markerSize;\n node.fill = markerFormat && markerFormat.fill != undefined ? markerFormat.fill : markerFill;\n node.stroke = markerFormat && markerFormat.stroke != undefined ? markerFormat.stroke : markerStroke;\n node.strokeWidth =\n markerFormat && markerFormat.strokeWidth != undefined ? markerFormat.strokeWidth : markerStrokeWidth;\n node.translationX = point.x;\n node.translationY = point.y;\n node.visible =\n markerFormat && markerFormat.enabled != undefined\n ? markerFormat.enabled\n : marker.enabled && node.size > 0;\n });\n };\n LineSparkline.prototype.updateLine = function () {\n var _a = this, linePath = _a.linePath, yData = _a.yData, xData = _a.xData, xScale = _a.xScale, yScale = _a.yScale, line = _a.line;\n if (yData.length < 2) {\n return;\n }\n var continuous = !(xScale instanceof BandScale$2);\n var path = linePath.path;\n var n = yData.length;\n var offsetX = !continuous ? xScale.bandwidth / 2 : 0;\n var moveTo = true;\n path.clear();\n for (var i = 0; i < n; i++) {\n var xDatum = xData[i];\n var yDatum = yData[i];\n var x = xScale.convert(continuous ? xScale.toDomain(xDatum) : xDatum) + offsetX;\n var y = yDatum === undefined ? NaN : yScale.convert(yDatum);\n if (yDatum == undefined) {\n moveTo = true;\n }\n else {\n if (moveTo) {\n path.moveTo(x, y);\n moveTo = false;\n }\n else {\n path.lineTo(x, y);\n }\n }\n }\n linePath.fill = undefined;\n linePath.stroke = line.stroke;\n linePath.strokeWidth = line.strokeWidth;\n };\n LineSparkline.prototype.updateXCrosshairLine = function () {\n var _a;\n var _b = this, yScale = _b.yScale, xCrosshairLine = _b.xCrosshairLine, highlightedDatum = _b.highlightedDatum, xLine = _b.crosshairs.xLine;\n if (!xLine.enabled || highlightedDatum == undefined) {\n xCrosshairLine.strokeWidth = 0;\n return;\n }\n xCrosshairLine.y1 = yScale.range[0];\n xCrosshairLine.y2 = yScale.range[1];\n xCrosshairLine.x1 = xCrosshairLine.x2 = 0;\n xCrosshairLine.stroke = xLine.stroke;\n xCrosshairLine.strokeWidth = (_a = xLine.strokeWidth) !== null && _a !== void 0 ? _a : 1;\n xCrosshairLine.lineCap = xLine.lineCap === 'round' || xLine.lineCap === 'square' ? xLine.lineCap : undefined;\n var lineDash = xLine.lineDash;\n xCrosshairLine.lineDash = Array.isArray(lineDash)\n ? lineDash\n : getLineDash(xCrosshairLine.lineCap, xLine.lineDash);\n xCrosshairLine.translationX = highlightedDatum.point.x;\n };\n LineSparkline.prototype.updateYCrosshairLine = function () {\n var _a;\n var _b = this, xScale = _b.xScale, yCrosshairLine = _b.yCrosshairLine, highlightedDatum = _b.highlightedDatum, yLine = _b.crosshairs.yLine;\n if (!yLine.enabled || highlightedDatum == undefined) {\n yCrosshairLine.strokeWidth = 0;\n return;\n }\n yCrosshairLine.x1 = xScale.range[0];\n yCrosshairLine.x2 = xScale.range[1];\n yCrosshairLine.y1 = yCrosshairLine.y2 = 0;\n yCrosshairLine.stroke = yLine.stroke;\n yCrosshairLine.strokeWidth = (_a = yLine.strokeWidth) !== null && _a !== void 0 ? _a : 1;\n yCrosshairLine.lineCap = yLine.lineCap === 'round' || yLine.lineCap === 'square' ? yLine.lineCap : undefined;\n var lineDash = yLine.lineDash;\n yCrosshairLine.lineDash = Array.isArray(lineDash)\n ? lineDash\n : getLineDash(yCrosshairLine.lineCap, yLine.lineDash);\n yCrosshairLine.translationY = highlightedDatum.point.y;\n };\n LineSparkline.prototype.getTooltipHtml = function (datum) {\n var _a, _b;\n var dataType = this.dataType;\n var seriesDatum = datum.seriesDatum;\n var yValue = seriesDatum.y;\n var xValue = seriesDatum.x;\n var content = this.formatNumericDatum(yValue);\n var title = dataType === 'array' || dataType === 'object' ? this.formatDatum(xValue) : undefined;\n var defaults = {\n content: content,\n title: title,\n };\n var tooltipRenderer = (_b = (_a = this.processedOptions) === null || _a === void 0 ? void 0 : _a.tooltip) === null || _b === void 0 ? void 0 : _b.renderer;\n if (tooltipRenderer) {\n return toTooltipHtml(tooltipRenderer({\n context: this.context,\n datum: seriesDatum,\n yValue: yValue,\n xValue: xValue,\n }), defaults);\n }\n return toTooltipHtml(defaults);\n };\n LineSparkline.className = 'LineSparkline';\n return LineSparkline;\n}(Sparkline));\n\nvar Label = /** @class */ (function () {\n function Label() {\n this.enabled = true;\n this.fontSize = 8;\n this.fontFamily = 'Verdana, sans-serif';\n this.fontStyle = undefined;\n this.fontWeight = undefined;\n this.color = 'rgba(70, 70, 70, 1)';\n }\n return Label;\n}());\n\nvar __extends$4 = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar extent = extent$4;\nvar BarColumnNodeTag;\n(function (BarColumnNodeTag) {\n BarColumnNodeTag[BarColumnNodeTag[\"Rect\"] = 0] = \"Rect\";\n BarColumnNodeTag[BarColumnNodeTag[\"Label\"] = 1] = \"Label\";\n})(BarColumnNodeTag || (BarColumnNodeTag = {}));\nvar BarColumnLabelPlacement;\n(function (BarColumnLabelPlacement) {\n BarColumnLabelPlacement[\"InsideBase\"] = \"insideBase\";\n BarColumnLabelPlacement[\"InsideEnd\"] = \"insideEnd\";\n BarColumnLabelPlacement[\"Center\"] = \"center\";\n BarColumnLabelPlacement[\"OutsideEnd\"] = \"outsideEnd\";\n})(BarColumnLabelPlacement || (BarColumnLabelPlacement = {}));\nvar BarColumnLabel = /** @class */ (function (_super) {\n __extends$4(BarColumnLabel, _super);\n function BarColumnLabel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.formatter = undefined;\n _this.placement = BarColumnLabelPlacement.InsideEnd;\n return _this;\n }\n return BarColumnLabel;\n}(Label));\nvar BarColumnSparkline = /** @class */ (function (_super) {\n __extends$4(BarColumnSparkline, _super);\n function BarColumnSparkline() {\n var _this = _super.call(this) || this;\n _this.fill = 'rgb(124, 181, 236)';\n _this.stroke = 'silver';\n _this.strokeWidth = 0;\n _this.paddingInner = 0.1;\n _this.paddingOuter = 0.2;\n _this.valueAxisDomain = undefined;\n _this.formatter = undefined;\n _this.axisLine = new Line();\n _this.bandWidth = 0;\n _this.sparklineGroup = new Group();\n _this.rectGroup = new Group();\n _this.labelGroup = new Group();\n _this.rectSelection = Selection.select(_this.rectGroup, Rect);\n _this.labelSelection = Selection.select(_this.labelGroup, Text);\n _this.nodeSelectionData = [];\n _this.label = new BarColumnLabel();\n _this.rootGroup.append(_this.sparklineGroup);\n _this.rectGroup.zIndex = ZINDICIES.SERIES_FILL_ZINDEX;\n _this.axisLine.zIndex = ZINDICIES.AXIS_LINE_ZINDEX;\n _this.labelGroup.zIndex = ZINDICIES.SERIES_LABEL_ZINDEX;\n _this.sparklineGroup.append([_this.rectGroup, _this.axisLine, _this.labelGroup]);\n _this.axisLine.lineCap = 'round';\n _this.label.enabled = false;\n return _this;\n }\n BarColumnSparkline.prototype.getNodeData = function () {\n return this.nodeSelectionData;\n };\n BarColumnSparkline.prototype.update = function () {\n this.updateSelections();\n this.updateNodes();\n };\n BarColumnSparkline.prototype.updateSelections = function () {\n var nodeData = this.generateNodeData();\n if (!nodeData) {\n return;\n }\n this.nodeSelectionData = nodeData;\n this.updateRectSelection(nodeData);\n this.updateLabelSelection(nodeData);\n };\n BarColumnSparkline.prototype.updateNodes = function () {\n this.updateRectNodes();\n this.updateLabelNodes();\n };\n BarColumnSparkline.prototype.calculateStep = function (range) {\n var _a;\n var _b = this, xScale = _b.xScale, paddingInner = _b.paddingInner, paddingOuter = _b.paddingOuter, smallestInterval = _b.smallestInterval;\n // calculate step\n var domainLength = xScale.domain[1] - xScale.domain[0];\n var intervals = domainLength / ((_a = smallestInterval === null || smallestInterval === void 0 ? void 0 : smallestInterval.x) !== null && _a !== void 0 ? _a : 1) + 1;\n // The number of intervals/bands is used to determine the width of individual bands by dividing the available range.\n // Allow a maximum of 50 bands to ensure the step (width of individual bands + padding) does not fall below a certain number of pixels.\n // If the number of intervals exceeds 50, calculate the step for 50 bands within the given range.\n // This means there could be some overlap of the bands in the sparkline.\n var maxBands = 50;\n var bands = Math.min(intervals, maxBands);\n var gaps = bands - 1; // number of gaps (padding between bands)\n var step = range / Math.max(1, 2 * paddingOuter + gaps * paddingInner + bands); // step width is a combination of band width and gap width\n return step;\n };\n BarColumnSparkline.prototype.updateYScaleDomain = function () {\n var _a = this, yScale = _a.yScale, yData = _a.yData, valueAxisDomain = _a.valueAxisDomain;\n var yMinMax = extent(yData);\n var yMin = 0;\n var yMax = 1;\n if (yMinMax !== undefined) {\n yMin = this.min = yMinMax[0];\n yMax = this.max = yMinMax[1];\n }\n // if yMin is positive, set yMin to 0\n yMin = yMin < 0 ? yMin : 0;\n // if yMax is negative, set yMax to 0\n yMax = yMax < 0 ? 0 : yMax;\n if (valueAxisDomain) {\n if (valueAxisDomain[1] < yMax) {\n valueAxisDomain[1] = yMax;\n }\n if (valueAxisDomain[0] > yMin) {\n valueAxisDomain[0] = yMin;\n }\n }\n yScale.domain = valueAxisDomain ? valueAxisDomain : [yMin, yMax];\n };\n BarColumnSparkline.prototype.updateRectSelection = function (selectionData) {\n this.rectSelection.update(selectionData);\n };\n BarColumnSparkline.prototype.updateRectNodes = function () {\n var _this = this;\n var _a = this, highlightedDatum = _a.highlightedDatum, nodeFormatter = _a.formatter, fill = _a.fill, stroke = _a.stroke, strokeWidth = _a.strokeWidth;\n var _b = this.highlightStyle, highlightFill = _b.fill, highlightStroke = _b.stroke, highlightStrokeWidth = _b.strokeWidth;\n this.rectSelection.each(function (node, datum, index) {\n var highlighted = datum === highlightedDatum;\n var nodeFill = highlighted && highlightFill !== undefined ? highlightFill : fill;\n var nodeStroke = highlighted && highlightStroke !== undefined ? highlightStroke : stroke;\n var nodeStrokeWidth = highlighted && highlightStrokeWidth !== undefined ? highlightStrokeWidth : strokeWidth;\n var nodeFormat;\n var x = datum.x, y = datum.y, width = datum.width, height = datum.height, seriesDatum = datum.seriesDatum;\n if (nodeFormatter) {\n var first = index === 0;\n var last = index === _this.nodeSelectionData.length - 1;\n var min = seriesDatum.y === _this.min;\n var max = seriesDatum.y === _this.max;\n nodeFormat = nodeFormatter({\n datum: datum,\n xValue: seriesDatum.x,\n yValue: seriesDatum.y,\n width: width,\n height: height,\n min: min,\n max: max,\n first: first,\n last: last,\n fill: nodeFill,\n stroke: nodeStroke,\n strokeWidth: nodeStrokeWidth,\n highlighted: highlighted,\n });\n }\n node.fill = (nodeFormat && nodeFormat.fill) || nodeFill;\n node.stroke = (nodeFormat && nodeFormat.stroke) || nodeStroke;\n node.strokeWidth = (nodeFormat && nodeFormat.strokeWidth) || nodeStrokeWidth;\n node.x = node.y = 0;\n node.width = width;\n node.height = height;\n node.visible = node.height > 0;\n node.translationX = x;\n node.translationY = y;\n // shifts bars upwards?\n // node.crisp = true;\n });\n };\n BarColumnSparkline.prototype.updateLabelSelection = function (selectionData) {\n this.labelSelection.update(selectionData, function (text) {\n text.tag = BarColumnNodeTag.Label;\n text.pointerEvents = PointerEvents.None;\n });\n };\n BarColumnSparkline.prototype.updateLabelNodes = function () {\n var _a = this.label, labelEnabled = _a.enabled, fontStyle = _a.fontStyle, fontWeight = _a.fontWeight, fontSize = _a.fontSize, fontFamily = _a.fontFamily, color = _a.color;\n this.labelSelection.each(function (text, datum) {\n var label = datum.label;\n if (label && labelEnabled) {\n text.fontStyle = fontStyle;\n text.fontWeight = fontWeight;\n text.fontSize = fontSize;\n text.fontFamily = fontFamily;\n text.textAlign = label.textAlign;\n text.textBaseline = label.textBaseline;\n text.text = label.text;\n text.x = label.x;\n text.y = label.y;\n text.fill = color;\n text.visible = true;\n }\n else {\n text.visible = false;\n }\n });\n };\n BarColumnSparkline.prototype.getTooltipHtml = function (datum) {\n var _a, _b;\n var dataType = this.dataType;\n var seriesDatum = datum.seriesDatum;\n var yValue = seriesDatum.y;\n var xValue = seriesDatum.x;\n var content = this.formatNumericDatum(yValue);\n var title = dataType === 'array' || dataType === 'object' ? this.formatDatum(xValue) : undefined;\n var defaults = {\n content: content,\n title: title,\n };\n var tooltipRenderer = (_b = (_a = this.processedOptions) === null || _a === void 0 ? void 0 : _a.tooltip) === null || _b === void 0 ? void 0 : _b.renderer;\n if (tooltipRenderer) {\n return toTooltipHtml(tooltipRenderer({\n context: this.context,\n datum: seriesDatum,\n yValue: yValue,\n xValue: xValue,\n }), defaults);\n }\n return toTooltipHtml(defaults);\n };\n BarColumnSparkline.prototype.formatLabelValue = function (value) {\n return value % 1 !== 0 ? value.toFixed(1) : value.toFixed(0);\n };\n return BarColumnSparkline;\n}(Sparkline));\n\nvar __extends$3 = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar isNumber$2 = isNumber$4;\nvar BandScale$1 = BandScale$5;\nvar BarSparkline = /** @class */ (function (_super) {\n __extends$3(BarSparkline, _super);\n function BarSparkline() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n BarSparkline.prototype.updateYScaleRange = function () {\n var _a = this, seriesRect = _a.seriesRect, yScale = _a.yScale;\n yScale.range = [0, seriesRect.width];\n };\n BarSparkline.prototype.updateXScaleRange = function () {\n var _a = this, xScale = _a.xScale, seriesRect = _a.seriesRect, paddingOuter = _a.paddingOuter, paddingInner = _a.paddingInner;\n if (xScale instanceof BandScale$1) {\n xScale.range = [0, seriesRect.height];\n xScale.paddingInner = paddingInner;\n xScale.paddingOuter = paddingOuter;\n }\n else {\n // last node will be clipped if the scale is not a band scale\n // subtract last band width from the range so that the last band is not clipped\n var step = this.calculateStep(seriesRect.height);\n // PaddingOuter and paddingInner are fractions of the step with values between 0 and 1\n var padding = step * paddingOuter; // left and right outer padding\n this.bandWidth = step * (1 - paddingInner);\n xScale.range = [padding, seriesRect.height - padding - this.bandWidth];\n }\n };\n BarSparkline.prototype.updateAxisLine = function () {\n var _a = this, yScale = _a.yScale, axis = _a.axis, axisLine = _a.axisLine, seriesRect = _a.seriesRect;\n var strokeWidth = axis.strokeWidth;\n axisLine.x1 = 0;\n axisLine.x2 = 0;\n axisLine.y1 = 0;\n axisLine.y2 = seriesRect.height;\n axisLine.stroke = axis.stroke;\n axisLine.strokeWidth = strokeWidth + (strokeWidth % 2 === 1 ? 1 : 0);\n var yZero = yScale.convert(0);\n axisLine.translationX = yZero;\n };\n BarSparkline.prototype.generateNodeData = function () {\n var _a = this, data = _a.data, yData = _a.yData, xData = _a.xData, xScale = _a.xScale, yScale = _a.yScale, fill = _a.fill, stroke = _a.stroke, strokeWidth = _a.strokeWidth, label = _a.label;\n if (!data) {\n return;\n }\n var labelFontStyle = label.fontStyle, labelFontWeight = label.fontWeight, labelFontSize = label.fontSize, labelFontFamily = label.fontFamily, labelColor = label.color, labelFormatter = label.formatter, labelPlacement = label.placement;\n var nodeData = [];\n var yZero = yScale.convert(0);\n var continuous = !(xScale instanceof BandScale$1);\n for (var i = 0, n = yData.length; i < n; i++) {\n var yDatum = yData[i];\n var xDatum = xData[i];\n var invalidDatum = yDatum === undefined;\n if (invalidDatum) {\n yDatum = 0;\n }\n var y = xScale.convert(continuous ? xScale.toDomain(xDatum) : xDatum);\n var x = Math.min(yDatum === undefined ? NaN : yScale.convert(yDatum), yZero);\n var bottom = Math.max(yDatum === undefined ? NaN : yScale.convert(yDatum), yZero);\n // if the scale is a band scale, the width of the rects will be the bandwidth, otherwise the width of the rects will be the range / number of items in the data\n var height = !continuous ? xScale.bandwidth : this.bandWidth;\n var width = bottom - x;\n var midPoint = {\n x: yZero,\n y: y,\n };\n var labelText = void 0;\n if (labelFormatter) {\n labelText = labelFormatter({ value: yDatum });\n }\n else {\n labelText = yDatum !== undefined && isNumber$2(yDatum) ? this.formatLabelValue(yDatum) : '';\n }\n var labelY = y + height / 2;\n var labelX = void 0;\n var labelTextBaseline = 'middle';\n var labelTextAlign = void 0;\n var isPositiveY = yDatum !== undefined && yDatum >= 0;\n var labelPadding = 4;\n if (labelPlacement === BarColumnLabelPlacement.Center) {\n labelX = x + width / 2;\n labelTextAlign = 'center';\n }\n else if (labelPlacement === BarColumnLabelPlacement.OutsideEnd) {\n labelX = x + (isPositiveY ? width + labelPadding : -labelPadding);\n labelTextAlign = isPositiveY ? 'start' : 'end';\n }\n else if (labelPlacement === BarColumnLabelPlacement.InsideEnd) {\n labelX = x + (isPositiveY ? width - labelPadding : labelPadding);\n labelTextAlign = isPositiveY ? 'end' : 'start';\n var textSize = HdpiCanvas.getTextSize(labelText, labelFontFamily);\n var textWidth = textSize.width || 20;\n var positiveBoundary = yZero + textWidth;\n var negativeBoundary = yZero - textWidth;\n var exceedsBoundaries = (isPositiveY && labelX < positiveBoundary) || (!isPositiveY && labelX > negativeBoundary);\n if (exceedsBoundaries) {\n // if labelX exceeds the boundary, labels should be positioned at `insideBase`.\n labelX = yZero + labelPadding * (isPositiveY ? 1 : -1);\n labelTextAlign = isPositiveY ? 'start' : 'end';\n }\n }\n else {\n // if labelPlacement === BarColumnLabelPlacement.InsideBase\n labelX = yZero + labelPadding * (isPositiveY ? 1 : -1);\n labelTextAlign = isPositiveY ? 'start' : 'end';\n }\n nodeData.push({\n x: x,\n y: y,\n width: width,\n height: height,\n fill: fill,\n stroke: stroke,\n strokeWidth: strokeWidth,\n seriesDatum: { x: xDatum, y: invalidDatum ? undefined : yDatum },\n point: midPoint,\n label: {\n x: labelX,\n y: labelY,\n text: labelText,\n fontStyle: labelFontStyle,\n fontWeight: labelFontWeight,\n fontSize: labelFontSize,\n fontFamily: labelFontFamily,\n textAlign: labelTextAlign,\n textBaseline: labelTextBaseline,\n fill: labelColor,\n },\n });\n }\n return nodeData;\n };\n BarSparkline.prototype.getDistance = function (p1, p2) {\n return Math.abs(p1.y - p2.y);\n };\n BarSparkline.className = 'BarSparkline';\n return BarSparkline;\n}(BarColumnSparkline));\n\nvar __extends$2 = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar isNumber$1 = isNumber$4;\nvar BandScale = BandScale$5;\nvar ColumnSparkline = /** @class */ (function (_super) {\n __extends$2(ColumnSparkline, _super);\n function ColumnSparkline() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n ColumnSparkline.prototype.updateYScaleRange = function () {\n var _a = this, seriesRect = _a.seriesRect, yScale = _a.yScale;\n yScale.range = [seriesRect.height, 0];\n };\n ColumnSparkline.prototype.updateXScaleRange = function () {\n var _a = this, xScale = _a.xScale, seriesRect = _a.seriesRect, paddingOuter = _a.paddingOuter, paddingInner = _a.paddingInner;\n if (xScale instanceof BandScale) {\n xScale.range = [0, seriesRect.width];\n xScale.paddingInner = paddingInner;\n xScale.paddingOuter = paddingOuter;\n }\n else {\n // last node will be clipped if the scale is not a band scale\n // subtract last band width from the range so that the last band is not clipped\n var step = this.calculateStep(seriesRect.width);\n // PaddingOuter and paddingInner are fractions of the step with values between 0 and 1\n var padding = step * paddingOuter; // left and right outer padding\n this.bandWidth = step * (1 - paddingInner);\n xScale.range = [padding, seriesRect.width - padding - this.bandWidth];\n }\n };\n ColumnSparkline.prototype.updateAxisLine = function () {\n var _a = this, yScale = _a.yScale, axis = _a.axis, axisLine = _a.axisLine, seriesRect = _a.seriesRect;\n var strokeWidth = axis.strokeWidth;\n axisLine.x1 = 0;\n axisLine.x2 = seriesRect.width;\n axisLine.y1 = 0;\n axisLine.y2 = 0;\n axisLine.stroke = axis.stroke;\n axisLine.strokeWidth = strokeWidth + (strokeWidth % 2 === 1 ? 1 : 0);\n var yZero = yScale.convert(0);\n axisLine.translationY = yZero;\n };\n ColumnSparkline.prototype.generateNodeData = function () {\n var _a = this, data = _a.data, yData = _a.yData, xData = _a.xData, xScale = _a.xScale, yScale = _a.yScale, fill = _a.fill, stroke = _a.stroke, strokeWidth = _a.strokeWidth, label = _a.label;\n if (!data) {\n return;\n }\n var labelFontStyle = label.fontStyle, labelFontWeight = label.fontWeight, labelFontSize = label.fontSize, labelFontFamily = label.fontFamily, labelColor = label.color, labelFormatter = label.formatter, labelPlacement = label.placement;\n var nodeData = [];\n var yZero = yScale.convert(0);\n var continuous = !(xScale instanceof BandScale);\n for (var i = 0, n = yData.length; i < n; i++) {\n var yDatum = yData[i];\n var xDatum = xData[i];\n var invalidDatum = yDatum === undefined;\n if (invalidDatum) {\n yDatum = 0;\n }\n var y = Math.min(yDatum === undefined ? NaN : yScale.convert(yDatum), yZero);\n var x = xScale.convert(continuous ? xScale.toDomain(xDatum) : xDatum);\n var bottom = Math.max(yDatum === undefined ? NaN : yScale.convert(yDatum), yZero);\n // if the scale is a band scale, the width of the rects will be the bandwidth, otherwise the width of the rects will be the range / number of items in the data\n var width = !continuous ? xScale.bandwidth : this.bandWidth;\n var height = bottom - y;\n var midPoint = {\n x: x + width / 2,\n y: yZero,\n };\n var labelText = void 0;\n if (labelFormatter) {\n labelText = labelFormatter({ value: yDatum });\n }\n else {\n labelText = yDatum !== undefined && isNumber$1(yDatum) ? this.formatLabelValue(yDatum) : '';\n }\n var labelX = x + width / 2;\n var labelY = void 0;\n var labelTextAlign = 'center';\n var labelTextBaseline = void 0;\n var isPositiveY = yDatum !== undefined && yDatum >= 0;\n var labelPadding = 2;\n if (labelPlacement === BarColumnLabelPlacement.Center) {\n labelY = y + height / 2;\n labelTextBaseline = 'middle';\n }\n else if (labelPlacement === BarColumnLabelPlacement.OutsideEnd) {\n labelY = y + (isPositiveY ? -labelPadding : height + labelPadding);\n labelTextBaseline = isPositiveY ? 'bottom' : 'top';\n }\n else if (labelPlacement === BarColumnLabelPlacement.InsideEnd) {\n labelY = y + (isPositiveY ? labelPadding : height - labelPadding);\n labelTextBaseline = isPositiveY ? 'top' : 'bottom';\n var textSize = HdpiCanvas.getTextSize(labelText, labelFontFamily);\n var textHeight = textSize.height || 10;\n var positiveBoundary = yZero - textHeight;\n var negativeBoundary = yZero + textHeight;\n var exceedsBoundaries = (isPositiveY && labelY > positiveBoundary) || (!isPositiveY && labelY < negativeBoundary);\n if (exceedsBoundaries) {\n // if labelY exceeds the y boundary, labels should be positioned at the insideBase\n labelY = yZero + labelPadding * (isPositiveY ? -1 : 1);\n labelTextBaseline = isPositiveY ? 'bottom' : 'top';\n }\n }\n else {\n // if labelPlacement === BarColumnLabelPlacement.InsideBase\n labelY = yZero + labelPadding * (isPositiveY ? -1 : 1);\n labelTextBaseline = isPositiveY ? 'bottom' : 'top';\n }\n nodeData.push({\n x: x,\n y: y,\n width: width,\n height: height,\n fill: fill,\n stroke: stroke,\n strokeWidth: strokeWidth,\n seriesDatum: { x: xDatum, y: invalidDatum ? undefined : yDatum },\n point: midPoint,\n label: {\n x: labelX,\n y: labelY,\n text: labelText,\n fontStyle: labelFontStyle,\n fontWeight: labelFontWeight,\n fontSize: labelFontSize,\n fontFamily: labelFontFamily,\n textAlign: labelTextAlign,\n textBaseline: labelTextBaseline,\n fill: labelColor,\n },\n });\n }\n return nodeData;\n };\n ColumnSparkline.className = 'ColumnSparkline';\n return ColumnSparkline;\n}(BarColumnSparkline));\n\nvar isNumber = isNumber$4;\nvar AgSparkline = /** @class */ (function () {\n function AgSparkline() {\n }\n AgSparkline.create = function (options, tooltip) {\n // avoid mutating user provided options\n options = jsonMerge([options]);\n var sparkline = getSparklineInstance(options.type);\n if (tooltip) {\n sparkline.tooltip = tooltip;\n }\n initSparkline(sparkline, options);\n initSparklineByType(sparkline, options);\n if (options.data) {\n sparkline.data = options.data;\n }\n sparkline.processedOptions = options;\n return sparkline;\n };\n return AgSparkline;\n}());\nfunction getSparklineInstance(type) {\n if (type === void 0) { type = 'line'; }\n switch (type) {\n case 'column':\n return new ColumnSparkline();\n case 'bar':\n return new BarSparkline();\n case 'area':\n return new AreaSparkline();\n case 'line':\n default:\n return new LineSparkline();\n }\n}\nfunction initSparklineByType(sparkline, options) {\n switch (options.type) {\n case 'bar':\n initBarColumnSparkline(sparkline, options);\n break;\n case 'column':\n initBarColumnSparkline(sparkline, options);\n break;\n case 'area':\n initAreaSparkline(sparkline, options);\n break;\n case 'line':\n default:\n initLineSparkline(sparkline, options);\n break;\n }\n}\nfunction initSparkline(sparkline, options) {\n setValueIfPropertyExists(sparkline, 'context', options.context, options);\n setValueIfPropertyExists(sparkline, 'width', options.width, options);\n setValueIfPropertyExists(sparkline, 'height', options.height, options);\n setValueIfPropertyExists(sparkline, 'container', options.container, options);\n setValueIfPropertyExists(sparkline, 'xKey', options.xKey, options);\n setValueIfPropertyExists(sparkline, 'yKey', options.yKey, options);\n if (options.padding) {\n initPaddingOptions(sparkline.padding, options.padding);\n }\n if (options.axis) {\n initAxisOptions(sparkline.axis, options.axis);\n }\n if (options.highlightStyle) {\n initHighlightStyleOptions(sparkline.highlightStyle, options.highlightStyle);\n }\n}\nfunction initLineSparkline(sparkline, options) {\n if (options.marker) {\n initMarkerOptions(sparkline.marker, options.marker);\n }\n if (options.line) {\n initLineOptions(sparkline.line, options.line);\n }\n if (options.crosshairs) {\n initCrosshairsOptions(sparkline.crosshairs, options.crosshairs);\n }\n}\nfunction initAreaSparkline(sparkline, options) {\n setValueIfPropertyExists(sparkline, 'fill', options.fill, options);\n if (options.marker) {\n initMarkerOptions(sparkline.marker, options.marker);\n }\n if (options.line) {\n initLineOptions(sparkline.line, options.line);\n }\n if (options.crosshairs) {\n initCrosshairsOptions(sparkline.crosshairs, options.crosshairs);\n }\n}\nfunction initBarColumnSparkline(sparkline, options) {\n setValueIfPropertyExists(sparkline, 'valueAxisDomain', options.valueAxisDomain, options);\n setValueIfPropertyExists(sparkline, 'fill', options.fill, options);\n setValueIfPropertyExists(sparkline, 'stroke', options.stroke, options);\n setValueIfPropertyExists(sparkline, 'strokeWidth', options.strokeWidth, options);\n setValueIfPropertyExists(sparkline, 'paddingInner', options.paddingInner, options);\n setValueIfPropertyExists(sparkline, 'paddingOuter', options.paddingOuter, options);\n setValueIfPropertyExists(sparkline, 'formatter', options.formatter, options);\n if (options.label) {\n initLabelOptions(sparkline.label, options.label);\n }\n}\nfunction initPaddingOptions(target, options) {\n setValueIfPropertyExists(target, 'top', options.top, options);\n setValueIfPropertyExists(target, 'right', options.right, options);\n setValueIfPropertyExists(target, 'bottom', options.bottom, options);\n setValueIfPropertyExists(target, 'left', options.left, options);\n}\nfunction initMarkerOptions(target, options) {\n setValueIfPropertyExists(target, 'enabled', options.enabled, options);\n setValueIfPropertyExists(target, 'size', options.size, options);\n setValueIfPropertyExists(target, 'shape', options.shape, options);\n setValueIfPropertyExists(target, 'fill', options.fill, options);\n setValueIfPropertyExists(target, 'stroke', options.stroke, options);\n setValueIfPropertyExists(target, 'strokeWidth', options.strokeWidth, options);\n setValueIfPropertyExists(target, 'formatter', options.formatter, options);\n}\nfunction initLabelOptions(target, options) {\n setValueIfPropertyExists(target, 'enabled', options.enabled, options);\n setValueIfPropertyExists(target, 'fontStyle', options.fontStyle, options);\n setValueIfPropertyExists(target, 'fontWeight', options.fontWeight, options);\n setValueIfPropertyExists(target, 'fontSize', options.fontSize, options);\n setValueIfPropertyExists(target, 'fontFamily', options.fontFamily, options);\n setValueIfPropertyExists(target, 'textAlign', options.textAlign, options);\n setValueIfPropertyExists(target, 'textBaseline', options.textBaseline, options);\n setValueIfPropertyExists(target, 'color', options.color, options);\n setValueIfPropertyExists(target, 'formatter', options.formatter, options);\n setValueIfPropertyExists(target, 'placement', options.placement, options);\n}\nfunction initLineOptions(target, options) {\n setValueIfPropertyExists(target, 'stroke', options.stroke, options);\n setValueIfPropertyExists(target, 'strokeWidth', options.strokeWidth, options);\n}\nfunction initAxisOptions(target, options) {\n setValueIfPropertyExists(target, 'type', options.type, options);\n setValueIfPropertyExists(target, 'stroke', options.stroke, options);\n setValueIfPropertyExists(target, 'strokeWidth', options.strokeWidth, options);\n}\nfunction initHighlightStyleOptions(target, options) {\n setValueIfPropertyExists(target, 'fill', options.fill, options);\n setValueIfPropertyExists(target, 'size', options.size, options);\n setValueIfPropertyExists(target, 'stroke', options.stroke, options);\n setValueIfPropertyExists(target, 'strokeWidth', options.strokeWidth, options);\n}\nfunction initCrosshairsOptions(target, options) {\n if (target.xLine && options.xLine) {\n initCrosshairLineOptions(target.xLine, options.xLine);\n }\n if (target.yLine && options.yLine) {\n initCrosshairLineOptions(target.yLine, options.yLine);\n }\n}\nfunction initCrosshairLineOptions(target, options) {\n setValueIfPropertyExists(target, 'enabled', options.enabled, options);\n setValueIfPropertyExists(target, 'stroke', options.stroke, options);\n setValueIfPropertyExists(target, 'strokeWidth', options.strokeWidth, options);\n setValueIfPropertyExists(target, 'lineDash', options.lineDash, options);\n setValueIfPropertyExists(target, 'lineCap', options.lineCap, options);\n}\nvar doOnceFlags = {};\n/**\n * If the key was passed before, then doesn't execute the func\n * @param {Function} func\n * @param {string} key\n */\nfunction doOnce(func, key) {\n if (doOnceFlags[key]) {\n return;\n }\n func();\n doOnceFlags[key] = true;\n}\nvar offsetValidator = function (property, value, defaultOffset) {\n if (isNumber(value)) {\n return true;\n }\n var message = \"AG Charts: \" + property + \" must be a number, the value you provided is not a valid number. Using the default of \" + defaultOffset + \"px.\";\n doOnce(function () { return console.warn(message); }, property + \" not a number\");\n return false;\n};\nvar validators = {\n xOffset: offsetValidator,\n yOffset: offsetValidator,\n};\nfunction setValueIfPropertyExists(target, property, value, options) {\n if (property in options) {\n if (property in target) {\n var validator = validators[property];\n var isValid = validator ? validator(property, value, target[property]) : true;\n if (isValid && target[property] !== value) {\n // only set property if the value is different to new value\n target[property] = value;\n }\n }\n else {\n console.warn(\"Property \" + property + \" does not exist on the target object.\");\n }\n }\n}\n\nvar __extends$1 = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (undefined && undefined.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __decorate$1 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar SparklineCellRenderer = /** @class */ (function (_super) {\n __extends$1(SparklineCellRenderer, _super);\n function SparklineCellRenderer() {\n return _super.call(this, SparklineCellRenderer.TEMPLATE) || this;\n }\n SparklineCellRenderer.prototype.init = function (params) {\n var _this = this;\n var firstTimeIn = true;\n var updateSparkline = function () {\n var _a = _this.getGui(), clientWidth = _a.clientWidth, clientHeight = _a.clientHeight;\n if (clientWidth === 0 || clientHeight === 0) {\n return;\n }\n if (firstTimeIn) {\n var options = __assign({ data: params.value, width: clientWidth, height: clientHeight, context: {\n data: params.data,\n } }, params.sparklineOptions);\n // create new instance of sparkline\n _this.sparkline = AgSparkline.create(options, _this.sparklineTooltipSingleton.getSparklineTooltip());\n // append sparkline canvas to cell renderer element\n _this.eSparkline.appendChild(_this.sparkline.canvasElement);\n firstTimeIn = false;\n }\n else {\n _this.sparkline.width = clientWidth;\n _this.sparkline.height = clientHeight;\n }\n };\n var unsubscribeFromResize = this.resizeObserverService.observeResize(this.getGui(), updateSparkline);\n this.addDestroyFunc(function () { return unsubscribeFromResize(); });\n };\n SparklineCellRenderer.prototype.refresh = function (params) {\n if (this.sparkline) {\n this.sparkline.data = params.value;\n return true;\n }\n return false;\n };\n SparklineCellRenderer.prototype.destroy = function () {\n if (this.sparkline) {\n this.sparkline.destroy();\n }\n _super.prototype.destroy.call(this);\n };\n SparklineCellRenderer.TEMPLATE /* html */ = \"
\\n \\n
\";\n __decorate$1([\n RefSelector('eSparkline')\n ], SparklineCellRenderer.prototype, \"eSparkline\", void 0);\n __decorate$1([\n Autowired('resizeObserverService')\n ], SparklineCellRenderer.prototype, \"resizeObserverService\", void 0);\n __decorate$1([\n Autowired('sparklineTooltipSingleton')\n ], SparklineCellRenderer.prototype, \"sparklineTooltipSingleton\", void 0);\n return SparklineCellRenderer;\n}(Component));\n\nvar __extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\n/**\n * This 'bean' creates a single sparkline tooltip that is bound to the grid lifecycle.\n */\nvar SparklineTooltipSingleton = /** @class */ (function (_super) {\n __extends(SparklineTooltipSingleton, _super);\n function SparklineTooltipSingleton() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n SparklineTooltipSingleton.prototype.postConstruct = function () {\n this.tooltip = new SparklineTooltip();\n };\n SparklineTooltipSingleton.prototype.getSparklineTooltip = function () {\n return this.tooltip;\n };\n SparklineTooltipSingleton.prototype.destroyTooltip = function () {\n if (this.tooltip) {\n this.tooltip.destroy();\n }\n };\n __decorate([\n PostConstruct\n ], SparklineTooltipSingleton.prototype, \"postConstruct\", null);\n __decorate([\n PreDestroy\n ], SparklineTooltipSingleton.prototype, \"destroyTooltip\", null);\n SparklineTooltipSingleton = __decorate([\n Bean('sparklineTooltipSingleton')\n ], SparklineTooltipSingleton);\n return SparklineTooltipSingleton;\n}(BeanStub));\n\n// DO NOT UPDATE MANUALLY: Generated from script during build time\nvar VERSION = '30.0.6';\n\nvar SparklinesModule = {\n version: VERSION,\n moduleName: ModuleNames.SparklinesModule,\n beans: [SparklineTooltipSingleton],\n userComponents: [{ componentName: 'agSparklineCellRenderer', componentClass: SparklineCellRenderer }],\n dependantModules: [EnterpriseCoreModule],\n};\n\nconst AllEnterpriseModules = [\n ClipboardModule,\n ColumnsToolPanelModule,\n ExcelExportModule,\n FiltersToolPanelModule,\n GridChartsModule,\n MasterDetailModule,\n MenuModule,\n MultiFilterModule,\n RangeSelectionModule,\n RichSelectModule,\n RowGroupingModule,\n ServerSideRowModelModule,\n SetFilterModule,\n SideBarModule,\n StatusBarModule,\n ViewportRowModelModule,\n SparklinesModule\n];\nconst AllModules = AllCommunityModules.concat(AllEnterpriseModules);\n\nModuleRegistry.registerModules(AllEnterpriseModules);\n\nexport { AllEnterpriseModules, AllModules, ClipboardModule, ColumnsToolPanelModule, EnterpriseCoreModule, ExcelExportModule, FiltersToolPanelModule, GridChartsModule, GridLicenseManager as LicenseManager, MasterDetailModule, MenuModule, MultiFilter, MultiFilterModule, PivotDropZonePanel, PrimaryColsPanel, RangeSelectionModule, RichSelectModule, RowGroupDropZonePanel, RowGroupingModule, ServerSideRowModelModule, SetFilter, SetFilterModule, SideBarModule, SparklinesModule, StatusBarModule, ToolPanelColDefService, ValuesDropZonePanel, ViewportRowModelModule, __FORCE_MODULE_DETECTION_AG_GRID_CORE_EXT, agCharts, exportMultipleSheetsAsExcel, getMultipleSheetsAsExcel };\n"],"names":[],"sourceRoot":""}