@odoo/o-spreadsheet 17.0.29 → 17.0.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,9 +2,9 @@
2
2
  /**
3
3
  * This file is generated by o-spreadsheet build tools. Do not edit it.
4
4
  * @see https://github.com/odoo/o-spreadsheet
5
- * @version 17.0.29
6
- * @date 2024-07-08T05:40:27.608Z
7
- * @hash 2d467e3
5
+ * @version 17.0.30
6
+ * @date 2024-07-11T06:34:04.932Z
7
+ * @hash a8eacf4
8
8
  */
9
9
 
10
10
  'use strict';
@@ -8430,7 +8430,7 @@ function truncateLabel(label) {
8430
8430
  /**
8431
8431
  * Get a default chart js configuration
8432
8432
  */
8433
- function getDefaultChartJsRuntime(chart, labels, fontColor, { format, locale, truncateLabels }) {
8433
+ function getDefaultChartJsRuntime(chart, labels, fontColor, { format, locale, truncateLabels = true }) {
8434
8434
  const options = {
8435
8435
  // https://www.chartjs.org/docs/latest/general/responsive.html
8436
8436
  responsive: true,
@@ -57578,6 +57578,6 @@ exports.setTranslationMethod = setTranslationMethod;
57578
57578
  exports.tokenize = tokenize;
57579
57579
 
57580
57580
 
57581
- __info__.version = "17.0.29";
57582
- __info__.date = "2024-07-08T05:40:27.608Z";
57583
- __info__.hash = "2d467e3";
57581
+ __info__.version = "17.0.30";
57582
+ __info__.date = "2024-07-11T06:34:04.932Z";
57583
+ __info__.hash = "a8eacf4";
@@ -2,9 +2,9 @@
2
2
  /**
3
3
  * This file is generated by o-spreadsheet build tools. Do not edit it.
4
4
  * @see https://github.com/odoo/o-spreadsheet
5
- * @version 17.0.29
6
- * @date 2024-07-08T05:40:27.608Z
7
- * @hash 2d467e3
5
+ * @version 17.0.30
6
+ * @date 2024-07-11T06:34:04.932Z
7
+ * @hash a8eacf4
8
8
  */
9
9
 
10
10
  import { Component, useRef, onMounted, useEffect, onWillPatch, useState, onWillUpdateProps, onPatched, useComponent, useExternalListener, onWillUnmount, onWillStart, xml, useChildSubEnv, useSubEnv, markRaw } from '@odoo/owl';
@@ -8428,7 +8428,7 @@ function truncateLabel(label) {
8428
8428
  /**
8429
8429
  * Get a default chart js configuration
8430
8430
  */
8431
- function getDefaultChartJsRuntime(chart, labels, fontColor, { format, locale, truncateLabels }) {
8431
+ function getDefaultChartJsRuntime(chart, labels, fontColor, { format, locale, truncateLabels = true }) {
8432
8432
  const options = {
8433
8433
  // https://www.chartjs.org/docs/latest/general/responsive.html
8434
8434
  responsive: true,
@@ -57541,6 +57541,6 @@ const constants = {
57541
57541
  export { AbstractChart, CommandResult, CorePlugin, DispatchResult, EvaluationError, Model, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, UIPlugin, __info__, addFunction, astToFormula, compile, compileTokens, components, constants, convertAstNodes, coreTypes, findCellInNewZone, functionCache, helpers, hooks, invalidateCFEvaluationCommands, invalidateDependenciesCommands, invalidateEvaluationCommands, iterateAstNodes, links, load, parse, parseTokens, readonlyAllowedCommands, registries, setDefaultSheetViewSize, setTranslationMethod, tokenize };
57542
57542
 
57543
57543
 
57544
- __info__.version = "17.0.29";
57545
- __info__.date = "2024-07-08T05:40:27.608Z";
57546
- __info__.hash = "2d467e3";
57544
+ __info__.version = "17.0.30";
57545
+ __info__.date = "2024-07-11T06:34:04.932Z";
57546
+ __info__.hash = "a8eacf4";
@@ -2,9 +2,9 @@
2
2
  /**
3
3
  * This file is generated by o-spreadsheet build tools. Do not edit it.
4
4
  * @see https://github.com/odoo/o-spreadsheet
5
- * @version 17.0.29
6
- * @date 2024-07-08T05:40:27.608Z
7
- * @hash 2d467e3
5
+ * @version 17.0.30
6
+ * @date 2024-07-11T06:34:04.932Z
7
+ * @hash a8eacf4
8
8
  */
9
9
 
10
10
  (function (exports, owl) {
@@ -8429,7 +8429,7 @@
8429
8429
  /**
8430
8430
  * Get a default chart js configuration
8431
8431
  */
8432
- function getDefaultChartJsRuntime(chart, labels, fontColor, { format, locale, truncateLabels }) {
8432
+ function getDefaultChartJsRuntime(chart, labels, fontColor, { format, locale, truncateLabels = true }) {
8433
8433
  const options = {
8434
8434
  // https://www.chartjs.org/docs/latest/general/responsive.html
8435
8435
  responsive: true,
@@ -57577,9 +57577,9 @@
57577
57577
  exports.tokenize = tokenize;
57578
57578
 
57579
57579
 
57580
- __info__.version = "17.0.29";
57581
- __info__.date = "2024-07-08T05:40:27.608Z";
57582
- __info__.hash = "2d467e3";
57580
+ __info__.version = "17.0.30";
57581
+ __info__.date = "2024-07-11T06:34:04.932Z";
57582
+ __info__.hash = "a8eacf4";
57583
57583
 
57584
57584
 
57585
57585
  })(this.o_spreadsheet = this.o_spreadsheet || {}, owl);
@@ -280,7 +280,7 @@
280
280
  }
281
281
  }
282
282
  }
283
- `;class Aa extends t.Component{static template="o-spreadsheet-LinkEditor";static components={Menu:Hr};menuItems=Ta.getMenuItems();link=t.useState(this.defaultState);menu=t.useState({isOpen:!1});linkEditorRef=t.useRef("linkEditor");position=Fr(this.linkEditorRef);urlInput=t.useRef("urlInput");setup(){t.onMounted((()=>this.urlInput.el?.focus()))}get defaultState(){const{col:e,row:t}=this.props.cellPosition,o=this.env.model.getters.getActiveSheetId(),s=this.env.model.getters.getEvaluatedCell({sheetId:o,col:e,row:t});return s.link?{url:s.link.url,label:s.formattedValue,isUrlEditable:s.link.isUrlEditable}:{label:s.formattedValue,url:"",isUrlEditable:!0}}get menuPosition(){return{x:this.position.x+320-12-2,y:this.position.y+100}}onSpecialLink(e){const{detail:t}=e,o=ji(t);o&&(this.link.url=o.url,this.link.label=o.label,this.link.isUrlEditable=o.isUrlEditable)}getUrlRepresentation(e){return Zi(e,this.env.model.getters)}openMenu(){this.menu.isOpen=!0}removeLink(){this.link.url="",this.link.isUrlEditable=!0}save(){const{col:e,row:t}=this.props.cellPosition,o=this.env.model.getters.getLocale(),s=this.link.label?aa(this.link.label,o):this.link.url;this.env.model.dispatch("UPDATE_CELL",{col:e,row:t,sheetId:this.env.model.getters.getActiveSheetId(),content:Ve(s,this.link.url)}),this.props.onClosed?.()}cancel(){this.props.onClosed?.()}onKeyDown(e){switch(e.key){case"Enter":this.link.url&&this.save(),e.stopPropagation(),e.preventDefault();break;case"Escape":this.cancel(),e.stopPropagation()}}}const Oa={onOpen:(e,t)=>({isOpen:!0,props:{cellPosition:e},Component:Aa,cellCorner:"BottomLeft"})};Aa.props={cellPosition:Object,onClosed:{type:Function,optional:!0}};const _a=new Hi;function Ma(e){return 8===(e=ft(e).replace("#","")).length?e.slice(6)+e.slice(0,6):e}_a.add("ErrorToolTip",vr).add("LinkCell",Gr).add("LinkEditor",Oa).add("FilterMenu",wr);const Na={wrongPasteSelection:a("This operation is not allowed with multiple selections."),willRemoveExistingMerge:a("This operation is not possible due to a merge. Please remove the merges first than try again."),wrongFigurePasteOption:a("Cannot do a special paste of a figure."),frozenPaneOverlap:a("This operation is not allowed due to an overlapping frozen pane.")};function Fa(e,t){t.isSuccessful||(t.reasons.includes("WrongPasteSelection")?e.raiseError(Na.wrongPasteSelection):t.reasons.includes("WillRemoveExistingMerge")?e.raiseError(Na.willRemoveExistingMerge):t.reasons.includes("WrongFigurePasteOption")?e.raiseError(Na.wrongFigurePasteOption):t.reasons.includes("FrozenPaneOverlap")&&e.raiseError(Na.frozenPaneOverlap))}function Da(e,t,o){const s=e.model.dispatch("PASTE",{target:t,pasteOption:o});Fa(e,s)}function La(e,t,o,s){const n=e.model.dispatch("PASTE_FROM_OS_CLIPBOARD",{target:t,text:o,pasteOption:s});Fa(e,n)}const Pa={Errors:{InvalidRange:a("The range is invalid"),FirstArgMissing:a("The argument is missing. Please provide a value"),SecondArgMissing:a("The second argument is missing. Please provide a value"),MinNaN:a("The minpoint must be a number"),MidNaN:a("The midpoint must be a number"),MaxNaN:a("The maxpoint must be a number"),ValueUpperInflectionNaN:a("The first value must be a number"),ValueLowerInflectionNaN:a("The second value must be a number"),MinBiggerThanMax:a("Minimum must be smaller then Maximum"),MinBiggerThanMid:a("Minimum must be smaller then Midpoint"),MidBiggerThanMax:a("Midpoint must be smaller then Maximum"),LowerBiggerThanUpper:a("Lower inflection point must be smaller than upper inflection point"),MinInvalidFormula:a("Invalid Minpoint formula"),MaxInvalidFormula:a("Invalid Maxpoint formula"),MidInvalidFormula:a("Invalid Midpoint formula"),ValueUpperInvalidFormula:a("Invalid upper inflection point formula"),ValueLowerInvalidFormula:a("Invalid lower inflection point formula"),EmptyRange:a("A range needs to be defined"),Unexpected:a("The rule is invalid for an unknown reason")},ColorScale:a("Color scale"),IconSet:a("Icon set")},ka={IsEmpty:a("Is empty"),IsNotEmpty:a("Is not empty"),ContainsText:a("Contains"),NotContains:a("Does not contain"),BeginsWith:a("Starts with"),EndsWith:a("Ends with"),Equal:a("Is equal to"),NotEqual:a("Is not equal to"),GreaterThan:a("Is greater than"),GreaterThanOrEqual:a("Is greater than or equal to"),LessThan:a("Is less than"),LessThanOrEqual:a("Is less than or equal to"),Between:a("Is between"),NotBetween:a("Is not between")},Va={Series:a("Series"),Errors:{Unexpected:a("The chart definition is invalid for an unknown reason"),InvalidDataSet:a("The dataset is invalid"),InvalidLabelRange:a("Labels are invalid"),InvalidScorecardKeyValue:a("The key value is invalid"),InvalidScorecardBaseline:a("The baseline value is invalid"),InvalidGaugeDataRange:a("The data range is invalid"),EmptyGaugeRangeMin:a("A minimum range limit value is needed"),GaugeRangeMinNaN:a("The minimum range limit value must be a number"),EmptyGaugeRangeMax:a("A maximum range limit value is needed"),GaugeRangeMaxNaN:a("The maximum range limit value must be a number"),GaugeRangeMinBiggerThanRangeMax:a("Minimum range limit must be smaller than maximum range limit"),GaugeLowerInflectionPointNaN:a("The lower inflection point value must be a number"),GaugeUpperInflectionPointNaN:a("The upper inflection point value must be a number")}},Ua={Custom:a("Custom")},Ba=a("Merged cells are preventing this operation. Unmerge those cells and try again."),Ha={Errors:{Unexpected:a("Cannot split the selection for an unknown reason"),NoSplitSeparatorInSelection:a("There is no match for the selected separator in the selection"),MoreThanOneColumnSelected:a("Only a selection from a single column can be split"),SplitWillOverwriteContent:a("Splitting will overwrite existing content")}},za={Errors:{Unexpected:a("Cannot remove duplicates for an unknown reason"),MoreThanOneRangeSelected:a("Please select only one range of cells"),EmptyTarget:a("Please select a range of cells containing values."),NoColumnsProvided:a("Please select at latest one column to analyze."),WillRemoveExistingMerge:Na.willRemoveExistingMerge}},Ga={DateIs:{today:a("today"),yesterday:a("yesterday"),tomorrow:a("tomorrow"),lastWeek:a("in the past week"),lastMonth:a("in the past month"),lastYear:a("in the past year")},DateIsBefore:{today:a("today"),yesterday:a("yesterday"),tomorrow:a("tomorrow"),lastWeek:a("one week ago"),lastMonth:a("one month ago"),lastYear:a("one year ago")},CriterionError:{notEmptyValue:a("The value must not be empty"),numberValue:a("The value must be a number"),dateValue:a("The value must be a date"),validRange:a("The value must be a valid range")}};function $a(e,t){if(t.dataRange){const o=t.labelCell?[pn(t.labelCell.zone)]:[],s=In([pn(t.dataRange.zone)],o)[0];if(void 0===s)return[];const n=e.getRangeFromSheetXC(t.dataRange.sheetId,s);return e.getRangeValues(n).map((e=>""===e?void 0:e))}return[]}function Wa(e,t){const o=Me(0,Math.max(e.length,...t.map((e=>e.data?.length||0)))).filter((o=>{const s=e[o],n=t.map((e=>e.data?.[o]));return s||n.some((e=>0===e||Boolean(e)))}));return{labels:o.map((t=>e[t]||"")),dataSetsValues:t.map((e=>({...e,data:o.map((t=>e.data[t]))})))}}function qa(e,t){const o=new Set(e),s={};o.forEach((e=>{s[e]=new Array(t.length).fill(0)}));for(const o of Me(0,e.length)){const i=e[o];for(const e of Me(0,t.length))s[i][e]+="number"==typeof(n=t[e].data[o])?n:0}var n;return{labels:Array.from(o),dataSetsValues:t.map(((e,t)=>({...e,data:Array.from(o).map((e=>s[e][t]))})))}}function Za(e){return e?e.length>de?e.substring(0,de)+"…":e:""}function Ya(e,t,o,{format:s,locale:n,truncateLabels:i}){const r={responsive:!0,maintainAspectRatio:!1,layout:{padding:{left:20,right:20,top:e.title?10:25,bottom:10}},elements:{line:{fill:!1},point:{hitRadius:15}},animation:!1,plugins:{title:{display:!!e.title,text:a(e.title),color:o,font:{size:22,weight:"normal"}},legend:{onClick:()=>{}},tooltip:{callbacks:{label:function(e){const t=e.dataset?.label||e.label,o=e.parsed.y??e.parsed,i=Is(o,{format:!s&&Math.abs(o)>=1e3?"#,##":s,locale:n});return t?`${t}: ${i}`:i}}}}};return{type:e.type,options:r,data:{labels:i?t.map(Za):t,datasets:[]},plugins:[]}}function ja(e,t,o){let s={values:[],formattedValues:[]};if(o)o.invalidXc||o.invalidSheetName||(s={formattedValues:e.getRangeFormattedValues(o),values:e.getRangeValues(o).map((e=>String(e)))});else if(1===t.length)for(let o=0;o<$a(e,t[0]).length;o++)s.formattedValues.push(""),s.values.push("");else if(t[0]){s={formattedValues:Me(0,$a(e,t[0]).length).map((e=>e.toString())),values:s.formattedValues}}return s}function Xa(e,t){for(const o of t){const t=e.getRangeFormats(o.dataRange).find((e=>void 0!==e&&!Ns(e)));if(t)return t}}function Ka(e,t){const o=[];for(const[s,n]of Object.entries(t)){let t;if(n.labelCell){const o=n.labelCell,i=o?e.getEvaluatedCell({sheetId:o.sheetId,col:o.zone.left,row:o.zone.top}):void 0;t=i&&o?Za(i.formattedValue):t=`${Va.Series} ${parseInt(s)+1}`}else t=t=`${Va.Series} ${parseInt(s)+1}`;let i=n.dataRange?$a(e,n):[];o.push({data:i,label:t})}return o}function Qa(e){return 0===e?"origin":e-1}function Ja(e,t,o){const s=document.createElement("div");s.style.width=`${t.width}px`,s.style.height=`${t.height}px`;const n=document.createElement("canvas");if(s.append(n),n.setAttribute("width",t.width.toString()),n.setAttribute("height",t.height.toString()),document.body.append(s),"chartJsConfig"in e){e.chartJsConfig.plugins=[el];const t=new window.Chart(n,Te(e.chartJsConfig)),o=t.toBase64Image();return t.destroy(),s.remove(),o}if("scorecard"===o){Fi(Li(t,e),n);const o=n.toDataURL();return s.remove(),o}return""}const el={id:"customCanvasBackgroundColor",beforeDraw:e=>{const{ctx:t}=e;t.save(),t.globalCompositeOperation="destination-over",t.fillStyle="#ffffff",t.fillRect(0,0,e.width,e.height),t.restore()}};class tl extends ci{dataSets;labelRange;background;verticalAxisPosition;legendPosition;stacked;aggregated;type="bar";dataSetsHaveTitle;constructor(e,t,o){super(e,t,o),this.dataSets=pi(o,e.dataSets,t,e.dataSetsHaveTitle),this.labelRange=Un(o,t,e.labelRange),this.background=e.background,this.verticalAxisPosition=e.verticalAxisPosition,this.legendPosition=e.legendPosition,this.stacked=e.stacked,this.aggregated=e.aggregated,this.dataSetsHaveTitle=e.dataSetsHaveTitle}static transformDefinition(e,t){return vi(e,t)}static validateChartDefinition(e,t){return e.checkValidations(t,wi,yi)}static getDefinitionFromContextCreation(e){return{background:e.background,dataSets:e.range?e.range:[],dataSetsHaveTitle:!1,stacked:!1,aggregated:!1,legendPosition:"top",title:e.title||"",type:"bar",verticalAxisPosition:"left",labelRange:e.auxiliaryRange||void 0}}getContextCreation(){return{background:this.background,title:this.title,range:this.dataSets.map((e=>this.getters.getRangeString(e.dataRange,this.sheetId))),auxiliaryRange:this.labelRange?this.getters.getRangeString(this.labelRange,this.sheetId):void 0}}copyForSheetId(e){const t=di(this.sheetId,e,this.dataSets),o=ui(this.sheetId,e,this.labelRange),s=this.getDefinitionWithSpecificDataSets(t,o,e);return new tl(s,e,this.getters)}copyInSheetId(e){const t=this.getDefinitionWithSpecificDataSets(this.dataSets,this.labelRange,e);return new tl(t,e,this.getters)}getDefinition(){return this.getDefinitionWithSpecificDataSets(this.dataSets,this.labelRange)}getDefinitionWithSpecificDataSets(e,t,o){return{type:"bar",dataSetsHaveTitle:!!e.length&&Boolean(e[0].labelCell),background:this.background,dataSets:e.map((e=>this.getters.getRangeString(e.dataRange,o||this.sheetId))),legendPosition:this.legendPosition,verticalAxisPosition:this.verticalAxisPosition,labelRange:t?this.getters.getRangeString(t,o||this.sheetId):void 0,title:this.title,stacked:this.stacked,aggregated:this.aggregated}}getDefinitionForExcel(){if(this.aggregated)return;const e=this.dataSets.map((e=>fi(this.getters,e))).filter((e=>""!==e.range&&e.range!==le)),t=bi(this.getters,this.labelRange,xi(this.labelRange,this.dataSets[0],this.dataSetsHaveTitle));return{...this.getDefinition(),backgroundColor:Ma(this.background||I),fontColor:Ma(Ei(this.background)),dataSets:e,labelRange:t}}updateRanges(e){const{dataSets:t,labelRange:o,isStale:s}=hi(this.getters,e,this.dataSets,this.labelRange);if(!s)return this;const n=this.getDefinitionWithSpecificDataSets(t,o);return new tl(n,this.sheetId,this.getters)}}function ol(e){return e.dataRange&&!on.test(e.dataRange)?"InvalidGaugeDataRange":"Success"}function sl(e,t){return t((t=>t.sectionRule?e(t.sectionRule.rangeMin,"rangeMin"):"Success"),(t=>t.sectionRule?e(t.sectionRule.rangeMax,"rangeMax"):"Success"))}function nl(e){return e.sectionRule&&Number(e.sectionRule.rangeMin)>=Number(e.sectionRule.rangeMax)?"GaugeRangeMinBiggerThanRangeMax":"Success"}function il(e,t){if(""===e)switch(t){case"rangeMin":return"EmptyGaugeRangeMin";case"rangeMax":return"EmptyGaugeRangeMax"}return"Success"}function rl(e,t){if(isNaN(e))switch(t){case"rangeMin":return"GaugeRangeMinNaN";case"rangeMax":return"GaugeRangeMaxNaN";case"lowerInflectionPointValue":return"GaugeLowerInflectionPointNaN";case"upperInflectionPointValue":return"GaugeUpperInflectionPointNaN"}return"Success"}class al extends ci{dataRange;sectionRule;background;type="gauge";constructor(e,t,o){super(e,t,o),this.dataRange=Un(this.getters,this.sheetId,e.dataRange),this.sectionRule=e.sectionRule,this.background=e.background}static validateChartDefinition(e,t){return e.checkValidations(t,ol,e.chainValidations(sl(il,e.batchValidations),sl(rl,e.batchValidations),nl),e.chainValidations((o=rl,(0,e.batchValidations)((e=>e.sectionRule?o(e.sectionRule.lowerInflectionPoint.value,"lowerInflectionPointValue"):"Success"),(e=>e.sectionRule?o(e.sectionRule.upperInflectionPoint.value,"upperInflectionPointValue"):"Success")))));var o}static transformDefinition(e,t){let o;return e.dataRange&&(o=ri(hn(e.dataRange),t)),{...e,dataRange:o?pn(o):void 0}}static getDefinitionFromContextCreation(e){return{background:e.background,title:e.title||"",type:"gauge",dataRange:e.range?e.range[0]:void 0,sectionRule:{colors:{lowerColor:"#cc0000",middleColor:"#f1c232",upperColor:"#6aa84f"},rangeMin:"0",rangeMax:"100",lowerInflectionPoint:{type:"percentage",value:"15"},upperInflectionPoint:{type:"percentage",value:"40"}}}}copyForSheetId(e){const t=ui(this.sheetId,e,this.dataRange),o=this.getDefinitionWithSpecificRanges(t,e);return new al(o,e,this.getters)}copyInSheetId(e){const t=this.getDefinitionWithSpecificRanges(this.dataRange,e);return new al(t,e,this.getters)}getDefinition(){return this.getDefinitionWithSpecificRanges(this.dataRange)}getDefinitionWithSpecificRanges(e,t){return{background:this.background,sectionRule:this.sectionRule,title:this.title,type:"gauge",dataRange:e?this.getters.getRangeString(e,t||this.sheetId):void 0}}getDefinitionForExcel(){}getContextCreation(){return{background:this.background,title:this.title,range:this.dataRange?[this.getters.getRangeString(this.dataRange,this.sheetId)]:void 0}}updateRanges(e){const t=gi(this.dataRange,e);if(this.dataRange===t)return this;const o=this.getDefinitionWithSpecificRanges(t);return new al(o,this.sheetId,this.getters)}}const ll={second:1e3,minute:6e4,hour:36e5,day:864e5,month:2592e6,year:31536e6},cl={inSeconds:function(e){return Math.floor(e/ll.second)},inMinutes:function(e){return Math.floor(e/ll.minute)},inHours:function(e){return Math.floor(e/ll.hour)},inDays:function(e){return Math.floor(e/ll.day)},inMonths:function(e){return Math.floor(e/ll.month)},inYears:function(e){return Math.floor(e/ll.year)}},hl=/^((d|dd|m|mm|yyyy|yy|hh|h|ss|a)(-|:|\s|\/))*(d|dd|m|mm|yyyy|yy|hh|h|ss|a)$/i;function dl(e,t,o){const s=function(e){const t=e.indexOf("h");e=t>=0?e.slice(0,t).replace(/m/g,"M")+e.slice(t):e.replace(/m/g,"M");e.includes("a")||(e=e.replace(/h/g,"H"));return e}(t),n=function(e,t,o){const s=e.map((e=>jt(e,o)?.jsDate));if(s.some((e=>void 0===e))||e.length<2)return;const n=s.map((e=>e.getTime())),i=ht(n)-dt(n),r=function(e){if(e.includes("s"))return"second";if(e.includes("m"))return"minute";if(e.includes("h")||e.includes("H"))return"hour";if(e.includes("d"))return"day";if(e.includes("M"))return"month";return"year"}(t);if(ll.second>=ll[r]&&cl.inSeconds(i)<180)return"second";if(ll.minute>=ll[r]&&cl.inMinutes(i)<180)return"minute";if(ll.hour>=ll[r]&&cl.inHours(i)<96)return"hour";if(ll.day>=ll[r]&&cl.inDays(i)<90)return"day";if(ll.month>=ll[r]&&cl.inMonths(i)<36)return"month";return"year"}(e,s,o),i={};return n&&(i[n]=s),{parser:s,displayFormats:i,unit:n??!1}}class ul extends ci{dataSets;labelRange;background;verticalAxisPosition;legendPosition;labelsAsText;stacked;aggregated;type="line";dataSetsHaveTitle;cumulative;constructor(e,t,o){super(e,t,o),this.dataSets=pi(this.getters,e.dataSets,t,e.dataSetsHaveTitle),this.labelRange=Un(this.getters,t,e.labelRange),this.background=e.background,this.verticalAxisPosition=e.verticalAxisPosition,this.legendPosition=e.legendPosition,this.labelsAsText=e.labelsAsText,this.stacked=e.stacked,this.aggregated=e.aggregated,this.dataSetsHaveTitle=e.dataSetsHaveTitle,this.cumulative=e.cumulative}static validateChartDefinition(e,t){return e.checkValidations(t,wi,yi)}static transformDefinition(e,t){return vi(e,t)}static getDefinitionFromContextCreation(e){return{background:e.background,dataSets:e.range?e.range:[],dataSetsHaveTitle:!1,labelsAsText:!1,legendPosition:"top",title:e.title||"",type:"line",verticalAxisPosition:"left",labelRange:e.auxiliaryRange||void 0,stacked:!1,aggregated:!1,cumulative:!1}}getDefinition(){return this.getDefinitionWithSpecificDataSets(this.dataSets,this.labelRange)}getDefinitionWithSpecificDataSets(e,t,o){return{type:"line",dataSetsHaveTitle:!!e.length&&Boolean(e[0].labelCell),background:this.background,dataSets:e.map((e=>this.getters.getRangeString(e.dataRange,o||this.sheetId))),legendPosition:this.legendPosition,verticalAxisPosition:this.verticalAxisPosition,labelRange:t?this.getters.getRangeString(t,o||this.sheetId):void 0,title:this.title,labelsAsText:this.labelsAsText,stacked:this.stacked,aggregated:this.aggregated,cumulative:this.cumulative}}getContextCreation(){return{background:this.background,title:this.title,range:this.dataSets.map((e=>this.getters.getRangeString(e.dataRange,this.sheetId))),auxiliaryRange:this.labelRange?this.getters.getRangeString(this.labelRange,this.sheetId):void 0}}updateRanges(e){const{dataSets:t,labelRange:o,isStale:s}=hi(this.getters,e,this.dataSets,this.labelRange);if(!s)return this;const n=this.getDefinitionWithSpecificDataSets(t,o);return new ul(n,this.sheetId,this.getters)}getDefinitionForExcel(){if(this.aggregated)return;const e=this.dataSets.map((e=>fi(this.getters,e))).filter((e=>""!==e.range&&e.range!==le)),t=bi(this.getters,this.labelRange,xi(this.labelRange,this.dataSets[0],this.dataSetsHaveTitle));return{...this.getDefinition(),backgroundColor:Ma(this.background||I),fontColor:Ma(Ei(this.background)),dataSets:e,labelRange:t}}copyForSheetId(e){const t=di(this.sheetId,e,this.dataSets),o=ui(this.sheetId,e,this.labelRange),s=this.getDefinitionWithSpecificDataSets(t,o,e);return new ul(s,e,this.getters)}copyInSheetId(e){const t=this.getDefinitionWithSpecificDataSets(this.dataSets,this.labelRange,e);return new ul(t,e,this.getters)}}function gl(e,t){return ml(e,t)||fl(e,t)}function pl(e,t){return function(e,t){return!e.labelsAsText&&ml(e.labelRange,t)}(e,t)&&function(){if(!window.Chart)return!1;const e="luxon"===new window.Chart._adapters._date({})._id;e||bl||(bl=!0,console.warn("'chartjs-adapter-luxon' time adapter is not installed. Time scale axes are disabled."));return e}()?"time":function(e,t){return!e.labelsAsText&&fl(e.labelRange,t)}(e,t)?"linear":"category"}function ml(e,t){if(!e||!fl(e,t))return!1;const o=t.getEvaluatedCell({sheetId:e.sheetId,col:e.zone.left,row:e.zone.top}).format;return Boolean(o&&hl.test(o))}function fl(e,t){if(!e)return!1;const o=t.getRangeValues(e);return!o.some((e=>isNaN(Number(e))&&e))&&!o.every((e=>!e))}let bl=!1;class vl extends ci{dataSets;labelRange;background;legendPosition;type="pie";aggregated;dataSetsHaveTitle;constructor(e,t,o){super(e,t,o),this.dataSets=pi(o,e.dataSets,t,e.dataSetsHaveTitle),this.labelRange=Un(o,t,e.labelRange),this.background=e.background,this.legendPosition=e.legendPosition,this.aggregated=e.aggregated,this.dataSetsHaveTitle=e.dataSetsHaveTitle}static transformDefinition(e,t){return vi(e,t)}static validateChartDefinition(e,t){return e.checkValidations(t,wi,yi)}static getDefinitionFromContextCreation(e){return{background:e.background,dataSets:e.range?e.range:[],dataSetsHaveTitle:!1,legendPosition:"top",title:e.title||"",type:"pie",labelRange:e.auxiliaryRange||void 0,aggregated:!1}}getDefinition(){return this.getDefinitionWithSpecificDataSets(this.dataSets,this.labelRange)}getContextCreation(){return{background:this.background,title:this.title,range:this.dataSets.map((e=>this.getters.getRangeString(e.dataRange,this.sheetId))),auxiliaryRange:this.labelRange?this.getters.getRangeString(this.labelRange,this.sheetId):void 0}}getDefinitionWithSpecificDataSets(e,t,o){return{type:"pie",dataSetsHaveTitle:!!e.length&&Boolean(e[0].labelCell),background:this.background,dataSets:e.map((e=>this.getters.getRangeString(e.dataRange,o||this.sheetId))),legendPosition:this.legendPosition,labelRange:t?this.getters.getRangeString(t,o||this.sheetId):void 0,title:this.title,aggregated:this.aggregated}}copyForSheetId(e){const t=di(this.sheetId,e,this.dataSets),o=ui(this.sheetId,e,this.labelRange),s=this.getDefinitionWithSpecificDataSets(t,o,e);return new vl(s,e,this.getters)}copyInSheetId(e){const t=this.getDefinitionWithSpecificDataSets(this.dataSets,this.labelRange,e);return new vl(t,e,this.getters)}getDefinitionForExcel(){if(this.aggregated)return;const e=this.dataSets.map((e=>fi(this.getters,e))).filter((e=>""!==e.range&&e.range!==le)),t=bi(this.getters,this.labelRange,xi(this.labelRange,this.dataSets[0],this.dataSetsHaveTitle));return{...this.getDefinition(),backgroundColor:Ma(this.background||I),fontColor:Ma(Ei(this.background)),verticalAxisPosition:"left",dataSets:e,labelRange:t}}updateRanges(e){const{dataSets:t,labelRange:o,isStale:s}=hi(this.getters,e,this.dataSets,this.labelRange);if(!s)return this;const n=this.getDefinitionWithSpecificDataSets(t,o);return new vl(n,this.sheetId,this.getters)}}function Sl(e,t){const o=[],s=ht(t.map((e=>e.data.length)));for(let t=0;t<=s;t++)o.push(e.next());return o}const Cl=new Hi;Cl.add("bar",{match:e=>"bar"===e,createChart:(e,t,o)=>new tl(e,t,o),getChartRuntime:function(e,t){let o=ja(t,e.dataSets,e.labelRange).formattedValues,s=Ka(t,e.dataSets);e.dataSetsHaveTitle&&s[0]&&o.length>s[0].data.length&&o.shift(),({labels:o,dataSetsValues:s}=Wa(o,s)),e.aggregated&&({labels:o,dataSetsValues:s}=qa(o,s));const n=function(e,t,o){const s=Ei(e.background),n=Ya(e,t,s,o),i={labels:{color:s}};return!e.labelRange&&1===e.dataSets.length||"none"===e.legendPosition?i.display=!1:i.position=e.legendPosition,n.options.plugins.legend={...n.options.plugins?.legend,...i},n.options.layout={padding:{left:20,right:20,top:e.title?10:25,bottom:10}},n.options.scales={x:{ticks:{padding:5,color:s}},y:{position:e.verticalAxisPosition,beginAtZero:!0,ticks:{color:s,callback:e=>{if(e=Number(e),isNaN(e))return e;const{locale:t,format:s}=o;return Is(e,{locale:t,format:!s&&Math.abs(e)>=1e3?"#,##":s})}}}},e.stacked&&(n.options.scales.x.stacked=!0,n.options.scales.y.stacked=!0),n}(e,o,{format:Xa(t,e.dataSets),locale:t.getLocale()}),i=new Ci;for(let{label:e,data:t}of s){const o=i.next(),s={label:e,data:t,borderColor:o,backgroundColor:o};n.data.datasets.push(s)}return{chartJsConfig:n,background:e.background||I}},validateChartDefinition:(e,t)=>tl.validateChartDefinition(e,t),transformDefinition:(e,t)=>tl.transformDefinition(e,t),getChartDefinitionFromContextCreation:e=>tl.getDefinitionFromContextCreation(e),name:a("Bar"),sequence:10}),Cl.add("line",{match:e=>"line"===e,createChart:(e,t,o)=>new ul(e,t,o),getChartRuntime:function(e,t){const o=pl(e,t),s=ja(t,e.dataSets,e.labelRange);let n="linear"===o?s.values:s.formattedValues,i=Ka(t,e.dataSets);e.dataSetsHaveTitle&&i[0]&&n.length>i[0].data.length&&n.shift(),({labels:n,dataSetsValues:i}=Wa(n,i)),"time"===o&&({labels:n,dataSetsValues:i}=function(e,t){if(0===e.length||e.every((e=>!e)))return{labels:e,dataSetsValues:t};const o=[...e],s=Te(t);for(let e=0;e<o.length;e++)if(!o[e]){o[e]=Xe(o,e);for(let t of s)t.data[e]=void 0}return{labels:o,dataSetsValues:s}}(n,i)),e.aggregated&&({labels:n,dataSetsValues:i}=qa(n,i));const r=t.getLocale(),a="category"===o,l=Xa(t,e.dataSets),c=function(e,t,o){const s=Ei(e.background),n=Ya(e,t,s,o),i={labels:{color:s,generateLabels(e){const{data:t}=e,o=window.Chart.defaults.plugins.legend.labels.generateLabels(e);for(const[e,s]of o.entries())s.fillStyle=t.datasets[e].borderColor;return o}}};return!e.labelRange&&1===e.dataSets.length||"none"===e.legendPosition?i.display=!1:i.position=e.legendPosition,Object.assign(n.options.plugins.legend||{},i),n.options.layout={padding:{left:20,right:20,top:e.title?10:25,bottom:10}},n.options.scales={x:{ticks:{padding:5,color:s}},y:{position:e.verticalAxisPosition,beginAtZero:!0,ticks:{color:s,callback:e=>{if(e=Number(e),isNaN(e))return e;const{locale:t,format:s}=o;return Is(e,{locale:t,format:!s&&Math.abs(e)>=1e3?"#,##":s})}}}},e.stacked&&n.options?.scales?.y&&(n.options.scales.y.stacked=!0),n}(e,n,{format:l,locale:r,truncateLabels:a}),h=function(e,t){if(t)return e.getEvaluatedCell({sheetId:t.sheetId,col:t.zone.left,row:t.zone.top}).format}(t,e.labelRange);if("time"===o){const e={type:"time",time:dl(n,h,r)};Object.assign(c.options.scales.x,e),c.options.scales.x.ticks.maxTicksLimit=15}else"linear"===o&&(c.options.scales.x.type="linear",c.options.scales.x.ticks.callback=e=>Is(e,{format:h,locale:r}),c.options.plugins.tooltip.callbacks.title=e=>Is(e[0].parsed.x||e[0].label,{locale:r,format:h}));const d=new Ci;for(let[t,{label:s,data:r}]of i.entries()){if(e.cumulative){let e=0;r=r.map((t=>isNaN(t)?t:(e+=parseFloat(t),e)))}["linear","time"].includes(o)&&(r=r.map(((e,t)=>({x:n[t]||void 0,y:e}))));const i=d.next();let a=wt(i);e.stacked&&(a.a=.4);const l={label:s,data:r,tension:0,borderColor:i,backgroundColor:Et(a),pointBackgroundColor:i,fill:!!e.stacked&&Qa(t)};c.data.datasets.push(l)}return{chartJsConfig:c,background:e.background||I}},validateChartDefinition:(e,t)=>ul.validateChartDefinition(e,t),transformDefinition:(e,t)=>ul.transformDefinition(e,t),getChartDefinitionFromContextCreation:e=>ul.getDefinitionFromContextCreation(e),name:a("Line"),sequence:20}),Cl.add("pie",{match:e=>"pie"===e,createChart:(e,t,o)=>new vl(e,t,o),getChartRuntime:function(e,t){let o=ja(t,e.dataSets,e.labelRange).formattedValues,s=Ka(t,e.dataSets);e.dataSetsHaveTitle&&s[0]&&o.length>s[0].data.length&&o.shift(),({labels:o,dataSetsValues:s}=Wa(o,s)),e.aggregated&&({labels:o,dataSetsValues:s}=qa(o,s));const n=function(e,t,o){const s=Ei(e.background),n=Ya(e,t,s,o),i={labels:{color:s}};return!e.labelRange&&1===e.dataSets.length||"none"===e.legendPosition?i.display=!1:i.position=e.legendPosition,Object.assign(n.options.plugins.legend||{},i),n.options.layout={padding:{left:20,right:20,top:e.title?10:25,bottom:10}},n.options.plugins.tooltip.callbacks.title=function(e){return e[0].dataset.label},n.options.plugins.tooltip.callbacks.label=function(e){const{format:t,locale:s}=o,n=function(e,t){const o=e.filter((e=>"number"==typeof e)).reduce(((e,t)=>e+t),0);if(!o)return"";return(e[t]/o*100).toFixed(2)}(e.dataset.data,e.dataIndex),i=e.label||e.dataset.label,r=e.parsed.y??e.parsed,a=Is(r,{format:!t&&Math.abs(r)>=1e3?"#,##":t,locale:s});return i?`${i}: ${a} (${n}%)`:`${a} (${n}%)`},n}(e,o,{format:Xa(t,e.dataSets),locale:t.getLocale()}),i=new Ci;for(let{label:e,data:t}of s){const o={label:e,data:t,borderColor:"#FFFFFF",backgroundColor:Sl(i,s)};n.data.datasets.push(o)}return{chartJsConfig:n,background:e.background||I}},validateChartDefinition:(e,t)=>vl.validateChartDefinition(e,t),transformDefinition:(e,t)=>vl.transformDefinition(e,t),getChartDefinitionFromContextCreation:e=>vl.getDefinitionFromContextCreation(e),name:a("Pie"),sequence:30}),Cl.add("scorecard",{match:e=>"scorecard"===e,createChart:(e,t,o)=>new Ni(e,t,o),getChartRuntime:function(e,t){let o,s,n="",i="";if(e.keyValue){const s={sheetId:e.keyValue.sheetId,col:e.keyValue.zone.left,row:e.keyValue.zone.top};o=t.getEvaluatedCell(s),n=String(o.value),i=o.formattedValue}const r=e.baseline;if(r){const o={sheetId:e.baseline.sheetId,col:e.baseline.zone.left,row:e.baseline.zone.top};s=t.getEvaluatedCell(o)}const{background:l,fontColor:c}=t.getStyleOfSingleCellChart(e.background,e.keyValue),h=t.getLocale();return{title:a(e.title),keyValue:i||n,baselineDisplay:Ii(s,o,e.baselineMode,h),baselineArrow:Ti(s,o,e.baselineMode),baselineColor:Ri(s,e.baselineMode,o,e.baselineColorUp,e.baselineColorDown),baselineDescr:e.baselineDescr?a(e.baselineDescr):"",fontColor:c,background:l,baselineStyle:"percentage"!==e.baselineMode&&r?t.getCellStyle({sheetId:r.sheetId,col:r.zone.left,row:r.zone.top}):void 0,keyValueStyle:e.keyValue?t.getCellStyle({sheetId:e.keyValue.sheetId,col:e.keyValue.zone.left,row:e.keyValue.zone.top}):void 0}},validateChartDefinition:(e,t)=>Ni.validateChartDefinition(e,t),transformDefinition:(e,t)=>Ni.transformDefinition(e,t),getChartDefinitionFromContextCreation:e=>Ni.getDefinitionFromContextCreation(e),name:a("Scorecard"),sequence:40}),Cl.add("gauge",{match:e=>"gauge"===e,createChart:(e,t,o)=>new al(e,t,o),getChartRuntime:function(e,t){const o=function(e,t){const o=Ya(e,[],Ei(e.background),{locale:t});return o.options.hover=void 0,o.options.events=[],o.options.layout={padding:{left:30,right:30,top:e.title?10:25,bottom:25}},o.options.needle={width:10,borderColor:"#000000",backgroundColor:"#000000"},o.options.valueLabel={display:!1,font:{size:30,color:"#FFFFFF"},backgroundColor:"#000000",borderColor:"#000000",borderRadius:5,padding:{top:5,right:5,bottom:5,left:5}},o}(e,t.getLocale()),s=e.sectionRule.colors,n=e.sectionRule.lowerInflectionPoint,i=e.sectionRule.upperInflectionPoint,r=Number(n.value),a=Number(i.value),l=Number(e.sectionRule.rangeMin),c=Number(e.sectionRule.rangeMax),h=c-l,d=[];if(""!==n.value){const e="number"===n.type?r:l+h*r/100;d.push({value:_e(e,l,c),color:s.lowerColor})}if(""!==i.value){const e="number"===i.type?a:l+h*a/100;d.push({value:_e(e,l,c),color:s.middleColor})}const u=[],g=[];d.sort(((e,t)=>e.value-t.value)).map((e=>{u.push(e.value),g.push(e.color)})),u.push(c),g.push(s.upperColor);const p=e.dataRange,m=h/30;let f,b=l-m,v=!1;if(void 0!==p){const e=t.getEvaluatedCell({sheetId:p.sheetId,col:p.zone.left,row:p.zone.top});e.type===mo.number&&(b=_e(e.value,l-m,c+m),f=()=>t.getRangeFormattedValues(p)[0],v=!0)}return o.options.valueLabel.display=v,o.options.valueLabel.formatter=f,o.data.datasets.push({data:u,minValue:Number(e.sectionRule.rangeMin),value:b,backgroundColor:g}),{chartJsConfig:o,background:t.getStyleOfSingleCellChart(e.background,p).background}},validateChartDefinition:(e,t)=>al.validateChartDefinition(e,t),transformDefinition:(e,t)=>al.transformDefinition(e,t),getChartDefinitionFromContextCreation:e=>al.getDefinitionFromContextCreation(e),name:a("Gauge"),sequence:50});const El=new Hi;El.add("line",li),El.add("bar",li),El.add("pie",li),El.add("gauge",li),El.add("scorecard",Bi);const wl=new Hi;gr`
283
+ `;class Aa extends t.Component{static template="o-spreadsheet-LinkEditor";static components={Menu:Hr};menuItems=Ta.getMenuItems();link=t.useState(this.defaultState);menu=t.useState({isOpen:!1});linkEditorRef=t.useRef("linkEditor");position=Fr(this.linkEditorRef);urlInput=t.useRef("urlInput");setup(){t.onMounted((()=>this.urlInput.el?.focus()))}get defaultState(){const{col:e,row:t}=this.props.cellPosition,o=this.env.model.getters.getActiveSheetId(),s=this.env.model.getters.getEvaluatedCell({sheetId:o,col:e,row:t});return s.link?{url:s.link.url,label:s.formattedValue,isUrlEditable:s.link.isUrlEditable}:{label:s.formattedValue,url:"",isUrlEditable:!0}}get menuPosition(){return{x:this.position.x+320-12-2,y:this.position.y+100}}onSpecialLink(e){const{detail:t}=e,o=ji(t);o&&(this.link.url=o.url,this.link.label=o.label,this.link.isUrlEditable=o.isUrlEditable)}getUrlRepresentation(e){return Zi(e,this.env.model.getters)}openMenu(){this.menu.isOpen=!0}removeLink(){this.link.url="",this.link.isUrlEditable=!0}save(){const{col:e,row:t}=this.props.cellPosition,o=this.env.model.getters.getLocale(),s=this.link.label?aa(this.link.label,o):this.link.url;this.env.model.dispatch("UPDATE_CELL",{col:e,row:t,sheetId:this.env.model.getters.getActiveSheetId(),content:Ve(s,this.link.url)}),this.props.onClosed?.()}cancel(){this.props.onClosed?.()}onKeyDown(e){switch(e.key){case"Enter":this.link.url&&this.save(),e.stopPropagation(),e.preventDefault();break;case"Escape":this.cancel(),e.stopPropagation()}}}const Oa={onOpen:(e,t)=>({isOpen:!0,props:{cellPosition:e},Component:Aa,cellCorner:"BottomLeft"})};Aa.props={cellPosition:Object,onClosed:{type:Function,optional:!0}};const _a=new Hi;function Ma(e){return 8===(e=ft(e).replace("#","")).length?e.slice(6)+e.slice(0,6):e}_a.add("ErrorToolTip",vr).add("LinkCell",Gr).add("LinkEditor",Oa).add("FilterMenu",wr);const Na={wrongPasteSelection:a("This operation is not allowed with multiple selections."),willRemoveExistingMerge:a("This operation is not possible due to a merge. Please remove the merges first than try again."),wrongFigurePasteOption:a("Cannot do a special paste of a figure."),frozenPaneOverlap:a("This operation is not allowed due to an overlapping frozen pane.")};function Fa(e,t){t.isSuccessful||(t.reasons.includes("WrongPasteSelection")?e.raiseError(Na.wrongPasteSelection):t.reasons.includes("WillRemoveExistingMerge")?e.raiseError(Na.willRemoveExistingMerge):t.reasons.includes("WrongFigurePasteOption")?e.raiseError(Na.wrongFigurePasteOption):t.reasons.includes("FrozenPaneOverlap")&&e.raiseError(Na.frozenPaneOverlap))}function Da(e,t,o){const s=e.model.dispatch("PASTE",{target:t,pasteOption:o});Fa(e,s)}function La(e,t,o,s){const n=e.model.dispatch("PASTE_FROM_OS_CLIPBOARD",{target:t,text:o,pasteOption:s});Fa(e,n)}const Pa={Errors:{InvalidRange:a("The range is invalid"),FirstArgMissing:a("The argument is missing. Please provide a value"),SecondArgMissing:a("The second argument is missing. Please provide a value"),MinNaN:a("The minpoint must be a number"),MidNaN:a("The midpoint must be a number"),MaxNaN:a("The maxpoint must be a number"),ValueUpperInflectionNaN:a("The first value must be a number"),ValueLowerInflectionNaN:a("The second value must be a number"),MinBiggerThanMax:a("Minimum must be smaller then Maximum"),MinBiggerThanMid:a("Minimum must be smaller then Midpoint"),MidBiggerThanMax:a("Midpoint must be smaller then Maximum"),LowerBiggerThanUpper:a("Lower inflection point must be smaller than upper inflection point"),MinInvalidFormula:a("Invalid Minpoint formula"),MaxInvalidFormula:a("Invalid Maxpoint formula"),MidInvalidFormula:a("Invalid Midpoint formula"),ValueUpperInvalidFormula:a("Invalid upper inflection point formula"),ValueLowerInvalidFormula:a("Invalid lower inflection point formula"),EmptyRange:a("A range needs to be defined"),Unexpected:a("The rule is invalid for an unknown reason")},ColorScale:a("Color scale"),IconSet:a("Icon set")},ka={IsEmpty:a("Is empty"),IsNotEmpty:a("Is not empty"),ContainsText:a("Contains"),NotContains:a("Does not contain"),BeginsWith:a("Starts with"),EndsWith:a("Ends with"),Equal:a("Is equal to"),NotEqual:a("Is not equal to"),GreaterThan:a("Is greater than"),GreaterThanOrEqual:a("Is greater than or equal to"),LessThan:a("Is less than"),LessThanOrEqual:a("Is less than or equal to"),Between:a("Is between"),NotBetween:a("Is not between")},Va={Series:a("Series"),Errors:{Unexpected:a("The chart definition is invalid for an unknown reason"),InvalidDataSet:a("The dataset is invalid"),InvalidLabelRange:a("Labels are invalid"),InvalidScorecardKeyValue:a("The key value is invalid"),InvalidScorecardBaseline:a("The baseline value is invalid"),InvalidGaugeDataRange:a("The data range is invalid"),EmptyGaugeRangeMin:a("A minimum range limit value is needed"),GaugeRangeMinNaN:a("The minimum range limit value must be a number"),EmptyGaugeRangeMax:a("A maximum range limit value is needed"),GaugeRangeMaxNaN:a("The maximum range limit value must be a number"),GaugeRangeMinBiggerThanRangeMax:a("Minimum range limit must be smaller than maximum range limit"),GaugeLowerInflectionPointNaN:a("The lower inflection point value must be a number"),GaugeUpperInflectionPointNaN:a("The upper inflection point value must be a number")}},Ua={Custom:a("Custom")},Ba=a("Merged cells are preventing this operation. Unmerge those cells and try again."),Ha={Errors:{Unexpected:a("Cannot split the selection for an unknown reason"),NoSplitSeparatorInSelection:a("There is no match for the selected separator in the selection"),MoreThanOneColumnSelected:a("Only a selection from a single column can be split"),SplitWillOverwriteContent:a("Splitting will overwrite existing content")}},za={Errors:{Unexpected:a("Cannot remove duplicates for an unknown reason"),MoreThanOneRangeSelected:a("Please select only one range of cells"),EmptyTarget:a("Please select a range of cells containing values."),NoColumnsProvided:a("Please select at latest one column to analyze."),WillRemoveExistingMerge:Na.willRemoveExistingMerge}},Ga={DateIs:{today:a("today"),yesterday:a("yesterday"),tomorrow:a("tomorrow"),lastWeek:a("in the past week"),lastMonth:a("in the past month"),lastYear:a("in the past year")},DateIsBefore:{today:a("today"),yesterday:a("yesterday"),tomorrow:a("tomorrow"),lastWeek:a("one week ago"),lastMonth:a("one month ago"),lastYear:a("one year ago")},CriterionError:{notEmptyValue:a("The value must not be empty"),numberValue:a("The value must be a number"),dateValue:a("The value must be a date"),validRange:a("The value must be a valid range")}};function $a(e,t){if(t.dataRange){const o=t.labelCell?[pn(t.labelCell.zone)]:[],s=In([pn(t.dataRange.zone)],o)[0];if(void 0===s)return[];const n=e.getRangeFromSheetXC(t.dataRange.sheetId,s);return e.getRangeValues(n).map((e=>""===e?void 0:e))}return[]}function Wa(e,t){const o=Me(0,Math.max(e.length,...t.map((e=>e.data?.length||0)))).filter((o=>{const s=e[o],n=t.map((e=>e.data?.[o]));return s||n.some((e=>0===e||Boolean(e)))}));return{labels:o.map((t=>e[t]||"")),dataSetsValues:t.map((e=>({...e,data:o.map((t=>e.data[t]))})))}}function qa(e,t){const o=new Set(e),s={};o.forEach((e=>{s[e]=new Array(t.length).fill(0)}));for(const o of Me(0,e.length)){const i=e[o];for(const e of Me(0,t.length))s[i][e]+="number"==typeof(n=t[e].data[o])?n:0}var n;return{labels:Array.from(o),dataSetsValues:t.map(((e,t)=>({...e,data:Array.from(o).map((e=>s[e][t]))})))}}function Za(e){return e?e.length>de?e.substring(0,de)+"…":e:""}function Ya(e,t,o,{format:s,locale:n,truncateLabels:i=!0}){const r={responsive:!0,maintainAspectRatio:!1,layout:{padding:{left:20,right:20,top:e.title?10:25,bottom:10}},elements:{line:{fill:!1},point:{hitRadius:15}},animation:!1,plugins:{title:{display:!!e.title,text:a(e.title),color:o,font:{size:22,weight:"normal"}},legend:{onClick:()=>{}},tooltip:{callbacks:{label:function(e){const t=e.dataset?.label||e.label,o=e.parsed.y??e.parsed,i=Is(o,{format:!s&&Math.abs(o)>=1e3?"#,##":s,locale:n});return t?`${t}: ${i}`:i}}}}};return{type:e.type,options:r,data:{labels:i?t.map(Za):t,datasets:[]},plugins:[]}}function ja(e,t,o){let s={values:[],formattedValues:[]};if(o)o.invalidXc||o.invalidSheetName||(s={formattedValues:e.getRangeFormattedValues(o),values:e.getRangeValues(o).map((e=>String(e)))});else if(1===t.length)for(let o=0;o<$a(e,t[0]).length;o++)s.formattedValues.push(""),s.values.push("");else if(t[0]){s={formattedValues:Me(0,$a(e,t[0]).length).map((e=>e.toString())),values:s.formattedValues}}return s}function Xa(e,t){for(const o of t){const t=e.getRangeFormats(o.dataRange).find((e=>void 0!==e&&!Ns(e)));if(t)return t}}function Ka(e,t){const o=[];for(const[s,n]of Object.entries(t)){let t;if(n.labelCell){const o=n.labelCell,i=o?e.getEvaluatedCell({sheetId:o.sheetId,col:o.zone.left,row:o.zone.top}):void 0;t=i&&o?Za(i.formattedValue):t=`${Va.Series} ${parseInt(s)+1}`}else t=t=`${Va.Series} ${parseInt(s)+1}`;let i=n.dataRange?$a(e,n):[];o.push({data:i,label:t})}return o}function Qa(e){return 0===e?"origin":e-1}function Ja(e,t,o){const s=document.createElement("div");s.style.width=`${t.width}px`,s.style.height=`${t.height}px`;const n=document.createElement("canvas");if(s.append(n),n.setAttribute("width",t.width.toString()),n.setAttribute("height",t.height.toString()),document.body.append(s),"chartJsConfig"in e){e.chartJsConfig.plugins=[el];const t=new window.Chart(n,Te(e.chartJsConfig)),o=t.toBase64Image();return t.destroy(),s.remove(),o}if("scorecard"===o){Fi(Li(t,e),n);const o=n.toDataURL();return s.remove(),o}return""}const el={id:"customCanvasBackgroundColor",beforeDraw:e=>{const{ctx:t}=e;t.save(),t.globalCompositeOperation="destination-over",t.fillStyle="#ffffff",t.fillRect(0,0,e.width,e.height),t.restore()}};class tl extends ci{dataSets;labelRange;background;verticalAxisPosition;legendPosition;stacked;aggregated;type="bar";dataSetsHaveTitle;constructor(e,t,o){super(e,t,o),this.dataSets=pi(o,e.dataSets,t,e.dataSetsHaveTitle),this.labelRange=Un(o,t,e.labelRange),this.background=e.background,this.verticalAxisPosition=e.verticalAxisPosition,this.legendPosition=e.legendPosition,this.stacked=e.stacked,this.aggregated=e.aggregated,this.dataSetsHaveTitle=e.dataSetsHaveTitle}static transformDefinition(e,t){return vi(e,t)}static validateChartDefinition(e,t){return e.checkValidations(t,wi,yi)}static getDefinitionFromContextCreation(e){return{background:e.background,dataSets:e.range?e.range:[],dataSetsHaveTitle:!1,stacked:!1,aggregated:!1,legendPosition:"top",title:e.title||"",type:"bar",verticalAxisPosition:"left",labelRange:e.auxiliaryRange||void 0}}getContextCreation(){return{background:this.background,title:this.title,range:this.dataSets.map((e=>this.getters.getRangeString(e.dataRange,this.sheetId))),auxiliaryRange:this.labelRange?this.getters.getRangeString(this.labelRange,this.sheetId):void 0}}copyForSheetId(e){const t=di(this.sheetId,e,this.dataSets),o=ui(this.sheetId,e,this.labelRange),s=this.getDefinitionWithSpecificDataSets(t,o,e);return new tl(s,e,this.getters)}copyInSheetId(e){const t=this.getDefinitionWithSpecificDataSets(this.dataSets,this.labelRange,e);return new tl(t,e,this.getters)}getDefinition(){return this.getDefinitionWithSpecificDataSets(this.dataSets,this.labelRange)}getDefinitionWithSpecificDataSets(e,t,o){return{type:"bar",dataSetsHaveTitle:!!e.length&&Boolean(e[0].labelCell),background:this.background,dataSets:e.map((e=>this.getters.getRangeString(e.dataRange,o||this.sheetId))),legendPosition:this.legendPosition,verticalAxisPosition:this.verticalAxisPosition,labelRange:t?this.getters.getRangeString(t,o||this.sheetId):void 0,title:this.title,stacked:this.stacked,aggregated:this.aggregated}}getDefinitionForExcel(){if(this.aggregated)return;const e=this.dataSets.map((e=>fi(this.getters,e))).filter((e=>""!==e.range&&e.range!==le)),t=bi(this.getters,this.labelRange,xi(this.labelRange,this.dataSets[0],this.dataSetsHaveTitle));return{...this.getDefinition(),backgroundColor:Ma(this.background||I),fontColor:Ma(Ei(this.background)),dataSets:e,labelRange:t}}updateRanges(e){const{dataSets:t,labelRange:o,isStale:s}=hi(this.getters,e,this.dataSets,this.labelRange);if(!s)return this;const n=this.getDefinitionWithSpecificDataSets(t,o);return new tl(n,this.sheetId,this.getters)}}function ol(e){return e.dataRange&&!on.test(e.dataRange)?"InvalidGaugeDataRange":"Success"}function sl(e,t){return t((t=>t.sectionRule?e(t.sectionRule.rangeMin,"rangeMin"):"Success"),(t=>t.sectionRule?e(t.sectionRule.rangeMax,"rangeMax"):"Success"))}function nl(e){return e.sectionRule&&Number(e.sectionRule.rangeMin)>=Number(e.sectionRule.rangeMax)?"GaugeRangeMinBiggerThanRangeMax":"Success"}function il(e,t){if(""===e)switch(t){case"rangeMin":return"EmptyGaugeRangeMin";case"rangeMax":return"EmptyGaugeRangeMax"}return"Success"}function rl(e,t){if(isNaN(e))switch(t){case"rangeMin":return"GaugeRangeMinNaN";case"rangeMax":return"GaugeRangeMaxNaN";case"lowerInflectionPointValue":return"GaugeLowerInflectionPointNaN";case"upperInflectionPointValue":return"GaugeUpperInflectionPointNaN"}return"Success"}class al extends ci{dataRange;sectionRule;background;type="gauge";constructor(e,t,o){super(e,t,o),this.dataRange=Un(this.getters,this.sheetId,e.dataRange),this.sectionRule=e.sectionRule,this.background=e.background}static validateChartDefinition(e,t){return e.checkValidations(t,ol,e.chainValidations(sl(il,e.batchValidations),sl(rl,e.batchValidations),nl),e.chainValidations((o=rl,(0,e.batchValidations)((e=>e.sectionRule?o(e.sectionRule.lowerInflectionPoint.value,"lowerInflectionPointValue"):"Success"),(e=>e.sectionRule?o(e.sectionRule.upperInflectionPoint.value,"upperInflectionPointValue"):"Success")))));var o}static transformDefinition(e,t){let o;return e.dataRange&&(o=ri(hn(e.dataRange),t)),{...e,dataRange:o?pn(o):void 0}}static getDefinitionFromContextCreation(e){return{background:e.background,title:e.title||"",type:"gauge",dataRange:e.range?e.range[0]:void 0,sectionRule:{colors:{lowerColor:"#cc0000",middleColor:"#f1c232",upperColor:"#6aa84f"},rangeMin:"0",rangeMax:"100",lowerInflectionPoint:{type:"percentage",value:"15"},upperInflectionPoint:{type:"percentage",value:"40"}}}}copyForSheetId(e){const t=ui(this.sheetId,e,this.dataRange),o=this.getDefinitionWithSpecificRanges(t,e);return new al(o,e,this.getters)}copyInSheetId(e){const t=this.getDefinitionWithSpecificRanges(this.dataRange,e);return new al(t,e,this.getters)}getDefinition(){return this.getDefinitionWithSpecificRanges(this.dataRange)}getDefinitionWithSpecificRanges(e,t){return{background:this.background,sectionRule:this.sectionRule,title:this.title,type:"gauge",dataRange:e?this.getters.getRangeString(e,t||this.sheetId):void 0}}getDefinitionForExcel(){}getContextCreation(){return{background:this.background,title:this.title,range:this.dataRange?[this.getters.getRangeString(this.dataRange,this.sheetId)]:void 0}}updateRanges(e){const t=gi(this.dataRange,e);if(this.dataRange===t)return this;const o=this.getDefinitionWithSpecificRanges(t);return new al(o,this.sheetId,this.getters)}}const ll={second:1e3,minute:6e4,hour:36e5,day:864e5,month:2592e6,year:31536e6},cl={inSeconds:function(e){return Math.floor(e/ll.second)},inMinutes:function(e){return Math.floor(e/ll.minute)},inHours:function(e){return Math.floor(e/ll.hour)},inDays:function(e){return Math.floor(e/ll.day)},inMonths:function(e){return Math.floor(e/ll.month)},inYears:function(e){return Math.floor(e/ll.year)}},hl=/^((d|dd|m|mm|yyyy|yy|hh|h|ss|a)(-|:|\s|\/))*(d|dd|m|mm|yyyy|yy|hh|h|ss|a)$/i;function dl(e,t,o){const s=function(e){const t=e.indexOf("h");e=t>=0?e.slice(0,t).replace(/m/g,"M")+e.slice(t):e.replace(/m/g,"M");e.includes("a")||(e=e.replace(/h/g,"H"));return e}(t),n=function(e,t,o){const s=e.map((e=>jt(e,o)?.jsDate));if(s.some((e=>void 0===e))||e.length<2)return;const n=s.map((e=>e.getTime())),i=ht(n)-dt(n),r=function(e){if(e.includes("s"))return"second";if(e.includes("m"))return"minute";if(e.includes("h")||e.includes("H"))return"hour";if(e.includes("d"))return"day";if(e.includes("M"))return"month";return"year"}(t);if(ll.second>=ll[r]&&cl.inSeconds(i)<180)return"second";if(ll.minute>=ll[r]&&cl.inMinutes(i)<180)return"minute";if(ll.hour>=ll[r]&&cl.inHours(i)<96)return"hour";if(ll.day>=ll[r]&&cl.inDays(i)<90)return"day";if(ll.month>=ll[r]&&cl.inMonths(i)<36)return"month";return"year"}(e,s,o),i={};return n&&(i[n]=s),{parser:s,displayFormats:i,unit:n??!1}}class ul extends ci{dataSets;labelRange;background;verticalAxisPosition;legendPosition;labelsAsText;stacked;aggregated;type="line";dataSetsHaveTitle;cumulative;constructor(e,t,o){super(e,t,o),this.dataSets=pi(this.getters,e.dataSets,t,e.dataSetsHaveTitle),this.labelRange=Un(this.getters,t,e.labelRange),this.background=e.background,this.verticalAxisPosition=e.verticalAxisPosition,this.legendPosition=e.legendPosition,this.labelsAsText=e.labelsAsText,this.stacked=e.stacked,this.aggregated=e.aggregated,this.dataSetsHaveTitle=e.dataSetsHaveTitle,this.cumulative=e.cumulative}static validateChartDefinition(e,t){return e.checkValidations(t,wi,yi)}static transformDefinition(e,t){return vi(e,t)}static getDefinitionFromContextCreation(e){return{background:e.background,dataSets:e.range?e.range:[],dataSetsHaveTitle:!1,labelsAsText:!1,legendPosition:"top",title:e.title||"",type:"line",verticalAxisPosition:"left",labelRange:e.auxiliaryRange||void 0,stacked:!1,aggregated:!1,cumulative:!1}}getDefinition(){return this.getDefinitionWithSpecificDataSets(this.dataSets,this.labelRange)}getDefinitionWithSpecificDataSets(e,t,o){return{type:"line",dataSetsHaveTitle:!!e.length&&Boolean(e[0].labelCell),background:this.background,dataSets:e.map((e=>this.getters.getRangeString(e.dataRange,o||this.sheetId))),legendPosition:this.legendPosition,verticalAxisPosition:this.verticalAxisPosition,labelRange:t?this.getters.getRangeString(t,o||this.sheetId):void 0,title:this.title,labelsAsText:this.labelsAsText,stacked:this.stacked,aggregated:this.aggregated,cumulative:this.cumulative}}getContextCreation(){return{background:this.background,title:this.title,range:this.dataSets.map((e=>this.getters.getRangeString(e.dataRange,this.sheetId))),auxiliaryRange:this.labelRange?this.getters.getRangeString(this.labelRange,this.sheetId):void 0}}updateRanges(e){const{dataSets:t,labelRange:o,isStale:s}=hi(this.getters,e,this.dataSets,this.labelRange);if(!s)return this;const n=this.getDefinitionWithSpecificDataSets(t,o);return new ul(n,this.sheetId,this.getters)}getDefinitionForExcel(){if(this.aggregated)return;const e=this.dataSets.map((e=>fi(this.getters,e))).filter((e=>""!==e.range&&e.range!==le)),t=bi(this.getters,this.labelRange,xi(this.labelRange,this.dataSets[0],this.dataSetsHaveTitle));return{...this.getDefinition(),backgroundColor:Ma(this.background||I),fontColor:Ma(Ei(this.background)),dataSets:e,labelRange:t}}copyForSheetId(e){const t=di(this.sheetId,e,this.dataSets),o=ui(this.sheetId,e,this.labelRange),s=this.getDefinitionWithSpecificDataSets(t,o,e);return new ul(s,e,this.getters)}copyInSheetId(e){const t=this.getDefinitionWithSpecificDataSets(this.dataSets,this.labelRange,e);return new ul(t,e,this.getters)}}function gl(e,t){return ml(e,t)||fl(e,t)}function pl(e,t){return function(e,t){return!e.labelsAsText&&ml(e.labelRange,t)}(e,t)&&function(){if(!window.Chart)return!1;const e="luxon"===new window.Chart._adapters._date({})._id;e||bl||(bl=!0,console.warn("'chartjs-adapter-luxon' time adapter is not installed. Time scale axes are disabled."));return e}()?"time":function(e,t){return!e.labelsAsText&&fl(e.labelRange,t)}(e,t)?"linear":"category"}function ml(e,t){if(!e||!fl(e,t))return!1;const o=t.getEvaluatedCell({sheetId:e.sheetId,col:e.zone.left,row:e.zone.top}).format;return Boolean(o&&hl.test(o))}function fl(e,t){if(!e)return!1;const o=t.getRangeValues(e);return!o.some((e=>isNaN(Number(e))&&e))&&!o.every((e=>!e))}let bl=!1;class vl extends ci{dataSets;labelRange;background;legendPosition;type="pie";aggregated;dataSetsHaveTitle;constructor(e,t,o){super(e,t,o),this.dataSets=pi(o,e.dataSets,t,e.dataSetsHaveTitle),this.labelRange=Un(o,t,e.labelRange),this.background=e.background,this.legendPosition=e.legendPosition,this.aggregated=e.aggregated,this.dataSetsHaveTitle=e.dataSetsHaveTitle}static transformDefinition(e,t){return vi(e,t)}static validateChartDefinition(e,t){return e.checkValidations(t,wi,yi)}static getDefinitionFromContextCreation(e){return{background:e.background,dataSets:e.range?e.range:[],dataSetsHaveTitle:!1,legendPosition:"top",title:e.title||"",type:"pie",labelRange:e.auxiliaryRange||void 0,aggregated:!1}}getDefinition(){return this.getDefinitionWithSpecificDataSets(this.dataSets,this.labelRange)}getContextCreation(){return{background:this.background,title:this.title,range:this.dataSets.map((e=>this.getters.getRangeString(e.dataRange,this.sheetId))),auxiliaryRange:this.labelRange?this.getters.getRangeString(this.labelRange,this.sheetId):void 0}}getDefinitionWithSpecificDataSets(e,t,o){return{type:"pie",dataSetsHaveTitle:!!e.length&&Boolean(e[0].labelCell),background:this.background,dataSets:e.map((e=>this.getters.getRangeString(e.dataRange,o||this.sheetId))),legendPosition:this.legendPosition,labelRange:t?this.getters.getRangeString(t,o||this.sheetId):void 0,title:this.title,aggregated:this.aggregated}}copyForSheetId(e){const t=di(this.sheetId,e,this.dataSets),o=ui(this.sheetId,e,this.labelRange),s=this.getDefinitionWithSpecificDataSets(t,o,e);return new vl(s,e,this.getters)}copyInSheetId(e){const t=this.getDefinitionWithSpecificDataSets(this.dataSets,this.labelRange,e);return new vl(t,e,this.getters)}getDefinitionForExcel(){if(this.aggregated)return;const e=this.dataSets.map((e=>fi(this.getters,e))).filter((e=>""!==e.range&&e.range!==le)),t=bi(this.getters,this.labelRange,xi(this.labelRange,this.dataSets[0],this.dataSetsHaveTitle));return{...this.getDefinition(),backgroundColor:Ma(this.background||I),fontColor:Ma(Ei(this.background)),verticalAxisPosition:"left",dataSets:e,labelRange:t}}updateRanges(e){const{dataSets:t,labelRange:o,isStale:s}=hi(this.getters,e,this.dataSets,this.labelRange);if(!s)return this;const n=this.getDefinitionWithSpecificDataSets(t,o);return new vl(n,this.sheetId,this.getters)}}function Sl(e,t){const o=[],s=ht(t.map((e=>e.data.length)));for(let t=0;t<=s;t++)o.push(e.next());return o}const Cl=new Hi;Cl.add("bar",{match:e=>"bar"===e,createChart:(e,t,o)=>new tl(e,t,o),getChartRuntime:function(e,t){let o=ja(t,e.dataSets,e.labelRange).formattedValues,s=Ka(t,e.dataSets);e.dataSetsHaveTitle&&s[0]&&o.length>s[0].data.length&&o.shift(),({labels:o,dataSetsValues:s}=Wa(o,s)),e.aggregated&&({labels:o,dataSetsValues:s}=qa(o,s));const n=function(e,t,o){const s=Ei(e.background),n=Ya(e,t,s,o),i={labels:{color:s}};return!e.labelRange&&1===e.dataSets.length||"none"===e.legendPosition?i.display=!1:i.position=e.legendPosition,n.options.plugins.legend={...n.options.plugins?.legend,...i},n.options.layout={padding:{left:20,right:20,top:e.title?10:25,bottom:10}},n.options.scales={x:{ticks:{padding:5,color:s}},y:{position:e.verticalAxisPosition,beginAtZero:!0,ticks:{color:s,callback:e=>{if(e=Number(e),isNaN(e))return e;const{locale:t,format:s}=o;return Is(e,{locale:t,format:!s&&Math.abs(e)>=1e3?"#,##":s})}}}},e.stacked&&(n.options.scales.x.stacked=!0,n.options.scales.y.stacked=!0),n}(e,o,{format:Xa(t,e.dataSets),locale:t.getLocale()}),i=new Ci;for(let{label:e,data:t}of s){const o=i.next(),s={label:e,data:t,borderColor:o,backgroundColor:o};n.data.datasets.push(s)}return{chartJsConfig:n,background:e.background||I}},validateChartDefinition:(e,t)=>tl.validateChartDefinition(e,t),transformDefinition:(e,t)=>tl.transformDefinition(e,t),getChartDefinitionFromContextCreation:e=>tl.getDefinitionFromContextCreation(e),name:a("Bar"),sequence:10}),Cl.add("line",{match:e=>"line"===e,createChart:(e,t,o)=>new ul(e,t,o),getChartRuntime:function(e,t){const o=pl(e,t),s=ja(t,e.dataSets,e.labelRange);let n="linear"===o?s.values:s.formattedValues,i=Ka(t,e.dataSets);e.dataSetsHaveTitle&&i[0]&&n.length>i[0].data.length&&n.shift(),({labels:n,dataSetsValues:i}=Wa(n,i)),"time"===o&&({labels:n,dataSetsValues:i}=function(e,t){if(0===e.length||e.every((e=>!e)))return{labels:e,dataSetsValues:t};const o=[...e],s=Te(t);for(let e=0;e<o.length;e++)if(!o[e]){o[e]=Xe(o,e);for(let t of s)t.data[e]=void 0}return{labels:o,dataSetsValues:s}}(n,i)),e.aggregated&&({labels:n,dataSetsValues:i}=qa(n,i));const r=t.getLocale(),a="category"===o,l=Xa(t,e.dataSets),c=function(e,t,o){const s=Ei(e.background),n=Ya(e,t,s,o),i={labels:{color:s,generateLabels(e){const{data:t}=e,o=window.Chart.defaults.plugins.legend.labels.generateLabels(e);for(const[e,s]of o.entries())s.fillStyle=t.datasets[e].borderColor;return o}}};return!e.labelRange&&1===e.dataSets.length||"none"===e.legendPosition?i.display=!1:i.position=e.legendPosition,Object.assign(n.options.plugins.legend||{},i),n.options.layout={padding:{left:20,right:20,top:e.title?10:25,bottom:10}},n.options.scales={x:{ticks:{padding:5,color:s}},y:{position:e.verticalAxisPosition,beginAtZero:!0,ticks:{color:s,callback:e=>{if(e=Number(e),isNaN(e))return e;const{locale:t,format:s}=o;return Is(e,{locale:t,format:!s&&Math.abs(e)>=1e3?"#,##":s})}}}},e.stacked&&n.options?.scales?.y&&(n.options.scales.y.stacked=!0),n}(e,n,{format:l,locale:r,truncateLabels:a}),h=function(e,t){if(t)return e.getEvaluatedCell({sheetId:t.sheetId,col:t.zone.left,row:t.zone.top}).format}(t,e.labelRange);if("time"===o){const e={type:"time",time:dl(n,h,r)};Object.assign(c.options.scales.x,e),c.options.scales.x.ticks.maxTicksLimit=15}else"linear"===o&&(c.options.scales.x.type="linear",c.options.scales.x.ticks.callback=e=>Is(e,{format:h,locale:r}),c.options.plugins.tooltip.callbacks.title=e=>Is(e[0].parsed.x||e[0].label,{locale:r,format:h}));const d=new Ci;for(let[t,{label:s,data:r}]of i.entries()){if(e.cumulative){let e=0;r=r.map((t=>isNaN(t)?t:(e+=parseFloat(t),e)))}["linear","time"].includes(o)&&(r=r.map(((e,t)=>({x:n[t]||void 0,y:e}))));const i=d.next();let a=wt(i);e.stacked&&(a.a=.4);const l={label:s,data:r,tension:0,borderColor:i,backgroundColor:Et(a),pointBackgroundColor:i,fill:!!e.stacked&&Qa(t)};c.data.datasets.push(l)}return{chartJsConfig:c,background:e.background||I}},validateChartDefinition:(e,t)=>ul.validateChartDefinition(e,t),transformDefinition:(e,t)=>ul.transformDefinition(e,t),getChartDefinitionFromContextCreation:e=>ul.getDefinitionFromContextCreation(e),name:a("Line"),sequence:20}),Cl.add("pie",{match:e=>"pie"===e,createChart:(e,t,o)=>new vl(e,t,o),getChartRuntime:function(e,t){let o=ja(t,e.dataSets,e.labelRange).formattedValues,s=Ka(t,e.dataSets);e.dataSetsHaveTitle&&s[0]&&o.length>s[0].data.length&&o.shift(),({labels:o,dataSetsValues:s}=Wa(o,s)),e.aggregated&&({labels:o,dataSetsValues:s}=qa(o,s));const n=function(e,t,o){const s=Ei(e.background),n=Ya(e,t,s,o),i={labels:{color:s}};return!e.labelRange&&1===e.dataSets.length||"none"===e.legendPosition?i.display=!1:i.position=e.legendPosition,Object.assign(n.options.plugins.legend||{},i),n.options.layout={padding:{left:20,right:20,top:e.title?10:25,bottom:10}},n.options.plugins.tooltip.callbacks.title=function(e){return e[0].dataset.label},n.options.plugins.tooltip.callbacks.label=function(e){const{format:t,locale:s}=o,n=function(e,t){const o=e.filter((e=>"number"==typeof e)).reduce(((e,t)=>e+t),0);if(!o)return"";return(e[t]/o*100).toFixed(2)}(e.dataset.data,e.dataIndex),i=e.label||e.dataset.label,r=e.parsed.y??e.parsed,a=Is(r,{format:!t&&Math.abs(r)>=1e3?"#,##":t,locale:s});return i?`${i}: ${a} (${n}%)`:`${a} (${n}%)`},n}(e,o,{format:Xa(t,e.dataSets),locale:t.getLocale()}),i=new Ci;for(let{label:e,data:t}of s){const o={label:e,data:t,borderColor:"#FFFFFF",backgroundColor:Sl(i,s)};n.data.datasets.push(o)}return{chartJsConfig:n,background:e.background||I}},validateChartDefinition:(e,t)=>vl.validateChartDefinition(e,t),transformDefinition:(e,t)=>vl.transformDefinition(e,t),getChartDefinitionFromContextCreation:e=>vl.getDefinitionFromContextCreation(e),name:a("Pie"),sequence:30}),Cl.add("scorecard",{match:e=>"scorecard"===e,createChart:(e,t,o)=>new Ni(e,t,o),getChartRuntime:function(e,t){let o,s,n="",i="";if(e.keyValue){const s={sheetId:e.keyValue.sheetId,col:e.keyValue.zone.left,row:e.keyValue.zone.top};o=t.getEvaluatedCell(s),n=String(o.value),i=o.formattedValue}const r=e.baseline;if(r){const o={sheetId:e.baseline.sheetId,col:e.baseline.zone.left,row:e.baseline.zone.top};s=t.getEvaluatedCell(o)}const{background:l,fontColor:c}=t.getStyleOfSingleCellChart(e.background,e.keyValue),h=t.getLocale();return{title:a(e.title),keyValue:i||n,baselineDisplay:Ii(s,o,e.baselineMode,h),baselineArrow:Ti(s,o,e.baselineMode),baselineColor:Ri(s,e.baselineMode,o,e.baselineColorUp,e.baselineColorDown),baselineDescr:e.baselineDescr?a(e.baselineDescr):"",fontColor:c,background:l,baselineStyle:"percentage"!==e.baselineMode&&r?t.getCellStyle({sheetId:r.sheetId,col:r.zone.left,row:r.zone.top}):void 0,keyValueStyle:e.keyValue?t.getCellStyle({sheetId:e.keyValue.sheetId,col:e.keyValue.zone.left,row:e.keyValue.zone.top}):void 0}},validateChartDefinition:(e,t)=>Ni.validateChartDefinition(e,t),transformDefinition:(e,t)=>Ni.transformDefinition(e,t),getChartDefinitionFromContextCreation:e=>Ni.getDefinitionFromContextCreation(e),name:a("Scorecard"),sequence:40}),Cl.add("gauge",{match:e=>"gauge"===e,createChart:(e,t,o)=>new al(e,t,o),getChartRuntime:function(e,t){const o=function(e,t){const o=Ya(e,[],Ei(e.background),{locale:t});return o.options.hover=void 0,o.options.events=[],o.options.layout={padding:{left:30,right:30,top:e.title?10:25,bottom:25}},o.options.needle={width:10,borderColor:"#000000",backgroundColor:"#000000"},o.options.valueLabel={display:!1,font:{size:30,color:"#FFFFFF"},backgroundColor:"#000000",borderColor:"#000000",borderRadius:5,padding:{top:5,right:5,bottom:5,left:5}},o}(e,t.getLocale()),s=e.sectionRule.colors,n=e.sectionRule.lowerInflectionPoint,i=e.sectionRule.upperInflectionPoint,r=Number(n.value),a=Number(i.value),l=Number(e.sectionRule.rangeMin),c=Number(e.sectionRule.rangeMax),h=c-l,d=[];if(""!==n.value){const e="number"===n.type?r:l+h*r/100;d.push({value:_e(e,l,c),color:s.lowerColor})}if(""!==i.value){const e="number"===i.type?a:l+h*a/100;d.push({value:_e(e,l,c),color:s.middleColor})}const u=[],g=[];d.sort(((e,t)=>e.value-t.value)).map((e=>{u.push(e.value),g.push(e.color)})),u.push(c),g.push(s.upperColor);const p=e.dataRange,m=h/30;let f,b=l-m,v=!1;if(void 0!==p){const e=t.getEvaluatedCell({sheetId:p.sheetId,col:p.zone.left,row:p.zone.top});e.type===mo.number&&(b=_e(e.value,l-m,c+m),f=()=>t.getRangeFormattedValues(p)[0],v=!0)}return o.options.valueLabel.display=v,o.options.valueLabel.formatter=f,o.data.datasets.push({data:u,minValue:Number(e.sectionRule.rangeMin),value:b,backgroundColor:g}),{chartJsConfig:o,background:t.getStyleOfSingleCellChart(e.background,p).background}},validateChartDefinition:(e,t)=>al.validateChartDefinition(e,t),transformDefinition:(e,t)=>al.transformDefinition(e,t),getChartDefinitionFromContextCreation:e=>al.getDefinitionFromContextCreation(e),name:a("Gauge"),sequence:50});const El=new Hi;El.add("line",li),El.add("bar",li),El.add("pie",li),El.add("gauge",li),El.add("scorecard",Bi);const wl=new Hi;gr`
284
284
  .o-chart-container {
285
285
  width: 100%;
286
286
  height: 100%;
@@ -2628,4 +2628,4 @@
2628
2628
  <tableParts count="${e.filterTables.length}">
2629
2629
  ${sy(a)}
2630
2630
  </tableParts>
2631
- `}var _T;!function(e){e[e.Ready=0]="Ready",e[e.Running=1]="Running",e[e.RunningCore=2]="RunningCore",e[e.Finalizing=3]="Finalizing"}(_T||(_T={}));function MT(e,t={}){const o=Te(t);return o.type=e,o}const NT={},FT={MIN_ROW_HEIGHT:10,MIN_COL_WIDTH:5,HEADER_HEIGHT:B,HEADER_WIDTH:H,TOPBAR_HEIGHT:63,BOTTOMBAR_HEIGHT:36,DEFAULT_CELL_WIDTH:z,DEFAULT_CELL_HEIGHT:G,SCROLLBAR_WIDTH:$},DT={autofillModifiersRegistry:nr,autofillRulesRegistry:ir,cellMenuRegistry:sb,colMenuRegistry:Hv,linkMenuRegistry:Ta,functionRegistry:Tf,featurePluginRegistry:eR,statefulUIPluginRegistry:tR,coreViewsPluginRegistry:oR,corePluginRegistry:JI,rowMenuRegistry:$v,sidePanelRegistry:tC,figureRegistry:Rl,chartSidePanelComponentRegistry:uS,chartComponentRegistry:El,chartRegistry:Cl,topbarMenuRegistry:Wv,topbarComponentRegistry:oC,clickableCellRegistry:sR,otRegistry:qv,inverseCommandRegistry:_l,urlRegistry:Gi,cellPopoverRegistry:_a,numberFormatMenuRegistry:zv,repeatLocalCommandTransformRegistry:VI,repeatCommandTransformRegistry:kI},LT={arg:Sc,toBoolean:Wo,toJsDate:qo,toNumber:Lo,toString:zo,toXC:Ft,toZone:dn,toUnboundedZone:hn,toCartesian:Nt,numberToLetters:Tt,lettersToNumber:Ot,UuidGenerator:oi,formatValue:Is,createCurrencyFormat:Hs,computeTextWidth:Zn,createEmptyWorkbookData:Py,createEmptySheet:Ly,createEmptyExcelSheet:ky,getDefaultChartJsRuntime:Ya,chartFontColor:Ei,ChartColors:Ci,EvaluationError:d,CellErrorLevel:h,getFillingMode:Qa,rgbaToHex:Et,colorToRGBA:wt,positionToZone:Fn,isDefined:$e,isMatrix:Oo,lazy:je,genericRepeat:UI,createAction:ii,createActions:si,transformRangeData:ai,deepEquals:Qe},PT={isMarkdownLink:Pe,parseMarkdownLink:Ue,markdownLink:Ve,openLink:Yi,urlRepresentation:Zi},kT={ChartPanel:gS,ChartFigure:yl,ChartJsComponent:li,Grid:aE,GridOverlay:WC,ScorecardChart:Bi,LineConfigPanel:cS,LineBarPieDesignPanel:rS,BarConfigPanel:Jv,LineBarPieConfigPanel:Qv,GaugeChartConfigPanel:aS,GaugeChartDesignPanel:lS,ScorecardChartConfigPanel:hS,ScorecardChartDesignPanel:dS,FigureComponent:sC,Menu:Hr,SelectionInput:Xv},VT={useDragAndDropListItems:vS};const UT={DEFAULT_LOCALE:To};e.AbstractChart=ci,e.CorePlugin=Uy,e.DispatchResult=yo,e.EvaluationError=d,e.Model=class extends uI{corePlugins=[];featurePlugins=[];statefulUIPlugins=[];coreViewsPlugins=[];range;session;isReplayingCommand=!1;renderers=[];status=0;config;corePluginConfig;uiPluginConfig;state;selection;getters;coreGetters;uuidGenerator;handlers=[];uiHandlers=[];coreHandlers=[];constructor(e={},r={},a=[],l=new oi,c=!0){super(),n===o&&i===s&&(i=()=>!0),a=Ny(e,a);const h=_y(e,c);this.state=new zR,this.uuidGenerator=l,this.config=this.setupConfig(r),this.session=this.setupSession(h.revisionId),this.coreGetters={},this.range=new Rx(this.coreGetters),this.coreGetters.getRangeString=this.range.getRangeString.bind(this.range),this.coreGetters.getRangeFromSheetXC=this.range.getRangeFromSheetXC.bind(this.range),this.coreGetters.createAdaptedRanges=this.range.createAdaptedRanges.bind(this.range),this.coreGetters.getRangeDataFromXc=this.range.getRangeDataFromXc.bind(this.range),this.coreGetters.getRangeDataFromZone=this.range.getRangeDataFromZone.bind(this.range),this.coreGetters.getRangeFromRangeData=this.range.getRangeFromRangeData.bind(this.range),this.coreGetters.getRangeFromZone=this.range.getRangeFromZone.bind(this.range),this.getters={isReadonly:()=>"readonly"===this.config.mode||"dashboard"===this.config.mode,isDashboard:()=>"dashboard"===this.config.mode},this.uuidGenerator.setIsFastStrategy(!0),this.selection=new HR(this.getters),this.coreHandlers.push(this.range),this.handlers.push(this.range),this.corePluginConfig=this.setupCorePluginConfig(),this.uiPluginConfig=this.setupUiPluginConfig();for(let e of JI.getAll())this.setupCorePlugin(e,h);Object.assign(this.getters,this.coreGetters),this.session.loadInitialMessages(a);for(let e of oR.getAll()){const t=this.setupUiPlugin(e);this.coreViewsPlugins.push(t),this.handlers.push(t),this.uiHandlers.push(t),this.coreHandlers.push(t)}for(let e of tR.getAll()){const t=this.setupUiPlugin(e);this.statefulUIPlugins.push(t),this.handlers.push(t),this.uiHandlers.push(t)}for(let e of eR.getAll()){const t=this.setupUiPlugin(e);this.featurePlugins.push(t),this.handlers.push(t),this.uiHandlers.push(t)}this.uuidGenerator.setIsFastStrategy(!1),this.dispatch("START"),this.selection.observe(this,{handleEvent:()=>this.trigger("update")}),this.setupSessionEvents(),this.joinSession(),r.snapshotRequested&&(this.session.snapshot(this.exportData()),this.garbageCollectExternalResources()),t.markRaw(this)}joinSession(){this.session.join(this.config.client)}leaveSession(){this.session.leave(this.exportData())}setupUiPlugin(e){const t=new e(this.uiPluginConfig);for(let o of e.getters){if(!(o in t))throw new Error(`Invalid getter name: ${o} for plugin ${t.constructor}`);if(o in this.getters)throw new Error(`Getter "${o}" is already defined.`);this.getters[o]=t[o].bind(t)}const o=e.layers.map((e=>[t,e]));return this.renderers.push(...o),this.renderers.sort(((e,t)=>e[1]-t[1])),t}setupCorePlugin(e,t){const o=new e(this.corePluginConfig);for(let t of e.getters){if(!(t in o))throw new Error(`Invalid getter name: ${t} for plugin ${o.constructor}`);if(t in this.coreGetters)throw new Error(`Getter "${t}" is already defined.`);this.coreGetters[t]=o[t].bind(o)}o.import(t),this.corePlugins.push(o),this.coreHandlers.push(o),this.handlers.push(o)}onRemoteRevisionReceived({commands:e}){for(let t of e){const e=this.status;this.status=2,this.dispatchToHandlers(this.statefulUIPlugins,t),this.status=e}this.finalize()}setupSession(e){return new yI(VR({initialRevisionId:e,recordChanges:this.state.recordChanges.bind(this.state),dispatch:e=>{this.checkDispatchAllowed(e).isSuccessful&&(this.isReplayingCommand=!0,this.dispatchToHandlers(this.coreHandlers,e),this.isReplayingCommand=!1)}}),this.config.transportService,e)}setupSessionEvents(){this.session.on("remote-revision-received",this,this.onRemoteRevisionReceived),this.session.on("revision-undone",this,(({commands:e})=>{this.dispatchFromCorePlugin("UNDO",{commands:e}),this.finalize()})),this.session.on("revision-redone",this,(({commands:e})=>{this.dispatchFromCorePlugin("REDO",{commands:e}),this.finalize()})),this.session.on("unexpected-revision-id",this,(()=>this.trigger("unexpected-revision-id"))),this.session.on("collaborative-event-received",this,(()=>{this.trigger("update")}))}setupConfig(e){const t=e.client||{id:this.uuidGenerator.uuidv4(),name:a("Anonymous").toString()},o=e.transportService||new OR;return{...e,mode:e.mode||"normal",custom:e.custom||{},external:this.setupExternalConfig(e.external||{}),transportService:o,client:t,moveClient:()=>{},snapshotRequested:!1,notifyUI:e=>this.trigger("notify-ui",e),raiseBlockingErrorUI:e=>this.trigger("raise-error-ui",{text:e})}}setupExternalConfig(e){const t=e.loadLocales||(()=>Promise.resolve(Ro));return{...e,loadLocales:t}}setupCorePluginConfig(){return{getters:this.coreGetters,stateObserver:this.state,range:this.range,dispatch:this.dispatchFromCorePlugin,uuidGenerator:this.uuidGenerator,custom:this.config.custom,external:this.config.external}}setupUiPluginConfig(){return{getters:this.getters,stateObserver:this.state,dispatch:this.dispatch,selection:this.selection,moveClient:this.session.move.bind(this.session),custom:this.config.custom,uiActions:this.config,session:this.session,defaultCurrencyFormat:this.config.defaultCurrencyFormat}}checkDispatchAllowed(e){const t=wo(e)?this.checkDispatchAllowedCoreCommand(e):this.checkDispatchAllowedLocalCommand(e);return t.some((e=>"Success"!==e))?new yo(t.flat()):yo.Success}checkDispatchAllowedCoreCommand(e){const t=this.corePlugins.map((t=>t.allowDispatch(e)));return t.push(this.range.allowDispatch(e)),t}checkDispatchAllowedLocalCommand(e){return this.uiHandlers.map((t=>t.allowDispatch(e)))}finalize(){this.status=3;for(const e of this.handlers)e.finalize();this.status=0}canDispatch=(e,t)=>this.checkDispatchAllowed(MT(e,t));dispatch=(e,t)=>{const o=MT(e,t);let s=this.status;if(this.getters.isReadonly()&&(n=o,!Co.has(n.type)))return new yo("Readonly");var n;if(!this.session.canApplyOptimisticUpdate())return new yo("WaitingSessionConfirmation");switch(s){case 0:const t=this.checkDispatchAllowed(o);if(!t.isSuccessful)return t;this.status=1;const{changes:s,commands:n}=this.state.recordChanges((()=>{wo(o)&&this.state.addCommand(o),this.dispatchToHandlers(this.handlers,o),this.finalize()}));this.session.save(o,n,s),this.status=0,this.trigger("update");break;case 1:if(wo(o)){const e=this.checkDispatchAllowed(o);if(!e.isSuccessful)return e;this.state.addCommand(o)}this.dispatchToHandlers(this.handlers,o);break;case 3:throw new Error("Cannot dispatch commands in the finalize state");case 2:if(wo(o))throw new Error(`A UI plugin cannot dispatch ${e} while handling a core command`);this.dispatchToHandlers(this.handlers,o)}return yo.Success};dispatchFromCorePlugin=(e,t)=>{const o=MT(e,t),s=this.status;this.status=2;const n=this.isReplayingCommand?this.coreHandlers:this.handlers;return this.dispatchToHandlers(n,o),this.status=s,yo.Success};dispatchToHandlers(e,t){const o=wo(t);for(const s of e)!o&&s instanceof Uy||s.beforeHandle(t);for(const s of e)!o&&s instanceof Uy||s.handle(t)}drawGrid(e){for(let[t,o]of this.renderers)e.ctx.save(),t.drawGrid(e,o),e.ctx.restore()}exportData(){let e=Py();for(let t of this.handlers)t instanceof Uy&&t.export(e);return e.revisionId=this.session.getRevisionId()||ce,e=Te(e),e}updateMode(e){"normal"!==e&&this.dispatch("CANCEL_EDITION"),this.config.mode=e,this.trigger("update")}exportXLSX(){this.dispatch("EVALUATE_CELLS");let e={...Py(),sheets:[ky(Oy,"Sheet1")]};for(let t of this.handlers)t instanceof Vy&&t.exportForExcel(e);return e=Te(e),AT(e)}garbageCollectExternalResources(){for(const e of this.corePlugins)e.garbageCollectExternalResources()}},e.Registry=Hi,e.Revision=EI,e.SPREADSHEET_DIMENSIONS=FT,e.Spreadsheet=AR,e.UIPlugin=Tx,e.__info__=NT,e.addFunction=function e(t,o){return Tf.add(t,o),{addFunction:(t,o)=>e(t,o)}},e.astToFormula=ix,e.compile=ux,e.compileTokens=gx,e.components=kT,e.constants=UT,e.convertAstNodes=tx,e.coreTypes=Eo,e.findCellInNewZone=Mn,e.functionCache=dx,e.helpers=LT,e.hooks=VT,e.invalidateCFEvaluationCommands=So,e.invalidateDependenciesCommands=vo,e.invalidateEvaluationCommands=bo,e.iterateAstNodes=ox,e.links=PT,e.load=_y,e.parse=Jy,e.parseTokens=ex,e.readonlyAllowedCommands=Co,e.registries=DT,e.setDefaultSheetViewSize=function(e){Ee=e},e.setTranslationMethod=function(e,t=(()=>!0)){n=e,i=t},e.tokenize=qr,NT.version="17.0.29",NT.date="2024-07-08T05:40:27.608Z",NT.hash="2d467e3"}(this.o_spreadsheet=this.o_spreadsheet||{},owl);
2631
+ `}var _T;!function(e){e[e.Ready=0]="Ready",e[e.Running=1]="Running",e[e.RunningCore=2]="RunningCore",e[e.Finalizing=3]="Finalizing"}(_T||(_T={}));function MT(e,t={}){const o=Te(t);return o.type=e,o}const NT={},FT={MIN_ROW_HEIGHT:10,MIN_COL_WIDTH:5,HEADER_HEIGHT:B,HEADER_WIDTH:H,TOPBAR_HEIGHT:63,BOTTOMBAR_HEIGHT:36,DEFAULT_CELL_WIDTH:z,DEFAULT_CELL_HEIGHT:G,SCROLLBAR_WIDTH:$},DT={autofillModifiersRegistry:nr,autofillRulesRegistry:ir,cellMenuRegistry:sb,colMenuRegistry:Hv,linkMenuRegistry:Ta,functionRegistry:Tf,featurePluginRegistry:eR,statefulUIPluginRegistry:tR,coreViewsPluginRegistry:oR,corePluginRegistry:JI,rowMenuRegistry:$v,sidePanelRegistry:tC,figureRegistry:Rl,chartSidePanelComponentRegistry:uS,chartComponentRegistry:El,chartRegistry:Cl,topbarMenuRegistry:Wv,topbarComponentRegistry:oC,clickableCellRegistry:sR,otRegistry:qv,inverseCommandRegistry:_l,urlRegistry:Gi,cellPopoverRegistry:_a,numberFormatMenuRegistry:zv,repeatLocalCommandTransformRegistry:VI,repeatCommandTransformRegistry:kI},LT={arg:Sc,toBoolean:Wo,toJsDate:qo,toNumber:Lo,toString:zo,toXC:Ft,toZone:dn,toUnboundedZone:hn,toCartesian:Nt,numberToLetters:Tt,lettersToNumber:Ot,UuidGenerator:oi,formatValue:Is,createCurrencyFormat:Hs,computeTextWidth:Zn,createEmptyWorkbookData:Py,createEmptySheet:Ly,createEmptyExcelSheet:ky,getDefaultChartJsRuntime:Ya,chartFontColor:Ei,ChartColors:Ci,EvaluationError:d,CellErrorLevel:h,getFillingMode:Qa,rgbaToHex:Et,colorToRGBA:wt,positionToZone:Fn,isDefined:$e,isMatrix:Oo,lazy:je,genericRepeat:UI,createAction:ii,createActions:si,transformRangeData:ai,deepEquals:Qe},PT={isMarkdownLink:Pe,parseMarkdownLink:Ue,markdownLink:Ve,openLink:Yi,urlRepresentation:Zi},kT={ChartPanel:gS,ChartFigure:yl,ChartJsComponent:li,Grid:aE,GridOverlay:WC,ScorecardChart:Bi,LineConfigPanel:cS,LineBarPieDesignPanel:rS,BarConfigPanel:Jv,LineBarPieConfigPanel:Qv,GaugeChartConfigPanel:aS,GaugeChartDesignPanel:lS,ScorecardChartConfigPanel:hS,ScorecardChartDesignPanel:dS,FigureComponent:sC,Menu:Hr,SelectionInput:Xv},VT={useDragAndDropListItems:vS};const UT={DEFAULT_LOCALE:To};e.AbstractChart=ci,e.CorePlugin=Uy,e.DispatchResult=yo,e.EvaluationError=d,e.Model=class extends uI{corePlugins=[];featurePlugins=[];statefulUIPlugins=[];coreViewsPlugins=[];range;session;isReplayingCommand=!1;renderers=[];status=0;config;corePluginConfig;uiPluginConfig;state;selection;getters;coreGetters;uuidGenerator;handlers=[];uiHandlers=[];coreHandlers=[];constructor(e={},r={},a=[],l=new oi,c=!0){super(),n===o&&i===s&&(i=()=>!0),a=Ny(e,a);const h=_y(e,c);this.state=new zR,this.uuidGenerator=l,this.config=this.setupConfig(r),this.session=this.setupSession(h.revisionId),this.coreGetters={},this.range=new Rx(this.coreGetters),this.coreGetters.getRangeString=this.range.getRangeString.bind(this.range),this.coreGetters.getRangeFromSheetXC=this.range.getRangeFromSheetXC.bind(this.range),this.coreGetters.createAdaptedRanges=this.range.createAdaptedRanges.bind(this.range),this.coreGetters.getRangeDataFromXc=this.range.getRangeDataFromXc.bind(this.range),this.coreGetters.getRangeDataFromZone=this.range.getRangeDataFromZone.bind(this.range),this.coreGetters.getRangeFromRangeData=this.range.getRangeFromRangeData.bind(this.range),this.coreGetters.getRangeFromZone=this.range.getRangeFromZone.bind(this.range),this.getters={isReadonly:()=>"readonly"===this.config.mode||"dashboard"===this.config.mode,isDashboard:()=>"dashboard"===this.config.mode},this.uuidGenerator.setIsFastStrategy(!0),this.selection=new HR(this.getters),this.coreHandlers.push(this.range),this.handlers.push(this.range),this.corePluginConfig=this.setupCorePluginConfig(),this.uiPluginConfig=this.setupUiPluginConfig();for(let e of JI.getAll())this.setupCorePlugin(e,h);Object.assign(this.getters,this.coreGetters),this.session.loadInitialMessages(a);for(let e of oR.getAll()){const t=this.setupUiPlugin(e);this.coreViewsPlugins.push(t),this.handlers.push(t),this.uiHandlers.push(t),this.coreHandlers.push(t)}for(let e of tR.getAll()){const t=this.setupUiPlugin(e);this.statefulUIPlugins.push(t),this.handlers.push(t),this.uiHandlers.push(t)}for(let e of eR.getAll()){const t=this.setupUiPlugin(e);this.featurePlugins.push(t),this.handlers.push(t),this.uiHandlers.push(t)}this.uuidGenerator.setIsFastStrategy(!1),this.dispatch("START"),this.selection.observe(this,{handleEvent:()=>this.trigger("update")}),this.setupSessionEvents(),this.joinSession(),r.snapshotRequested&&(this.session.snapshot(this.exportData()),this.garbageCollectExternalResources()),t.markRaw(this)}joinSession(){this.session.join(this.config.client)}leaveSession(){this.session.leave(this.exportData())}setupUiPlugin(e){const t=new e(this.uiPluginConfig);for(let o of e.getters){if(!(o in t))throw new Error(`Invalid getter name: ${o} for plugin ${t.constructor}`);if(o in this.getters)throw new Error(`Getter "${o}" is already defined.`);this.getters[o]=t[o].bind(t)}const o=e.layers.map((e=>[t,e]));return this.renderers.push(...o),this.renderers.sort(((e,t)=>e[1]-t[1])),t}setupCorePlugin(e,t){const o=new e(this.corePluginConfig);for(let t of e.getters){if(!(t in o))throw new Error(`Invalid getter name: ${t} for plugin ${o.constructor}`);if(t in this.coreGetters)throw new Error(`Getter "${t}" is already defined.`);this.coreGetters[t]=o[t].bind(o)}o.import(t),this.corePlugins.push(o),this.coreHandlers.push(o),this.handlers.push(o)}onRemoteRevisionReceived({commands:e}){for(let t of e){const e=this.status;this.status=2,this.dispatchToHandlers(this.statefulUIPlugins,t),this.status=e}this.finalize()}setupSession(e){return new yI(VR({initialRevisionId:e,recordChanges:this.state.recordChanges.bind(this.state),dispatch:e=>{this.checkDispatchAllowed(e).isSuccessful&&(this.isReplayingCommand=!0,this.dispatchToHandlers(this.coreHandlers,e),this.isReplayingCommand=!1)}}),this.config.transportService,e)}setupSessionEvents(){this.session.on("remote-revision-received",this,this.onRemoteRevisionReceived),this.session.on("revision-undone",this,(({commands:e})=>{this.dispatchFromCorePlugin("UNDO",{commands:e}),this.finalize()})),this.session.on("revision-redone",this,(({commands:e})=>{this.dispatchFromCorePlugin("REDO",{commands:e}),this.finalize()})),this.session.on("unexpected-revision-id",this,(()=>this.trigger("unexpected-revision-id"))),this.session.on("collaborative-event-received",this,(()=>{this.trigger("update")}))}setupConfig(e){const t=e.client||{id:this.uuidGenerator.uuidv4(),name:a("Anonymous").toString()},o=e.transportService||new OR;return{...e,mode:e.mode||"normal",custom:e.custom||{},external:this.setupExternalConfig(e.external||{}),transportService:o,client:t,moveClient:()=>{},snapshotRequested:!1,notifyUI:e=>this.trigger("notify-ui",e),raiseBlockingErrorUI:e=>this.trigger("raise-error-ui",{text:e})}}setupExternalConfig(e){const t=e.loadLocales||(()=>Promise.resolve(Ro));return{...e,loadLocales:t}}setupCorePluginConfig(){return{getters:this.coreGetters,stateObserver:this.state,range:this.range,dispatch:this.dispatchFromCorePlugin,uuidGenerator:this.uuidGenerator,custom:this.config.custom,external:this.config.external}}setupUiPluginConfig(){return{getters:this.getters,stateObserver:this.state,dispatch:this.dispatch,selection:this.selection,moveClient:this.session.move.bind(this.session),custom:this.config.custom,uiActions:this.config,session:this.session,defaultCurrencyFormat:this.config.defaultCurrencyFormat}}checkDispatchAllowed(e){const t=wo(e)?this.checkDispatchAllowedCoreCommand(e):this.checkDispatchAllowedLocalCommand(e);return t.some((e=>"Success"!==e))?new yo(t.flat()):yo.Success}checkDispatchAllowedCoreCommand(e){const t=this.corePlugins.map((t=>t.allowDispatch(e)));return t.push(this.range.allowDispatch(e)),t}checkDispatchAllowedLocalCommand(e){return this.uiHandlers.map((t=>t.allowDispatch(e)))}finalize(){this.status=3;for(const e of this.handlers)e.finalize();this.status=0}canDispatch=(e,t)=>this.checkDispatchAllowed(MT(e,t));dispatch=(e,t)=>{const o=MT(e,t);let s=this.status;if(this.getters.isReadonly()&&(n=o,!Co.has(n.type)))return new yo("Readonly");var n;if(!this.session.canApplyOptimisticUpdate())return new yo("WaitingSessionConfirmation");switch(s){case 0:const t=this.checkDispatchAllowed(o);if(!t.isSuccessful)return t;this.status=1;const{changes:s,commands:n}=this.state.recordChanges((()=>{wo(o)&&this.state.addCommand(o),this.dispatchToHandlers(this.handlers,o),this.finalize()}));this.session.save(o,n,s),this.status=0,this.trigger("update");break;case 1:if(wo(o)){const e=this.checkDispatchAllowed(o);if(!e.isSuccessful)return e;this.state.addCommand(o)}this.dispatchToHandlers(this.handlers,o);break;case 3:throw new Error("Cannot dispatch commands in the finalize state");case 2:if(wo(o))throw new Error(`A UI plugin cannot dispatch ${e} while handling a core command`);this.dispatchToHandlers(this.handlers,o)}return yo.Success};dispatchFromCorePlugin=(e,t)=>{const o=MT(e,t),s=this.status;this.status=2;const n=this.isReplayingCommand?this.coreHandlers:this.handlers;return this.dispatchToHandlers(n,o),this.status=s,yo.Success};dispatchToHandlers(e,t){const o=wo(t);for(const s of e)!o&&s instanceof Uy||s.beforeHandle(t);for(const s of e)!o&&s instanceof Uy||s.handle(t)}drawGrid(e){for(let[t,o]of this.renderers)e.ctx.save(),t.drawGrid(e,o),e.ctx.restore()}exportData(){let e=Py();for(let t of this.handlers)t instanceof Uy&&t.export(e);return e.revisionId=this.session.getRevisionId()||ce,e=Te(e),e}updateMode(e){"normal"!==e&&this.dispatch("CANCEL_EDITION"),this.config.mode=e,this.trigger("update")}exportXLSX(){this.dispatch("EVALUATE_CELLS");let e={...Py(),sheets:[ky(Oy,"Sheet1")]};for(let t of this.handlers)t instanceof Vy&&t.exportForExcel(e);return e=Te(e),AT(e)}garbageCollectExternalResources(){for(const e of this.corePlugins)e.garbageCollectExternalResources()}},e.Registry=Hi,e.Revision=EI,e.SPREADSHEET_DIMENSIONS=FT,e.Spreadsheet=AR,e.UIPlugin=Tx,e.__info__=NT,e.addFunction=function e(t,o){return Tf.add(t,o),{addFunction:(t,o)=>e(t,o)}},e.astToFormula=ix,e.compile=ux,e.compileTokens=gx,e.components=kT,e.constants=UT,e.convertAstNodes=tx,e.coreTypes=Eo,e.findCellInNewZone=Mn,e.functionCache=dx,e.helpers=LT,e.hooks=VT,e.invalidateCFEvaluationCommands=So,e.invalidateDependenciesCommands=vo,e.invalidateEvaluationCommands=bo,e.iterateAstNodes=ox,e.links=PT,e.load=_y,e.parse=Jy,e.parseTokens=ex,e.readonlyAllowedCommands=Co,e.registries=DT,e.setDefaultSheetViewSize=function(e){Ee=e},e.setTranslationMethod=function(e,t=(()=>!0)){n=e,i=t},e.tokenize=qr,NT.version="17.0.30",NT.date="2024-07-11T06:34:04.932Z",NT.hash="a8eacf4"}(this.o_spreadsheet=this.o_spreadsheet||{},owl);
@@ -1,9 +1,9 @@
1
1
  <!--
2
2
  This file is generated by o-spreadsheet build tools. Do not edit it.
3
3
  @see https://github.com/odoo/o-spreadsheet
4
- @version 17.0.29
5
- @date 2024-07-08T05:41:01.898Z
6
- @hash 2d467e3
4
+ @version 17.0.30
5
+ @date 2024-07-11T06:34:37.876Z
6
+ @hash a8eacf4
7
7
  -->
8
8
  <odoo>
9
9
  <t t-name="o-spreadsheet-ActionButton">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@odoo/o-spreadsheet",
3
- "version": "17.0.29",
3
+ "version": "17.0.30",
4
4
  "description": "A spreadsheet component",
5
5
  "type": "module",
6
6
  "main": "dist/o-spreadsheet.cjs.js",